Welcome, Guest. Please Login or Register.
November 26, 2024, 05:51:11 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  |  English User Help  |  English Help  |  Show last post on another page? « previous next »
Pages: [1] Reply Ignore Print
Author Topic: Show last post on another page?  (Read 315 times)
owen100
Noobie
*
Posts: 39


I'm not an alcoholic - alcoholics go to meetings

owen100@hotmail.com WWW
Show last post on another page?
« on: June 22, 2002, 01:07:06 PM »
Reply with quote

Can someone direct me to the relevent thread (I have searched but can't find) or better still, explain how I can display the last message posted on my board on another page within my site?

If that one's too difficult, then I'd be happy to display users and guests online, or my news script or the simple stats displayed on the board's index..... anything really to entise more people to look at the message board.
Logged
mediman
Support Team
YaBB God
*****
Posts: 2858


WWW
Re:Show last post on another page?
« Reply #1 on: June 22, 2002, 01:49:14 PM »
Reply with quote

you can write a little script like

<?php

$full_yabbse_path 
""
$topmem ="5";
$newmes ="5";

if (
$full_yabbse_path == "") {
echo 
"<center><font color=red>Error: full_yabbse_path es vacio!</font><br><br>has to be the same as 'boarddir' in Settings.php!</center>";
exit;
}

$incl = @include_once ($full_yabbse_path."/Settings.php");
if (!
$incl) {
die ( 
"<center><font color=red>Error: full_yabbse_path ($full_yabbse_path) is wrong!</font><br><br>has to be the same as 'boarddir' in Settings.php!</center>" );
}

$db = @mysql_connect($db_server$db_user$db_passwd);
if (!
$db) {
die ( 
"<center><font color=red>Error: db not found and/or connected!</font><br><br>or your settings in Settings.php 'db_server, db_user, db_passwd' of your db are wrong!</center>" );
}

   
$res = @mysql_db_query$db_name"select * from {$db_prefix}members order by posts desc");
   if (!
$res) {
   die ( 
"<center><font color=red>Error: db not found and/or connected!</font><br><br>your settings 'db_name' or/and 'db_prefix' are wrong!</center>" );
   }
   
$num mysql_num_rows($res);
   echo 
"We have $num members in our board!<br><br>";
   echo 
"Our Topposters are: ";
   if (
$num $topmem) {$topmem $num;}
   for (
$i=0$i<$topmem$i++)
   {
    
$nn mysql_result($res$i"realName");
    
$no mysql_result($res$i"posts");
    echo 
"$nn ($no) ";
   }

   
$res2 mysql_db_query$db_name"select memberName from {$db_prefix}members order by dateRegistered desc");

   list(
$memberName) = mysql_fetch_row($res2);
   echo 
"<br><br>Newest member is <font color='red'>$memberName</font>";   

   $res3 
mysql_db_query$db_name"select * from {$db_prefix}messages order by posterTime desc");
   
$num3 mysql_num_rows($res3);
   echo 
"<br><br>We have $num3 message(s) in our board!<br>";
   echo 
"<br>The $newmes newest are: <br>";
   if (
$num3 $newmes) {$newmes $num3;} 
   for (
$i=0$i<$newmes$i++)
   {
      
   $nn mysql_result($res3$i"subject");
        
$no mysql_result($res3$i"posterName");
        echo 
"<br><font color='blue'>$nn</font> de <font color='green'>$no</font>";
   }  

   
$res4 mysql_db_query$db_name"select * from {$db_prefix}topics");
   
$num4 mysql_num_rows($res4);
   echo 
"<br><br>We have $num4 theme(s) in our board!";


   $guests 0;
   $tmpusers = array();
   $res5 mysql_db_query$db_name"select identity FROM {$db_prefix}log_online where 1 order by logTime desc");
   while ($tmp mysql_fetch_array($res5))
   {
      $identity $tmp[0];
      $res6 mysql_db_query$db_name"SELECT realName FROM {$db_prefix}members WHERE (memberName='$identity') LIMIT 1");
      if (mysql_num_rows($res6) > 0){
         $tmp mysql_fetch_row($res6);
         $tmpusers[] = "<a href=\"$boardurl/index.php?action=viewprofile;user=$identity\">$tmp[0]</a>";
      }
      else
         $guests 
++;
   }
   $users implode(", ",$tmpusers);
   $numusersonline sizeof($tmpusers);
   echo "<br><br>Guests: $guests , Members: $numusersonline <br>Members online: $users";
   
mysql_close
($db);

   
?>
or something like that  ;)
« Last Edit: June 22, 2002, 01:54:06 PM by mediman » Logged

mainComm Dev Team
David
Destroyer Dave
Global Moderator
YaBB God
*****
Posts: 5761


I'm not a llama!

WWW
Re:Show last post on another page?
« Reply #2 on: June 22, 2002, 04:06:52 PM »
Reply with quote

Use the SSI.php script in your Sources folder.  Here is an example of howto. http://www.yabb.info/ssi_examples.php
Logged

Pages: [1] Reply Ignore Print 
YaBB SE Community  |  English User Help  |  English Help  |  Show last post on another 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.045 seconds with 21 queries.