Jump to content

IP Board


flyalaska

Recommended Posts

Is anyone else using IPBoard, like the one here. I am having trouble with the latest post on my main site. Their SSI is really bad. The other option is to use their IP Content module. I don't want to spend another $50, for IP COntent. Doeas someone have a script to show the latest post from my board to display on my main page?

Link to comment
Share on other sites

  • Administrators

What I do is this, read the RSS feed of the forum:

http://forum.phpvms....ype=forums&id=1

Replace that with your URL, and the id=1 is the id of the forum.

Then the code (you can see in the dashboard), I use in phpVMS is:

$file = new CodonWebService();
$contents = $file->get("YOUR URL HERE");
$feed = simplexml_load_string($contents);
$contents = '';

$i = 1;
$count = 5; // Show the last 5
foreach ($feed->channel->item as $news) {
           	$news_content = (string )$news->description;
           	$date_posted = str_replace('-0400', '', (string )$news->pubDate);

           	// YOU CAN CUSTOMIZE THIS
           	$contents .= "<div class=\"newsitem\">
							<b>{$news->title}</b> <br />{$news_content}
							<br /><br />
							Posted: {$date_posted}
						</div>";

           	if ($i++ == $count)
               	break;
       	}
}

// ECHO THE HTML
echo $contents;

I elected to go that route because the databases are different, I don't want to open another connection.

You can also cache this, which I'm going to add the code to do right now in the next beta

Link to comment
Share on other sites

  • 3 months later...
  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...