PDA

View Full Version : Click icon to get all new posts in each forum


SirSteve
10 Nov 2001, 23:02
I would like this hack that is on the home page. Can it be posted? :)

Thanks in advance.

Chen
11 Nov 2001, 13:35
In index.php, find this:
// do light bulb
if ($bbuserinfo['lastvisitdate']=='Never') {
$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']) {
$forum['onoff']='on';
} else {
$forum['onoff']='off';
}
}
and replace it with this:
// do light bulb
if ($bbuserinfo['lastvisitdate']=='Never') {
$forum['onoff']='on';
$forum['getnews']="<a href=\"search.php?s=$session[sessionhash]&action=getnew&forumid=$forum[forumid]\">";
$forum['getnewe']='</a>';
} else {
if (isset($bbforumview[$forum['forumid']]) and $bbforumview[$forum['forumid']]>$bbuserinfo['lastvisit']) {
$userlastvisit=$bbforumview[$forum['forumid']];
} else {
$userlastvisit=$bbuserinfo['lastvisit'];
}
if ($userlastvisit<$forum['lastpost']) {
$forum['onoff']='on';
$forum['getnews']="<a href=\"search.php?s=$session[sessionhash]&action=getnew&forumid=$forum[forumid]\">";
$forum['getnewe']='</a>';
} else {
$forum['onoff']='off';
$forum['getnews']='';
$forum['getnewe']='';
}
}

Now in forumhome_forumbit_levelX_post templates replace this:
<img src="{imagesfolder}/$forum[onoff].gif" border="0" alt="">
with this:
$forum['getnews']<img src="{imagesfolder}/$forum[onoff].gif" border="0" alt="">$forum['getnewe']

That's it I think... this will only work if you have v2.2.0.

SirSteve
11 Nov 2001, 14:50
Can you double check the code?

This is mine:

<img src="{imagesfolder}/$forum[onoff].gif" border="0" alt="">

not this:

<img src="images/$forum[onoff].gif" border="0" alt="">

Even so, I made the changes with adding the {imagesfolder} to your replacement code and I get errors.

inetd
05 Apr 2002, 08:46
SirSteve, remove ' in second code.

$forum[getnews]<img src="{imagesfolder}/$forum[onoff].gif" border="0" alt="">$forum[getnewe]