Compare commits
1 Commits
main
...
ingore-in-
| Author | SHA1 | Date | |
|---|---|---|---|
| cdeed1b70a |
@@ -39,6 +39,9 @@ $cookiename = 'SMFCookie10'; # Name of the cookie to set for authentication.
|
||||
$memcached_host = 'memcached';
|
||||
$memcached_port = 11211;
|
||||
|
||||
$redis_host = 'valkey';
|
||||
$redis_port = 6379;
|
||||
|
||||
$recaptcha_secret = '6LfbSRUUAAAAAM4goUyXz9gB21cfIHL0ZhiQ6doM';
|
||||
$recaptcha_site_key = '6LfbSRUUAAAAAN1TtRVmVsHw8NKWe5w50fzjyK3U';
|
||||
########## Database Info ##########
|
||||
|
||||
@@ -8,7 +8,7 @@ if (!defined('SMF'))
|
||||
|
||||
function ignore()
|
||||
{
|
||||
global $topic, $txt, $db_prefix, $context, $scripturl, $sourcedir, $ID_MEMBER, $mongodb;
|
||||
global $topic, $txt, $db_prefix, $context, $scripturl, $sourcedir, $ID_MEMBER, $redis;
|
||||
|
||||
// We need at least a topic... go away if you don't have one.
|
||||
if (empty($topic))
|
||||
@@ -19,17 +19,14 @@ function ignore()
|
||||
$ignoree_id = $_GET['member'];
|
||||
$msg = $_GET['msg'];
|
||||
if ($ID_MEMBER > 0 && $ignoree_id > 0)
|
||||
$mongodb->rock->ignorelists->update(
|
||||
array ('user' => (int) $ID_MEMBER),
|
||||
array ('$addToSet' => array ('ignores' => $ignoree_id)),
|
||||
array ('upsert' => true));
|
||||
$redis->sadd("ignore:${ID_MEMBER}", $ignoree_id);
|
||||
// Back to the topic!
|
||||
redirectexit('topic=' . $topic . '.msg'.$msg."#msg".$msg);
|
||||
}
|
||||
|
||||
function unignore()
|
||||
{
|
||||
global $topic, $txt, $db_prefix, $context, $scripturl, $sourcedir, $ID_MEMBER, $mongodb;
|
||||
global $topic, $txt, $db_prefix, $context, $scripturl, $sourcedir, $ID_MEMBER, $redis;
|
||||
|
||||
// We need at least a topic... go away if you don't have one.
|
||||
if (empty($topic))
|
||||
@@ -40,9 +37,7 @@ function unignore()
|
||||
$ignoree_id = $_GET['member'];
|
||||
$msg = $_GET['msg'];
|
||||
if ($ID_MEMBER > 0 && $ignoree_id > 0)
|
||||
$mongodb->rock->ignorelists->update(
|
||||
array ('user' => (int) $ID_MEMBER),
|
||||
array ('$pull' => array ('ignores' => $ignoree_id)));
|
||||
$redis->sadd("ignore:${ID_MEMBER}", $ignoree_id);
|
||||
|
||||
// Back to the topic!
|
||||
redirectexit('topic=' . $topic . '.msg'.$msg."#msg".$msg);
|
||||
|
||||
@@ -78,6 +78,9 @@ if (!$db_connection || !@mysql_select_db($db_name, $db_connection))
|
||||
$memcached = new Memcached();
|
||||
$memcached->addServer($memcached_host, $memcached_port);
|
||||
|
||||
$redis = new Redis();
|
||||
$redis->connect($redis_host, $redis_port);
|
||||
|
||||
//
|
||||
mysql_query("SET NAMES 'utf8'");
|
||||
mysql_query("set SESSION sql_mode='STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'");
|
||||
|
||||
Reference in New Issue
Block a user