mirror of
https://github.com/e107inc/e107.git
synced 2025-08-01 04:10:38 +02:00
recode list_new plugin + e_list.php files
This commit is contained in:
@@ -1,87 +1,101 @@
|
||||
<?php
|
||||
/*
|
||||
+ ----------------------------------------------------------------------------+
|
||||
| e107 website system
|
||||
|
|
||||
| <20>Steve Dunstan 2001-2002
|
||||
| http://e107.org
|
||||
| jalist@e107.org
|
||||
|
|
||||
| Released under the terms and conditions of the
|
||||
| GNU General Public License (http://gnu.org).
|
||||
|
|
||||
| $Source: /cvs_backup/e107_0.8/e107_plugins/calendar_menu/e_list.php,v $
|
||||
| $Revision: 1.3 $
|
||||
| $Date: 2007-08-28 19:05:02 $
|
||||
| $Author: e107steved $
|
||||
|
|
||||
+----------------------------------------------------------------------------+
|
||||
* e107 website system
|
||||
*
|
||||
* Copyright (C) 2001-2008 e107 Inc (e107.org)
|
||||
* Released under the terms and conditions of the
|
||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||
*
|
||||
* Calendar e_list Handler
|
||||
*
|
||||
* $Source: /cvs_backup/e107_0.8/e107_plugins/calendar_menu/e_list.php,v $
|
||||
* $Revision: 1.4 $
|
||||
* $Date: 2009-01-27 21:33:52 $
|
||||
* $Author: lisa_ $
|
||||
*
|
||||
*/
|
||||
|
||||
if (!defined('e107_INIT')) { exit; }
|
||||
|
||||
if (isset($pref['plug_installed']))
|
||||
class list_calendar_menu
|
||||
{
|
||||
if (!isset($pref['plug_installed']['calendar_menu'])) return;
|
||||
}
|
||||
else
|
||||
{ // Support 'legacy' method as well for now
|
||||
if(!$calendar_install = $sql -> db_Select("plugin", "*", "plugin_path = 'calendar_menu' AND plugin_installflag = '1' "))
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
$LIST_CAPTION = $arr[0];
|
||||
$LIST_DISPLAYSTYLE = ($arr[2] ? "" : "none");
|
||||
|
||||
require_once('ecal_class.php');
|
||||
$ecal_class = new ecal_class;
|
||||
|
||||
$current_day = $ecal_class->cal_date['mday'];
|
||||
$current_month = $ecal_class->cal_date['mon'];
|
||||
$current_year = $ecal_class->cal_date['year'];
|
||||
|
||||
$current = mktime(0,0,0,$current_month, $current_day, $current_year);
|
||||
|
||||
if($mode == "new_page" || $mode == "new_menu" ){
|
||||
$lvisit = $this -> getlvisit();
|
||||
$qry = " event_datestamp>".intval($lvisit)." AND ";
|
||||
}else{
|
||||
$qry = "";
|
||||
function list_calendar_menu($parent)
|
||||
{
|
||||
$this->parent = $parent;
|
||||
}
|
||||
|
||||
$bullet = $this -> getBullet($arr[6], $mode);
|
||||
function getListData()
|
||||
{
|
||||
$list_caption = $this->parent->settings['caption'];
|
||||
$list_display = ($this->parent->settings['open'] ? "" : "none");
|
||||
|
||||
$qry = "
|
||||
SELECT e.*, c.event_cat_name
|
||||
FROM #event AS e
|
||||
LEFT JOIN #event_cat AS c ON c.event_cat_id = e.event_category
|
||||
WHERE ".$qry." e.event_start>='$current' AND c.event_cat_class REGEXP '".e_CLASS_REGEXP."'
|
||||
ORDER BY e.event_start ASC LIMIT 0,".intval($arr[7]);
|
||||
require_once('ecal_class.php');
|
||||
$ecal_class = new ecal_class;
|
||||
|
||||
if(!$event_items = $sql->db_Select_gen($qry)){
|
||||
$LIST_DATA = LIST_CALENDAR_2;
|
||||
}else{
|
||||
while($row = $sql -> db_Fetch()){
|
||||
$current_day = $ecal_class->cal_date['mday'];
|
||||
$current_month = $ecal_class->cal_date['mon'];
|
||||
$current_year = $ecal_class->cal_date['year'];
|
||||
|
||||
$tmp = explode(".", $row['event_author']);
|
||||
if($tmp[0] == "0"){
|
||||
$AUTHOR = $tmp[1];
|
||||
}elseif(is_numeric($tmp[0]) && $tmp[0] != "0"){
|
||||
$AUTHOR = (USER ? "<a href='".e_BASE."user.php?id.".$tmp[0]."'>".$tmp[1]."</a>" : $tmp[1]);
|
||||
}else{
|
||||
$AUTHOR = "";
|
||||
}
|
||||
$current = mktime(0,0,0,$current_month, $current_day, $current_year);
|
||||
|
||||
$rowheading = $this -> parse_heading($row['event_title'], $mode);
|
||||
$ICON = $bullet;
|
||||
$HEADING = "<a href='".e_PLUGIN."calendar_menu/event.php?".$row['event_start'].".event.".$row['event_id']."' title='".$row['event_title']."'>".$rowheading."</a>";
|
||||
$CATEGORY = $row['event_cat_name'];
|
||||
$DATE = ($arr[5] ? ($row['event_start'] ? $this -> getListDate($row['event_start'], $mode) : "") : "");
|
||||
$INFO = "";
|
||||
$LIST_DATA[$mode][] = array( $ICON, $HEADING, $AUTHOR, $CATEGORY, $DATE, $INFO );
|
||||
if($this->parent->mode == "new_page" || $this->parent->mode == "new_menu" )
|
||||
{
|
||||
$lvisit = $this->parent->getlvisit();
|
||||
$qry = " event_datestamp>".intval($lvisit)." AND ";
|
||||
}
|
||||
else
|
||||
{
|
||||
$qry = "";
|
||||
}
|
||||
|
||||
$bullet = $this->parent->getBullet($this->parent->settings['icon']);
|
||||
|
||||
$qry = "
|
||||
SELECT e.*, c.event_cat_name
|
||||
FROM #event AS e
|
||||
LEFT JOIN #event_cat AS c ON c.event_cat_id = e.event_category
|
||||
WHERE ".$qry." e.event_start>='$current' AND c.event_cat_class REGEXP '".e_CLASS_REGEXP."'
|
||||
ORDER BY e.event_start ASC LIMIT 0,".intval($this->parent->settings['amount']);
|
||||
|
||||
if(!$event_items = $this->parent->e107->sql->db_Select_gen($qry))
|
||||
{
|
||||
$list_data = LIST_CALENDAR_2;
|
||||
}
|
||||
else
|
||||
{
|
||||
while($row = $this->parent->e107->sql->db_Fetch())
|
||||
{
|
||||
$record = array();
|
||||
$tmp = explode(".", $row['event_author']);
|
||||
if($tmp[0] == "0")
|
||||
{
|
||||
$record['author'] = $tmp[1];
|
||||
}
|
||||
elseif(is_numeric($tmp[0]) && $tmp[0] != "0")
|
||||
{
|
||||
$record['author'] = (USER ? "<a href='".e_BASE."user.php?id.".$tmp[0]."'>".$tmp[1]."</a>" : $tmp[1]);
|
||||
}
|
||||
else
|
||||
{
|
||||
$record['author'] = "";
|
||||
}
|
||||
|
||||
$rowheading = $this->parent->parse_heading($row['event_title']);
|
||||
$record['icon'] = $bullet;
|
||||
$record['heading'] = "<a href='".e_PLUGIN."calendar_menu/event.php?".$row['event_start'].".event.".$row['event_id']."' title='".$row['event_title']."'>".$rowheading."</a>";
|
||||
$record['category'] = $row['event_cat_name'];
|
||||
$record['date'] = ($this->parent->settings['date'] ? ($row['event_start'] ? $this->parent->getListDate($row['event_start']) : "") : "");
|
||||
$record['info'] = '';
|
||||
|
||||
$list_data[] = $record;
|
||||
}
|
||||
}
|
||||
//return array with 'records', (global)'caption', 'display'
|
||||
return array(
|
||||
'records'=>$list_data,
|
||||
'caption'=>$list_caption,
|
||||
'display'=>$list_display
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@@ -1,41 +1,74 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* e107 website system
|
||||
*
|
||||
* Copyright (C) 2001-2008 e107 Inc (e107.org)
|
||||
* Released under the terms and conditions of the
|
||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||
*
|
||||
* Chatbox e_list Handler
|
||||
*
|
||||
* $Source: /cvs_backup/e107_0.8/e107_plugins/chatbox_menu/e_list.php,v $
|
||||
* $Revision: 1.2 $
|
||||
* $Date: 2009-01-27 21:33:52 $
|
||||
* $Author: lisa_ $
|
||||
*
|
||||
*/
|
||||
if (!defined('e107_INIT')) { exit; }
|
||||
|
||||
if(!$chatbox_install = $sql -> db_Select("plugin", "*", "plugin_path = 'chatbox_menu' AND plugin_installflag = '1' ")){
|
||||
return;
|
||||
class list_chatbox_menu
|
||||
{
|
||||
function list_chatbox_menu($parent)
|
||||
{
|
||||
$this->parent = $parent;
|
||||
}
|
||||
|
||||
$LIST_CAPTION = $arr[0];
|
||||
$LIST_DISPLAYSTYLE = ($arr[2] ? "" : "none");
|
||||
function getListData()
|
||||
{
|
||||
$list_caption = $this->parent->settings['caption'];
|
||||
$list_display = ($this->parent->settings['open'] ? "" : "none");
|
||||
|
||||
if($mode == "new_page" || $mode == "new_menu" ){
|
||||
$lvisit = $this -> getlvisit();
|
||||
$qry = "cb_datestamp>".$lvisit;
|
||||
}else{
|
||||
$qry = "cb_id != '0' ";
|
||||
}
|
||||
$qry .= " ORDER BY cb_datestamp DESC LIMIT 0,".intval($arr[7]);
|
||||
|
||||
$bullet = $this -> getBullet($arr[6], $mode);
|
||||
|
||||
if(!$chatbox_posts = $sql -> db_Select("chatbox", "*", $qry)){
|
||||
$LIST_DATA = LIST_CHATBOX_2;
|
||||
}else{
|
||||
while($row = $sql -> db_Fetch()) {
|
||||
|
||||
$cb_id = substr($row['cb_nick'] , 0, strpos($row['cb_nick'] , "."));
|
||||
$cb_nick = substr($row['cb_nick'] , (strpos($row['cb_nick'] , ".")+1));
|
||||
$cb_message = ($row['cb_blocked'] ? CHATBOX_L6 : str_replace("<br />", " ", $tp -> toHTML($row['cb_message'])));
|
||||
$rowheading = $this -> parse_heading($cb_message, $mode);
|
||||
$ICON = $bullet;
|
||||
$HEADING = $rowheading;
|
||||
$AUTHOR = ($arr[3] ? ($cb_id != 0 ? "<a href='".e_BASE."user.php?id.$cb_id'>".$cb_nick."</a>" : $cb_nick) : "");
|
||||
$CATEGORY = "";
|
||||
$DATE = ($arr[5] ? ($row['cb_datestamp'] ? $this -> getListDate($row['cb_datestamp'], $mode) : "") : "");
|
||||
$INFO = "";
|
||||
$LIST_DATA[$mode][] = array( $ICON, $HEADING, $AUTHOR, $CATEGORY, $DATE, $INFO );
|
||||
if($this->parent->mode == "new_page" || $this->parent->mode == "new_menu" )
|
||||
{
|
||||
$lvisit = $this->parent->getlvisit();
|
||||
$qry = "cb_datestamp>".$lvisit;
|
||||
}
|
||||
else
|
||||
{
|
||||
$qry = "cb_id != '0' ";
|
||||
}
|
||||
$qry .= " ORDER BY cb_datestamp DESC LIMIT 0,".intval($this->parent->settings['amount']);
|
||||
|
||||
$bullet = $this->parent->getBullet($this->parent->settings['icon']);
|
||||
|
||||
if(!$chatbox_posts = $this->parent->e107->sql->db_Select_gen("SELECT * FROM #chatbox WHERE ".$qry))
|
||||
{
|
||||
$list_data = LIST_CHATBOX_2;
|
||||
}
|
||||
else
|
||||
{
|
||||
while($row = $this->parent->e107->sql->db_Fetch())
|
||||
{
|
||||
$cb_id = substr($row['cb_nick'] , 0, strpos($row['cb_nick'] , "."));
|
||||
$cb_nick = substr($row['cb_nick'] , (strpos($row['cb_nick'] , ".")+1));
|
||||
$cb_message = ($row['cb_blocked'] ? CHATBOX_L6 : str_replace("<br />", " ", $tp->toHTML($row['cb_message'])));
|
||||
$rowheading = $this->parent->parse_heading($cb_message);
|
||||
$record['icon'] = $bullet;
|
||||
$record['heading'] = $rowheading;
|
||||
$record['author'] = ($this->parent->settings['author'] ? ($cb_id != 0 ? "<a href='".e_BASE."user.php?id.$cb_id'>".$cb_nick."</a>" : $cb_nick) : "");
|
||||
$record['category'] = "";
|
||||
$record['date'] = ($this->parent->settings['date'] ? ($row['cb_datestamp'] ? $this->parent->getListDate($row['cb_datestamp']) : "") : "");
|
||||
$record['info'] = "";
|
||||
|
||||
$list_data[] = $record;
|
||||
}
|
||||
//return array with 'records', (global)'caption', 'display'
|
||||
return array(
|
||||
'records'=>$list_data,
|
||||
'caption'=>$list_caption,
|
||||
'display'=>$list_display
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@@ -1,152 +1,157 @@
|
||||
<?php
|
||||
/*
|
||||
+ ----------------------------------------------------------------------------+
|
||||
| e107 website system
|
||||
|
|
||||
| Steve Dunstan 2001-2002
|
||||
| http://e107.org
|
||||
| jalist@e107.org
|
||||
|
|
||||
| Released under the terms and conditions of the
|
||||
| GNU General Public License (http://gnu.org).
|
||||
|
|
||||
| $Source: /cvs_backup/e107_0.8/e107_plugins/forum/e_list.php,v $
|
||||
| $Revision: 1.1.1.1 $
|
||||
| $Date: 2006-12-02 04:35:10 $
|
||||
| $Author: mcfly_e107 $
|
||||
+----------------------------------------------------------------------------+
|
||||
* e107 website system
|
||||
*
|
||||
* Copyright (C) 2001-2008 e107 Inc (e107.org)
|
||||
* Released under the terms and conditions of the
|
||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||
*
|
||||
* Forum e_list Handler
|
||||
*
|
||||
* $Source: /cvs_backup/e107_0.8/e107_plugins/forum/e_list.php,v $
|
||||
* $Revision: 1.2 $
|
||||
* $Date: 2009-01-27 21:33:52 $
|
||||
* $Author: lisa_ $
|
||||
*
|
||||
*/
|
||||
if (!defined('e107_INIT')) { exit; }
|
||||
|
||||
if(!$forum_install = $sql -> db_Select("plugin", "*", "plugin_path = 'forum' AND plugin_installflag = '1' "))
|
||||
class list_forum
|
||||
{
|
||||
function list_forum($parent)
|
||||
{
|
||||
return;
|
||||
$this->parent = $parent;
|
||||
}
|
||||
|
||||
$LIST_CAPTION = $arr[0];
|
||||
$LIST_DISPLAYSTYLE = ($arr[2] ? "" : "none");
|
||||
|
||||
$bullet = $this -> getBullet($arr[6], $mode);
|
||||
|
||||
if($mode == "new_page" || $mode == "new_menu" )
|
||||
function getListData()
|
||||
{
|
||||
$lvisit = $this -> getlvisit();
|
||||
$qry = "
|
||||
SELECT tp.thread_name AS parent_name, tp.thread_id as parent_id, f.forum_id, f.forum_name, f.forum_class, u.user_name, lp.user_name AS lp_name, t.thread_thread, t.thread_id, t.thread_views as tviews, t.thread_name, tp.thread_parent, t.thread_datestamp, t.thread_user, tp.thread_views, tp.thread_lastpost, tp.thread_lastuser, tp.thread_total_replies
|
||||
FROM #forum_t AS t
|
||||
LEFT JOIN #forum_t AS tp ON t.thread_parent = tp.thread_id
|
||||
LEFT JOIN #forum AS f ON f.forum_id = t.thread_forum_id
|
||||
LEFT JOIN #user AS u ON t.thread_user = u.user_id
|
||||
LEFT JOIN #user AS lp ON tp.thread_lastuser = lp.user_id
|
||||
WHERE f.forum_class REGEXP '".e_CLASS_REGEXP."'
|
||||
AND t.thread_datestamp > $lvisit
|
||||
ORDER BY t.thread_datestamp DESC LIMIT 0,".intval($arr[7]);
|
||||
}
|
||||
else
|
||||
{
|
||||
$qry = "
|
||||
SELECT t.thread_id, t.thread_name AS parent_name, t.thread_datestamp, t.thread_user, t.thread_views, t.thread_lastpost, t.thread_lastuser, t.thread_total_replies, f.forum_id, f.forum_name, f.forum_class, u.user_name, lp.user_name AS lp_name
|
||||
FROM #forum_t AS t
|
||||
LEFT JOIN #forum AS f ON f.forum_id = t.thread_forum_id
|
||||
LEFT JOIN #user AS u ON t.thread_user = u.user_id
|
||||
LEFT JOIN #user AS lp ON t.thread_lastuser = lp.user_id
|
||||
WHERE t.thread_parent=0 AND f.forum_class REGEXP '".e_CLASS_REGEXP."'
|
||||
ORDER BY t.thread_lastpost DESC LIMIT 0,".intval($arr[7]);
|
||||
|
||||
}
|
||||
$list_caption = $this->parent->settings['caption'];
|
||||
$list_display = ($this->parent->settings['open'] ? "" : "none");
|
||||
|
||||
if(!$results = $sql->db_Select_gen($qry))
|
||||
{
|
||||
$LIST_DATA = LIST_FORUM_2;
|
||||
}
|
||||
else
|
||||
{
|
||||
$forumArray = $sql->db_getList();
|
||||
$path = e_PLUGIN."forum/";
|
||||
$bullet = $this->parent->getBullet($this->parent->settings['icon']);
|
||||
|
||||
foreach($forumArray as $forumInfo)
|
||||
if($this->parent->mode == "new_page" || $this->parent->mode == "new_menu" )
|
||||
{
|
||||
extract($forumInfo);
|
||||
|
||||
//last user
|
||||
$r_id = substr($thread_lastuser, 0, strpos($thread_lastuser, "."));
|
||||
$r_name = substr($thread_lastuser, (strpos($thread_lastuser, ".")+1));
|
||||
if (strstr($thread_lastuser, chr(1))) {
|
||||
$tmp = explode(chr(1), $thread_lastuser);
|
||||
$r_name = $tmp[0];
|
||||
}
|
||||
$thread_lastuser = $r_id;
|
||||
$lvisit = $this->parent->getlvisit();
|
||||
$qry = "
|
||||
SELECT tp.thread_name AS parent_name, tp.thread_id as parent_id, f.forum_id, f.forum_name, f.forum_class, u.user_name, lp.user_name AS lp_name, t.thread_thread, t.thread_id, t.thread_views as tviews, t.thread_name, tp.thread_parent, t.thread_datestamp, t.thread_user, tp.thread_views, tp.thread_lastpost, tp.thread_lastuser, tp.thread_total_replies
|
||||
FROM #forum_t AS t
|
||||
LEFT JOIN #forum_t AS tp ON t.thread_parent = tp.thread_id
|
||||
LEFT JOIN #forum AS f ON f.forum_id = t.thread_forum_id
|
||||
LEFT JOIN #user AS u ON t.thread_user = u.user_id
|
||||
LEFT JOIN #user AS lp ON tp.thread_lastuser = lp.user_id
|
||||
WHERE f.forum_class REGEXP '".e_CLASS_REGEXP."'
|
||||
AND t.thread_datestamp > $lvisit
|
||||
ORDER BY t.thread_datestamp DESC LIMIT 0,".intval($this->parent->settings['amount']);
|
||||
}
|
||||
else
|
||||
{
|
||||
$qry = "
|
||||
SELECT t.thread_id, t.thread_name AS parent_name, t.thread_datestamp, t.thread_user, t.thread_views, t.thread_lastpost, t.thread_lastuser, t.thread_total_replies, f.forum_id, f.forum_name, f.forum_class, u.user_name, lp.user_name AS lp_name
|
||||
FROM #forum_t AS t
|
||||
LEFT JOIN #forum AS f ON f.forum_id = t.thread_forum_id
|
||||
LEFT JOIN #user AS u ON t.thread_user = u.user_id
|
||||
LEFT JOIN #user AS lp ON t.thread_lastuser = lp.user_id
|
||||
WHERE t.thread_parent=0 AND f.forum_class REGEXP '".e_CLASS_REGEXP."'
|
||||
ORDER BY t.thread_lastpost DESC LIMIT 0,".intval($this->parent->settings['amount']);
|
||||
}
|
||||
|
||||
//user
|
||||
$u_id = substr($thread_user, 0, strpos($thread_user, "."));
|
||||
$u_name = substr($thread_user, (strpos($thread_user, ".")+1));
|
||||
$thread_user = $u_id;
|
||||
if(!$results = $this->parent->e107->sql->db_Select_gen($qry))
|
||||
{
|
||||
$list_data = LIST_FORUM_2;
|
||||
}
|
||||
else
|
||||
{
|
||||
$forumArray = $this->parent->e107->sql->db_getList();
|
||||
$path = e_PLUGIN."forum/";
|
||||
|
||||
if ($thread_anon) {
|
||||
$tmp = explode(chr(1), $thread_anon);
|
||||
$thread_user = $tmp[0];
|
||||
$thread_user_ip = $tmp[1];
|
||||
}
|
||||
|
||||
$gen = new convert;
|
||||
$r_datestamp = $gen->convert_date($thread_lastpost, "short");
|
||||
if($thread_total_replies)
|
||||
foreach($forumArray as $forumInfo)
|
||||
{
|
||||
$LASTPOST = "";
|
||||
if($lp_name)
|
||||
{
|
||||
$LASTPOST = "<a href='".e_BASE."user.php?id.{$thread_lastuser}'>$lp_name</a>";
|
||||
extract($forumInfo);
|
||||
|
||||
$record = array();
|
||||
|
||||
//last user
|
||||
$r_id = substr($thread_lastuser, 0, strpos($thread_lastuser, "."));
|
||||
$r_name = substr($thread_lastuser, (strpos($thread_lastuser, ".")+1));
|
||||
if (strstr($thread_lastuser, chr(1))) {
|
||||
$tmp = explode(chr(1), $thread_lastuser);
|
||||
$r_name = $tmp[0];
|
||||
}
|
||||
else
|
||||
$thread_lastuser = $r_id;
|
||||
|
||||
//user
|
||||
$u_id = substr($thread_user, 0, strpos($thread_user, "."));
|
||||
$u_name = substr($thread_user, (strpos($thread_user, ".")+1));
|
||||
$thread_user = $u_id;
|
||||
|
||||
if ($thread_anon) {
|
||||
$tmp = explode(chr(1), $thread_anon);
|
||||
$thread_user = $tmp[0];
|
||||
$thread_user_ip = $tmp[1];
|
||||
}
|
||||
|
||||
$gen = new convert;
|
||||
$r_datestamp = $gen->convert_date($thread_lastpost, "short");
|
||||
if($thread_total_replies)
|
||||
{
|
||||
if($thread_lastuser{0} == "0")
|
||||
$LASTPOST = "";
|
||||
if($lp_name)
|
||||
{
|
||||
$LASTPOST = substr($thread_lastuser, 2);
|
||||
$LASTPOST = "<a href='".e_BASE."user.php?id.{$thread_lastuser}'>$lp_name</a>";
|
||||
}
|
||||
else
|
||||
{
|
||||
//$LASTPOST = NFPM_L16;
|
||||
if($thread_lastuser{0} == "0")
|
||||
{
|
||||
$LASTPOST = substr($thread_lastuser, 2);
|
||||
}
|
||||
else
|
||||
{
|
||||
//$LASTPOST = NFPM_L16;
|
||||
}
|
||||
}
|
||||
$LASTPOST .= " ".LIST_FORUM_6." <span class='smalltext'>$r_datestamp</span>";
|
||||
}
|
||||
else
|
||||
{
|
||||
$LASTPOST = " - ";
|
||||
$LASTPOSTDATE = '';
|
||||
}
|
||||
$LASTPOST .= " ".LIST_FORUM_6." <span class='smalltext'>$r_datestamp</span>";
|
||||
}
|
||||
else
|
||||
{
|
||||
$LASTPOST = " - ";
|
||||
$LASTPOSTDATE = "";
|
||||
}
|
||||
|
||||
if($parent_name == "")
|
||||
{
|
||||
$parent_name = $thread_name;
|
||||
if($parent_name == '')
|
||||
{
|
||||
$parent_name = $thread_name;
|
||||
}
|
||||
$rowheading = $this->parent->parse_heading($parent_name);
|
||||
$lnk = ($parent_id ? $thread_id.".post" : $thread_id);
|
||||
|
||||
$record['heading'] = "<a href='".$path."forum_viewtopic.php?$lnk' title='".$parent_name."'>".$rowheading."</a>";
|
||||
$record['author'] = ($this->parent->settings['author'] ? ($thread_anon ? $thread_user : "<a href='".e_BASE."user.php?id.$thread_user'>$user_name</a>") : "");
|
||||
$record['category'] = ($this->parent->settings['category'] ? "<a href='".$path."forum_viewforum.php?$forum_id'>$forum_name</a>" : "");
|
||||
$record['date'] = ($this->parent->settings['date'] ? $this->parent->getListDate($thread_datestamp) : "");
|
||||
$record['icon'] = $bullet;
|
||||
$VIEWS = $thread_views;
|
||||
$REPLIES = $thread_total_replies;
|
||||
if($thread_total_replies)
|
||||
{
|
||||
$record['info'] = "[ ".LIST_FORUM_3." ".$VIEWS.", ".LIST_FORUM_4." ".$REPLIES.", ".LIST_FORUM_5." ".$LASTPOST." ]";
|
||||
}
|
||||
else
|
||||
{
|
||||
$record['info'] = "[ ".LIST_FORUM_3." ".intval($tviews)." ]";
|
||||
}
|
||||
|
||||
$list_data[] = $record;
|
||||
}
|
||||
$rowheading = $this -> parse_heading($parent_name, $mode);
|
||||
if($parent_id)
|
||||
{
|
||||
$lnk = $thread_id.".post";
|
||||
}
|
||||
else
|
||||
{
|
||||
$lnk = $thread_id;
|
||||
}
|
||||
$HEADING = "<a href='".$path."forum_viewtopic.php?$lnk' title='".$parent_name."'>".$rowheading."</a>";
|
||||
$AUTHOR = ($arr[3] ? ($thread_anon ? $thread_user : "<a href='".e_BASE."user.php?id.$thread_user'>$user_name</a>") : "");
|
||||
$CATEGORY = ($arr[4] ? "<a href='".$path."forum_viewforum.php?$forum_id'>$forum_name</a>" : "");
|
||||
$DATE = ($arr[5] ? $this -> getListDate($thread_datestamp, $mode) : "");
|
||||
$ICON = $bullet;
|
||||
$VIEWS = $thread_views;
|
||||
$REPLIES = $thread_total_replies;
|
||||
if($thread_total_replies)
|
||||
{
|
||||
$INFO = "[ ".LIST_FORUM_3." ".$VIEWS.", ".LIST_FORUM_4." ".$REPLIES.", ".LIST_FORUM_5." ".$LASTPOST." ]";
|
||||
}
|
||||
else
|
||||
{
|
||||
$INFO = "[ ".LIST_FORUM_3." ".intval($tviews)." ]";
|
||||
}
|
||||
$LIST_DATA[$mode][] = array( $ICON, $HEADING, $AUTHOR, $CATEGORY, $DATE, $INFO );
|
||||
}
|
||||
//return array with 'records', (global)'caption', 'display'
|
||||
return array(
|
||||
'records'=>$list_data,
|
||||
'caption'=>$list_caption,
|
||||
'display'=>$list_display
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
@@ -1,46 +1,77 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* e107 website system
|
||||
*
|
||||
* Copyright (C) 2001-2008 e107 Inc (e107.org)
|
||||
* Released under the terms and conditions of the
|
||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||
*
|
||||
* linksPage e_list Handler
|
||||
*
|
||||
* $Source: /cvs_backup/e107_0.8/e107_plugins/links_page/e_list.php,v $
|
||||
* $Revision: 1.3 $
|
||||
* $Date: 2009-01-27 21:33:52 $
|
||||
* $Author: lisa_ $
|
||||
*
|
||||
*/
|
||||
if (!defined('e107_INIT')) { exit; }
|
||||
|
||||
if(!$links_install = $sql -> db_Select("plugin", "*", "plugin_path = 'links_page' AND plugin_installflag = '1' ")){
|
||||
return;
|
||||
class list_links_page
|
||||
{
|
||||
function list_links_page($parent)
|
||||
{
|
||||
$this->parent = $parent;
|
||||
}
|
||||
|
||||
$LIST_CAPTION = $arr[0];
|
||||
$LIST_DISPLAYSTYLE = ($arr[2] ? "" : "none");
|
||||
|
||||
if($mode == "new_page" || $mode == "new_menu" ){
|
||||
$lvisit = $this -> getlvisit();
|
||||
$qry = " l.link_datestamp>".$lvisit." AND ";
|
||||
}else{
|
||||
$qry = "";
|
||||
}
|
||||
|
||||
$bullet = $this -> getBullet($arr[6], $mode);
|
||||
|
||||
$qry = "
|
||||
SELECT l.*, c.link_category_id, c.link_category_name
|
||||
FROM #links_page AS l
|
||||
LEFT JOIN #links_page_cat AS c ON c.link_category_id = l.link_category
|
||||
WHERE ".$qry." l.link_class REGEXP '".e_CLASS_REGEXP."' AND c.link_category_class REGEXP '".e_CLASS_REGEXP."'
|
||||
ORDER BY l.link_datestamp DESC LIMIT 0,".intval($arr[7])."
|
||||
";
|
||||
|
||||
if(!$sql -> db_Select_gen($qry)){
|
||||
$LIST_DATA = LIST_LINKS_2;
|
||||
}else{
|
||||
while($row = $sql -> db_Fetch()){
|
||||
|
||||
$rowheading = $this -> parse_heading($row['link_name'], $mode);
|
||||
$ICON = $bullet;
|
||||
$HEADING = "<a href='".$row['link_url']."' rel='external' title='".$row['link_name']."'>".$rowheading."</a>";
|
||||
$AUTHOR = "";
|
||||
$CATEGORY = ($arr[4] ? "<a href='".e_PLUGIN."links_page/links.php?cat.".$row['link_category_id']."'>".$row['link_category_name']."</a>" : "");
|
||||
$DATE = ($arr[5] ? ($row['link_datestamp'] > 0 ? $this -> getListDate($row['link_datestamp'], $mode) : "") : "");
|
||||
$INFO = "";
|
||||
$LIST_DATA[$mode][] = array( $ICON, $HEADING, $AUTHOR, $CATEGORY, $DATE, $INFO );
|
||||
function getListData()
|
||||
{
|
||||
$list_caption = $this->parent->settings['caption'];
|
||||
$list_display = ($this->parent->settings['open'] ? "" : "none");
|
||||
|
||||
$qry = '';
|
||||
if($this->parent->mode == "new_page" || $this->parent->mode == "new_menu" )
|
||||
{
|
||||
$lvisit = $this->parent->getlvisit();
|
||||
$qry = " l.link_datestamp>".$lvisit." AND ";
|
||||
}
|
||||
|
||||
$bullet = $this->parent->getBullet($this->parent->settings['icon']);
|
||||
|
||||
$qry = "
|
||||
SELECT l.*, c.link_category_id, c.link_category_name
|
||||
FROM #links_page AS l
|
||||
LEFT JOIN #links_page_cat AS c ON c.link_category_id = l.link_category
|
||||
WHERE ".$qry." l.link_class REGEXP '".e_CLASS_REGEXP."' AND c.link_category_class REGEXP '".e_CLASS_REGEXP."'
|
||||
ORDER BY l.link_datestamp DESC LIMIT 0,".intval($this->parent->settings['amount'])." ";
|
||||
|
||||
if(!$this->parent->e107->sql->db_Select_gen($qry))
|
||||
{
|
||||
$list_data = LIST_LINKS_2;
|
||||
}
|
||||
else
|
||||
{
|
||||
$list_data = array();
|
||||
while($row = $this->parent->e107->sql->db_Fetch())
|
||||
{
|
||||
$record = array();
|
||||
$rowheading = $this->parent->parse_heading($row['link_name']);
|
||||
$record['icon'] = $bullet;
|
||||
$record['heading'] = "<a href='".$row['link_url']."' rel='external' title='".$row['link_name']."'>".$rowheading."</a>";
|
||||
$record['author'] = "";
|
||||
$record['category'] = ($this->parent->settings['category'] ? "<a href='".e_PLUGIN."links_page/links.php?cat.".$row['link_category_id']."'>".$row['link_category_name']."</a>" : "");
|
||||
$record['date'] = ($this->parent->settings['date'] ? ($row['link_datestamp'] > 0 ? $this->parent->getListDate($row['link_datestamp']) : "") : "");
|
||||
$record['info'] = "";
|
||||
|
||||
$list_data[] = $record;
|
||||
}
|
||||
}
|
||||
//return array with 'records', (global)'caption', 'display'
|
||||
return array(
|
||||
'records'=>$list_data,
|
||||
'caption'=>$list_caption,
|
||||
'display'=>$list_display
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@@ -1,20 +1,18 @@
|
||||
<?php
|
||||
/*
|
||||
+---------------------------------------------------------------+
|
||||
| e107 website system
|
||||
|
|
||||
| <20>Steve Dunstan 2001-2002
|
||||
| http://e107.org
|
||||
| jalist@e107.org
|
||||
|
|
||||
| Released under the terms and conditions of the
|
||||
| GNU General Public License (http://gnu.org).
|
||||
|
|
||||
| $Source: /cvs_backup/e107_0.8/e107_plugins/list_new/admin_list_config.php,v $
|
||||
| $Revision: 1.7 $
|
||||
| $Date: 2008-12-20 12:30:18 $
|
||||
| $Author: secretr $
|
||||
+---------------------------------------------------------------+
|
||||
* e107 website system
|
||||
*
|
||||
* Copyright (C) 2001-2008 e107 Inc (e107.org)
|
||||
* Released under the terms and conditions of the
|
||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||
*
|
||||
* List Admin Config
|
||||
*
|
||||
* $Source: /cvs_backup/e107_0.8/e107_plugins/list_new/admin_list_config.php,v $
|
||||
* $Revision: 1.8 $
|
||||
* $Date: 2009-01-27 21:33:52 $
|
||||
* $Author: lisa_ $
|
||||
*
|
||||
*/
|
||||
|
||||
//include and require several classes
|
||||
@@ -29,550 +27,51 @@ require_once(e_HANDLER."form_handler.php");
|
||||
$rs = new form;
|
||||
require_once(e_HANDLER."file_class.php");
|
||||
$fl = new e_file;
|
||||
$listplugindir = e_PLUGIN."list_new/";
|
||||
require_once($listplugindir."list_class.php");
|
||||
$rc = new listclass;
|
||||
|
||||
//get language file
|
||||
@include_lan($listplugindir."languages/".e_LANGUAGE.".php");
|
||||
require_once(e_PLUGIN."list_new/list_class.php");
|
||||
$rc = new listclass('admin');
|
||||
|
||||
//get all sections to use (and reload if new e_list.php files are added)
|
||||
$rc -> getSections();
|
||||
$rc->getSections();
|
||||
|
||||
//update preferences in database
|
||||
if(isset($_POST['update_menu']))
|
||||
{
|
||||
$list_pref = $rc -> getListPrefs(); // Get the preferences so we've got a reference for changes
|
||||
$temp = array();
|
||||
while(list($key, $value) = each($_POST))
|
||||
{
|
||||
if($value != LIST_ADMIN_2){ $temp[$tp->toDB($key)] = $tp->toDB($value); }
|
||||
}
|
||||
|
||||
if ($admin_log->logArrayDiffs($temp, $list_pref, 'LISTNEW_01'))
|
||||
{
|
||||
$tmp = $eArrayStorage->WriteArray($list_pref);
|
||||
$sql -> db_Update("core", "e107_value='{$tmp}' WHERE e107_name='list' ");
|
||||
$message = LIST_ADMIN_3;
|
||||
}
|
||||
else
|
||||
{
|
||||
$message = LIST_ADMIN_LAN_41;
|
||||
}
|
||||
$message = $rc->admin->db_update_menu();
|
||||
}
|
||||
|
||||
//check preferences from database
|
||||
$list_pref = $rc -> getListPrefs();
|
||||
|
||||
|
||||
$iconlist = $fl->get_files($listplugindir."images/");
|
||||
$rc->list_pref = $rc->getListPrefs();
|
||||
|
||||
//render message if set
|
||||
if(isset($message))
|
||||
{
|
||||
$ns -> tablerender("", "<div style='text-align:center'><b>".$message."</b></div>");
|
||||
$rc->e107->ns->tablerender("", "<div style='text-align:center'><b>".$message."</b></div>");
|
||||
}
|
||||
|
||||
//display admin page
|
||||
$text = $rc->admin->display();
|
||||
|
||||
//define some variables
|
||||
$stylespacer = "style='border:0; height:20px;'";
|
||||
$styletable = "style='width:90%; border:1px solid #444; border-collapse:collapse;' cellpadding='0' cellspacing='0' ";
|
||||
$rc->e107->ns->tablerender(LIST_ADMIN_1, $text);
|
||||
|
||||
//template for non expanding row
|
||||
$TOPIC_ROW_NOEXPAND = "
|
||||
<tr>
|
||||
<td class='forumheader3' style='width:20%; white-space:nowrap; vertical-align:top;'>{TOPIC_TOPIC}</td>
|
||||
<td class='forumheader3'>{TOPIC_FIELD}</td>
|
||||
</tr>
|
||||
";
|
||||
|
||||
//template for expanding row
|
||||
$TOPIC_ROW = "
|
||||
<tr>
|
||||
<td class='forumheader3' style='width:20%; white-space:nowrap; vertical-align:top;'>{TOPIC_TOPIC}</td>
|
||||
<td class='forumheader3'>
|
||||
<a href='#{TOPIC_CONTID}' class='e-pointer e-expandit'>{TOPIC_HEADING}</a>
|
||||
<div class='e-hideme' id='{TOPIC_CONTID}'>
|
||||
<div class='smalltext'>{TOPIC_HELP}</div><br />
|
||||
{TOPIC_FIELD}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
";
|
||||
|
||||
//template for spacer row
|
||||
$TOPIC_ROW_SPACER = "<tr><td $stylespacer colspan='2'></td></tr>";
|
||||
|
||||
$TOPIC_TABLE_START = "
|
||||
<div style='text-align:center;'>
|
||||
".$rs -> form_open("post", e_SELF, "menu_conf_form", "", "enctype='multipart/form-data'")."
|
||||
<table style='".ADMIN_WIDTH."' class='fborder'>";
|
||||
|
||||
//$TOPIC_TABLE_END = "
|
||||
//</table>
|
||||
//</form>
|
||||
//</div>";
|
||||
$TOPIC_TABLE_END = pref_submit()."</table></div>";
|
||||
|
||||
|
||||
$text .= "
|
||||
<div style='text-align:center'>
|
||||
".$rs -> form_open("post", e_SELF, "menu_conf_form", "", "class='admin-menu' enctype='multipart/form-data'")."\n";
|
||||
|
||||
$text .= parse_menu_options("recent_menu");
|
||||
$text .= parse_menu_options("new_menu");
|
||||
$text .= parse_page_options("recent_page");
|
||||
$text .= parse_page_options("new_page");
|
||||
|
||||
$text .= "
|
||||
</form>
|
||||
</div>";
|
||||
|
||||
$ns -> tablerender(LIST_ADMIN_1, $text);
|
||||
|
||||
|
||||
function parse_global_options($type){
|
||||
global $rc, $list_pref, $rs, $tp, $sections, $titles, $iconlist, $TOPIC_ROW, $TOPIC_ROW_SPACER, $TOPIC_TABLE_END;
|
||||
|
||||
//show sections
|
||||
$TOPIC_TOPIC = LIST_ADMIN_SECT_1;
|
||||
$TOPIC_HEADING = LIST_ADMIN_SECT_2;
|
||||
$TOPIC_HELP = LIST_ADMIN_SECT_3;
|
||||
$TOPIC_CONTID = "list-new-{$type}-expandable-sections";
|
||||
$TOPIC_FIELD = "";
|
||||
for($i=0;$i<count($sections);$i++){
|
||||
$TOPIC_FIELD .= $rs -> form_checkbox($sections[$i]."_".$type."_display", 1, ($list_pref[$sections[$i]."_".$type."_display"]) ? "1" : "0")." ".$titles[$i]."<br />";
|
||||
}
|
||||
$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
|
||||
|
||||
//open or closed
|
||||
$TOPIC_TOPIC = LIST_ADMIN_SECT_4;
|
||||
$TOPIC_HEADING = LIST_ADMIN_SECT_5;
|
||||
$TOPIC_HELP = LIST_ADMIN_SECT_6;
|
||||
$TOPIC_CONTID = "list-new-{$type}-expandable-display-style";
|
||||
$TOPIC_FIELD = "";
|
||||
for($i=0;$i<count($sections);$i++){
|
||||
$TOPIC_FIELD .= $rs -> form_checkbox($sections[$i]."_".$type."_open", 1, (isset($list_pref[$sections[$i]."_".$type."_open"]) ? "1" : "0"))." ".$titles[$i]."<br />";
|
||||
}
|
||||
$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
|
||||
|
||||
//author
|
||||
$TOPIC_TOPIC = LIST_ADMIN_SECT_7;
|
||||
$TOPIC_HEADING = LIST_ADMIN_SECT_8;
|
||||
$TOPIC_HELP = LIST_ADMIN_SECT_9;
|
||||
$TOPIC_CONTID = "list-new-{$type}-expandable-author";
|
||||
$TOPIC_FIELD = "";
|
||||
for($i=0;$i<count($sections);$i++){
|
||||
$TOPIC_FIELD .= $rs -> form_checkbox($sections[$i]."_".$type."_author", 1, (isset($list_pref[$sections[$i]."_".$type."_author"]) ? "1" : "0"))." ".$titles[$i]."<br />";
|
||||
}
|
||||
$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
|
||||
|
||||
//category
|
||||
$TOPIC_TOPIC = LIST_ADMIN_SECT_10;
|
||||
$TOPIC_HEADING = LIST_ADMIN_SECT_11;
|
||||
$TOPIC_HELP = LIST_ADMIN_SECT_12;
|
||||
$TOPIC_FIELD = "";
|
||||
$TOPIC_CONTID = "list-new-{$type}-expandable-category";
|
||||
for($i=0;$i<count($sections);$i++){
|
||||
$TOPIC_FIELD .= $rs -> form_checkbox($sections[$i]."_".$type."_category", 1, (isset($list_pref[$sections[$i]."_".$type."_category"]) ? "1" : "0"))." ".$titles[$i]."<br />";
|
||||
}
|
||||
$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
|
||||
|
||||
//date
|
||||
$TOPIC_TOPIC = LIST_ADMIN_SECT_13;
|
||||
$TOPIC_HEADING = LIST_ADMIN_SECT_14;
|
||||
$TOPIC_HELP = LIST_ADMIN_SECT_15;
|
||||
$TOPIC_FIELD = "";
|
||||
$TOPIC_CONTID = "list-new-{$type}-expandable-date";
|
||||
for($i=0;$i<count($sections);$i++){
|
||||
$TOPIC_FIELD .= $rs -> form_checkbox($sections[$i]."_".$type."_date", 1, (isset($list_pref[$sections[$i]."_".$type."_date"]) ? "1" : "0"))." ".$titles[$i]."<br />";
|
||||
}
|
||||
$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
|
||||
|
||||
//icon
|
||||
$TOPIC_TOPIC = LIST_ADMIN_SECT_22;
|
||||
$TOPIC_HEADING = LIST_ADMIN_SECT_23;
|
||||
$TOPIC_HELP = LIST_ADMIN_SECT_24;
|
||||
$TOPIC_CONTID = "list-new-{$type}-expandable-icon";
|
||||
$TOPIC_FIELD = "<table $styletable>";
|
||||
for($i=0;$i<count($sections);$i++){
|
||||
$TOPIC_FIELD .= "
|
||||
<tr>
|
||||
<td class='forumheader3' style='width:10%; white-space:nowrap; vertical-align:top;'>".$titles[$i]."</td>
|
||||
<td class='forumheader3'>
|
||||
".$rs -> form_text($sections[$i]."_".$type."_icon", 15, $list_pref[$sections[$i]."_".$type."_icon"], 100)."
|
||||
<input class='button' type='button' style='cursor:pointer' size='30' value='".LIST_ADMIN_12."' onclick=\"e107Helper.toggle('div_".$sections[$i]."_".$type."_icon'); return false;\" />
|
||||
<div id='div_".$sections[$i]."_".$type."_icon' style='display:none;'>";
|
||||
foreach($iconlist as $icon){
|
||||
$TOPIC_FIELD .= "<a href=\"javascript:insertext('".$icon['fname']."','".$sections[$i]."_".$type."_icon','div_".$sections[$i]."_".$type."_icon')\"><img src='".$icon['path'].$icon['fname']."' style='border:0' alt='' /></a> ";
|
||||
}
|
||||
$TOPIC_FIELD .= "</div>
|
||||
</td>
|
||||
</tr>";
|
||||
}
|
||||
$TOPIC_FIELD .= "</table>";
|
||||
$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
|
||||
|
||||
//amount
|
||||
$maxitems_amount = "50";
|
||||
$TOPIC_TOPIC = LIST_ADMIN_SECT_16;
|
||||
$TOPIC_HEADING = LIST_ADMIN_SECT_17;
|
||||
$TOPIC_HELP = LIST_ADMIN_SECT_18;
|
||||
$TOPIC_CONTID = "list-new-{$type}-expandable-amount";
|
||||
$TOPIC_FIELD = "<table $styletable>";
|
||||
for($i=0;$i<count($sections);$i++){
|
||||
$TOPIC_FIELD .= "
|
||||
<tr>
|
||||
<td class='forumheader3' style='width:10%; white-space:nowrap; vertical-align:top;'>".$titles[$i]."</td>
|
||||
<td class='forumheader3'>
|
||||
".$rs -> form_select_open($sections[$i]."_".$type."_amount");
|
||||
for($a=1; $a<=$maxitems_amount; $a++){
|
||||
$TOPIC_FIELD .= ($list_pref[$sections[$i]."_".$type."_amount"] == $a ? $rs -> form_option($a, 1, $a) : $rs -> form_option($a, 0, $a));
|
||||
}
|
||||
$TOPIC_FIELD .= $rs -> form_select_close()."
|
||||
</td>
|
||||
</tr>";
|
||||
}
|
||||
$TOPIC_FIELD .= "</table>";
|
||||
$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
|
||||
|
||||
//order
|
||||
$max = count($sections);
|
||||
$TOPIC_TOPIC = LIST_ADMIN_SECT_19;
|
||||
$TOPIC_HEADING = LIST_ADMIN_SECT_20;
|
||||
$TOPIC_HELP = LIST_ADMIN_SECT_21;
|
||||
$TOPIC_CONTID = "list-new-{$type}-expandable-order";
|
||||
$TOPIC_FIELD = "<table $styletable>";
|
||||
for($i=0;$i<count($sections);$i++){
|
||||
$TOPIC_FIELD .= "
|
||||
<tr>
|
||||
<td class='forumheader3' style='width:10%; white-space:nowrap; vertical-align:top;'>".$titles[$i]."</td>
|
||||
<td class='forumheader3'>
|
||||
".$rs -> form_select_open($sections[$i]."_".$type."_order");
|
||||
for($a=1; $a<=$max; $a++){
|
||||
$TOPIC_FIELD .= ($list_pref[$sections[$i]."_".$type."_order"] == $a ? $rs -> form_option($a, 1, $a) : $rs -> form_option($a, 0, $a));
|
||||
}
|
||||
$TOPIC_FIELD .= $rs -> form_select_close()."
|
||||
</td>
|
||||
</tr>";
|
||||
}
|
||||
$TOPIC_FIELD .= "</table>";
|
||||
$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
|
||||
|
||||
//caption
|
||||
$TOPIC_TOPIC = LIST_ADMIN_SECT_25;
|
||||
$TOPIC_HEADING = LIST_ADMIN_SECT_26;
|
||||
$TOPIC_HELP = LIST_ADMIN_SECT_27;
|
||||
$TOPIC_CONTID = "list-new-{$type}-expandable-caption";
|
||||
$TOPIC_FIELD = "<table $styletable>";
|
||||
for($i=0;$i<count($sections);$i++){
|
||||
$TOPIC_FIELD .= "
|
||||
<tr>
|
||||
<td class='forumheader3' style='width:10%; white-space:nowrap; vertical-align:top;'>".$titles[$i]."</td>
|
||||
<td class='forumheader3'>
|
||||
".$rs -> form_text($sections[$i]."_".$type."_caption", 30, $tp->toHTML($list_pref[$sections[$i]."_".$type."_caption"],"","defs"), "50", "tbox")."
|
||||
</td>
|
||||
</tr>";
|
||||
}
|
||||
$TOPIC_FIELD .= "</table>";
|
||||
$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
|
||||
|
||||
$text .= $TOPIC_ROW_SPACER;
|
||||
|
||||
return $text;
|
||||
/**
|
||||
* Display admin menu
|
||||
*
|
||||
* @return string menu
|
||||
*/
|
||||
function admin_list_config_adminmenu()
|
||||
{
|
||||
$act = "";
|
||||
unset($var);
|
||||
$var=array();
|
||||
//$var['general']['text'] = LIST_ADMIN_OPT_1;
|
||||
$var['list-new-recent-page']['text'] = LIST_ADMIN_OPT_2;
|
||||
$var['list-new-recent-menu']['text'] = LIST_ADMIN_OPT_3;
|
||||
$var['list-new-new-page']['text'] = LIST_ADMIN_OPT_4;
|
||||
$var['list-new-new-menu']['text'] = LIST_ADMIN_OPT_5;
|
||||
e_admin_menu(LIST_ADMIN_OPT_6.'--id--list_new', 'list-new-recent-page', $var);
|
||||
}
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------------------------------
|
||||
function parse_menu_options($type){
|
||||
global $rc, $list_pref, $rs, $tp, $sections, $titles, $iconlist, $TOPIC_ROW, $TOPIC_ROW_SPACER, $TOPIC_TABLE_END;
|
||||
|
||||
$text = "
|
||||
<div id='list-new-".str_replace('_', '-', $type)."' class='e-hideme center'>
|
||||
<table style='".ADMIN_WIDTH."' class='fborder'>";
|
||||
|
||||
if($type == "new_menu"){
|
||||
$text .= $rc -> parse_headerrow_title(LIST_ADMIN_OPT_5);
|
||||
}else{
|
||||
$text .= $rc -> parse_headerrow_title(LIST_ADMIN_OPT_3);
|
||||
}
|
||||
|
||||
$text .= parse_global_options($type);
|
||||
|
||||
//menu preference : caption
|
||||
$TOPIC_TOPIC = LIST_ADMIN_LAN_2;
|
||||
$TOPIC_HEADING = LIST_ADMIN_LAN_3;
|
||||
$TOPIC_HELP = LIST_ADMIN_LAN_4;
|
||||
$TOPIC_CONTID = "list-new-menu-{$type}-expandable-caption";
|
||||
$TOPIC_FIELD = $rs -> form_text($type."_caption", "30", $tp->toHTML($list_pref[$type."_caption"],"","defs"), "50", "tbox");
|
||||
$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
|
||||
|
||||
//menu preference : icon : use
|
||||
$TOPIC_TOPIC = LIST_ADMIN_LAN_5;
|
||||
$TOPIC_HEADING = LIST_ADMIN_LAN_6;
|
||||
$TOPIC_HELP = LIST_ADMIN_LAN_7;
|
||||
$TOPIC_CONTID = "list-new-menu-{$type}-expandable-icon-use";
|
||||
$TOPIC_FIELD = "
|
||||
".$rs -> form_radio($type."_icon_use", "1", ($list_pref[$type."_icon_use"] ? "1" : "0"), "", "").LIST_ADMIN_7."
|
||||
".$rs -> form_radio($type."_icon_use", "0", ($list_pref[$type."_icon_use"] ? "0" : "1"), "", "").LIST_ADMIN_8."
|
||||
";
|
||||
$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
|
||||
|
||||
//menu preference : icon : show default theme bullet
|
||||
$TOPIC_TOPIC = LIST_ADMIN_MENU_2;
|
||||
$TOPIC_HEADING = LIST_ADMIN_MENU_3;
|
||||
$TOPIC_HELP = LIST_ADMIN_MENU_4;
|
||||
$TOPIC_CONTID = "list-new-menu-{$type}-expandable-icon-show";
|
||||
$TOPIC_FIELD = "
|
||||
".$rs -> form_radio($type."_icon_default", "1", ($list_pref[$type."_icon_default"] ? "1" : "0"), "", "").LIST_ADMIN_7."
|
||||
".$rs -> form_radio($type."_icon_default", "0", ($list_pref[$type."_icon_default"] ? "0" : "1"), "", "").LIST_ADMIN_8."
|
||||
";
|
||||
$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
|
||||
|
||||
//menu preference : amount chars
|
||||
$TOPIC_TOPIC = LIST_ADMIN_LAN_8;
|
||||
$TOPIC_HEADING = LIST_ADMIN_LAN_9;
|
||||
$TOPIC_HELP = LIST_ADMIN_LAN_10;
|
||||
$TOPIC_CONTID = "list-new-menu-{$type}-expandable-amount-chars";
|
||||
$TOPIC_FIELD = $rs -> form_text($type."_char_heading", "30", $list_pref[$type."_char_heading"], "50", "tbox");
|
||||
$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
|
||||
|
||||
//menu preference : postfix
|
||||
$TOPIC_TOPIC = LIST_ADMIN_LAN_11;
|
||||
$TOPIC_HEADING = LIST_ADMIN_LAN_12;
|
||||
$TOPIC_HELP = LIST_ADMIN_LAN_13;
|
||||
$TOPIC_CONTID = "list-new-menu-{$type}-expandable-postfix";
|
||||
$TOPIC_FIELD = $rs -> form_text($type."_char_postfix", "30", $list_pref[$type."_char_postfix"], "50", "tbox");
|
||||
$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
|
||||
|
||||
//menu preference : date
|
||||
$TOPIC_TOPIC = LIST_ADMIN_LAN_14;
|
||||
$TOPIC_HEADING = LIST_ADMIN_LAN_15;
|
||||
$TOPIC_HELP = LIST_ADMIN_LAN_16;
|
||||
$TOPIC_CONTID = "list-new-menu-{$type}-expandable-date";
|
||||
$TOPIC_FIELD = $rs -> form_text($type."_datestyle", "30", $list_pref[$type."_datestyle"], "50", "tbox");
|
||||
$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
|
||||
|
||||
//menu preference : date today
|
||||
$TOPIC_TOPIC = LIST_ADMIN_LAN_17;
|
||||
$TOPIC_HEADING = LIST_ADMIN_LAN_18;
|
||||
$TOPIC_HELP = LIST_ADMIN_LAN_19;
|
||||
$TOPIC_CONTID = "list-new-menu-{$type}-expandable-datet";
|
||||
$TOPIC_FIELD = $rs -> form_text($type."_datestyletoday", "30", $list_pref[$type."_datestyletoday"], "50", "tbox");
|
||||
$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
|
||||
|
||||
//menu preference : show empty
|
||||
$TOPIC_TOPIC = LIST_ADMIN_LAN_26;
|
||||
$TOPIC_HEADING = LIST_ADMIN_LAN_27;
|
||||
$TOPIC_HELP = LIST_ADMIN_LAN_28;
|
||||
$TOPIC_CONTID = "list-new-menu-{$type}-expandable-sempty";
|
||||
$TOPIC_FIELD = "
|
||||
".$rs -> form_radio($type."_showempty", "1", ($list_pref[$type."_showempty"] ? "1" : "0"), "", "").LIST_ADMIN_7."
|
||||
".$rs -> form_radio($type."_showempty", "0", ($list_pref[$type."_showempty"] ? "0" : "1"), "", "").LIST_ADMIN_8."
|
||||
";
|
||||
$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
|
||||
|
||||
//menu preference : open section if content exists? this will override the individual setting of the section
|
||||
$TOPIC_TOPIC = LIST_ADMIN_LAN_39;
|
||||
$TOPIC_HEADING = LIST_ADMIN_LAN_40;
|
||||
$TOPIC_HELP = LIST_ADMIN_LAN_41;
|
||||
$TOPIC_CONTID = "list-new-menu-{$type}-expandable-osie";
|
||||
$TOPIC_FIELD = "
|
||||
".$rs -> form_radio($type."_openifrecords", "1", ($list_pref[$type."_openifrecords"] ? "1" : "0"), "", "").LIST_ADMIN_7."
|
||||
".$rs -> form_radio($type."_openifrecords", "0", ($list_pref[$type."_openifrecords"] ? "0" : "1"), "", "").LIST_ADMIN_8."
|
||||
";
|
||||
$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
|
||||
|
||||
$text .= $TOPIC_ROW_SPACER;
|
||||
$text .= $TOPIC_TABLE_END;
|
||||
|
||||
return $text;
|
||||
}
|
||||
//---------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------------------------------
|
||||
function parse_page_options($type){
|
||||
global $rc, $list_pref, $rs, $tp, $sections, $TOPIC_ROW, $TOPIC_ROW_SPACER, $TOPIC_TABLE_END;
|
||||
|
||||
if($type == "recent_page"){
|
||||
$display = "";
|
||||
}else{
|
||||
$display = "display:none;";
|
||||
}
|
||||
|
||||
$text = "
|
||||
<div id='list-new-".str_replace('_', '-', $type)."' class='e-hideme center'>
|
||||
<table style='".ADMIN_WIDTH."' class='fborder'>";
|
||||
|
||||
if($type == "new_page"){
|
||||
$text .= $rc -> parse_headerrow_title(LIST_ADMIN_OPT_4);
|
||||
}else{
|
||||
$text .= $rc -> parse_headerrow_title(LIST_ADMIN_OPT_2);
|
||||
}
|
||||
|
||||
$text .= parse_global_options($type);
|
||||
|
||||
//page preference : caption
|
||||
$TOPIC_TOPIC = LIST_ADMIN_LAN_2;
|
||||
$TOPIC_HEADING = LIST_ADMIN_LAN_3;
|
||||
$TOPIC_HELP = LIST_ADMIN_LAN_4;
|
||||
$TOPIC_CONTID = "list-new-page-{$type}-expandable-caption";
|
||||
$TOPIC_FIELD = $rs -> form_text($type."_caption", "30", $tp->toHTML($list_pref[$type."_caption"],"","defs"), "50", "tbox");
|
||||
$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
|
||||
|
||||
//page preference : icon : use
|
||||
$TOPIC_TOPIC = LIST_ADMIN_LAN_5;
|
||||
$TOPIC_HEADING = LIST_ADMIN_LAN_6;
|
||||
$TOPIC_HELP = LIST_ADMIN_LAN_7;
|
||||
$TOPIC_CONTID = "list-new-page-{$type}-expandable-icon-use";
|
||||
$TOPIC_FIELD = "
|
||||
".$rs -> form_radio($type."_icon_use", "1", ($list_pref[$type."_icon_use"] ? "1" : "0"), "", "").LIST_ADMIN_7."
|
||||
".$rs -> form_radio($type."_icon_use", "0", ($list_pref[$type."_icon_use"] ? "0" : "1"), "", "").LIST_ADMIN_8."
|
||||
";
|
||||
$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
|
||||
|
||||
//page preference : icon : show default theme bullet
|
||||
$TOPIC_TOPIC = LIST_ADMIN_LAN_29;
|
||||
$TOPIC_HEADING = LIST_ADMIN_LAN_30;
|
||||
$TOPIC_HELP = LIST_ADMIN_LAN_31;
|
||||
$TOPIC_CONTID = "list-new-page-{$type}-expandable-icon-show";
|
||||
$TOPIC_FIELD = "
|
||||
".$rs -> form_radio($type."_icon_default", "1", ($list_pref[$type."_icon_default"] ? "1" : "0"), "", "").LIST_ADMIN_7."
|
||||
".$rs -> form_radio($type."_icon_default", "0", ($list_pref[$type."_icon_default"] ? "0" : "1"), "", "").LIST_ADMIN_8."
|
||||
";
|
||||
$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
|
||||
|
||||
//page preference : amount chars
|
||||
$TOPIC_TOPIC = LIST_ADMIN_LAN_8;
|
||||
$TOPIC_HEADING = LIST_ADMIN_LAN_9;
|
||||
$TOPIC_HELP = LIST_ADMIN_LAN_10;
|
||||
$TOPIC_CONTID = "list-new-page-{$type}-expandable-amount-chars";
|
||||
$TOPIC_FIELD = $rs -> form_text($type."_char_heading", "30", $list_pref[$type."_char_heading"], "50", "tbox");
|
||||
$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
|
||||
|
||||
//page preference : postfix
|
||||
$TOPIC_TOPIC = LIST_ADMIN_LAN_11;
|
||||
$TOPIC_HEADING = LIST_ADMIN_LAN_12;
|
||||
$TOPIC_HELP = LIST_ADMIN_LAN_13;
|
||||
$TOPIC_CONTID = "list-new-page-{$type}-expandable-postfix";
|
||||
$TOPIC_FIELD = $rs -> form_text($type."_char_postfix", "30", $list_pref[$type."_char_postfix"], "50", "tbox");
|
||||
$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
|
||||
|
||||
//page preference : date
|
||||
$TOPIC_TOPIC = LIST_ADMIN_LAN_14;
|
||||
$TOPIC_HEADING = LIST_ADMIN_LAN_15;
|
||||
$TOPIC_HELP = LIST_ADMIN_LAN_16;
|
||||
$TOPIC_CONTID = "list-new-page-{$type}-expandable-date";
|
||||
$TOPIC_FIELD = $rs -> form_text($type."_datestyle", "30", $list_pref[$type."_datestyle"], "50", "tbox");
|
||||
$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
|
||||
|
||||
//page preference : date today
|
||||
$TOPIC_TOPIC = LIST_ADMIN_LAN_17;
|
||||
$TOPIC_HEADING = LIST_ADMIN_LAN_18;
|
||||
$TOPIC_HELP = LIST_ADMIN_LAN_19;
|
||||
$TOPIC_CONTID = "list-new-page-{$type}-expandable-datet";
|
||||
$TOPIC_FIELD = $rs -> form_text($type."_datestyletoday", "30", $list_pref[$type."_datestyletoday"], "50", "tbox");
|
||||
$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
|
||||
|
||||
//page preference : show empty
|
||||
$TOPIC_TOPIC = LIST_ADMIN_LAN_26;
|
||||
$TOPIC_HEADING = LIST_ADMIN_LAN_27;
|
||||
$TOPIC_HELP = LIST_ADMIN_LAN_28;
|
||||
$TOPIC_CONTID = "list-new-page-{$type}-expandable-showe";
|
||||
$TOPIC_FIELD = "
|
||||
".$rs -> form_radio($type."_showempty", "1", ($list_pref[$type."_showempty"] ? "1" : "0"), "", "").LIST_ADMIN_7."
|
||||
".$rs -> form_radio($type."_showempty", "0", ($list_pref[$type."_showempty"] ? "0" : "1"), "", "").LIST_ADMIN_8."
|
||||
";
|
||||
$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
|
||||
|
||||
//page preference : colomn
|
||||
$TOPIC_TOPIC = LIST_ADMIN_LAN_20;
|
||||
$TOPIC_HEADING = LIST_ADMIN_LAN_21;
|
||||
$TOPIC_HELP = LIST_ADMIN_LAN_22;
|
||||
$TOPIC_CONTID = "list-new-page-{$type}-expandable-colomn";
|
||||
$TOPIC_FIELD = $rs -> form_select_open($type."_colomn");
|
||||
for($a=1; $a<=count($sections); $a++){
|
||||
$TOPIC_FIELD .= ($list_pref[$type."_colomn"] == $a ? $rs -> form_option($a, 1, $a) : $rs -> form_option($a, 0, $a));
|
||||
}
|
||||
$TOPIC_FIELD .= $rs -> form_select_close();
|
||||
$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
|
||||
|
||||
//page preference : welcome text
|
||||
$TOPIC_TOPIC = LIST_ADMIN_LAN_23;
|
||||
$TOPIC_HEADING = LIST_ADMIN_LAN_24;
|
||||
$TOPIC_HELP = LIST_ADMIN_LAN_25;
|
||||
$TOPIC_CONTID = "list-new-page-{$type}-expandable-wtext";
|
||||
$TOPIC_FIELD = $rs -> form_textarea($type."_welcometext", "50", "5", $tp->toHTML($list_pref[$type."_welcometext"],"","defs"), "", "tbox");
|
||||
$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
|
||||
|
||||
if($type == "new_page"){
|
||||
//timelapse:show
|
||||
$TOPIC_TOPIC = LIST_ADMIN_LAN_36;
|
||||
$TOPIC_HEADING = LIST_ADMIN_LAN_37;
|
||||
$TOPIC_HELP = LIST_ADMIN_LAN_38;
|
||||
$TOPIC_CONTID = "list-new-page-{$type}-expandable-timelapse-show";
|
||||
$TOPIC_FIELD = "
|
||||
".$rs -> form_radio($type."_timelapse", "1", ($list_pref[$type."_timelapse"] ? "1" : "0"), "", "").LIST_ADMIN_7."
|
||||
".$rs -> form_radio($type."_timelapse", "0", ($list_pref[$type."_timelapse"] ? "0" : "1"), "", "").LIST_ADMIN_8."
|
||||
";
|
||||
$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
|
||||
|
||||
//timelapse day number maximum
|
||||
$TOPIC_TOPIC = LIST_ADMIN_LAN_32;
|
||||
$TOPIC_HEADING = LIST_ADMIN_LAN_33;
|
||||
$TOPIC_HELP = LIST_ADMIN_LAN_34;
|
||||
$TOPIC_CONTID = "list-new-page-{$type}-expandable-timelapse-dnm";
|
||||
$TOPIC_FIELD = $rs -> form_text($type."_timelapse_days", "3", $list_pref[$type."_timelapse_days"], "3", "tbox")." ".LIST_ADMIN_LAN_35;
|
||||
$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
|
||||
}
|
||||
|
||||
//page preference : open section if content exists? this will override the individual setting of the section
|
||||
$TOPIC_TOPIC = LIST_ADMIN_LAN_39;
|
||||
$TOPIC_HEADING = LIST_ADMIN_LAN_40;
|
||||
$TOPIC_HELP = LIST_ADMIN_LAN_41;
|
||||
$TOPIC_CONTID = "list-new-page-{$type}-expandable-osie";
|
||||
$TOPIC_FIELD = "
|
||||
".$rs -> form_radio($type."_openifrecords", "1", ($list_pref[$type."_openifrecords"] ? "1" : "0"), "", "").LIST_ADMIN_7."
|
||||
".$rs -> form_radio($type."_openifrecords", "0", ($list_pref[$type."_openifrecords"] ? "0" : "1"), "", "").LIST_ADMIN_8."
|
||||
";
|
||||
$text .= preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW);
|
||||
|
||||
$text .= $TOPIC_ROW_SPACER;
|
||||
$text .= $TOPIC_TABLE_END;
|
||||
|
||||
return $text;
|
||||
}
|
||||
//---------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
function pref_submit() {
|
||||
global $rs, $TOPIC_ROW_NOEXPAND;
|
||||
|
||||
$TOPIC_TOPIC = LIST_ADMIN_11;
|
||||
$TOPIC_FIELD = $rs -> form_button("submit", update_menu, LIST_ADMIN_2);
|
||||
return (preg_replace("/\{(.*?)\}/e", '$\1', $TOPIC_ROW_NOEXPAND));
|
||||
}
|
||||
|
||||
|
||||
// ##### Display options --------------------------------------------------------------------------
|
||||
function admin_list_config_adminmenu(){
|
||||
|
||||
$act = "";
|
||||
unset($var);
|
||||
$var=array();
|
||||
//$var['general']['text'] = LIST_ADMIN_OPT_1;
|
||||
$var['list-new-recent-page']['text'] = LIST_ADMIN_OPT_2;
|
||||
$var['list-new-recent-menu']['text'] = LIST_ADMIN_OPT_3;
|
||||
$var['list-new-new-page']['text'] = LIST_ADMIN_OPT_4;
|
||||
$var['list-new-new-menu']['text'] = LIST_ADMIN_OPT_5;
|
||||
e_admin_menu(LIST_ADMIN_OPT_6.'--id--list_new', 'list-new-recent-page', $var);
|
||||
//e_admin_menu(LIST_ADMIN_OPT_6, $act, $var, TRUE);
|
||||
|
||||
}
|
||||
// ##### End --------------------------------------------------------------------------------------
|
||||
|
||||
require_once(e_ADMIN."footer.php");
|
||||
|
||||
/**
|
||||
|
@@ -1,23 +1,22 @@
|
||||
<?php
|
||||
/*
|
||||
+ ----------------------------------------------------------------------------+
|
||||
| e107 website system
|
||||
|
|
||||
| <20>Steve Dunstan 2001-2002
|
||||
| http://e107.org
|
||||
| jalist@e107.org
|
||||
|
|
||||
| Released under the terms and conditions of the
|
||||
| GNU General Public License (http://gnu.org).
|
||||
|
|
||||
* e107 website system
|
||||
*
|
||||
* Copyright (C) 2001-2008 e107 Inc (e107.org)
|
||||
* Released under the terms and conditions of the
|
||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||
*
|
||||
* List Language
|
||||
*
|
||||
| $Source: /cvs_backup/e107_0.8/e107_plugins/list_new/languages/English.php,v $
|
||||
| $Revision: 1.5 $
|
||||
| $Date: 2008-12-11 22:38:06 $
|
||||
| $Author: e107steved $
|
||||
+----------------------------------------------------------------------------+
|
||||
| $Revision: 1.6 $
|
||||
| $Date: 2009-01-27 21:34:02 $
|
||||
| $Author: lisa_ $
|
||||
*
|
||||
*/
|
||||
|
||||
if (!defined("PAGE_NAME")) { define("PAGE_NAME", "List New Items"); }
|
||||
|
||||
define("LIST_MENU_1", "recent additions");
|
||||
define("LIST_MENU_2", "by");
|
||||
define("LIST_MENU_3", "on");
|
||||
|
@@ -1,20 +1,18 @@
|
||||
<?php
|
||||
/*
|
||||
+ ----------------------------------------------------------------------------+
|
||||
| e107 website system
|
||||
|
|
||||
| <20>Steve Dunstan 2001-2002
|
||||
| http://e107.org
|
||||
| jalist@e107.org
|
||||
|
|
||||
| Released under the terms and conditions of the
|
||||
| GNU General Public License (http://gnu.org).
|
||||
|
|
||||
* e107 website system
|
||||
*
|
||||
* Copyright (C) 2001-2008 e107 Inc (e107.org)
|
||||
* Released under the terms and conditions of the
|
||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||
*
|
||||
* List Language Admin
|
||||
*
|
||||
| $Source: /cvs_backup/e107_0.8/e107_plugins/list_new/languages/English_admin_list_new.php,v $
|
||||
| $Revision: 1.1 $
|
||||
| $Date: 2008-12-11 22:38:06 $
|
||||
| $Author: e107steved $
|
||||
+----------------------------------------------------------------------------+
|
||||
| $Revision: 1.2 $
|
||||
| $Date: 2009-01-27 21:34:02 $
|
||||
| $Author: lisa_ $
|
||||
*
|
||||
*/
|
||||
|
||||
if (!defined("PAGE_NAME")) { define("PAGE_NAME", "List New Items"); }
|
||||
@@ -42,6 +40,7 @@ define("LIST_ADMIN_13", "Welcome to the Recent page of ".SITENAME." ! This page
|
||||
define("LIST_ADMIN_14", "recent additions");
|
||||
define("LIST_ADMIN_15", "new since your last visit");
|
||||
define("LIST_ADMIN_16", "Welcome to the New page of ".SITENAME." ! This page shows, for the most common sections of this site, a list of the additions in these sections since your last visit.");
|
||||
define("LIST_ADMIN_17", 'Nothing changed - not updated');
|
||||
|
||||
define("LIST_ADMIN_SECT_1", "sections");
|
||||
define("LIST_ADMIN_SECT_2", "choose which sections to show");
|
||||
@@ -141,7 +140,7 @@ define("LIST_ADMIN_LAN_38", "");
|
||||
|
||||
define("LIST_ADMIN_LAN_39", "open if records exist");
|
||||
define("LIST_ADMIN_LAN_40", "should sections that contain records be opened by default?");
|
||||
define("LIST_ADMIN_LAN_41", 'Nothing changed - not updated');
|
||||
define("LIST_ADMIN_LAN_41", '');
|
||||
|
||||
// Admin log messages
|
||||
//-------------------
|
||||
|
@@ -1,142 +1,61 @@
|
||||
<?php
|
||||
/*
|
||||
+---------------------------------------------------------------+
|
||||
| e107 website system
|
||||
|
|
||||
| <20>Steve Dunstan 2001-2002
|
||||
| http://e107.org
|
||||
| jalist@e107.org
|
||||
|
|
||||
| Released under the terms and conditions of the
|
||||
| GNU General Public License (http://gnu.org).
|
||||
|
|
||||
| $Source: /cvs_backup/e107_0.8/e107_plugins/list_new/list.php,v $
|
||||
| $Revision: 1.3 $
|
||||
| $Date: 2009-01-06 21:30:28 $
|
||||
| $Author: e107steved $
|
||||
+---------------------------------------------------------------+
|
||||
* e107 website system
|
||||
*
|
||||
* Copyright (C) 2001-2008 e107 Inc (e107.org)
|
||||
* Released under the terms and conditions of the
|
||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||
*
|
||||
* List Page
|
||||
*
|
||||
* $Source: /cvs_backup/e107_0.8/e107_plugins/list_new/list.php,v $
|
||||
* $Revision: 1.4 $
|
||||
* $Date: 2009-01-27 21:33:52 $
|
||||
* $Author: lisa_ $
|
||||
*
|
||||
*/
|
||||
|
||||
require_once("../../class2.php");
|
||||
|
||||
$listplugindir = e_PLUGIN."list_new/";
|
||||
|
||||
//get language file
|
||||
include_lan($listplugindir."languages/".e_LANGUAGE.".php");
|
||||
|
||||
if (!plugInstalled('list_new'))
|
||||
{
|
||||
header("Location: ".e_BASE."index.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
require_once($listplugindir."list_shortcodes.php");
|
||||
if (!is_object($rc))
|
||||
{
|
||||
require_once($listplugindir . "list_class.php");
|
||||
$rc = new listclass;
|
||||
}
|
||||
|
||||
require_once(e_HANDLER."form_handler.php");
|
||||
$rs = new form;
|
||||
e107_require_once(e_HANDLER.'arraystorage_class.php');
|
||||
$eArrayStorage = new ArrayData();
|
||||
|
||||
global $rc;
|
||||
if (!is_object($rc))
|
||||
{
|
||||
require_once(e_PLUGIN."list_new/list_class.php");
|
||||
$rc = new listclass;
|
||||
}
|
||||
|
||||
unset($text);
|
||||
|
||||
require_once(HEADERF);
|
||||
|
||||
global $tp,$list_pref;
|
||||
|
||||
// check query
|
||||
//check query
|
||||
$mode = '';
|
||||
if(e_QUERY)
|
||||
{
|
||||
$qs = explode(".", e_QUERY);
|
||||
if($qs[0] == "new")
|
||||
if($qs[0] == 'new')
|
||||
{
|
||||
$mode = $qs[0];
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($mode) && $mode == "new")
|
||||
{
|
||||
$mode = "new_page";
|
||||
}
|
||||
else
|
||||
{
|
||||
$mode = "recent_page"; //default to 'page'
|
||||
}
|
||||
//set mode
|
||||
$rc->mode = (varsettrue($mode) == 'new' ? 'new_page' : 'recent_page');
|
||||
|
||||
if(!isset($list_pref))
|
||||
{
|
||||
$list_pref = $rc->getListPrefs();
|
||||
}
|
||||
$sections = $rc -> prepareSection($mode);
|
||||
$arr = $rc -> prepareSectionArray($mode, $sections);
|
||||
//parse page
|
||||
$text = $rc->displayPage();
|
||||
|
||||
$text = "";
|
||||
$timelapse = 0;
|
||||
if(isset($qs[0]) && $qs[0] == "new")
|
||||
{
|
||||
if(isset($list_pref['new_page_timelapse']) && $list_pref['new_page_timelapse']){
|
||||
if(isset($list_pref['new_page_timelapse_days']) && is_numeric($list_pref['new_page_timelapse_days'])){
|
||||
$days = $list_pref['new_page_timelapse_days'];
|
||||
}else{
|
||||
$days = "30";
|
||||
}
|
||||
if(isset($qs[1]) && is_numeric($qs[1]) && $qs[1] <= $days){
|
||||
$timelapse = $qs[1];
|
||||
}
|
||||
$url = e_PLUGIN."list_new/list.php?new";
|
||||
$selectjs = "onchange=\"if(this.options[this.selectedIndex].value != 'none'){ return document.location=this.options[this.selectedIndex].value; }\"";
|
||||
|
||||
$LIST_TIMELAPSE = LIST_MENU_6;
|
||||
$LIST_TIMELAPSE .= $rs -> form_select_open("timelapse", $selectjs).$rs -> form_option(LIST_MENU_5, 0, $url);
|
||||
for($a=1; $a<=$days; $a++){
|
||||
$LIST_TIMELAPSE .= $rs -> form_option($a, ($timelapse == $a ? "1" : "0"), $url.".".$a);
|
||||
}
|
||||
$LIST_TIMELAPSE .= $rs -> form_select_close();
|
||||
$text .= preg_replace("/\{(.*?)\}/e", '$\1', $LIST_TIMELAPSE_TABLE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//display the sections
|
||||
$LIST_COL_COLS = $list_pref[$mode."_colomn"];
|
||||
|
||||
$LIST_COL_CELLWIDTH = round((100/$list_pref[$mode."_colomn"]),0);
|
||||
$text .= $LIST_COL_START;
|
||||
|
||||
if($list_pref[$mode."_welcometext"])
|
||||
{
|
||||
$LIST_COL_WELCOMETEXT = $tp -> toHTML($list_pref[$mode."_welcometext"]);
|
||||
$text .= preg_replace("/\{(.*?)\}/e", '$\1', $LIST_COL_WELCOME);
|
||||
}
|
||||
$k=0;
|
||||
for($i=0;$i<count($arr);$i++)
|
||||
{
|
||||
unset($rowswitch);
|
||||
if($arr[$i][1] == "1")
|
||||
{
|
||||
$sectiontext = $rc -> show_section_list($arr[$i], $mode);
|
||||
if($sectiontext != "")
|
||||
{
|
||||
if( intval($k/$list_pref[$mode."_colomn"]) == $k/$list_pref[$mode."_colomn"] )
|
||||
{
|
||||
$rowswitch = $LIST_COL_ROWSWITCH;
|
||||
}
|
||||
$text .= (isset($rowswitch) ? $rowswitch : "");
|
||||
$text .= preg_replace("/\{(.*?)\}/e", '$\1', $LIST_COL_CELL_START);
|
||||
$text .= $sectiontext;
|
||||
$text .= $LIST_COL_CELL_END;
|
||||
$k++;
|
||||
}
|
||||
}
|
||||
}
|
||||
$text .= $LIST_COL_END;
|
||||
|
||||
$caption = (isset($list_pref[$mode."_caption"]) && $list_pref[$mode."_caption"] ? $list_pref[$mode."_caption"] : LIST_MENU_1);
|
||||
$ns -> tablerender($caption, $text);
|
||||
$caption = varsettrue($rc->list_pref[$rc->mode."_caption"], LIST_MENU_1);
|
||||
$rc->e107->ns->tablerender($caption, $text);
|
||||
unset($text);
|
||||
|
||||
require_once(FOOTERF);
|
||||
|
570
e107_plugins/list_new/list_admin_class.php
Normal file
570
e107_plugins/list_new/list_admin_class.php
Normal file
@@ -0,0 +1,570 @@
|
||||
<?php
|
||||
/*
|
||||
* e107 website system
|
||||
*
|
||||
* Copyright (C) 2001-2008 e107 Inc (e107.org)
|
||||
* Released under the terms and conditions of the
|
||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||
*
|
||||
* List Admin Class
|
||||
*
|
||||
* $Source: /cvs_backup/e107_0.8/e107_plugins/list_new/list_admin_class.php,v $
|
||||
* $Revision: 1.1 $
|
||||
* $Date: 2009-01-27 21:33:52 $
|
||||
* $Author: lisa_ $
|
||||
*
|
||||
*/
|
||||
if (!defined('e107_INIT')) { exit; }
|
||||
|
||||
/**
|
||||
* e107 List New Plugin
|
||||
* @package list_new
|
||||
*/
|
||||
/**
|
||||
* class list_admin
|
||||
* The admin class
|
||||
* @package list_admin
|
||||
*/
|
||||
class list_admin
|
||||
{
|
||||
var $row;
|
||||
|
||||
/**
|
||||
* constructor
|
||||
*
|
||||
* @param object $parent the parent object
|
||||
* @return void
|
||||
*
|
||||
*/
|
||||
function list_admin($parent)
|
||||
{
|
||||
$this->e107 = e107::getInstance();
|
||||
$this->parent = $parent;
|
||||
|
||||
$this->styletable = "style='width:90%; border:1px solid #444; border-collapse:collapse;' cellpadding='0' cellspacing='0' ";
|
||||
}
|
||||
|
||||
/**
|
||||
* database update settings
|
||||
*
|
||||
* @return sting $message
|
||||
*
|
||||
*/
|
||||
function db_update_menu()
|
||||
{
|
||||
// Get the preferences so we've got a reference for changes
|
||||
$list_pref = $this->parent->getListPrefs();
|
||||
$temp = array();
|
||||
while(list($key, $value) = each($_POST))
|
||||
{
|
||||
if($value != LIST_ADMIN_2){ $temp[$this->e107->tp->toDB($key)] = $this->e107->tp->toDB($value); }
|
||||
}
|
||||
|
||||
if ($this->e107->admin_log->logArrayDiffs($temp, $list_pref, 'LISTNEW_01'))
|
||||
{
|
||||
$tmp = $this->e107->arrayStorage->WriteArray($list_pref);
|
||||
$this->e107->sql->db_Update("core", "e107_value='{$tmp}' WHERE e107_name='list' ");
|
||||
$message = LIST_ADMIN_3;
|
||||
}
|
||||
else
|
||||
{
|
||||
$message = LIST_ADMIN_17;
|
||||
}
|
||||
return $message;
|
||||
}
|
||||
|
||||
/**
|
||||
* display the admin configuration page
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
*/
|
||||
function display()
|
||||
{
|
||||
global $rs;
|
||||
|
||||
$text = "
|
||||
<div style='text-align:center'>
|
||||
".$rs->form_open("post", e_SELF, "menu_conf_form", "", "class='admin-menu' enctype='multipart/form-data'")."\n";
|
||||
|
||||
$text .= $this->parse_menu_options("recent_menu");
|
||||
$text .= $this->parse_menu_options("new_menu");
|
||||
$text .= $this->parse_page_options("recent_page");
|
||||
$text .= $this->parse_page_options("new_page");
|
||||
|
||||
$text .= "
|
||||
</form>
|
||||
</div>";
|
||||
|
||||
return $text;
|
||||
}
|
||||
|
||||
/**
|
||||
* display global options
|
||||
*
|
||||
* @param string $type the area to display
|
||||
* @return string
|
||||
*
|
||||
*/
|
||||
function parse_global_options($type)
|
||||
{
|
||||
global $rs, $fl;
|
||||
|
||||
$text = '';
|
||||
|
||||
//show sections
|
||||
$this->row['TOPIC'] = LIST_ADMIN_SECT_1;
|
||||
$this->row['HEADING'] = LIST_ADMIN_SECT_2;
|
||||
$this->row['HELP'] = LIST_ADMIN_SECT_3;
|
||||
$this->row['CONTID'] = "list-new-{$type}-expandable-sections";
|
||||
$this->row['FIELD'] = "";
|
||||
for($i=0;$i<count($this->parent->sections);$i++)
|
||||
{
|
||||
$this->row['FIELD'] .= $rs->form_checkbox($this->parent->sections[$i]."_".$type."_display", 1, (varsettrue($this->parent->list_pref[$this->parent->sections[$i]."_".$type."_display"]) ? "1" : "0"))." ".$this->parent->titles[$i]."<br />";
|
||||
}
|
||||
$text .= $this->parseTemplate('TOPIC_ROW');
|
||||
|
||||
//open or closed
|
||||
$this->row['TOPIC'] = LIST_ADMIN_SECT_4;
|
||||
$this->row['HEADING'] = LIST_ADMIN_SECT_5;
|
||||
$this->row['HELP'] = LIST_ADMIN_SECT_6;
|
||||
$this->row['CONTID'] = "list-new-{$type}-expandable-display-style";
|
||||
$this->row['FIELD'] = "";
|
||||
for($i=0;$i<count($this->parent->sections);$i++)
|
||||
{
|
||||
$this->row['FIELD'] .= $rs->form_checkbox($this->parent->sections[$i]."_".$type."_open", 1, (varsettrue($this->parent->list_pref[$this->parent->sections[$i]."_".$type."_open"]) ? "1" : "0"))." ".$this->parent->titles[$i]."<br />";
|
||||
}
|
||||
$text .= $this->parseTemplate('TOPIC_ROW');
|
||||
|
||||
//author
|
||||
$this->row['TOPIC'] = LIST_ADMIN_SECT_7;
|
||||
$this->row['HEADING'] = LIST_ADMIN_SECT_8;
|
||||
$this->row['HELP'] = LIST_ADMIN_SECT_9;
|
||||
$this->row['CONTID'] = "list-new-{$type}-expandable-author";
|
||||
$this->row['FIELD'] = "";
|
||||
for($i=0;$i<count($this->parent->sections);$i++)
|
||||
{
|
||||
$this->row['FIELD'] .= $rs->form_checkbox($this->parent->sections[$i]."_".$type."_author", 1, (varsettrue($this->parent->list_pref[$this->parent->sections[$i]."_".$type."_author"]) ? "1" : "0"))." ".$this->parent->titles[$i]."<br />";
|
||||
}
|
||||
$text .= $this->parseTemplate('TOPIC_ROW');
|
||||
|
||||
//category
|
||||
$this->row['TOPIC'] = LIST_ADMIN_SECT_10;
|
||||
$this->row['HEADING'] = LIST_ADMIN_SECT_11;
|
||||
$this->row['HELP'] = LIST_ADMIN_SECT_12;
|
||||
$this->row['FIELD'] = "";
|
||||
$this->row['CONTID'] = "list-new-{$type}-expandable-category";
|
||||
for($i=0;$i<count($this->parent->sections);$i++)
|
||||
{
|
||||
$this->row['FIELD'] .= $rs->form_checkbox($this->parent->sections[$i]."_".$type."_category", 1, (varsettrue($this->parent->list_pref[$this->parent->sections[$i]."_".$type."_category"]) ? "1" : "0"))." ".$this->parent->titles[$i]."<br />";
|
||||
}
|
||||
$text .= $this->parseTemplate('TOPIC_ROW');
|
||||
|
||||
//date
|
||||
$this->row['TOPIC'] = LIST_ADMIN_SECT_13;
|
||||
$this->row['HEADING'] = LIST_ADMIN_SECT_14;
|
||||
$this->row['HELP'] = LIST_ADMIN_SECT_15;
|
||||
$this->row['FIELD'] = "";
|
||||
$this->row['CONTID'] = "list-new-{$type}-expandable-date";
|
||||
for($i=0;$i<count($this->parent->sections);$i++)
|
||||
{
|
||||
$this->row['FIELD'] .= $rs->form_checkbox($this->parent->sections[$i]."_".$type."_date", 1, (varsettrue($this->parent->list_pref[$this->parent->sections[$i]."_".$type."_date"]) ? "1" : "0"))." ".$this->parent->titles[$i]."<br />";
|
||||
}
|
||||
$text .= $this->parseTemplate('TOPIC_ROW');
|
||||
|
||||
//icon
|
||||
$this->row['TOPIC'] = LIST_ADMIN_SECT_22;
|
||||
$this->row['HEADING'] = LIST_ADMIN_SECT_23;
|
||||
$this->row['HELP'] = LIST_ADMIN_SECT_24;
|
||||
$this->row['CONTID'] = "list-new-{$type}-expandable-icon";
|
||||
$this->row['FIELD'] = "<table $this->styletable>";
|
||||
$iconlist = $fl->get_files($this->parent->plugin_dir."images/");
|
||||
for($i=0;$i<count($this->parent->sections);$i++)
|
||||
{
|
||||
$this->row['FIELD'] .= "
|
||||
<tr>
|
||||
<td class='forumheader3' style='width:10%; white-space:nowrap; vertical-align:top;'>".$this->parent->titles[$i]."</td>
|
||||
<td class='forumheader3'>
|
||||
".$rs->form_text($this->parent->sections[$i]."_".$type."_icon", 15, $this->parent->list_pref[$this->parent->sections[$i]."_".$type."_icon"], 100)."
|
||||
<input class='button' type='button' style='cursor:pointer' size='30' value='".LIST_ADMIN_12."' onclick=\"e107Helper.toggle('div_".$this->parent->sections[$i]."_".$type."_icon'); return false;\" />
|
||||
<div id='div_".$this->parent->sections[$i]."_".$type."_icon' style='display:none;'>";
|
||||
foreach($iconlist as $icon)
|
||||
{
|
||||
$this->row['FIELD'] .= "<a href=\"javascript:insertext('".$icon['fname']."','".$this->parent->sections[$i]."_".$type."_icon','div_".$this->parent->sections[$i]."_".$type."_icon')\"><img src='".$icon['path'].$icon['fname']."' style='border:0' alt='' /></a> ";
|
||||
}
|
||||
$this->row['FIELD'] .= "</div>
|
||||
</td>
|
||||
</tr>";
|
||||
}
|
||||
$this->row['FIELD'] .= "</table>";
|
||||
$text .= $this->parseTemplate('TOPIC_ROW');
|
||||
|
||||
//amount
|
||||
$maxitems_amount = "50";
|
||||
$this->row['TOPIC'] = LIST_ADMIN_SECT_16;
|
||||
$this->row['HEADING'] = LIST_ADMIN_SECT_17;
|
||||
$this->row['HELP'] = LIST_ADMIN_SECT_18;
|
||||
$this->row['CONTID'] = "list-new-{$type}-expandable-amount";
|
||||
$this->row['FIELD'] = "<table $this->styletable>";
|
||||
for($i=0;$i<count($this->parent->sections);$i++)
|
||||
{
|
||||
$this->row['FIELD'] .= "
|
||||
<tr>
|
||||
<td class='forumheader3' style='width:10%; white-space:nowrap; vertical-align:top;'>".$this->parent->titles[$i]."</td>
|
||||
<td class='forumheader3'>
|
||||
".$rs->form_select_open($this->parent->sections[$i]."_".$type."_amount");
|
||||
for($a=1; $a<=$maxitems_amount; $a++)
|
||||
{
|
||||
$this->row['FIELD'] .= ($this->parent->list_pref[$this->parent->sections[$i]."_".$type."_amount"] == $a ? $rs->form_option($a, 1, $a) : $rs->form_option($a, 0, $a));
|
||||
}
|
||||
$this->row['FIELD'] .= $rs->form_select_close()."
|
||||
</td>
|
||||
</tr>";
|
||||
}
|
||||
$this->row['FIELD'] .= "</table>";
|
||||
$text .= $this->parseTemplate('TOPIC_ROW');
|
||||
|
||||
//order
|
||||
$max = count($this->parent->sections);
|
||||
$this->row['TOPIC'] = LIST_ADMIN_SECT_19;
|
||||
$this->row['HEADING'] = LIST_ADMIN_SECT_20;
|
||||
$this->row['HELP'] = LIST_ADMIN_SECT_21;
|
||||
$this->row['CONTID'] = "list-new-{$type}-expandable-order";
|
||||
$this->row['FIELD'] = "<table $this->styletable>";
|
||||
for($i=0;$i<count($this->parent->sections);$i++)
|
||||
{
|
||||
$this->row['FIELD'] .= "
|
||||
<tr>
|
||||
<td class='forumheader3' style='width:10%; white-space:nowrap; vertical-align:top;'>".$this->parent->titles[$i]."</td>
|
||||
<td class='forumheader3'>
|
||||
".$rs->form_select_open($this->parent->sections[$i]."_".$type."_order");
|
||||
for($a=1; $a<=$max; $a++)
|
||||
{
|
||||
$this->row['FIELD'] .= ($this->parent->list_pref[$this->parent->sections[$i]."_".$type."_order"] == $a ? $rs->form_option($a, 1, $a) : $rs->form_option($a, 0, $a));
|
||||
}
|
||||
$this->row['FIELD'] .= $rs->form_select_close()."
|
||||
</td>
|
||||
</tr>";
|
||||
}
|
||||
$this->row['FIELD'] .= "</table>";
|
||||
$text .= $this->parseTemplate('TOPIC_ROW');
|
||||
|
||||
//caption
|
||||
$this->row['TOPIC'] = LIST_ADMIN_SECT_25;
|
||||
$this->row['HEADING'] = LIST_ADMIN_SECT_26;
|
||||
$this->row['HELP'] = LIST_ADMIN_SECT_27;
|
||||
$this->row['CONTID'] = "list-new-{$type}-expandable-caption";
|
||||
$this->row['FIELD'] = "<table $this->styletable>";
|
||||
for($i=0;$i<count($this->parent->sections);$i++)
|
||||
{
|
||||
$this->row['FIELD'] .= "
|
||||
<tr>
|
||||
<td class='forumheader3' style='width:10%; white-space:nowrap; vertical-align:top;'>".$this->parent->titles[$i]."</td>
|
||||
<td class='forumheader3'>
|
||||
".$rs->form_text($this->parent->sections[$i]."_".$type."_caption", 30, $this->e107->tp->toHTML($this->parent->list_pref[$this->parent->sections[$i]."_".$type."_caption"],"","defs"), "50", "tbox")."
|
||||
</td>
|
||||
</tr>";
|
||||
}
|
||||
$this->row['FIELD'] .= "</table>";
|
||||
$text .= $this->parseTemplate('TOPIC_ROW');
|
||||
|
||||
$text .= $this->parseTemplate('TOPIC_ROW_SPACER');
|
||||
|
||||
return $text;
|
||||
}
|
||||
|
||||
/**
|
||||
* display menu options
|
||||
*
|
||||
* @param string $type the area to display
|
||||
* @return string
|
||||
*
|
||||
*/
|
||||
function parse_menu_options($type)
|
||||
{
|
||||
global $rs;
|
||||
|
||||
$text = "
|
||||
<div id='list-new-".str_replace('_', '-', $type)."' class='e-hideme center'>
|
||||
<table style='".ADMIN_WIDTH."' class='fborder'>";
|
||||
|
||||
$title = ($type == "new_menu" ? LIST_ADMIN_OPT_5 : LIST_ADMIN_OPT_3);
|
||||
$text .= "<tr><td colspan='4' class='forumheader'>".$title."</td></tr>";
|
||||
|
||||
$text .= $this->parse_global_options($type);
|
||||
|
||||
//menu preference : caption
|
||||
$this->row['TOPIC'] = LIST_ADMIN_LAN_2;
|
||||
$this->row['HEADING'] = LIST_ADMIN_LAN_3;
|
||||
$this->row['HELP'] = LIST_ADMIN_LAN_4;
|
||||
$this->row['CONTID'] = "list-new-menu-{$type}-expandable-caption";
|
||||
$this->row['FIELD'] = $rs->form_text($type."_caption", "30", $this->e107->tp->toHTML($this->parent->list_pref[$type."_caption"],"","defs"), "50", "tbox");
|
||||
$text .= $this->parseTemplate('TOPIC_ROW');
|
||||
|
||||
//menu preference : icon : use
|
||||
$this->row['TOPIC'] = LIST_ADMIN_LAN_5;
|
||||
$this->row['HEADING'] = LIST_ADMIN_LAN_6;
|
||||
$this->row['HELP'] = LIST_ADMIN_LAN_7;
|
||||
$this->row['CONTID'] = "list-new-menu-{$type}-expandable-icon-use";
|
||||
$this->row['FIELD'] = "
|
||||
".$rs->form_radio($type."_icon_use", "1", ($this->parent->list_pref[$type."_icon_use"] ? "1" : "0"), "", "").LIST_ADMIN_7."
|
||||
".$rs->form_radio($type."_icon_use", "0", ($this->parent->list_pref[$type."_icon_use"] ? "0" : "1"), "", "").LIST_ADMIN_8."
|
||||
";
|
||||
$text .= $this->parseTemplate('TOPIC_ROW');
|
||||
|
||||
//menu preference : icon : show default theme bullet
|
||||
$this->row['TOPIC'] = LIST_ADMIN_MENU_2;
|
||||
$this->row['HEADING'] = LIST_ADMIN_MENU_3;
|
||||
$this->row['HELP'] = LIST_ADMIN_MENU_4;
|
||||
$this->row['CONTID'] = "list-new-menu-{$type}-expandable-icon-show";
|
||||
$this->row['FIELD'] = "
|
||||
".$rs->form_radio($type."_icon_default", "1", ($this->parent->list_pref[$type."_icon_default"] ? "1" : "0"), "", "").LIST_ADMIN_7."
|
||||
".$rs->form_radio($type."_icon_default", "0", ($this->parent->list_pref[$type."_icon_default"] ? "0" : "1"), "", "").LIST_ADMIN_8."
|
||||
";
|
||||
$text .= $this->parseTemplate('TOPIC_ROW');
|
||||
|
||||
//menu preference : amount chars
|
||||
$this->row['TOPIC'] = LIST_ADMIN_LAN_8;
|
||||
$this->row['HEADING'] = LIST_ADMIN_LAN_9;
|
||||
$this->row['HELP'] = LIST_ADMIN_LAN_10;
|
||||
$this->row['CONTID'] = "list-new-menu-{$type}-expandable-amount-chars";
|
||||
$this->row['FIELD'] = $rs->form_text($type."_char_heading", "3", $this->parent->list_pref[$type."_char_heading"], "3", "tbox");
|
||||
$text .= $this->parseTemplate('TOPIC_ROW');
|
||||
|
||||
//menu preference : postfix
|
||||
$this->row['TOPIC'] = LIST_ADMIN_LAN_11;
|
||||
$this->row['HEADING'] = LIST_ADMIN_LAN_12;
|
||||
$this->row['HELP'] = LIST_ADMIN_LAN_13;
|
||||
$this->row['CONTID'] = "list-new-menu-{$type}-expandable-postfix";
|
||||
$this->row['FIELD'] = $rs->form_text($type."_char_postfix", "3", $this->parent->list_pref[$type."_char_postfix"], "3", "tbox");
|
||||
$text .= $this->parseTemplate('TOPIC_ROW');
|
||||
|
||||
//menu preference : date
|
||||
$this->row['TOPIC'] = LIST_ADMIN_LAN_14;
|
||||
$this->row['HEADING'] = LIST_ADMIN_LAN_15;
|
||||
$this->row['HELP'] = LIST_ADMIN_LAN_16;
|
||||
$this->row['CONTID'] = "list-new-menu-{$type}-expandable-date";
|
||||
$this->row['FIELD'] = $rs->form_text($type."_datestyle", "30", $this->parent->list_pref[$type."_datestyle"], "50", "tbox");
|
||||
$text .= $this->parseTemplate('TOPIC_ROW');
|
||||
|
||||
//menu preference : date today
|
||||
$this->row['TOPIC'] = LIST_ADMIN_LAN_17;
|
||||
$this->row['HEADING'] = LIST_ADMIN_LAN_18;
|
||||
$this->row['HELP'] = LIST_ADMIN_LAN_19;
|
||||
$this->row['CONTID'] = "list-new-menu-{$type}-expandable-datet";
|
||||
$this->row['FIELD'] = $rs->form_text($type."_datestyletoday", "30", $this->parent->list_pref[$type."_datestyletoday"], "50", "tbox");
|
||||
$text .= $this->parseTemplate('TOPIC_ROW');
|
||||
|
||||
//menu preference : show empty
|
||||
$this->row['TOPIC'] = LIST_ADMIN_LAN_26;
|
||||
$this->row['HEADING'] = LIST_ADMIN_LAN_27;
|
||||
$this->row['HELP'] = LIST_ADMIN_LAN_28;
|
||||
$this->row['CONTID'] = "list-new-menu-{$type}-expandable-sempty";
|
||||
$this->row['FIELD'] = "
|
||||
".$rs->form_radio($type."_showempty", "1", ($this->parent->list_pref[$type."_showempty"] ? "1" : "0"), "", "").LIST_ADMIN_7."
|
||||
".$rs->form_radio($type."_showempty", "0", ($this->parent->list_pref[$type."_showempty"] ? "0" : "1"), "", "").LIST_ADMIN_8."
|
||||
";
|
||||
$text .= $this->parseTemplate('TOPIC_ROW');
|
||||
|
||||
//menu preference : open section if content exists? this will override the individual setting of the section
|
||||
$this->row['TOPIC'] = LIST_ADMIN_LAN_39;
|
||||
$this->row['HEADING'] = LIST_ADMIN_LAN_40;
|
||||
$this->row['HELP'] = LIST_ADMIN_LAN_41;
|
||||
$this->row['CONTID'] = "list-new-menu-{$type}-expandable-osie";
|
||||
$this->row['FIELD'] = "
|
||||
".$rs->form_radio($type."_openifrecords", "1", ($this->parent->list_pref[$type."_openifrecords"] ? "1" : "0"), "", "").LIST_ADMIN_7."
|
||||
".$rs->form_radio($type."_openifrecords", "0", ($this->parent->list_pref[$type."_openifrecords"] ? "0" : "1"), "", "").LIST_ADMIN_8."
|
||||
";
|
||||
$text .= $this->parseTemplate('TOPIC_ROW');
|
||||
|
||||
$text .= $this->parseTemplate('TOPIC_ROW_SPACER');
|
||||
$this->row['SUBMIT'] = $this->pref_submit();
|
||||
$text .= $this->parseTemplate('TOPIC_TABLE_END');
|
||||
return $text;
|
||||
}
|
||||
|
||||
/**
|
||||
* display page options
|
||||
*
|
||||
* @param string $type the area to display
|
||||
* @return string
|
||||
*
|
||||
*/
|
||||
function parse_page_options($type)
|
||||
{
|
||||
global $rs;
|
||||
|
||||
$display = ($type == "recent_page" ? "display:none;" : '');
|
||||
|
||||
$text = "
|
||||
<div id='list-new-".str_replace('_', '-', $type)."' class='e-hideme center'>
|
||||
<table style='".ADMIN_WIDTH."' class='fborder'>";
|
||||
|
||||
$title = ($type == "new_page" ? LIST_ADMIN_OPT_4 : LIST_ADMIN_OPT_2);
|
||||
$text .= "<tr><td colspan='4' class='forumheader'>".$title."</td></tr>";
|
||||
|
||||
$text .= $this->parse_global_options($type);
|
||||
|
||||
//page preference : caption
|
||||
$this->row['TOPIC'] = LIST_ADMIN_LAN_2;
|
||||
$this->row['HEADING'] = LIST_ADMIN_LAN_3;
|
||||
$this->row['HELP'] = LIST_ADMIN_LAN_4;
|
||||
$this->row['CONTID'] = "list-new-page-{$type}-expandable-caption";
|
||||
$this->row['FIELD'] = $rs->form_text($type."_caption", "30", $this->e107->tp->toHTML($this->parent->list_pref[$type."_caption"],"","defs"), "50", "tbox");
|
||||
$text .= $this->parseTemplate('TOPIC_ROW');
|
||||
|
||||
//page preference : icon : use
|
||||
$this->row['TOPIC'] = LIST_ADMIN_LAN_5;
|
||||
$this->row['HEADING'] = LIST_ADMIN_LAN_6;
|
||||
$this->row['HELP'] = LIST_ADMIN_LAN_7;
|
||||
$this->row['CONTID'] = "list-new-page-{$type}-expandable-icon-use";
|
||||
$this->row['FIELD'] = "
|
||||
".$rs->form_radio($type."_icon_use", "1", ($this->parent->list_pref[$type."_icon_use"] ? "1" : "0"), "", "").LIST_ADMIN_7."
|
||||
".$rs->form_radio($type."_icon_use", "0", ($this->parent->list_pref[$type."_icon_use"] ? "0" : "1"), "", "").LIST_ADMIN_8."
|
||||
";
|
||||
$text .= $this->parseTemplate('TOPIC_ROW');
|
||||
|
||||
//page preference : icon : show default theme bullet
|
||||
$this->row['TOPIC'] = LIST_ADMIN_LAN_29;
|
||||
$this->row['HEADING'] = LIST_ADMIN_LAN_30;
|
||||
$this->row['HELP'] = LIST_ADMIN_LAN_31;
|
||||
$this->row['CONTID'] = "list-new-page-{$type}-expandable-icon-show";
|
||||
$this->row['FIELD'] = "
|
||||
".$rs->form_radio($type."_icon_default", "1", ($this->parent->list_pref[$type."_icon_default"] ? "1" : "0"), "", "").LIST_ADMIN_7."
|
||||
".$rs->form_radio($type."_icon_default", "0", ($this->parent->list_pref[$type."_icon_default"] ? "0" : "1"), "", "").LIST_ADMIN_8."
|
||||
";
|
||||
$text .= $this->parseTemplate('TOPIC_ROW');
|
||||
|
||||
//page preference : amount chars
|
||||
$this->row['TOPIC'] = LIST_ADMIN_LAN_8;
|
||||
$this->row['HEADING'] = LIST_ADMIN_LAN_9;
|
||||
$this->row['HELP'] = LIST_ADMIN_LAN_10;
|
||||
$this->row['CONTID'] = "list-new-page-{$type}-expandable-amount-chars";
|
||||
$this->row['FIELD'] = $rs->form_text($type."_char_heading", "3", $this->parent->list_pref[$type."_char_heading"], "3", "tbox");
|
||||
$text .= $this->parseTemplate('TOPIC_ROW');
|
||||
|
||||
//page preference : postfix
|
||||
$this->row['TOPIC'] = LIST_ADMIN_LAN_11;
|
||||
$this->row['HEADING'] = LIST_ADMIN_LAN_12;
|
||||
$this->row['HELP'] = LIST_ADMIN_LAN_13;
|
||||
$this->row['CONTID'] = "list-new-page-{$type}-expandable-postfix";
|
||||
$this->row['FIELD'] = $rs->form_text($type."_char_postfix", "3", $this->parent->list_pref[$type."_char_postfix"], "3", "tbox");
|
||||
$text .= $this->parseTemplate('TOPIC_ROW');
|
||||
|
||||
//page preference : date
|
||||
$this->row['TOPIC'] = LIST_ADMIN_LAN_14;
|
||||
$this->row['HEADING'] = LIST_ADMIN_LAN_15;
|
||||
$this->row['HELP'] = LIST_ADMIN_LAN_16;
|
||||
$this->row['CONTID'] = "list-new-page-{$type}-expandable-date";
|
||||
$this->row['FIELD'] = $rs->form_text($type."_datestyle", "30", $this->parent->list_pref[$type."_datestyle"], "50", "tbox");
|
||||
$text .= $this->parseTemplate('TOPIC_ROW');
|
||||
|
||||
//page preference : date today
|
||||
$this->row['TOPIC'] = LIST_ADMIN_LAN_17;
|
||||
$this->row['HEADING'] = LIST_ADMIN_LAN_18;
|
||||
$this->row['HELP'] = LIST_ADMIN_LAN_19;
|
||||
$this->row['CONTID'] = "list-new-page-{$type}-expandable-datet";
|
||||
$this->row['FIELD'] = $rs->form_text($type."_datestyletoday", "30", $this->parent->list_pref[$type."_datestyletoday"], "50", "tbox");
|
||||
$text .= $this->parseTemplate('TOPIC_ROW');
|
||||
|
||||
//page preference : show empty
|
||||
$this->row['TOPIC'] = LIST_ADMIN_LAN_26;
|
||||
$this->row['HEADING'] = LIST_ADMIN_LAN_27;
|
||||
$this->row['HELP'] = LIST_ADMIN_LAN_28;
|
||||
$this->row['CONTID'] = "list-new-page-{$type}-expandable-showe";
|
||||
$this->row['FIELD'] = "
|
||||
".$rs->form_radio($type."_showempty", "1", ($this->parent->list_pref[$type."_showempty"] ? "1" : "0"), "", "").LIST_ADMIN_7."
|
||||
".$rs->form_radio($type."_showempty", "0", ($this->parent->list_pref[$type."_showempty"] ? "0" : "1"), "", "").LIST_ADMIN_8."
|
||||
";
|
||||
$text .= $this->parseTemplate('TOPIC_ROW');
|
||||
|
||||
//page preference : colomn
|
||||
$this->row['TOPIC'] = LIST_ADMIN_LAN_20;
|
||||
$this->row['HEADING'] = LIST_ADMIN_LAN_21;
|
||||
$this->row['HELP'] = LIST_ADMIN_LAN_22;
|
||||
$this->row['CONTID'] = "list-new-page-{$type}-expandable-colomn";
|
||||
$this->row['FIELD'] = $rs->form_select_open($type."_colomn");
|
||||
for($a=1; $a<=count($this->parent->sections); $a++)
|
||||
{
|
||||
$this->row['FIELD'] .= ($this->parent->list_pref[$type."_colomn"] == $a ? $rs->form_option($a, 1, $a) : $rs->form_option($a, 0, $a));
|
||||
}
|
||||
$this->row['FIELD'] .= $rs->form_select_close();
|
||||
$text .= $this->parseTemplate('TOPIC_ROW');
|
||||
|
||||
//page preference : welcome text
|
||||
$this->row['TOPIC'] = LIST_ADMIN_LAN_23;
|
||||
$this->row['HEADING'] = LIST_ADMIN_LAN_24;
|
||||
$this->row['HELP'] = LIST_ADMIN_LAN_25;
|
||||
$this->row['CONTID'] = "list-new-page-{$type}-expandable-wtext";
|
||||
$this->row['FIELD'] = $rs->form_textarea($type."_welcometext", "50", "5", $this->e107->tp->toHTML($this->parent->list_pref[$type."_welcometext"],"","defs"), "", "tbox");
|
||||
$text .= $this->parseTemplate('TOPIC_ROW');
|
||||
|
||||
if($type == "new_page")
|
||||
{
|
||||
//timelapse:show
|
||||
$this->row['TOPIC'] = LIST_ADMIN_LAN_36;
|
||||
$this->row['HEADING'] = LIST_ADMIN_LAN_37;
|
||||
$this->row['HELP'] = LIST_ADMIN_LAN_38;
|
||||
$this->row['CONTID'] = "list-new-page-{$type}-expandable-timelapse-show";
|
||||
$this->row['FIELD'] = "
|
||||
".$rs->form_radio($type."_timelapse", "1", ($this->parent->list_pref[$type."_timelapse"] ? "1" : "0"), "", "").LIST_ADMIN_7."
|
||||
".$rs->form_radio($type."_timelapse", "0", ($this->parent->list_pref[$type."_timelapse"] ? "0" : "1"), "", "").LIST_ADMIN_8."
|
||||
";
|
||||
$text .= $this->parseTemplate('TOPIC_ROW');
|
||||
|
||||
//timelapse day number maximum
|
||||
$this->row['TOPIC'] = LIST_ADMIN_LAN_32;
|
||||
$this->row['HEADING'] = LIST_ADMIN_LAN_33;
|
||||
$this->row['HELP'] = LIST_ADMIN_LAN_34;
|
||||
$this->row['CONTID'] = "list-new-page-{$type}-expandable-timelapse-dnm";
|
||||
$this->row['FIELD'] = $rs->form_text($type."_timelapse_days", "3", $this->parent->list_pref[$type."_timelapse_days"], "3", "tbox")." ".LIST_ADMIN_LAN_35;
|
||||
$text .= $this->parseTemplate('TOPIC_ROW');
|
||||
}
|
||||
|
||||
//page preference : open section if content exists? this will override the individual setting of the section
|
||||
$this->row['TOPIC'] = LIST_ADMIN_LAN_39;
|
||||
$this->row['HEADING'] = LIST_ADMIN_LAN_40;
|
||||
$this->row['HELP'] = LIST_ADMIN_LAN_41;
|
||||
$this->row['CONTID'] = "list-new-page-{$type}-expandable-osie";
|
||||
$this->row['FIELD'] = "
|
||||
".$rs->form_radio($type."_openifrecords", "1", ($this->parent->list_pref[$type."_openifrecords"] ? "1" : "0"), "", "").LIST_ADMIN_7."
|
||||
".$rs->form_radio($type."_openifrecords", "0", ($this->parent->list_pref[$type."_openifrecords"] ? "0" : "1"), "", "").LIST_ADMIN_8."
|
||||
";
|
||||
$text .= $this->parseTemplate('TOPIC_ROW');
|
||||
|
||||
$text .= $this->parseTemplate('TOPIC_ROW_SPACER');
|
||||
$this->row['SUBMIT'] = $this->pref_submit();
|
||||
$text .= $this->parseTemplate('TOPIC_TABLE_END');
|
||||
|
||||
return $text;
|
||||
}
|
||||
|
||||
/**
|
||||
* parseTemplate for admin page
|
||||
*
|
||||
* @param string $template the template to parse
|
||||
* @return string
|
||||
*
|
||||
*/
|
||||
function parseTemplate($template)
|
||||
{
|
||||
return preg_replace("/\{(.*?)\}/e", '$this->row[\'\1\']', $this->parent->template[$template]);
|
||||
}
|
||||
|
||||
/**
|
||||
* display submit button
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
*/
|
||||
function pref_submit()
|
||||
{
|
||||
global $rs;
|
||||
|
||||
$this->row['TOPIC'] = LIST_ADMIN_11;
|
||||
$this->row['FIELD'] = $rs->form_button("submit", 'update_menu', LIST_ADMIN_2);
|
||||
return $this->parseTemplate('TOPIC_ROW_NOEXPAND');
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
File diff suppressed because it is too large
Load Diff
@@ -1,20 +1,18 @@
|
||||
<?php
|
||||
/*
|
||||
+---------------------------------------------------------------+
|
||||
| e107 website system
|
||||
|
|
||||
| <20>Steve Dunstan 2001-2002
|
||||
| http://e107.org
|
||||
| jalist@e107.org
|
||||
|
|
||||
| Released under the terms and conditions of the
|
||||
| GNU General Public License (http://gnu.org).
|
||||
|
|
||||
| $Source: /cvs_backup/e107_0.8/e107_plugins/list_new/list_new_menu.php,v $
|
||||
| $Revision: 1.3 $
|
||||
| $Date: 2009-01-06 21:30:28 $
|
||||
| $Author: e107steved $
|
||||
+---------------------------------------------------------------+
|
||||
* e107 website system
|
||||
*
|
||||
* Copyright (C) 2001-2008 e107 Inc (e107.org)
|
||||
* Released under the terms and conditions of the
|
||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||
*
|
||||
* List Menu New
|
||||
*
|
||||
* $Source: /cvs_backup/e107_0.8/e107_plugins/list_new/list_new_menu.php,v $
|
||||
* $Revision: 1.4 $
|
||||
* $Date: 2009-01-27 21:33:52 $
|
||||
* $Author: lisa_ $
|
||||
*
|
||||
*/
|
||||
|
||||
if (!defined('e107_INIT')) { exit; }
|
||||
@@ -24,44 +22,23 @@ if (!plugInstalled('list_new'))
|
||||
return;
|
||||
}
|
||||
|
||||
global $sysprefs, $tp, $eArrayStorage, $list_pref, $rc;
|
||||
$listplugindir = e_PLUGIN . "list_new/";
|
||||
unset($text);
|
||||
require_once($listplugindir."list_shortcodes.php");
|
||||
|
||||
// get language file
|
||||
include_lan($listplugindir . "languages/" . e_LANGUAGE . ".php");
|
||||
|
||||
global $rc;
|
||||
if (!is_object($rc))
|
||||
{
|
||||
require_once($listplugindir . "list_class.php");
|
||||
require_once(e_PLUGIN."list_new/list_class.php");
|
||||
$rc = new listclass;
|
||||
}
|
||||
|
||||
if(!isset($list_pref))
|
||||
{
|
||||
$list_pref = $rc->getListPrefs();
|
||||
}
|
||||
//set mode
|
||||
$rc->mode = "new_menu";
|
||||
|
||||
$mode = "new_menu";
|
||||
$sections = $rc->prepareSection($mode);
|
||||
$arr = $rc->prepareSectionArray($mode, $sections);
|
||||
// display the sections
|
||||
$text = "";
|
||||
for($i = 0;$i < count($arr);$i++)
|
||||
{
|
||||
if ($arr[$i][1] == "1")
|
||||
{
|
||||
$sectiontext = $rc->show_section_list($arr[$i], $mode);
|
||||
if ($sectiontext != "")
|
||||
{
|
||||
$text .= $sectiontext;
|
||||
}
|
||||
}
|
||||
}
|
||||
//parse menu
|
||||
$text = $rc->displayMenu();
|
||||
|
||||
$caption = (isset($list_pref[$mode."_caption"]) && $list_pref[$mode."_caption"] ? $list_pref[$mode."_caption"] : LIST_MENU_1);
|
||||
$ns->tablerender($caption, $text, 'list_new');
|
||||
$caption = varsettrue($rc->list_pref[$rc->mode."_caption"], LIST_MENU_1);
|
||||
$rc->e107->ns->tablerender($caption, $text, 'list_new');
|
||||
unset($text);
|
||||
|
||||
?>
|
@@ -1,20 +1,18 @@
|
||||
<?php
|
||||
/*
|
||||
+---------------------------------------------------------------+
|
||||
| e107 website system
|
||||
|
|
||||
| <20>Steve Dunstan 2001-2002
|
||||
| http://e107.org
|
||||
| jalist@e107.org
|
||||
|
|
||||
| Released under the terms and conditions of the
|
||||
| GNU General Public License (http://gnu.org).
|
||||
|
|
||||
| $Source: /cvs_backup/e107_0.8/e107_plugins/list_new/list_recent_menu.php,v $
|
||||
| $Revision: 1.4 $
|
||||
| $Date: 2009-01-06 21:30:28 $
|
||||
| $Author: e107steved $
|
||||
+---------------------------------------------------------------+
|
||||
* e107 website system
|
||||
*
|
||||
* Copyright (C) 2001-2008 e107 Inc (e107.org)
|
||||
* Released under the terms and conditions of the
|
||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||
*
|
||||
* List Menu Recent
|
||||
*
|
||||
* $Source: /cvs_backup/e107_0.8/e107_plugins/list_new/list_recent_menu.php,v $
|
||||
* $Revision: 1.5 $
|
||||
* $Date: 2009-01-27 21:33:52 $
|
||||
* $Author: lisa_ $
|
||||
*
|
||||
*/
|
||||
|
||||
if (!defined('e107_INIT')) { exit; }
|
||||
@@ -24,47 +22,23 @@ if (!plugInstalled('list_new'))
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
global $sysprefs, $tp, $eArrayStorage, $list_pref, $rc;
|
||||
$listplugindir = e_PLUGIN."list_new/";
|
||||
unset($text);
|
||||
require_once($listplugindir."list_shortcodes.php");
|
||||
|
||||
//get language file
|
||||
include_lan($listplugindir."languages/".e_LANGUAGE.".php");
|
||||
|
||||
|
||||
global $rc;
|
||||
if (!is_object($rc))
|
||||
{
|
||||
require_once($listplugindir . "list_class.php");
|
||||
require_once(e_PLUGIN."list_new/list_class.php");
|
||||
$rc = new listclass;
|
||||
}
|
||||
|
||||
if(!isset($list_pref))
|
||||
{
|
||||
$list_pref = $rc->getListPrefs();
|
||||
}
|
||||
//set mode
|
||||
$rc->mode = "recent_menu";
|
||||
|
||||
$mode = "recent_menu";
|
||||
$sections = $rc -> prepareSection($mode);
|
||||
$arr = $rc -> prepareSectionArray($mode, $sections);
|
||||
//parse menu
|
||||
$text = $rc->displayMenu();
|
||||
|
||||
//display the sections
|
||||
$text = "";
|
||||
for($i=0;$i<count($arr);$i++)
|
||||
{
|
||||
if($arr[$i][1] == "1")
|
||||
{
|
||||
$sectiontext = $rc -> show_section_list($arr[$i], $mode);
|
||||
if($sectiontext != "")
|
||||
{
|
||||
$text .= $sectiontext;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$caption = (isset($list_pref[$mode."_caption"]) && $list_pref[$mode."_caption"] ? $list_pref[$mode."_caption"] : LIST_MENU_1);
|
||||
$ns -> tablerender($caption, $text, 'list_recent');
|
||||
$caption = varsettrue($rc->list_pref[$rc->mode."_caption"], LIST_MENU_1);
|
||||
$rc->e107->ns->tablerender($caption, $text, 'list_recent');
|
||||
unset($text);
|
||||
|
||||
?>
|
@@ -1,38 +1,105 @@
|
||||
<?php
|
||||
if (!defined('e107_INIT')) { exit; }
|
||||
include_once(e_HANDLER.'shortcode_handler.php');
|
||||
$list_shortcodes = $tp -> e_sc -> parse_scbatch(__FILE__);
|
||||
/*
|
||||
SC_BEGIN LIST_DATE
|
||||
global $LIST_DATE;
|
||||
return $LIST_DATE;
|
||||
SC_END
|
||||
|
||||
SC_BEGIN LIST_ICON
|
||||
global $LIST_ICON;
|
||||
return $LIST_ICON;
|
||||
SC_END
|
||||
|
||||
SC_BEGIN LIST_HEADING
|
||||
global $LIST_HEADING;
|
||||
return $LIST_HEADING;
|
||||
SC_END
|
||||
|
||||
SC_BEGIN LIST_AUTHOR
|
||||
global $LIST_AUTHOR;
|
||||
return $LIST_AUTHOR;
|
||||
SC_END
|
||||
|
||||
SC_BEGIN LIST_CATEGORY
|
||||
global $LIST_CATEGORY;
|
||||
return $LIST_CATEGORY;
|
||||
SC_END
|
||||
|
||||
SC_BEGIN LIST_INFO
|
||||
global $LIST_INFO;
|
||||
return $LIST_INFO;
|
||||
SC_END
|
||||
|
||||
|
||||
* e107 website system
|
||||
*
|
||||
* Copyright (C) 2001-2008 e107 Inc (e107.org)
|
||||
* Released under the terms and conditions of the
|
||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||
*
|
||||
* List Shortcodes
|
||||
*
|
||||
* $Source: /cvs_backup/e107_0.8/e107_plugins/list_new/list_shortcodes.php,v $
|
||||
* $Revision: 1.2 $
|
||||
* $Date: 2009-01-27 21:33:52 $
|
||||
* $Author: lisa_ $
|
||||
*
|
||||
*/
|
||||
|
||||
if (!defined('e107_INIT')) { exit; }
|
||||
|
||||
register_shortcode('list_shortcodes', true);
|
||||
initShortcodeClass('list_shortcodes');
|
||||
|
||||
class list_shortcodes
|
||||
{
|
||||
var $rc;
|
||||
var $e107;
|
||||
var $row;
|
||||
var $list_pref;
|
||||
|
||||
function list_shortcodes()
|
||||
{
|
||||
$this->e107 = e107::getInstance();
|
||||
}
|
||||
|
||||
function load_globals()
|
||||
{
|
||||
global $rc;
|
||||
$e107 = e107::getInstance();
|
||||
$e107->tp->e_sc->scClasses['list_shortcodes']->rc = $rc;
|
||||
$e107->tp->e_sc->scClasses['list_shortcodes']->row = $rc->row;
|
||||
$e107->tp->e_sc->scClasses['list_shortcodes']->list_pref = $rc->list_pref;
|
||||
}
|
||||
|
||||
function get_list_date()
|
||||
{
|
||||
return $this->row['date'];
|
||||
}
|
||||
|
||||
function get_list_icon()
|
||||
{
|
||||
return $this->row['icon'];
|
||||
}
|
||||
|
||||
function get_list_heading()
|
||||
{
|
||||
return $this->row['heading'];
|
||||
}
|
||||
|
||||
function get_list_author()
|
||||
{
|
||||
return $this->row['author'];
|
||||
}
|
||||
|
||||
function get_list_category()
|
||||
{
|
||||
return $this->row['category'];
|
||||
}
|
||||
|
||||
function get_list_info()
|
||||
{
|
||||
return $this->row['info'];
|
||||
}
|
||||
|
||||
function get_list_caption()
|
||||
{
|
||||
return $this->rc->data['caption'];
|
||||
}
|
||||
|
||||
function get_list_displaystyle()
|
||||
{
|
||||
//open sections if content exists ? yes if true, else use individual setting of section
|
||||
return (varsettrue($this->list_pref[$this->rc->mode."_openifrecords"]) && is_array($this->rc->data['records']) ? "" : $this->rc->data['display']);
|
||||
}
|
||||
|
||||
function get_list_col_cols()
|
||||
{
|
||||
return $this->list_pref[$this->rc->mode."_colomn"];
|
||||
}
|
||||
|
||||
function get_list_col_welcometext()
|
||||
{
|
||||
return $this->e107->tp->toHTML($this->list_pref[$this->rc->mode."_welcometext"]);
|
||||
}
|
||||
|
||||
function get_list_col_cellwidth()
|
||||
{
|
||||
return round((100/$this->list_pref[$this->rc->mode."_colomn"]),0);
|
||||
}
|
||||
|
||||
function get_list_timelapse()
|
||||
{
|
||||
return $this->row['timelapse'];
|
||||
}
|
||||
}
|
||||
?>
|
@@ -1,8 +1,23 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* e107 website system
|
||||
*
|
||||
* Copyright (C) 2001-2008 e107 Inc (e107.org)
|
||||
* Released under the terms and conditions of the
|
||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||
*
|
||||
* List Template
|
||||
*
|
||||
* $Source: /cvs_backup/e107_0.8/e107_plugins/list_new/list_template.php,v $
|
||||
* $Revision: 1.2 $
|
||||
* $Date: 2009-01-27 21:33:52 $
|
||||
* $Author: lisa_ $
|
||||
*
|
||||
*/
|
||||
if (!defined('e107_INIT')) { exit; }
|
||||
|
||||
global $sc_style, $list_shortcodes;
|
||||
|
||||
$sc_style['LIST_DATE']['pre'] = "";
|
||||
$sc_style['LIST_DATE']['post'] = " ";
|
||||
|
||||
@@ -21,66 +36,100 @@ $sc_style['LIST_CATEGORY']['post'] = " ";
|
||||
$sc_style['LIST_INFO']['pre'] = "";
|
||||
$sc_style['LIST_INFO']['post'] = " ";
|
||||
|
||||
|
||||
//LIST_MENU_NEW TEMPLATE -------------------------------------------------------------------------
|
||||
$LIST_MENU_NEW_START = "
|
||||
$TEMPLATE_LIST_NEW['MENU_NEW_START'] = "
|
||||
<div class='fcaption' style='cursor:pointer;' onclick='expandit(this);'>{LIST_CAPTION}</div>
|
||||
<div class='forumheader' style='margin-bottom:5px; display:{LIST_DISPLAYSTYLE};'>\n";
|
||||
$LIST_MENU_NEW = "
|
||||
<div class='forumheader3' style='margin-bottom:5px; display:{LIST_DISPLAYSTYLE};'>\n";
|
||||
$TEMPLATE_LIST_NEW['MENU_NEW'] = "
|
||||
<div>
|
||||
{LIST_ICON} {LIST_DATE} {LIST_HEADING} {LIST_AUTHOR} {LIST_CATEGORY}
|
||||
</div>";
|
||||
$LIST_MENU_NEW_END = "
|
||||
$TEMPLATE_LIST_NEW['MENU_NEW_END'] = "
|
||||
</div>\n";
|
||||
|
||||
//LIST_MENU_RECENT TEMPLATE -------------------------------------------------------------------------
|
||||
$LIST_MENU_RECENT_START = "
|
||||
$TEMPLATE_LIST_NEW['MENU_RECENT_START'] = "
|
||||
<div class='fcaption' style='cursor:pointer;' onclick='expandit(this);'>{LIST_CAPTION}</div>
|
||||
<div class='forumheader' style='margin-bottom:5px; display:{LIST_DISPLAYSTYLE};'>\n";
|
||||
$LIST_MENU_RECENT = "
|
||||
<div class='forumheader3' style='margin-bottom:5px; display:{LIST_DISPLAYSTYLE};'>\n";
|
||||
$TEMPLATE_LIST_NEW['MENU_RECENT'] = "
|
||||
<div>
|
||||
{LIST_ICON} {LIST_DATE} {LIST_HEADING} {LIST_AUTHOR} {LIST_CATEGORY}
|
||||
</div>";
|
||||
$LIST_MENU_RECENT_END = "
|
||||
$TEMPLATE_LIST_NEW['MENU_RECENT_END'] = "
|
||||
</div>\n";
|
||||
|
||||
|
||||
//PAGE TEMPLATE -------------------------------------------------------------------------
|
||||
$LIST_PAGE_RECENT_START = "
|
||||
$TEMPLATE_LIST_NEW['PAGE_RECENT_START'] = "
|
||||
<div class='fcaption' style='cursor:pointer;' onclick='expandit(this);'>{LIST_CAPTION}</div>
|
||||
<div class='forumheader' style='margin-bottom:10px; display:{LIST_DISPLAYSTYLE};'>\n";
|
||||
$LIST_PAGE_RECENT = "
|
||||
<div class='forumheader3' style='margin-bottom:10px; display:{LIST_DISPLAYSTYLE};'>\n";
|
||||
$TEMPLATE_LIST_NEW['PAGE_RECENT'] = "
|
||||
<div>
|
||||
{LIST_ICON} {LIST_DATE} {LIST_HEADING} {LIST_AUTHOR} {LIST_CATEGORY} {LIST_INFO}
|
||||
</div>";
|
||||
$LIST_PAGE_RECENT_END = "
|
||||
$TEMPLATE_LIST_NEW['PAGE_RECENT_END'] = "
|
||||
</div>\n";
|
||||
|
||||
|
||||
//NEW TEMPLATE -------------------------------------------------------------------------
|
||||
$LIST_PAGE_NEW_START = "
|
||||
$TEMPLATE_LIST_NEW['PAGE_NEW_START'] = "
|
||||
<div class='fcaption' style='cursor:pointer;' onclick='expandit(this);'>{LIST_CAPTION}</div>
|
||||
<div class='forumheader' style='margin-bottom:10px; display:{LIST_DISPLAYSTYLE};'>\n";
|
||||
$LIST_PAGE_NEW = "
|
||||
<div class='forumheader3' style='margin-bottom:10px; display:{LIST_DISPLAYSTYLE};'>\n";
|
||||
$TEMPLATE_LIST_NEW['PAGE_NEW'] = "
|
||||
<div>
|
||||
{LIST_ICON} {LIST_DATE} {LIST_HEADING} {LIST_AUTHOR} {LIST_CATEGORY} {LIST_INFO}
|
||||
</div>";
|
||||
$LIST_PAGE_NEW_END = "
|
||||
$TEMPLATE_LIST_NEW['PAGE_NEW_END'] = "
|
||||
</div>\n";
|
||||
|
||||
|
||||
//MULTI COLOMNS LAYOUT MASTER -----------------------------------------------------------
|
||||
$LIST_COL_START = "
|
||||
$TEMPLATE_LIST_NEW['COL_START'] = "
|
||||
<div style='text-align:center;'>
|
||||
<table class='fborder' style='width:100%;' cellspacing='0' cellpadding='0'>
|
||||
<tr>";
|
||||
$LIST_COL_WELCOME = "<td colspan='{LIST_COL_COLS}' class='forumheader'>{LIST_COL_WELCOMETEXT}<br /><br /></td>";
|
||||
$LIST_COL_ROWSWITCH = "</tr><tr>";
|
||||
$LIST_COL_CELL_START = "<td style='width:{LIST_COL_CELLWIDTH}%; padding-right:5px; vertical-align:top;'>";
|
||||
$LIST_COL_CELL_END = "</td>";
|
||||
$LIST_COL_END = "</tr></table></div>";
|
||||
$TEMPLATE_LIST_NEW['COL_WELCOME'] = "<td colspan='{LIST_COL_COLS}' class='forumheader3'>{LIST_COL_WELCOMETEXT}<br /><br /></td>";
|
||||
$TEMPLATE_LIST_NEW['COL_ROWSWITCH'] = "</tr><tr>";
|
||||
$TEMPLATE_LIST_NEW['COL_CELL_START'] = "<td style='width:{LIST_COL_CELLWIDTH}%; padding-right:5px; vertical-align:top;'>";
|
||||
$TEMPLATE_LIST_NEW['COL_CELL_END'] = "</td>";
|
||||
$TEMPLATE_LIST_NEW['COL_END'] = "</tr></table></div>";
|
||||
|
||||
//TIMELAPSE SELECT -----------------------------------------------------------
|
||||
$LIST_TIMELAPSE_TABLE = "<div class='forumheader3' style='margin-bottom:20px;'>{LIST_TIMELAPSE}</div>";
|
||||
$TEMPLATE_LIST_NEW['TIMELAPSE_TABLE'] = "<div class='forumheader3' style='margin-bottom:20px;'>{LIST_TIMELAPSE}</div>";
|
||||
|
||||
|
||||
//##### ADMIN
|
||||
|
||||
//define some variables
|
||||
//$stylespacer = "style='border:0; height:20px;'";
|
||||
|
||||
//template for non expanding row
|
||||
$TEMPLATE_LIST_NEW['TOPIC_ROW_NOEXPAND'] = "
|
||||
<tr>
|
||||
<td class='forumheader3' style='width:20%; white-space:nowrap; vertical-align:top;'>{TOPIC}</td>
|
||||
<td class='forumheader3'>{FIELD}</td>
|
||||
</tr>";
|
||||
|
||||
//template for expanding row
|
||||
$TEMPLATE_LIST_NEW['TOPIC_ROW'] = "
|
||||
<tr>
|
||||
<td class='forumheader3' style='width:20%; white-space:nowrap; vertical-align:top;'>{TOPIC}</td>
|
||||
<td class='forumheader3'>
|
||||
<a href='#{CONTID}' class='e-pointer e-expandit'>{HEADING}</a>
|
||||
<div class='e-hideme' id='{CONTID}'>
|
||||
<div class='smalltext'>{HELP}</div><br />
|
||||
{FIELD}
|
||||
</div>
|
||||
</td>
|
||||
</tr>";
|
||||
|
||||
//template for spacer row
|
||||
$TEMPLATE_LIST_NEW['TOPIC_ROW_SPACER'] = "<tr><td style='border:0; height:20px;' colspan='2'></td></tr>";
|
||||
|
||||
$TEMPLATE_LIST_NEW['TOPIC_TABLE_START'] = "
|
||||
<div style='text-align:center;'>
|
||||
<form method='post' action='".e_SELF."' name='menu_conf_form' id='menu_conf_form' enctype='multipart/form-data'>
|
||||
<table style='".ADMIN_WIDTH."' class='fborder'>";
|
||||
|
||||
$TEMPLATE_LIST_NEW['TOPIC_TABLE_END'] = "{SUBMIT}</table></div>";
|
||||
|
||||
?>
|
@@ -1,9 +1,9 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
|
||||
<!-- $Id: plugin.xml,v 1.2 2008-12-13 10:30:24 e107steved Exp $ -->
|
||||
<!-- $Id: plugin.xml,v 1.3 2009-01-27 21:33:52 lisa_ Exp $ -->
|
||||
|
||||
<e107Plugin name="LIST_PLUGIN_1" version="1.0" compatibility="0.8" installRequired="true">
|
||||
<author name="Eric Vanderfeesten (lisa)" url="http://eindhovenseschool.net" email="lisa@eindhovenseschool.net" />
|
||||
<author name="e107dev" url="http://e107.org"/>
|
||||
<description>LIST_PLUGIN_2</description>
|
||||
<folder>list_new</folder>
|
||||
<logLanguageFile filename="languages/--LAN--_admin_list_new.php" />
|
||||
|
@@ -1,43 +1,99 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* e107 website system
|
||||
*
|
||||
* Copyright (C) 2001-2008 e107 Inc (e107.org)
|
||||
* Released under the terms and conditions of the
|
||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||
*
|
||||
* Comment e_list Handler
|
||||
*
|
||||
* $Source: /cvs_backup/e107_0.8/e107_plugins/list_new/section/list_comment.php,v $
|
||||
* $Revision: 1.2 $
|
||||
* $Date: 2009-01-27 21:34:02 $
|
||||
* $Author: lisa_ $
|
||||
*
|
||||
*/
|
||||
if (!defined('e107_INIT')) { exit; }
|
||||
require_once(e_HANDLER."comment_class.php");
|
||||
$cobj = new comment;
|
||||
|
||||
$LIST_CAPTION = $arr[0];
|
||||
$LIST_DISPLAYSTYLE = ($arr[2] ? "" : "none");
|
||||
|
||||
$bullet = $this -> getBullet($arr[6], $mode);
|
||||
|
||||
$qry = '';
|
||||
if($mode == "new_page" || $mode == "new_menu" ){
|
||||
$lvisit = $this -> getlvisit();
|
||||
$qry = "comment_datestamp>".$lvisit;
|
||||
global $tp, $cobj;
|
||||
if(!is_object($cobj))
|
||||
{
|
||||
require_once(e_HANDLER."comment_class.php");
|
||||
$cobj = new comment;
|
||||
}
|
||||
|
||||
$data = $cobj->getCommentData(intval($arr[7]), '0', $qry);
|
||||
class list_comment
|
||||
{
|
||||
function list_comment($parent)
|
||||
{
|
||||
$this->parent = $parent;
|
||||
}
|
||||
|
||||
foreach($data as $row){
|
||||
$rowheading = $this -> parse_heading($row['comment_title'], $mode);
|
||||
if($row['comment_url']){
|
||||
$HEADING = "<a href='".$row['comment_url']."' title='".$row['comment_title']."'>".$tp -> toHTML($rowheading, TRUE)."</a>";
|
||||
}else{
|
||||
$HEADING = $tp -> toHTML($rowheading, TRUE);
|
||||
}
|
||||
$CATEGORY = '';
|
||||
if($arr[4]){
|
||||
if($row['comment_category_url']){
|
||||
$CATEGORY = "<a href='".$row['comment_category_url']."'>".$row['comment_category_heading']."</a>";
|
||||
}else{
|
||||
$CATEGORY = $row['comment_category_heading'];
|
||||
function getListData()
|
||||
{
|
||||
global $tp, $cobj;
|
||||
|
||||
$list_caption = $this->parent->settings['caption'];
|
||||
$list_display = ($this->parent->settings['open'] ? "" : "none");
|
||||
|
||||
$bullet = $this->parent->getBullet($this->parent->settings['icon']);
|
||||
|
||||
$qry = '';
|
||||
if($this->parent->mode == "new_page" || $this->parent->mode == "new_menu" )
|
||||
{
|
||||
$qry = "comment_datestamp>".$this->parent->getlvisit();
|
||||
}
|
||||
|
||||
$data = $cobj->getCommentData(intval($this->parent->settings['amount']), '0', $qry);
|
||||
|
||||
if(empty($data))
|
||||
{
|
||||
$list_data = LIST_COMMENT_2;
|
||||
}
|
||||
else
|
||||
{
|
||||
$list_data = array();
|
||||
foreach($data as $row)
|
||||
{
|
||||
$record = array();
|
||||
$rowheading = $this->parent->parse_heading($row['comment_title']);
|
||||
$record['icon'] = $bullet;
|
||||
if($row['comment_url'])
|
||||
{
|
||||
$record['heading'] = "<a href='".$row['comment_url']."' title='".$row['comment_title']."'>".$this->parent->e107->tp->toHTML($rowheading, TRUE)."</a>";
|
||||
}
|
||||
else
|
||||
{
|
||||
$record['heading'] = $this->parent->e107->tp->toHTML($rowheading, TRUE);
|
||||
}
|
||||
$category = '';
|
||||
if(varsettrue($this->parent->settings['category']))
|
||||
{
|
||||
if($row['comment_category_url'])
|
||||
{
|
||||
$record['category'] = "<a href='".$row['comment_category_url']."'>".$row['comment_category_heading']."</a>";
|
||||
}
|
||||
else
|
||||
{
|
||||
$record['category'] = $row['comment_category_heading'];
|
||||
}
|
||||
}
|
||||
$record['author'] = (varsettrue($this->parent->settings['author']) ? $row['comment_author'] : '');
|
||||
$record['date'] = (varsettrue($this->parent->settings['date']) ? $this->parent->getListDate($row['comment_datestamp']) : "");
|
||||
$record['icon'] = $bullet;
|
||||
$record['info'] = '';
|
||||
|
||||
$list_data[] = $record;
|
||||
}
|
||||
}
|
||||
//return array with 'records', (global)'caption', 'display'
|
||||
return array(
|
||||
'records'=>$list_data,
|
||||
'caption'=>$list_caption,
|
||||
'display'=>$list_display
|
||||
);
|
||||
}
|
||||
$AUTHOR = ($arr[3] ? $row['comment_author'] : '');
|
||||
$DATE = ($arr[5] ? $this -> getListDate($row['comment_datestamp'], $mode) : "");
|
||||
$ICON = $bullet;
|
||||
$INFO = '';
|
||||
|
||||
$LIST_DATA[$mode][] = array( $ICON, $HEADING, $AUTHOR, $CATEGORY, $DATE, $INFO );
|
||||
}
|
||||
|
||||
?>
|
@@ -1,45 +1,80 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* e107 website system
|
||||
*
|
||||
* Copyright (C) 2001-2008 e107 Inc (e107.org)
|
||||
* Released under the terms and conditions of the
|
||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||
*
|
||||
* Download e_list Handler
|
||||
*
|
||||
* $Source: /cvs_backup/e107_0.8/e107_plugins/list_new/section/list_download.php,v $
|
||||
* $Revision: 1.3 $
|
||||
* $Date: 2009-01-27 21:34:02 $
|
||||
* $Author: lisa_ $
|
||||
*
|
||||
*/
|
||||
if (!defined('e107_INIT')) { exit; }
|
||||
|
||||
$LIST_CAPTION = $arr[0];
|
||||
$LIST_DISPLAYSTYLE = ($arr[2] ? "" : "none");
|
||||
|
||||
if($mode == "new_page" || $mode == "new_menu" ){
|
||||
$lvisit = $this -> getlvisit();
|
||||
$qry = " AND download_datestamp>".$lvisit;
|
||||
}else{
|
||||
$qry = " ";
|
||||
}
|
||||
|
||||
$bullet = $this -> getBullet($arr[6], $mode);
|
||||
|
||||
$qry = "SELECT d.download_id, d.download_name, d.download_author, d.download_datestamp,
|
||||
dc.download_category_id, dc.download_category_name, dc.download_category_class
|
||||
FROM #download AS d
|
||||
LEFT JOIN #download_category AS dc ON d.download_category=dc.download_category_id
|
||||
WHERE dc.download_category_class REGEXP '".e_CLASS_REGEXP."' AND d.download_class REGEXP '".e_CLASS_REGEXP."' AND d.download_active != '0' ".$qry."
|
||||
ORDER BY download_datestamp DESC LIMIT 0,".intval($arr[7])." ";
|
||||
|
||||
$downloads = $sql -> db_Select_gen($qry);
|
||||
if($downloads == 0)
|
||||
class list_download
|
||||
{
|
||||
function list_download($parent)
|
||||
{
|
||||
$LIST_DATA = LIST_DOWNLOAD_2;
|
||||
$this->parent = $parent;
|
||||
}
|
||||
else
|
||||
{
|
||||
while($row = $sql -> db_Fetch())
|
||||
{
|
||||
|
||||
$rowheading = $this -> parse_heading($row['download_name'], $mode);
|
||||
$ICON = $bullet;
|
||||
$HEADING = "<a href='".e_BASE."download.php?view.".$row['download_id']."' title='".$row['download_name']."'>".$rowheading."</a>";
|
||||
$AUTHOR = ($arr[3] ? $row['download_author'] : "");
|
||||
$CATEGORY = ($arr[4] ? "<a href='".e_BASE."download.php?list.".$row['download_category_id']."'>".$row['download_category_name']."</a>" : "");
|
||||
$DATE = ($arr[5] ? $this -> getListDate($row['download_datestamp'], $mode) : "");
|
||||
$INFO = "";
|
||||
$LIST_DATA[$mode][] = array( $ICON, $HEADING, $AUTHOR, $CATEGORY, $DATE, $INFO );
|
||||
}
|
||||
function getListData()
|
||||
{
|
||||
$list_caption = $this->parent->settings['caption'];
|
||||
$list_display = ($this->parent->settings['open'] ? "" : "none");
|
||||
|
||||
if($this->parent->mode == "new_page" || $this->parent->mode == "new_menu" )
|
||||
{
|
||||
$qry = " AND download_datestamp>".$this->parent->getlvisit();
|
||||
}
|
||||
else
|
||||
{
|
||||
$qry = '';
|
||||
}
|
||||
|
||||
$bullet = $this->parent->getBullet($this->parent->settings['icon']);
|
||||
|
||||
$qry = "SELECT d.download_id, d.download_name, d.download_author, d.download_datestamp,
|
||||
dc.download_category_id, dc.download_category_name, dc.download_category_class
|
||||
FROM #download AS d
|
||||
LEFT JOIN #download_category AS dc ON d.download_category=dc.download_category_id
|
||||
WHERE dc.download_category_class REGEXP '".e_CLASS_REGEXP."' AND d.download_class REGEXP '".e_CLASS_REGEXP."' AND d.download_active != '0' ".$qry."
|
||||
ORDER BY download_datestamp DESC LIMIT 0,".intval($this->parent->settings['amount'])." ";
|
||||
|
||||
$downloads = $this->parent->e107->sql->db_Select_gen($qry);
|
||||
if($downloads == 0)
|
||||
{
|
||||
$list_data = LIST_DOWNLOAD_2;
|
||||
}
|
||||
else
|
||||
{
|
||||
$list_data = array();
|
||||
while($row = $this->parent->e107->sql->db_Fetch())
|
||||
{
|
||||
$record = array();
|
||||
$rowheading = $this->parent->parse_heading($row['download_name']);
|
||||
$record['icon'] = $bullet;
|
||||
$record['heading'] = "<a href='".e_BASE."download.php?view.".$row['download_id']."' title='".$row['download_name']."'>".$rowheading."</a>";
|
||||
$record['author'] = (varsettrue($this->parent->settings['author']) ? $row['download_author'] : "");
|
||||
$record['category'] = (varsettrue($this->parent->settings['category']) ? "<a href='".e_BASE."download.php?list.".$row['download_category_id']."'>".$row['download_category_name']."</a>" : "");
|
||||
$record['date'] = (varsettrue($this->parent->settings['date']) ? $this->parent->getListDate($row['download_datestamp']) : "");
|
||||
$record['info'] = "";
|
||||
|
||||
$list_data[] = $record;
|
||||
}
|
||||
}
|
||||
//return array with 'records', (global)'caption', 'display'
|
||||
return array(
|
||||
'records'=>$list_data,
|
||||
'caption'=>$list_caption,
|
||||
'display'=>$list_display
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@@ -1,34 +1,68 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* e107 website system
|
||||
*
|
||||
* Copyright (C) 2001-2008 e107 Inc (e107.org)
|
||||
* Released under the terms and conditions of the
|
||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||
*
|
||||
* Members e_list Handler
|
||||
*
|
||||
* $Source: /cvs_backup/e107_0.8/e107_plugins/list_new/section/list_members.php,v $
|
||||
* $Revision: 1.4 $
|
||||
* $Date: 2009-01-27 21:34:02 $
|
||||
* $Author: lisa_ $
|
||||
*
|
||||
*/
|
||||
if (!defined('e107_INIT')) { exit; }
|
||||
|
||||
$LIST_CAPTION = $arr[0];
|
||||
$LIST_DISPLAYSTYLE = ($arr[2] ? "" : "none");
|
||||
|
||||
if($mode == "new_page" || $mode == "new_menu" ){
|
||||
$lvisit = $this -> getlvisit();
|
||||
$qry = "user_join>".$lvisit." AND ";
|
||||
}else{
|
||||
$qry = " ";
|
||||
class list_members
|
||||
{
|
||||
function list_members($parent)
|
||||
{
|
||||
$this->parent = $parent;
|
||||
}
|
||||
$qry .= " user_ban=0 ORDER BY user_join DESC LIMIT 0,".intval($arr[7]);
|
||||
|
||||
$bullet = $this -> getBullet($arr[6], $mode);
|
||||
function getListData()
|
||||
{
|
||||
$list_caption = $this->parent->settings['caption'];
|
||||
$list_display = ($this->parent->settings['open'] ? "" : "none");
|
||||
|
||||
if(!$sql -> db_Select("user", "user_id,user_name,user_join", $qry)){
|
||||
$LIST_DATA = LIST_MEMBER_2;
|
||||
}else{
|
||||
while($row = $sql -> db_Fetch()){
|
||||
|
||||
$rowheading = $this -> parse_heading($row['user_name'], $mode);
|
||||
$ICON = $bullet;
|
||||
$HEADING = (USER ? "<a href='".e_BASE."user.php?id.".$row['user_id']."' title='".$row['user_name']."'>".$rowheading."</a>" : $rowheading);
|
||||
$CATEGORY = "";
|
||||
$AUTHOR = "";
|
||||
$DATE = ($arr[5] ? $this -> getListDate($row['user_join'], $mode) : "");
|
||||
$INFO = "";
|
||||
$LIST_DATA[$mode][] = array( $ICON, $HEADING, $AUTHOR, $CATEGORY, $DATE, $INFO );
|
||||
$qry = '';
|
||||
if($this->parent->mode == "new_page" || $this->parent->mode == "new_menu" )
|
||||
{
|
||||
$qry = "user_join>".$this->parent->getlvisit()." AND ";
|
||||
}
|
||||
$qry .= " user_ban=0 ORDER BY user_join DESC LIMIT 0,".intval($this->parent->settings['amount']);
|
||||
|
||||
$bullet = $this->parent->getBullet($this->parent->settings['icon']);
|
||||
|
||||
if(!$this->parent->e107->sql->db_Select_gen("SELECT user_id,user_name,user_join FROM #user WHERE ".$qry))
|
||||
{
|
||||
$list_data = LIST_MEMBER_2;
|
||||
}
|
||||
else
|
||||
{
|
||||
while($row = $this->parent->e107->sql->db_Fetch())
|
||||
{
|
||||
$record = array();
|
||||
$rowheading = $this->parent->parse_heading($row['user_name']);
|
||||
$record['icon'] = $bullet;
|
||||
$record['heading'] = (USER ? "<a href='".e_BASE."user.php?id.".$row['user_id']."' title='".$row['user_name']."'>".$rowheading."</a>" : $rowheading);
|
||||
$record['category'] = '';
|
||||
$record['author'] = '';
|
||||
$record['date'] = (varsettrue($this->parent->settings['date']) ? $this->parent->getListDate($row['user_join']) : "");
|
||||
$record['info'] = '';
|
||||
$list_data[] = $record;
|
||||
}
|
||||
}
|
||||
//return array with 'records', (global)'caption', 'display'
|
||||
return array(
|
||||
'records'=>$list_data,
|
||||
'caption'=>$list_caption,
|
||||
'display'=>$list_display
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@@ -1,62 +1,131 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* e107 website system
|
||||
*
|
||||
* Copyright (C) 2001-2008 e107 Inc (e107.org)
|
||||
* Released under the terms and conditions of the
|
||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||
*
|
||||
* News e_list Handler
|
||||
*
|
||||
* $Source: /cvs_backup/e107_0.8/e107_plugins/list_new/section/list_news.php,v $
|
||||
* $Revision: 1.2 $
|
||||
* $Date: 2009-01-27 21:34:02 $
|
||||
* $Author: lisa_ $
|
||||
*
|
||||
*/
|
||||
if (!defined('e107_INIT')) { exit; }
|
||||
|
||||
if($mode == "new_page" || $mode == "new_menu" ){
|
||||
$lvisit = $this -> getlvisit();
|
||||
$qry = " news_datestamp>".$lvisit;
|
||||
}else{
|
||||
$qry = " (news_start=0 || news_start < ".time().") AND (news_end=0 || news_end>".time().") ";
|
||||
class list_news
|
||||
{
|
||||
function list_news($parent)
|
||||
{
|
||||
$this->parent = $parent;
|
||||
}
|
||||
|
||||
$bullet = $this -> getBullet($arr[6], $mode);
|
||||
|
||||
$LIST_CAPTION = $arr[0];
|
||||
$LIST_DISPLAYSTYLE = ($arr[2] ? "" : "none");
|
||||
|
||||
$qry = "
|
||||
SELECT n.*, c.category_id AS news_category_id, c.category_name AS news_category_name, u.user_id AS news_author_id, u.user_name AS news_author_name
|
||||
FROM #news AS n
|
||||
LEFT JOIN #news_category AS c ON c.category_id = n.news_category
|
||||
LEFT JOIN #user AS u ON n.news_author = u.user_id
|
||||
WHERE ".$qry." AND n.news_class REGEXP '".e_CLASS_REGEXP."'
|
||||
ORDER BY n.news_datestamp DESC LIMIT 0,".intval($arr[7])."
|
||||
";
|
||||
|
||||
if(!$sql -> db_Select_gen($qry)){
|
||||
$LIST_DATA = LIST_NEWS_2;
|
||||
}else{
|
||||
while($row = $sql -> db_Fetch()){
|
||||
|
||||
// Code from Lisa
|
||||
// copied from the rss creation, but added here to make sure the url for the newsitem is to the news.php?item.X
|
||||
// instead of the actual hyperlink that may have been added to a newstitle on creation
|
||||
$search = array();
|
||||
$replace = array();
|
||||
$search[0] = "/\<a href=\"(.*?)\">(.*?)<\/a>/si";
|
||||
$replace[0] = '\\2';
|
||||
$search[1] = "/\<a href='(.*?)'>(.*?)<\/a>/si";
|
||||
$replace[1] = '\\2';
|
||||
$search[2] = "/\<a href='(.*?)'>(.*?)<\/a>/si";
|
||||
$replace[2] = '\\2';
|
||||
$search[3] = "/\<a href="(.*?)">(.*?)<\/a>/si";
|
||||
$replace[3] = '\\2';
|
||||
$search[4] = "/\<a href='(.*?)'>(.*?)<\/a>/si";
|
||||
$replace[4] = '\\2';
|
||||
$search[5] = "/\<a href='(.*?)'>(.*?)<\/a>/si";
|
||||
$replace[5] = '\\2';
|
||||
$news_title = preg_replace($search, $replace, $row['news_title']);
|
||||
// End of code from Lisa
|
||||
|
||||
$rowheading = $this -> parse_heading($news_title, $mode);
|
||||
$ICON = $bullet;
|
||||
$HEADING = "<a href='".e_BASE."news.php?item.".$row['news_id']."' title='".$rowheading."'>".$rowheading."</a>";
|
||||
$AUTHOR = ($arr[3] ? ($row['news_author'] == 0 ? $row['news_author'] : ($row['news_author_name'] ? "<a href='".e_BASE."user.php?id.".$row['news_author_id']."'>".$row['news_author_name']."</a>" : "") ) : "");
|
||||
$CATEGORY = ($arr[4] ? "<a href='".e_BASE."news.php?cat.".$row['news_category_id']."'>".$row['news_category_name']."</a>" : "");
|
||||
$DATE = ($arr[5] ? $this -> getListDate($row['news_datestamp'], $mode) : "");
|
||||
$INFO = "";
|
||||
$LIST_DATA[$mode][] = array( $ICON, $HEADING, $AUTHOR, $CATEGORY, $DATE, $INFO );
|
||||
function getListData()
|
||||
{
|
||||
if($this->parent->mode == "new_page" || $this->parent->mode == "new_menu" )
|
||||
{
|
||||
$qry = " n.news_datestamp>".$this->parent->getlvisit();
|
||||
}
|
||||
else
|
||||
{
|
||||
$qry = " (n.news_start=0 || n.news_start < ".time().") AND (n.news_end=0 || n.news_end>".time().") ";
|
||||
}
|
||||
|
||||
$bullet = $this->parent->getBullet($this->parent->settings['icon']);
|
||||
|
||||
$list_caption = $this->parent->settings['caption'];
|
||||
$list_display = (varsettrue($this->parent->settings['open']) ? '' : 'none');
|
||||
|
||||
$qry = "
|
||||
SELECT n.*, c.category_id AS news_category_id, c.category_name AS news_category_name, u.user_id AS news_author_id, u.user_name AS news_author_name
|
||||
FROM #news AS n
|
||||
LEFT JOIN #news_category AS c ON c.category_id = n.news_category
|
||||
LEFT JOIN #user AS u ON n.news_author = u.user_id
|
||||
WHERE ".$qry." AND n.news_class REGEXP '".e_CLASS_REGEXP."'
|
||||
ORDER BY n.news_datestamp DESC LIMIT 0,".intval($this->parent->settings['amount']);
|
||||
|
||||
if(!$this->parent->e107->sql->db_Select_gen($qry))
|
||||
{
|
||||
$list_data = LIST_NEWS_2;
|
||||
}
|
||||
else
|
||||
{
|
||||
$list_data = array();
|
||||
while($row=$this->parent->e107->sql->db_Fetch())
|
||||
{
|
||||
$row['news_title'] = $this->parse_news_title($row['news_title']);
|
||||
$rowheading = $this->parent->parse_heading($row['news_title']);
|
||||
|
||||
$record = array();
|
||||
$record['icon'] = $bullet;
|
||||
$record['heading'] = "<a href='".e_BASE."news.php?item.".$row['news_id']."' title='".$rowheading."'>".$rowheading."</a>";
|
||||
|
||||
$record['author'] = '';
|
||||
if(varsettrue($this->parent->settings['author']))
|
||||
{
|
||||
if($row['news_author'] == 0)
|
||||
{
|
||||
$record['author'] = $row['news_author'];
|
||||
}
|
||||
else
|
||||
{
|
||||
if(varsettrue($row['news_author_name']))
|
||||
{
|
||||
$record['author'] = "<a href='".e_BASE."user.php?id.".$row['news_author_id']."'>".$row['news_author_name']."</a>";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$record['category'] = '';
|
||||
if(varsettrue($this->parent->settings['category']))
|
||||
{
|
||||
$record['category'] = "<a href='".e_BASE."news.php?cat.".$row['news_category_id']."'>".$row['news_category_name']."</a>";
|
||||
}
|
||||
|
||||
$record['date'] = '';
|
||||
if(varsettrue($this->parent->settings['date']))
|
||||
{
|
||||
$record['date'] = $this->parent->getListDate($row['news_datestamp']);
|
||||
}
|
||||
|
||||
$record['info'] = '';
|
||||
|
||||
//collect each result
|
||||
$list_data[] = $record;
|
||||
}
|
||||
}
|
||||
|
||||
//return array with 'records', (global)'caption', 'display'
|
||||
return array(
|
||||
'records'=>$list_data,
|
||||
'caption'=>$list_caption,
|
||||
'display'=>$list_display
|
||||
);
|
||||
}
|
||||
|
||||
//helpers
|
||||
function parse_news_title($title)
|
||||
{
|
||||
// copied from the rss creation, but added here to make sure the url for the newsitem is to the news.php?item.X
|
||||
// instead of the actual hyperlink that may have been added to a newstitle on creation
|
||||
$search = array();
|
||||
$replace = array();
|
||||
$search[0] = "/\<a href=\"(.*?)\">(.*?)<\/a>/si";
|
||||
$replace[0] = '\\2';
|
||||
$search[1] = "/\<a href='(.*?)'>(.*?)<\/a>/si";
|
||||
$replace[1] = '\\2';
|
||||
$search[2] = "/\<a href='(.*?)'>(.*?)<\/a>/si";
|
||||
$replace[2] = '\\2';
|
||||
$search[3] = "/\<a href="(.*?)">(.*?)<\/a>/si";
|
||||
$replace[3] = '\\2';
|
||||
$search[4] = "/\<a href='(.*?)'>(.*?)<\/a>/si";
|
||||
$replace[4] = '\\2';
|
||||
$search[5] = "/\<a href='(.*?)'>(.*?)<\/a>/si";
|
||||
$replace[5] = '\\2';
|
||||
return preg_replace($search, $replace, $title);
|
||||
}
|
||||
}
|
||||
?>
|
Reference in New Issue
Block a user