From 7cd6534f10eb9cadf164aa34f9290d7821fa1751 Mon Sep 17 00:00:00 2001 From: e107steved Date: Sat, 11 Oct 2008 10:49:16 +0000 Subject: [PATCH] Bugtracker #4535 - path to base plugin in comments list. Plus a bit of absolute path adding --- e107_handlers/comment_class.php | 27 ++++++++++++++------------- e107_plugins/content/e_comment.php | 11 ++++++++++- e107_plugins/content/e_latest.php | 17 +++++++++++------ e107_plugins/content/e_list.php | 9 +++++---- 4 files changed, 40 insertions(+), 24 deletions(-) diff --git a/e107_handlers/comment_class.php b/e107_handlers/comment_class.php index 62469ccf6..8ab50b4ab 100644 --- a/e107_handlers/comment_class.php +++ b/e107_handlers/comment_class.php @@ -12,8 +12,8 @@ | GNU General Public License (http://gnu.org). | | $Source: /cvs_backup/e107_0.8/e107_handlers/comment_class.php,v $ -| $Revision: 1.12 $ -| $Date: 2008-05-25 08:26:11 $ +| $Revision: 1.13 $ +| $Date: 2008-10-11 10:48:58 $ | $Author: e107steved $ +----------------------------------------------------------------------------+ */ @@ -795,9 +795,9 @@ class comment { $ret['comment_type'] = COMLAN_TYPE_1; $ret['comment_title'] = $tp -> toHTML($row2['news_title'], TRUE,'emotes_off, no_make_clickable'); - $ret['comment_url'] = e_BASE."comment.php?comment.news.".$row['comment_item_id']; + $ret['comment_url'] = e_HTTP."comment.php?comment.news.".$row['comment_item_id']; $ret['comment_category_heading'] = COMLAN_TYPE_1; - $ret['comment_category_url'] = e_BASE."news.php"; + $ret['comment_category_url'] = e_HTTP."news.php"; } break; @@ -812,9 +812,9 @@ class comment { $ret['comment_type'] = COMLAN_TYPE_2; $ret['comment_title'] = $tp -> toHTML($row2['download_name'], TRUE,'emotes_off, no_make_clickable'); - $ret['comment_url'] = e_BASE."download.php?view.".$row['comment_item_id']; + $ret['comment_url'] = e_HTTP."download.php?view.".$row['comment_item_id']; $ret['comment_category_heading'] = $row2['download_category_name']; - $ret['comment_category_url'] = e_BASE."download.php?list.".$row2['download_category_id']; + $ret['comment_category_url'] = e_HTTP."download.php?list.".$row2['download_category_id']; } break; // '3' was FAQ @@ -825,7 +825,8 @@ class comment { $ret['comment_type'] = COMLAN_TYPE_4; $ret['comment_title'] = $tp -> toHTML($row2['poll_title'], TRUE,'emotes_off, no_make_clickable'); - $ret['comment_url'] = e_BASE."comment.php?comment.poll.".$row['comment_item_id']; + $ret['comment_url'] = e_HTTP."comment.php?comment.poll.".$row['comment_item_id']; + $ret['comment_category_url'] = e_PLUGIN_ABS.'poll/poll.php'; } break; @@ -838,14 +839,14 @@ class comment { { $ret['comment_type'] = COMLAN_TYPE_8; $ret['comment_title'] = $comment_author_name; - $ret['comment_url'] = e_BASE."user.php?id.".$row['comment_item_id']; + $ret['comment_url'] = e_HTTP."user.php?id.".$row['comment_item_id']; } break; case 'page' : // Custom Page $ret['comment_type'] = COMLAN_TYPE_PAGE; $ret['comment_title'] = $ret['comment_subject'] ? $ret['comment_subject'] : $ret['comment_comment']; - $ret['comment_url'] = e_BASE."page.php?".$row['comment_item_id']; + $ret['comment_url'] = e_HTTP."page.php?".$row['comment_item_id']; break; default : @@ -856,7 +857,6 @@ class comment { //new method must use the 'qry' variable if(isset($var) && $var['qry']!='') { -// if ($installed = $sql2 -> db_Select("plugin", "*", "plugin_path = '".$var['plugin_path']."' AND plugin_installflag = '1' ")) if ($installed = isset($pref['plug_installed'][$var['plugin_path']])) { $qryp = str_replace("{NID}", $row['comment_item_id'], $var['qry']); @@ -867,20 +867,21 @@ class comment { $ret['comment_title'] = $tp -> toHTML($row2[$var['db_title']], TRUE,'emotes_off, no_make_clickable'); $ret['comment_url'] = str_replace("{NID}", $row['comment_item_id'], $var['reply_location']); $ret['comment_category_heading'] = $var['plugin_name']; - $ret['comment_category_url'] = $var['plugin_name']; + $ret['comment_category_url'] = e_PLUGIN_ABS.$var['plugin_name'].'/'.$var['plugin_name'].'.php'; } } //old method } else { - if($sql2 -> db_Select($var['db_table'], $var['db_title'], $var['db_id']." = '".$row['comment_item_id']."' ")){ + if($sql2 -> db_Select($var['db_table'], $var['db_title'], $var['db_id']." = '".$row['comment_item_id']."' ")) + { $row2 = $sql2 -> db_Fetch(); $ret['comment_type'] = $var['plugin_name']; $ret['comment_title'] = $tp -> toHTML($row2[$var['db_title']], TRUE,'emotes_off, no_make_clickable'); $ret['comment_url'] = str_replace("{NID}", $row['comment_item_id'], $var['reply_location']); $ret['comment_category_heading'] = $var['plugin_name']; - $ret['comment_category_url'] = $var['plugin_name']; + $ret['comment_category_url'] = e_PLUGIN_ABS.$var['plugin_name'].'/'.$var['plugin_name'].'.php'; } } } diff --git a/e107_plugins/content/e_comment.php b/e107_plugins/content/e_comment.php index 9fa321559..0e84a55b5 100644 --- a/e107_plugins/content/e_comment.php +++ b/e107_plugins/content/e_comment.php @@ -2,11 +2,20 @@ if (!defined('e107_INIT')) { exit; } +/* +$e_plug_table = "pcontent"; //This is set to the table name you have decided to use. +$reply_location = e_PLUGIN."content/content.php?content.$nid"; //This is set to the location you'd like the user to return to after replying to a comment. +$db_table = "pcontent"; //This is the name of your plugins database table. +$link_name = "content_heading"; //This is the name of the field in your plugin's db table that corresponds to it's name or title. +$db_id = "content_id"; // This is the name of the field in your plugin's db table that correspond to it's unique id number. +$plugin_name = "Content"; // A name for your plugin. It will be used in links to comments, in list_new/new.php. +*/ + $e_comment['eplug_comment_ids'] = "pcontent"; //This is set to the table name you have decided to use. $e_comment['plugin_path'] = "content"; //The path of your plugin. $e_comment['plugin_name'] = "content"; //A name for your plugin. It will be used in links to comments, in list_new/new.php. //This is set to the location you'd like the user to return to after replying to a comment. -$e_comment['reply_location'] = e_PLUGIN."content/content.php?content.{NID}"; +$e_comment['reply_location'] = e_PLUGIN_ABS."content/content.php?content.{NID}"; $e_comment['db_title'] = "content_heading"; //This is the name of the field in your plugin's db table that corresponds to it's name or title. $e_comment['db_id'] = "content_id"; // This is the name of the field in your plugin's db table that correspond to it's unique id number. diff --git a/e107_plugins/content/e_latest.php b/e107_plugins/content/e_latest.php index d3133d061..100983a96 100644 --- a/e107_plugins/content/e_latest.php +++ b/e107_plugins/content/e_latest.php @@ -1,14 +1,19 @@ db_Count($plugintable, '(*)', "WHERE content_refer='sa' "); -$text .= "
"; -if($reported_content) { - $text .= " ".CONTENT_LATEST_LAN_1." $reported_content"; -} else { +$text .= " +
+ +"; +if($reported_content) +{ + $text .= " ".CONTENT_LATEST_LAN_1." $reported_content"; +} +else +{ $text .= CONTENT_LATEST_LAN_1." ".$reported_content; } $text .= "
"; diff --git a/e107_plugins/content/e_list.php b/e107_plugins/content/e_list.php index 67cb14246..5f65827ee 100644 --- a/e107_plugins/content/e_list.php +++ b/e107_plugins/content/e_list.php @@ -64,21 +64,21 @@ if (!defined('e107_INIT')) { exit; } while($rowi = $sqli -> db_Fetch()){ $rowheading = $this -> parse_heading($rowi['content_heading'], $mode); - $HEADING = "".$rowheading.""; + $HEADING = "".$rowheading.""; //category if($arr[4]){ $crumb = ""; if(array_key_exists($rowi['content_parent'], $array)){ $newarr = $array[$rowi['content_parent']]; $newarr = array_reverse($newarr); - $CATEGORY = "".$newarr[0].""; + $CATEGORY = "".$newarr[0].""; } } $DATE = ($arr[5] ? $this -> getListDate($rowi['content_datestamp'], $mode) : ""); //$ICON = $this -> getBullet($arr[6], $mode); - $image_link_append = ""; + $image_link_append = ""; if($rowi['content_icon'] && file_exists($content_recent_pref["content_icon_path"].$rowi['content_icon'])){ $ICON = $image_link_append.""; }else{ @@ -89,7 +89,7 @@ if (!defined('e107_INIT')) { exit; } if($arr[3]){ $authordetails = $aa -> getAuthor($rowi['content_author']); if(USER && is_numeric($authordetails[0]) && $authordetails[0] != "0"){ - $AUTHOR = "".$authordetails[1].""; + $AUTHOR = "".$authordetails[1].""; }else{ $AUTHOR = $authordetails[1]; } @@ -105,4 +105,5 @@ if (!defined('e107_INIT')) { exit; } } } + ?> \ No newline at end of file