Firefox PHP

Latest X Posts in a templated Phorum-Page

Posted by Thomas Seifert 
Re: Latest X Posts in a templated Phorum-Page
September 28, 2010 11:27AM
I've found the problem by comparing the newest.tpl from my old template and the one from the zip. The zip one points to newest11.php while the file is called newest.php. By adjusting that it works again.
Although the listing is very primitive now. and does not follow the css of the template

Franc


Things are not always what they seem to be.
Re: Latest X Posts in a templated Phorum-Page
September 28, 2012 04:18AM
I came across this thread while looking for something to display the latest threads/topics/posts and whatnot. This seems like exactly what I need, and I installed exactly as the readme stated. However, it's not working for some reason. When I pull up ~/newest11.php the following is displayed:

$row){ if(empty($first_thread)){ $first_thread=$row["thread"]; } $rows[$key]["datestamp"] = phorum_date($PHORUM["short_date"], $row["datestamp"]); $rows[$key]["url"] = phorum_get_url(PHORUM_FOREIGN_READ_URL,$row['forum_id'] , $row["thread"], $row["message_id"]); // find out which forums are involved $forums[$row['forum_id']]=1; if ($row["user_id"]){ $url = phorum_get_url(PHORUM_PROFILE_URL, $row["user_id"]); $rows[$key]["profile_url"] = $url; $rows[$key]["linked_author"] = "$row[author]"; }else{ $rows[$key]["profile_url"] = ""; if(!empty($row['email'])) { $email_url = phorum_html_encode("mailto:$row"); // we don't normally put HTML in this code, but this makes it easier on template builders $rows[$key]["linked_author"] = "".htmlspecialchars($row["author"]).""; } else { $rows[$key]["linked_author"] = $row["author"]; } } } $forum_data = phorum_db_get_forums(array_keys($forums)); $newflags=array(); if ($PHORUM["DATA"]["LOGGEDIN"]){ // retrieving newflags if logged in foreach($forums as $forumid => $none) { $newflags[$forumid]=phorum_db_newflag_get_flags($forumid); } } // going through them again for forumname, -link and newflags foreach($rows as $key => $row){ if($PHORUM['forum_id'] == 0 || $PHORUM['folder_flag']==1) { $rows[$key]["forum_url"] = phorum_get_url(PHORUM_LIST_URL, $row["forum_id"]); $rows[$key]["forum_name"] = $forum_data[$row["forum_id"]]["name"]; } // newflag, if its NOT in newinfo AND newer (min than min_id, then its a new message $rows[$key]["new"] = ""; if (!isset($newflags[$row['forum_id']][$row['message_id']]) && $row['message_id'] > $newflags[$row['forum_id']]['min_id']) { $rows[$key]["new"]=$PHORUM["DATA"]["LANG"]["newflag"]; } } $PHORUM["DATA"]["ROWS"] = $rows; include phorum_get_template("header"); phorum_hook("after_header"); // include the correct template include phorum_get_template("newest11"); phorum_hook("before_footer"); include phorum_get_template("footer"); ?> If I could get some help on resolving this I would GREATLY appreciate it. I really need to get this working, as there's nothing else that will do this. Phorum version 5.2 Thanks!!
Sorry, only registered users may post in this forum.

Click here to login