Welcome, Guest. Please Login or Register.
April 26, 2025, 11:46:11 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  |  General Category  |  Feedback  |  recentTopics in the new SSI.php « previous next »
Pages: [1] Reply Ignore Print
Author Topic: recentTopics in the new SSI.php  (Read 786 times)
Spaceman-Spiff
Mod Team
YaBB God
*****
Posts: 3689


My $txt[228]

recentTopics in the new SSI.php
« on: February 27, 2003, 01:34:17 AM »
Reply with quote

In the new SSI.php (v.1.5.1) the queries have been changed a lot from v1.4.1. I heard its more optimized than the older version.

but one thing i don't like in the new (1.5.1) SSI.php recentTopics is u can get something like:
QuoteRecent Forum Topics:
» WooHoo by zip
» Re: Finally....it's here -_-||| by c
» Re: Finally....it's here -_-||| by f
» Re: Finally....it's here -_-||| by a
» Re: Finally....it's here -_-||| by b
» Re: Finally....it's here -_-||| by d
» Re: Finally....it's here -_-||| by c
» Finally....it's here -_-||| by e
the same topic can be repeated a few times
now i'm thinking of using the older SSI.php version
i'm just wondering how much difference does the new version make in the speed optimization?
is it really significant compared to v1.4.1?
Logged

   My mods, ysePak, codes, tutorials
    Support question IMs = bad.
[Unknown]
Global Moderator
YaBB God
*****
Posts: 7830


ICQ - 179721867unknownbrackets@hotmail.com WWW
Re:recentTopics in the new SSI.php
« Reply #1 on: February 27, 2003, 01:45:17 AM »
Reply with quote

UNTESTED!!!

Change the first query in recentTopics from:
SELECT m.ID_MSG

To:
SELECT DISTINCT m.subject, m.ID_MSG

That /should/ do it.

-[Unknown]
Logged
Spaceman-Spiff
Mod Team
YaBB God
*****
Posts: 3689


My $txt[228]

Re:recentTopics in the new SSI.php
« Reply #2 on: February 27, 2003, 02:08:11 AM »
Reply with quote

doesnt work
i also have tried SELECT DISTINCT t.ID_TOPICS, m.ID_MSG

also tried using GROUP BY t.ID_TOPICs, but that screws up the order
Logged

   My mods, ysePak, codes, tutorials
    Support question IMs = bad.
Joseph Fung
Global Moderator
YaBB God
*****
Posts: 4512


Keep smiling: it makes others nervous.

WWW
Re:recentTopics in the new SSI.php
« Reply #3 on: February 27, 2003, 02:39:18 AM »
Reply with quote

Ok - here's something that should work a little better ;)

The problem is with    $request = mysql_query("
      SELECT m.ID_MSG
      FROM {$db_prefix}messages AS m, {$db_prefix}topics AS t, {$db_prefix}boards AS b,{$db_prefix}categories AS c
      WHERE t.ID_TOPIC=m.ID_TOPIC
specifically in the WHERE t.ID_TOPIC=m.ID_TOPIC line.  That's just checking to make sure the message is in the topic.  What you need is to change that part to WHERE m.ID_MSG = t.ID_LAST_MSG

Note, The reason that DISTINCT wasn't working is because DISTINCT looks for unique sets of results, not unique values for one field.
Logged

[Unknown]
Global Moderator
YaBB God
*****
Posts: 7830


ICQ - 179721867unknownbrackets@hotmail.com WWW
Re:recentTopics in the new SSI.php
« Reply #4 on: February 27, 2003, 03:45:15 AM »
Reply with quote

Oops, my mistake.  I don't use DISTINCT all to much.  I shoulda' looked more closely at the query :$.

-[Unknown]
Logged
Spaceman-Spiff
Mod Team
YaBB God
*****
Posts: 3689


My $txt[228]

Re:recentTopics in the new SSI.php
« Reply #5 on: February 27, 2003, 03:59:20 AM »
Reply with quote

thanks, will try it when i get home :)
Logged

   My mods, ysePak, codes, tutorials
    Support question IMs = bad.
Spaceman-Spiff
Mod Team
YaBB God
*****
Posts: 3689


My $txt[228]

Re:recentTopics in the new SSI.php
« Reply #6 on: February 27, 2003, 06:44:01 AM »
Reply with quote

works great, thanks Joseph :)

i've also added this into the WHERE statement:
AND m.subject NOT LIKE '$txt[yse56]%'
so all the MOVED:... topics won't be shown :)
Logged

   My mods, ysePak, codes, tutorials
    Support question IMs = bad.
Joseph Fung
Global Moderator
YaBB God
*****
Posts: 4512


Keep smiling: it makes others nervous.

WWW
Re:recentTopics in the new SSI.php
« Reply #7 on: February 27, 2003, 02:49:17 PM »
Reply with quote

I'm glad it worked for you! And that's a great idea on the moved topics!
Logged

Pages: [1] Reply Ignore Print 
YaBB SE Community  |  General Category  |  Feedback  |  recentTopics in the new SSI.php « 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 1.278 seconds with 19 queries.