1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-14 10:34:23 +02:00

new module creation

This commit is contained in:
mcfly
2006-12-02 04:36:16 +00:00
commit e149b35fcc
2196 changed files with 182987 additions and 0 deletions

View File

@@ -0,0 +1,550 @@
<?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.1.1.1 $
| $Date: 2006-12-02 04:35:26 $
| $Author: mcfly_e107 $
+---------------------------------------------------------------+
*/
//include and require several classes
require_once("../../class2.php");
if(!getperms("1")){ header("location:".e_BASE."index.php"); exit ;}
require_once(e_ADMIN."auth.php");
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
$lan_file = $listplugindir."languages/".e_LANGUAGE.".php";
include(file_exists($lan_file) ? $lan_file : $listplugindir."languages/English.php");
//get all sections to use (and reload if new e_list.php files are added)
$rc -> getSections();
//update preferences in database
if(isset($_POST['update_menu'])){
while(list($key, $value) = each($_POST)){
if($value != LIST_ADMIN_2){ $list_pref[$tp->toDB($key)] = $tp->toDB($value); }
}
$tmp = $eArrayStorage->WriteArray($list_pref);
$sql -> db_Update("core", "e107_value='$tmp' WHERE e107_name='list' ");
$message = LIST_ADMIN_3;
}
//check preferences from database
$list_pref = $rc -> getListPrefs();
$rejectlist = array('$.','$..','/','CVS','thumbs.db','Thumbs.db','*._$', 'index', 'null*');
$iconlist = $fl->get_files($listplugindir."images/", "", $rejectlist);
//render message if set
if(isset($message)){
$ns -> tablerender("", "<div style='text-align:center'><b>".$message."</b></div>");
}
//define some variables
$stylespacer = "style='border:0; height:20px;'";
$styletable = "style='width:90%; border:1px solid #444; border-collapse:collapse;' cellpadding='0' cellspacing='0' ";
//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 style='cursor: pointer; cursor: hand' onclick='expandit(this);'>{TOPIC_HEADING}</a>
<div style='display: none;'>
<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 = "
<script type=\"text/javascript\">
<!--
var hideid=\"recent_page\";
function showhideit(showid){
if (hideid!=showid){
show=document.getElementById(showid).style;
hide=document.getElementById(hideid).style;
show.display=\"\";
hide.display=\"none\";
hideid = showid;
}
}
//-->
</script>";
$text .= "
<div style='text-align:center'>
".$rs -> form_open("post", e_SELF, "menu_conf_form", "", "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_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_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_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 = "";
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 = "";
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_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:hand' size='30' value='".LIST_ADMIN_12."' onClick=\"expandit('div_".$sections[$i]."_".$type."_icon')\" />
<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_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_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_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;
}
//---------------------------------------------------------------------------------------------------
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='".$type."' style='display:none; text-align: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_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_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_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_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_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_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_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_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_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 = "display:;";
}else{
$display = "display:none;";
}
$text = "
<div id='".$type."' style='".$display." text-align: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_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_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_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_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_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_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_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_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_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_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_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_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_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['recent_page']['text'] = LIST_ADMIN_OPT_2;
$var['recent_menu']['text'] = LIST_ADMIN_OPT_3;
$var['new_page']['text'] = LIST_ADMIN_OPT_4;
$var['new_menu']['text'] = LIST_ADMIN_OPT_5;
show_admin_menu(LIST_ADMIN_OPT_6, $act, $var, TRUE);
}
// ##### End --------------------------------------------------------------------------------------
require_once(e_ADMIN."footer.php");
?>

Binary file not shown.

After

Width:  |  Height:  |  Size: 922 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 B

View File

@@ -0,0 +1,206 @@
<?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/languages/English.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:35:27 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
if (!defined("PAGE_NAME")) { define("PAGE_NAME", "List New Items"); }
define("LIST_PLUGIN_1", "List");
define("LIST_PLUGIN_2", "This plugin allows you to view a list of recent additions in all e107 categories. You can either view the list with data since your last visit, or view a general latest additions list. Besides the page a menu is also present. Every section is configurable in the admin area.");
define("LIST_PLUGIN_3", "Configure Main Menu");
define("LIST_PLUGIN_4", "The List_new plugin is now ready to be used.");
define("LIST_PLUGIN_5", "list");
define("LIST_PLUGIN_6", "This plugin is not installed.");
define("LIST_ADMIN_1", "recent");
define("LIST_ADMIN_2", "update settings");
define("LIST_ADMIN_3", "settings updated");
define("LIST_ADMIN_4", "section");
define("LIST_ADMIN_5", "menu");
define("LIST_ADMIN_6", "page");
define("LIST_ADMIN_7", "enabled");
define("LIST_ADMIN_8", "disabled");
define("LIST_ADMIN_9", "open");
define("LIST_ADMIN_10", "closed");
define("LIST_ADMIN_11", "update");
define("LIST_ADMIN_12", "choose");
define("LIST_ADMIN_13", "Welcome on the Recent page of ".SITENAME." ! This page shows for the most common sections of this site a list with the most recent additions in these sections.");
define("LIST_ADMIN_14", "recent additions");
define("LIST_ADMIN_15", "new since your last visit");
define("LIST_ADMIN_16", "Welcome on the New page of ".SITENAME." ! This page shows for the most common sections of this site a list with the additions in these sections since your last visit.");
define("LIST_ADMIN_SECT_1", "sections");
define("LIST_ADMIN_SECT_2", "choose which sections to show");
define("LIST_ADMIN_SECT_3", "");
define("LIST_ADMIN_SECT_4", "display style");
define("LIST_ADMIN_SECT_5", "choose which sections are opened by default");
define("LIST_ADMIN_SECT_6", "");
define("LIST_ADMIN_SECT_7", "author");
define("LIST_ADMIN_SECT_8", "choose if the author should be displayed");
define("LIST_ADMIN_SECT_9", "");
define("LIST_ADMIN_SECT_10", "category");
define("LIST_ADMIN_SECT_11", "choose if the category should be displayed");
define("LIST_ADMIN_SECT_12", "");
define("LIST_ADMIN_SECT_13", "date");
define("LIST_ADMIN_SECT_14", "choose if the date should be displayed");
define("LIST_ADMIN_SECT_15", "");
define("LIST_ADMIN_SECT_16", "amount items");
define("LIST_ADMIN_SECT_17", "choose how many items should be displayed for each section");
define("LIST_ADMIN_SECT_18", "");
define("LIST_ADMIN_SECT_19", "order items");
define("LIST_ADMIN_SECT_20", "choose the order in which sections should be displayed");
define("LIST_ADMIN_SECT_21", "");
define("LIST_ADMIN_SECT_22", "icon");
define("LIST_ADMIN_SECT_23", "choose an icon for each section");
define("LIST_ADMIN_SECT_24", "");
define("LIST_ADMIN_SECT_25", "caption");
define("LIST_ADMIN_SECT_26", "define a caption for each section");
define("LIST_ADMIN_SECT_27", "");
define("LIST_ADMIN_OPT_1", "general");
define("LIST_ADMIN_OPT_2", "recent page");
define("LIST_ADMIN_OPT_3", "recent menu");
define("LIST_ADMIN_OPT_4", "new page");
define("LIST_ADMIN_OPT_5", "new menu");
define("LIST_ADMIN_OPT_6", "options");
define("LIST_ADMIN_MENU_2", "icon : default");
define("LIST_ADMIN_MENU_3", "use default theme bullet if no icon is present or if icon:use is disabled");
define("LIST_ADMIN_MENU_4", "");
define("LIST_ADMIN_LAN_2", "caption");
define("LIST_ADMIN_LAN_3", "define a caption");
define("LIST_ADMIN_LAN_4", "");
define("LIST_ADMIN_LAN_5", "icon : use");
define("LIST_ADMIN_LAN_6", "use icon from each section");
define("LIST_ADMIN_LAN_7", "");
define("LIST_ADMIN_LAN_8", "characters");
define("LIST_ADMIN_LAN_9", "choose how many characters of the heading will be shown");
define("LIST_ADMIN_LAN_10", "leave blank to show full heading");
define("LIST_ADMIN_LAN_11", "postfix");
define("LIST_ADMIN_LAN_12", "choose a postfix if the heading is larger then the given amount of characters");
define("LIST_ADMIN_LAN_13", "leave blank to show no postfix");
define("LIST_ADMIN_LAN_14", "date");
define("LIST_ADMIN_LAN_15", "choose a date style");
define("LIST_ADMIN_LAN_16", "For more information on date formats see the <a href='http://www.php.net/manual/en/function.strftime.php' rel='external'>strftime function page at php.net</a>");
define("LIST_ADMIN_LAN_17", "today date");
define("LIST_ADMIN_LAN_18", "choose a date style if the date is today");
define("LIST_ADMIN_LAN_19", "For more information on date formats see the <a href='http://www.php.net/manual/en/function.strftime.php' rel='external'>strftime function page at php.net</a>");
define("LIST_ADMIN_LAN_20", "columns");
define("LIST_ADMIN_LAN_21", "choose an amount of columns");
define("LIST_ADMIN_LAN_22", "define how many columns you want to use. the number you specify will separate the page into an equal amount of columns");
define("LIST_ADMIN_LAN_23", "welcome text");
define("LIST_ADMIN_LAN_24", "define a welcome text that will be rendered at the top of the page");
define("LIST_ADMIN_LAN_25", "");
define("LIST_ADMIN_LAN_26", "show empty");
define("LIST_ADMIN_LAN_27", "define if a message needs to be shown when sections have no results ");
define("LIST_ADMIN_LAN_28", "");
define("LIST_ADMIN_LAN_29", "icon : default");
define("LIST_ADMIN_LAN_30", "use default theme bullet if no icon is present or if icon:use is disabled");
define("LIST_ADMIN_LAN_31", "");
define("LIST_ADMIN_LAN_32", "timelapse:days");
define("LIST_ADMIN_LAN_33", "maximum of days users can look back");
define("LIST_ADMIN_LAN_34", "");
define("LIST_ADMIN_LAN_35", "days");
define("LIST_ADMIN_LAN_36", "timelapse");
define("LIST_ADMIN_LAN_37", "display a select box with number of days to look back?");
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", "");
define("LIST_MENU_1", "recent additions");
define("LIST_MENU_2", "by");
define("LIST_MENU_3", "on");
define("LIST_MENU_4", "in");
define("LIST_MENU_5", "days");
define("LIST_MENU_6", "view content for how may days?");
define("LIST_MENU_7", "");
define("LIST_MENU_8", "");
define("LIST_MENU_9", "");
define("LIST_MENU_10", "");
define("LIST_MENU_11", "");
define("LIST_MENU_12", "");
define("LIST_MENU_13", "");
define("LIST_MENU_14", "");
define("LIST_MENU_15", "");
define("LIST_MENU_16", "");
define("LIST_MENU_17", "");
define("LIST_MENU_18", "");
define("LIST_MENU_19", "");
define("LIST_NEWS_1", "news");
define("LIST_NEWS_2", "no news items");
define("LIST_COMMENT_1", "comments");
define("LIST_COMMENT_2", "no comments");
define("LIST_COMMENT_3", "news");
define("LIST_COMMENT_4", "faq");
define("LIST_COMMENT_5", "poll");
define("LIST_COMMENT_6", "docs");
define("LIST_COMMENT_7", "bugtrack");
define("LIST_COMMENT_8", "content");
define("LIST_COMMENT_9", "download");
define("LIST_COMMENT_10", "ideas");
define("LIST_DOWNLOAD_1", "downloads");
define("LIST_DOWNLOAD_2", "no downloads");
define("LIST_MEMBER_1", "members");
define("LIST_MEMBER_2", "no members");
define("LIST_CONTENT_1", "content");
define("LIST_CONTENT_2", "no content in");
define("LIST_CONTENT_3", "no valid content category");
define("LIST_CHATBOX_1", "chatbox");
define("LIST_CHATBOX_2", "no chatbox posts");
define("LIST_CALENDAR_1", "calendar");
define("LIST_CALENDAR_2", "no calendar events");
define("LIST_LINKS_1", "links");
define("LIST_LINKS_2", "no links");
define("LIST_FORUM_1", "forum");
define("LIST_FORUM_2", "no forum posts");
define("LIST_FORUM_3", "views:");
define("LIST_FORUM_4", "replies:");
define("LIST_FORUM_5", "lastpost:");
define("LIST_FORUM_6", "on:");
?>

View File

@@ -0,0 +1,125 @@
<?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.1.1.1 $
| $Date: 2006-12-02 04:35:26 $
| $Author: mcfly_e107 $
+---------------------------------------------------------------+
*/
require_once("../../class2.php");
$listplugindir = e_PLUGIN."list_new/";
//get language file
$lan_file = $listplugindir."languages/".e_LANGUAGE.".php";
include_once(file_exists($lan_file) ? $lan_file : $listplugindir."languages/English.php");
if(!$sql -> db_Select("plugin", "*", "plugin_path = 'list_new' AND plugin_installflag = '1' ")){
require_once(HEADERF);
$ns -> tablerender("", LIST_PLUGIN_6);
require_once(FOOTERF);
exit;
}
require_once($listplugindir."list_shortcodes.php");
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();
unset($text);
require_once(HEADERF);
global $tp;
// check query
if(e_QUERY){
$qs = explode(".", e_QUERY);
if($qs[0] == "new"){
$mode = $qs[0];
}
}
if(isset($mode) && $mode == "new"){
$mode = "new_page";
}else{
$mode = "recent_page"; //default to 'page'
}
$list_pref = $rc -> getListPrefs();
$sections = $rc -> prepareSection($mode);
$arr = $rc -> prepareSectionArray($mode, $sections);
$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);
unset($text);
require_once(FOOTERF);
?>

View File

@@ -0,0 +1,551 @@
<?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_class.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:35:26 $
| $Author: mcfly_e107 $
+---------------------------------------------------------------+
*/
if (!defined('e107_INIT')) { exit; }
global $sql, $rc, $list_pref, $sc_style, $tp, $list_shortcodes, $defaultarray;
global $LIST_PAGE_NEW, $LIST_PAGE_RECENT, $LIST_MENU_NEW, $LIST_MENU_RECENT, $LIST_PAGE_NEW_START, $LIST_PAGE_RECENT_START, $LIST_MENU_NEW_START, $LIST_MENU_RECENT_START, $LIST_PAGE_NEW_END, $LIST_PAGE_RECENT_END, $LIST_MENU_NEW_END, $LIST_MENU_RECENT_END;
global $LIST_ICON, $LIST_DATE, $LIST_HEADING, $LIST_AUTHOR, $LIST_CATEGORY, $LIST_INFO;
global $LIST_DISPLAYSTYLE, $LIST_CAPTION, $LIST_STYLE_CAPTION, $LIST_STYLE_BODY;
$listplugindir = e_PLUGIN."list_new/";
//default sections (present in this list plugin)
$defaultarray = array("news", "comment", "download", "members");
//get language file
$lan_file = $listplugindir."languages/".e_LANGUAGE.".php";
include_once(file_exists($lan_file) ? $lan_file : $listplugindir."languages/English.php");
if (file_exists(THEME."list_template.php")) {
require_once(THEME."list_template.php");
} else {
require_once($listplugindir."list_template.php");
}
class listclass {
function getListPrefs()
{
global $sql,$eArrayStorage;
//check preferences from database
$sql = new db;
$num_rows = $sql -> db_Select("core", "*", "e107_name='list' ");
$row = $sql -> db_Fetch();
//insert default preferences
if (empty($row['e107_value'])) {
$this -> getSections();
$list_pref = $this -> getDefaultPrefs();
$tmp = $eArrayStorage->WriteArray($list_pref);
$sql -> db_Insert("core", "'list', '$tmp' ");
$sql -> db_Select("core", "*", "e107_name='list' ");
}
$list_pref = $eArrayStorage->ReadArray($row['e107_value']);
return $list_pref;
}
function prepareSection($mode){
global $list_pref;
$len = strlen($mode) + 9;
//get all sections to use
foreach ($list_pref as $key => $value) {
if(substr($key,-$len) == "_{$mode}_display" && $value == "1"){
$sections[] = substr($key,0,-$len);
}
}
return $sections;
}
function prepareSectionArray($mode, $sections){
global $list_pref;
//section reference
for($i=0;$i<count($sections);$i++){
if(isset($list_pref[$sections[$i]."_".$mode."_display"]) && $list_pref[$sections[$i]."_".$mode."_display"] == "1"){
$arr[$sections[$i]][0] = (isset($list_pref[$sections[$i]."_".$mode."_caption"]) ? $list_pref[$sections[$i]."_".$mode."_caption"] : "");
$arr[$sections[$i]][1] = (isset($list_pref[$sections[$i]."_".$mode."_display"]) ? $list_pref[$sections[$i]."_".$mode."_display"] : "");
$arr[$sections[$i]][2] = (isset($list_pref[$sections[$i]."_".$mode."_open"]) ? $list_pref[$sections[$i]."_".$mode."_open"] : "");
$arr[$sections[$i]][3] = (isset($list_pref[$sections[$i]."_".$mode."_author"]) ? $list_pref[$sections[$i]."_".$mode."_author"] : "");
$arr[$sections[$i]][4] = (isset($list_pref[$sections[$i]."_".$mode."_category"]) ? $list_pref[$sections[$i]."_".$mode."_category"] : "");
$arr[$sections[$i]][5] = (isset($list_pref[$sections[$i]."_".$mode."_date"]) ? $list_pref[$sections[$i]."_".$mode."_date"] : "");
$arr[$sections[$i]][6] = (isset($list_pref[$sections[$i]."_".$mode."_icon"]) ? $list_pref[$sections[$i]."_".$mode."_icon"] : "");
$arr[$sections[$i]][7] = (isset($list_pref[$sections[$i]."_".$mode."_amount"]) ? $list_pref[$sections[$i]."_".$mode."_amount"] : "");
$arr[$sections[$i]][8] = (isset($list_pref[$sections[$i]."_".$mode."_order"]) ? $list_pref[$sections[$i]."_".$mode."_order"] : "");
$arr[$sections[$i]][9] = $sections[$i];
}
}
//sort array on order values set in preferences
usort($arr, create_function('$e,$f','return $e[8]==$f[8]?0:($e[8]>$f[8]?1:-1);'));
return $arr;
}
function getDefaultSections(){
global $sql, $sections, $titles, $defaultarray;
//default always present sections
for($i=0;$i<count($defaultarray);$i++){
$sections[] = $defaultarray[$i];
$titles[] = $defaultarray[$i];
}
return;
}
//content needs this to split each main parent into separate sections
function getContentSections($mode)
{
global $sql, $sections, $titles, $content_types, $content_name;
if(!$content_install = $sql -> db_Select("plugin", "plugin_id", "plugin_path = 'content' AND plugin_installflag = '1' ")){
return;
}
$datequery = " AND (content_datestamp=0 || content_datestamp < ".time().") AND (content_enddate=0 || content_enddate>".time().") ";
//get main parent types
if($mainparents = $sql -> db_Select("pcontent", "content_id, content_heading", "content_parent = '0' ".$datequery." ORDER BY content_heading"))
{
while($row = $sql -> db_Fetch())
{
$content_types[] = "content_".$row['content_id'];
$content_name = 'content';
if($mode == "add")
{
$sections[] = "content_".$row['content_id'];
$titles[] = $content_name." : ".$row['content_heading'];
}
}
}
$content_types = array_unique($content_types);
return;
}
function getSections()
{
global $sql, $sections, $titles;
$this -> getDefaultSections();
require_once(e_HANDLER."file_class.php");
$fl = new e_file;
$rejectlist = array('$.','$..','/','CVS','thumbs.db','Thumbs.db','*._$', 'index', 'null*', '.bak');
$iconlist = $fl->get_files(e_PLUGIN, "e_list\.php$", "standard", 1);
foreach($iconlist as $icon)
{
$tmp = explode("/", $icon['path']);
$tmp = array_reverse($tmp);
$icon['fname'] = $tmp[1];
if($plugin_installed = $sql -> db_Select("plugin", "plugin_id", "plugin_path = '".$icon['fname']."' AND plugin_installflag = '1' "))
{
if($icon['fname'] == "content")
{
$this -> getContentSections("add");
}
else
{
$sections[] = $icon['fname'];
$titles[] = $icon['fname'];
}
}
}
return;
}
function getDefaultPrefs()
{
global $sql, $sections, $titles, $defaultarray, $content_types, $tp;
//section preferences
for($i=0;$i<count($sections);$i++)
{
if(!in_array($sections[$i], $defaultarray))
{
if(!in_array($sections[$i], $content_types))
{
if($plugin_installed = $sql -> db_Select("plugin", "plugin_id", "plugin_path = '".$tp -> toDB($sections[$i], true)."' AND plugin_installflag = '1' "))
{
$list_pref["$sections[$i]_recent_menu_caption"] = $sections[$i];
$list_pref["$sections[$i]_recent_page_caption"] = $sections[$i];
$list_pref["$sections[$i]_new_menu_caption"] = $sections[$i];
$list_pref["$sections[$i]_new_page_caption"] = $sections[$i];
}
}
else
{
$list_pref["$sections[$i]_recent_menu_caption"] = $titles[$i];
$list_pref["$sections[$i]_recent_page_caption"] = $titles[$i];
$list_pref["$sections[$i]_new_menu_caption"] = $titles[$i];
$list_pref["$sections[$i]_new_page_caption"] = $titles[$i];
}
}
else
{
$list_pref["$sections[$i]_recent_menu_caption"] = $sections[$i];
$list_pref["$sections[$i]_recent_page_caption"] = $sections[$i];
$list_pref["$sections[$i]_new_menu_caption"] = $sections[$i];
$list_pref["$sections[$i]_new_page_caption"] = $sections[$i];
}
$list_pref["$sections[$i]_recent_menu_display"] = "1";
$list_pref["$sections[$i]_recent_menu_open"] = "0";
$list_pref["$sections[$i]_recent_menu_author"] = "0";
$list_pref["$sections[$i]_recent_menu_category"] = "0";
$list_pref["$sections[$i]_recent_menu_date"] = "1";
$list_pref["$sections[$i]_recent_menu_amount"] = "5";
$list_pref["$sections[$i]_recent_menu_order"] = ($i+1);
$list_pref["$sections[$i]_recent_menu_icon"] = "";
$list_pref["$sections[$i]_recent_page_display"] = "1";
$list_pref["$sections[$i]_recent_page_open"] = "1";
$list_pref["$sections[$i]_recent_page_author"] = "1";
$list_pref["$sections[$i]_recent_page_category"] = "1";
$list_pref["$sections[$i]_recent_page_date"] = "1";
$list_pref["$sections[$i]_recent_page_amount"] = "10";
$list_pref["$sections[$i]_recent_page_order"] = ($i+1);
$list_pref["$sections[$i]_recent_page_icon"] = "1";
$list_pref["$sections[$i]_new_menu_display"] = "1";
$list_pref["$sections[$i]_new_menu_open"] = "0";
$list_pref["$sections[$i]_new_menu_author"] = "0";
$list_pref["$sections[$i]_new_menu_category"] = "0";
$list_pref["$sections[$i]_new_menu_date"] = "1";
$list_pref["$sections[$i]_new_menu_amount"] = "5";
$list_pref["$sections[$i]_new_menu_order"] = ($i+1);
$list_pref["$sections[$i]_new_menu_icon"] = "1";
$list_pref["$sections[$i]_new_page_display"] = "1";
$list_pref["$sections[$i]_new_page_open"] = "1";
$list_pref["$sections[$i]_new_page_author"] = "1";
$list_pref["$sections[$i]_new_page_category"] = "1";
$list_pref["$sections[$i]_new_page_date"] = "1";
$list_pref["$sections[$i]_new_page_amount"] = "10";
$list_pref["$sections[$i]_new_page_order"] = ($i+1);
$list_pref["$sections[$i]_new_page_icon"] = "1";
}
//new menu preferences
$list_pref['new_menu_caption'] = LIST_ADMIN_15;
$list_pref['new_menu_icon_use'] = "1";
$list_pref['new_menu_icon_default'] = "1";
$list_pref['new_menu_char_heading'] = "20";
$list_pref['new_menu_char_postfix'] = "...";
$list_pref['new_menu_datestyle'] = "%d %b";
$list_pref['new_menu_datestyletoday'] = "%H:%M";
$list_pref['new_menu_showempty'] = "1";
$list_pref['new_menu_openifrecords'] = "";
//new page preferences
$list_pref['new_page_caption'] = LIST_ADMIN_15;
$list_pref['new_page_icon_use'] = "1";
$list_pref['new_page_icon_default'] = "1";
$list_pref['new_page_char_heading'] = "";
$list_pref['new_page_char_postfix'] = "";
$list_pref['new_page_datestyle'] = "%d %b";
$list_pref['new_page_datestyletoday'] = "%H:%M";
$list_pref['new_page_showempty'] = "1";
$list_pref['new_page_colomn'] = "1";
$list_pref['new_page_welcometext'] = LIST_ADMIN_16;
$list_pref['new_page_timelapse'] = "1";
$list_pref['new_page_timelapse_days'] = "30";
$list_pref['new_page_openifrecords'] = "";
//recent menu preferences
$list_pref['recent_menu_caption'] = LIST_ADMIN_14;
$list_pref['recent_menu_icon_use'] = "1";
$list_pref['recent_menu_icon_default'] = "1";
$list_pref['recent_menu_char_heading'] = "20";
$list_pref['recent_menu_char_postfix'] = "...";
$list_pref['recent_menu_datestyle'] = "%d %b";
$list_pref['recent_menu_datestyletoday'] = "%H:%M";
$list_pref['recent_menu_showempty'] = "";
$list_pref['recent_menu_openifrecords'] = "";
//recent page preferences
$list_pref['recent_page_caption'] = LIST_ADMIN_14;
$list_pref['recent_page_icon_use'] = "1";
$list_pref['recent_page_icon_default'] = "1";
$list_pref['recent_page_char_heading'] = "";
$list_pref['recent_page_char_postfix'] = "";
$list_pref['recent_page_datestyle'] = "%d %b";
$list_pref['recent_page_datestyletoday'] = "%H:%M";
$list_pref['recent_page_showempty'] = "";
$list_pref['recent_page_colomn'] = "1";
$list_pref['recent_page_welcometext'] = LIST_ADMIN_13;
$list_pref['recent_page_openifrecords'] = "";
return $list_pref;
}
function show_section_list($arr, $mode, $max="")
{
global $tp, $listplugindir, $list_shortcodes, $sql, $list_pref, $defaultarray, $content_types, $content_name;
global $LIST_ICON, $LIST_DATE, $LIST_HEADING, $LIST_AUTHOR, $LIST_CATEGORY, $LIST_INFO;
global $LIST_DISPLAYSTYLE, $LIST_CAPTION, $LIST_STYLE_CAPTION, $LIST_STYLE_BODY;
global $LIST_PAGE_NEW, $LIST_PAGE_RECENT, $LIST_MENU_NEW, $LIST_MENU_RECENT, $LIST_PAGE_NEW_START, $LIST_PAGE_RECENT_START, $LIST_MENU_NEW_START, $LIST_MENU_RECENT_START, $LIST_PAGE_NEW_END, $LIST_PAGE_RECENT_END, $LIST_MENU_NEW_END, $LIST_MENU_RECENT_END;
$menu_installed = $sql -> db_Select("menus", "menu_id", "(menu_name = 'list_new_menu' || menu_name = 'list_recent_menu') AND menu_location != '0' AND menu_class REGEXP '".e_CLASS_REGEXP."' ");
$LIST_DATA = "";
$LIST_CAPTION = "";
$this -> getContentSections("");
//require is needed here instead of require_once, since both the menu and the page could be visible at the same time
if(is_array($content_types) && in_array($arr[9], $content_types))
{
$file = $content_name;
if(file_exists(e_PLUGIN.$file."/e_list.php"))
{
global $contentmode;
$contentmode = $arr[9];
require(e_PLUGIN.$file."/e_list.php");
}
}
else
{
$file = $arr[9];
if(in_array($file, $defaultarray))
{
require($listplugindir."section/list_".$file.".php");
}
else
{
if(file_exists(e_PLUGIN.$file."/e_list.php"))
{
require(e_PLUGIN.$file."/e_list.php");
}
}
}
$menutext = "";
$start = "";
$end = "";
$LIST_ICON = "";
$LIST_DATE = "";
$LIST_HEADING = "";
$LIST_AUTHOR = "";
$LIST_CATEGORY = "";
$LIST_INFO = "";
//$LIST_CAPTION = (isset($list_pref[$mode."_caption"]) && $list_pref[$mode."_caption"] ? $list_pref[$mode."_caption"] : "");
//$LIST_CAPTION = (isset($list_pref[$mode."_caption"]) && $list_pref[$mode."_caption"] ? $list_pref[$mode."_caption"] : "");
//echo $list_pref["$arr_{$mode}_caption"];
if(is_array($LIST_DATA)){ //if it is an array, data exists and data is not empty
for($i=0;$i<count($LIST_DATA[$mode]);$i++)
{
$LIST_ICON = $LIST_DATA[$mode][$i][0];
$LIST_HEADING = $LIST_DATA[$mode][$i][1];
$LIST_AUTHOR = $LIST_DATA[$mode][$i][2];
$LIST_CATEGORY = $LIST_DATA[$mode][$i][3];
$LIST_DATE = $LIST_DATA[$mode][$i][4];
$LIST_INFO = $LIST_DATA[$mode][$i][5];
if($mode == "recent_menu"){
global $sc_style;
$LIST_AUTHOR = ($LIST_AUTHOR ? $sc_style['LIST_AUTHOR']['pre'].$LIST_AUTHOR.$sc_style['LIST_AUTHOR']['post'] : "");
$LIST_CATEGORY = ($LIST_CATEGORY ? $sc_style['LIST_CATEGORY']['pre'].$LIST_CATEGORY.$sc_style['LIST_CATEGORY']['post'] : "");
$menutext .= preg_replace("/\{(.*?)\}/e", '$\1', $LIST_MENU_RECENT);
}elseif($mode == "new_menu"){
global $sc_style;
$LIST_AUTHOR = ($LIST_AUTHOR ? $sc_style['LIST_AUTHOR']['pre'].$LIST_AUTHOR.$sc_style['LIST_AUTHOR']['post'] : "");
$LIST_CATEGORY = ($LIST_CATEGORY ? $sc_style['LIST_CATEGORY']['pre'].$LIST_CATEGORY.$sc_style['LIST_CATEGORY']['post'] : "");
$menutext .= preg_replace("/\{(.*?)\}/e", '$\1', $LIST_MENU_NEW);
}elseif($mode == "recent_page"){
$menutext .= $tp -> parseTemplate($LIST_PAGE_RECENT, FALSE, $list_shortcodes);
}elseif($mode == "new_page"){
$menutext .= $tp -> parseTemplate($LIST_PAGE_NEW, FALSE, $list_shortcodes);
}
}
}elseif(!is_array($LIST_DATA) && $LIST_DATA != ""){
$LIST_HEADING = $LIST_DATA;
if($mode == "recent_menu"){
if($list_pref[$mode."_showempty"]){
$menutext .= preg_replace("/\{(.*?)\}/e", '$\1', $LIST_MENU_RECENT);
}
}elseif($mode == "new_menu"){
if($list_pref[$mode."_showempty"]){
$menutext .= preg_replace("/\{(.*?)\}/e", '$\1', $LIST_MENU_NEW);
}
}elseif($mode == "recent_page"){
if($list_pref[$mode."_showempty"]){
$menutext .= $tp -> parseTemplate($LIST_PAGE_RECENT, FALSE, $list_shortcodes);
}
}elseif($mode == "new_page"){
if($list_pref[$mode."_showempty"]){
$menutext .= $tp -> parseTemplate($LIST_PAGE_NEW, FALSE, $list_shortcodes);
}
}
}
if($LIST_DATA != ""){
//open sections if content exists ? yes if true, else use individual setting of section
$LIST_DISPLAYSTYLE = ($list_pref[$mode."_openifrecords"] ? "" : $LIST_DISPLAYSTYLE);
if($mode == "recent_menu"){
if($list_pref[$mode."_showempty"] || $menutext){
$start = preg_replace("/\{(.*?)\}/e", '$\1', $LIST_MENU_RECENT_START);
$end = preg_replace("/\{(.*?)\}/e", '$\1', $LIST_MENU_RECENT_END);
}
}elseif($mode == "new_menu"){
if($list_pref[$mode."_showempty"] || $menutext){
$start = preg_replace("/\{(.*?)\}/e", '$\1', $LIST_MENU_NEW_START);
$end = preg_replace("/\{(.*?)\}/e", '$\1', $LIST_MENU_NEW_END);
}
}elseif($mode == "recent_page"){
if($list_pref[$mode."_showempty"] || $menutext){
$start = preg_replace("/\{(.*?)\}/e", '$\1', $LIST_PAGE_RECENT_START);
$end = preg_replace("/\{(.*?)\}/e", '$\1', $LIST_PAGE_RECENT_END);
}
}elseif($mode == "new_page"){
if($list_pref[$mode."_showempty"] || $menutext){
$start = preg_replace("/\{(.*?)\}/e", '$\1', $LIST_PAGE_NEW_START);
$end = preg_replace("/\{(.*?)\}/e", '$\1', $LIST_PAGE_NEW_END);
}
}
$text = $start.$menutext.$end;
}else{
$text = "";
}
return $text;
}
function getlvisit(){
global $qs, $list_pref;
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']) && $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){
$lvisit = time()-$qs[1]*86400;
}else{
$lvisit = USERLV;
}
}else{
$lvisit = USERLV;
}
}else{
$lvisit = USERLV;
}
return $lvisit;
}
function getBullet($sectionicon, $mode)
{
global $list_pref, $listplugindir;
$default_bullet = "";
if($list_pref[$mode."_icon_default"])
{
if(file_exists(THEME."images/bullet2.gif"))
{
$default_bullet = "<img src='".THEME."images/bullet2.gif' alt='' />";
}
}
$icon_width = "8";
$icon_height = "8";
$style_pre = "";
if($list_pref[$mode."_icon_use"]){
if($sectionicon){
if(file_exists($listplugindir."images/".$sectionicon)){
$bullet = "<img src='".$listplugindir."images/".$sectionicon."' style='width:".$icon_width."px; height:".$icon_height."px; border:0; vertical-align:middle;' alt='' />";
}
}
}
$bullet = (isset($bullet) ? $bullet : $default_bullet);
return $bullet;
}
function parse_heading($heading, $mode){
global $list_pref;
if($list_pref[$mode."_char_heading"] && strlen($heading) > $list_pref[$mode."_char_heading"]){
$heading = substr($heading, 0, $list_pref[$mode."_char_heading"]).$list_pref[$mode."_char_postfix"];
}
return $heading;
}
function getListDate($datestamp, $mode){
global $list_pref;
$datestamp += TIMEOFFSET;
$todayarray = getdate();
$current_day = $todayarray['mday'];
$current_month = $todayarray['mon'];
$current_year = $todayarray['year'];
$thisday = date("d", $datestamp);
$thismonth = date("m", $datestamp);
$thisyear = date("Y", $datestamp);
//check and use the today date style if day is today
if($thisyear == $current_year){
if($thismonth == $current_month){
if($thisday == $current_day){
$datepreftoday = $list_pref[$mode."_datestyletoday"];
$date = strftime($datepreftoday, $datestamp);
return $date;
}
}
}
//else use default date style
$datepref = $list_pref[$mode."_datestyle"];
$date = strftime($datepref, $datestamp);
return $date;
}
//##### FUNCTIONS BENEATH ARE ONLY USED IN THE ADMIN PAGE
function parse_headerrow_title($title){
global $rs, $list_pref;
$text = "<tr><td colspan='4' class='forumheader'>".$title."</td></tr>";
return $text;
}
}
?>

View File

@@ -0,0 +1,58 @@
<?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.1.1.1 $
| $Date: 2006-12-02 04:35:26 $
| $Author: mcfly_e107 $
+---------------------------------------------------------------+
*/
if (!defined('e107_INIT')) { exit; }
if(!$sql -> db_Select("plugin", "*", "plugin_path = 'list_new' AND plugin_installflag = '1' ")){
return;
}
global $sysprefs, $tp, $eArrayStorage;
$listplugindir = e_PLUGIN."list_new/";
unset($text);
require_once($listplugindir."list_shortcodes.php");
//get language file
$lan_file = $listplugindir."languages/".e_LANGUAGE.".php";
include_once(file_exists($lan_file) ? $lan_file : $listplugindir."languages/English.php");
require_once($listplugindir."list_class.php");
$rc = new listclass;
$list_pref = $rc -> getListPrefs();
$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;
}
}
}
$caption = (isset($list_pref[$mode."_caption"]) && $list_pref[$mode."_caption"] ? $list_pref[$mode."_caption"] : LIST_MENU_1);
$ns -> tablerender($caption, $text, 'list_new');
unset($text);
?>

View File

@@ -0,0 +1,58 @@
<?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.1.1.1 $
| $Date: 2006-12-02 04:35:26 $
| $Author: mcfly_e107 $
+---------------------------------------------------------------+
*/
if (!defined('e107_INIT')) { exit; }
if(!$sql -> db_Select("plugin", "*", "plugin_path = 'list_new' AND plugin_installflag = '1' ")){
return;
}
global $sysprefs, $tp, $eArrayStorage;
$listplugindir = e_PLUGIN."list_new/";
unset($text);
require_once($listplugindir."list_shortcodes.php");
//get language file
$lan_file = $listplugindir."languages/".e_LANGUAGE.".php";
include_once(file_exists($lan_file) ? $lan_file : $listplugindir."languages/English.php");
require_once($listplugindir."list_class.php");
$rc = new listclass;
$list_pref = $rc -> getListPrefs();
$mode = "recent_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;
}
}
}
$caption = (isset($list_pref[$mode."_caption"]) && $list_pref[$mode."_caption"] ? $list_pref[$mode."_caption"] : LIST_MENU_1);
$ns -> tablerender($caption, $text, 'list_recent');
unset($text);
?>

View File

@@ -0,0 +1,38 @@
<?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
*/
?>

View File

@@ -0,0 +1,86 @@
<?php
if (!defined('e107_INIT')) { exit; }
global $sc_style, $list_shortcodes;
$sc_style['LIST_DATE']['pre'] = "";
$sc_style['LIST_DATE']['post'] = " ";
$sc_style['LIST_ICON']['pre'] = "";
$sc_style['LIST_ICON']['post'] = " ";
$sc_style['LIST_HEADING']['pre'] = "";
$sc_style['LIST_HEADING']['post'] = " ";
$sc_style['LIST_AUTHOR']['pre'] = LIST_MENU_2.": ";
$sc_style['LIST_AUTHOR']['post'] = " ";
$sc_style['LIST_CATEGORY']['pre'] = LIST_MENU_4.": ";
$sc_style['LIST_CATEGORY']['post'] = " ";
$sc_style['LIST_INFO']['pre'] = "";
$sc_style['LIST_INFO']['post'] = " ";
//LIST_MENU_NEW TEMPLATE -------------------------------------------------------------------------
$LIST_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>
{LIST_ICON} {LIST_DATE} {LIST_HEADING} {LIST_AUTHOR} {LIST_CATEGORY}
</div>";
$LIST_MENU_NEW_END = "
</div>\n";
//LIST_MENU_RECENT TEMPLATE -------------------------------------------------------------------------
$LIST_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>
{LIST_ICON} {LIST_DATE} {LIST_HEADING} {LIST_AUTHOR} {LIST_CATEGORY}
</div>";
$LIST_MENU_RECENT_END = "
</div>\n";
//PAGE TEMPLATE -------------------------------------------------------------------------
$LIST_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>
{LIST_ICON} {LIST_DATE} {LIST_HEADING} {LIST_AUTHOR} {LIST_CATEGORY} {LIST_INFO}
</div>";
$LIST_PAGE_RECENT_END = "
</div>\n";
//NEW TEMPLATE -------------------------------------------------------------------------
$LIST_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>
{LIST_ICON} {LIST_DATE} {LIST_HEADING} {LIST_AUTHOR} {LIST_CATEGORY} {LIST_INFO}
</div>";
$LIST_PAGE_NEW_END = "
</div>\n";
//MULTI COLOMNS LAYOUT MASTER -----------------------------------------------------------
$LIST_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>";
//TIMELAPSE SELECT -----------------------------------------------------------
$LIST_TIMELAPSE_TABLE = "<div class='forumheader3' style='margin-bottom:20px;'>{LIST_TIMELAPSE}</div>";
?>

View File

@@ -0,0 +1,76 @@
<?php
/*
+---------------------------------------------------------------+
| e107 website system
| code adapted from original by Lolo Irie (lolo_irie@e107coders.org)
|
| <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).
+---------------------------------------------------------------+
*/
if (!defined('e107_INIT')) { exit; }
global $PLUGINS_DIRECTORY;
$lan_file = e_PLUGIN."list_new/languages/".e_LANGUAGE.".php";
include_once(file_exists($lan_file) ? $lan_file : e_PLUGIN."list_new/languages/English.php");
// Plugin info -------------------------------------------------------------------------------------------------------
$eplug_name = LIST_PLUGIN_1;
$eplug_version = "1.0";
$eplug_author = "Eric Vanderfeesten (lisa)";
$eplug_logo = "";
$eplug_url = "http://eindhovenseschool.net";
$eplug_email = "lisa@eindhovenseschool.net";
$eplug_description = LIST_PLUGIN_2;
$eplug_compatible = "e107v0.7+";
$eplug_readme = ""; // leave blank if no readme file
// Name of the plugin's folder -------------------------------------------------------------------------------------
$eplug_folder = "list_new";
// Name of menu item for plugin ----------------------------------------------------------------------------------
$eplug_menu_name = array("list_new_menu.php", "list_recent_menu.php");
// Name of the admin configuration file --------------------------------------------------------------------------
$eplug_conffile = "admin_list_config.php";
// Icon image and caption text ------------------------------------------------------------------------------------
$eplug_icon = $eplug_folder."/icon/list_32.png";
$eplug_icon_small = $eplug_folder."/icon/list_16.png";
$eplug_caption = LIST_PLUGIN_3;
// List of preferences -----------------------------------------------------------------------------------------------
$eplug_prefs = array();
// List of table names -----------------------------------------------------------------------------------------------
$eplug_table_names = "";
// List of sql requests to create tables -----------------------------------------------------------------------------
$eplug_tables = "";
// Create a link in main menu (yes=TRUE, no=FALSE) -------------------------------------------------------------
$eplug_link = TRUE;
$eplug_link_name = LIST_PLUGIN_5;
$eplug_link_url = e_PLUGIN."list_new/list.php";
// Text to display after plugin successfully installed ------------------------------------------------------------------
$eplug_done = LIST_PLUGIN_4;
// upgrading ... //
$upgrade_add_prefs = "";
$upgrade_remove_prefs = "";
$upgrade_alter_tables = "";
$eplug_upgrade_done = "";
?>

View File

@@ -0,0 +1,43 @@
<?php
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;
}
$data = $cobj->getCommentData(intval($arr[7]), '0', $qry);
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'];
}
}
$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 );
}
?>

View File

@@ -0,0 +1,38 @@
<?php
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);
$mp = MPREFIX;
$qry = "SELECT download_id, download_name, download_author, download_datestamp, {$mp}download_category.download_category_id, {$mp}download_category.download_category_name, {$mp}download_category.download_category_class FROM {$mp}download LEFT JOIN {$mp}download_category ON {$mp}download.download_category={$mp}download_category.download_category_id WHERE download_category_class REGEXP '".e_CLASS_REGEXP."' AND download_class REGEXP '".e_CLASS_REGEXP."' AND {$mp}download.download_active != '0' ".$qry." ORDER BY download_datestamp DESC LIMIT 0,".intval($arr[7])." ";
$downloads = $sql -> db_Select_gen($qry);
if($downloads == 0) {
$LIST_DATA = LIST_DOWNLOAD_2;
}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'] : "");
//$AUTHOR = ($arr[3] ? (USERID ? "<a href='".e_BASE."user.php?id.".$row['download_author_id']."'>".$row['download_author']."</a>" : $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 );
}
}
?>

View File

@@ -0,0 +1,34 @@
<?php
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 user_ban='0' AND ";
}else{
$qry = " ";
}
$qry .= " (user_class = '' || user_class REGEXP '".e_CLASS_REGEXP."') ORDER BY user_join DESC LIMIT 0,".intval($arr[7]);
$bullet = $this -> getBullet($arr[6], $mode);
if(!$sql -> db_Select("user", "*", $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 );
}
}
?>

View File

@@ -0,0 +1,62 @@
<?php
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().") ";
}
$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=&quot;(.*?)&quot;>(.*?)<\/a>/si";
$replace[3] = '\\2';
$search[4] = "/\<a href=&#39;(.*?)&#39;>(.*?)<\/a>/si";
$replace[4] = '\\2';
$search[5] = "/\<a href=&#039;(.*?)&#039;>(.*?)<\/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 );
}
}
?>