NOTE! This website and the forum are pretty much in archival mode and are often prone to being broken.
If you need something or would like to reconnect with the community reach out to Monkeydog on Discord (username Monkeydog189).
News Feeder - Grove of Game Making and General Programming - Monkey Productions

Jump to content


Photo
- - - - -

News Feeder


  • Please log in to reply
3 replies to this topic

#1 E.Nigma

E.Nigma

    Ryo

  • Members
  • 1276 posts
  • Location:Earth
  • Interests:Stuff
  • Gender:Male

Posted 10 July 2007 - 04:01 PM

That's something i've always wondered about. Im not any good with PHP so i dont know what to do with it, but i've always been curious on how exactly its done. The first post of the most recent.... 4 or so topics in a certain forum appearing on the MAIN PAGE of whatever website you're running. how's that done?
  • 0
Posted ImageOh! ....Cake!?

#2 Hyperlisk

Hyperlisk

    Meow.

  • StarCraft
  • 3895 posts
  • Location:The Land Unknown
  • Gender:Male

Posted 10 July 2007 - 04:53 PM

If you are using IPB, you can just use the ssi.php page that comes with it. Other than that, you need to know mySQL.
  • 0
TIP.png

#3 lazlo falconi

lazlo falconi

    Knows Nothing

  • YATTAMAN!!
  • 4635 posts
  • Location:Cartoon Hell
  • Interests:Presidency.
  • Gender:Male

Posted 21 August 2007 - 06:09 PM

Making SQL queries in itself isn't hard, through, depending on how your forum software sets the tables, it could be very difficult to find the most recent posts. Also lol month old thread.
  • 0

samussig_zpsf75ec25d.png


Or, to put it more politely, "Neener neener."


-all my friends that came with are drinking out in the car
--forever alone
+\- joke's on them i'm too drunk to drive


#4 matrim

matrim

    Killer Coder Ninja Monkey

  • Members
  • 478 posts
  • Location:Sweden
  • Gender:Male

Posted 30 August 2007 - 01:02 AM

Really just making quick links to forum threads or things are doneas


$sql = mysql_query("SELECT * FROM $table order by date limit 5",$db);
while ($list = mysql_fetch_array($sql)) {
   echo '<a href="'.$list["link"].'">'.$list["item"].'</a><br>';
}


explination:

$table = table name in the database
date = the column in the table "$table"
$list = array containing the table row currently looped in the while statement
$list["link"] = the column link in the table $table, it changes to the value of link on every row looped
$list["item"] = the column item (name of thread/user/news) in table $table, it changes to the value of link on every row looped


NOTE: this requires that you have a connaction to the database saved in a variable $db (seen in the sql_query line)
  • 0

-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
Yes private, thats exactly it. War's over, we won.
Turns out you're the big hero and we're gonna hold a parade in your honor.
I get to drive the float, and Simmons here IS IN CHARGE OF CONFETTI!!!
-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users