Welcome, Guest. Please Login or Register.
May 08, 2025, 12:56:22 PM
Home Help Search Log in Register
News: If you are still using YaBB SE, please consider upgrading to SMF as soon as possible.

YaBB SE Community  |  Development  |  Mod Ideas and Creation  |  Top 10 topics by views() « previous next »
Pages: [1] Reply Ignore Print
Author Topic: Top 10 topics by views()  (Read 270 times)
pege
Full Member
***
Posts: 146


Top 10 topics by views()
« on: November 09, 2002, 09:57:47 PM »
Reply with quote

Is there already a function for the top 10 topics by views (currently used on the stats page) that I could hack into the SSI.php?  If so, where?

Thanks
Logged
Spaceman-Spiff
Mod Team
YaBB God
*****
Posts: 3689


My $txt[228]

Re:Top 10 topics by views()
« Reply #1 on: November 09, 2002, 11:51:55 PM »
Reply with quote

it's not currently in SSI.php, but u can hack it yourself, just copy the source code from the stats page.. (Stats.php)
Logged

   My mods, ysePak, codes, tutorials
    Support question IMs = bad.
adRIAmYCin
Noobie
*
Posts: 1


Re:Top 10 topics by views()
« Reply #2 on: November 10, 2002, 10:35:28 AM »
Reply with quote

Create this code as stat2.php and add this file into Source directory.
Quote<?php
$statsphpver ="YaBB SE 1.4.1";
function display_stats2() {
global $txt, $color,$yytitle,$boardurl,$yyheaderdone,$settings,$months,$db_prefix,$username,$REMOTE_ADDR,$REQUEST_URI,$modSettings,$imagesdir,$mbname,$sourcedir,$totalt,$totalm,$messnum, $scripturl;
// Topic replies top 10
$topic_reply_result = mysql_query("SELECT {$db_prefix}topics.*,m.* FROM {$db_prefix}topics,{$db_prefix}messages as m, {$db_prefix}messages as mes WHERE (m.ID_MSG={$db_prefix}topics.ID_FIRST_MSG && mes.ID_MSG={$db_prefix}topics.ID_LAST_MSG) ORDER BY {$db_prefix}topics.numReplies DESC LIMIT 10");
while ($row_topic_reply = mysql_fetch_array($topic_reply_result))
{
  echo "<a href=\"index.php?board=$row_topic_reply[ID_BOARD];action=display;threadid=$row_topic_reply[ID_TOPIC];start=0\" target=\"_blank\">$row_topic_reply[subject]&nbsp;[$row_topic_reply[numReplies]]</a><br>";
}
EOT;
}
?>

And then insert this code in the page that you want to show top ten topic
Quote<? { include_once "$sourcedir/Stats2.php"; display_stats2(); } ?>
Logged
pege
Full Member
***
Posts: 146


Re:Top 10 topics by views()
« Reply #3 on: November 10, 2002, 08:22:16 PM »
Reply with quote

kewl guys...thanks.
Logged
Pages: [1] Reply Ignore Print 
YaBB SE Community  |  Development  |  Mod Ideas and Creation  |  Top 10 topics by views() « previous - next »
 


Powered by MySQL Powered by PHP YaBB SE Community | Powered by YaBB SE
© 2001-2003, YaBB SE Dev Team. All Rights Reserved.
SMF 2.1.4 © 2023, Simple Machines
Valid XHTML 1.0! Valid CSS

Page created in 0.040 seconds with 20 queries.