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

Recent

Welcome to TinyPortal. Please login or sign up.

May 12, 2024, 02:28:20 AM

Login with username, password and session length
Members
  • Total Members: 3,885
  • Latest: Growner
Stats
  • Total Posts: 195,187
  • Total Topics: 21,220
  • Online today: 75
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 0
  • Guests: 71
  • Total: 71

Forum-Posts as a Frontpanel Block?

Started by Cetra, October 12, 2009, 05:57:07 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Lorazz

Hey there,

first of all, this is the current situation:

i am currently using the "Only forum-posts" option with two boards selected. (Limit of 5 Posts to be displayed on the frontpage)

now i'm wondering if it is possible to use this feature in combination with the frontpanel option,because that would allow a better and more inteligent usage of frontpage-space)
i guess a php block would be the best solution but i'm not that good in these things.
i tried to create a suitable frontpanel-block, but the only option i found was that "recent topics"-thing - and that is def. not the same^^

i'd be *very* happy if someone of you could help me out of this mess  O0

G6Cad

And we would be very happy if you could add more info according to our Posting Guidelines  :)

Lorazz

oh yea.
Link to my site: http://www.nilenia.de
SMF version: 1.1.10
TP version: 1.0 beta 4
Theme name and version: Outline Omega by Antechinus

i hope that's all i missed and i got the right board - it's about some block code^^

sorry bout that, i've been working on things all night long and can barely keep my eyes open.  :)

Freddy

#3
So you basically just need a PHP block to do this then :

1) Get posts from two sets of  boards (not every board).
2) Ordered by most recent.
3) Display 5 of them in the block.

Then you will switch to using the front panel option so you can assemble it that way instead?

That's something that can be done :)

Just let me know if I got that right.

Lorazz

yeah that's what i'd like to bring to work.  :)
but it's essential that the block
- displays these posts sorted by the date these topics were started
- and just show up the initial postings
just like the news-post-behavior that is known from the "Only forum-posts" and
"Forum-posts and articles - sorted on date" options that can be used in the "Settings & Frontpage" Tab in TinyPortals Admin-Panel

Freddy

Ok I will work on this then.  I can't start right away as I have visitors in a bit then later I am busy, but I should be able to make a start today at some point.

Cheers  :)

Lorazz

thank you very much, that messege saves my day  :D
take all the time you need  :)

Freddy

No problem :)

After a bit of digging around I found the functions Bloc used to do that job, so the code turned out to be pretty simple, once I worked out how to use the functions.

I added the code to the block code board, you can find it here :

http://www.tinyportal.net/index.php/topic,31143.msg249024.html#msg249024

Lorazz

ohh well, thats awesome but i'm unable to view your posted link:
QuoteThe topic or board you are looking for appears to be either missing or off limits to you.

Freddy

LOL, sorry about that - we're in the midst of re-organising the block area.  Here's the code :

// *** Config ***

// Set the boards you want to pull from - comma seperated within quotes.
$boards = '1,2,3';

// Set the total number of posts to show.
$number = 5;

// Set the maximum number of characters to show in a post.
$length = 300;

// *** End of config ***


// Now the code...

$posts = array();

$posts = TP_boardNews($boards, $number, 0, $length);

foreach ($posts as $post)
{
TPpageLayout1($post, 0);
}

Lorazz

yezzz sir, thank you very much. once more you saved my day :D

Freddy

You are welcome  :)

Thanks for giving a clear explanation of what you wanted, it helps me no end.

Chair

Sorry for the gravedig, but is there any chance this code could be updated for TP5b1? It is exactly what I have been looking for, only it isn't compatible.

(error returned was "Fatal error: Call to undefined function TP_boardNews() in /home/speed64/public_html/ihackmyi/Sources/Load.php(2092) : eval()'d code(48) : eval()'d code on line 19")

Freddy


Freddy

Hmm it looks like the function TP_boardNews no longer exists as I can not find it.

Is that the case Bloc ?

Lorazz

yes and the "read more" thing on classic "entries on startpage/frontpage" is missing. so this would be once more a great alternative.

WillyP

I have a test forum up here, the POTD, Soupe and News blocks are all forum posts, using the same script the real site used with SMF 1. If this is what your looking for I'll post the script here.