PDA

View Full Version : new post graphic as bgcolor


mr e
08-09-2002, 06:18 AM
ok i've been trying to make this hack but i dont know enough about mysql to get it done, what it does is instead of a new post/thread graphic i just want the background of the cell on the index.php to change color...i know this has to be in the index.php around the // do light bulb area, BUT the thing is i only want it to change color if it's a specific style, all the other styles would still have the graphic...this is what i have so far and i know im doing it wrong because for the life of me i cant get it to work

$style=$DB_site->query_first("SELECT styleid FROM style WHERE styleid IS NOT NULL AND userselect=1");
// do light bulb
if ($bbuserinfo['lastvisitdate']=='Never') {
if ($style['styleid'] == '5') {
$forum['onoff']='#999999';
} else {
$forum['onoff']='on';
}
} else {
if (isset($bbforumview[$forum['forumid']]) and $bbforumview[$forum['forumid']]>$bbuserinfo['lastvisit']) {
$userlastvisit=$bbforumview[$forum['forumid']];
} else {
$userlastvisit=$bbuserinfo['lastvisit'];
}
if ($userlastvisit<$forum['lastpost']) {
if ($style['styleid'] == '5') {
$forum['onoff']='#999999';
} else {
$forum['onoff']='on';
}
} else {
if ($style['styleid'] == '5') {
$forum['onoff']='#666666';
} else {
$forum['onoff']='off';
}
}
}

mr e
08-09-2002, 06:21 AM
also after this i would do <td bgcolor="$forum[onoff]"> </td> etc

mr e
08-09-2002, 06:52 AM
updated version, not much difference ,but a little


$style=$DB_site->query_first("SELECT styleid FROM user");
// do light bulb
if ($bbuserinfo['lastvisitdate']=='Never') {
if ($style['styleid'] == 5) {
$forum['onoff']='#CCCCCC';
} else {
$forum['onoff']='on';
}
} else {
if (isset($bbforumview[$forum['forumid']]) and $bbforumview[$forum['forumid']]>$bbuserinfo['lastvisit']) {
$userlastvisit=$bbforumview[$forum['forumid']];
} else {
$userlastvisit=$bbuserinfo['lastvisit'];
}
if ($userlastvisit<$forum['lastpost']) {
if ($style['styleid'] == 5) {
$forum['onoff']='#CCCCCC';
} else {
$forum['onoff']='on';
}
} else {
if ($style['styleid'] == 5) {
$forum['onoff']='#666666';
} else {
$forum['onoff']='off';
}
}
}


also, everytime i try to post i have to login again...whats up with that?