Jump to content


Integrating posts from IPB forum with website?

  • Please log in to reply
3 replies to this topic

#1 Duskybby

  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 20 February 2012 - 11:16 PM

I'm trying to integrate my website with my Invision Power Board forum. I'm trying to have the posts from the news & updates section to be placed also on the home page automatically. This is the design for that portion of my homepage (sorry if the text offends you). I was able to make the posts display, but I can't figure out how to make it only display from a specific forum. I only want the first post of each topic from the News and Updates section of my forum to display here, but it's currently displaying them all.

This is what I have for the page so far.


include ("includes/global.php");

$news = mysql_query("SELECT * FROM ipb_topics ORDER BY start_date DESC");
while ($news_row = mysql_fetch_assoc($news))
	//get data
	$topic_id = $news_row['tid'];
	$forum_id = $news_row['forum_id'];
	$starter_id = $news_row['starter_id'];
	//get topic name
	$topic_name = mysql_query("SELECT title FROM ipb_topics WHERE tid='$topic_id'");
	$topic_name = mysql_fetch_assoc($topic_name);
	$topic_name = $topic_name['title'];
	//get user name
	$username = mysql_query("SELECT name FROM ipb_members WHERE member_id=$starter_id");
	$username = mysql_fetch_assoc($username);
	$username = $username['name'];
	//get post info
	$post = mysql_query("SELECT post FROM ipb_posts WHERE topic_id=$topic_id");
	$post = mysql_fetch_assoc($post);
	$post = $post['post'];
	echo "<h1>$topic_name</h1> $post<br /><br /> posted by $username<br /><br />";


Any help will do. Please. :)

#2 Duskybby

  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 22 February 2012 - 01:32 AM


#3 ManiacDan

  • Staff Alumni
  • Likely to be eaten by a grue
  • 2,608 posts
  • LocationPhiladelphia PA

Posted 22 February 2012 - 03:05 PM

Please don't bump your threads or report a moderate as an abusive member.  Your thread is in the correct section and if someone is interested in replying they will.

NOTE: Sometimes the answers you get on a forum won't be entirely correct. Think for yourselves. Why did you ask for evens and get odds? Why is the output sorted backward? Do the research, learn something.

"The greatest tragedy of this changing society is that people who never knew what it was like before will simply assume that this is the way things are supposed to be." -2600 Magazine, Fall 2002

Think we're being rude? Maybe you asked a bad question or you're a Help Vampire. Trying to argue intelligently? Please read this.

#4 floridaflatlander

  • Members
  • PipPipPip
  • Advanced Member
  • 673 posts
  • LocationFlorida

Posted 22 February 2012 - 04:26 PM

With smf you can use the ssi functions, IPB has got to use something like that, have you posted this topic on their forum?

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users