PDA

View Full Version : template threadbit


Poet PHP
02-27-2008, 11:44 AM
hi all i have Q . PLZ.. replay

i want to use Variable usergroupid in template threadbit

example


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

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

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

shovel
02-27-2008, 12:00 PM
Try..

<if condition="$bbuserinfo[usergroupid] == 6">

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

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

Opserty
02-27-2008, 01:01 PM
usergroupid of whom? The thread starter or the browsing user or?

shovel
02-27-2008, 01:28 PM
Hmm you're correct. I assumed the browser since it was a style change.

Poet PHP
02-28-2008, 04:59 AM
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 :


<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 1204201286 at 1204201286 ---------------

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

in file forumdisplay.php

find out


while ($thread = $db->fetch_array($threads))
{ // AND $counter++ < $perpage)



then put this code after


$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



<if condition="$getparent_id==6"><font color="#FF0000"></if>
$thread[threadtitle]
</font>

see the result http://www.akafi.net/forumdisplay2.php?f=13

Opserty
02-28-2008, 01:50 PM
Two things:

You shouldn't be editing files, it means you have to edit files every time you upgrade
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:

$hook_query_fields = ", user.usergroupid";

$hook_query_joins = "LEFT JOIN ". TABLE_PREFIX ."user AS user ON(user.userid=postuserid)";


The you can use:
$thread['usergroupid']

shovel
02-28-2008, 02:04 PM
Two things:
You shouldn't be editing files, it means you have to edit files every time you upgrade
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:

$hook_query_fields = ", user.usergroupid";

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