1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-30 03:10:50 +02:00

Bugtracker #4535 - path to base plugin in comments list. Plus a bit of absolute path adding

This commit is contained in:
e107steved
2008-10-11 10:49:16 +00:00
parent 41b4ebf37f
commit 7cd6534f10
4 changed files with 40 additions and 24 deletions

View File

@@ -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';
}
}
}

View File

@@ -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.

View File

@@ -1,14 +1,19 @@
<?php
if (!defined('e107_INIT')) { exit; }
include_lan(e_PLUGIN."content/languages/".e_LANGUAGE."/lan_content_admin.php");
include_lan(e_PLUGIN.'content/languages/'.e_LANGUAGE.'/lan_content_admin.php');
$plugintable = "pcontent";
$reported_content = $sql -> db_Count($plugintable, '(*)', "WHERE content_refer='sa' ");
$text .= "<div style='padding-bottom: 2px;'><img src='".e_PLUGIN."content/images/content_16.png' style='width: 16px; height: 16px; vertical-align: bottom' alt='' />";
if($reported_content) {
$text .= " <a href='".e_PLUGIN."content/admin_content_config.php?submitted'>".CONTENT_LATEST_LAN_1." $reported_content</a>";
} else {
$text .= "
<div style='padding-bottom: 2px;'>
<img src='".e_PLUGIN_ABS."content/images/content_16.png' style='width: 16px; height: 16px; vertical-align: bottom' alt='' />
";
if($reported_content)
{
$text .= " <a href='".e_PLUGIN_ABS."content/admin_content_config.php?submitted'>".CONTENT_LATEST_LAN_1." $reported_content</a>";
}
else
{
$text .= CONTENT_LATEST_LAN_1." ".$reported_content;
}
$text .= "</div>";

View File

@@ -64,21 +64,21 @@ if (!defined('e107_INIT')) { exit; }
while($rowi = $sqli -> db_Fetch()){
$rowheading = $this -> parse_heading($rowi['content_heading'], $mode);
$HEADING = "<a href='".e_PLUGIN."content/content.php?content.".$rowi['content_id']."' title='".$rowi['content_heading']."'>".$rowheading."</a>";
$HEADING = "<a href='".e_PLUGIN_ABS."content/content.php?content.".$rowi['content_id']."' title='".$rowi['content_heading']."'>".$rowheading."</a>";
//category
if($arr[4]){
$crumb = "";
if(array_key_exists($rowi['content_parent'], $array)){
$newarr = $array[$rowi['content_parent']];
$newarr = array_reverse($newarr);
$CATEGORY = "<a href='".e_PLUGIN."content/content.php?cat.".$newarr[1]."'>".$newarr[0]."</a>";
$CATEGORY = "<a href='".e_PLUGIN_ABS."content/content.php?cat.".$newarr[1]."'>".$newarr[0]."</a>";
}
}
$DATE = ($arr[5] ? $this -> getListDate($rowi['content_datestamp'], $mode) : "");
//$ICON = $this -> getBullet($arr[6], $mode);
$image_link_append = "<a href='".e_PLUGIN."content/content.php?content.".$rowi['content_id']."'>";
$image_link_append = "<a href='".e_PLUGIN_ABS."content/content.php?content.".$rowi['content_id']."'>";
if($rowi['content_icon'] && file_exists($content_recent_pref["content_icon_path"].$rowi['content_icon'])){
$ICON = $image_link_append."<img src='".$content_recent_pref["content_icon_path"].$rowi['content_icon']."' style='width:50px; border:1px solid #000;' alt='' /></a>";
}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 = "<a href='".e_BASE."user.php?id.".$authordetails[0]."' >".$authordetails[1]."</a>";
$AUTHOR = "<a href='".e_HTTP."user.php?id.".$authordetails[0]."' >".$authordetails[1]."</a>";
}else{
$AUTHOR = $authordetails[1];
}
@@ -105,4 +105,5 @@ if (!defined('e107_INIT')) { exit; }
}
}
?>