PDA

View Full Version : Hide (The last post was form ?????) on Forum home page.


XrayHead
01-21-2003, 03:30 PM
Hi all

I am after a hack for a private forum I have on the forum home page.
I am not hiding the forum from all, but I don?t want anyone to see who the last post was from in that forum.
I have seen this somewhere on a board but can?t remember where.

Any ideas



Lee
:(

XrayHead
01-22-2003, 12:09 PM
Please can anyone help me with this as i havent been able to find it anywhere.

Neo
01-22-2003, 05:32 PM
Ok. You could take that out but I am sure for the users that can see it you still want it... give me a sec.

There are two ways we can do this. Here are both of them.

##### 1 #####
-----------------------
in index.php find


if ($forum['lastpost']>0) {
$forum['lastpostdate']=vbdate($dateformat,$forum['lastpost']);
$forum['lastposttime']=vbdate($timeformat,$forum['lastpost']);
eval("\$forum['lastpostinfo'] = \"".gettemplate('forumhome_lastpostby')."\";");
} else {
$forum['lastpostinfo']='Never';
}


and replace with


if ($forum['lastpost']>0 AND $bbuserinfo[usergroupid]!=0) {
$forum['lastpostdate']=vbdate($dateformat,$forum['lastpost']);
$forum['lastposttime']=vbdate($timeformat,$forum['lastpost']);
eval("\$forum['lastpostinfo'] = \"".gettemplate('forumhome_lastpostby')."\";");
} else {
$forum['lastpostinfo']='Never';
}


now in forumdisplay.php find


if ($forum['lastpost']>0) {
$forum['lastpostdate']=vbdate($dateformat,$forum['lastpost']);
$forum['lastposttime']=vbdate($timeformat,$forum['lastpost']);
eval("\$forum['lastpostinfo'] = \"".gettemplate('forumhome_lastpostby')."\";");
} else {
$forum['lastpostinfo']='Never';
}


and replace with


if ($forum['lastpost']>0 AND $bbuserinfo[usergroupid]!=0) {
$forum['lastpostdate']=vbdate($dateformat,$forum['lastpost']);
$forum['lastposttime']=vbdate($timeformat,$forum['lastpost']);
eval("\$forum['lastpostinfo'] = \"".gettemplate('forumhome_lastpostby')."\";");
} else {
$forum['lastpostinfo']='Never';
}

-----------------------
############

OR

##### 2 #####
-----------------------
in index.php find


if ($forum['lastpost']>0) {
$forum['lastpostdate']=vbdate($dateformat,$forum['lastpost']);
$forum['lastposttime']=vbdate($timeformat,$forum['lastpost']);
eval("\$forum['lastpostinfo'] = \"".gettemplate('forumhome_lastpostby')."\";");
} else {
$forum['lastpostinfo']='Never';
}


and replace with


if ($forum['lastpost']>0) {
$forum['lastpostdate']=vbdate($dateformat,$forum['lastpost']);
$forum['lastposttime']=vbdate($timeformat,$forum['lastpost']);
eval("\$forum['lastpostinfo'] = \"".gettemplate('forumhome_lastpostby')."\";");
} else if($bbuserinfo[usergroupid]==0) {
$forum['lastpostdate']=vbdate($dateformat,$forum['lastpost']);
$forum['lastposttime']=vbdate($timeformat,$forum['lastpost']);
eval("\$forum['lastpostinfo'] = \"".gettemplate('forumhome_lastpostby2')."\";");
} else {
$forum['lastpostinfo']='Never';
}


in forumdisplay.php find


if ($forum['lastpost']>0) {
$forum['lastpostdate']=vbdate($dateformat,$forum['lastpost']);
$forum['lastposttime']=vbdate($timeformat,$forum['lastpost']);
eval("\$forum['lastpostinfo'] = \"".gettemplate('forumhome_lastpostby')."\";");
} else {
$forum['lastpostinfo']='Never';
}


and replace with


if ($forum['lastpost']>0) {
$forum['lastpostdate']=vbdate($dateformat,$forum['lastpost']);
$forum['lastposttime']=vbdate($timeformat,$forum['lastpost']);
eval("\$forum['lastpostinfo'] = \"".gettemplate('forumhome_lastpostby')."\";");
} else if($bbuserinfo[usergroupid]==0) {
$forum['lastpostdate']=vbdate($dateformat,$forum['lastpost']);
$forum['lastposttime']=vbdate($timeformat,$forum['lastpost']);
eval("\$forum['lastpostinfo'] = \"".gettemplate('forumhome_lastpostby2')."\";");
} else {
$forum['lastpostinfo']='Never';
}


now make a new template and call it forumhome_lastpostby2 and place this within it.


<table cellpadding="0" cellspacing="0" border="0" width="100%" id="ltlink"><tr align="right">
<td nowrap><smallfont>$forum[lastpostdate] <font color="#006000">$forum[lastposttime]</font>
</smallfont></td>
<td nowrap>&nbsp;<a href="showthread.php?s=$session[sessionhash]&goto=lastpost&forumid=$forum[forumid]"><img src="https://vborg.vbsupport.ru/greentek/lastpost.gif" border="0" alt="Go to last post"></a></td>
</tr></table>

-----------------------
############

Now in 1 its simple, but in 2 it gives you the option to still have last post info / or change what it will say instead.

XrayHead
01-22-2003, 09:23 PM
Hi Neo
Thanks for the reply; I want to do this with two forums only.
Can I enter somewhere the forum ID's so that the rest of the site/forum is unaffected?

Anyway, thanks for taking the time to post the code. It is much appreciated.

Lee

PS, If you look at the bottom of my site you will see the two forums I want to change.
Site............ (http://www.walkonzone.com/vboard)
:bunny:

XrayHead
01-27-2003, 05:14 PM
Hi All
Can anyone else help with this problem i have?

mauisun
09-13-2003, 03:09 PM
the code works well for all the forums on the board, but I am with XrayHead on this one, how do I get this code to work for just 2 or 3 specific forums? or even just one forum fo rthat matter. I want the forum to be visible but locked to all but whom permissions are set for. but unfortunately, the last poster is listed, and if you follow that it shows the title of the last post. anyone please?
.....mauisun

zsmom
12-05-2003, 02:21 AM
I would love this to be able to work on just two or three forums as well. Anyone?