vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Member Archives (https://vborg.vbsupport.ru/forumdisplay.php?f=202)
-   -   you guys already have this hack? (https://vborg.vbsupport.ru/showthread.php?t=11677)

SNA 03-17-2001 10:58 PM

Its like the UBB look, it shows the last post icon and title for each forum instead of just the username , time and date on the forum front page (index.php) in the LAST POST column.

I can post it if nobody has released it

SNA

03-18-2001 12:05 AM

:rolleyes:

03-18-2001 12:20 AM

1 Attachment(s)
Ill take that as a 'what the hell are you talking about'

heres what i mean

03-18-2001 01:01 AM

im sorry, but that seems compleatly useless!
(hey 100 posts)

03-18-2001 05:44 AM

This is a function my members have been using on my ubb and I would love to have a hack for VB that does it!

Where is it at?

03-18-2001 09:26 AM

You can do it by editing the templates.
Its easy to do.

03-18-2001 12:41 PM

You have to hack the templates yes but you need to write code to get the latest title and icon in each forum.

If you can do it without writing a function please let me know.

I can post the hack on how I did it you guys want.

03-18-2001 01:08 PM

Thank you SNA

I would love to try your hack on my board. waiting ..

03-18-2001 01:33 PM

EDITED >> 3-18-2001 11:07 AM Central Time
Fixed the Select Statement to take in consideration if the thread was moved or not by looking for open='1'.



Add this code to the bottom of admin/functions.php before ?>


PHP Code:

function active_topic($theforumid)
{
global 
$DB_site;

$activeresult $DB_site->query("SELECT thread.title,thread.iconid,icon.iconpath FROM thread LEFT JOIN icon ON thread.iconid=icon.iconid WHERE forumid='$theforumid' AND open='1' ORDER BY lastpost DESC LIMIT 1");
$activeresults $DB_site->fetch_array($activeresult);

return(
$activeresults);




Add this code to index.php

PHP Code:

    $lastposthome active_topic($forum[forumid]);
    
$lastposthome[title] = substr($lastposthome[title],0,40) . "...";
    if(
$lastposthome[iconpath]){
    } else {
    
$lastposthome[iconpath] = "images/icons/icon1.gif";
    } 

after

PHP Code:

if ($forum['lastpost']>0) {
          
$forum['lastpostdate']=vbdate($dateformat,$forum['lastpost']);
          
$forum['lastposttime']=vbdate($timeformat,$forum['lastpost']); 

now add this code to forumdisplay.php

PHP Code:

    $lastposthome active_topic($forum[forumid]);
    
$lastposthome[title] = substr($lastposthome[title],0,40) . "...";
    if(
$lastposthome[iconpath]){
    } else {
    
$lastposthome[iconpath] = "images/icons/icon1.gif";
    } 

after

PHP Code:

        if ($forum['lastpost']>0) {
          
$forum['lastpostdate']=vbdate($dateformat,$forum['lastpost']);
          
$forum['lastposttime']=vbdate($timeformat,$forum['lastpost']); 



Now to get it to show up on you board.


Edit the 'forumhome' template.


replace it with this

Code:

<img  src="$lastposthome[iconpath]" border=0>
&nbsp;<a href="showthread.php?s=$session[sessionhash]&goto=lastpost&forumid=$forum[forumid]"><smallfont>$lastposthome[title]</smallfont></a>
<smallfont>(by <a href="member.php?s=$session[sessionhash]&action=getinfo&find=lastposter&forumid=$forum[forumid]">$forum[lastposter]</a>)</smallfont>
<br>
<smallfont>$forum[lastpostdate]</smallfont> <smallfont COLOR="#6c6081">$forum[lastposttime]</smallfont>


There you go...

Again, I am new to PHP/MySQL and right now I know how to make things work. Whether its efficient or not, thats another story, im getting there :)

PM me if you have any problems.

03-19-2001 11:02 AM

LittleBird. Did it work?


All times are GMT. The time now is 12:06 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.01124 seconds
  • Memory Usage 1,751KB
  • 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
  • (5)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)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