Latest X Posts in a templated Phorum-Page
Posted by Thomas Seifert
November 16, 2006 08:32PM |
Admin Registered: 19 years ago Posts: 8,532 |
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



Re: Latest X Posts in a templated Phorum-Page - RSS don't work November 22, 2006 05:24AM |
Registered: 19 years ago Posts: 38 |
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:
I forget something?
Thanks in advance
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 |
Registered: 19 years ago Posts: 38 |
Re: Latest X Posts in a templated Phorum-Page - RSS don't work November 22, 2006 05:34AM |
Admin Registered: 20 years ago Posts: 9,240 |
Re: Latest X Posts in a templated Phorum-Page - RSS don't work November 22, 2006 06:56AM |
Registered: 19 years ago Posts: 38 |
Re: Latest X Posts in a templated Phorum-Page - RSS don't work December 01, 2006 03:32PM |
Registered: 19 years ago Posts: 38 |
Re: Latest X Posts in a templated Phorum-Page - RSS don't work December 02, 2006 04:58AM |
Registered: 19 years ago Posts: 38 |
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...
and in line 500 more or less...
And then the silly...
In the newest11.php file you have to add "define('phorum_page','newest11');" in the first line. Very easy!
That's all.
Phorum power!
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!
December 09, 2006 01:13AM |
Registered: 21 years ago Posts: 793 |
December 23, 2006 06:30PM |
Registered: 21 years ago Posts: 793 |
January 03, 2007 06:59AM |
Admin Registered: 19 years ago Posts: 8,532 |
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
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



Sorry, only registered users may post in this forum.