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

17 Apr 2003, 00:44
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 :)

17 Apr 2003, 00:55
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";

$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") {
$adminbits = $val;
eval("\$groupbits .= \"".gettemplate("rollcall_group")."\";");


And here is the contents of my template bit:

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