Author Topic: SSI help  (Read 6296 times)

Offline silentfreak

  • Junior Phone Loser
  • **
  • Posts: 28
  • 1337 13V3L: +1/-7
SSI help
« on: August 28, 2006, 11:46:11 PM »
I'm trying to integrate my forum throughout my site.  Is it possible to display the latest topics based on when they are first posted?

Once a reply has been sent through a topic will jump to the top of the list! I do not want that to happen.  Here's my code.

Code: [Select]
<?php
$exclude 
= array('1','2','3','4','5','7','8','9','10');
$topics ssi_recentTopics(10$exclude'array');

foreach(
$topics as $topic)
  echo 
$topic['link'], </br>';
?>


I do not know what I'm doing wrong.  I even tried the ssi_topTopicsViews function.

Offline Reverend Greed

  • PLA Guru
  • *****
  • Posts: 224
  • 1337 13V3L: +42/-7
Re: SSI help
« Reply #1 on: August 28, 2006, 11:59:58 PM »
I'm trying to integrate my forum throughout my site.  Is it possible to display the latest topics based on when they are first posted?

Once a reply has been sent through a topic will jump to the top of the list! I do not want that to happen.  Here's my code.

Code: [Select]
<?php
$exclude 
= array('1','2','3','4','5','7','8','9','10');
$topics ssi_recentTopics(10$exclude'array');

foreach(
$topics as $topic)
  echo 
$topic['link'], </br>';
?>


I do not know what I'm doing wrong.  I even tried the ssi_topTopicsViews function.

Don't use that code  unless you just want topics to be listed over and over again when replies mount.  You need to use mysql_query() or mysql_fetch_array()  to look at the topics board and extrapolate the information from the timestamp of the post.

Just an FYI going forward regarding your code.....

Find:
Code: [Select]
echo $topic['link'], </br>';
Change to:
Code: [Select]
echo $topic['link'], '<br />';

 ---> XHTML
Reboot America

Offline silentfreak

  • Junior Phone Loser
  • **
  • Posts: 28
  • 1337 13V3L: +1/-7
Re: SSI help
« Reply #2 on: August 29, 2006, 12:10:58 AM »
Ok, cool.  I know how to add mysql_query() but I don't know how to write the actual query for what I want to do.  Can you show me how?

Offline Reverend Greed

  • PLA Guru
  • *****
  • Posts: 224
  • 1337 13V3L: +42/-7
Re: SSI help
« Reply #3 on: August 29, 2006, 12:16:25 AM »
1) What is the name your database prefix?

2) How many topics do you want displayed on your page?
Reboot America

Offline silentfreak

  • Junior Phone Loser
  • **
  • Posts: 28
  • 1337 13V3L: +1/-7
Re: SSI help
« Reply #4 on: August 29, 2006, 12:19:18 AM »
1) What is the name your database prefix?

2) How many topics do you want displayed on your page?

1)  smf_

2) 10

Offline Reverend Greed

  • PLA Guru
  • *****
  • Posts: 224
  • 1337 13V3L: +42/-7
Re: SSI help
« Reply #5 on: August 29, 2006, 12:26:48 AM »
Use the code below and add it to your PHP.  This query will return the topic title and time.  It will get the last 10 created topics whether there have been replies or not.

Code: [Select]
SELECT t.ID_TOPIC, t.ID_BOARD, t.isSticky, t.locked,
m.subject, m.posterName, m.posterTime
FROM smf_topics AS t
INNER JOIN smf_messages AS m
  ON t.ID_FIRST_MSG = m.ID_MSG
ORDER BY m.posterTime ASC
LIMIT 0, 10
Reboot America

Offline ryanfido

  • I smoke rocks.
  • Lieutenant Cactus
  • *****
  • Posts: 261
  • 1337 13V3L: +16/-60
  • You think you know? You have no brain.
Re: SSI help
« Reply #6 on: August 30, 2006, 12:09:53 AM »
Use the code below and add it to your PHP.  This query will return the topic title and time.  It will get the last 10 created topics whether there have been replies or not.

Code: [Select]
SELECT t.ID_TOPIC, t.ID_BOARD, t.isSticky, t.locked,
m.subject, m.posterName, m.posterTime
FROM smf_topics AS t elitehaxortothemaxor
INNER JOIN smf_messages AS m
  ON t.ID_FIRST_MSG = m.ID_MSG
ORDER BY m.posterTime ASC
LIMIT 0, 10,60

as you can tell ive made some edits, you should be fine now

Offline Reverend Greed

  • PLA Guru
  • *****
  • Posts: 224
  • 1337 13V3L: +42/-7
Re: SSI help
« Reply #7 on: August 30, 2006, 02:23:27 PM »
Too cute.   :P
Reboot America

Offline ryanfido

  • I smoke rocks.
  • Lieutenant Cactus
  • *****
  • Posts: 261
  • 1337 13V3L: +16/-60
  • You think you know? You have no brain.
Re: SSI help
« Reply #8 on: August 30, 2006, 03:28:15 PM »
Too cute.   :P

im never too cute, i am the ultimate bonesaw