Welcome, Guest. Please Login or Register.
October 06, 2024, 04:34:28 AM
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  |  want Stats to display at my first page. « previous next »
Pages: [1] Reply Ignore Print
Author Topic: want Stats to display at my first page.  (Read 2013 times)
sunpetch
Noobie
*
Posts: 7


I'm a llama!

want Stats to display at my first page.
« on: November 24, 2003, 06:16:42 PM »
Reply with quote

Hello Guy..

I don;t know if this can do or not..but this is what i am looking for.

I want a stats detail : Top 10 Topics (by Replies) and Top 10 Topics (by Views) to be on my first index page..

I am trying by copy the code from /source/stats.php into my index.html and change index.html to index.php but it is not working T_T.. What should i do ??

Thank you very much
Logged
Ayeka
Jr. Member
**
Posts: 80


Good & Evil, there is never one without the other.

WWW
Re:want Stats to display at my first page.
« Reply #1 on: November 24, 2003, 10:24:56 PM »
Reply with quote

For your newly converted index.htm (php) page, do you have it defined as a PHP page:

at the very top, first thing:

<?php


at the very bottom:

?>


Then it should work, although, I'm not sure if simply copying and pasting the code would give you the desired layout of your page :)
Logged

--Ayeka
Master of the purple!
HAHAhahahahahaha!
sunpetch
Noobie
*
Posts: 7


I'm a llama!

Re:want Stats to display at my first page.
« Reply #2 on: November 25, 2003, 01:25:26 AM »
Reply with quote

Hi,

Yes, I do put the php code and change the index.html to index.php.... but it is still not working..T_T.. I just copy the code and paste...^_^.. So I believe that it is not enough..Do I have to remove the </html> too ??

I also trying to browse only the soucre/stats.php only ,but nothing happen..there is no display at all...T_T

Is there any file that i have to include them first ??
Logged
Ayeka
Jr. Member
**
Posts: 80


Good & Evil, there is never one without the other.

WWW
Re:want Stats to display at my first page.
« Reply #3 on: November 25, 2003, 03:35:22 AM »
Reply with quote

Well you could do something like this:


<?php
echo ' Insert all of your HTML stuff in here between single quotes';

   include_once(
"$sourcedir/stats.php");
   
display_stats();
?>



That might work, I haven't really sat down to figure this one out yet.  But it is a cool idea.
Logged

--Ayeka
Master of the purple!
HAHAhahahahahaha!
sunpetch
Noobie
*
Posts: 7


I'm a llama!

Re:want Stats to display at my first page.
« Reply #4 on: November 25, 2003, 05:42:17 PM »
Reply with quote

HI,

Here is what i did... but there is some problem with the URL link T_T ..the  : $scripturl

here is my code

<table>
<?

conn_db();


   $topic_view_result = mysql_query("
      SELECT m.subject, t.ID_TOPIC, t.ID_BOARD, t.numViews
      FROM yabbse_topics AS t,yabbse_messages AS m, yabbse_messages AS mes , yabbse_boards AS b, yabbse_categories AS c
   WHERE m.ID_MSG=t.ID_FIRST_MSG
      AND mes.ID_MSG=t.ID_LAST_MSG
      AND t.ID_BOARD=b.ID_BOARD
      AND c.ID_CAT=b.ID_CAT

   ORDER BY t.numViews DESC limit 10") ;
// it is 'ORDER BY t.numReplies DESC")' for by replies...
// 'limit 10'  is for 10 record shown
while ($row_topic_view = mysql_fetch_array($topic_view_result))
   {
      echo '
                           <tr>
                              <td><font size="2"><a href="' . $scripturl . '?board=' . $row_topic_view['ID_BOARD'] . ';action=display;threadid=' . $row_topic_view['ID_TOPIC'] . ';start=0">' . $row_topic_view['subject'] . '</a></font></td>
                              <td align="right"><font size="2">' . $row_topic_view['numViews'] . '</font></td>
                           </tr>';
   }
function conn_db()
{
mysql_connect ("localhost","root","");
mysql_select_db("yabbse");
return;
}
?>
</table>
Logged
sunpetch
Noobie
*
Posts: 7


I'm a llama!

Re:want Stats to display at my first page.
« Reply #5 on: November 25, 2003, 05:46:10 PM »
Reply with quote

I belive the  $scripturl didn;t select the right url...T_T..

This is the link that show to me..

http://www.ebetta2u.com/?board=3;action=display;threadid=7;start=0

my yabbse root is www.ebetta2u.com/webboard/

what should i do ??
Thank you
Logged
Anguz
YaBB God
*****
Posts: 641


llama me?!

WWW
Re:want Stats to display at my first page.
« Reply #6 on: November 27, 2003, 06:47:01 AM »
Reply with quote

SSI.php is your answer

http://www.ebetta2u.com/webboard/ssi_examples.php

these'd be the two you want:

<? topTopicsViews(); ?>
<? topTopicsReplies(); ?>
Logged

My Mods: Avatar & Sig Size Control, No Show Msg Subject, Msg URL Composer, Built-in Avatar Rand, Built-in Sig Rand, Remove New-lines Excess, Show All Stars, Search Bar, Smart URLs
Pages: [1] Reply Ignore Print 
YaBB SE Community  |  Development  |  Mod Ideas and Creation  |  want Stats to display at my first page. « 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.033 seconds with 21 queries.