Firefox PHP

Phorum 5.2.18 - another question to the 'edit names' feature

Posted by OWHorus 
Phorum 5.2.18 - another question to the 'edit names' feature
October 17, 2011 04:01PM
Hello,

everything works now with this feature - without using hacks - I can enable it for every forum my hook, and so on...

With one exception: When formatting RSS feeds the script in 'feed.php' calls my read hook (line 88,89), and I do my specific formatting as usual.
But the feed_functions.php seem to do everything in their power to undo this, since they search for the display name of a message poster, and insert it, ignoring the $message['author'] field.

Why is this? Is there a specific reason for this?

The result: In the feed the field
dc:creator
reveals the 'real' author of the message, and since everybody can request a feed, everybody can read it. Additionally IE9 shows this field in the feed, while IE8 and Firefox do not.

I fear, this will become a hack...

Thank you

OWHorus
Re: Phorum 5.2.18 - another question to the 'edit names' feature
October 24, 2011 06:47AM
Hello,

here is what I did (it's a hack, but I found no other simple way to do it):

in include/feed_functions.php (Line 130 ff) is a line:

$author = isset($users[$message['user_id']]) && $users[$message['user_id']] != '' ? $users[$message['user_id']] : $message['author'];

I changed this line to:

Language: PHP
$namesel_forums = array(); // forums where ';name editing'; is allowed, if my mod is inactive - no effect if (@count($PHORUM["mod_owmod"]["nameselect_forums"])) $namesel_forums = $PHORUM["mod_owmod"]["nameselect_forums"]; // are we in a name edit forum? if (in_array($message[';forum_id';], $namesel_forums)) { // take author name from message, it was corrected in the previous read hook $author = $message[';author';]; } else { // default behavior $author = isset($users[$message[';user_id';]]) && $users[$message[';user_id';]] != ';'; ? $users[$message[';user_id';]] : $message[';author';]; }

Similar in two other places (for RSS, Atom and Javascript Feeds, in HTML Feeds no change was necessary).

OWHorus



Edited 1 time(s). Last edit at 10/24/2011 06:49AM by OWHorus.
Sorry, only registered users may post in this forum.

Click here to login