PDA

View Full Version : how would i do this...


Tryfwar
04-16-2003, 11:44 PM
i have a an array which is is made up in a similar way to showgroups.php which basicly is a rollcall with various details listed in: http://forums.mortalis.com/rollcall.php

What i would like to do is have different font styles where any occurence of 'Guild Officer', 'Guild Member', 'Guild Leader'.

for e.g. all occurences of Guild Officer would be red and italic, any occurences of member would be green and normal.

Would it be at the stage when the array is built in the php or would it be a manipulation with html from within the forum template?

Thanks :)

Tryfwar
04-16-2003, 11:55 PM
Here is where my array is built within rollcall.php

while ($user = $DB_site->fetch_array($users)) {
if (($smodcount++ % 2) == 0) {
$backcolor = "#94CDF8";
} else {
$backcolor = "#6699CC";
}

douserinfo();
$userclassid = $user['userclassid'];
$getuserstatus=$DB_site->query_first("SELECT title FROM useractive WHERE useractiveid=$user[activestatus]");
$getuserrace=$DB_site->query_first("SELECT title FROM userrace WHERE userraceid=$user[userraceid]");
$getusergroup=$DB_site->query_first("SELECT title FROM usergroup WHERE usergroupid=$user[usergroupid]");
$getuserrank=$DB_site->query_first("SELECT title FROM userrank WHERE userrankid=$user[userrankid]");
$getusergender=$DB_site->query_first("SELECT title FROM usergender WHERE usergenderid=$user[usergenderid]");

if (!$grouptitle[$usergroupid]) {
$grouptitle[$userclassid] = $user['title'];
}
eval("\$groupinfo[$userclassid] .= \"".gettemplate("rollcall_bit")."\";");
}

if (is_array($groupinfo)) {
while(list($key, $val) = each($groupinfo)) {
$classname = $grouptitle["$key"];
if (substr($classname,-1)!="s") {
$classname.="s";
}
$adminbits = $val;
eval("\$groupbits .= \"".gettemplate("rollcall_group")."\";");
}
}

makeforumjump();
eval("dooutput(\"".gettemplate("rollcall")."\");");


And here is the contents of my template bit:


<tr>
<td bgcolor="$backcolor" nowrap width=100%><a href="javascript:view_profile($user[magelo]);">$user[username] $user[surname]</a>
<td bgcolor="$backcolor" nowrap>$getuserrace[title]&nbsp;</td>
<td bgcolor="$backcolor" nowrap>$getusergender[title]&nbsp;</td>
<td bgcolor="$backcolor" nowrap>$getuserstatus[title]&nbsp;</td>
<td bgcolor="$backcolor" nowrap>$getuserrank[title]&nbsp;</td>