Firefox PHP

Last X topics (and no posts)

Posted by Clément 
Re: Last X topics (and no posts)
March 10, 2005 03:18PM
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 03:50PM
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 04:22PM by Panu.
Re: Last X topics (and no posts)
March 10, 2005 04:31PM
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 04:32PM by Panu.
Attachments:
open | download - latestthreads.php (4.2 KB)
Re: Last X topics (and no posts)
March 11, 2005 09: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 04:13PM
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 02:31PM
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 08: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 01:39PM
Fixed

Sergej

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



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


Thomas Seifert
Phorum Development Team / Mysnip-Solutions.de
Custom Phorum and general software development
worry-free Phorum Hosting
Re: Last X topics (and no posts)
March 22, 2005 01:42PM
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