vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Member Archives (https://vborg.vbsupport.ru/forumdisplay.php?f=202)
-   -   [release] Most Popular Threads from Last X Hours (https://vborg.vbsupport.ru/showthread.php?t=655)

05-24-2000 10:19 AM

JonnyQuest hacked the Active Threads hack (thank you to those fine contributors to our community) to make this one. He also made a Most Popular Threads ever ... pretty basic mod.

See it included here:

http://www.bigsoccer.com/forum/boards.shtml

05-24-2000 10:46 AM

dns-error right now ... where could i find this to download?

05-24-2000 11:11 AM

Likewise, I'm not able to load your page, but this is an AWESOME hack! I've been working on something similar, but I haven't had the time to iron it out recently.

05-25-2000 01:10 AM

we're back up.

05-25-2000 02:21 AM

huss, congrats that you're online again - but where's this fine hack to download ?

;)

05-25-2000 02:24 AM

Hi Huss,

i'm just looking over your site and saw the small message "PM users click here to check messages."

Is this a hack for vB?

05-28-2000 10:28 AM

Just curious, how do you folks time stamp the most popular posts? I need this feature to highlight the most popular posts of the week.

With UBB i had the server parsing html files for SSI and then executing a custom counter.

Can we take a look at the code please? :)

06-12-2000 09:17 AM

WHoops my bad, forgot I never put it up!!

Most read Today:
Code:

<script language="php">

/*

##############################################################################
# vBulletin Active Topics                                      Version 0.25 #
##############################################################################

*/

/*
##############################################################################
# Load Required Variables                                                    #
##############################################################################
*/

        include("admin/config.php");
        include("class.FastTemplate.php3");

/*
##############################################################################
# Set initial directory to load templates from.                              #
##############################################################################
*/

        $Template_Dir = ".";

/*
##############################################################################
# Set file to output to if post_to_file is equal to 1.                      #
##############################################################################
*/

        $Post_File_Name = "mostread.txt";

/*
##############################################################################
# Initiate FastTemplate                                                      #
##############################################################################
*/

    $displaytemplate = new FastTemplate("$Template_Dir");
    $displaytemplate->strict();

/*
##############################################################################
# Setup initial settings if not specified on command line.                  #
##############################################################################
*/

        if (isset($posts)) {
                $num_active = intval($posts);
        }
        else {
                $num_active = 10;
        }
       
        if (isset($length)) {
                $num_chars = intval($length);
        }
        else {
                $num_chars = 150;
        }


        if (isset($file)) {
                $post_to_file = 1;
                $displaytemplate->define(array(
                        "ActivePage" => "Most-Read-Page.tpl",
                        "ActiveMessage" => "Most-Read-Message.tpl"
                       
                ));
               
        }
        else {
                $post_to_file = 1;
                $displaytemplate->define(array(
                        "ActivePage" => "Most-Read-Page.tpl",
                        "ActiveMessage" => "Most-Read-Message.tpl"
                ));
        }

        if (isset($forum)) {
                $selected_forum = intval($forum);
                $querylatest = "select * from thread where forumid='$selected_forum' and (UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(lastpost))<35000 order by views desc limit $num_active";
        }
        else {
                $querylatest = "select * from thread where (UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(lastpost))<35000 order by views desc limit $num_active";
        }
       
/*
##############################################################################
# Lets Setup and Connect to the Database                                    #
##############################################################################
*/

        $db=mysql_connect($servername,$dbusername,$dbpassword);
        mysql_select_db($dbname);

/*
##############################################################################
# Generate SQL and Query Database                                            #
##############################################################################
*/

        $resultlatest = mysql_query($querylatest,$db);

/*
##############################################################################
# Lets Find the Latest Topics                                                #
##############################################################################
*/

        while ($latest_array = mysql_fetch_array($resultlatest)) {
       
/*
##############################################################################
# Go one-by-one through the result query.                                    #
##############################################################################
*/

        $query_forum = "select * from forum where forumid='$latest_array[forumid]'";
        $result_forum = mysql_query($query_forum,$db);
        $forum_info_array = mysql_fetch_array($result_forum);
       
/*
##############################################################################
# Split the Date to make it nicer.                                          #
##############################################################################
*/
        $datestr1 = substr($latest_array["dateline"],0,10);
        $datetime = substr($latest_array["dateline"],11,8);       
       
/*
##############################################################################
# Assign result info to template                                            #
##############################################################################
*/

        $displaytemplate->assign ("FORUMTITLE"  , $forum_info_array["title"]);
        $displaytemplate->assign ("POSTTITLE"  , $latest_array["title"]);
        $displaytemplate->assign ("POSTUSERNAME"  , $latest_array["postusername"]);
        $displaytemplate->assign ("POSTDATETIME"  , $datetime);
        $displaytemplate->assign ("POSTREPLYCOUNT"  , $latest_array["replycount"]);
       
        $querythread="select * from post where threadid='$latest_array[threadid]' order by dateline asc limit 1";

        $result_thread_text= mysql_query($querythread,$db);

        $result_thread_array = mysql_fetch_array($result_thread_text);

        $displaytemplate->assign ("POSTICON"  , $latest_array["iconid"]);
        $displaytemplate->assign ("LASTPOSTER"  , $latest_array["lastposter"]);
       
        $displaytemplate->assign ("VIEWS"  , $latest_array["views"]);       
       
        $Msg = substr(strip_tags($result_thread_array["pagetext"]),0,$num_chars);
       
        $displaytemplate->assign ("POSTMESSAGE" , $Msg);
        $displaytemplate->assign ("THREADID" , $latest_array["threadid"]);
       
        $displaytemplate->parse  ("FORUMINFO" , ".ActiveMessage");       
        }

/*
##############################################################################
# Parse the Data and Output the whole Page                                  #
##############################################################################
*/

        if ($post_to_file == 1) {
       
        $displaytemplate->parse  ("GLOBAL"    , "ActivePage");
        $displaybody = $displaytemplate->fetch("GLOBAL");
        $fp = fopen("$Post_File_Name", "w");
        fwrite($fp, $displaybody);
        fclose($fp);
        exit();
               
        }
       
       
        $displaytemplate->parse  ("GLOBAL"    , "ActivePage");
        $displaytemplate->FastPrint();
        exit();       

</script>

Most read ever:

Code:

<script language="php">

/*

##############################################################################
# vBulletin Active Topics                                      Version 0.25 #
##############################################################################

*/

/*
##############################################################################
# Load Required Variables                                                    #
##############################################################################
*/

        include("admin/config.php");
        include("class.FastTemplate.php3");

/*
##############################################################################
# Set initial directory to load templates from.                              #
##############################################################################
*/

        $Template_Dir = ".";

/*
##############################################################################
# Set file to output to if post_to_file is equal to 1.                      #
##############################################################################
*/

        $Post_File_Name = "mostreadever.txt";

/*
##############################################################################
# Initiate FastTemplate                                                      #
##############################################################################
*/

    $displaytemplate = new FastTemplate("$Template_Dir");
    $displaytemplate->strict();

/*
##############################################################################
# Setup initial settings if not specified on command line.                  #
##############################################################################
*/

        if (isset($posts)) {
                $num_active = intval($posts);
        }
        else {
                $num_active = 5;
        }
       
        if (isset($length)) {
                $num_chars = intval($length);
        }
        else {
                $num_chars = 150;
        }


        if (isset($file)) {
                $post_to_file = 1;
                $displaytemplate->define(array(
                        "ActivePage" => "Most-Read-Page.tpl",
                        "ActiveMessage" => "Most-Read-Message.tpl"
                       
                ));
               
        }
        else {
                $post_to_file = 1;
                $displaytemplate->define(array(
                        "ActivePage" => "Most-Read-Page.tpl",
                        "ActiveMessage" => "Most-Read-Message.tpl"
                ));
        }

        if (isset($forum)) {
                $selected_forum = intval($forum);
                $querylatest = "select * from thread where forumid='$selected_forum' order by views desc limit $num_active";
        }
        else {
                $querylatest = "select * from thread order by views desc limit $num_active";
        }
       
/*
##############################################################################
# Lets Setup and Connect to the Database                                    #
##############################################################################
*/

        $db=mysql_connect($servername,$dbusername,$dbpassword);
        mysql_select_db($dbname);

/*
##############################################################################
# Generate SQL and Query Database                                            #
##############################################################################
*/

        $resultlatest = mysql_query($querylatest,$db);

/*
##############################################################################
# Lets Find the Latest Topics                                                #
##############################################################################
*/

        while ($latest_array = mysql_fetch_array($resultlatest)) {
       
/*
##############################################################################
# Go one-by-one through the result query.                                    #
##############################################################################
*/

        $query_forum = "select * from forum where forumid='$latest_array[forumid]'";
        $result_forum = mysql_query($query_forum,$db);
        $forum_info_array = mysql_fetch_array($result_forum);
       
/*
##############################################################################
# Split the Date to make it nicer.                                          #
##############################################################################
*/
        $datestr1 = substr($latest_array["dateline"],0,10);
        $datetime = substr($latest_array["dateline"],11,8);       
       
/*
##############################################################################
# Assign result info to template                                            #
##############################################################################
*/

        $displaytemplate->assign ("FORUMTITLE"  , $forum_info_array["title"]);
        $displaytemplate->assign ("POSTTITLE"  , $latest_array["title"]);
        $displaytemplate->assign ("POSTUSERNAME"  , $latest_array["postusername"]);
        $displaytemplate->assign ("POSTDATETIME"  , $datetime);
        $displaytemplate->assign ("POSTREPLYCOUNT"  , $latest_array["replycount"]);
       
        $querythread="select * from post where threadid='$latest_array[threadid]' order by dateline asc limit 1";

        $result_thread_text= mysql_query($querythread,$db);

        $result_thread_array = mysql_fetch_array($result_thread_text);

        $displaytemplate->assign ("POSTICON"  , $latest_array["iconid"]);
        $displaytemplate->assign ("LASTPOSTER"  , $latest_array["lastposter"]);
       
        $displaytemplate->assign ("VIEWS"  , $latest_array["views"]);       
       
        $Msg = substr(strip_tags($result_thread_array["pagetext"]),0,$num_chars);
       
        $displaytemplate->assign ("POSTMESSAGE" , $Msg);
        $displaytemplate->assign ("THREADID" , $latest_array["threadid"]);
       
        $displaytemplate->parse  ("FORUMINFO" , ".ActiveMessage");       
        }

/*
##############################################################################
# Parse the Data and Output the whole Page                                  #
##############################################################################
*/

        if ($post_to_file == 1) {
       
        $displaytemplate->parse  ("GLOBAL"    , "ActivePage");
        $displaybody = $displaytemplate->fetch("GLOBAL");
        $fp = fopen("$Post_File_Name", "w");
        fwrite($fp, $displaybody);
        fclose($fp);
        exit();
               
        }
       
       
        $displaytemplate->parse  ("GLOBAL"    , "ActivePage");
        $displaytemplate->FastPrint();
        exit();       

</script>


06-12-2000 11:16 AM

Um.. could you also post the tpl file? :) I still havent figured out FastTemplates well enough to create my own.

Thanks!

Shri

06-24-2000 08:15 AM

the tpl files all come frm the active threads hack. this is just a hack of a hack.


All times are GMT. The time now is 11:54 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.01060 seconds
  • Memory Usage 1,813KB
  • 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
  • (2)bbcode_code_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