vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.7 Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=229)
-   -   Moderators Functions - Alert Moderator Button (https://vborg.vbsupport.ru/showthread.php?t=245416)

nerbert 06-27-2010 10:00 PM

Alert Moderator Button
 
This will place a red button in the thread display (SHOWTHREAD) page, or any other forum pages, that will alert moderators when a new user needs approval. When the button is clicked it takes you directly to the list of new users awaiting approval.

First, you will need to use the Add New Plugin feature to insert the following code into SHOWTHREAD:

PHP Code:

$waiting $db->query_first("SELECT COUNT(*) AS users FROM " TABLE_PREFIX "user WHERE usergroupid = 4"); 

Product: vBulletin
Location: showthread_start
Title: Find number of users to moderate
Execution order: 1
Plugin is active: Yes

In the SHOWTHREAD template under $navbar add:

HTML Code:

<!--##################### User to Moderate Button ####################-->
<if condition="$show['inlinemod']">
<if condition="$waiting[users] != 0">

<style type = "text/css">
#modbutton1
{
background-color:#801010;
border-top:4px solid #aa1313;
border-right:4px solid #660000;
border-left:4px solid #aa1313;
border-bottom:4px solid #660000;
color: #e0e0e0;
font-weight: bold;
font-size:small;
padding:0px;
white-space:nowrap;
}
</style>

<table style =" padding:0px;" border = "0px" width = "100%" cellspacing="0">
          <tr>
                    <td id = "modbutton1" align = "center" >
                    <a href="admincp/user.php$session[sessionurl_q]?do=moderate" target = "_blank">
                    <img src = "images/buttons/moderate.gif" alt = "Click to go to the admin CP" border = "0px" />
                    </a></td>
          </tr>
</table>
<br />

</if>
</if>
<!--#################### /User to Moderate Button ####################-->

Now upload moderate.gif to images/buttons.

You are done. This can be disabled in Plugin Manager

To put this on another page find a hook location for that page and add the plugin there, and paste in the html under $navbar in the appropriate template.

If anyone wants to expand on this idea here are some hints:
The PHP code for this was taken directly out of forum/admincp/index.php. If you want to alert moderators to other moderated items you can grab the appropriate php from there.

You could make a more complex second conditional at the top of the html for more items to moderate and make table cells with conditionals for each moderated item.

To create the appropriate links go to your Control Panel Home and right click [view] for the item to moderate and click Properties. Insert "$session[sessionurl_q]" between "php" and "?do =.....".

The moderate.gif image is included only to make a larger target to click on. You could just as well add some padding to the css (6px) and put in "User to Moderate" instead of the image. If you want to make more table cells an image for each one will probably not be needed.

nerbert 06-28-2010 02:39 AM

Well, I didn't know how to get moderate.gif in files so you will have to get it out of screen shots.


All times are GMT. The time now is 06:39 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01009 seconds
  • Memory Usage 1,722KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_html_printable
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (2)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete