Firefox PHP

Last X topics (and no posts)

Posted by Clément 
Re: Last X topics (and no posts)
March 10, 2005 09:18AM
I did, I just get a blank screen.

[www.assassinsunited.com]

Sergej

------------------------------------------
^AU^ Assassins United
[www.assassinsunited.com]
------------------------------------------
Re: Last X topics (and no posts)
March 10, 2005 09:50AM
Here's the smarty assigns in case someone is interested.

I put the version from few messages above to my own server, added the lines here to the script and it worked. You could do something like print_r($p) or something to see what happens, or check php error log for parse errors etc.

So I quess you have something wrong with either database settings or otherwise.

Note. The "script must be run in phorum directory" isn't exactly true :-)

What I do is as follows:
cd to phorum directory,
include common.php
cd back to the current scripts directory
include ./phorum/latestthreads.php.

smarty assigns:
$smarty->assign("p", $p);

edit: hmm I put old assigns above.

It is also maybe better to sort the messages on message_id not date. In that case just do
$pkey[$key] = $data['message_id'];

inside the foreach.

and then sort by that field:

array_multisort($pkey, SORT_DESC, $p);

---
-=[ Panu ]=-



Edited 2 time(s). Last edit at 03/10/2005 10:22AM by Panu.
Re: Last X topics (and no posts)
March 10, 2005 10:31AM
Hmm, cleaned up version...

this is the smarty template snip to display the list:
{section name=i loop=$p}
<p>
<span class="time">{$p.datestamp}</span><br/>
{$p.subject}<br/>{$p.author}:&nbsp;{$p.body}
</p>
{/section}

---
-=[ Panu ]=-



Edited 1 time(s). Last edit at 03/10/2005 10:32AM by Panu.
Attachments:
open | download - latestthreads.php (4.2 KB)
Re: Last X topics (and no posts)
March 11, 2005 03:23AM
Dear Panu,
i tried to implement your script in my home page but it doesn't work.
The phorum index instead is in the /forum dir and i'm using version 5.0.14

Could you give me the detailed instructions please ?

Thanks
Luigi
Re: Last X topics (and no posts)
March 11, 2005 10:13AM
beverelli Wrote:
-------------------------------------------------------
> Dear Panu,
> i tried to implement your script in my home page
> but it doesn't work.
> The phorum index instead is in the /forum dir and
> i'm using version 5.0.14
>
> Could you give me the detailed instructions please

Well I try, but first I need to know how it exactly doesn't work?

you could do something like:
echo "<pre>";
print_r($p);
echo "</pre>";

before and after 

array_multisort($pkey, SORT_DESC, $p);
line.

I suspect you don't have a working database connection or something.



---
-=[ Panu ]=-
Re: Last X topics (and no posts)
March 19, 2005 08:31AM
I have been checking my own settings and from a blank screen I go into this:

Fatal error: Call to a member function on a non-object in /home/serbiad/public_html/rodoslovlje/phorum/latestthreads.php on line 80

Sergej

------------------------------------------
^AU^ Assassins United
[www.assassinsunited.com]
------------------------------------------
Re: Last X topics (and no posts)
March 20, 2005 02:35PM
Sergej Wrote:
-------------------------------------------------------
> I have been checking my own settings and from a
> blank screen I go into this:
>
> Fatal error: Call to a member function on a
> non-object in
> /home/serbiad/public_html/rodoslovlje/phorum/lates
> tthreads.php on line 80

Have you Smart installed?

The smarty line on the script is just an example. You should assign $p array to your own template or echo it's content directly.




---
-=[ Panu ]=-
Re: Last X topics (and no posts)
March 22, 2005 07:39AM
Fixed

Sergej

------------------------------------------
^AU^ Assassins United
[www.assassinsunited.com]
------------------------------------------



Edited 1 time(s). Last edit at 03/22/2005 07:50AM by Sergej.
Re: Last X topics (and no posts)
March 22, 2005 07:40AM
you have nothing in there which outputs the actual data.
thats what panu told all the time yet,


Thomas Seifert
Re: Last X topics (and no posts)
March 22, 2005 07:42AM
Dang you were fast. But, I am sorry to say I am kinda lost on what you mean. Any examples please ?

Sergej

------------------------------------------
^AU^ Assassins United
[www.assassinsunited.com]
------------------------------------------
Sorry, only registered users may post in this forum.

Click here to login