Simple Machines Community Forum

SMF Development => Feature Requests => Applied or Declined Requests => Aiheen aloitti: Kan5478 - kesäkuu 27, 2007, 01:59:28 IP

Otsikko: interface to integrate certain threads into a home page
Kirjoitti: Kan5478 - kesäkuu 27, 2007, 01:59:28 IP
sorry if this has been requested/rejected/implemented... but i was unable to find it with the search function...

here's the deal:

we use SMF for a world of warcraft guild... forums are working great... we have a board where we post the latest news/kills/etc...

we currently have a index.html with a logo of the guild and links to forums...

now we want to create a index.php that queries the threads from the news board and displays it on the home page...

if you got php knowledge, it's probably easy... but without them... it's kind of time consuming...

is there anyway to create an interface to facilitate this process? basically a UI to create this php or a wizard... etc...

thank you
Otsikko: Re: interface to integrate certain threads into a home page
Kirjoitti: Oldiesmann - kesäkuu 27, 2007, 03:09:48 IP
Tinyportal (http://www.tinyportal.net) has a nice interface for that - you can put posts from selected boards on the front page, and choose how may to display there.

If you don't want a portal, it's extremely easy to do with SSI.php.
Otsikko: Re: interface to integrate certain threads into a home page
Kirjoitti: Kan5478 - kesäkuu 27, 2007, 05:35:35 IP
awesome info! thanks... i'll give it a try

EDIT: i installed it and then the boards disappeared... all i was able to see what the left menu...
Otsikko: Re: interface to integrate certain threads into a home page
Kirjoitti: 青山 素子 - kesäkuu 27, 2007, 07:47:06 IP
TinyPortal requires slightly different themes from the normal SMF ones. Try switching to the default theme and see if that helps.
Otsikko: Re: interface to integrate certain threads into a home page
Kirjoitti: fshagan - heinäkuu 26, 2007, 02:13:58 AP
SMF has this capability built in, with SSI.PHP.  Your server has to be able to process .PHP files like HTML files.

Take your index.html file and rename it index.php.  At the very top, before the DOCTYPE declaration, include the SSI.PHP file with an include statement:


<?php require("/home/path_to/public_html/your_forums/SSI.php"); ?>


Then, where you want the posts to appear on your home page, such as in a DIV or table in the center column, put:


<?php
$results 
ssi_recentTopics(10null'noecho'); flush();
  foreach ($results as $post){
$trackdown $post['poster'];
$dateposted $post['timestamp'];
$dateposted date("d/m/y");
  
       echo '<b><a href="'$post['href'], '" target="_blank">'$post['subject'].'</a></b>';
    
echo '<br /><i>' $post['preview'] . '</i>';
echo ' <br />by ' $trackdown['name'];
echo ' in ' '<a href="' $post['board']['href'] . '" target="_blank">' $post['board']['name'] . '</a>';
   
echo '<br /><br />';
?>



SSI.php will reveal the last 10 posts in this case, formatted according to my preferences above.  You can see how it looks at http://www.messing-about.com

SSI.php is pretty powerful; it can display the calendar events, etc.  See the full function list at  SSI.php Functions  (http://support.simplemachines.org/function_db/index.php?action=view_file;file=66).