Modified:
/admin/ips.php
/admin/migrate.php
/admin/settings.php
/functions.inc
/include/gf_format.php
/public_html/index.php
/public_html/notify.php
/public_html/print.php
/public_html/viewtopic.php
=======================================
--- /admin/ips.php Sun Mar 27 13:51:17 2011
+++ /admin/ips.php Mon Apr 11 15:42:39 2011
@@ -65,9 +65,7 @@
$display =
COM_refresh($_CONF['site_admin_url'] .'/plugins/forum/ips.php?msg=1');
COM_output($display);
exit;
- }
-
- if ($_POST['sure'] != 'yes') {
+ } else {
$ips_unban = new
Template($CONF_FORUM['path_layout'] . 'forum/layout/admin');
$ips_unban->set_file (array ('ips_unban'=>'ips_unban.thtml'));
$ips_unban->set_var ('xhtml', XHTML);
=======================================
--- /admin/migrate.php Sun Mar 27 13:51:17 2011
+++ /admin/migrate.php Mon Apr 11 15:42:39 2011
@@ -259,7 +259,7 @@
$p->set_file (array ('page'=>'migratestories.thtml','records'
=> 'migrate_records.thtml'));
$p->set_var ('xhtml', XHTML);
-if (!empty($_GET['num_stories'])) {
+if (!empty($_GET['num_stories']) && !empty($_GET['num_posts'])) {
$p->set_var
('status_message',sprintf($LANG_GF02['msg192'],$_GET['num_stories'],$_GET['num_posts']));
} else {
$p->set_var ('show_message','none');
@@ -303,7 +303,7 @@
$p->set_var ('LANG_date',$LANG_GF01['DATE']);
$p->set_var ('LANG_comments',$LANG_GF01['COMMENTS']);
-if ($numrows > 0) {
+if ($numrows > 0 && isset($tid)) {
$base_url =
$_CONF['site_admin_url'] . '/plugins/forum/migrate.php?tid='.$tid;
for ($i = 0; $i < $numrows; $i++) {
list($topic,$sid,$story,$date,$comments) = DB_fetchArray($result);
=======================================
--- /admin/settings.php Sun Mar 27 13:51:17 2011
+++ /admin/settings.php Mon Apr 11 15:42:39 2011
@@ -72,7 +72,7 @@
$display .= COM_startBlock($LANG_GF92['gfsettings']);
$display .= forum_Navbar($navbarMenu,$LANG_GF06['2']);
-if (($_POST['savesettings'] == 'yes') && SEC_checkToken()) {
+if (isset($_POST['savesettings']) && ($_POST['savesettings'] == 'yes') &&
SEC_checkToken()) {
$registrationrequired =
COM_applyFilter($_POST['registrationrequired'],true);
$registerpost = COM_applyFilter($_POST['registerpost'],true);
=======================================
--- /functions.inc Sat Apr 9 15:15:36 2011
+++ /functions.inc Mon Apr 11 15:42:39 2011
@@ -668,7 +668,7 @@
$CONF_FORUM['allow_smilies']=0;
require_once $CONF_FORUM['path_include'] . 'gf_format.php';
- if ( !function_exists( 'str_ireplace' ))
+ if ( !function_exists('str_ireplace'))
{
require_once 'PHP/Compat.php';
PHP_Compat::loadFunction( 'str_ireplace' );
@@ -1512,7 +1512,7 @@
return;
}
- $f_tooltip = function_exists(COM_Tooltip);
+ $f_tooltip = function_exists('COM_Tooltip');
while ($A = DB_fetchArray ($result)) {
$fullsubject
= "{$A['subject']}\n{$LANG_GF01['POSTEDBY']}:{$A['name']}{$LANG_GF01['VIEWS']}:{$A['views']},
{$LANG_GF01['REPLIES']}:{$A['replies']}";
if (strlen ($A['subject']) > $CONF_FORUM['cb_subject_size']) {
@@ -1555,7 +1555,11 @@
$lastpostinfo = mb_ereg_replace("\r\n", "<br" .
XHTML . ">", forum_mb_wordwrap($lastpostinfo,
$CONF_FORUM['linkinfo_width'], "n")); // added function
}
- $cssid = ($cssid ==1) ? 2: 1;
+
+ $cssid = 1;
+ if (isset($cssid) && $cssid == 1) {
+ $cssid = 2;
+ }
if ($f_tooltip) {
$lastpostlink
= "{$_CONF['site_url']}/forum/viewtopic.php?showtopic={$A['id']}&lastpost=true#{$lastid}";
@@ -1647,7 +1651,7 @@
global $_CONF,$CONF_FORUM;
// Check and see if glMessenger is installed
- if ($CONF_FORUM['use_smilies_plugin'] AND
function_exists(msg_showsmilies)) {
+ if ($CONF_FORUM['use_smilies_plugin'] AND
function_exists('msg_showsmilies')) {
return msg_showsmilies();
} else {
$t = new Template($CONF_FORUM['path_layout'] . 'forum/layout');
@@ -1662,7 +1666,7 @@
function forumPLG_restoreEmoticons($str) {
// Check and see if glMessenger is installed
- if (function_exists(msg_showsmilies)) {
+ if (function_exists('msg_showsmilies')) {
return msg_restoreEmoticons($str);
} else {
forum_xchsmilies($str);
@@ -1734,7 +1738,7 @@
$retval = '<table width="100%" border="0" cellpadding="1"
cellspacing="1"><tr><td>';
$retval .= "<a href=\"{$_CONF['site_url']}/forum/index.php\"
title=\"{$LANG_GF02['msg196']}\">{$LANG_GF01['INDEXPAGE']}</a>";
$retval .= '</td></tr><tr><td>';
- if ($_USER['uid'] > 1) {
+ if (isset($_USER['uid']) && $_USER['uid'] > 1) {
$retval .= "<a
href=\"{$_CONF['site_url']}/forum/index.php?op=markallread\"
title=\"{$LANG_GF02['msg197']}\">{$LANG_GF01['MARKALLREAD']}</a>";
$retval .= '</td></tr><tr><td>';
$retval .= "<a
href=\"{$_CONF['site_url']}/forum/userprefs.php\"
title=\"{$LANG_GF02['msg198']}\">{$LANG_GF01['USERPREFS']}</a>";
=======================================
--- /include/gf_format.php Sun Mar 27 13:51:17 2011
+++ /include/gf_format.php Mon Apr 11 15:42:39 2011
@@ -928,10 +928,10 @@
}
if ($lastrecid == NULL AND $topicparent > 0) {
- $topicdatecreated =
DB_getItem($_TABLES['gf_topic'],date,"id=$topicparent");
+ $topicdatecreated =
DB_getItem($_TABLES['gf_topic'],'date',"id=$topicparent");
DB_query("UPDATE {$_TABLES['gf_topic']} SET
last_reply_rec=$topicparent, lastupdated='$topicdatecreated' WHERE
id={$topicparent}");
} elseif ($topicparent > 0) {
- $topicdatecreated =
DB_getItem($_TABLES['gf_topic'],date,"id=$lastrecid");
+ $topicdatecreated =
DB_getItem($_TABLES['gf_topic'],'date',"id=$lastrecid");
DB_query("UPDATE {$_TABLES['gf_topic']} SET
last_reply_rec=$lastrecid, lastupdated=$topicdatecreated WHERE
id={$topicparent}");
}
if ($topicparent > 0) {
=======================================
--- /public_html/index.php Mon Apr 11 12:42:40 2011
+++ /public_html/index.php Mon Apr 11 15:42:39 2011
@@ -640,7 +640,7 @@
if ($lastdate1 == date('d')) {
$lasttime = (substr($_USER['language'],0,2) == "ja") ?
strftime('%p %I:%M', $B['date']) : strftime('%I:%M %p',
$B['date']); // need examination
$lastdate = $LANG_GF01['TODAY'] .$lasttime;
- } elseif ($CONF_FORUM['use_userdate_format']) {
+ } elseif (isset($CONF_FORUM['use_userdate_format']) &&
$CONF_FORUM['use_userdate_format']) { // FIXME: why would it not be set?
$lastdate = COM_getUserDateTimeFormat($B['date']);
$lastdate = $lastdate[0];
} else {
@@ -752,7 +752,7 @@
$topiclisting->set_var ('img_desc4', '<img alt=""
src="'.gf_getImage('desc').'" style="border:none;"' . XHTML . '>');
$topiclisting->set_var ('img_desc5', '<img alt=""
src="'.gf_getImage('desc').'" style="border:none;"' . XHTML . '>');
- if (function_exists(prj_getSessionProject)) {
+ if (function_exists('prj_getSessionProject')) {
$projectid = prj_getSessionProject();
if ($projectid > 0) {
$link = "<a
href=\"{$_CONF['site_url']}/projects/viewproject.php?pid=$projectid\">{$strings['RETURN2PROJECT']}</a>";
@@ -879,7 +879,7 @@
$topiclisting->set_var ('newtopiclink','#');
}
- $displaypostpages .= $LANG_GF01['PAGES'] .':';
+ $displaypostpages = $LANG_GF01['PAGES'] .':'; // FIXME: is this used
anywhere?
while ($record = DB_fetchArray($topicResults,false)) {
@@ -952,7 +952,7 @@
if ($firstdate1 == date($format2)) {
$firsttime = strftime($format3, $record['date']);
$firstdate = $LANG_GF01['TODAY'] . $firsttime;
- } elseif ($CONF_FORUM['use_userdate_format']) {
+ } elseif (isset($CONF_FORUM['use_userdate_format']) &&
$CONF_FORUM['use_userdate_format']) { // FIXME: why would it not be set?
$firstdate = COM_getUserDateTimeFormat($record['date']);
$firstdate = $firstdate[0];
} else {
@@ -1015,7 +1015,7 @@
$topicinfo .= wordwrap(strip_tags(COM_truncate($record['comment'],
$CONF_FORUM['contentinfo_numchars'], '...')),
$CONF_FORUM['linkinfo_width'],"<br" . XHTML . ">\n");
$topicinfo .= mb_ereg_replace("\r\n", "<br" . XHTML . ">",
forum_mb_wordwrap($topicinfotmp, $CONF_FORUM['linkinfo_width'], "\n"));
- if (function_exists(COM_Tooltip)) {
+ if (function_exists('COM_Tooltip')) {
$topiclink = "viewtopic.php?showtopic={$record['id']}";
$tooltip_subject = COM_Tooltip($subject, $topicinfo,
$topiclink);
$subject = '';
=======================================
--- /public_html/notify.php Sun Mar 27 13:51:17 2011
+++ /public_html/notify.php Mon Apr 11 15:42:39 2011
@@ -70,7 +70,7 @@
$sql = "SELECT * FROM {$_TABLES['gf_watch']} WHERE ((topic_id='$id')
AND (uid='{$_USER['uid']}') OR ";
$sql .= "((forum_id='$forum') AND (topic_id='0') and
(uid='{$_USER['uid']}')))";
$notifyquery = DB_query("$sql");
- $pid = DB_getItem($_TABLES['gf_topic'],pid,"id='$id'");
+ $pid = DB_getItem($_TABLES['gf_topic'],'pid',"id='$id'");
if ($pid == 0) {
$pid = $id;
}
@@ -137,7 +137,7 @@
}
/* Check to see if user has checked multiple records to delete */
-if ($op == 'delchecked') {
+if ($op == 'delchecked' && isset($_POST['chkrecid'])) {
foreach ($_POST['chkrecid'] as $id) {
$id = COM_applyFilter($id);
if (DB_getItem($_TABLES['gf_watch'],'uid',"id='$id'") ==
$_USER['uid']) {
=======================================
--- /public_html/print.php Mon Mar 28 13:12:40 2011
+++ /public_html/print.php Mon Apr 11 15:42:39 2011
@@ -45,7 +45,7 @@
global $CONF_FORUM;
// Handle Pre ver 2.5 quoting and New Line Formatting - consider
adding this to a migrate function
- if ($CONF_FORUM['pre2.5_mode']) {
+ if ($CONF_FORUM['pre2.5_mode'] && isset($showtopic['comment'])) {
if ( stristr($showtopic['comment'],'[code') == false ) {
$showtopic['comment'] =
str_replace('<pre>','[code]',$showtopic['comment']);
$showtopic['comment'] =
str_replace('</pre>','[/code]',$showtopic['comment']);
=======================================
--- /public_html/viewtopic.php Mon Apr 11 12:42:40 2011
+++ /public_html/viewtopic.php Mon Apr 11 15:42:39 2011
@@ -285,7 +285,7 @@
// $viewtopic['subject'] .= "..";
//}
- if (function_exists(prj_getSessionProject)) {
+ if (function_exists('prj_getSessionProject')) {
$projectid = prj_getSessionProject();
if ($projectid > 0) {
$link = "<a
href=\"{$_CONF['site_url']}/projects/viewproject.php?pid=$projectid\">{$strings['RETURN2PROJECT']}</a>";
@@ -340,12 +340,12 @@
if ($showtopicpid == 0 ) {
$showtopicpid = $showtopics;
}
- $lrows =
DB_count($_TABLES['gf_log'],array('uid','topic'),array($_USER[uid],$showtopic));
+ $lrows =
DB_count($_TABLES['gf_log'],array('uid','topic'),array($_USER['uid'],$showtopic));
$logtime = time();
if ($lrows < 1) {
- DB_query("INSERT INTO {$_TABLES['gf_log']} (uid,forum,topic,time)
VALUES ('$_USER[uid]','$forum','$showtopic','$logtime')");
+ DB_query("INSERT INTO {$_TABLES['gf_log']} (uid,forum,topic,time)
VALUES ('{$_USER['uid']}','$forum','$showtopic','$logtime')");
} else {
- DB_query("UPDATE {$_TABLES['gf_log']} SET time=$logtime WHERE
uid=$_USER[uid] AND topic=$showtopic");
+ DB_query("UPDATE {$_TABLES['gf_log']} SET time=$logtime WHERE
uid={$_USER['uid']} AND topic=$showtopic");
}
}