PDA

View Full Version : Rules Page for users and moderators


WhaLberg
07 Jan 2007, 11:28
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

// ######################### 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): <td class="vbmenu_control"><a href="register.php$session[sessionurl_q]" rel="nofollow">$vbphrase[register]</a></td> </if>

- After add: <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): <!-- / user cp tools menu -->
</if>

- After add:<!-- 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
07 Jan 2007, 11:33
If you have any recommendations about these modification or question(s) please let me know.

KURTZ
07 Jan 2007, 15:56
reserved for future use

anyway interesting modification, right now i use CYB HACK (http://www.vbulletin.org/forum/showthread.php?t=122998&highlight=forum+rules+page), but yours include the moderating rules ...

Brew
07 Jan 2007, 16:34
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
07 Jan 2007, 18:44
<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
07 Jan 2007, 18:47
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
07 Jan 2007, 19:08
Are you sure that you've changed the username, password and database?

Brew
07 Jan 2007, 19:22
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
07 Jan 2007, 19:32
The code is:
$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
08 Jan 2007, 05:04
Thanks, this will come in handy.

WhaLberg
08 Jan 2007, 15:19
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

:)

Okey.. If you have prefix for tables like vb_something, then you should use like that:


$smodquery = "SELECT * FROM prefix_user WHERE usergroupid='5'";

$modquery = mysql_query("SELECT * FROM prefix_moderator");

and also

$modquery_2 = mysql_query("SELECT * FROM prefix_user WHERE userid='$useridd'");

Your sincerely.

Brew
08 Jan 2007, 15:21
That's perfect man!

All is working according to plan now :)

Thank you for your great help with this!