Jump to content

Recommended Posts

Posted

Does anyone use SMF 2 and is the SSI to show latest post on your frontpage_,main.php?

I had a code that worked years ago, that doesn't work anymore. I am downgrading from IPB. Now I remember why I left SMF...lol

I can't seem to get it too work.

As shown in the SSI example I have this code on the top of the <html>

<?php require("/home/flyakaco/public_html/forums/SSI.php"); ?>

and have this to display the latest post, on my frontpage_main.php

<?php ssi_recentPosts(); ?>

I get an error and my site is all whacked.

Fatal error: Call to undefined function ssi_recentPosts() in /home/flyakaco/public_html/lib/skins/flyalaska_1.0/frontpage_main.php on line 263
  • Like 10
  • Moderators
Posted

i call them like this in the layout tpl

<!-- forum area -->

  <?php
	    require_once('smforum/SSI.php'); // only if not already loaded
	    $data = ssi_recentTopics($num_recent = 3, $exclude_boards = null, $include_boards = null, $output_method = 'array');
	    echo '<table border="0px" bordercolor="#FF960E">';
	    echo '<tr><td colspan="3"><center><h4>Recent Forum Posts</h4><hr height="0.001em" color="#d4d4d4"></center></td></tr>';
	    foreach($data as $post)
		    {echo '<tr><td>'.$post['link'] . ' </td><td> ' . $post['preview'] . ' </td><td> ' . $post['poster']['link'] . '</td></tr>';}
	    echo '</table>';
	    ?>

<!-- end forum area -->

  • Like 1

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...