TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
Stats
  • Total Posts: 196,030
  • Total Topics: 21,334
  • Online today: 519
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 146
  • Total: 146

Recent Topics

Started by swampy, April 20, 2008, 10:35:26 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Swampy

Is there a way to create a recent topics for one specific forum and also have the standard recent topics running else where?

Zetan

Yes.


/******************************************************************************
* Reviews SSI                                                                 *
*******************************************************************************
* For TinyPortal                                                              *
*                                                                             *
* =========================================================================== *
* Software Version:           1.0                                             *
*                                                                             *
*                                                                             *
*                                                                             *
* Software by:                Zetan aka LAB DESIGN                            *
*                                                                             *
*                                                                             *
*          My First Code :D                                                   *
*             Damn being a n000b :P                                           *
*                                                                             *
*                                                                             *
*                                                                             *
* Support, News, Updates at:  This snippet is as. No updates guaranteed       *
*******************************************************************************
* This program is free software; you may redistribute it and/or modify it     *
* under the terms of the provided license as published by Lewis Media.        *
*                                                                             *
* This program is distributed in the hope that it is and will be useful,      *
* but WITHOUT ANY WARRANTIES; without even any implied warranty of            *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.                        *
*                                                                             *
* See the "license.txt" file for details of the Simple Machines license.      *
* The latest version can always be found at http://www.simplemachines.org.    *
******************************************************************************/

// Review Type

{

echo '
<div style="padding: 5px;" class="mediumtext"><p style="margin: 0pt; padding: 0pt 0pt 0.5ex;"><a href="http://labradio.co.uk/index.php/board,66.0.html"  Title="Recent Member Gig Reviews from the Gig Reviews board."><img src="/Themes/global_img/reviews.png" align="absmiddle"></img></a>   
<a href="http://labradio.co.uk/index.php/board,66.0.html"  Title="Recent Member Gig Reviews from the Gig Reviews board."><b>Gig Reviews</b></a><br><hr width="100%" /></div>';


}       

// Fetch Board, Number of Topics Displayed. Subject, Time & Date and Topic Starter

$array = ssi_boardNews(66.0, 8, null, null, 'array');
foreach ($array as $r)   

{
echo '
<div style="padding: 0px;" class="smalltext"><p style="margin: 0pt; padding: 0pt 0pt 0.5ex;">
<a href="', $r['href'], '">', $r['subject'], '</a><br>',  '['.$r['time'].']', '<br>by <b>', $r['poster']['link'], '</b></p></div>';

if (!$r['is_last'])
echo '
<hr width="100%" />';
}

     
// Submit Review

{


echo '
<hr>
<div style="padding: 5px;" class="mediumtext"><p style="margin: 0pt; padding: 0pt 0pt 0.5ex;"><a href="http://YourSite.com/index.php/action,post/board,66.0.html" Title="You must be a registered member to submit a review."><img src="/Themes/global_img/submit.png" align="absmiddle"></img></a>   
<a href="http://YourSite.com/index.php/action,post/board,66.0.html" Title="You must be a registered member to submit a review."><b>Submit a Review</b></a></div>';
}


Adapt as needed.. it's a direct copy/paste from my site. Reviews and News is a single board.. we have several.

jepot

#2
nice code, but how can you remove the line and use bullets instead?
and also to get topics from 6 different boards?

IchBin

ssi_boardNews() only takes 1 board as a place to pull news from. You'd have to re-write the function to accept more, or find another code snippet to do what you want. There are already some that probably do what you want if you go through the code snippets board.

jepot

i did, some of them didn't work and i dont have access to the server right now to edit files just to my forum's admin cp..
i just want to show recent topics from certain boards like this
http://www.tinyportal.net/index.php?topic=2467.0

but i cannot get it to work

This website is proudly hosted on Crocweb Cloud Website Hosting.