vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   [RELEASE 1.0 beta] LAST THREAD NAME (https://vborg.vbsupport.ru/showthread.php?t=23302)

07-20-2001 10:00 PM

Deutsch
Diese Hack zeigt auf der index.php unter dem username der das letzte posting gemacht hat auch den titel des threads auf dem dieser das reply geschrieben hat!

English
This hack showes the thread title in the "Last Post" col.

Information
[Version nummer] maybe 1.0 beta
[Files to change] index.php and forumhome_lastpostby template

Installation

== in index.php ==
find:
PHP Code:

        // prepare template vars
        
if (!$showforumdescription) {
          
$forum['description']='';
        } 

below that add:
PHP Code:

       $lastposttitle $DB_site->query("SELECT title FROM thread WHERE forumid='$forum[forumid]' ORDER BY lastpost DESC");
       
$lastposttitle $DB_site->fetch_array($lastposttitle);
       
$lastposttitle $lastposttitle[title];
       if (
strlen($lastposttitle) > 20) {
           
$lastposttitle substr($lastposttitle,0,18);
    
$lastposttitle .= "..";
       } 

== in forumhome_lastpostby template ==
find:
PHP Code:

<a href="member.php3?s=$session[sessionhash]&action=getinfo&find=lastposter&forumid=$forum[forumid]"><b>$forum[lastposter]</b></a

und this add:
PHP Code:

<br><a href="showthread.php3?s=$session[sessionhash]&goto=lastpost&forumid=$forum[forumid]"><b>$lastposttitle</b></a></a></smallfont></td

thats all folk

have phun!

ztsky 07-21-2001 11:08 AM

Very very cool!
You have done a difficult thing so easy.
congratulations!;)

maverick1236 07-21-2001 01:58 PM

any way I can show the last post title under the last thread title??
TIA!!

ztsky 07-21-2001 03:24 PM

Works well,but....
BUG~
If i have two sub-forum like b and c in main forum.
Use this hack,If I post a new thread in forum b ,but the lastitle in forum home page is remain the title of the newest thread title in main forum

somnium 07-22-2001 04:21 PM

i didn't test it with subforums.

perhaps i debug the hack, but i don't know.

ztsky 07-22-2001 04:22 PM

Quote:

Originally posted by somnium
i didn't test it with subforums.

perhaps i debug the hack, but i don't know.

How to fix it?
I tried ti fix it yestoday,but nothing can do.

somnium 07-22-2001 06:08 PM

i don't know how to debug but i think there must be an answer!!

you can hack everythin you want!!!

EXCHANGE 07-28-2001 03:31 PM

I changed the Code a little bit.
The Thread titles now are only displayed to users who can view the forum the last post is in.

PHP Code:

//start get last thread title from forums
        
$lastposttitle $DB_site->query("SELECT title FROM thread WHERE forumid='$forum[forumid]' ORDER BY lastpost DESC");
        
$lastposttitle $DB_site->fetch_array($lastposttitle);
        
$lastposttitle $lastposttitle[title];
        
$has_access=getpermissions($forum[forumid]);
        if (!
$has_access['canview']) {
            
$lastposttitle='';
        }
        else
        {
            if (
strlen($lastposttitle) > 20) {
               
$lastposttitle substr($lastposttitle,0,18);
               
$lastposttitle .= "..";
               }
        }
        
//end get last thread title from forums 


somnium 07-28-2001 09:33 PM

many thx for that!!!

EXCHANGE 07-29-2001 09:10 AM

Another thing.
There is a Problem when moving a thread and leave a link in another forum.
So here is another fix:
PHP Code:

        //start get last thread title from forums
        
$lastposttitle $DB_site->query("SELECT iconid,title FROM thread WHERE forumid='$forum[forumid]' AND open!='10' ORDER BY lastpost DESC");
        
$lastposttitle $DB_site->fetch_array($lastposttitle);
        
$threadicon $lastposttitle[iconid];
        
$lastposttitle $lastposttitle[title];

        
$has_access=getpermissions($forum[forumid]);
        if (!
$has_access['canview']) {
            
$lastposttitle='';
        }
        else
        {
            if (
$threadicon 0) {
                
$icon="<img src=\"images/icons/icon$threadicon.gif\">";
                }
            else {
                
$threadicon=1;
                
$icon="<img src=\"images/icons/icon$threadicon.gif\">";
            }
            if (
strlen($lastposttitle) > 20) {
               
$lastposttitle substr($lastposttitle,0,18);
               
$lastposttitle .= "..";
               }
        }
//end get last thread title from forums 

I also included the Thread icons, so change forumhome_lastpostby template to this:

Code:

<table cellpadding="0" cellspacing="0" border="0" width="100%" id="ltlink">
  <tr align="right">
    <td nowrap rowspan="2">$icon</td>
    <td nowrap><smallfont><a href="showthread.php?s=$session[sessionhash]&goto=lastpost&forumid=$forum[forumid]"><b>$lastposttitle</b></a></smallfont></td>
    <td nowrap rowspan="2">&nbsp;<a href="showthread.php?s=$session[sessionhash]&goto=lastpost&forumid=$forum[forumid]"><img src="images/lastpost.gif" border="0" alt="Go to last post"></a></td>
  </tr>
  <tr align="right">
    <td nowrap><smallfont>$forum[lastpostdate] <font color="#666686">$forum[lastposttime]</font><br>
      von <a href="member.php?s=$session[sessionhash]&action=getinfo&find=lastposter&forumid=$forum[forumid]"><b>$forum[lastposter]</b></a></smallfont></td>
  </tr>
</table>



All times are GMT. The time now is 12:35 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.01431 seconds
  • Memory Usage 1,774KB
  • 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
  • (6)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete