Welcome, Guest. Please Login or Register.
May 14, 2025, 10:53:38 PM
Home Help Search Log in Register
News: SMF is the next generation in forum software, almost completely re-written from the ground up, make sure you don't fall for cheap imitations that suffer from feature bloat!

YaBB SE Community  |  Development  |  Mod Ideas and Creation  |  Looking for someone to make a simple SSI.php type mod « previous next »
Pages: [1] Reply Ignore Print
Author Topic: Looking for someone to make a simple SSI.php type mod  (Read 1341 times)
Royce
Noobie
*
Posts: 44


I'm a llama!

Looking for someone to make a simple SSI.php type mod
« on: July 09, 2003, 12:01:18 AM »
Reply with quote

I basically just need someone to write a *simple* SSI.php type file that displays the 8 most (or whatever I define) recent topics that also snips topics longer than say 30 characters.  It would ended up looking like this on the page that calls the SSI.php type script.

>>Joe bob likes monkeys
>>Why is the sky blue?
>>This is a really long topic tha... (ex. of a snipped topic)
>>Bla Bla Bla
>>La la la la la

I once had a script like this when I had the perl version and loved it.  The current SSI.php throws up tons of errors (even when error reporting is off) so I'd love it if someone could make this small little script for me.  If you live in the socal area, I'll be sending free lift tickets your way in exchange  ;)   THANKS FOR ANY HELP!!  ;D
Logged
[Unknown]
Global Moderator
YaBB God
*****
Posts: 7830


ICQ - 179721867unknownbrackets@hotmail.com WWW
Re:Looking for someone to make a simple SSI.php type mod
« Reply #1 on: July 09, 2003, 12:26:04 AM »
Reply with quote

LOL, I do this on my site AND I live in LA.  But, I don't need any tickets :P..

$result = mysql_query("
   SELECT ms.subject, t.ID_TOPIC, b.ID_BOARD
  FROM {$yyprefix}topics AS t
     LEFT JOIN {$yyprefix}messages AS m ON (m.ID_TOPIC = t.ID_TOPIC)
     LEFT JOIN {$yyprefix}boards AS b ON (b.ID_BOARD = t.ID_BOARD)
     LEFT JOIN {$yyprefix}categories AS c ON (c.ID_CAT = b.ID_CAT)
     LEFT JOIN {$yyprefix}messages AS ms ON (ms.ID_MSG = t.ID_FIRST_MSG)
  WHERE t.ID_LAST_MSG = m.ID_MSG
     AND c.memberGroups = ''
  ORDER BY m.ID_MSG DESC
  LIMIT 8") or die(mysql_error());
while ($row = mysql_fetch_assoc($result))
{
  if (strlen($row['subject']) > 30)
     $row['subject'] = substr($row['subject'], 0, 28) . '...';
  echo '<a href="index.php?board=' . $row['ID_BOARD'] . ';action=display;threadid=' . $row['ID_TOPIC'] . ';start=new">' . $row['subject'] . '</a><br />';
}
mysql_free_result($result);


Man, I really screwed thsat up at first.

Be warned that this had been adapted to 1.5.x from code for 1.6.0.  I think it works...

-[Unknown]
« Last Edit: July 09, 2003, 01:23:41 AM by [Unknown] » Logged
Royce
Noobie
*
Posts: 44


I'm a llama!

Re:Looking for someone to make a simple SSI.php type mod
« Reply #2 on: July 09, 2003, 12:37:33 AM »
Reply with quote

Sorry if this is a dumb question but, where exactly do I put this?
Logged
grosbouff
Noobie
*
Posts: 9


I'm a llama!

Re:Looking for someone to make a simple SSI.php type mod
« Reply #3 on: July 09, 2003, 08:52:47 AM »
Reply with quote

and wich files do we include ?
(it interessed me also  ;D)
Logged
Royce
Noobie
*
Posts: 44


I'm a llama!

Re:Looking for someone to make a simple SSI.php type mod
« Reply #4 on: July 09, 2003, 03:39:35 PM »
Reply with quote

put that code in a php file and don't forget the <?php ?> tag.  Use php include to call it into the page you wish.  Thanks again Unknown for this!
Logged
Royce
Noobie
*
Posts: 44


I'm a llama!

Re:Looking for someone to make a simple SSI.php type mod
« Reply #5 on: August 26, 2003, 07:05:31 PM »
Reply with quote

Just noticed that the above code doesn't censor the words.  I had a nice S H I T on my homepage!  Can anyone fix this?  Thanks!
Logged
[Unknown]
Global Moderator
YaBB God
*****
Posts: 7830


ICQ - 179721867unknownbrackets@hotmail.com WWW
Re:Looking for someone to make a simple SSI.php type mod
« Reply #6 on: August 26, 2003, 10:35:16 PM »
Reply with quote

Find:

while ($row = mysql_fetch_assoc($result))
{
 if (strlen($row['subject']) > 30)


Replace:

while ($row = mysql_fetch_assoc($result))
{
 CensorTxt($row['subject']);
 if (strlen($row['subject']) > 30)


-[Unknown]
Logged
Pages: [1] Reply Ignore Print 
YaBB SE Community  |  Development  |  Mod Ideas and Creation  |  Looking for someone to make a simple SSI.php type mod « 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.135 seconds with 20 queries.