News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Visual Warning Mod

Started by xenovanis, November 06, 2005, 01:39:15 AM

Previous topic - Next topic

DemonicInfluence


CHwebby

ok thanx. I looked and I have no clue to what I should be modifying in this. Isn't this file for package manager installation? I'm manually installing the mod. Too advanced for me here I guess.

DemonicInfluence

Search in there for an add replace or something like that..

CHwebby

I see a lot of <add> tags here is the doc. itself

Quote<?xml version="1.0"?>
<!DOCTYPE modification SYSTEM "http://www.simplemachines.org/xml/modification">
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
   ATTENTION: If you are trying to install this manually, you should try
   the package manager.  If it will not work for you, please take a look
   at the following for information on this format:
      http://mods.simplemachines.org/docs/manual-install.php

        Modifications use this general format...
        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        <file name="$sourcedir/filename.php">
          <operation>
             <search position="after"><![CDATA[ ]]></search>
             <add><![CDATA[ ]]></add>
          </operation>
        </file>

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->

<modification xmlns="http://www.simplemachines.org/xml/modification" xmlns:smf="http://www.simplemachines.org/">
       <id>Grudge:VisualWarning</id>
       <version>1.27</version>

       <file name="$boarddir/index.php">
          <operation>
             <search position="before"><![CDATA[      'viewquery' => array('ViewQuery.php', 'ViewQuery'),
]]></search>
             <add><![CDATA[      'warnadd' => array('VisualWarning.php', 'AddWarning'),
      'warnadd2' => array('VisualWarning.php', 'AddWarning2'),
      'warnlist' => array('VisualWarning.php', 'ListWarnings'),
      'warnlist2' => array('VisualWarning.php', 'ListWarnings2'),
      'warnpmman' => array('VisualWarning.php', 'Manager'),
      'warnpmman2' => array('VisualWarning.php', 'Manager2'),
]]></add>
          </operation>
         
           <operation>
             <search position="before"><![CDATA[      // Log this user as online.
      writeLog();

]]></search>
             <add><![CDATA[      // Check if time to run visual warning update
      if ($modSettings['autoWarningTime'] < time())
         autoWarn();

]]></add>
          </operation>
        </file>
       
        <file name="$sourcedir/ModSettings.php">
          <operation>
             <search position="before"><![CDATA[         array('text', 'karmaSmiteLabel'),
]]></search>
             <add><![CDATA[      array('heading', &$txt['visual_warning_mod']),
         array('text', 'visualw_mess_ban'),
         array('text', 'visualw_mess_mute'),
         array('text', 'visualw_mess_pmod'),
         array('text', 'visualw_mess_warn'),
      array('rule'),
         array('text', 'visualw_color_ban'),
         array('text', 'visualw_color_mute'),
         array('text', 'visualw_color_pmod'),
         array('text', 'visualw_color_warn'),
      array('rule'),
         array('text', 'visualw_image_ban'),
         array('text', 'visualw_image_mute'),
         array('text', 'visualw_image_pmod'),
         array('text', 'visualw_image_warn'),
      array('rule'),
         array('text', 'muteAutoTime'),
         array('text', 'moderationAutoTime'),
         array('text', 'warningAutoTime'),
      array('rule'),
         array('check', 'visualw_pmod_edit'),
]]></add>
           </operation>
        </file>
       
        <file name="$themedir/Profile.template.php">
          <operation>
             <search position="after"><![CDATA[               <td colspan="2"><hr size="1" width="100%" class="hrcolor" /></td>
            </tr><tr>
               <td><b>', $txt[231], ': </b></td>
               <td>', $context['member']['gender']['name'], '</td>
]]></search>
             <add><![CDATA[';
if ($context['member']['warning']['link'] != '')
echo'
               <td><b>' . $txt['visual_current_level'] . ' </b></td>
               <td>' . $context['member']['warning']['link'] . '</td>
            </tr><tr>
';
echo'
]]></add>
          </operation>
        </file>
       
        <file name="$sourcedir/Display.php">
          <operation>
             <search position="before"><![CDATA[   $context['can_reply'] &= empty($topicinfo['locked']) || allowedTo('moderate_board');
]]></search>
             <add><![CDATA[$context['can_warn'] = allowedTo('visual_warn_any');
]]></add>
           </operation>
        </file>
       
        <file name="$themedir/Display.template.php">
          <operation>
             <search position="before"><![CDATA[      if ($message['can_remove'])
         echo '
                           <a href="', $scripturl, '?action=deletemsg;topic=', $context['current_topic'], '.', $context['start'], ';msg=', $message['id'], ';sesc=', $context['session_id'], '" onclick="return confirm(\'', $txt[154], '?\');">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/delete.gif" alt="' . $txt[121] . '" border="0" />' : $txt[31]), '</a>';
]]></search>
             <add><![CDATA[   if ($context['can_warn'])
         echo '
                           <a href="', $scripturl, '?action=warnadd;topic=', $context['current_topic'], ';start=', $context['start'], ';user=', $message['member']['id'], ';msg=', $message['id'], '">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/im_visualw.gif" alt="' . $txt['visual_raise'] . '" border="0" />' : $txt['visual_warn']), '</a>';

]]></add>
          </operation>
         
          <operation>
             <search position="before"><![CDATA[      if (isset($message['member']['group']) && $message['member']['group'] != '')
         echo '
                        ', $message['member']['group'], '<br />';
]]></search>
             <add><![CDATA[      if (isset($message['member']['warning']['link']) && $message['member']['warning']['link'] != '')
         echo'
                        ', $message['member']['warning']['link'];
]]></add>
           </operation>
        </file>
       
        <file name="$sourcedir/Post.php">
          <operation>
             <search position="before"><![CDATA[   $context['show_spellchecking'] = $modSettings['enableSpellChecking'] && function_exists('pspell_new');
]]></search>
             <add><![CDATA[   if ($user_info['warning'] > 2)
      fatal_error($txt['visual_been_muted']);
   if ($user_info['warning'] == 2)
      $context['warning'] = 1;
]]></add>
          </operation>
            <operation>
           
                <search position="after"><![CDATA[  global $ID_MEMBER, $user_info, $board_info, $options;
]]></search>
                <add><![CDATA[  global $scripturl, $threadid;
]]></add>
            </operation>
           
          <operation>
             <search position="before"><![CDATA[   require_once($sourcedir . '/Subs-Post.php');
   loadLanguage('Post');

]]></search>
             <add><![CDATA[   if ($user_info['warning'] > 2)
      fatal_error($txt['visual_been_muted']);
]]></add>
          </operation>

           <operation>
             <search position="before"><![CDATA[         $msgOptions['modify_time'] = time();
         $msgOptions['modify_name'] = addslashes($user_info['name']);
      }

      modifyPost($msgOptions, $topicOptions, $posterOptions);
   }
]]></search>
             <add><![CDATA[   // This is a new post, not an admin, user's posts are moderated - save it.
   elseif(!isset($_REQUEST['msg']) && !$user_info['is_admin'] && $user_info['warning'] == 2){
      $idtostore = $topic == null ? -1 : $topic;
      $request = db_query("
            INSERT INTO {$db_prefix}postmoderation
            (ID_MEMBER, ID_TOPIC, ID_BOARD, subject, posterName,
            posterEmail, posterTime, posterIP, body, icon,smiliesEnabled, ID_POLL)
            VALUES ($ID_MEMBER, '$idtostore', '$board', '$_POST[subject]',
            '$_POST[guestname]', '$_POST[email]', " . time() . ", '$_SERVER[REMOTE_ADDR]',
            '$_POST[message]','$_POST[icon]', " . (isset($_POST['ns']) ? '0' : '1') . ", $ID_POLL)", __FILE__, __LINE__);
      if ($options['return_to_post'] == '1' && $topic != '')
         redirectexit("$scripturl?topic=$threadid;start=new");
      else
         redirectexit("$scripturl?board=$board");
   }
]]></add>
          </operation>
         
          <operation>
             <search position="before"><![CDATA[   // Editing a message...
   elseif (isset($_REQUEST['msg']))
   {
      checkSession('get');
]]></search>
             <add><![CDATA[      // Check user has no warnings on this message
      if ($user_info['warning'] > 1 && empty($modSettings['visualw_pmod_edit']))
         fatal_error($txt['visual_perm_modify']);
      if ($user_info['warning'] > 0){
         $request = db_query("
            SELECT warningText
            FROM {$db_prefix}vwarnings
            WHERE memberID=$ID_MEMBER
               AND messageID=$_REQUEST[msg] LIMIT 1", __FILE__, __LINE__);
         if (mysql_fetch_assoc($request))
            fatal_error($txt['visual_perm_modify']);
      }
]]></add>
          </operation>
         
          <operation>
             <search position="before"><![CDATA[   if (isset($_REQUEST['msg']) && !empty($topic))
   {
      $_REQUEST['msg'] = (int) $_REQUEST['msg'];
]]></search>
             <add><![CDATA[      // Check user has no warnings on this message
      if ($user_info['warning'] > 1 && empty($modSettings['visualw_pmod_edit']))
         fatal_error($txt['visual_perm_modify']);
      if ($user_info['warning'] > 0){
         $request = db_query("
            SELECT warningText
            FROM {$db_prefix}vwarnings
            WHERE memberID=$ID_MEMBER
               AND messageID=$_REQUEST[msg] LIMIT 1", __FILE__, __LINE__);
         if (mysql_fetch_assoc($request))
            fatal_error($txt['visual_perm_modify']);
      }
]]></add>
          </operation>
         
          <operation>
             <search position="before"><![CDATA[      // Permissions check!
      isAllowedTo('calendar_post');
]]></search>
             <add><![CDATA[      // warning
      if ($user_info['warning'] > 1)
         fatal_error($txt['visual_postmod_auth']);
]]></add>
          </operation>
        </file>
       
        <file name="$themedir/Post.template.php">
          <operation>
             <search position="replace"><![CDATA[   if ($context['can_post_attachment'])
]]></search>
             <add><![CDATA[   if (isset($context['warning']))
   echo'
      <tr>
         <td align="center" colspan="2">
            <font size="2">' . $txt['visual_postmod_appear'] . '</font>
         </td>
      </tr>';
   elseif ($context['can_post_attachment'])
]]></add>
           </operation>
        </file>
       
        <file name="$sourcedir/Karma.php">
          <operation>
             <search position="before"><![CDATA[   // If you're a guest or can't do this, blow you off...
   is_not_guest();
]]></search>
             <add><![CDATA[   // If you have ANY warning, also blow you off
   if ($user_info['warning'] > 1)
      fatal_error($txt['visual_no_karma']);
]]></add>
           </operation>
        </file>

        <file name="$sourcedir/ManagePermissions.php">
          <operation>
             <search position="before"><![CDATA[   'profile' => array(
            'profile_view' => true,
            'profile_identity' => true,
            'profile_extra' => true,
            'profile_title' => true,
            'profile_remove' => true,
            'profile_server_avatar' => false,
            'profile_upload_avatar' => false,
            'profile_remote_avatar' => false,
         )
]]></search>
             <add><![CDATA[         ,
         'visual_warn' => array(
            'visual_warn_any' => false,
            'visual_approve_any' => false,
         )
]]></add>
           </operation>
        </file>

        <file name="$sourcedir/Subs.php">
          <operation>
             <search position="replace"><![CDATA[      if (allowedTo('moderate_forum'))
         $context['admin_areas']['members']['areas']['view_members'] = '<a href="' . $scripturl . '?action=viewmembers">' . $txt[5] . '</a>';
]]></search>
             <add><![CDATA[      if (allowedTo('moderate_forum'))
      {
         $context['admin_areas']['members']['areas']['view_members'] = '<a href="' . $scripturl . '?action=viewmembers">' . $txt[5] . '</a>';
         $context['admin_areas']['members']['areas']['warning_manager'] = '<a href="' . $scripturl . '?action=warnlist">' . $txt['visual_warning_management'] . '</a>';
         $context['admin_areas']['members']['areas']['postmod_manager'] = '<a href="' . $scripturl . '?action=warnpmman">' . $txt['visual_postmod_manager'] . '</a>';
      }
]]></add>
          </operation>
         
          <operation>
             <search position="before"><![CDATA[      $context['user']['unread_messages'] = &$user_info['unread_messages'];
]]></search>
             <add><![CDATA[      if (allowedTo('visual_approve_any'))
      {
         $result = db_query("
               SELECT COUNT(*)
               FROM {$db_prefix}postmoderation", __FILE__, __LINE__);
         list($modmsg) = mysql_fetch_row($result);
         if ($modmsg)
            $context['user']['awaiting_mod'] = $modmsg . ' ' . $txt['visual_require_mod'];
      }
]]></add>
          </operation>
         
          <operation>
             <search position="before"><![CDATA[function setupThemeContext()
{
   global $modSettings, $user_info, $scripturl, $context, $settings, $options, $txt, $maintenance;
]]></search>
             <add><![CDATA[   global $db_prefix; // Grudge's Mod
]]></add>
           </operation>
        </file>
       
        <file name="$sourcedir/Security.php">
          <operation>
             <search position="after"><![CDATA[// Do banning related stuff.  (ie. disallow access....)
function is_not_banned($forceCheck = false)
]]></search>
             <add><![CDATA[function autoWarn()
{
   global $txt, $db_prefix, $modSettings, $sourcedir;

   loadLanguage('InstantMessage');

   // Only check warning levels once every blue moon
   updateSettings(array('autoWarningTime' => time() + 86400));
   $request = db_query("
         SELECT ID, memberID, timeToWarn, time, level
         FROM {$db_prefix}vwarnings WHERE level < 4 AND level > 0", __FILE__, __LINE__);
   include_once($sourcedir . '/Subs-Post.php');
   while ($row = mysql_fetch_assoc($request)){
      $IM=0;
      if($row['timeToWarn'] == -1){
         // Check if time is expired
         if ($row['level'] == 1)
            $timeinc = $modSettings['warningAutoTime']*86400;
         elseif ($row['level'] == 2)
            $timeinc = $modSettings['moderationAutoTime']*86400;
         else
            $timeinc = $modSettings['muteAutoTime']*86400;
      }
      else
         $timeinc = $row['timeToWarn']*86400;
      if(time() > $row['time'] + $timeinc){
         db_query("
            UPDATE {$db_prefix}vwarnings
            SET level = level - 1, time = " . time() . "
            WHERE ID=$row[ID]", __FILE__, __LINE__);
         db_query("
            UPDATE {$db_prefix}members
            SET warning=warning - 1
            WHERE ID_MEMBER=$row[memberID]",__FILE__, __LINE__);
         $IM=1;
      }
      if ($IM==1){
         $result = db_query("
               SELECT memberName, ID_MEMBER, emailAddress
               FROM {$db_prefix}members
               WHERE ID_MEMBER=$row[memberID]", __FILE__, __LINE__);
         list($nameTo, $toID, $emailTo) = mysql_fetch_row($result);
         $result = db_query("
            SELECT ID_MEMBER, realName, memberName FROM {$db_prefix}members
            WHERE ID_GROUP=1 LIMIT 1", __FILE__, __LINE__);
         $fromInfo = mysql_fetch_row($result);
         $from = array(
            'id' => $fromInfo[0],
            'name' => $fromInfo[1],
            'username' => $fromInfo[2],
         );
         $immessage = $nameTo . "\n\n" . $txt['visual_warning_reduced'];
         sendpm($toID, null, $txt['visual_reduced'], $immessage, $from);
      }
   }
}
]]></add>
           </operation>
        </file>

<file name="$languagedir/Modifications.dutch.php">
          <operation>
             <search position="after"><![CDATA[?>
]]></search>
             <add><![CDATA[$txt['visual_warning_mod']='Visual Warning Mod';
$txt['visualw_mess_ban']='Bericht voor gebande gebruiker';
$txt['visualw_mess_mute']='Bericht voor verstomde gebruiker';
$txt['visualw_mess_pmod']='Bericht voor gebruiker onder postmoderatie';
$txt['visualw_mess_warn']='Bericht voor gewaarschuwde gebruiker';
$txt['visualw_color_ban']='Color of Message For Banned User';
$txt['visualw_color_mute']='Color of Message For Muted User';
$txt['visualw_color_pmod']='Color of Message For Post Moderated User';
$txt['visualw_color_warn']='Color of Message For Warned User';
$txt['visualw_image_ban']='Image to Show For Banned User';
$txt['visualw_image_mute']='Image to Show For Muted User';
$txt['visualw_image_pmod']='Image to Show For Post Moderated User';
$txt['visualw_image_warn']='Image to Show For Warned User';
$txt['warningAutoTime']='Default Time Before Warning Removed (Days):';
$txt['moderationAutoTime']='Default Time Before Moderation Removed (Days):';
$txt['muteAutoTime']='Default Time Before Mute Removed (Days):';
$txt['visualw_pmod_edit']='Moderated Users May Edit Messages:';
$txt['visual_require_mod'] = 'messages require moderation';
$txt['visual_raise']='Raise Warning Level';
$txt['visual_no_perm']='You Do Not Have Permission To Raise Warning Levels';
$txt['visual_no_warnings']='User has NO Current Warnings!';
$txt['visual_prev_warning']='Previous Warning Details';
$txt['visual_current_level']='Current Level:';
$txt['visual_topic_raised']='Topic Where Raised:';
$txt['visual_time_raised']='Time When Raised:';
$txt['visual_reason_raised']='Reason For Raise:';
$txt['visual_level_details']='New Level Details';
$txt['visual_submit']='Submit';
$txt['visual_new_level']='New Level:';
$txt['visual_warning_management']='Warning Management';
$txt['visual_list_desc']='This lists all users that currently have some form of warning (levels 1,2 or 3. Level 4 is not listed as these members have already been banned! You can choose to mass reduce members here or click the member to adjust level accordingly';
$txt['visual_member']='Member';
$txt['visual_level']='Level';
$txt['visual_reason']='Reason';
$txt['visual_when']='When';
$txt['visual_text_warn']='Warned';
$txt['visual_warn']='Warn';
$txt['visual_perm_modify']='You Do Not Have Permission To Modify This Message';
$txt['visual_official_warning']='You Have Received an Offical Warning';
$txt['visual_received_warning']='You have received a warning for recent conduct on our message board. Please follow the link below for more information:';
$txt['visual_been_muted']='You Have Been Muted Due To Bad Behaviour';
$txt['visual_no_karma']='You May Not Give Karma Whilst Warned';
$txt['visual_stages']='(0=None, 1=Warned, 2=Moderated, 3=Muted. 4=Banned)';
$txt['visual_text_pmod']='Moderated';
$txt['visual_text_mute']='Muted';
$txt['visual_text_ban']='Banned';
$txt['visual_none']='None';
$txt['visual_warning_increased']='I have to inform you that your warning level on the board has been increased.';
$txt['visual_warning_reduced']='I am pleased to announce that your warning level on the board has been reduced.';
$txt['visual_reduced']='Warning level reduced';
$txt['visual_lasts']='Time Warning Lasts (Blank=Default)';
$txt['visual_postmod_manager']='Post Moderation Manager';
$txt['visual_postmod_user_under']='This User Is Currently Having All Theirs Posts Approved Before Posting';
$txt['visual_postmod_under']='You Are Currently Under Post Moderation';
$txt['visual_postmod_not']='This User Is Not Post Moderated';
$txt['visual_postmod_is']='This User Is Post Moderated';
$txt['visual_postmod_change']='Change This User\'s Status';
$txt['visual_postmod']='Post Moderation';
$txt['visual_postmod_auth']='You are not authorised to perform this action!';
$txt['visual_postmod_appear']='You Are Currently Under Post Moderation - Your Post Will Appear After Approval';
$txt['visual_postmod_awaiting']='These are all the posts awaiting moderation. To approve a posts (or posts) check all the messages you wish to approve and select "Approve" to delete messages off select those messages you wish to delete and select "Delete"';
$txt['visual_postmod_username']='Username';
$txt['visual_postmod_subject']='Subject/Message';
$txt['visual_postmod_approve']='Approve';
$txt['visual_postmod_delete']='Delete';
$txt['permissiongroup_visual_warn']='Give warnings and perform post moderation';
$txt['permissionname_visual_warn_any']='Warn users';
$txt['permissionname_visual_approve_any']='Approve posts';
]]></add>
           </operation>
        </file>
       
        <file name="$languagedir/Modifications.english.php">
          <operation>
             <search position="after"><![CDATA[?>
]]></search>
             <add><![CDATA[$txt['visual_warning_mod']='Visual Warning Mod';
$txt['visualw_mess_ban']='Message To Show For Banned User';
$txt['visualw_mess_mute']='Message To Show For Muted User';
$txt['visualw_mess_pmod']='Message To Show For Post Moderated User';
$txt['visualw_mess_warn']='Message To Show For Warned User';
$txt['visualw_color_ban']='Color of Message For Banned User';
$txt['visualw_color_mute']='Color of Message For Muted User';
$txt['visualw_color_pmod']='Color of Message For Post Moderated User';
$txt['visualw_color_warn']='Color of Message For Warned User';
$txt['visualw_image_ban']='Image to Show For Banned User';
$txt['visualw_image_mute']='Image to Show For Muted User';
$txt['visualw_image_pmod']='Image to Show For Post Moderated User';
$txt['visualw_image_warn']='Image to Show For Warned User';
$txt['warningAutoTime']='Default Time Before Warning Removed (Days):';
$txt['moderationAutoTime']='Default Time Before Moderation Removed (Days):';
$txt['muteAutoTime']='Default Time Before Mute Removed (Days):';
$txt['visualw_pmod_edit']='Moderated Users May Edit Messages:';
$txt['visual_require_mod'] = 'messages require moderation';
$txt['visual_raise']='Raise Warning Level';
$txt['visual_no_perm']='You Do Not Have Permission To Raise Warning Levels';
$txt['visual_no_warnings']='User has NO Current Warnings!';
$txt['visual_prev_warning']='Previous Warning Details';
$txt['visual_current_level']='Current Level:';
$txt['visual_topic_raised']='Topic Where Raised:';
$txt['visual_time_raised']='Time When Raised:';
$txt['visual_reason_raised']='Reason For Raise:';
$txt['visual_level_details']='New Level Details';
$txt['visual_submit']='Submit';
$txt['visual_new_level']='New Level:';
$txt['visual_warning_management']='Warning Management';
$txt['visual_list_desc']='This lists all users that currently have some form of warning (levels 1,2 or 3. Level 4 is not listed as these members have already been banned! You can choose to mass reduce members here or click the member to adjust level accordingly';
$txt['visual_member']='Member';
$txt['visual_level']='Level';
$txt['visual_reason']='Reason';
$txt['visual_when']='When';
$txt['visual_text_warn']='Warned';
$txt['visual_warn']='Warn';
$txt['visual_perm_modify']='You Do Not Have Permission To Modify This Message';
$txt['visual_official_warning']='You Have Received an Offical Warning';
$txt['visual_received_warning']='You have received a warning for recent conduct on our message board. Please follow the link below for more information:';
$txt['visual_been_muted']='You Have Been Muted Due To Bad Behaviour';
$txt['visual_no_karma']='You May Not Give Karma Whilst Warned';
$txt['visual_stages']='(0=None, 1=Warned, 2=Moderated, 3=Muted. 4=Banned)';
$txt['visual_text_pmod']='Moderated';
$txt['visual_text_mute']='Muted';
$txt['visual_text_ban']='Banned';
$txt['visual_none']='None';
$txt['visual_warning_increased']='I have to inform you that your warning level on the board has been increased.';
$txt['visual_warning_reduced']='I am pleased to announce that your warning level on the board has been reduced.';
$txt['visual_reduced']='Warning level reduced';
$txt['visual_lasts']='Time Warning Lasts (Blank=Default)';
$txt['visual_postmod_manager']='Post Moderation Manager';
$txt['visual_postmod_user_under']='This User Is Currently Having All Theirs Posts Approved Before Posting';
$txt['visual_postmod_under']='You Are Currently Under Post Moderation';
$txt['visual_postmod_not']='This User Is Not Post Moderated';
$txt['visual_postmod_is']='This User Is Post Moderated';
$txt['visual_postmod_change']='Change This User\'s Status';
$txt['visual_postmod']='Post Moderation';
$txt['visual_postmod_auth']='You are not authorised to perform this action!';
$txt['visual_postmod_appear']='You Are Currently Under Post Moderation - Your Post Will Appear After Approval';
$txt['visual_postmod_awaiting']='These are all the posts awaiting moderation. To approve a posts (or posts) check all the messages you wish to approve and select "Approve" to delete messages off select those messages you wish to delete and select "Delete"';
$txt['visual_postmod_username']='Username';
$txt['visual_postmod_subject']='Subject/Message';
$txt['visual_postmod_approve']='Approve';
$txt['visual_postmod_delete']='Delete';
$txt['permissiongroup_visual_warn']='Give warnings and perform post moderation';
$txt['permissionname_visual_warn_any']='Warn users';
$txt['permissionname_visual_approve_any']='Approve posts';
]]></add>
           </operation>
        </file>


        <file name="$themedir/index.template.php">
          <operation>
             <search position="before"><![CDATA[      // Is the forum in maintenance mode?
      if ($context['in_maintenance'] && $context['user']['is_admin'])
         echo '
                     <b>', $txt[616], '</b><br />';
]]></search>
             <add><![CDATA[      if (isset($context['user']['awaiting_mod']))
         echo '<br />' . $context['user']['awaiting_mod'];

]]></add>
           </operation>
        </file>
       
        <file name="$sourcedir/Load.php">
          <operation>
             <search position="before"><![CDATA[         mem.birthdate, mem.memberIP, mem.ICQ, mem.AIM, mem.YIM, mem.MSN, mem.posts, mem.lastLogin,
]]></search>
             <add><![CDATA[         mem.warning, " . "
]]></add>
          </operation>
         
          <operation>
             <search position="before"><![CDATA[         mem.karmaBad, mem.memberIP, mem.lngfile, mem.ID_GROUP, mem.ID_THEME, mem.buddy_list, mem.pm_ignore_list,
]]></search>
             <add><![CDATA[         mem.warning, " . "" . "
]]></add>
          </operation>
         
          <operation>
             <search position="before"><![CDATA[      'email' => isset($user_settings['emailAddress']) ? $user_settings['emailAddress'] : '',
]]></search>
             <add><![CDATA[      'warning' => isset($user_settings['warning']) ? $user_settings['warning'] : 0,
]]></add>
          </operation>
         
          <operation>
             <search position="after"><![CDATA[      'aim' => $profile['AIM'] != '' && (empty($modSettings['guest_hideContacts']) || !$user_info['is_guest']) ? array(
]]></search>
             <add><![CDATA[      'warning' => $profile['warning'] > 0 ? array(
         'link' => ($modsettings['visualw_image_' . $warn] != "" ? '<img src="' . $settings['images_url'] . '/' . $modsettings['visualw_image_' . $warn] . '"/>' : '') .
         ($modsettings['visualw_color_' . $warn] != "" ? '<font size="2" color="' . $modsettings['visualw_color_' . $warn] . '">
          ' . $txt['visual_text_' . $warn] . '</font>' : '') . '<br />',
      ) : array('link' => ''),
]]></add>
          </operation>
         
          <operation>
             <search position="before"><![CDATA[   $profile['signature'] = parse_bbc($profile['signature'], true, 'sig' . $profile['ID_MEMBER']);
]]></search>
             <add><![CDATA[   if ($profile['warning'] == 1)
      $warn = 'warn';
   elseif ($profile['warning'] == 2)
      $warn = 'pmod';
   elseif ($profile['warning'] == 3)
      $warn = 'mute';
   elseif ($profile['warning'] == 4)
      $warn = 'ban';
]]></add>
          </operation>
        </file>
</modification>

DemonicInfluence

Quote from: DemonicInfluence on April 10, 2006, 03:40:23 PM
okay. In the package it either has a boardmod.xml or install.xml or something like that.. In it, it has loks to add after/before/replace.. If it is something that has tags like this:;
<add after>

Then just do using common sense..

If it is something like this:

<search position=after>
After means to add before. ANd before is to add after.. Replace same..

Hope it helped..

<file name="$boarddir/index.php">
          <operation>
             <search position="before"><![CDATA[      'viewquery' => array('ViewQuery.php', 'ViewQuery'),
]]></search>
             <add><![CDATA[      'warnadd' => array('VisualWarning.php', 'AddWarning'),
      'warnadd2' => array('VisualWarning.php', 'AddWarning2'),
      'warnlist' => array('VisualWarning.php', 'ListWarnings'),
      'warnlist2' => array('VisualWarning.php', 'ListWarnings2'),
      'warnpmman' => array('VisualWarning.php', 'Manager'),
      'warnpmman2' => array('VisualWarning.php', 'Manager2'),
]]></add>
          </operation>
         
           <operation>
             <search position="before"><![CDATA[      // Log this user as online.
      writeLog();

]]></search>
             <add><![CDATA[      // Check if time to run visual warning update
      if ($modSettings['autoWarningTime'] < time())
         autoWarn();

]]></add>
          </operation>
        </file>
     


That says to edit index.php... ANd read above post for more help.

CHwebby

ohh ohhhhhhh.... Now I GET IT! those are the modification directions. Gosh I feel like such a dope! It's a pain to be dyslexic. Thank you so much.


Yellowrose

I have a question. I am new to this and am programing illiterate to a point. I have just installed a fresh install of 1.0.7 will this mod work with my install.

I see references to 1.1RC1 and 1.1RC2 which does my 1.0.7 fall under so when looking for other mods to add I can be sure I have the right version for my board.

Iwould like very much to add this to my board as I have used the warn system on another board where I'm admin and find it very useful.

Bigguy

This is were the isual warning mod is. If your version # is not there I dont think it is compatible.

http://mods.simplemachines.org/?action=search;basic_search=visual+warning

L.G.S

I need some help with this please.

How can I make it so that posts that have been approved from moderation show up as new posts ?
FREE and LIVE World Cup + Premier League football streams:

www.gamesandgoals.com


Hwoarang

Hello, we are experiencing a small problem with the mod. At the board where I am an administrator along with another guy, the other guy warned himself by mistake. And now that Warning thingy is always displaying under his name even though it's ages since the warning expired. Is there any way to get rid of his warning withouth reinstalling the vwarn mod?

xenovanis

Have you tried to reduce the warning level to 0?
"Insanity: doing the same thing over and over again and expecting different results."

Hwoarang

How do you do that?

do you mean the amount of days he is warned? because the warning already has expired.

xenovanis

No, I mean hit the "Warn button" in one of his posts and set the warning level to 0 (zero). That should remove the warning.
"Insanity: doing the same thing over and over again and expecting different results."

Vinspire

Quote from: Hwoarang on August 06, 2006, 10:45:06 PM
How do you do that?

do you mean the amount of days he is warned? because the warning already has expired.

Try this

Admin CP -> Members -> Warning Management -> ( If his nick is there, click on it then change the New Level: to 0 )

Hope this help :)

Hwoarang

Yeah hmm, i think i got my warning mods mixed up a bit. this problem is for the vwarn mod whcih dosen't seem to have those options.

Oleg Vereshchagin

Bug. ID of last message in topic is not changes when message has moderated and information about new message is not showes.
To fix it in file Source/VisualWarning11.php find

$request = db_query("
SELECT ID_MSG
FROM {$db_prefix}messages
WHERE ID_TOPIC = $row[ID_TOPIC]
ORDER BY posterTime LIMIT 1", __FILE__, __LINE__);

and add DESC before LIMIT, i.e.

$request = db_query("
SELECT ID_MSG
FROM {$db_prefix}messages
WHERE ID_TOPIC = $row[ID_TOPIC]
ORDER BY posterTime DESC LIMIT 1", __FILE__, __LINE__);

ArkServer

is it possible that a local moderator can only warn in the board he moderates and not outside his own board?

xenovanis

No, and I'm sorry to say I have no intention of implementing this.
"Insanity: doing the same thing over and over again and expecting different results."

ArkServer

It should be a nice feature because now everyone can warn or ban people as long as they are in that membergroup.

But oh well, ill try to find someone to help me with this. nice mod though.

Advertisement: