Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 02-27-2008, 11:44 AM
Poet PHP Poet PHP is offline
 
Join Date: Oct 2007
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default template threadbit

hi all i have Q . PLZ.. replay

i want to use Variable usergroupid in template threadbit

example

PHP Code:
<if condition="$show[usergroupid]==6">

<
font color=red>$thread[threadtitle]</font>
</else>

<
font color=000000>$thread[threadtitle]</font>
</if> 
Reply With Quote
  #2  
Old 02-27-2008, 12:00 PM
shovel's Avatar
shovel shovel is offline
 
Join Date: Mar 2002
Location: South Carolina, US
Posts: 222
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Try..

PHP Code:
<if condition="$bbuserinfo[usergroupid] == 6"

<
font color=red>$thread[threadtitle]</font
<else /> 

<
font color=000000>$thread[threadtitle]</font
</if> 
Reply With Quote
  #3  
Old 02-27-2008, 01:01 PM
Opserty Opserty is offline
 
Join Date: Apr 2007
Posts: 4,103
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

usergroupid of whom? The thread starter or the browsing user or?
Reply With Quote
  #4  
Old 02-27-2008, 01:28 PM
shovel's Avatar
shovel shovel is offline
 
Join Date: Mar 2002
Location: South Carolina, US
Posts: 222
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hmm you're correct. I assumed the browser since it was a style change.
Reply With Quote
  #5  
Old 02-28-2008, 04:59 AM
Poet PHP Poet PHP is offline
 
Join Date: Oct 2007
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thank U for your responding
i wnat fo chose the color of the tite according to the group 'otherwise when the mangager write any subject the tite must be red color
this method is not useful :

PHP Code:
<if condition="$bbuserinfo[usergroupid] == 6"

<
font color=red>$thread[threadtitle]</font
<else /> 

<
font color=000000>$thread[threadtitle]</font
</if> 

because it will make all titles color with same color when the manager neter to any department
just i want to change the color title of the manager i mean to be unique than the member's subjects
in order to the reader be able to differentiat betweet the subjects of the manager and members
so i want vairiable usergrouid according to the writer
with best best wishes

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

thanks for your unhelp
i found the solution and it's as following:

in file forumdisplay.php

find out

PHP Code:
        while ($thread $db->fetch_array($threads))
        { 
// AND $counter++ < $perpage) 
then put this code after

PHP Code:
        $getparent_id '';  
        
$getparentid $db->query_read("SELECT * FROM " TABLE_PREFIX "user WHERE userid ='" $thread[postuserid] . "'");  
          
        while (
$getparentids $db->fetch_array($getparentid)) {  
              
            
$getparent_id .=  $getparentids[displaygroupid];  
              
        } 
then put this code in template threadbit

PHP Code:

            
<if condition="$getparent_id==6"><font color="#FF0000"></if>
            
$thread[threadtitle]
            </
font
see the result http://www.akafi.net/forumdisplay2.php?f=13
Reply With Quote
  #6  
Old 02-28-2008, 01:50 PM
Opserty Opserty is offline
 
Join Date: Apr 2007
Posts: 4,103
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Two things:
  1. You shouldn't be editing files, it means you have to edit files every time you upgrade
  2. You are running an extra query on every threadbit (thats 25 queries extra on top of the ~14 or so there)

Here is the plugin we use:
Hook Location: forumdisplay_query
PHP Code:
PHP Code:
$hook_query_fields ", user.usergroupid";

$hook_query_joins "LEFT JOIN "TABLE_PREFIX ."user AS user ON(user.userid=postuserid)"
The you can use:
PHP Code:
$thread['usergroupid'
Reply With Quote
  #7  
Old 02-28-2008, 02:04 PM
shovel's Avatar
shovel shovel is offline
 
Join Date: Mar 2002
Location: South Carolina, US
Posts: 222
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Opserty View Post
Two things:
  1. You shouldn't be editing files, it means you have to edit files every time you upgrade
  2. You are running an extra query on every threadbit (thats 25 queries extra on top of the ~14 or so there)
Here is the plugin we use:
Hook Location: forumdisplay_query
PHP Code:
PHP Code:
$hook_query_fields ", user.usergroupid";

$hook_query_joins "LEFT JOIN "TABLE_PREFIX ."user AS user ON(user.userid=postuserid)"
The you can use:
PHP Code:
$thread['usergroupid'
Shoot, I think even I learned from that one. Didn't know they had query modifier variables.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:34 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04205 seconds
  • Memory Usage 2,252KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (10)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (7)postbit
  • (7)postbit_onlinestatus
  • (7)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • 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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete