View Single Post
  #278  
Old 09-30-2004, 03:31 AM
Mosh's Avatar
Mosh Mosh is offline
 
Join Date: Aug 2004
Location: Melbourne, Australia
Posts: 1,968
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by SamirDarji
Mind sharing the code for the changes? I was thinking to do the same.
Yep, no probs. It is not neat or the most efficient code, but it works for me (not a coder myself but have started to experiment). Only tested on v3.0.3. These changes will have to be made in every style you use.

The only thing viewable by a member is the Warn Level (all members are displayed for everyone to see) and their warning page (only viewable by them and staff). My staff love this as originally everyone saw all links.



You will have to reference with ZT's original instructions to see what is different for the 'postbit' template (additional navbar and MEMBERINFO template alterations by me):


1. In the 'postbit' template (you will have to find the equivalent place in the 'postbit_legacy' template yourself as I do not use it), Warn and View Warning only seen by staff. Warn Level are displayed for members (when level is above zero it changes colour). You can change the font colours to whatever you want.

Postbit Templates -> postbit:-

Find:
PHP Code:
<if condition="$show['postcount']">#<a 
Replace with:
PHP Code:
<if condition="$post['usergroupid'] == 5 OR $post['usergroupid'] == 6 OR $post['usergroupid'] == 7"><else /><if condition="$bbuserinfo['usergroupid'] == 5 OR $bbuserinfo['usergroupid'] == 6 OR $bbuserinfo['usergroupid'] == 7"><a href='Warn.php?do=WarnUser&id=$post[userid]&post=$post[postid]'><font color=orange>Warn $post[musername]</font></a>&nbsp;&nbsp;<a href='Warn.php?do=ViewWarnings&id=$post[userid]'><font color=yellow>View $post[musername]'s Warnings</font></a>&nbsp;&nbsp;</if></if><if condition="$show['postcount']">#<a 
Find:
PHP Code:
                    <if condition="$post['age']"><div>$vbphrase[age]: $post[age]</div></if>
                    <
div>
                        
$vbphrase[posts]: $post[posts]
                    </
div
Under it Add:
PHP Code:
                <if condition="$post['usergroupid'] == 5 OR $post['usergroupid'] == 6 OR $post['usergroupid'] == 7"><else /><if condition="$post['warning_level'] == 0"><div class="smallfont">Warning Level$post[warning_level]</div></if></if>
                                <if 
condition="$post['usergroupid'] == 5 OR $post['usergroupid'] == 6 OR $post['usergroupid'] == 7"><else /><if condition="$post['warning_level']>0"><div class="smallfont"><font color=yellow>Warning Level$post[warning_level]</font></div></if></if> 

2. I put a 'View My Warnings' link in 'Quick Links' on the navbar (as staff can't get warned they will not see this).

Navigation / Breadcrumb Templates -> navbar:-

Find:
PHP Code:
<tr><td class="thead">$vbphrase[miscellaneous]</td></tr
Above it add:
PHP Code:
<if condition="$bbuserinfo['usergroupid'] == 5 OR $bbuserinfo['usergroupid'] == 6 OR $bbuserinfo['usergroupid'] == 7"><else /><tr><td class="thead">Warnings</td></tr><tr><td class="vbmenu_option"><a href="Warn.php?$session[sessionurl]do=ViewMyWarnings">View My Warnings</a></td></tr></if> 

3. For members public profiles I have added a view warnings (viewable by staff only) and Warning Level (everyone can see)

Member Info Templates -> MEMBERINFO:-

Find:
PHP Code:
    <td class="tcat">$vbphrase[view_profile]<span class="normal">: $userinfo[username]</span></td
Replace with:
PHP Code:
    <td class="tcat">$vbphrase[view_profile]<span class="normal">: $userinfo[username]<if condition="$post['usergroupid'] == 5 OR $post['usergroupid'] == 6 OR $post['usergroupid'] == 7"><else /><if condition="$bbuserinfo['usergroupid'] == 5 OR $bbuserinfo['usergroupid'] == 6 OR $bbuserinfo['usergroupid'] == 7">&nbsp;&nbsp;<a href='Warn.php?do=ViewWarnings&id=$post[userid]'><font color=yellow>View $post[musername]'s Warnings</font></a>&nbsp;&nbsp;</if></if></span></td> 
Find:
PHP Code:
                <if condition="$show['lastactivity']">
                    <
div>$vbphrase[last_activity]: $userinfo[lastactivitydate] <span class="time">$userinfo[lastactivitytime]</span>&nbsp;</div>
                </if> 
Above it Add:
PHP Code:
                <if condition="$post['usergroupid'] == 5 OR $post['usergroupid'] == 6 OR $post['usergroupid'] == 7"><else /><if condition="$post['warning_level'] == 0"><div class="smallfont">Warning Level$post[warning_level]&nbsp;</div></if></if>
                                <if 
condition="$post['usergroupid'] == 5 OR $post['usergroupid'] == 6 OR $post['usergroupid'] == 7"><else /><if condition="$post['warning_level']>0"><div class="smallfont"><font color=yellow>Warning Level$post[warning_level]</font>&nbsp;</div></if></if> 


That is all I really did, so if you find use for it go right ahead and use it

JD.
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01236 seconds
  • Memory Usage 1,862KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (10)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete