Simple Machines Community Forum

Customizing SMF => Graphics and Templates => Aiheen aloitti: Crip - marraskuu 30, 2011, 01:09:44 IP

Otsikko: View the most recent posts on the forum.
Kirjoitti: Crip - marraskuu 30, 2011, 01:09:44 IP
hi,
..is there away to display only a certain amount of View the most recent posts on the forum. (http://www.simplemachines.org/community/index.php?action=recent) located at bottom of Stats Area?

Link takes you to: Pages: [1] 2 ... 10 , I'd like to display only [...]Pages: [1]

kind regards,
Crip~
-----------
Otsikko: Re: View the most recent posts on the forum.
Kirjoitti: Akyhne - marraskuu 30, 2011, 02:42:22 IP
For your own forum only? You could tweak RecentPosts() in Recent.php

For a theme, you could tweak SSI.php
Otsikko: Re: View the most recent posts on the forum.
Kirjoitti: Crip - marraskuu 30, 2011, 03:12:42 IP
Thanks ,
yes it's for my Forum .. i'll try the SSI.php
Otsikko: Re: View the most recent posts on the forum.
Kirjoitti: Crip - joulukuu 01, 2011, 06:25:35 AP
No dice , there must be another way ?

p/s
I checked my 1.1 version and it displays => Pages: [10] as\well ..?
Otsikko: Re: View the most recent posts on the forum.
Kirjoitti: Ricky. - joulukuu 02, 2011, 03:11:04 AP
I did it  using SSI recently, saving it in array then output as required.
Otsikko: Re: View the most recent posts on the forum.
Kirjoitti: Crip - joulukuu 02, 2011, 08:17:54 AP
Lainaus käyttäjältä: Ricky. - joulukuu 02, 2011, 03:11:04 AP
I did it  using SSI recently, saving it in array then output as required.

Cool , please , tell me more?
Otsikko: Re: View the most recent posts on the forum.
Kirjoitti: Ricky. - joulukuu 02, 2011, 10:51:56 AP
Do following but don't forget to include SSI first...

$latest = ssi_recentTopics($num_recent = 10, $exclude_boards = 47.0, $include_boards = null, $output_method='array');

Now $latest will contain all your latest topic, you can see that array using print_r($latest) and format them as you need ! Here, have excluded board 47.0 , you can omit this part to include all board.

Otsikko: Re: View the most recent posts on the forum.
Kirjoitti: Crip - joulukuu 04, 2011, 08:51:50 AP
thanks Ricky. -- and this SSI code goes where?  ... via the =>  //Recent.template.php  ?
Otsikko: Re: View the most recent posts on the forum.
Kirjoitti: Ricky. - joulukuu 04, 2011, 09:03:02 AP
Depends where you need, since most of the time we modify index.template.php only, I had used this in index.template.php only!
Otsikko: Re: View the most recent posts on the forum.
Kirjoitti: Crip - joulukuu 04, 2011, 09:04:06 AP
Okay , thanks again ;)
Otsikko: Re: View the most recent posts on the forum.
Kirjoitti: Crip - joulukuu 04, 2011, 10:14:38 AP
I really can't find a place to add your code or I'm doing it wrong ? ,, no errors though..

wrong??
<?php include("$latest = ssi_recentTopics($num_recent = 10, $exclude_boards = 47.0, $include_boards = null, $output_method='array');"); ?>
Otsikko: Re: View the most recent posts on the forum.
Kirjoitti: Ricky. - joulukuu 04, 2011, 03:38:09 IP
It will not output anything, you should do like this :

include 'Path/to/your/SSI.php';
$latest = ssi_recentTopics($num_recent = 10, $exclude_boards = 47.0, $include_boards = null, $output_method='array');

Above will not show anything,  rather everything will be in $latest. Now either using loop or directly, you output them as required.