1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-04 13:47:31 +02:00

bugfix #3696 hardcoded lan in e_list

This commit is contained in:
lisa
2008-12-08 07:57:21 +00:00
parent 4d830beec3
commit 504d47fa1f
3 changed files with 115 additions and 94 deletions

View File

@@ -2,29 +2,30 @@
if (!defined('e107_INIT')) { exit; } if (!defined('e107_INIT')) { exit; }
if(!$content_install = $sql -> db_Select("plugin", "*", "plugin_path = 'content' AND plugin_installflag = '1' ")){ if(!$content_install = $sql->db_Select_gen("SELECT * FROM plugin WHERE plugin_path = 'content' AND plugin_installflag = '1' "))
{
return; return;
} }
require_once(e_PLUGIN."content/handlers/content_class.php"); require_once(e_PLUGIN."content/handlers/content_class.php");
$aa = new content; $aa = new content;
$datequery = " AND content_datestamp < ".time()." AND (content_enddate=0 || content_enddate>".time().") "; $datequery = " AND content_datestamp < ".time()." AND (content_enddate=0 || content_enddate>".time().") ";
global $contentmode; global $contentmode;
//contentmode : content_144 (content_ + idvalue) //contentmode : content_144 (content_ + idvalue)
if($contentmode){ $headingquery = ($contentmode ? " AND content_id = '".substr($contentmode,8)."' " : '');
$headingquery = " AND content_id = '".substr($contentmode,8)."' ";
}else{
$headingquery = "";
}
//get main parent types //get main parent types
$sqlm = new db; $sqlm = new db;
if(!$mainparents = $sqlm -> db_Select("pcontent", "content_id, content_heading", "content_class REGEXP '".e_CLASS_REGEXP."' AND content_parent = '0' ".$datequery." ".$headingquery." ORDER BY content_heading")){ if(!$mainparents = $sqlm->db_Select_gen("SELECT content_id, content_heading FROM #pcontent WHERE content_class REGEXP '".e_CLASS_REGEXP."' AND content_parent = '0' ".$datequery." ".$headingquery." ORDER BY content_heading"))
$LIST_DATA = "no valid content category"; {
}else{ $LIST_DATA = CONTENT_E_LIST_LAN_1;
while($rowm = $sqlm -> db_Fetch()){ }
else
{
while($rowm = $sqlm->db_Fetch())
{
$ICON = ""; $ICON = "";
$HEADING = ""; $HEADING = "";
$AUTHOR = ""; $AUTHOR = "";
@@ -37,63 +38,79 @@ if (!defined('e107_INIT')) { exit; }
$mainparent = $rowm['content_id']; $mainparent = $rowm['content_id'];
//get path variables //get path variables
$content_recent_pref = $aa -> getContentPref($mainparent, true); $content_recent_pref = $aa->getContentPref($mainparent, true);
//prepare query string //prepare query string
$array = $aa -> getCategoryTree("", $mainparent, TRUE); $array = $aa->getCategoryTree("", $mainparent, TRUE);
$validparent = implode(",", array_keys($array)); $validparent = implode(",", array_keys($array));
$qry = " content_refer !='sa' AND content_parent REGEXP '".$aa -> CONTENTREGEXP($validparent)."' AND content_class REGEXP '".e_CLASS_REGEXP."' "; $qry = "content_refer !='sa' AND content_parent REGEXP '".$aa->CONTENTREGEXP($validparent)."' AND content_class REGEXP '".e_CLASS_REGEXP."' ";
//check so only the preferences from the correct content_type (article, content, review etc) are used and rendered //check so only the preferences from the correct content_type (article, content, review etc) are used and rendered
if(substr($contentmode,8) == $rowm['content_id']){ if(substr($contentmode,8) == $rowm['content_id'])
{
if($mode == "new_page" || $mode == "new_menu" ){ if($mode == "new_page" || $mode == "new_menu" )
$lvisit = $this -> getlvisit(); {
$lvisit = $this->getlvisit();
$qry = $qry." AND content_datestamp>".$lvisit; $qry = $qry." AND content_datestamp>".$lvisit;
}else{ }
else
{
$qry = $qry." ".$datequery; $qry = $qry." ".$datequery;
} }
$qry .= " ORDER BY content_datestamp DESC LIMIT 0,".intval($arr[7]); $qry .= " ORDER BY content_datestamp DESC LIMIT 0,".intval($arr[7]);
//get recent content for each main parent //get recent content for each main parent
$sqli = new db; $sqli = new db;
if(!$resultitem = $sqli -> db_Select("pcontent", "content_id, content_heading, content_parent, content_datestamp, content_icon, content_author", $qry)){ if(!$resultitem = $sqli->db_Select_gen("SELECT content_id, content_heading, content_parent, content_datestamp, content_icon, content_author FROM #pcontent WHERE ".$qry))
$LIST_DATA = "no items in ".$rowm['content_heading']; {
}else{ $LIST_DATA = LIST_LAN_1." ".$rowm['content_heading'];
}
else
{
$LIST_DISPLAYSTYLE = ($arr[2] ? "" : "none"); $LIST_DISPLAYSTYLE = ($arr[2] ? "" : "none");
while($rowi = $sqli->db_Fetch())
while($rowi = $sqli -> db_Fetch()){ {
$rowheading = $this -> parse_heading($rowi['content_heading'], $mode); $rowheading = $this->parse_heading($rowi['content_heading'], $mode);
$HEADING = "<a href='".e_PLUGIN_ABS."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 //category
if($arr[4]){ if($arr[4])
{
$crumb = ""; $crumb = "";
if(array_key_exists($rowi['content_parent'], $array)){ if(array_key_exists($rowi['content_parent'], $array))
{
$newarr = $array[$rowi['content_parent']]; $newarr = $array[$rowi['content_parent']];
$newarr = array_reverse($newarr); $newarr = array_reverse($newarr);
$CATEGORY = "<a href='".e_PLUGIN_ABS."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) : ""); $DATE = ($arr[5] ? $this->getListDate($rowi['content_datestamp'], $mode) : "");
//$ICON = $this -> getBullet($arr[6], $mode);
$image_link_append = "<a href='".e_PLUGIN_ABS."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'])){ 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>"; $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{ }
else
{
$ICON = ""; $ICON = "";
} }
//get author details //get author details
if($arr[3]){ if($arr[3])
$authordetails = $aa -> getAuthor($rowi['content_author']); {
if(USER && is_numeric($authordetails[0]) && $authordetails[0] != "0"){ $authordetails = $aa->getAuthor($rowi['content_author']);
if(USER && is_numeric($authordetails[0]) && $authordetails[0] != "0")
{
$AUTHOR = "<a href='".e_HTTP."user.php?id.".$authordetails[0]."' >".$authordetails[1]."</a>"; $AUTHOR = "<a href='".e_HTTP."user.php?id.".$authordetails[0]."' >".$authordetails[1]."</a>";
}else{ }
else
{
$AUTHOR = $authordetails[1]; $AUTHOR = $authordetails[1];
} }
}else{ }
else
{
$AUTHOR = ""; $AUTHOR = "";
} }
$INFO = ""; $INFO = "";
@@ -103,7 +120,6 @@ if (!defined('e107_INIT')) { exit; }
} }
} }
} }
} }
?> ?>

View File

@@ -4,9 +4,9 @@
| e107 website system - Language File. | e107 website system - Language File.
| |
| $Source: /cvs_backup/e107_0.8/e107_plugins/content/languages/English/lan_content.php,v $ | $Source: /cvs_backup/e107_0.8/e107_plugins/content/languages/English/lan_content.php,v $
| $Revision: 1.5 $ | $Revision: 1.6 $
| $Date: 2008-07-25 21:03:37 $ | $Date: 2008-12-08 07:57:12 $
| $Author: e107steved $ | $Author: lisa_ $
+----------------------------------------------------------------------------+ +----------------------------------------------------------------------------+
*/ */
@@ -224,4 +224,7 @@ define("CONTENT_MANAGER_LAN_1", "create content");
define("CONTENT_MANAGER_LAN_2", "edit content"); define("CONTENT_MANAGER_LAN_2", "edit content");
define("CONTENT_MANAGER_LAN_3", "approve submitted "); define("CONTENT_MANAGER_LAN_3", "approve submitted ");
define("CONTENT_MANAGER_LAN_4", "submit content"); define("CONTENT_MANAGER_LAN_4", "submit content");
define("CONTENT_E_LIST_LAN_1", "no valid content category");
?> ?>

View File

@@ -11,9 +11,9 @@
| GNU General Public License (http://gnu.org). | GNU General Public License (http://gnu.org).
| |
| $Source: /cvs_backup/e107_0.8/e107_plugins/list_new/languages/English.php,v $ | $Source: /cvs_backup/e107_0.8/e107_plugins/list_new/languages/English.php,v $
| $Revision: 1.3 $ | $Revision: 1.4 $
| $Date: 2007-04-02 20:31:46 $ | $Date: 2008-12-08 07:57:21 $
| $Author: e107steved $ | $Author: lisa_ $
+----------------------------------------------------------------------------+ +----------------------------------------------------------------------------+
*/ */
@@ -203,4 +203,6 @@ define("LIST_FORUM_4", "replies:");
define("LIST_FORUM_5", "lastpost:"); define("LIST_FORUM_5", "lastpost:");
define("LIST_FORUM_6", "on:"); define("LIST_FORUM_6", "on:");
define("LIST_LAN_1", "no items in");
?> ?>