vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=192)
-   -   Rules Page for users and moderators (https://vborg.vbsupport.ru/showthread.php?t=135774)

WhaLberg 01-06-2007 10:00 PM

Rules Page for users and moderators
 
You want to have a page which includes the rules that must be followed by the users and moderators / admins. But they must be seperated and drop downed from the navbar link "Rules". If so, here is what you need..

You must write your own rules of users for sections, and also you must write the rules of moderators.

What you need to install?
- Upload the rules.php, modrules.php and mods.php to your home directory.
- Do not forget to change the database name, user name and password in mods.php

PHP Code:

// ######################### SQL THINGS ############################

mysql_connect('localhost''username''password') or die("Cannot connect the database..");
mysql_select_db('databasename') or die("Cannot select the database.."); 

- Go to Styles & Templates -> Style Manager -> the Style that you use
- Click to Add New Template from the right top drop down menu.
- Change the title as "userrules" and copy the codes in userrules.txt .
- Click to Add New Template again.
- Change the title as "moderatorrules" and copy the codes in moderatorrules.txt.
- Click to Add New Template again.
- Change the title as "mods" and copy the code in mods.txt.
- Click to Add New Template again.
- Change the title as "supmods" and copy the code in supmods.txt.
- Go to Styles & Templates -> Style Manager -> the Style that you use
- Open the navbar template from Navbar Templates.
- Find (in navbar):
HTML Code:

<td class="vbmenu_control"><a href="register.php$session[sessionurl_q]" rel="nofollow">$vbphrase[register]</a></td> </if>
- After add:
HTML Code:

<td id="rules" class="vbmenu_control"><a href="$show[nojs_link]#rules">Board Rules</a> <script type="text/javascript"> vbmenu_register("rules"); </script></td>
- Find (in navbar):
HTML Code:

<!-- / user cp tools menu -->
</if>

- After add:
HTML Code:

<!-- rules menu -->
<if condition="$show['member']">
<div class="vbmenu_rulepopup" id="rules_menu" style="display:none">
                <table cellpadding="4" cellspacing="1" border="0">
                <tr><td class="thead">Board Rules</td></tr>               
                <tr><td class="vbmenu_option"><a href="rules.php">User Rules</a></td></tr>
                <if condition="is_member_of($bbuserinfo, array('5','6','7'))"><tr><td class="vbmenu_option"><a href="modrules.php">Moderator Rules</a></td></tr></if>
                </table>
        </div><else />
<div class="vbmenu_rulepopup" id="rules_menu" style="display:none">
                <table cellpadding="4" cellspacing="1" border="0">
                <tr><td class="thead">Board Rules</td></tr>               
                <tr><td class="vbmenu_option"><a href="rules.php">User Rules</a></td></tr>
                </table>
        </div>
        </if>       
        <!-- / rules menu -->

I hope this helps you and please don't be shy to ask any questions.

You can do anything you want to this addon. :)

Don't forget to click install.

WhaLberg 01-07-2007 10:33 AM

If you have any recommendations about these modification or question(s) please let me know.

KURTZ 01-07-2007 02:56 PM

reserved for future use

anyway interesting modification, right now i use CYB HACK, but yours include the moderating rules ...

Brew 01-07-2007 03:34 PM

Our forums really don't have any rules for members.

But the option for rules for the moderator seems to be a good idea.

[installed]

Thanks!

Brew 01-07-2007 05:44 PM

HTML Code:

<if condition="is_member_of($bbuserinfo, array('5','6','7'))">
Doesn't seem to be working.

All users see the same link.

Thanks!

edit: I fixed the problem....somehow... :)

Brew 01-07-2007 05:47 PM

When looking at the Board Management page I get this at the top of the page:

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /mods.php on line 27

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /mods.php on line 40


:)

WhaLberg 01-07-2007 06:08 PM

Are you sure that you've changed the username, password and database?

Brew 01-07-2007 06:22 PM

Yea man.

If it couldn't connect than I should be getting "Cannot connect the database.." errors.

So I'm really not sure what is going on.

WhaLberg 01-07-2007 06:32 PM

The code is:
PHP Code:

$smodquery "SELECT * FROM user WHERE usergroupid='5'";
$runsmodquery mysql_query($smodquery);
while (
$smod=mysql_fetch_array($runsmodquery)) { 

And it works great with me.. Hmm.. Let me think..

Discussions 01-08-2007 04:04 AM

Thanks, this will come in handy.


All times are GMT. The time now is 12:05 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.01644 seconds
  • Memory Usage 1,757KB
  • 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
  • (5)bbcode_html_printable
  • (2)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete