Last X topics (and no posts)
Posted by Clément
March 10, 2005 09:18AM |
Registered: 20 years ago Posts: 868 |
I did, I just get a blank screen.
[www.assassinsunited.com]
Sergej
------------------------------------------
^AU^ Assassins United
[www.assassinsunited.com]
------------------------------------------
[www.assassinsunited.com]
Sergej
------------------------------------------
^AU^ Assassins United
[www.assassinsunited.com]
------------------------------------------
Re: Last X topics (and no posts) March 10, 2005 09:50AM |
Registered: 21 years ago Posts: 1,076 |
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:
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
---
-=[ Panu ]=-
Edited 2 time(s). Last edit at 03/10/2005 10:22AM by Panu.
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 |
Registered: 21 years ago Posts: 1,076 |
Hmm, cleaned up version...
this is the smarty template snip to display the list:
---
-=[ Panu ]=-
Edited 1 time(s). Last edit at 03/10/2005 10:32AM by Panu.
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}: {$p.body} </p> {/section}
---
-=[ Panu ]=-
Edited 1 time(s). Last edit at 03/10/2005 10:32AM by Panu.
Re: Last X topics (and no posts) March 11, 2005 03:23AM |
Registered: 18 years ago Posts: 25 |
Re: Last X topics (and no posts) March 11, 2005 10:13AM |
Registered: 21 years ago Posts: 1,076 |
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:
I suspect you don't have a working database connection or something.
---
-=[ Panu ]=-
-------------------------------------------------------
> 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 ]=-
March 19, 2005 08:31AM |
Registered: 20 years ago Posts: 868 |
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]
------------------------------------------
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 |
Registered: 21 years ago Posts: 1,076 |
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 ]=-
-------------------------------------------------------
> 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 ]=-
March 22, 2005 07:39AM |
Registered: 20 years ago Posts: 868 |
Fixed
Sergej
------------------------------------------
^AU^ Assassins United
[www.assassinsunited.com]
------------------------------------------
Edited 1 time(s). Last edit at 03/22/2005 07:50AM by Sergej.
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 |
Admin Registered: 20 years ago Posts: 9,240 |
March 22, 2005 07:42AM |
Registered: 20 years ago Posts: 868 |
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]
------------------------------------------
Sergej
------------------------------------------
^AU^ Assassins United
[www.assassinsunited.com]
------------------------------------------
Sorry, only registered users may post in this forum.