Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > General > Member Archives
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Details »»

Version: , by Mutt Mutt is offline
Developer Last Online: Mar 2013 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 01-11-2002 Last Update: Never Installs: 0
 
No support by the author.

I miss the old active topics addon for ubb. I had worked on it and and added lots of features to it. My members really liked it.

anyway, changing to VB has left a void for those members. I know we have lots of ways to look up the latest post, but it's just not the same

I've been throwing one together and it's working out pretty nice

here it is on the corvette site
http://www.ccdv.com/forum/activetopics.php

I'll tell you the things I still need to do and maybe one of ya can point me in the right direction. I'm pretty damn good, but honestly, I don't really know php. some of it is easy and then I have stupid stuff like this.

the idea is to list the last 20 posts but only show a thread once so several of the latest posts don't all point to the same thread.
right now it lists every post in a thread. I only want the newest post listed. here's the code I'm using to grab the postids

PHP Code:
$getpostids=$DB_site->query("
    SELECT post.postid FROM post
    WHERE post.visible=1 
$datecut
    ORDER BY post.dateline DESC
    LIMIT "
.($limitlower-1).",$perpage
"
);

//GROUP BY post.threadid 
this will give me the last 20 posts made in any forum but I don't want the same thread showing up multiple times.

see the Group by line I have commented out. If I stick that in right before the order by line, it limits the output to just one post per thread alright, but it gives me the first post in each thread instead of the latest. it's almost like it groups them before it orders them. I need it to be ordered before grouping but if I move the group by line to after the order by line, it doesn't work at all.

next

I'd like to limit the text to x amount of chars and tag on a "... read more" but I don't want to screw up the vb code by cutting off the text in the middle of a tag. do you guys know of any other vb hack that already does this so I could take a look at it instead of reinventing the wheel? maybe one of the news scripts?

finally

I forget there was something else but oh well.

please shoot me any suggestions or ideas.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 01-30-2002, 02:15 PM
newvbuser newvbuser is offline
 
Join Date: Jan 2002
Posts: 57
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi I also miss the active threads topics from UBB

Unfortunately nobody here is interested in hacking the active thread topic as follows:

I Just want a simple listing in a table that is 25 rows and 2 columns wide, with each topic occupying one row (topic title, with link to it in like this:

<a href="titlelinkhtml">title topic name</a>,

so 25 topics per column as follows:

. Topic 1 . Topic2
. Topic 3 . Topic 4
. Topic 5 . Topic 6
. Topic 7 . Topic 8
. Topic 9 . Topic 10
.... upto Topic 50

Called by ssi or php.

Would you be interested in checking out what I used in UBB to get this thing working as above? (2 column nice table) ?
Reply With Quote
  #3  
Old 01-30-2002, 06:28 PM
Mutt's Avatar
Mutt Mutt is offline
 
Join Date: Nov 2001
Posts: 331
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

here, use this. you should be able to modify it to build the table. it's from the any forum news hack


PHP Code:
###################### Start Active Topics #######################

$getheadssql=$DB_site->query("SELECT threadid,thread.title as title,lastpost,forumid,open,replycount,dateline,views,visible,thread.iconid
    "
.iif($foruminfo[allowicons],',icon.title as icontitle,icon.iconpath','')."
    FROM thread
    "
.iif($foruminfo[allowicons],'LEFT JOIN icon ON (icon.iconid = thread.iconid)','')."
    WHERE visible=1 AND open!=10
    ORDER BY lastpost DESC LIMIT 0,
$maxactivetopics
    "
);
while (
$getheads=$DB_site->fetch_array($getheadssql)) {
  
$glforumid=$getheads[forumid];
  
$getforumnamesql=$DB_site->query("SELECT forumid,title FROM forum WHERE forumid=$glforumid");
  
$getforumname=$DB_site->fetch_array($getforumnamesql);

      if (!
$foruminfo[allowicons] or $getheads[iconid]==0) {
        if (
$showdeficon) {
            
$glicon='<img src="images/icons/icon1.gif"  border="0" alt="">';
          } else {
          
$glicon="&nbsp;";
        }
      } else {
         
$glicon="<img src=\"$getheads[iconpath]\" alt=\"$getheads[icontitle]\" width=\"15\" height=\"15\" border=\"0\">";
      }

      if (
$foruminfo[allowicons] and $getheads[pollid]!=0) {
        
$glicon='<img src="{imagesfolder}/poll.gif" alt="Poll" width="15" height="15" border="0">';
      }
  
  
$glthreadid=$getheads[threadid];
  
$gltitle=$getheads[title];
  
$glforumname=$getforumname[title];
  
$glreplycount=$getheads[replycount];
  
$glviewcount=$getheads[views];
  
$gldateline=vbdate($dateformat,$getheads[dateline]);

    if (
$bgclass == "alt2") {
        
$backcolor="{firstaltcolor}";
        
$bgclass "alt1";
    } else {
        
$backcolor="{secondaltcolor}";
        
$bgclass "alt2";
    }  
  
  eval(
"\$getheadsbits .= \"".gettemplate("main_getheadsbit")."\";");

Reply With Quote
  #4  
Old 01-31-2002, 03:11 AM
newvbuser newvbuser is offline
 
Join Date: Jan 2002
Posts: 57
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Mutt thanks for the reply and tip. I am a vb and PHP newbie. What should i do with this code extract and how should I run it? thanks again.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:08 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04632 seconds
  • Memory Usage 2,254KB
  • Queries Executed 17 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (2)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (4)post_thanks_box
  • (4)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (4)post_thanks_postbit_info
  • (3)postbit
  • (4)postbit_onlinestatus
  • (4)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete