vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Beta Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=5)
-   -   Last / Next Thread Name in thread view (https://vborg.vbsupport.ru/showthread.php?t=40348)

bad_madman 06-26-2002 10:00 PM

Last / Next Thread Name in thread view
 
Showing in thread view the last thread name and next thread name instead of "last thread" and "next thread".

Advantage:
-I know before whether the thread is interesting for me.
-The link to the thread isn't shown, if there is not any next or last thread.
-Additional information possible (for example thread starter, views etc.).

Disadvantage:
- The previous thread isn't the previous thread any more, if somebody writes into this in the meantime :nervous:

See the screenshot for more informations.

Xenon 06-27-2002 04:44 PM

hey mate, very good idea, so this links can be usefull :)
i don't think the old style is used so much ;)

bad_madman 06-27-2002 04:54 PM

Ups. Have forgotten the code :rolleyes:

Search in showthread.php for:

Code:

if ($goto=="nextnewest") {
  $thread = verifyid("thread",$threadid,1,1);
  if ($getnextnewest=$DB_site->query_first("SELECT threadid
            FROM thread
            WHERE forumid='$thread[forumid]'
              AND lastpost>'$thread[lastpost]'
              AND visible=1
              AND open<>10
            ORDER BY lastpost LIMIT 1")) {
    $threadid=$getnextnewest[threadid];
    unset ($thread);
  } else {
    eval("standarderror(\"".gettemplate("error_nonextnewest")."\");");
  }
}

if ($goto=="nextoldest") {
  $thread = verifyid("thread",$threadid,1,1);
        if ($getnextoldest=$DB_site->query_first("SELECT threadid
                        FROM thread
                        WHERE forumid='$thread[forumid]'
                                AND lastpost<'$thread[lastpost]'
                                AND visible=1
                                AND open<>10
                        ORDER BY lastpost DESC LIMIT 1")) {
                $threadid=$getnextoldest[threadid];
    unset ($thread);
        } else {
    eval("standarderror(\"".gettemplate("error_nonextoldest")."\");");
        }
}

and replace with:
Code:

if ($nextthread=$DB_site->query_first("SELECT threadid,title,views,replycount,postusername FROM thread WHERE forumid='$thread[forumid]' AND lastpost>'$thread[lastpost]' AND visible=1 AND open<>10 ORDER BY lastpost LIMIT 1")) {$nextthr=$nextthread[title]; if(strlen($nextthr)>45) $nextthr=substr($nextthr,0,42)."...";}
if ($lastthread=$DB_site->query_first("SELECT threadid,title,views,replycount,postusername FROM thread WHERE forumid='$thread[forumid]' AND lastpost<'$thread[lastpost]' AND visible=1 AND open<>10 ORDER BY lastpost DESC LIMIT 1")) {$lastthr=$lastthread[title]; if(strlen($lastthr)>45) $lastthr=substr($lastthr,0,42)."...";}
$nextlastthread="<table><tr>".iif($lastthr!="","<td align='right'><smallfont><a href='showthread.php?s=$session[sessionhash]&threadid=$lastthread[threadid]'><b>&laquo; Previous Thread</b><br>$lastthr<br>$lastthread[views] Views, $lastthread[replycount] Replys, Starter: $lastthread[postusername]</a></smallfont></td>","")."<td>&nbsp;</td>".iif($nextthr!="","<td><smallfont><a href='showthread.php?s=$session[sessionhash]&threadid=$nextthread[threadid]'><b>Next Thread &raquo;</b><br>$nextthr<br>$nextthread[views] Views, $nextthread[replycount] Replys,  Starter: $lastthread[postusername]</a></smallfont></td>","")."</tr></table>"

search in template showthread for:

Code:

<smallfont>
        <img src="https://vborg.vbsupport.ru/images/prev.gif" alt="" border="0">
        <a href="showthread.php?s=$session[sessionhash]&threadid=$threadid&goto=nextoldest">Last Thread</a>
        &nbsp;
        <a href="showthread.php?s=$session[sessionhash]&threadid=$threadid&goto=nextnewest">Next Thread</a>
        <img src="https://vborg.vbsupport.ru/images/next.gif" alt="" border="0">
        </smallfont>

and replace with:

Code:

$nextlastthread

Xenon 06-27-2002 05:04 PM

i was sure you want to post the code in the next post ;)
A tip for the next version:
Don't make the Design hardcoded as you made here, would be better if you can set own designs in a template :)

bad_madman 06-27-2002 05:20 PM

Hmm. Right. Thx for the tip. I always make this to my Hacks actually, too ;)

Quote:

Originally posted by Xenon
i was sure you want to post the code in the next post ;)
A tip for the next version:
Don't make the Design hardcoded as you made here, would be better if you can set own designs in a template :)


Velocd 06-27-2002 06:35 PM

Nice ;)

I will probably only use the title of the thread though, that extra information seems to make it look cluttered.

BigJohnson 07-02-2002 03:51 PM

Can someone make it so it uses a template instead of being so hard coded because i have different styles and I have different pics for each style for the next and previous buttons. Thanks. That would really really help.

Xenon 07-02-2002 03:58 PM

i'm not the creator of it, and i think he'll do it more comfortable hisself, but you can do this:

replace
PHP Code:

$nextlastthread="<table><tr>".iif($lastthr!="","<td align='right'><smallfont><a href='showthread.php?s=$session[sessionhash]&threadid=$lastthread[threadid]'><b>? Previous Thread</b><br>$lastthr<br>$lastthread[views] Views, $lastthread[replycount] Replys, Starter: $lastthread[postusername]</a></smallfont></td>","")."<td> </td>".iif($nextthr!="","<td><smallfont><a href='showthread.php?s=$session[sessionhash]&threadid=$nextthread[threadid]'><b>Next Thread ?</b><br>$nextthr<br>$nextthread[views] Views, $nextthread[replycount] Replys,  Starter: $lastthread[postusername]</a></smallfont></td>","")."</tr></table>" 

with this:
PHP Code:

eval("\$nextlastthread = \"".gettemplate("nextlastthread")."\";"); 

then create the template nextlastthread and put in the infos you want :), like $lastthread[postusername] or whatever ;)

bad_madman 07-03-2002 12:17 AM

Thx Xenen :)
I will publish a new version with Templates - soon... :D

padblaz 07-09-2003 04:47 AM

i'm looking for this hack since a long time
do you think that you can publish the new version soon ? ;)
up one year later :D


All times are GMT. The time now is 10:05 AM.

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.01127 seconds
  • Memory Usage 1,750KB
  • 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
  • (4)bbcode_code_printable
  • (2)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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