[geeklog-hg] geeklog: Fixed undefined variables.
geeklog-cvs at lists.geeklog.net
geeklog-cvs at lists.geeklog.net
Sat Oct 26 11:35:56 EDT 2013
changeset 9327:fb6b973b36af
url: http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/fb6b973b36af
user: Tom <websitemaster at cogeco.net>
date: Sat Oct 26 11:35:32 2013 -0400
description:
Fixed undefined variables.
diffstat:
system/classes/story.class.php | 8 ++++++++
system/lib-story.php | 5 ++---
2 files changed, 10 insertions(+), 3 deletions(-)
diffs (50 lines):
diff -r 6c0b07d51b99 -r fb6b973b36af system/classes/story.class.php
--- a/system/classes/story.class.php Sat Oct 26 10:50:43 2013 -0400
+++ b/system/classes/story.class.php Sat Oct 26 11:35:32 2013 -0400
@@ -397,6 +397,8 @@
*/
function loadFromArray($story)
{
+ global $_USER;
+
/* Use the magic cheat array to quickly reload the whole story
* from the database result array, doing the quick stripslashes.
*/
@@ -418,6 +420,12 @@
if (array_key_exists('fullname', $story)) {
$this->_fullname = $story['fullname'];
}
+
+ if (COM_isAnonUser()) {
+ $this->_uid = 1;
+ } else {
+ $this->_uid = $_USER['uid'];
+ }
// Overwrite the date with the timestamp.
$this->_date = $story['unixdate'];
diff -r 6c0b07d51b99 -r fb6b973b36af system/lib-story.php
--- a/system/lib-story.php Sat Oct 26 10:50:43 2013 -0400
+++ b/system/lib-story.php Sat Oct 26 11:35:32 2013 -0400
@@ -106,6 +106,8 @@
$article->set_var('story_date', $story->DisplayElements('date'), false, true);
// Topic Icon is user configurable so do not cache
+ $topicname = $story->DisplayElements('topic');
+ $topicurl = $_CONF['site_url'] . '/index.php?topic=' . $story->DisplayElements('tid');
if(( !isset( $_USER['noicons'] ) OR ( $_USER['noicons'] != 1 )) AND $story->DisplayElements('show_topic_icon') == 1 ) {
$imageurl = $story->DisplayElements('imageurl');
if (!empty($imageurl)) {
@@ -254,12 +256,9 @@
}
}
- $topicname = $story->DisplayElements('topic');
-
$article->set_var('story_topic_id', $story->DisplayElements('tid'));
$article->set_var('story_topic_name', $topicname);
- $topicurl = $_CONF['site_url'] . '/index.php?topic=' . $story->DisplayElements('tid');
$article->set_var( 'story_topic_url', $topicurl );
$recent_post_anchortag = '';
More information about the geeklog-cvs
mailing list