PDA

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


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

Thanks in advance.

Admin
11-11-2001, 11:35 AM
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-11-2001, 12:50 PM
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
04-05-2002, 06:46 AM
SirSteve, remove ' in second code.

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