vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Hide (The last post was form ?????) on Forum home page. (https://vborg.vbsupport.ru/showthread.php?t=47970)

XrayHead 01-21-2003 03:30 PM

Hide (The last post was form ?????) on Forum home page.
 
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

PHP Code:

        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

PHP Code:

        if ($forum['lastpost']>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

PHP Code:

        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

PHP Code:

        if ($forum['lastpost']>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

PHP Code:

        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

PHP Code:

        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

PHP Code:

        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

PHP Code:

        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.

Code:

        <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............
: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?


All times are GMT. The time now is 12:27 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01215 seconds
  • Memory Usage 1,785KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (8)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete