Firefox PHP

Latest X Posts in a templated Phorum-Page

Posted by Thomas Seifert 
Re: Latest X Posts in a templated Phorum-Page
November 16, 2006 08:32PM
Quote
rheo
why is that? is there any reason why the author field of p5_message has to be the p5_users.username? I would have thought the user_id would be enough for anything important.

Why not? The real name mod rewrites all occurances of the username dynamically. If you store the real name in the author field, then the name would not change along with changing the name in the real_name custom user field. Additionally, this way more options are available. For example: on my own site, I do not only display a user's name, but also a profile image button next to their name and some small flagging images for marking moderators and users that are in the chatroom. All I have to code for this, is a small module that adds functionality to the real_name mod.

Anyway, if you really need different functionality, then you'll have to start coding. If you want to trim the real name length, you can do this with an additional module which adds this functionality to the real_name module. Take a look at the Real Name Stripper module as a base for what you are doing.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: Latest X Posts in a templated Phorum-Page - RSS don't work
November 22, 2006 05:24AM
rss don't work in the newest11.php file.

How can we do that rss works in newest11.php?

I have tried to hack the common file with no results:

// RSS-Url only makes sense on a couple of pages
    if(isset($PHORUM['use_rss']) && $PHORUM['use_rss']
        && (phorum_page=="index" || phorum_page=="list" || phorum_page=="newest11" || phorum_page=="read")){
        $GLOBALS["PHORUM"]["DATA"]["URL"]["RSS"] = phorum_get_url( PHORUM_RSS_URL );
    }



case PHORUM_RSS_URL:
            switch(phorum_page){
                case "newest11":
                    $add_forum_id = true;
                    break;
                case "list":
                    $add_forum_id = true;
                    break;
                case "read":
                    $add_forum_id = true;
                    $thread_id = (int)$PHORUM["args"]["1"];
                    array_push($argv, $thread_id);
                    break;
            }
            $page = "rss";

I forget something?

Thanks in advance
Re: Latest X Posts in a templated Phorum-Page - RSS don't work
November 22, 2006 05:26AM
Maybe a "bug".

I think you can "hack" the newest11.php putting manually newest11.php?0,num=100000000000000000, for example, or I'm wrong?
Re: Latest X Posts in a templated Phorum-Page - RSS don't work
November 22, 2006 05:34AM
Quote

I think you can "hack" the newest11.php putting manually newest11.php?0,num=100000000000000000, for example, or I'm wrong?

whats the hack or bug in that? yes, you can do this.


Thomas Seifert
Re: Latest X Posts in a templated Phorum-Page - RSS don't work
November 22, 2006 06:56AM
I think its possible to collapse our database making a synchro attack.

Probably Im wrong.
Re: Latest X Posts in a templated Phorum-Page - RSS don't work
December 01, 2006 03:32PM
Finally I have been trying to add RSS options to the "Latest X Posts in a templated Phorum-Page" module but with no good results.

Anybody can tell me my error? thanks, another time, in advance.
Re: Latest X Posts in a templated Phorum-Page - RSS don't work
December 02, 2006 04:58AM
Very hard work (form me! I'm really bad!!!), but finally I found the problem.

Arg! it was a silly...

First of all, you have to hack "common.php" file:

Line 700 more or less...

// RSS-Url only makes sense on a couple of pages
    if(isset($PHORUM['use_rss']) && $PHORUM['use_rss']
        && (phorum_page=="index" || phorum_page=="list" || phorum_page=="newest11" || phorum_page=="read")){
        $GLOBALS["PHORUM"]["DATA"]["URL"]["RSS"] = phorum_get_url( PHORUM_RSS_URL );
    }

and in line 500 more or less...

case PHORUM_RSS_URL:
            switch(phorum_page){
                case "newest11":
                    $add_forum_id = true;
                    break;
                case "list":
                    $add_forum_id = true;
                    break;
                case "read":
                    $add_forum_id = true;
                    $thread_id = (int)$PHORUM["args"]["1"];
                    array_push($argv, $thread_id);
                    break;
            }
            $page = "rss";

And then the silly...

In the newest11.php file you have to add "define('phorum_page','newest11');" in the first line. Very easy!

define('phorum_page','newest11');
include_once("./common.php"); //change to match your file system
include_once("./include/format_functions.php");"

That's all.

Phorum power!
Re: Latest X Posts in a templated Phorum-Page
December 09, 2006 01:13AM
i would like to vote to see the "latest x posts" page added to the core phorum release..

it's a very handy page and i can't imagine why anyone would want it not included by default.

thanks!
Re: Latest X Posts in a templated Phorum-Page
December 23, 2006 06:30PM
I meant to say I would like to nominate this addon to the core.

Can't really be a vote without nomination.. :-)
Re: Latest X Posts in a templated Phorum-Page
January 03, 2007 06:59AM
It's not a core feature, but really an addon. There's not a good way of making this a core feature, since the exact use really depends on the type of website that you're running and what you want to show. One thing to think about for example, is that there are systems with advanced authorization restrictions, where not every user is allowed to read all forums. An anonymous view at the last [x] forum posts would not be wanted at such type of site. There are more issues like this, which do not make this addon a clean addon which can be distributed with Phorum by default.

If it were an addon that only was used for showing the last posts on the Phorum index page, then it could be something core-like (allthough it still is a typical feature to implement using a module). However, a lot of people use (a modified version of) the script to show the last posts outside the Phorum page, e.g. on their own website's index page.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Sorry, only registered users may post in this forum.

Click here to login