View Single Post
  #7  
Old 02-17-2013, 01:19 AM
Digital Jedi's Avatar
Digital Jedi Digital Jedi is offline
 
Join Date: Oct 2006
Location: PopCulturalReferenceLand
Posts: 5,171
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by CoffeeLovesYou View Post
Well, thanks to the help with someone who also has experience with this, this is working;

HTML Code:
<if condition="can_moderate($GLOBALS[forumid], 0, $post[userid])">
Code
</if>
However, I am trying to combine this code with 1 more if condition, and 2 more.

HTML Code:
<if condition="$thread['postuserid'] == $post['userid']"><div class="smallfont"><b><big>Original Poster</big></b></div><else />
<if condition="can_moderate($GLOBALS[forumid], 0, $post[userid]) AND $thread['postuserid'] == $post['userid'] AND is_member_of($bbuserinfo, 7,47)">
<div class="smallfont"><b><big>$GLOBALS[foruminfo][title] Leader & Original Poster</big></b></div><else />
<if condition="can_moderate($GLOBALS[forumid], 0, $post[userid]) AND $thread['postuserid'] == $post['userid']">
<div class="smallfont"><b><big>$GLOBALS[foruminfo][title] Moderator & Original Poster</big></b></div>
</if></if></if>
^^ Does anyone see what is wrong with this?
When I just had..
HTML Code:
<if condition="can_moderate($GLOBALS[forumid], 0, $post[userid])">
Code
</if>
..it was working. Now that I combined it with the if original poster and if member of, it isn't working. Same with the other if condition, now that I combined it with original poster.

--------------- Added [DATE]1361049497[/DATE] at [TIME]1361049497[/TIME] ---------------

Okay, I kind of figured out why.
My if condition was saying that, if the user moderated the forum and the user is apart of the usergroup IDs I specified, they could see the code. I needed it so if the user moderated the current forum and the user who moderates that forum is a member of the usergroup ID I specified, then they get the code shown in their post and is visible to everyone else.

My friend helped me get to this code;

HTML Code:
<if condition="can_moderate($GLOBALS[forumid], 0, $post[userid]) AND is_member_of($userinfo, 7,47)">
<div class="smallfont"><b><big>{$GLOBALS['foruminfo']['title']}Leader</big></b></div></if> <else />
<if condition="can_moderate($GLOBALS[forumid], 0, $post[userid]) AND is_member_of($userinfo, 5,55)">
<div class="smallfont"><b><big>{$GLOBALS['foruminfo']['title']} Moderator</big></b></div>
</if>
But it isn't working for me, yet it's working for him..
Interesting. I had not seen $globals used that way before, surprisingly.

First off, let's narrow down what you're trying to do. Because the first code you posted (which I spent a couple of hours trying to figure out earlier today) isn't doing the same thing that you're trying to do now. In the first post you seem to only want to show code that displayed Thread Starter, Thread Starter & Moderator and Thread Starter & Leader (which I'm assuming was groups 7 and 47). Now you seem to only want to demarcate Moderators from Leaders, with no regard for thread starter. Let's pick one of those and go with it, because the code would be different depending on which you're trying to accomplish.
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01233 seconds
  • Memory Usage 1,791KB
  • 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
  • (4)bbcode_html
  • (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