1

Topic: Last 5 posts-script?

anyone have a script that prints out links the 5 last posts in the forum?

I searched around and found that i could use extern.php and active, but the page im printing these in are not in the same folder as the forum so i get some errors when including extern.php...

Is there any quick php code that just gets the latest 5 titles with author+link?

Re: Last 5 posts-script?

You shouldn't get errors hmm
You're including http://www.site.com/pathtoforum/extern.php, right?

3

Re: Last 5 posts-script?

im including /diskusjon/extern.php (where diskusjon is the forum folder)


i dont think you can use include with extern pages (using http://...."

Re: Last 5 posts-script?

And I know you can't include locally, since you can't pass variables in $_GET properly tongue

Re: Last 5 posts-script?

how do i do a last five posting in the main tpl? from the extern.php
or is there a mod that i can do?
http://modelcorwd.com at the bottom that where i want to add it on the frontpage under last articles

My stuff or my style might sux, but atleast I'm willing to help when I can.
Don't be stupid and help ! We are the stupid one's !!!

Re: Last 5 posts-script?

Just write a php script to read the database?

The posts table in the database holds post (I'm assuming with the highest id value being the newest). Then there's the topic id which I'm sure could get you the url directly with something like "<relative path to forum>/viewpost.php?id=$topic_id".

NOTE: I say ~something like~ because my forum is currently down, while I code a god dam pdo_sqlite.so db abstraction layer! So don't come crying to me when you find out to see the last 5 posts you need to write 30 lines of php code!

echo "deadram"; echo; fortune;

Re: Last 5 posts-script?

create a folder in the include called user
include/user
drop a php file name post.php
here the code for it.

<?php
include('http://yourdomain.com/extern.php?action=active');
?>

now go to the main.tpl
and post this code where you want it to show up at!

<pun_include "post.php">

that simple you can use that for anything that you want to include in the main.tpl file.

My stuff or my style might sux, but atleast I'm willing to help when I can.
Don't be stupid and help ! We are the stupid one's !!!