News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

new to coding and need a little bit of help

Started by BigGunn, January 08, 2006, 06:50:44 PM

Previous topic - Next topic

BigGunn

I'm altering a mod that I installed to make it so that global mods can see all hidden posts without replying. I have it set so admins can, and i added a bit of code that worked to make it so that moderators can see the hidden content without replying if it's posted in the forum they moderate.

Here's the original code before I changed it at all:

// Find if there a post from you in this thread :) (For the hide tag)
if ($user_info['is_admin'] && !empty($modSettings['hide_adminshouldsee']))
$context['user_post_avaible'] = 1;
elseif (!$user_info['is_guest']) {
$request = db_query("
SELECT ID_MSG, ID_MEMBER
FROM {$db_prefix}messages
WHERE ID_TOPIC = $topic AND ID_MEMBER = $ID_MEMBER
LIMIT 1", __FILE__, __LINE__);

if (mysql_num_rows($request)) $context['user_post_avaible'] = 1;
else $context['user_post_avaible'] = 0;
mysql_free_result($request);
}
else $context['user_post_avaible'] = 0; //Anyway no way you should see it!


I've since changed it to this:

// Find if there a post from you in this thread :) (For the hide tag)
if ($user_info['is_admin'] && !empty($modSettings['hide_adminshouldsee']))
$context['user_post_avaible'] = 1;
elseif ($user_info['is_gmod'] && !empty($modSettings['hide_adminshouldsee']))
$context['user_post_avaible'] = 1;
elseif ($user_info['is_mod'] && !empty($modSettings['hide_adminshouldsee']))
$context['user_post_avaible'] = 1;
elseif (!$user_info['is_guest']) {
$request = db_query("
SELECT ID_MSG, ID_MEMBER
FROM {$db_prefix}messages
WHERE ID_TOPIC = $topic AND ID_MEMBER = $ID_MEMBER
LIMIT 1", __FILE__, __LINE__);

if (mysql_num_rows($request)) $context['user_post_avaible'] = 1;
else $context['user_post_avaible'] = 0;
mysql_free_result($request);
}
else $context['user_post_avaible'] = 0; //Anyway no way you should see it!


Any help would be greatly appreciated.


Advertisement: