1
0
mirror of https://github.com/e107inc/e107.git synced 2025-01-16 12:18:39 +01:00

Plugin script tests and PHP8 fixes.

This commit is contained in:
Cameron 2021-01-22 13:44:10 -08:00
parent 4b0edad459
commit acc1a9af0d
62 changed files with 799 additions and 1849 deletions

View File

@ -2367,7 +2367,7 @@ switch ($action)
show_prefs($mailAdmin);
}
break;
/*
case 'maint' :
if (getperms('0'))
{
@ -2380,7 +2380,7 @@ switch ($action)
{
show_maint(TRUE);
}
break;
break;*/
case 'saved' : // Show template emails
case 'sent' :
@ -2653,6 +2653,7 @@ function sendImmediately($id)
//-----------------------------------------------------------
// MAINTENANCE OPTIONS
//-----------------------------------------------------------
/*
function show_maint($debug = FALSE)
{
return;
@ -2680,7 +2681,7 @@ function show_maint($debug = FALSE)
$ns->tablerender(ADLAN_136.SEP.ADLAN_40, $mes->render().$text);
}
*/
/*
function mailout_adminmenu()

View File

@ -815,20 +815,22 @@ class news_shortcodes extends e_shortcode
*/
function sc_news_thumbnail($parm = '') //TODO Add support {NEWSTHUMBNAIL: x=y} format
{
$tmp = $this->handleMultiple($parm,'all');
$newsThumb = $tmp['file'];
if($tmp = $this->handleMultiple($parm,'all'))
{
$newsThumb = $tmp['file'];
}
$class = 'news-thumbnail-'.$tmp['count'];
$class = 'news-thumbnail-'.varset($tmp['count']);
$dimensions = null;
$srcset = null;
$tp = e107::getParser();
if(!$newsThumb && $parm != 'placeholder')
if(!isset($newsThumb) && $parm != 'placeholder')
{
return '';
}
if($vThumb = e107::getParser()->toVideo($newsThumb, array('thumb'=>'src')))
if(isset($newsThumb) && $vThumb = e107::getParser()->toVideo($newsThumb, array('thumb'=>'src')))
{
$src = $vThumb;
$_src = '#';
@ -846,7 +848,7 @@ class news_shortcodes extends e_shortcode
if(isset($parms[2]['legacy']) && $parms[2]['legacy']==true) // Legacy mode - swap out thumbnails for actual images and update paths.
{
if($newsThumb[0] != '{') // Fix old paths.
if($newsThumb[0] !== '{') // Fix old paths.
{
$newsThumb = '{e_IMAGE}newspost_images/'.$newsThumb;
}
@ -862,10 +864,16 @@ class news_shortcodes extends e_shortcode
}
// We store SC path in DB now + BC
$_src = $src = ($newsThumb[0] == '{' || $parms[1] == 'placeholder') ? e107::getParser()->replaceConstants($newsThumb, 'abs') : e_IMAGE_ABS."newspost_images/".$newsThumb;
if(!empty($newsThumb))
{
$_src = $src = (($newsThumb[0] === '{')) || varset($parms[1]) === 'placeholder' ? e107::getParser()->replaceConstants($newsThumb, 'abs') : e_IMAGE_ABS."newspost_images/".$newsThumb;
}
else
{
$src = '';
}
if(!empty($parms[2]) || $parms[1] == 'placeholder')
if(!empty($parms[2]) || varset($parms[1]) === 'placeholder')
{
// $srcset = "srcset='".$tp->thumbSrcSet($src,'all')."' size='100vw' ";
$attr = !empty($parms[2]) ? $parms[2] : null;

View File

@ -356,7 +356,8 @@ class e107
{
self::plugLan($plug_name, '', true); // English/English_front.php
self::plugLan($plug_name, null, true); // English/English.php
self::plugLan($plug_name, null); // English_front.php
// self::plugLan($plug_name, 'front'); // English_front.php
self::plugLan($plug_name, null); // English.php
self::plugLan($plug_name, 'global', true); // English/English_global.php
self::plugLan($plug_name, 'global'); // English_global.php
}
@ -3211,7 +3212,9 @@ class e107
{
$id = $plug_name;
}
$reg_path = 'plugin/'.$plug_name.'/templates/'.$id.($override ? '/ext' : '');
$reg_path = 'plugin/'.$plug_name.'/templates/'.$id;
$reg_path .= ($override) ? '/ext' : '';
$path = self::templatePath($plug_name, $id, $override);
if(ADMIN && E107_DBG_INCLUDES)
@ -3606,16 +3609,22 @@ class e107
* </code>
*
* @param string $plugin plugin name
* @param string $fname filename without the extension part (e.g. 'common')
* @param string|bool|null $fname filename without the extension part (e.g. 'common')
* @param boolean $flat false (default, preferred) Language folder structure; true - prepend Language to file name
* @param boolean $return When true, returns the path, but does not include the file or set the registry.
* @return bool|null
*/
public static function plugLan($plugin, $fname = '', $flat = false)
public static function plugLan($plugin, $fname = '', $flat = false, $returnPath = false)
{
// $cstring = 'pluglan/'.e_LANGUAGE.'_'.$plugin.'_'.$fname.($flat ? '_1' : '_0');
$cstring = 'core/e107/pluglan/'.$plugin.'/'.e_LANGUAGE.'/'.$fname.($flat ? '_1' : '_0');
if(self::getRegistry($cstring))
$cstring = 'core/e107/pluglan/'.$plugin.'/'.e_LANGUAGE.'/';
$cstring .= ($fname === null) ? 'null' : '';
$cstring .= ($fname === true) ? 'true' : '';
$cstring .= is_string($fname) ? $fname : '';
$cstring .= ($flat) ? '/flat' : '/noflat';
if(self::getRegistry($cstring) && ($returnPath === false))
{
return null;
}
@ -3653,6 +3662,11 @@ class e107
$path = e_PLUGIN.$plugin.'/languages/'.$fname.'.php';
}
if($returnPath === true)
{
return $path;
}
if(deftrue('E107_DBG_INCLUDES'))
{
$adminLanguage = self::getPref('adminlanguage');
@ -3666,7 +3680,7 @@ class e107
}
self::setRegistry($cstring, true);
self::setRegistry($cstring, true);
$ret = self::includeLan($path);

View File

@ -1183,8 +1183,11 @@
{
if(E107_DEBUG_LEVEL > 0 && ADMIN)
{
echo "file failed =" . $file . "<br />";
echo "path =" . $path . "<br />";
$mes = __METHOD__." -- File failed: " . $file . "\n";
$mes .= "Path: " . $path . "\n";
$mes .= "Backtrace: ";
$mes .= print_r(debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS), true);
trigger_error($mes, E_USER_NOTICE);
exit();
}
else

View File

@ -33,7 +33,7 @@ class download_request
header("location: " . e_QUERY);
exit();
}
elseif(file_exists(e_DOWNLOAD . e_QUERY)) // 1 - should we allow this?
elseif(file_exists(e_DOWNLOAD . e_QUERY) && !is_dir(e_DOWNLOAD . e_QUERY)) // 1 - should we allow this?
{
e107::getFile()->send(e_DOWNLOAD . e_QUERY);
exit();

View File

@ -709,4 +709,4 @@ new plugin_gallery_admin();
require_once(e_ADMIN . "auth.php");
e107::getAdminUI()->runPage(); //gallery/includes/admin.php is auto-loaded.
require_once(e_ADMIN . "footer.php");
exit;

View File

@ -43,8 +43,10 @@ class gallery_shortcodes extends e_shortcode
$template = e107::getTemplate('gallery', 'gallery', 'cat');
$caption = isset($template['caption']) ? e107::getParser()->toText($template['caption']) : LAN_PLUGIN_GALLERY_TITLE;
$breadcrumb[] = array('text' => $caption, 'url' => e107::getUrl()->create('gallery', $this->var));
if(!empty($var))
{
$breadcrumb[] = array('text' => $caption, 'url' => e107::getUrl()->create('gallery', $this->var));
}
if(vartrue($this->curCat))
{

View File

@ -170,4 +170,4 @@ class gallery
new gallery;
require_once(FOOTERF);
exit;

View File

@ -185,7 +185,7 @@ class gsitemap_ui extends e_admin_ui
$caption = LAN_HELP;
$text = 'Some help text';
return array('caption'=>$caption,'text'=> $text);
// return array('caption'=>$caption,'text'=> $text);
}
@ -636,7 +636,7 @@ new gsitemap_adminArea();
require_once(e_ADMIN."auth.php");
e107::getAdminUI()->runPage();
if(deftrue('e_DEBUG'))
if(deftrue('e_DEBUG_GSITEMAP_ADMIN'))
{
echo "Debug Comparison<hr /> ";
$gsm = new gsitemap;
@ -1032,6 +1032,7 @@ class gsitemap
require_once(e_ADMIN."footer.php");
// loaded automatically.
/*
function admin_config_adminmenu()
{
$action = (e_QUERY) ? e_QUERY : "list";
@ -1049,5 +1050,5 @@ function admin_config_adminmenu()
$var['import']['perm'] = "0";
show_admin_menu(LAN_PLUGIN_GSITEMAP_NAME, $action, $var);
}
}*/

View File

@ -640,5 +640,5 @@ e107::js('hero', 'js/bootstrap-iconpicker.min.js');
require_once(e_ADMIN."footer.php");
exit;

View File

@ -1264,272 +1264,6 @@ require_once(e_ADMIN."auth.php");
e107::getAdminUI()->runPage();
require_once(e_ADMIN."footer.php");
exit;
/*
* Currently unused function - shows available import methods and capabilities
*/
/*
function showStartPage()
{
global $emessage, $frm, $import_class_names, $import_class_support, $db_import_blocks, $import_class_comment;
$frm = e107::getForm();
$text = "
<form method='get' action='".e_SELF."' id='core-import-form'>
<fieldset id='core-import-select-type'>
<legend class='e-hideme'>".'DBLAN_10'."</legend>
".$frm->hidden('mode','main')."
".$frm->hidden('action','import')."
<table class='table adminlist'>
<colgroup>
<col />
<col />
<col />
<col />
<col />
</colgroup>
<thead>
<tr>
<th>".LAN_CONVERT_06."</th>";
foreach($db_import_blocks as $name) // 1 column for each of users, news, forum etc.
{
$text .= "<th class='center'>".$name['message']."</th>";
}
$text.="
<th class='center'>".LAN_OPTIONS."</th>
</tr>
</thead>
<tbody>
<tr>
<td><img src='".e_PLUGIN."import/images/csv.png' alt='' style='float:left;height:32px;width:32px;margin-right:4px'>CSV</td>
<td class='center'>".ADMIN_TRUE_ICON."</td>";
for ($i=0; $i < count($db_import_blocks)-1; $i++)
{
$text .= "<td>&nbsp;</td>";
}
$text .= "<td class='center middle'>".$frm->admin_button('import_type', 'csv', 'other',"Select")."</td></tr>";
foreach ($import_class_names as $k => $title)
{
$iconFile = e_PLUGIN."import/images/".str_replace("_import","",strtolower($k)).".png";
$icon = (file_exists($iconFile)) ? "<img src='{$iconFile}' alt='' style='float:left;height:32px;width:32px;margin-right:4px'>" : "";
$text .= "<!-- $title -->
<tr><td>".$icon.$title."<div class='smalltext'>".$import_class_comment[$k]."</div></td>\n";
foreach($db_import_blocks as $key=>$val)
{
$text .= "<td class='center'>".(in_array($key,$import_class_support[$k]) ? ADMIN_TRUE_ICON : "&nbsp;")."</td>\n";
}
$text .= "
<td class='center middle'>";
$text .= $frm->admin_button('type', $k, 'other',"Select");
// $text .= $frm->admin_button('import_type', $k, 'other',"Select");
$text .= "
</td>
</tr>";
}
$text .= "
</tbody>
</table>
<div class='buttons-bar center'>
".$frm->hidden('trigger_import',1)."
</div>
</fieldset>
</form>";
echo $emessage->render().$text;
// $ns->tablerender(LAN_PLUGIN_IMPORT_NAME, $emessage->render().$text);
}
function showImportOptions($mode='csv')
{
global $text, $emessage, $csv_names, $import_class_names, $e_userclass, $db_import_blocks, $import_class_support, $import_default_prefix;
$frm = e107::getForm();
$ns = e107::getRender();
$mes = e107::getMessage();
if (class_exists($mode))
{
$mes->addDebug("Class Available: ".$mode);
$proObj = new $mode;
if($proObj->init()===FALSE)
{
return;
}
}
$message = "<strong>".LAN_CONVERT_05."</strong>";
$emessage->add($message, E_MESSAGE_WARNING);
$text = "
<form method='post' action='".e_SELF."?import_type=".$_GET['import_type']."'>
<table class='table adminform'>
<colgroup>
<col class='col-label' />
<col class='col-control' />
</colgroup>";
if($mode == "csv")
{
$text .= "
<tr>
<td>".LAN_CONVERT_07."</td>
<td><select name='csv_format' class='tbox'>\n";
foreach ($csv_names as $k => $v)
{
$s = ($current_csv == $k) ? " selected='selected'" : '';
$text .= "<option value='{$k}'{$s}>{$v}</option>\n";
}
$text .= "</select>\n
</td>
</tr>
<tr>
<td>".LAN_CONVERT_36."</td>
<td><input class='tbox' type='text' name='csv_data_file' size='30' value='{$csv_data_file}' maxlength='100' /></td>
</tr>
<tr><td>".LAN_CONVERT_17."
</td>
<td>
<input type='hidden' name='import_source' value='csv' />
<input type='checkbox' name='csv_pw_not_encrypted' value='1'".($csv_pw_not_encrypted ? " checked='checked'" : '')."/>
<span class='smallblacktext'>".LAN_CONVERT_18."</span></td>
</tr>
";
}
elseif(method_exists($proObj,"config"))
{
$ops = $proObj->config();
foreach($ops as $key=>$val)
{
$text .= "<tr>
<td>".$val['caption']."</td>
<td>".$val['html'];
$text .= (vartrue($val['help'])) ? "<div class='field-help'>".$val['help']."</div>" : "";
$text .= "</td>
</tr>\n";
}
if($proObj->sourceType)
{
$text .= "<input type='hidden' name='import_source' value='".$proObj->sourceType."' />\n";
}
}
else
{
$importType = $import_class_names[$mode];
$text .= "
<tr>
<td>$importType ".LAN_CONVERT_19."</td>
<td><input class='tbox' type='text' name='dbParamHost' size='30' value='".(varset($_POST['dbParamHost']) ? $_POST['dbParamHost'] : 'localhost')."' maxlength='100' /></td>
</tr>
<tr>
<td >$importType ".LAN_CONVERT_20."</td>
<td ><input class='tbox' type='text' name='dbParamUsername' size='30' value='".varset($_POST['dbParamUsername'])."' maxlength='100' /></td>
</tr>
<tr>
<td >$importType ".LAN_CONVERT_21."</td>
<td ><input class='tbox' type='text' name='dbParamPassword' size='30' value='".varset($_POST['dbParamPassword'])."' maxlength='100' /></td>
</tr>
<tr>
<td >$importType ".LAN_CONVERT_22."</td>
<td ><input class='tbox' type='text' name='dbParamDatabase' size='30' value='".varset($_POST['dbParamDatabase'])."' maxlength='100' /></td>
</tr>
<tr>
<td >$importType ".LAN_CONVERT_23."</td>
<td ><input class='tbox' type='text' name='dbParamPrefix' size='30' value='".(varset($_POST['dbParamPrefix']) ? $_POST['dbParamPrefix'] : $import_default_prefix[$mode])."' maxlength='100' />
<input type='hidden' name='import_source' value='db' />
</td>
</tr>";
}
if($mode != 'csv')
{
$text .= "
<tr>
<td >$importType ".LAN_CONVERT_24."</td>
<td >";
$defCheck = (count($import_class_support[$mode])==1) ? "checked='checked'" : "";
foreach ($db_import_blocks as $k => $v)
{
if(in_array($k, $import_class_support[$mode])) // display only the options supported.
{
$text .= "<input type='checkbox' name='import_block_{$k}' id='import_block_{$k}' value='1' {$defCheck} />&nbsp;".$v['message'];
$text .= "<br />";
}
}
$text .= "</td></tr>";
}
$text .= "<tr><td>".LAN_CONVERT_38."</td>
<td><input type='checkbox' name='import_delete_existing_data' value='1'".(varset($_POST['import_delete_existing_data']) ? " checked='checked'" : '')."/>
<span class='smallblacktext'>".LAN_CONVERT_39."</span></td>
</tr>";
if(varset($proObj->defaultClass) !== false)
{
$text .= "
<tr><td>".LAN_CONVERT_16."</td>
<td>";
$text .= $e_userclass->vetted_tree('classes_select',array($e_userclass,'checkbox'), varset($_POST['classes_select']),'main,admin,classes,matchclass, no-excludes');
$text .= "</td></tr>";
}
$action = varset($proObj->action,'do_conversion');
$text .= "</table>
<div class='buttons-bar center'>".$frm->admin_button($action,LAN_CONTINUE, 'execute').
$frm->admin_button('back',LAN_CANCEL, 'cancel')."
<input type='hidden' name='db_import_type' value='$mode' />
<input type='hidden' name='import_type' value='".$mode."' />
</div>
</form>";
// Now a little bit of JS to initialise some of the display divs etc
$temp = '';
if(varset($import_source)) { $temp .= "disp('{$import_source}');"; }
if (varset($current_db_type)) $temp .= " flagbits('{$current_db_type}');";
if (varset($temp)) $text .= "<script type=\"text/javascript\"> {$temp}</script>";
$ns -> tablerender(LAN_PLUGIN_IMPORT_NAME.SEP.$importType, $emessage->render().$text);
}
*/
@ -1584,7 +1318,7 @@ function csv_split(&$data,$delim=',',$enveloper='')
/*
function headerjs()
{
@ -1683,7 +1417,7 @@ function headerjs()
return $text;
}
*/

View File

@ -19,7 +19,7 @@
// b) The array index of certain variables
// Array element key defines the function prefix and the class name; value is displayed in drop-down selection box
require_once('import_classes.php');
require_once(__DIR__.'/../import_classes.php');
class PHPFusion_import extends base_import_class
{

View File

@ -19,7 +19,7 @@
// b) The array index of certain variables
// Array element key defines the function prefix and the class name; value is displayed in drop-down selection box
require_once('import_classes.php');
require_once(__DIR__.'/../import_classes.php');
class PHPNuke_import extends base_import_class
{

View File

@ -23,7 +23,7 @@
// require_once('import_classes.php');
// require_once(__DIR__.'/../import_classes.php');
require_once('rss_import_class.php');

View File

@ -25,7 +25,7 @@
//$import_default_prefix['coppermine_import'] = 'CPG_';
require_once('import_classes.php');
require_once(__DIR__.'/../import_classes.php');
class coppermine_import extends base_import_class
{

View File

@ -12,7 +12,7 @@
* b) The array index of certain variables.
*/
require_once('import_classes.php');
require_once(__DIR__.'/../import_classes.php');
/**
* Class drupal_import.

View File

@ -26,7 +26,7 @@
//$import_default_prefix['e107_import'] = 'e107_';
require_once('import_classes.php');
require_once(__DIR__.'/../import_classes.php');
class e107_import extends base_import_class
{

View File

@ -13,7 +13,7 @@
//$import_class_support['html_import'] = array('news','page');
//$import_default_prefix['html_import'] = '';
require_once('import_classes.php');
require_once(__DIR__.'/../import_classes.php');
class html_import extends base_import_class
{

View File

@ -21,7 +21,7 @@
// Array element key defines the function prefix and the class name; value is displayed in drop-down selection box
// Module based on ikonboard version current about September 2007 - may well support other versions
require_once('import_classes.php');
require_once(__DIR__.'/../import_classes.php');
class ikonboard_import extends base_import_class
{

View File

@ -25,7 +25,7 @@
// Mambo and joomla have the same DB format apart from the default prefix - 'jos_' for Joomla
require_once('import_classes.php');
require_once(__DIR__.'/../import_classes.php');
class joomla_import extends base_import_class
{

View File

@ -12,7 +12,7 @@
* $Author: secretr $
*/
// require_once('import_classes.php');
// require_once(__DIR__.'/../import_classes.php');
require_once('rss_import_class.php');
//$import_class_names['livejournal_import'] = 'LiveJournal';

View File

@ -22,7 +22,7 @@
// Mambo and joomla have the same DB format apart from the default prefix - 'jos_' for Joomla
require_once('import_classes.php');
require_once(__DIR__.'/../import_classes.php');
class mambo_import extends base_import_class
{

View File

@ -14,7 +14,7 @@
* $Author$
*/
require_once('import_classes.php');
require_once(__DIR__.'/../import_classes.php');
class phpbb3_import extends base_import_class
{

View File

@ -23,7 +23,7 @@
require_once('import_classes.php');
require_once(__DIR__.'/../import_classes.php');
class rss_import extends base_import_class
{

View File

@ -9,7 +9,7 @@
*/
require_once('import_classes.php');
require_once(__DIR__.'/../import_classes.php');
class smf_import extends base_import_class
{

View File

@ -9,7 +9,7 @@
*/
require_once('import_classes.php');
require_once(__DIR__.'/../import_classes.php');
/**
* @usage replace 'template' with the name of the other cms and rename this file.

View File

@ -26,7 +26,7 @@
//$import_class_support['wordpress_import'] = array('users','news','page','links');
//$import_default_prefix['wordpress_import'] = 'wp_';
require_once('import_classes.php');
require_once(__DIR__.'/../import_classes.php');
class wordpress_import extends base_import_class
{

View File

@ -9,7 +9,7 @@
*/
require_once('import_classes.php');
require_once(__DIR__.'/../import_classes.php');
/**
* @usage replace 'template' with the name of the other cms and rename this file.

View File

@ -191,7 +191,7 @@ require_once(e_ADMIN."auth.php");
e107::getAdminUI()->runPage();
require_once(e_ADMIN."footer.php");
exit;

View File

@ -24,7 +24,7 @@ class list_admin
/**
* constructor
*
* @param object $parent the parent object
* @param list_admin_class $parent the parent object
* @return void
*
*/
@ -81,7 +81,6 @@ class list_admin
*/
function display()
{
global $rs;
$text = $this->parseTemplate('ADMIN_START');
@ -104,7 +103,8 @@ class list_admin
*/
function parse_global_options($type)
{
global $rs;
$frm = e107::getForm();
$fl = e107::getFile();
$text = '';
@ -117,7 +117,10 @@ class list_admin
$this->row['FIELD'] = "";
for($i=0, $iMax = count($this->parent->sections); $i< $iMax; $i++)
{
$this->row['FIELD'] .= $rs->form_checkbox($this->parent->sections[$i]."_".$type."_display", 1, (vartrue($this->parent->list_pref[$this->parent->sections[$i]."_".$type."_display"]) ? "1" : "0"))." ".$this->parent->titles[$i]."<br />";
// form_checkbox($form_name, $form_value, $form_checked = 0, $form_tooltip = '', $form_js = '')
$this->row['FIELD'] .= $frm->checkbox($this->parent->sections[$i]."_".$type."_display", 1, (vartrue($this->parent->list_pref[$this->parent->sections[$i]."_".$type."_display"]) ? "1" : "0"))." ".$this->parent->titles[$i]."<br />";
}
$text .= $this->parseTemplate('TOPIC_ROW');
@ -129,7 +132,7 @@ class list_admin
$this->row['FIELD'] = "";
for($i=0, $iMax = count($this->parent->sections); $i< $iMax; $i++)
{
$this->row['FIELD'] .= $rs->form_checkbox($this->parent->sections[$i]."_".$type."_open", 1, (vartrue($this->parent->list_pref[$this->parent->sections[$i]."_".$type."_open"]) ? "1" : "0"))." ".$this->parent->titles[$i]."<br />";
$this->row['FIELD'] .= $frm->checkbox($this->parent->sections[$i]."_".$type."_open", 1, (vartrue($this->parent->list_pref[$this->parent->sections[$i]."_".$type."_open"]) ? "1" : "0"))." ".$this->parent->titles[$i]."<br />";
}
$text .= $this->parseTemplate('TOPIC_ROW');
@ -141,7 +144,7 @@ class list_admin
$this->row['FIELD'] = "";
for($i=0, $iMax = count($this->parent->sections); $i< $iMax; $i++)
{
$this->row['FIELD'] .= $rs->form_checkbox($this->parent->sections[$i]."_".$type."_author", 1, (vartrue($this->parent->list_pref[$this->parent->sections[$i]."_".$type."_author"]) ? "1" : "0"))." ".$this->parent->titles[$i]."<br />";
$this->row['FIELD'] .= $frm->checkbox($this->parent->sections[$i]."_".$type."_author", 1, (vartrue($this->parent->list_pref[$this->parent->sections[$i]."_".$type."_author"]) ? "1" : "0"))." ".$this->parent->titles[$i]."<br />";
}
$text .= $this->parseTemplate('TOPIC_ROW');
@ -153,7 +156,7 @@ class list_admin
$this->row['CONTID'] = "list-new-{$type}-expandable-category";
for($i=0, $iMax = count($this->parent->sections); $i< $iMax; $i++)
{
$this->row['FIELD'] .= $rs->form_checkbox($this->parent->sections[$i]."_".$type."_category", 1, (vartrue($this->parent->list_pref[$this->parent->sections[$i]."_".$type."_category"]) ? "1" : "0"))." ".$this->parent->titles[$i]."<br />";
$this->row['FIELD'] .= $frm->checkbox($this->parent->sections[$i]."_".$type."_category", 1, (vartrue($this->parent->list_pref[$this->parent->sections[$i]."_".$type."_category"]) ? "1" : "0"))." ".$this->parent->titles[$i]."<br />";
}
$text .= $this->parseTemplate('TOPIC_ROW');
@ -165,7 +168,7 @@ class list_admin
$this->row['CONTID'] = "list-new-{$type}-expandable-date";
for($i=0, $iMax = count($this->parent->sections); $i< $iMax; $i++)
{
$this->row['FIELD'] .= $rs->form_checkbox($this->parent->sections[$i]."_".$type."_date", 1, (vartrue($this->parent->list_pref[$this->parent->sections[$i]."_".$type."_date"]) ? "1" : "0"))." ".$this->parent->titles[$i]."<br />";
$this->row['FIELD'] .= $frm->checkbox($this->parent->sections[$i]."_".$type."_date", 1, (vartrue($this->parent->list_pref[$this->parent->sections[$i]."_".$type."_date"]) ? "1" : "0"))." ".$this->parent->titles[$i]."<br />";
}
$text .= $this->parseTemplate('TOPIC_ROW');
@ -176,6 +179,7 @@ class list_admin
$this->row['CONTID'] = "list-new-{$type}-expandable-icon";
$this->row['FIELD'] = $this->parseTemplate('FIELD_TABLE_START');
$iconlist = $fl->get_files($this->parent->plugin_dir."images/");
$frm = e107::getForm();
for($i=0, $iMax = count($this->parent->sections); $i< $iMax; $i++)
@ -186,24 +190,16 @@ class list_admin
$this->row['FIELD_TITLE'] = $this->parent->titles[$i];
$this->row['FIELD_ITEM'] = $frm->iconpicker($name,$curVal, LAN_SELECT); // TODO: Is this a reasonable label to use? Might not be used
// $this->row['FIELD_ITEM'] = $frm->iconpicker($this->parent->sections[$i]."_".$type."_icon",$this->parent->list_pref[$this->parent->sections[$i]."_".$type."_icon"]).
// $this->row['FIELD_ITEM'] = $rs->form_text($this->parent->sections[$i]."_".$type."_icon", 15, $this->parent->list_pref[$this->parent->sections[$i]."_".$type."_icon"], 100)."
// <input type='button' style='cursor:pointer' size='30' value='".LIST_ADMIN_12."' onclick=\"e107Helper.toggle('div_".$this->parent->sections[$i]."_".$type."_icon'); return false;\" />
// $this->row['FIELD_ITEM'] .= div id='div_".$this->parent->sections[$i]."_".$type."_icon' style='display:none;'>";
// foreach($iconlist as $icon)
// {
// $this->row['FIELD_ITEM'] .= "<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']."' alt='' /></a> ";
// }
// $this->row['FIELD_ITEM'] .= "</div>";
$this->row['FIELD'] .= $this->parseTemplate('FIELD_TABLE');
}
$this->row['FIELD'] .= $this->parseTemplate('FIELD_TABLE_END');
$text .= $this->parseTemplate('TOPIC_ROW');
//amount
//amount
$maxitems_amount = "50";
$this->row['TOPIC'] = LIST_ADMIN_SECT_16;
$this->row['HEADING'] = LIST_ADMIN_SECT_17;
@ -213,12 +209,12 @@ class list_admin
for($i=0, $iMax = count($this->parent->sections); $i< $iMax; $i++)
{
$this->row['FIELD_TITLE'] = $this->parent->titles[$i];
$this->row['FIELD_ITEM'] = $rs->form_select_open($this->parent->sections[$i]."_".$type."_amount");
$this->row['FIELD_ITEM'] = $frm->open($this->parent->sections[$i]."_".$type."_amount");
for($a=1; $a<=$maxitems_amount; $a++)
{
$this->row['FIELD_ITEM'] .= ($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_ITEM'] .= ($this->parent->list_pref[$this->parent->sections[$i]."_".$type."_amount"] == $a ? $frm->option($a, $a, 1) : $frm->option($a, $a, 0));
}
$this->row['FIELD_ITEM'] .= $rs->form_select_close();
$this->row['FIELD_ITEM'] .= $frm->close();
$this->row['FIELD'] .= $this->parseTemplate('FIELD_TABLE');
}
$this->row['FIELD'] .= $this->parseTemplate('FIELD_TABLE_END');
@ -234,17 +230,20 @@ class list_admin
for($i=0, $iMax = count($this->parent->sections); $i< $iMax; $i++)
{
$this->row['FIELD_TITLE'] = $this->parent->titles[$i];
$this->row['FIELD_ITEM'] = $rs->form_select_open($this->parent->sections[$i]."_".$type."_order");
$this->row['FIELD_ITEM'] = $frm->open($this->parent->sections[$i]."_".$type."_order");
for($a=1; $a<=$max; $a++)
{
$this->row['FIELD_ITEM'] .= ($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_ITEM'] .= ($this->parent->list_pref[$this->parent->sections[$i]."_".$type."_order"] == $a ? $frm->option($a, $a, 1) : $frm->option($a, $a, 0));
}
$this->row['FIELD_ITEM'] .= $rs->form_select_close();
$this->row['FIELD_ITEM'] .= $frm->close();
$this->row['FIELD'] .= $this->parseTemplate('FIELD_TABLE');
}
$this->row['FIELD'] .= $this->parseTemplate('FIELD_TABLE_END');
$text .= $this->parseTemplate('TOPIC_ROW');
// form_text($form_name, $form_size, $form_value, $form_maxlength = FALSE, $form_class = 'tbox form-control', $form_readonly = '', $form_tooltip = '', $form_js = '') {
// text($name, $value = '', $maxlength = 80, $options= null)
//caption
$this->row['TOPIC'] = LIST_ADMIN_SECT_25;
$this->row['HEADING'] = LIST_ADMIN_SECT_26;
@ -254,7 +253,7 @@ class list_admin
for($i=0, $iMax = count($this->parent->sections); $i< $iMax; $i++)
{
$this->row['FIELD_TITLE'] = $this->parent->titles[$i];
$this->row['FIELD_ITEM'] = $rs->form_text($this->parent->sections[$i]."_".$type."_caption", 30, e107::getParser()->toHTML($this->parent->list_pref[$this->parent->sections[$i]."_".$type."_caption"],"","defs"), "50", "tbox");
$this->row['FIELD_ITEM'] = $frm->text($this->parent->sections[$i]."_".$type."_caption", e107::getParser()->toHTML($this->parent->list_pref[$this->parent->sections[$i]."_".$type."_caption"],"","defs"), 50);
$this->row['FIELD'] .= $this->parseTemplate('FIELD_TABLE');
}
$this->row['FIELD'] .= $this->parseTemplate('FIELD_TABLE_END');
@ -274,7 +273,12 @@ class list_admin
*/
function parse_menu_options($type)
{
global $rs;
$frm = e107::getForm();
// form_radio($form_name, $form_value, $form_checked = 0, $form_tooltip = '', $form_js = '')
// radio($name, $value, $checked = false, $options = null)
$tp = e107::getParser();
$this->row['ID'] = "list-new-".str_replace('_', '-', $type);
@ -288,7 +292,7 @@ class list_admin
$this->row['HEADING'] = LIST_ADMIN_LAN_3;
$this->row['HELP'] = defset('LIST_ADMIN_LAN_4');
$this->row['CONTID'] = "list-new-menu-{$type}-expandable-caption";
$this->row['FIELD'] = $rs->form_text($type."_caption", "30", $tp->toHTML($this->parent->list_pref[$type."_caption"],"","defs"), "50", "tbox");
$this->row['FIELD'] = $frm->text($type."_caption", $tp->toHTML($this->parent->list_pref[$type."_caption"],"","defs"), 50);
$text .= $this->parseTemplate('TOPIC_ROW');
//menu preference : icon : use
@ -297,8 +301,8 @@ class list_admin
$this->row['HELP'] = defset('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."
".$frm->radio($type."_icon_use", "1", ($this->parent->list_pref[$type."_icon_use"] ? "1" : "0")).LIST_ADMIN_7."
".$frm->radio($type."_icon_use", "0", ($this->parent->list_pref[$type."_icon_use"] ? "0" : "1")).LIST_ADMIN_8."
";
$text .= $this->parseTemplate('TOPIC_ROW');
@ -308,8 +312,8 @@ class list_admin
$this->row['HELP'] = defset('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."
".$frm->radio($type."_icon_default", "1", ($this->parent->list_pref[$type."_icon_default"] ? "1" : "0")).LIST_ADMIN_7."
".$frm->radio($type."_icon_default", "0", ($this->parent->list_pref[$type."_icon_default"] ? "0" : "1")).LIST_ADMIN_8."
";
$text .= $this->parseTemplate('TOPIC_ROW');
@ -318,7 +322,7 @@ class list_admin
$this->row['HEADING'] = LIST_ADMIN_LAN_9;
$this->row['HELP'] = defset('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");
$this->row['FIELD'] = $frm->text($type."_char_heading", $this->parent->list_pref[$type."_char_heading"], 3);
$text .= $this->parseTemplate('TOPIC_ROW');
//menu preference : postfix
@ -326,7 +330,7 @@ class list_admin
$this->row['HEADING'] = LIST_ADMIN_LAN_12;
$this->row['HELP'] = defset('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");
$this->row['FIELD'] = $frm->text($type."_char_postfix", $this->parent->list_pref[$type."_char_postfix"], 3);
$text .= $this->parseTemplate('TOPIC_ROW');
//menu preference : date
@ -334,7 +338,7 @@ class list_admin
$this->row['HEADING'] = LIST_ADMIN_LAN_15;
$this->row['HELP'] = defset('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");
$this->row['FIELD'] = $frm->text($type."_datestyle", $this->parent->list_pref[$type."_datestyle"], 50);
$text .= $this->parseTemplate('TOPIC_ROW');
//menu preference : date today
@ -342,7 +346,7 @@ class list_admin
$this->row['HEADING'] = LIST_ADMIN_LAN_18;
$this->row['HELP'] = defset('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");
$this->row['FIELD'] = $frm->text($type."_datestyletoday",$this->parent->list_pref[$type."_datestyletoday"], 50);
$text .= $this->parseTemplate('TOPIC_ROW');
//menu preference : show empty
@ -351,8 +355,8 @@ class list_admin
$this->row['HELP'] = defset('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."
".$frm->radio($type."_showempty", "1", ($this->parent->list_pref[$type."_showempty"] ? "1" : "0")).LIST_ADMIN_7."
".$frm->radio($type."_showempty", "0", ($this->parent->list_pref[$type."_showempty"] ? "0" : "1")).LIST_ADMIN_8."
";
$text .= $this->parseTemplate('TOPIC_ROW');
@ -362,8 +366,8 @@ class list_admin
$this->row['HELP'] = defset('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."
".$frm->radio($type."_openifrecords", "1", ($this->parent->list_pref[$type."_openifrecords"] ? "1" : "0")).LIST_ADMIN_7."
".$frm->radio($type."_openifrecords", "0", ($this->parent->list_pref[$type."_openifrecords"] ? "0" : "1")).LIST_ADMIN_8."
";
$text .= $this->parseTemplate('TOPIC_ROW');
@ -382,7 +386,7 @@ class list_admin
*/
function parse_page_options($type)
{
global $rs;
$frm = e107::getForm();
$tp = e107::getParser();
$display = ($type == "recent_page" ? "display:none;" : '');
@ -398,7 +402,7 @@ class list_admin
$this->row['HEADING'] = LIST_ADMIN_LAN_3;
$this->row['HELP'] = defset('LIST_ADMIN_LAN_4');
$this->row['CONTID'] = "list-new-page-{$type}-expandable-caption";
$this->row['FIELD'] = $rs->form_text($type."_caption", "30", $tp->toHTML($this->parent->list_pref[$type."_caption"],"","defs"), "50", "tbox");
$this->row['FIELD'] = $frm->text($type."_caption", $tp->toHTML($this->parent->list_pref[$type."_caption"],"","defs"), 50);
$text .= $this->parseTemplate('TOPIC_ROW');
//page preference : icon : use
@ -407,8 +411,8 @@ class list_admin
$this->row['HELP'] = defset('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."
".$frm->radio($type."_icon_use", "1", ($this->parent->list_pref[$type."_icon_use"] ? "1" : "0")).LIST_ADMIN_7."
".$frm->radio($type."_icon_use", "0", ($this->parent->list_pref[$type."_icon_use"] ? "0" : "1")).LIST_ADMIN_8."
";
$text .= $this->parseTemplate('TOPIC_ROW');
@ -418,8 +422,8 @@ class list_admin
$this->row['HELP'] = defset('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."
".$frm->radio($type."_icon_default", "1", ($this->parent->list_pref[$type."_icon_default"] ? "1" : "0")).LIST_ADMIN_7."
".$frm->radio($type."_icon_default", "0", ($this->parent->list_pref[$type."_icon_default"] ? "0" : "1")).LIST_ADMIN_8."
";
$text .= $this->parseTemplate('TOPIC_ROW');
@ -428,7 +432,7 @@ class list_admin
$this->row['HEADING'] = LIST_ADMIN_LAN_9;
$this->row['HELP'] = defset('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");
$this->row['FIELD'] = $frm->text($type."_char_heading", $this->parent->list_pref[$type."_char_heading"], 3);
$text .= $this->parseTemplate('TOPIC_ROW');
//page preference : postfix
@ -436,7 +440,7 @@ class list_admin
$this->row['HEADING'] = LIST_ADMIN_LAN_12;
$this->row['HELP'] = defset('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");
$this->row['FIELD'] = $frm->text($type."_char_postfix", $this->parent->list_pref[$type."_char_postfix"], 3);
$text .= $this->parseTemplate('TOPIC_ROW');
//page preference : date
@ -444,7 +448,7 @@ class list_admin
$this->row['HEADING'] = LIST_ADMIN_LAN_15;
$this->row['HELP'] = defset('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");
$this->row['FIELD'] = $frm->text($type."_datestyle", $this->parent->list_pref[$type."_datestyle"], 50);
$text .= $this->parseTemplate('TOPIC_ROW');
//page preference : date today
@ -452,7 +456,7 @@ class list_admin
$this->row['HEADING'] = LIST_ADMIN_LAN_18;
$this->row['HELP'] = defset('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");
$this->row['FIELD'] = $frm->text($type."_datestyletoday", $this->parent->list_pref[$type."_datestyletoday"], 50);
$text .= $this->parseTemplate('TOPIC_ROW');
//page preference : show empty
@ -461,8 +465,8 @@ class list_admin
$this->row['HELP'] = defset('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."
".$frm->radio($type."_showempty", "1", ($this->parent->list_pref[$type."_showempty"] ? "1" : "0")).LIST_ADMIN_7."
".$frm->radio($type."_showempty", "0", ($this->parent->list_pref[$type."_showempty"] ? "0" : "1")).LIST_ADMIN_8."
";
$text .= $this->parseTemplate('TOPIC_ROW');
@ -471,20 +475,22 @@ class list_admin
$this->row['HEADING'] = LIST_ADMIN_LAN_21;
$this->row['HELP'] = defset('LIST_ADMIN_LAN_22');
$this->row['CONTID'] = "list-new-page-{$type}-expandable-colomn";
$this->row['FIELD'] = $rs->form_select_open($type."_colomn");
$this->row['FIELD'] = $frm->open($type."_colomn");
for($a=1, $aMax = count($this->parent->sections); $a<= $aMax; $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'] .= ($this->parent->list_pref[$type."_colomn"] == $a ? $frm->option($a, $a, 1) : $frm->option($a, $a, 0));
}
$this->row['FIELD'] .= $rs->form_select_close();
$this->row['FIELD'] .= $frm->close();
$text .= $this->parseTemplate('TOPIC_ROW');
// form_textarea($form_name, $form_columns, $form_rows, $form_value, $form_js = '',
// textarea($name, $value, $rows = 10, $cols = 80, $options = null,
//page preference : welcome text
$this->row['TOPIC'] = LIST_ADMIN_LAN_23;
$this->row['HEADING'] = LIST_ADMIN_LAN_24;
$this->row['HELP'] = defset('LIST_ADMIN_LAN_25');
$this->row['CONTID'] = "list-new-page-{$type}-expandable-wtext";
$this->row['FIELD'] = $rs->form_textarea($type."_welcometext", "50", "5", $tp->toHTML($this->parent->list_pref[$type."_welcometext"],"","defs"), "", "tbox");
$this->row['FIELD'] = $frm->textarea($type."_welcometext", $tp->toHTML($this->parent->list_pref[$type."_welcometext"],"","defs"), 5, 50);
$text .= $this->parseTemplate('TOPIC_ROW');
if($type == "new_page")
@ -495,8 +501,8 @@ class list_admin
$this->row['HELP'] = defset('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."
".$frm->radio($type."_timelapse", "1", ($this->parent->list_pref[$type."_timelapse"] ? "1" : "0")).LIST_ADMIN_7."
".$frm->radio($type."_timelapse", "0", ($this->parent->list_pref[$type."_timelapse"] ? "0" : "1")).LIST_ADMIN_8."
";
$text .= $this->parseTemplate('TOPIC_ROW');
@ -505,7 +511,7 @@ class list_admin
$this->row['HEADING'] = LIST_ADMIN_LAN_33;
$this->row['HELP'] = defset('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;
$this->row['FIELD'] = $frm->text($type."_timelapse_days", $this->parent->list_pref[$type."_timelapse_days"],3)." ".LIST_ADMIN_LAN_35;
$text .= $this->parseTemplate('TOPIC_ROW');
}
@ -515,8 +521,8 @@ class list_admin
$this->row['HELP'] = defset('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."
".$frm->radio($type."_openifrecords", "1", ($this->parent->list_pref[$type."_openifrecords"] ? "1" : "0")).LIST_ADMIN_7."
".$frm->radio($type."_openifrecords", "0", ($this->parent->list_pref[$type."_openifrecords"] ? "0" : "1")).LIST_ADMIN_8."
";
$text .= $this->parseTemplate('TOPIC_ROW');
@ -536,11 +542,13 @@ class list_admin
*/
function parseTemplate($template)
{
$text = preg_replace_callback( '/\{(.*?)\}/', function($matches) {
return($this->row[$matches[1]]);
}, $this->parent->template[$template]);
if(empty($this->parent->template[$template]))
{
return null;
}
return e107::getParser()->parseTemplate($this->parent->template[$template], false, $this->row);
return $text;
//return preg_replace("/\{(.*?)\}/e", '$this->row[\'\1\']', $this->parent->template[$template]);
}
@ -552,7 +560,7 @@ class list_admin
*/
function pref_submit()
{
global $rs;
$frm = e107::getForm();
$this->row['TOPIC'] = LIST_ADMIN_11;

View File

@ -28,7 +28,7 @@ class listclass
var $defaultArray;
var $sections;
var $titles;
var $content_types;
private $content_types= array();
var $content_name;
var $list_pref;
var $mode;
@ -92,7 +92,7 @@ class listclass
{
//for each call to the template, provide the correct data set through load_globals
//list_shortcodes::load_globals();
return e107::getParser()->parseTemplate($this->template[$template], true, $this->shortcodes);
return e107::getParser()->parseTemplate(varset($this->template[$template]), true, $this->shortcodes);
}
/**
@ -263,15 +263,15 @@ class listclass
*/
function getSections()
{
global $pref;
$list = e107::getPref('e_list_list', array());
$this->getDefaultSections();
if(is_array($pref['e_list_list']))
if(!empty($list))
{
foreach($pref['e_list_list'] as $file)
foreach($list as $file)
{
if ($plugin_installed = isset($pref['plug_installed'][$file]))
if ($plugin_installed = e107::isInstalled($file))
{
if($file == "content")
{
@ -296,7 +296,8 @@ class listclass
*/
function getDefaultPrefs()
{
global $pref;
$pref = e107::getPref();
$prf = array();
//section preferences

View File

@ -421,15 +421,98 @@ e107::css('inline', 'td.last.options { padding-right:20px } ');
return $this->export('export');
}
function runExport()
{
if (isset($_POST['create_export']) )
{
$export_type = $_POST['export_type'];
$export_month = $_POST['export_month'];
$export_year = $_POST['export_year'];
$export_day = $_POST['export_day'];
$export_date = $_POST['export_date'];
$export2_date = $_POST['export2_date'];
$first_date = 0;
$last_date = 0;
$date_error = FALSE;
if ($export_type == 'page')
{
switch ($export_date)
{
case '1' : // Single day
$first_date = gmmktime(0,0,0,$export_month,$export_day,$export_year);
$last_date = $first_date+86399;
$export_filter = " `log_id`='".date("Y-m-j",$first_date)."'";
break;
case '2' : // Daily for a month
$first_date = gmmktime(0,0,0,$export_month,1,$export_year);
$last_date = gmmktime(0,0,0,$export_month+1,1,$export_year) - 1;
$export_filter = " LEFT(`log_id`,8)='".gmstrftime("%Y-%m-",$first_date)."'";
break;
case '3' : // Monthly for a Year
$first_date = gmmktime(0,0,0,1,1,$export_year);
$last_date = gmmktime(0,0,0,1,1,$export_year+1) - 1;
$export_filter = " LENGTH(`log_id`)=7 AND LEFT(`log_id`,5)='".gmstrftime("%Y-",$first_date)."'";
break;
case '4' : // Accumulated
case '5' :
$export_filter = "`log_id`='pageTotal'";
$date_error = 'ignore';
break;
}
}
else
{ // Calculate strings for non-page sources
$prefix_len = 0;
$export_date = $export2_date;
if (isset($stats_list[$export_type]))
{
$prefix_len = strlen($export_type) + 1;
switch ($export2_date)
{
case '3' : // Monthly for a Year
if ($prefix_len > 0)
{
$first_date = gmmktime(0,0,0,1,1,$export_year);
$last_date = gmmktime(0,0,0,1,1,$export_year+1) - 1;
$export_filter = " LENGTH(`log_id`)='".($prefix_len + 7)."' AND LEFT(`log_id`,".($prefix_len + 5).")='".$export_type.":".gmstrftime("%Y-",$first_date)."'";
}
break;
case '4' : // Accumulated
$export_filter = " `log_id`='".$export_type."'";
$date_error = 'ignore';
break;
}
}
else
{
$message = ADSTAT_LAN_54;
}
}
if (($date_error != 'ignore') && (($first_date == 0) || ($last_date == 0) || $date_error))
{
$message = ADSTAT_LAN_47;
}
}
}
private function export($action)
{
$this->runExport();
global $export_type, $export_date, $export2_date, $export_day, $export_month, $export_year, $separator_list,
$export_char, $quote_list, $export_quote, $export_filter;
$frm = e107::getForm();
$sql = e107::getDb();
$text = "<div style='text-align:center'>";
$text = "<div>";
if ($action == 'export')
{
@ -442,8 +525,8 @@ e107::css('inline', 'td.last.options { padding-right:20px } ');
$text .= "<table class='table adminform'>
<colgroup>
<col style='width:50%' />
<col style='width:50%' />
<col style='width:25%' />
<col />
</colgroup>
";
@ -471,8 +554,8 @@ e107::css('inline', 'td.last.options { padding-right:20px } ');
// Period selection type for non-page data
$text .= "
<select class='tbox' name='export2_date' id='export2_date' onchange=\"setdatebox(this.value);\" ".($export_type=='page' ? "style='display:none'" : "").">\n
<option value='3'".($export2_date==3 ? " selected='selected'" : "").">".ADSTAT_LAN_44."</option>\n
<option value='4'".($export2_date==4 ? " selected='selected'" : "").">".ADSTAT_LAN_45."</option>\n
<option value='3' ".($export2_date==3 ? " selected='selected'" : "").">".ADSTAT_LAN_44."</option>\n
<option value='4' ".($export2_date==4 ? " selected='selected'" : "").">".ADSTAT_LAN_45."</option>\n
</select>";
$text .= "</td></tr>";
@ -530,7 +613,7 @@ e107::css('inline', 'td.last.options { padding-right:20px } ');
foreach ($quote_list as $k=>$v)
{
$selected = $export_quote == $k ? " selected='selected'" : "";
$text .= "<option value='{$k}'".$selected.">{$v}</option>\n";
$text .= "<option value='{$k}' ".$selected.">{$v}</option>\n";
}
$text .= "</select>\n</td></tr>";
@ -808,7 +891,7 @@ e107::css('inline', 'td.last.options { padding-right:20px } ');
for ($i = 1; $i < 13; $i++)
{
$selected = $match_month == $i ? " selected='selected'" : "";
$text .= "<option value='{$i}'".$selected.">".nl_langinfo(constant('MON_'.$i))."</option>\n";
$text .= "<option value='{$i}' ".$selected.">".nl_langinfo(constant('MON_'.$i))."</option>\n";
}
$text .= "</select>\n&nbsp;&nbsp;&nbsp;";
@ -819,7 +902,7 @@ e107::css('inline', 'td.last.options { padding-right:20px } ');
for ($i = $this_year; $i > $this_year - 6; $i--)
{
$selected = ($this_year - 2) == $i ? " selected='selected'" : "";
$text .= "<option value='{$i}'{$selected}>{$i}</option>\n";
$text .= "<option value='{$i}' {$selected}>{$i}</option>\n";
}
$text .= "</select>\n</td></tr>";
@ -882,7 +965,7 @@ e107::css('inline', 'td.last.options { padding-right:20px } ');
public function prefsPage()
{
global $pref;
$pref = e107::getPref();
$frm = e107::getForm();
@ -896,31 +979,31 @@ e107::css('inline', 'td.last.options { padding-right:20px } ');
<tr>
<td>".ADSTAT_LAN_4."</td>
<td>".$frm->radio_switch('statActivate', $pref['statActivate'])."</td>
<td>".$frm->radio_switch('statActivate', varset($pref['statActivate']))."</td>
</tr>
<tr>
<td>".ADSTAT_LAN_18."</td>
<td>".r_userclass("statUserclass", $pref['statUserclass'],'off','public, member, admin, classes')."</td>
<td>".r_userclass("statUserclass", varset($pref['statUserclass']),'off','public, member, admin, classes')."</td>
</tr>
<tr>
<td>".ADSTAT_LAN_20."</td>
<td>".$frm->radio_switch('statCountAdmin', $pref['statCountAdmin'])."</td>
<td>".$frm->radio_switch('statCountAdmin', varset($pref['statCountAdmin']))."</td>
</tr>
<tr>
<td>".ADSTAT_LAN_21."</td>
<td><input class='tbox' type='text' name='statDisplayNumber' size='8' value='".$pref['statDisplayNumber']."' maxlength='3' /></td>
<td><input class='tbox' type='text' name='statDisplayNumber' size='8' value='".varset($pref['statDisplayNumber'])."' maxlength='3' /></td>
</tr>
<tr>
<td>".ADSTAT_LAN_5."</td>
<td>
".$this->gen_select(ADSTAT_LAN_6, 'statBrowser',$pref['statBrowser'])
.$this->gen_select(ADSTAT_LAN_7, 'statOs',$pref['statOs'])
.$this->gen_select(ADSTAT_LAN_8, 'statScreen',$pref['statScreen'])
.$this->gen_select(ADSTAT_LAN_9, 'statDomain',$pref['statDomain'])
.$this->gen_select(ADSTAT_LAN_10, 'statRefer',$pref['statRefer'])
.$this->gen_select(ADSTAT_LAN_11, 'statQuery',$pref['statQuery'])
".$this->gen_select(ADSTAT_LAN_6, 'statBrowser', varset($pref['statBrowser']))
.$this->gen_select(ADSTAT_LAN_7, 'statOs', varset($pref['statOs']))
.$this->gen_select(ADSTAT_LAN_8, 'statScreen',varset($pref['statScreen']))
.$this->gen_select(ADSTAT_LAN_9, 'statDomain',varset($pref['statDomain']))
.$this->gen_select(ADSTAT_LAN_10, 'statRefer',varset($pref['statRefer']))
.$this->gen_select(ADSTAT_LAN_11, 'statQuery',varset($pref['statQuery']))
."<div class='clearfix' style='padding-bottom: 4px'><span class='pull-left float-left'>".ADSTAT_LAN_19."</span><span class='pull-right float-right'>
".$frm->radio_switch('statRecent', $pref['statRecent'])."</span></div>
".$frm->radio_switch('statRecent', varset($pref['statRecent']))."</span></div>
</td>
</tr>
@ -1147,152 +1230,10 @@ e107::css('inline', 'td.last.options { padding-right:20px } ');
e107::getAdminUI()->runPage();
require_once(e_ADMIN."footer.php");
exit;
/*
require_once(e_ADMIN.'auth.php');
require_once(e_HANDLER.'userclass_class.php');
$frm = e107::getForm();
$mes = e107::getMessage();
*/
if (e_QUERY)
{
$sl_qs = explode('.', e_QUERY);
}
$action = varset($sl_qs[0],'config');
$params = varset($sl_qs[1],'');
if (isset($_POST['create_export']) && (($action == 'export') || ($action == 'datasets')))
{
$first_date = 0;
$last_date = 0;
$date_error = FALSE;
if ($export_type == 'page')
{
switch ($export_date)
{
case '1' : // Single day
$first_date = gmmktime(0,0,0,$export_month,$export_day,$export_year);
$last_date = $first_date+86399;
$export_filter = " `log_id`='".date("Y-m-j",$first_date)."'";
break;
case '2' : // Daily for a month
$first_date = gmmktime(0,0,0,$export_month,1,$export_year);
$last_date = gmmktime(0,0,0,$export_month+1,1,$export_year) - 1;
$export_filter = " LEFT(`log_id`,8)='".gmstrftime("%Y-%m-",$first_date)."'";
break;
case '3' : // Monthly for a Year
$first_date = gmmktime(0,0,0,1,1,$export_year);
$last_date = gmmktime(0,0,0,1,1,$export_year+1) - 1;
$export_filter = " LENGTH(`log_id`)=7 AND LEFT(`log_id`,5)='".gmstrftime("%Y-",$first_date)."'";
break;
case '4' : // Accumulated
case '5' :
$export_filter = "`log_id`='pageTotal'";
$date_error = 'ignore';
break;
}
}
else
{ // Calculate strings for non-page sources
$prefix_len = 0;
$export_date = $export2_date;
if (isset($stats_list[$export_type]))
{
$prefix_len = strlen($export_type) + 1;
switch ($export2_date)
{
case '3' : // Monthly for a Year
if ($prefix_len > 0)
{
$first_date = gmmktime(0,0,0,1,1,$export_year);
$last_date = gmmktime(0,0,0,1,1,$export_year+1) - 1;
$export_filter = " LENGTH(`log_id`)='".($prefix_len + 7)."' AND LEFT(`log_id`,".($prefix_len + 5).")='".$export_type.":".gmstrftime("%Y-",$first_date)."'";
}
break;
case '4' : // Accumulated
$export_filter = " `log_id`='".$export_type."'";
$date_error = 'ignore';
break;
}
}
else
{
$message = ADSTAT_LAN_54;
}
}
if (($date_error != 'ignore') && (($first_date == 0) || ($last_date == 0) || $date_error))
{
$message = ADSTAT_LAN_47;
}
}
//---------------------------------------------
// Remove page entries
//---------------------------------------------
if(isset($_POST['openRemPageD']))
{
$action = 'rempage';
}
echo $mes->render() ;
switch ($action)
{
case 'config' :
break; // case config
case 'rempage' : // Remove pages
// rempage();
break;
case 'export' : // Export file
case 'datasets' :
//===========================================================
// EXPORT DATA
//===========================================================
break; // case 'export'
case 'history' :
//===========================================================
// DELETE HISTORY
//===========================================================
break; // case 'history'
}
require_once(e_ADMIN."footer.php");
function headerjs()
{
$script_js = "<script type=\"text/javascript\">
@ -1368,50 +1309,6 @@ function headerjs()
return $script_js;
}
//---------------------------------------------
// Remove page entries - prompt/list
//---------------------------------------------
function rempage()
{
}
//---------------------------------------------
// Remove page entries - action
//---------------------------------------------
function admin_config_adminmenu()
{
if (e_QUERY)
{
$tmp = explode(".", e_QUERY);
$action = $tmp[0];
}
if (empty($action)) $action = "config";
$var['config']['text'] = ADSTAT_LAN_35;
$var['config']['link'] = 'admin_config.php';
$var['export']['text'] = ADSTAT_LAN_36;
$var['export']['link'] ='admin_config.php?export';
// $var['datasets']['text'] = ADSTAT_LAN_63;
// $var['datasets']['link'] ='admin_config.php?datasets';
$var['rempage']['text'] = ADSTAT_LAN_26;
$var['rempage']['link'] ='admin_config.php?rempage';
$var['history']['text'] = ADSTAT_LAN_69;
$var['history']['link'] ='admin_config.php?history';
show_admin_menu(ADSTAT_LAN_39, $action, $var);
}
*/

View File

@ -14,7 +14,10 @@
* $Author$
*/
define("PAGE_NAME", "Statistics");
if(!defined('PAGE_NAME')) // TODO FIX ME - use English_global.php
{
define("PAGE_NAME", "Statistics");
}
define("ADSTAT_L1", "This plugin will log all visits to your site, and build detailed statistic screens based on the information gathered.");
define("ADSTAT_L2", "The statistics logger has been successfully installed. To convert your existing stats to the new system, please <a href='".e_PLUGIN."log/update_routine.php'>click here to run update routine</a>.");

View File

@ -100,7 +100,7 @@ if (USER == TRUE || ADMIN == TRUE)
//prepare
$new_total = 0;
$time = USERLV;
$time = defset('USERLV', 0);
$menu_data = array();
// ------------ News Stats -----------

View File

@ -8,7 +8,7 @@
*
*/
require_once ('../../class2.php');
require_once (__DIR__.'/../../class2.php');
if(!getperms('1'))
{
header('location:'.e_BASE.'index.php');

View File

@ -10,221 +10,3 @@
if(!defined('e107_INIT')) { exit();}
require_once (e_HANDLER.'userclass_class.php');
$query = ($pref['nfp_posts'] ? 'thread_lastpost' : 'thread_datestamp');
e107::includeLan(e_PLUGIN.'newforumposts_main/languages/'.e_LANGUAGE.'.php');
$path = e_PLUGIN.'forum/';
global $sql, $ns;
// get template ...
if(is_readable(THEME.'newforumpost.php'))
{
require_once (THEME.'newforumpost.php');
}
elseif(!isset($NEWFORUMPOSTSTYLE_HEADER))
{
// no template found - use default ...
$NEWFORUMPOSTSTYLE_HEADER = "
<!-- newforumposts -->
<div style='text-align:center'>
<table style='width:auto' class='fborder'>
<tr>
<td style='width:5%' class='forumheader'>&nbsp;</td>
<td style='width:45%' class='forumheader'>".NFPM_LAN_1."</td>
<td style='width:15%; text-align:center' class='forumheader'>".NFPM_LAN_2."</td>
<td style='width:5%; text-align:center' class='forumheader'>".NFPM_LAN_3."</td>
<td style='width:5%; text-align:center' class='forumheader'>".NFPM_LAN_4."</td>
<td style='width:25%; text-align:center' class='forumheader'>".NFPM_LAN_5."</td>
</tr>";
$NEWFORUMPOSTSTYLE_MAIN = "
<tr>
<td style='width:5%; text-align:center' class='forumheader3'>{ICON}</td>
<td style='width:45%' class='forumheader3'><b>{THREAD}</b> <span class='smalltext'>({FORUM})</span></td>
<td style='width:15%; text-align:center' class='forumheader3'>{POSTER}</td>
<td style='width:5%; text-align:center' class='forumheader3'>{VIEWS}</td>
<td style='width:5%; text-align:center' class='forumheader3'>{REPLIES}</td>
<td style='width:25%; text-align:center' class='forumheader3'>{LASTPOST}<br /><span class='smalltext'>{LASTPOSTDATE}&nbsp;</span></td>
</tr>";
$NEWFORUMPOSTSTYLE_FOOTER = "
<tr>
<td colspan='6' style='text-align:center' class='forumheader2'>
<span class='smalltext'>".NFPM_LAN_6.": <b>{TOTAL_TOPICS}</b> | ".NFPM_LAN_4.": <b>{TOTAL_REPLIES}</b> | ".NFPM_LAN_3.": <b>{TOTAL_VIEWS}</b></span>
</td>
</tr>
</table>
</div>";
}
$results = $sql->gen("
SELECT t.thread_id, t.thread_name, t.thread_datestamp, t.thread_user, t.thread_views, t.thread_lastpost, t.thread_lastuser, t.thread_total_replies, t.thread_active, f.forum_id, f.forum_name, f.forum_class, u.user_name, fp.forum_class, lp.user_name AS lp_name
FROM #forum_thread AS t
LEFT JOIN #user AS u ON SUBSTRING_INDEX(t.thread_user,'.',1) = u.user_id
LEFT JOIN #user AS lp ON SUBSTRING_INDEX(t.thread_lastuser,'.',1) = lp.user_id
LEFT JOIN #forum AS f ON f.forum_id = t.thread_forum_id
LEFT JOIN #forum AS fp ON f.forum_parent = fp.forum_id
WHERE f.forum_id = t.thread_forum_id AND f.forum_class IN (".USERCLASS_LIST.")
AND fp.forum_class IN (".USERCLASS_LIST.")
ORDER BY t.$query DESC LIMIT 0, ".$pref['nfp_amount']);
$forumArray = $sql->db_getList();
if(!isset($gen) || !is_object($gen))
{
$gen = new convert;
}
/* // Deprecated method to indicate new forum posts
if(is_readable(THEME."forum/new_small.png"))
{
$ICON = "<img src='".THEME."forum/new_small.png' alt='' />";
}
else
{
$ICON = "<img src='".e_PLUGIN_ABS."forum/images/".IMODE."/new_small.png' alt='' />";
}
*/
$TOTAL_TOPICS = $sql->count("forum_thread");
$TOTAL_REPLIES = $sql->count("forum_post");
$sql->gen("SELECT sum(thread_views) FROM #forum_thread");
$tmp = $sql->fetch();
$TOTAL_VIEWS = $tmp["sum(thread_views)"];
$text = preg_replace("/\{(.*?)\}/e", '$\1', $NEWFORUMPOSTSTYLE_HEADER);
foreach ($forumArray as $forumInfo)
{
extract($forumInfo);
$r_datestamp = $gen->convert_date($thread_lastpost, "forum");
if($thread_total_replies)
{
$tmp = explode(".", $thread_lastuser, 2);
if($lp_name)
{
//$LASTPOST = "<a href='".e_BASE."user.php?id.{$tmp[0]}'>$lp_name</a>";
$uparams = array('id' => $tmp[0], 'name' => $lp_name);
$link = e107::getUrl()->create('user/profile/view', $uparams);
$LASTPOST = "<a href='".$link."'>".$lp_name."</a>";
}
else
{
if($tmp[1])
{
$LASTPOST = $tmp[1];
}
else
{
$LASTPOST = NFPM_L16;
}
}
$LASTPOSTDATE = "<span class='smalltext'>$r_datestamp</span>";
}
else
{
$LASTPOST = ' - ';
$LASTPOSTDATE = '';
}
$newflag = FALSE;
if (USER)
{
if ($forumInfo['thread_lastpost'] > USERLV && !preg_match("#\b".$forumInfo['thread_id']."\b#", USERVIEWED))
{
$newflag = TRUE;
}
}
if ($newflag)
{
if ($forumInfo['thread_total_replies'] >= $pref['forum_popular'])
{
$iconfile = 'new_popular.png';
$iconalt = NFPM_L17;
}
else
{
$iconfile = 'new.png';
$iconalt = NFPM_L18;
}
}
else
{
if ($forumInfo['thread_total_replies'] >= $pref['forum_popular'])
{
$iconfile = 'nonew_popular.png';
$iconalt = NFPM_L19;
}
else
{
$iconfile = 'nonew.png';
$iconalt = NFPM_L20;
}
if ($forumInfo['thread_s'] == 1)
{
if ($forumInfo['thread_active'])
{
$iconfile = 'sticky.png';
$iconalt = NFPM_L21;
}
else
{
$iconfile = 'sticky_closed.png';
$iconalt = NFPM_L22;
}
}
elseif($forumInfo['thread_s'] == 2)
{
$iconfile = 'announce.png';
$iconalt = NFPM_L23;
}
elseif(!$forumInfo['thread_active'])
{
$iconfile = 'closed.png';
$iconalt = NFPM_L24;
}
}
$ICON = "<img src='".e_PLUGIN_ABS."forum/images/".IMODE."/". $iconfile. "' alt='".$iconalt."' title='".$iconalt."' />";
$x = explode(chr(1), $thread_user);
$tmp = explode(".", $x[0], 2);
if($user_name)
{
//$POSTER = "<a href='".e_BASE."user.php?id.{$tmp[0]}'>$user_name</a>";
$uparams = array('id' => $tmp[0], 'name' => $user_name);
$link = e107::getUrl()->create('user/profile/view', $uparams);
$POSTER = "<a href='".$link."'>".$user_name."</a>";
}
else
{
if($tmp[1])
{
$POSTER = $tmp[1];
}
else
{
$POSTER = NFPM_L16;
}
}
$THREAD = "<a href='".$path."forum_viewtopic.php?{$thread_id}.last'>$thread_name</a>";
$FORUM = "<a href='".$path."forum_viewforum.php?{$forum_id}'>$forum_name</a>";
$VIEWS = $thread_views;
$REPLIES = $thread_total_replies;
$text .= preg_replace("/\{(.*?)\}/e", '$\1', $NEWFORUMPOSTSTYLE_MAIN);
}
$text .= preg_replace("/\{(.*?)\}/e", '$\1', $NEWFORUMPOSTSTYLE_FOOTER);
$text = ($pref['nfp_layer'] ? "<div style='border : 0; padding : 4px; width : auto; height : ".$pref['nfp_layer_height']."px; overflow : auto; '>".$text."</div>" : $text);
if($results)
{
$ns->tablerender($pref["nfp_caption"], $text, 'nfp');
}

View File

@ -342,4 +342,4 @@ require_once(e_ADMIN."auth.php");
e107::getAdminUI()->runPage();
require_once(e_ADMIN."footer.php");
exit;

View File

@ -29,8 +29,14 @@ if (!e107::isInstalled('newsfeed'))
return;
}
define('NEWSFEED_LIST_CACHE_TAG', 'newsfeeds'.e_LAN."_");
define('NEWSFEED_NEWS_CACHE_TAG', 'newsfeeds_news_'.e_LAN."_");
if(!defined('NEWSFEED_LIST_CACHE_TAG'))
{
define('NEWSFEED_LIST_CACHE_TAG', 'newsfeeds'.e_LAN."_");
}
if(!defined('NEWSFEED_NEWS_CACHE_TAG'))
{
define('NEWSFEED_NEWS_CACHE_TAG', 'newsfeeds_news_'.e_LAN."_");
}
define('NEWSFEED_DEBUG', false);

View File

@ -123,6 +123,8 @@ class newsletter
$mes = e107::getMessage();
$tp = e107::getParser();
$text = '';
if(!$sql->select('newsletter', '*', "newsletter_parent='0' ORDER BY newsletter_id DESC"))
{
$mes->addInfo(NLLAN_05);
@ -168,7 +170,8 @@ class newsletter
}
$ns->tablerender(NLLAN_10, $mes->render() . $text);
unset($text);
$text = '';
if(!$sql->select('newsletter', '*', "newsletter_parent!='0' ORDER BY newsletter_id DESC"))
{

View File

@ -60,8 +60,8 @@ define("NLLAN_44", "Newsletter Front Page"); // FIXME admin_menu
define("NLLAN_45", "Create Newsletter"); // FIXME admin_menu
define("NLLAN_46", "Create Mailing"); // FIXME admin_menu
define("NLLAN_47", "Newsletter Options");
define("NLLAN_48", "Newsletter Subscribers");
define("NLLAN_49", "Newsletter: ");
// define("NLLAN_48", "Newsletter Subscribers");
// define("NLLAN_49", "Newsletter: ");
define("NLLAN_54", "Sending");

View File

@ -16,7 +16,8 @@ if (!e107::isInstalled('newsletter') || !ADMIN)
e107::redirect();
exit();
}
e107::includeLan(e_PLUGIN.'newsletter/languages/'.e_LANGUAGE.'.php');
e107::plugLan('newsletter', null);
require_once(HEADERF);
$sql = e107::getDb();

View File

@ -27,22 +27,29 @@ $insert = (vartrue($parm['book'])) ? "AND chapter_parent = ".intval($parm['book'
//TODO Limits and cache etc.
$data = $sql->retrieve("SELECT * FROM #page_chapters WHERE chapter_visibility IN (".USERCLASS_LIST.") AND chapter_template = 'panel' ".$insert. " LIMIT 24", true);
$sc = e107::getScBatch('page', null, 'cpage');
$body = $template['listChapters']['start'];
foreach($data as $row)
if(!empty($data))
{
$sc->setVars($row);
$sc = e107::getScBatch('page', null, 'cpage');
$sc->setChapter($row['chapter_id']);
$title = $tp->toHTML($row['chapter_name'],false,'TITLE'); // Used when tablerender style includes the caption.
$body .= $tp->parseTemplate($template['listChapters']['item'], true, $sc);
// check for $mode == 'page-menu' in tablestyle() if you need a simple 'echo' without rendering styles.
$body = $template['listChapters']['start'];
foreach($data as $row)
{
$sc->setVars($row);
$sc->setChapter($row['chapter_id']);
$title = $tp->toHTML($row['chapter_name'],false,'TITLE'); // Used when tablerender style includes the caption.
$body .= $tp->parseTemplate($template['listChapters']['item'], true, $sc);
// check for $mode == 'page-menu' in tablestyle() if you need a simple 'echo' without rendering styles.
}
$body .= $template['listChapters']['end'];
}
elseif(ADMIN)
{
$body = "<div class='alert alert-danger'>No Chapters available</div>";
}
$body .= $template['listChapters']['end'];
$caption = $tp->parseTemplate($template['listChapters']['caption'], true, $sc);

View File

@ -1044,6 +1044,6 @@ require_once(e_ADMIN."auth.php");
e107::getAdminUI()->runPage();
require_once(e_ADMIN."footer.php");
exit;

View File

@ -95,11 +95,8 @@
$pm_prefs = e107::getPlugPref('pm');
$pm_prefs['perpage'] = intval($pm_prefs['perpage']);
if($pm_prefs['perpage'] == 0)
{
$pm_prefs['perpage'] = 10;
}
$pm_prefs['perpage'] = (int) varset($pm_prefs['perpage'], 10);
if(!isset($pm_prefs['pm_class']) || !check_class($pm_prefs['pm_class']))
{
@ -952,5 +949,5 @@
require_once(FOOTERF);
exit;

View File

@ -265,7 +265,7 @@ switch ($action)
$ns->tablerender(ADLAN_PM_15, add_limit($pm_prefs));
break;
case 'maint' :
$ns->tablerender(ADLAN_PM_60, show_maint($pm_prefs));
$ns->tablerender(ADLAN_PM_60, renderPMMaint($pm_prefs));
break;
}
@ -285,15 +285,15 @@ function show_options($pm_prefs)
<tbody>
<tr>
<td>".ADLAN_PM_16."</td>
<td>".$frm->text('pm_option-title', $pm_prefs['title'], '50')."</td>
<td>".$frm->text('pm_option-title', varset($pm_prefs['title']), '50')."</td>
</tr>
<tr>
<td>".ADLAN_PM_23."</td>
<td>".e107::getUserClass()->uc_dropdown('pm_option-pm_class', $pm_prefs['pm_class'], 'member,admin,classes')."</td>
<td>".e107::getUserClass()->uc_dropdown('pm_option-pm_class', varset($pm_prefs['pm_class']), 'member,admin,classes')."</td>
</tr>
<tr>
<td>".ADLAN_PM_29."</td>
<td>".e107::getUserClass()->uc_dropdown('pm_option-sendall_class', $pm_prefs['sendall_class'], 'nobody,member,admin,classes')."</td>
<td>".e107::getUserClass()->uc_dropdown('pm_option-sendall_class', varset($pm_prefs['sendall_class']), 'nobody,member,admin,classes')."</td>
</tr>
<tr>
<td>".ADLAN_PM_88."</td>
@ -313,61 +313,61 @@ function show_options($pm_prefs)
<tr>
<td>".ADLAN_PM_17."</td>
<td>".$frm->radio_switch('pm_option-animate', $pm_prefs['animate'], LAN_YES, LAN_NO)."</td>
<td>".$frm->radio_switch('pm_option-animate', varset($pm_prefs['animate']), LAN_YES, LAN_NO)."</td>
</tr>
<tr>
<td>".ADLAN_PM_18."</td>
<td>".$frm->radio_switch('pm_option-dropdown', $pm_prefs['dropdown'], LAN_YES, LAN_NO)."</td>
<td>".$frm->radio_switch('pm_option-dropdown', varset($pm_prefs['dropdown']), LAN_YES, LAN_NO)."</td>
</tr>
<tr>
<td>".ADLAN_PM_19."</td>
<td>".$frm->text('pm_option-read_timeout', $pm_prefs['read_timeout'], '5', array('class' => 'tbox input-text'))."</td>
<td>".$frm->text('pm_option-read_timeout', varset($pm_prefs['read_timeout']), '5', array('class' => 'tbox input-text'))."</td>
</tr>
<tr>
<td>".ADLAN_PM_20."</td>
<td>".$frm->text('pm_option-unread_timeout', $pm_prefs['unread_timeout'], '5', array('class' => 'tbox input-text'))."</td>
<td>".$frm->text('pm_option-unread_timeout', varset($pm_prefs['unread_timeout']), '5', array('class' => 'tbox input-text'))."</td>
</tr>
<tr>
<td>".ADLAN_PM_21."</td>
<td>".$frm->radio_switch('pm_option-popup', $pm_prefs['popup'], LAN_YES, LAN_NO)."</td>
<td>".$frm->radio_switch('pm_option-popup', varset($pm_prefs['popup']), LAN_YES, LAN_NO)."</td>
</tr>
<tr>
<td>".ADLAN_PM_22."</td>
<td class='form-inline'>".$frm->text('pm_option-popup_delay', $pm_prefs['popup_delay'], '5', array('class' => 'tbox input-text'))." ".ADLAN_PM_44."</td>
<td class='form-inline'>".$frm->text('pm_option-popup_delay', varset($pm_prefs['popup_delay']), '5', array('class' => 'tbox input-text'))." ".ADLAN_PM_44."</td>
</tr>
<tr>
<td>".ADLAN_PM_24."</td>
<td>".$frm->text('pm_option-perpage', $pm_prefs['perpage'], '5', array('class' => 'tbox input-text'))."</td>
<td>".$frm->text('pm_option-perpage', varset($pm_prefs['perpage']), '5', array('class' => 'tbox input-text'))."</td>
</tr>
<tr>
<td>".ADLAN_PM_25."</td>
<td>".e107::getUserClass()->uc_dropdown('pm_option-notify_class', $pm_prefs['notify_class'], 'nobody,member,admin,classes')."</td>
<td>".e107::getUserClass()->uc_dropdown('pm_option-notify_class', varset($pm_prefs['notify_class']), 'nobody,member,admin,classes')."</td>
</tr>
<tr>
<td>".ADLAN_PM_26."</td>
<td>".e107::getUserClass()->uc_dropdown('pm_option-receipt_class', $pm_prefs['receipt_class'], 'nobody,member,admin,classes')."</td>
<td>".e107::getUserClass()->uc_dropdown('pm_option-receipt_class', varset($pm_prefs['receipt_class']), 'nobody,member,admin,classes')."</td>
</tr>
<tr>
<td>".ADLAN_PM_27."</td>
<td>".e107::getUserClass()->uc_dropdown('pm_option-attach_class', $pm_prefs['attach_class'], 'nobody,member,admin,classes')."</td>
<td>".e107::getUserClass()->uc_dropdown('pm_option-attach_class', varset($pm_prefs['attach_class']), 'nobody,member,admin,classes')."</td>
</tr>
<tr>
<td>".ADLAN_PM_28."</td>
<td class='form-inline'>".$frm->text('pm_option-attach_size', $pm_prefs['attach_size'], '8', array('class' => 'tbox input-text'))." kB</td>
<td class='form-inline'>".$frm->text('pm_option-attach_size', varset($pm_prefs['attach_size']), '8', array('class' => 'tbox input-text'))." kB</td>
</tr>
<tr>
<td>".ADLAN_PM_30."</td>
<td>".e107::getUserClass()->uc_dropdown('pm_option-multi_class', $pm_prefs['multi_class'], 'nobody,member,admin,classes')."</td>
<td>".e107::getUserClass()->uc_dropdown('pm_option-multi_class', varset($pm_prefs['multi_class']), 'nobody,member,admin,classes')."</td>
</tr>
<tr>
<td>".ADLAN_PM_31."</td>
<td>".e107::getUserClass()->uc_dropdown('pm_option-opt_userclass', $pm_prefs['opt_userclass'], 'nobody,member,admin,classes')."</td>
<td>".e107::getUserClass()->uc_dropdown('pm_option-opt_userclass', varset($pm_prefs['opt_userclass']), 'nobody,member,admin,classes')."</td>
</tr>
<tr>
<td>".ADLAN_PM_81."</td>
<td class='form-inline'>".$frm->text('pm_option-v', $pm_prefs['pm_max_send'], '5', array('class' => 'tbox input-text'))."<span class='field-help'>".ADLAN_PM_82."</span></td>
<td class='form-inline'>".$frm->text('pm_option-v', varset($pm_prefs['pm_max_send']), '5', array('class' => 'tbox input-text'))."<span class='field-help'>".ADLAN_PM_82."</span></td>
</tr>
</tbody>
</table>
@ -533,7 +533,7 @@ function add_limit($pm_prefs)
}
function show_maint($pmPrefs)
function renderPMMaint($pmPrefs)
{
$frm = e107::getForm();

View File

@ -10,17 +10,15 @@
*
*/
$pm_prefs = e107::getPlugPref('pm');
if(!check_class($pm_prefs['pm_class']))
{
return null;
}
if (!defined('e107_INIT')) { exit; }
if (!e107::isInstalled('pm')) { return ''; }
$pm_prefs = e107::getPlugPref('pm');
$pmClass = varset($pm_prefs['pm_class'], e_UC_NOBODY);
if(!check_class($pmClass))
{
return null;
}
/**
@ -142,7 +140,8 @@ $sc->wrapper('pm_menu');
// $txt = "\n".$tp->parseTemplate($pm_menu_template, TRUE, $sc);
$txt = "\n".$tp->parseTemplate($template, TRUE, $sc);
if($pm_inbox['inbox']['new'] > 0 && $pm_prefs['popup'] && strpos(e_SELF, 'pm.php') === FALSE && $_COOKIE['pm-alert'] != 'ON')
$inboxNew = (int) varset($pm_inbox['inbox']['new'], 0);
if($inboxNew > 0 && $pm_prefs['popup'] && strpos(e_SELF, 'pm.php') === FALSE && $_COOKIE['pm-alert'] != 'ON')
{
$txt .= pm_show_popup($pm_inbox, $pm_prefs['popup_delay']);
}

View File

@ -8,147 +8,160 @@
*
*/
require_once(__DIR__.'/../../class2.php');
if (!e107::isInstalled('poll'))
require_once(__DIR__ . '/../../class2.php');
if(!e107::isInstalled('poll'))
{
e107::redirect();
exit;
}
require_once(HEADERF);
require_once(e_HANDLER."comment_class.php");
$cobj = new comment;
if(!defined("USER_WIDTH") && !deftrue('BOOTSTRAP'))
if(!defined("USER_WIDTH"))
{
define("USER_WIDTH","width:95%");
define("USER_WIDTH", "width:95%");
}
e107::includeLan(e_PLUGIN."poll/languages/".e_LANGUAGE.".php");
e107::plugLan('poll', null);
if(e_QUERY)
class oldpolls_front
{
require_once('poll_class.php');
$query = "SELECT p.*, u.user_id, u.user_name FROM #polls AS p
LEFT JOIN #user AS u ON p.poll_admin_id = u.user_id
WHERE p.poll_type=1 AND p.poll_id=".intval(e_QUERY);
if($sql->gen($query))
public static function init()
{
$pl = new poll;
$row = $sql ->fetch();
$start_datestamp = $tp->toDate($row['poll_datestamp'], "long");
$end_datestamp = $tp->toDate($row['poll_end_datestamp'], "long");
$uparams = array('id' => $row['user_id'], 'name' => $row['user_name']);
$link = e107::getUrl()->create('user/profile/view', $uparams);
$userlink = "<a href='".$link."'>".$row['user_name']."</a>";
$ns = e107::getRender();
$tp = e107::getParser();
$sql = e107::getDb();
if(e_QUERY)
{
require_once('poll_class.php');
$query = "SELECT p.*, u.user_id, u.user_name FROM #polls AS p
LEFT JOIN #user AS u ON p.poll_admin_id = u.user_id
WHERE p.poll_type=1 AND p.poll_id=" . intval(e_QUERY);
if($sql->gen($query))
{
$pl = new poll;
$row = $sql->fetch();
$start_datestamp = $tp->toDate($row['poll_datestamp'], "long");
$end_datestamp = $tp->toDate($row['poll_end_datestamp'], "long");
$uparams = array('id' => $row['user_id'], 'name' => $row['user_name']);
$link = e107::getUrl()->create('user/profile/view', $uparams);
$userlink = "<a href='" . $link . "'>" . $row['user_name'] . "</a>";
$text = $pl->render_poll($row, 'forum', 'oldpolls',true);
$text = $pl->render_poll($row, 'forum', 'oldpolls', true);
$text .= "
$text .= "
<div class='smalltext text-right'>
<small>".LAN_POSTED_BY." ".$userlink."<br /> ".$tp->lanVars(POLLAN_50, array('x'=>$start_datestamp, 'y'=> $end_datestamp))."</small></div>
<small>" . LAN_POSTED_BY . " " . $userlink . "<br /> " . $tp->lanVars(POLLAN_50, array('x' => $start_datestamp, 'y' => $end_datestamp)) . "</small></div>
";
/* $count = 0;
/* $count = 0;
$barl = (file_exists(THEME."images/barl.png") ? THEME."images/barl.png" : e_PLUGIN."poll/images/barl.png");
$barr = (file_exists(THEME."images/barr.png") ? THEME."images/barr.png" : e_PLUGIN."poll/images/barr.png");
$bar = (file_exists(THEME."images/bar.png") ? THEME."images/bar.png" : e_PLUGIN."poll/images/bar.png");
$barl = (file_exists(THEME."images/barl.png") ? THEME."images/barl.png" : e_PLUGIN."poll/images/barl.png");
$barr = (file_exists(THEME."images/barr.png") ? THEME."images/barr.png" : e_PLUGIN."poll/images/barr.png");
$bar = (file_exists(THEME."images/bar.png") ? THEME."images/bar.png" : e_PLUGIN."poll/images/bar.png");
foreach($optionArray as $option)
{
$text .= "
<tr>
<td style='width:40%; text-align: right' class='mediumtext'><b>".$tp -> toHTML($option, TRUE, 'TITLE')."</b>&nbsp;&nbsp;</td>
<td class='smalltext'>
<div style='background-image: url($barl); width: 5px; height: 14px; float: left;'>
</div>
<div style='background-image: url($bar); width: ".(floor($percentage[$count]) != 100 ? floor($percentage[$count]) : 95)."%; height: 14px; float: left;'>
</div>
<div style='background-image: url($barr); width: 5px; height: 14px; float: left;'>
</div>
".$percentage[$count]."% [".POL
LAN_31.": ".$voteArray[$count]."]
</td>
</tr>\n";
$count++;
foreach($optionArray as $option)
{
$text .= "
<tr>
<td style='width:40%; text-align: right' class='mediumtext'><b>".$tp -> toHTML($option, TRUE, 'TITLE')."</b>&nbsp;&nbsp;</td>
<td class='smalltext'>
<div style='background-image: url($barl); width: 5px; height: 14px; float: left;'>
</div>
<div style='background-image: url($bar); width: ".(floor($percentage[$count]) != 100 ? floor($percentage[$count]) : 95)."%; height: 14px; float: left;'>
</div>
<div style='background-image: url($barr); width: 5px; height: 14px; float: left;'>
</div>
".$percentage[$count]."% [".POL
LAN_31.": ".$voteArray[$count]."]
</td>
</tr>\n";
$count++;
}
*/
$text .= e107::getComment()->compose_comment('poll', 'comment', intval($row['poll_id']), null, '', false, 'html');
$ns->tablerender(LAN_PLUGIN_POLL_NAME . " #" . $row['poll_id'], $text);
echo "<hr />";
}
}
*/
$text .= e107::getComment()->compose_comment('poll', 'comment', intval( $row['poll_id'] ), null, '', false, 'html');
$ns->tablerender(LAN_PLUGIN_POLL_NAME." #".$row['poll_id'], $text);
echo "<hr />";
// Render List of Polls.
$query = "SELECT p.*, u.user_name FROM #polls AS p
LEFT JOIN #user AS u ON p.poll_admin_id = u.user_id
WHERE p.poll_type=1
ORDER BY p.poll_datestamp DESC";
if(!$array = $sql->retrieve($query, true))
{
$ns->tablerender(POLLAN_28, "<div style='text-align:center'>" . LAN_NO_RECORDS_FOUND . "</div>");
return null;
}
$array = array_slice($array, 1);
if(empty($array))
{
$ns->tablerender(POLLAN_28, "<div style='text-align:center'>" . LAN_NO_RECORDS_FOUND . "</div>");
return null;
}
$text = "<table class='table fborder' style='" . USER_WIDTH . "'>
<colgroup>
<col style='width: 55%;' />
<col style='width: 15%;' />
<col style='width: 30%;' />
<thead>
<tr>
<th class='fcaption'>" . LAN_TITLE . "</th>
<th class='fcaption'>" . LAN_POSTED_BY . "</th>
<th class='fcaption'>" . LAN_ACTIVE . "</th>
</tr></thead><tbody>\n";
foreach($array as $row)
{
$from = $tp->toDate($row['poll_datestamp'], "short");
$to = $tp->toDate($row['poll_end_datestamp'], "short");
$poll_title = $tp->toHTML($row['poll_title'], true, 'TITLE');
$uparams = array('id' => $row['poll_admin_id'], 'name' => $row['user_name']);
$link = e107::getUrl()->create('user/profile/view', $uparams);
$userlink = "<a href='" . $link . "'>" . $row['user_name'] . "</a>";
$text .= "<tr>
<td class='forumheader3' style='width: 55%;'><a href='" . e_SELF . "?" . $row['poll_id'] . "'>{$poll_title}</a></td>
<td class='forumheader3' style='width: 15%;'>" . $userlink . "</td>
<td class='forumheader3' style='width: 30%;'>" . $tp->lanVars(POLLAN_50, array('x' => $from, 'y' => $to)) . "</td>
</tr>\n";
}
$text .= "</tbody></table>";
e107::getRender()->tablerender(POLLAN_28, $text);
}
}
require_once(HEADERF);
// Render List of Polls.
$query = "SELECT p.*, u.user_name FROM #polls AS p
LEFT JOIN #user AS u ON p.poll_admin_id = u.user_id
WHERE p.poll_type=1
ORDER BY p.poll_datestamp DESC";
if(!$array = $sql->retrieve($query,true))
{
$ns->tablerender(POLLAN_28, "<div style='text-align:center'>".LAN_NO_RECORDS_FOUND."</div>");
require_once(FOOTERF);
exit;
}
$array = array_slice($array, 1);
if(empty($array))
{
$ns->tablerender(POLLAN_28, "<div style='text-align:center'>".LAN_NO_RECORDS_FOUND."</div>");
require_once(FOOTERF);
exit;
}
$text = "<table class='table fborder' style='".USER_WIDTH."'>
<colgroup>
<col style='width: 55%;' />
<col style='width: 15%;' />
<col style='width: 30%;' />
<thead>
<tr>
<th class='fcaption'>".LAN_TITLE."</th>
<th class='fcaption'>".LAN_POSTED_BY."</th>
<th class='fcaption'>".LAN_ACTIVE."</th>
</tr></thead><tbody>\n";
foreach($array as $row)
{
$from = $tp->toDate($row['poll_datestamp'], "short");
$to = $tp->toDate($row['poll_end_datestamp'], "short");
$poll_title = $tp->toHTML($row['poll_title'], true, 'TITLE');
$uparams = array('id' => $row['poll_admin_id'], 'name' => $row['user_name']);
$link = e107::getUrl()->create('user/profile/view', $uparams);
$userlink = "<a href='".$link."'>".$row['user_name']."</a>";
$text .= "<tr>
<td class='forumheader3' style='width: 55%;'><a href='".e_SELF."?".$row['poll_id']."'>{$poll_title}</a></td>
<td class='forumheader3' style='width: 15%;'>".$userlink."</td>
<td class='forumheader3' style='width: 30%;'>".$tp->lanVars(POLLAN_50, array('x'=>$from, 'y'=> $to))."</td>
</tr>\n";
}
$text .= "</tbody></table>";
e107::getRender()->tablerender(POLLAN_28, $text);
require_once(FOOTERF);
oldpolls_front::init();
require_once(FOOTERF);

View File

@ -13,6 +13,7 @@
*/
require_once(__DIR__.'/../../class2.php');
if (!e107::isInstalled('poll'))
{
e107::redirect();
@ -23,8 +24,7 @@ require_once(HEADERF);
require(e_PLUGIN.'poll/poll_menu.php');
require_once(FOOTERF);
exit;

View File

@ -675,7 +675,7 @@ class poll
$opt = ($count==1) ? "poll_answer" : "";
$text .= "<div class='form-group' id='".$opt."'>
".$frm->text('poll_option[]', $_POST['poll_option'][($count-1)], '200', array('placeholder' => POLLAN_4, 'id' => $opt))."
".$frm->text('poll_option[]', varset($_POST['poll_option'][($count-1)]), '200', array('placeholder' => POLLAN_4, 'id' => $opt))."
</div>";
}

View File

@ -18,57 +18,58 @@ Notes:
- using $caption = "whatever", is unneccessary.
*/
require_once(__DIR__.'/../../class2.php');
require_once(__DIR__ . '/../../class2.php');
if(!getperms("P") || !e107::isInstalled('rss_menu'))
{
{
e107::redirect('admin');
exit;
}
e107::includeLan(e_PLUGIN."rss_menu/languages/".e_LANGUAGE."_admin_rss_menu.php");
e107::includeLan(e_PLUGIN . "rss_menu/languages/" . e_LANGUAGE . "_admin_rss_menu.php");
class rss_admin extends e_admin_dispatcher
{
protected $modes = array(
'main' => array(
'controller' => 'rss_ui',
'path' => null,
'ui' => 'rss_form_ui',
'uipath' => null
protected $modes = array(
'main' => array(
'controller' => 'rss_ui',
'path' => null,
'ui' => 'rss_form_ui',
'uipath' => null
),
);
);
protected $adminMenu = array(
'main/list' => array('caption'=> LAN_MANAGE, 'perm' => 'P'),
'main/import' => array('caption'=> LAN_IMPORT, 'perm' => 'P'),
'main/list' => array('caption' => LAN_MANAGE, 'perm' => 'P'),
'main/import' => array('caption' => LAN_IMPORT, 'perm' => 'P'),
'main/prefs' => array('caption'=> LAN_PREFS, 'perm' => 'P'),
'main/prefs' => array('caption' => LAN_PREFS, 'perm' => 'P'),
/*
'main/custom' => array('caption'=> 'Custom Page', 'perm' => 'P')
*/
*/
);
protected $adminMenuAliases = array(
'main/edit' => 'main/list'
);
'main/edit' => 'main/list'
);
protected $menuTitle = 'RSS';
function init()
{
if(E107_DEBUG_LEVEL > 0)
{
$this->adminMenu['main/create'] = array('caption'=> LAN_CREATE, 'perm' => 'P');
$this->adminMenu['main/create'] = array('caption' => LAN_CREATE, 'perm' => 'P');
}
}
}
@ -77,36 +78,36 @@ class rss_admin extends e_admin_dispatcher
//TODO - Use this .. .
class rss_ui extends e_admin_ui
{
protected $pluginTitle = 'RSS';
protected $pluginName = 'core';
protected $table = 'rss';
protected $pid = 'rss_id';
protected $perPage = 10;
protected $fields = array (
'checkboxes' => array ( 'title' => '', 'type' => null, 'data' => false, 'width' => '5%', 'thclass' => 'center', 'forced' => '1', 'class' => 'center', 'toggle' => 'e-multiselect', ),
'rss_id' => array ( 'title' => LAN_ID, 'data' => 'int', 'width' => '5%', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ),
'rss_name' => array ( 'title' => LAN_TITLE, 'type' => 'text', 'data' => 'str', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ),
'rss_path' => array ( 'title' => LAN_PLUGIN_FOLDER,'type' => 'text', 'data' => 'str', 'readonly'=>1, 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ),
'rss_url' => array ( 'title' => LAN_URL, 'type' => 'method', 'data' => 'str', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ),
'rss_topicid' => array ( 'title' => RSS_LAN_ADMIN_12,'type' => 'text', 'data' => 'int', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'center', 'thclass' => 'center', ),
'rss_text' => array ( 'title' => LAN_DESCRIPTION,'type' => 'textarea', 'data' => 'str', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'center', 'thclass' => 'center', ),
'rss_datestamp' => array ( 'title' => LAN_DATESTAMP, 'type' => 'datestamp', 'data' => 'int', 'readonly'=>true, 'width' => 'auto', 'filter' => true, 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ),
'rss_class' => array ( 'title' => LAN_VISIBILITY, 'type' => 'dropdown', 'data' => 'int', 'width' => 'auto', 'batch' => true, 'filter' => true, 'help' => '', 'readParms' => '', 'writeParms' => array('optArray'=> array(RSS_LAN_ADMIN_21,RSS_LAN_ADMIN_22,RSS_LAN_ADMIN_23),'size'=>'xlarge'), 'class' => 'left', 'thclass' => 'left', ),
'rss_limit' => array ( 'title' => LAN_LIMIT, 'type' => 'number', 'data' => 'int', 'inline'=>true, 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ),
'options' => array ( 'title' => LAN_OPTIONS, 'type' => null, 'data' => '', 'width' => '10%', 'thclass' => 'center last', 'class' => 'center last', 'forced' => '1', ),
);
protected $fieldpref = array('checkboxes', 'rss_name','rss_url', 'rss_topicid', 'rss_limit', 'rss_class', 'options');
protected $pluginTitle = 'RSS';
protected $pluginName = 'core';
protected $table = 'rss';
protected $pid = 'rss_id';
protected $perPage = 10;
protected $fields = array(
'checkboxes' => array('title' => '', 'type' => null, 'data' => false, 'width' => '5%', 'thclass' => 'center', 'forced' => '1', 'class' => 'center', 'toggle' => 'e-multiselect',),
'rss_id' => array('title' => LAN_ID, 'data' => 'int', 'width' => '5%', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left',),
'rss_name' => array('title' => LAN_TITLE, 'type' => 'text', 'data' => 'str', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left',),
'rss_path' => array('title' => LAN_PLUGIN_FOLDER, 'type' => 'text', 'data' => 'str', 'readonly' => 1, 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left',),
'rss_url' => array('title' => LAN_URL, 'type' => 'method', 'data' => 'str', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left',),
'rss_topicid' => array('title' => RSS_LAN_ADMIN_12, 'type' => 'text', 'data' => 'int', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'center', 'thclass' => 'center',),
'rss_text' => array('title' => LAN_DESCRIPTION, 'type' => 'textarea', 'data' => 'str', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'center', 'thclass' => 'center',),
'rss_datestamp' => array('title' => LAN_DATESTAMP, 'type' => 'datestamp', 'data' => 'int', 'readonly' => true, 'width' => 'auto', 'filter' => true, 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left',),
'rss_class' => array('title' => LAN_VISIBILITY, 'type' => 'dropdown', 'data' => 'int', 'width' => 'auto', 'batch' => true, 'filter' => true, 'help' => '', 'readParms' => '', 'writeParms' => array('optArray' => array(RSS_LAN_ADMIN_21, RSS_LAN_ADMIN_22, RSS_LAN_ADMIN_23), 'size' => 'xlarge'), 'class' => 'left', 'thclass' => 'left',),
'rss_limit' => array('title' => LAN_LIMIT, 'type' => 'number', 'data' => 'int', 'inline' => true, 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left',),
'options' => array('title' => LAN_OPTIONS, 'type' => null, 'data' => '', 'width' => '10%', 'thclass' => 'center last', 'class' => 'center last', 'forced' => '1',),
);
protected $fieldpref = array('checkboxes', 'rss_name', 'rss_url', 'rss_topicid', 'rss_limit', 'rss_class', 'options');
protected $prefs = array(
'rss_othernews' => array('title'=> RSS_LAN_ADMIN_13, 'type' => 'boolean', 'data' => 'int'),
'rss_summarydiz' => array('title'=> RSS_LAN_ADMIN_19, 'type' => 'boolean', 'data' => 'integer'),
'rss_shownewsimage' => array('title'=> RSS_LAN_ADMIN_33, 'type' => 'boolean', 'data' => 'int')
);
protected $prefs = array(
'rss_othernews' => array('title' => RSS_LAN_ADMIN_13, 'type' => 'boolean', 'data' => 'int'),
'rss_summarydiz' => array('title' => RSS_LAN_ADMIN_19, 'type' => 'boolean', 'data' => 'integer'),
'rss_shownewsimage' => array('title' => RSS_LAN_ADMIN_33, 'type' => 'boolean', 'data' => 'int')
);
// optional
@ -122,60 +123,63 @@ class rss_ui extends e_admin_ui
function dbrssImport()
{
$sql = e107::getDb();
$tp = e107::getParser();
foreach($_POST['importid'] as $key=>$value)
foreach($_POST['importid'] as $key => $value)
{
$rssVals = array();
$rssVals['rss_topicid'] = $tp->toDB(varset($_POST['topic_id'][$key], ''));
$rssVals['rss_url'] = $tp->toDB(varset($_POST['url'][$key], ''));
$rssVals['rss_path'] = $tp->toDB(varset($_POST['path'][$key], ''));
$rssVals['rss_name'] = $tp->toDB(varset($_POST['name'][$key], ''));
$rssVals['rss_text'] = $tp->toDB(varset($_POST['text'][$key], ''));
$rssVals['rss_datestamp'] = time();
$rssVals['rss_class'] = intval(varset($_POST['class'][$key], '0'));
$rssVals['rss_limit'] = intval(varset($_POST['limit'][$key], '0'));
$rssVals['rss_topicid'] = $tp->toDB(varset($_POST['topic_id'][$key], ''));
$rssVals['rss_url'] = $tp->toDB(varset($_POST['url'][$key], ''));
$rssVals['rss_path'] = $tp->toDB(varset($_POST['path'][$key], ''));
$rssVals['rss_name'] = $tp->toDB(varset($_POST['name'][$key], ''));
$rssVals['rss_text'] = $tp->toDB(varset($_POST['text'][$key], ''));
$rssVals['rss_datestamp'] = time();
$rssVals['rss_class'] = intval(varset($_POST['class'][$key], '0'));
$rssVals['rss_limit'] = intval(varset($_POST['limit'][$key], '0'));
$sql->insert("rss", $rssVals);
e107::getLog()->addArray($rssVals)->save('RSS_04');
// e107::getLog()->logArrayAll('RSS_04',$rssVals);
// e107::getLog()->logArrayAll('RSS_04',$rssVals);
}
$message = count($_POST['importid'])." ".RSS_LAN_ADMIN_18;
$message = count($_POST['importid']) . " " . RSS_LAN_ADMIN_18;
return $message;
}
public function importPage()
{
// Import - put up the list of possible feeds to import
$sql = e107::getDb();
$ns = e107::getRender();
$mes = e107::getMessage();
$tp = e107::getParser();
$frm = e107::getForm();
$sql = e107::getDb();
$ns = e107::getRender();
$mes = e107::getMessage();
$tp = e107::getParser();
$frm = e107::getForm();
global $i,$rss_shortcodes, $feed, $pref;
global $i, $rss_shortcodes, $feed, $pref;
require_once(e_PLUGIN.'rss_menu/rss_shortcodes.php');
require_once(e_PLUGIN . 'rss_menu/rss_shortcodes.php');
$rss_shortcodes = e107::getScBatch('rss_menu', true);
$RSS_ADMIN_IMPORT_HEADER = "
<form action='".e_SELF."' id='imlistform' method='post' >
<form action='" . e_SELF . "' id='imlistform' method='post' >
<table class='table table-striped adminlist'>
<thead>
<tr>
<th class='center' style='width:5%'>".LAN_SELECT."</td>
<th>".LAN_NAME."</td>
<th>".LAN_PLUGIN_FOLDER."</td>
<th class='center' style='width:5%'>" . LAN_SELECT . "</td>
<th>" . LAN_NAME . "</td>
<th>" . LAN_PLUGIN_FOLDER . "</td>
<th>".LAN_URL."</td>
<th>".RSS_LAN_ADMIN_12."</td>
<th>" . LAN_URL . "</td>
<th>" . RSS_LAN_ADMIN_12 . "</td>
</tr>
</thead><tbody>";
$RSS_ADMIN_IMPORT_TABLE = "
$RSS_ADMIN_IMPORT_TABLE = "
<tr>
<td class='first center'>{RSS_ADMIN_IMPORT_CHECK}</td>
<td>{RSS_ADMIN_IMPORT_NAME} - {RSS_ADMIN_IMPORT_TEXT}</td>
@ -186,104 +190,102 @@ class rss_ui extends e_admin_ui
</tr>";
$RSS_ADMIN_IMPORT_FOOTER = "</tbody>
$RSS_ADMIN_IMPORT_FOOTER = "</tbody>
</table>
<div class='buttons-bar center'>
".$frm->admin_button('import_rss',LAN_ADD,'submit')."
" . $frm->admin_button('import_rss', LAN_ADD, 'submit') . "
</div>
</form>
";
$sqli = new db;
$feedlist = array();
$sqli = new db;
$feedlist = array();
// @see e107_plugins/news/e_rss.php
// @see e107_plugins/news/e_rss.php
// Comments
$feed['name'] = LAN_COMMENTS;
$feed['url'] = 'comments';
$feed['topic_id'] = '';
$feed['path'] = 'comments';
$feed['text'] = RSS_PLUGIN_LAN_9;
$feed['class'] = '0';
$feed['limit'] = '9';
$feedlist[] = $feed;
// Comments
$feed['name'] = LAN_COMMENTS;
$feed['url'] = 'comments';
$feed['topic_id'] = '';
$feed['path'] = 'comments';
$feed['text'] = RSS_PLUGIN_LAN_9;
$feed['class'] = '0';
$feed['limit'] = '9';
$feedlist[] = $feed;
// Plugin rss feed, using e_rss.php in plugin folder
$plugin_feedlist = array();
foreach($pref['e_rss_list'] as $val)
// Plugin rss feed, using e_rss.php in plugin folder
$plugin_feedlist = array();
foreach($pref['e_rss_list'] as $val)
{
$eplug_rss_feed = array();
if(is_readable(e_PLUGIN . $val . "/e_rss.php"))
{
$eplug_rss_feed = array();
if (is_readable(e_PLUGIN.$val."/e_rss.php"))
require_once(e_PLUGIN . $val . "/e_rss.php");
$className = $val . "_rss";
$data = false;
if(!$data = e107::callMethod($className, 'config'))
{
require_once(e_PLUGIN.$val."/e_rss.php");
$className = $val."_rss";
$data = false;
if(!$data = e107::callMethod($className,'config'))
{
$data = $eplug_rss_feed;
}
foreach($data as $v)
{
$v['path'] = $val;
array_push($plugin_feedlist,$v);
}
$data = $eplug_rss_feed;
}
}
$feedlist = array_merge($feedlist, $plugin_feedlist);
// print_a($feedlist);
$render=FALSE;
$i=0;
$text = $RSS_ADMIN_IMPORT_HEADER;
foreach($feedlist as $k=>$feed)
{
$feed['topic_id'] = $tp->toDB($feed['topic_id']);
$feed['url'] = $tp->toDB($feed['url']);
// Check if feed is not yet present
if(!$sql->select("rss", "*", "rss_path='".$feed['path']."' AND rss_url='".$feed['url']."' AND rss_topicid='".$feed['topic_id']."' "))
foreach($data as $v)
{
$render = TRUE;
$rss_shortcodes->setVars($feed);
$text .= $tp -> parseTemplate($RSS_ADMIN_IMPORT_TABLE, FALSE, $rss_shortcodes);
$i++;
$v['path'] = $val;
array_push($plugin_feedlist, $v);
}
}
$text .= $tp -> parseTemplate($RSS_ADMIN_IMPORT_FOOTER, FALSE, $rss_shortcodes);
if(!$render)
{
$this->show_message(RSS_LAN_ADMIN_11, RSS_LAN_ERROR_6);
}
else
{
return $text;
}
}
$feedlist = array_merge($feedlist, $plugin_feedlist);
// print_a($feedlist);
$render = false;
$i = 0;
$text = $RSS_ADMIN_IMPORT_HEADER;
foreach($feedlist as $k => $feed)
{
$feed['topic_id'] = $tp->toDB($feed['topic_id']);
$feed['url'] = $tp->toDB($feed['url']);
// Check if feed is not yet present
if(!$sql->select("rss", "*", "rss_path='" . $feed['path'] . "' AND rss_url='" . $feed['url'] . "' AND rss_topicid='" . $feed['topic_id'] . "' "))
{
$render = true;
$rss_shortcodes->setVars($feed);
$text .= $tp->parseTemplate($RSS_ADMIN_IMPORT_TABLE, false, $rss_shortcodes);
$i++;
}
}
$text .= $tp->parseTemplate($RSS_ADMIN_IMPORT_FOOTER, false, $rss_shortcodes);
if(!$render)
{
$this->show_message(RSS_LAN_ADMIN_11, RSS_LAN_ERROR_6);
}
else
{
return $text;
}
}
}
class rss_form_ui extends e_admin_form_ui
{
// Custom Method/Function
function rss_url($curVal,$mode)
{
// Custom Method/Function
function rss_url($curVal, $mode)
{
switch($mode)
@ -293,32 +295,34 @@ class rss_form_ui extends e_admin_form_ui
$type = $this->getController()->getListModel()->get('rss_type');
$topic = $this->getController()->getListModel()->get('rss_topicid');
$link = e107::url('rss_menu', 'rss', array('rss_type'=>$type, 'rss_url'=>$curVal, 'rss_topicid'=>$topic));
return "<a href='".$link."'>".$curVal."</a>";
break;
$link = e107::url('rss_menu', 'rss', array('rss_type' => $type, 'rss_url' => $curVal, 'rss_topicid' => $topic));
return "<a href='" . $link . "'>" . $curVal . "</a>";
break;
case 'write': // Edit Page
$link = SITEURL."feed/"; // e107::url('rss_menu','index').'/';
return "<div class='form-inline'>".$link.e107::getForm()->text('rss_url', $curVal,255, 'size=small')."/rss/{Topic id}</div>";
break;
$link = SITEURL . "feed/"; // e107::url('rss_menu','index').'/';
return "<div class='form-inline'>" . $link . e107::getForm()->text('rss_url', $curVal, 255, 'size=small') . "/rss/{Topic id}</div>";
break;
case 'filter':
case 'batch':
return null;
break;
return null;
break;
}
}
}
}
new rss_admin();
require_once(e_ADMIN."auth.php");
e107::getAdminUI()->runPage();
new rss_admin();
require_once(e_ADMIN . "auth.php");
e107::getAdminUI()->runPage();
require_once(e_ADMIN . "footer.php");
require_once(e_ADMIN."footer.php");
exit;

View File

@ -193,7 +193,7 @@ else
require_once(HEADERF);
$ns->tablerender(LAN_ERROR, RSS_LAN_ERROR_1);
require_once(FOOTERF);
exit;
}
class rssCreate

View File

@ -2,6 +2,8 @@
if (!defined('e107_INIT')) { exit; }
e107::plugLan('siteinfo', null);
$text = "<div style='text-align:center'>
<a href='http://validator.w3.org/check?uri=".e_SELF.(e_QUERY ? '?'.e_QUERY : '')."'><img src='".e_PLUGIN_ABS."siteinfo/images/valid-xhtml11.png' alt='Valid XHTML 1.1!' height='31' width='88' /></a><br />
<a href='http://jigsaw.w3.org/css-validator/validator?uri=".e_SELF.(e_QUERY ? '?'.e_QUERY : '')."'><img src='".e_PLUGIN_ABS."siteinfo/images/vcss.png' alt='Valid CSS!' height='31' width='88' /></a>

View File

@ -943,6 +943,6 @@ require_once(e_ADMIN."auth.php");
e107::getAdminUI()->runPage();
require_once(e_ADMIN."footer.php");
exit;

View File

@ -22,7 +22,7 @@ require_once('tagcloud_class.php');
// http://lotsofcode.github.io/tag-cloud/
if (!class_exists('tagcloud_menu'))
if(!class_exists('tagcloud_menu'))
{
class tagcloud_menu
{
@ -32,10 +32,9 @@ if (!class_exists('tagcloud_menu'))
function __construct()
{
$this->template = e107::getTemplate('tagcloud', 'tagcloud_menu', 'default');
}
function render($parm = null)
public function render($parm = null)
{
$cloud = new TagCloud();
@ -106,10 +105,17 @@ if (!class_exists('tagcloud_menu'))
}
}
/* TODO: add template type as parm, now always default */
$tag = new tagcloud_menu;
$text = $tag->render($parm);
/* TODO: add template type as parm, now always default */
if(class_exists('tagcloud_menu'))
{
$tag = new tagcloud_menu;
$text = $tag->render($parm);
}
else
{
$text = '';
}
if (!empty($parm))
{

View File

@ -85,643 +85,5 @@ $result = e107::lan('tinymce4', true);
e107::getAdminUI()->runPage();
require_once(e_ADMIN."footer.php");
exit;
require_once(e_HANDLER."form_handler.php");
require_once (e_HANDLER.'message_handler.php');
$frm = new e_form(true);
$ef = new tinymce;
//TODO save prefs to separate config row.
// List all forms of access, and allow the user to choose between simple/advanced or 'custom' settings.
if(varset($_POST['update']) || varset($_POST['create']))
{
$id = intval($_POST['record_id']);
$ef->submitPage($id);
}
if(varset($_POST['delete']))
{
$id = key($_POST['delete']);
$ef->deleteRecord($id);
$_GET['mode'] = "list";
}
if(isset($_POST['edit']) || $id) // define after db changes and before header loads.
{
$id = (isset($_POST['edit'])) ? key($_POST['edit']) : $id;
define("TINYMCE_CONFIG",$id);
}
else
{
define("TINYMCE_CONFIG",FALSE);
}
require_once(e_ADMIN."auth.php");
if(varset($_GET['mode'])=='create')
{
$id = varset($_POST['edit']) ? key($_POST['edit']) : "";
if($_POST['record_id'])
{
$id = $_POST['record_id'];
}
$ef->createRecord($id);
}
else
{
$ef->listRecords();
}
require_once(e_ADMIN."footer.php");
class tinymce
{
var $fields;
var $fieldpref;
var $listQry;
var $table;
var $primary;
function __construct()
{
$this->fields = array(
'tinymce_id' => array('title'=> ID, 'width'=>'5%', 'forced'=> TRUE, 'primary'=>TRUE),
'tinymce_name' => array('title'=> 'name', 'width'=>'auto','type'=>'text'),
'tinymce_userclass' => array('title'=> 'class', 'type' => 'array', 'method'=>'tinymce_class', 'width' => 'auto'),
'tinymce_plugins' => array('title'=> 'plugins', 'type' => 'array', 'method'=>'tinymce_plugins', 'width' => 'auto'),
'tinymce_buttons1' => array('title'=> 'buttons1', 'type' => 'text', 'method'=>'tinymce_buttons', 'methodparms'=>1, 'width' => 'auto'),
'tinymce_buttons2' => array('title'=> 'buttons2', 'type' => 'text', 'method'=>'tinymce_buttons', 'methodparms'=>2, 'width' => 'auto'),
'tinymce_buttons3' => array('title'=> 'buttons3', 'type' => 'text', 'method'=>'tinymce_buttons', 'methodparms'=>3, 'width' => 'auto', 'thclass' => 'left first'),
'tinymce_buttons4' => array('title'=> 'buttons4', 'type' => 'text', 'method'=>'tinymce_buttons', 'methodparms'=>4, 'width' => 'auto', 'thclass' => 'left first'),
'tinymce_custom' => array('title'=> 'custom', 'type' => 'text', 'width' => 'auto'),
'tinymce_prefs' => array('title'=> 'prefs', 'type' => 'text', 'width' => '10%', 'thclass' => 'center' ),
'options' => array('title'=> LAN_OPTIONS, 'forced'=>TRUE, 'width' => '10%', 'thclass' => 'center last')
);
$this->fieldpref = (varset($user_pref['admin_tinymce_columns'])) ? $user_pref['admin_tinymce_columns'] : array_keys($this->fields);
$this->table = "tinymce";
$this->listQry = "SELECT * FROM #tinymce ORDER BY tinymce_id";
$this->editQry = "SELECT * FROM #tinymce WHERE tinymce_id = {ID}";
$this->primary = "tinymce_id";
$this->pluginTitle = "Tinymce";
$this->listCaption = "Tinymce Configs";
$this->createCaption = LAN_CREATE."/".LAN_EDIT;
}
// --------------------------------------------------------------------------
/**
* Generic DB Record Listing Function.
*
* @param object $mode [optional] - reserved
* @return void
*/
function listRecords($mode = FALSE)
{
$ns = e107::getRender();
$sql = e107::getDb();
$frm = e107::getForm();
global $pref;
$emessage = eMessage::getInstance();
$text = "<form method='post' action='".e_SELF."?mode=create'>
<fieldset id='core-release-list'>
<legend class='e-hideme'>".$this->pluginTitle."</legend>
<table class='adminlist'>".
$frm->colGroup($this->fields,$this->fieldpref).
$frm->thead($this->fields,$this->fieldpref).
"<tbody>";
if(!$sql->gen($this->listQry))
{
$text .= "\n<tr><td colspan='".count($this->fields)."' class='center middle'>".CUSLAN_42."</td></tr>\n";
}
else
{
$row = $sql->db_getList('ALL', FALSE, FALSE);
foreach($row as $field)
{
$text .= "<tr>\n";
foreach($this->fields as $key=>$att)
{
$class = vartrue($this->fields[$key]['thclass']) ? "class='".$this->fields[$key]['thclass']."'" : "";
$text .= (in_array($key,$this->fieldpref) || $att['forced']==TRUE) ? "\t<td ".$class.">".$this->renderValue($key,$field)."</td>\n" : "";
}
$text .= "</tr>\n";
}
}
$text .= "
</tbody>
</table>
</fieldset>
</form>
";
$ns->tablerender($this->pluginTitle." :: ".$this->listCaption, $emessage->render().$text);
}
/**
* Render Field value (listing page)
*
* @param string $key
* @param array $row
* @return string
*/
function renderValue($key, $row)
{
$att = $this->fields[$key];
$frm = e107::getForm();
if($key == "options")
{
$id = $this->primary;
$text = "<input type='image' class='action edit' name='edit[{$row[$id]}]' src='".ADMIN_EDIT_ICON_PATH."' title='".LAN_EDIT."' />";
$text .= "<input type='image' class='action delete' name='delete[{$row[$id]}]' src='".ADMIN_DELETE_ICON_PATH."' title='".LAN_DELETE." [ ID: {$row[$id]} ]' />";
return $text;
}
if($key == "tinymce_userclass")
{
return $frm->uc_label($row[$key]);
}
if($key == "tinymce_plugins")
{
return str_replace(",","<br />",$row[$key]);
}
switch($att['type'])
{
case 'url':
return "<a href='".$row[$key]."'>".$row[$key]."</a>";
break;
default:
return $row[$key];
break;
}
return $row[$key] .$att['type'];
}
/**
* Render Form Element (edit page)
*
* @param string $key
* @param array $row
* @return string method's value or HTML input
*/
function renderElement($key, $row)
{
$frm = e107::getForm();
$att = $this->fields[$key];
$value = $row[$key];
if($att['method'])
{
$meth = $att['method'];
if(isset($att['methodparms']))
{
return $this->$meth($value, $att['methodparms']);
}
return $this->$meth($value);
}
return $frm->text($key, $row[$key], 50);
}
function createRecord($id=FALSE)
{
global $frm, $e_userclass, $e_event;
$tp = e107::getParser();
$ns = e107::getRender();
$sql = e107::getDb();
$mes = eMessage::getInstance();
if($id)
{
$query = str_replace("{ID}",$id,$this->editQry);
$sql->gen($query);
$row = $sql->fetch();
}
else
{
$row = array();
}
$text = "
<form method='post' action='".e_SELF."?mode=create' id='dataform' enctype='multipart/form-data'>
<fieldset id='core-cpage-create-general'>
<legend class='e-hideme'>".$this->pluginTitle."</legend>
<table class='adminedit'>
<colgroup>
<col class='col-label' />
<col class='col-control' />
</colgroup>
<tbody>
<tr>
<td>Preview<div style='padding:20px'>[<a href='javascript:start_tinyMce();'>Refresh Preview</a>]
<br /><br />[<a href='#' onclick=\"tinyMCE.execCommand('mceToggleEditor',false,'content');\">Toggle WYSIWYG</a>]
</div>
</td>
<td>".$this->tinymce_preview()."</td>
</tr>";
foreach($this->fields as $key=>$att)
{
if($att['forced']!==TRUE)
{
$text .= "
<tr>
<td>".$att['title']."</td>
<td>".$this->renderElement($key,$row)."</td>
</tr>";
}
}
$text .= "
</tbody>
</table>
<div class='buttons-bar center'>";
if($id)
{
$text .= $frm->admin_button('update', LAN_UPDATE, 'update');
$text .= "<input type='hidden' name='record_id' value='".$id."' />";
}
else
{
$text .= $frm->admin_button('create', LAN_CREATE, 'create');
}
$text .= "
</div>
</fieldset>
</form>";
$ns->tablerender($this->pluginTitle." :: ".$this->createCaption,$mes->render(). $text);
}
function tinymce_buttons($curVal,$id)
{
return "<input class='tbox' style='width:97%' type='text' name='tinymce_buttons".$id."' value='".$curVal."' />\n";
}
function tinymce_preview()
{
return "<textarea id='content' class='e-wysiwyg tbox' rows='10' cols='10' name='preview' style='width:80%'> </textarea>";
}
function tinymce_plugins($curVal)
{
$fl = e107::getFile();
$curArray = explode(",",$curVal);
if($plug_array = $fl->get_dirs(e_PLUGIN."tinymce/plugins/"))
{
sort($plug_array);
}
$text = "<div style='width:80%'>";
foreach($plug_array as $mce_plg)
{
$checked = (in_array($mce_plg,$curArray)) ? "checked='checked'" : "";
$text .= "<div style='width:25%;float:left'><input type='checkbox' name='tinymce_plugins[]' value='".$mce_plg."' $checked /> $mce_plg </div>";
}
$text .= "</div>";
return $text;
}
function tinymce_class($curVal)
{
$frm = e107::getForm();
// $cur = explode(",",$curVal);
$uc_options = "guest,member,admin,main,classes";
return $frm->uc_checkbox('tinymce_userclass', $curVal, $uc_options);
}
/**
* Generic Save DB Record Function.
* Insert or Update a table row.
*
* @param mixed $id [optional] if set, $id correspond to the primary key of the table
* @return void
*/
function submitPage($id = FALSE)
{
global $sql, $tp, $e107cache, $admin_log, $e_event;
$emessage = eMessage::getInstance();
$insert_array = array();
foreach($this->fields as $key=>$att)
{
if($att['forced']!=TRUE)
{
$insert_array[$key] = $_POST[$key];
}
if($att['type']=='array')
{
$insert_array[$key] = implode(",",$_POST[$key]);
}
}
$xml = new SimpleXMLElement('<tinymce/>');
$insertXml = array_flip($insert_array);
array_walk_recursive($insertXml, array ($xml, 'addChild'));
$save = $xml->asXML();
file_put_contents(e_SYSTEM."admin.xml",$save);
// echo htmlentities($save);
if($id)
{
$insert_array['WHERE'] = $this->primary." = ".$id;
$status = $sql->update($this->table,$insert_array) ? E_MESSAGE_SUCCESS : E_MESSAGE_FAILED;
$message = LAN_UPDATED;
}
else
{
$status = $sql->insert($this->table,$insert_array) ? E_MESSAGE_SUCCESS : E_MESSAGE_FAILED;
$message = LAN_CREATED;
}
$emessage->add($message, $status);
}
function deleteRecord($id)
{
if(!$id || !$this->primary || !$this->table)
{
return;
}
$emessage = eMessage::getInstance();
$sql = e107::getDb();
$query = $this->primary." = ".$id;
$status = $sql->delete($this->table,$query) ? E_MESSAGE_SUCCESS : E_MESSAGE_FAILED;
$message = LAN_DELETED;
$emessage->add($message, $status);
}
function optionsPage()
{
global $e107, $pref, $frm, $emessage;
if(!isset($pref['pageCookieExpire'])) $pref['pageCookieExpire'] = 84600;
//XXX Lan - Options
$text = "
<form method='post' action='".e_SELF."?".e_QUERY."'>
<fieldset id='core-cpage-options'>
<legend class='e-hideme'>".LAN_OPTIONS."</legend>
<table class='adminform'>
<colgroup>
<col class='col-label' />
<col class='col-control' />
</colgroup>
<tbody>
<tr>
<td>".CUSLAN_29."</td>
<td>
".$frm->radio_switch('listPages', $pref['listPages'])."
</td>
</tr>
<tr>
<td>".CUSLAN_30."</td>
<td>
".$frm->text('pageCookieExpire', $pref['pageCookieExpire'], 10)."
</td>
</tr>
</tbody>
</table>
<div class='buttons-bar center'>
".$frm->admin_button('saveOptions', CUSLAN_40, 'submit')."
</div>
</fieldset>
</form>
";
$e107->ns->tablerender(LAN_OPTIONS, $emessage->render().$text);
}
function saveSettings()
{
$temp = array();
$temp['listPages'] = $_POST['listPages'];
$temp['pageCookieExpire'] = $_POST['pageCookieExpire'];
e107::getConfig()->setPref($temp)->save(true, true, true);
}
function show_options($action)
{
$action = varset($_GET['mode'],'list');
$var['list']['text'] = $this->listCaption;
$var['list']['link'] = e_SELF."?mode=list";
$var['list']['perm'] = "0";
$var['create']['text'] = $this->createCaption;
$var['create']['link'] = e_SELF."?mode=create";
$var['create']['perm'] = 0;
/*
$var['options']['text'] = LAN_OPTIONS;
$var['options']['link'] = e_SELF."?options";
$var['options']['perm'] = "0";*/
e107::getNav()->admin($this->pluginTitle, $action, $var);
}
}
function admin_config_adminmenu()
{
global $ef;
global $action;
$ef->show_options($action);
}
if($_POST['save_settings']) // Needs to be saved before e_meta.php is loaded by auth.php.
{
$tpref['customjs'] = $_POST['customjs'];
$tpref['theme_advanced_buttons1'] = $_POST['theme_advanced_buttons1'];
$tpref['theme_advanced_buttons2'] = $_POST['theme_advanced_buttons2'];
$tpref['theme_advanced_buttons3'] = $_POST['theme_advanced_buttons3'];
$tpref['theme_advanced_buttons4'] = $_POST['theme_advanced_buttons4'];
$tpref['plugins'] = $_POST['mce_plugins'];
e107::getPlugConfig('tinymce')->setPref($tpref);
e107::getPlugConfig('tinymce')->save();
}
$tpref = e107::getPlugConfig('tinymce')->getPref();
if($_POST['save_settings']) // is there an if $emessage? $emessage->hasMessage doesn't return TRUE.
{
$emessage->add(LAN_UPDATED, E_MESSAGE_SUCCESS);
e107::getRender()->tablerender(LAN_UPDATED, $emessage->render());
}
if(!$tpref['theme_advanced_buttons1'])
{
$tpref['theme_advanced_buttons1'] = "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect";
}
if(!$tpref['theme_advanced_buttons2'])
{
$tpref['theme_advanced_buttons2'] = "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor";
}
if(!$tpref['theme_advanced_buttons3'])
{
$tpref['theme_advanced_buttons3'] = "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen,emoticons,ibrowser";
}
if(!$tpref['theme_advanced_buttons4'])
{
$tpref['theme_advanced_buttons4'] = "insertlayer,moveforward,movebackward,absolute,|,styleprops,spellchecker,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,blockquote,pagebreak,|,insertfile,insertimage";
}
function edit_theme()
{
$ns = e107::getRender();
$text = "<div style='text-align:center'>
<form method='post' action='".e_SELF."'>
<fieldset id='plugin-tinymce-config'>
<table class='adminform'>
<colgroup>
<col class='col-label' />
<col class='col-control' />
</colgroup>
<tr>
<td>Preview<div style='padding:20px'>[<a href='javascript:start_tinyMce();'>Refresh Preview</a>]
<br /><br />[<a href='#' onclick=\"tinyMCE.execCommand('mceToggleEditor',false,'content');\">Toggle WYSIWYG</a>]
</div>
</td>
<td>
<textarea id='content' class='e-wysiwyg tbox' rows='10' cols='10' name='name3' style='width:80%'> </textarea>
</td>
</tr>
<tr>
<td>Installed Plugins</td>
<td><div style='width:80%'>
";
foreach($plug_array as $mce_plg)
{
$checked = (in_array($mce_plg,$tpref['plugins'])) ? "checked='checked'" : "";
$text .= "<div style='width:25%;float:left'><input type='checkbox' name='mce_plugins[]' value='".$mce_plg."' $checked /> $mce_plg </div>";
}
$text .= "</div>
</td>
</tr>
<tr>
<td>Button Layout</td>
<td style='width:80%' class='forumheader3'>";
for ($i=1; $i<=4; $i++)
{
$rowNm = "theme_advanced_buttons".$i;
$text .= "\t<input class='tbox' style='width:97%' type='text' name='".$rowNm."' value='".$tpref[$rowNm]."' />\n";
}
$text .= "
</td>
</tr>
<tr>
<td>Custom TinyMce Javascript</td>
<td>
<textarea rows='5' cols='10' name='customjs' class='tbox' style='width:80%'>".$tpref['customjs']."</textarea>
</td>
</tr>
</table>
<div class='buttons-bar center'>";
$text .= "<input class='btn btn-default btn-secondary button' type='submit' name='save_settings' value='".LAN_SAVE."' />";
$text .= "
</div>
</fieldset>
</form>
</div>";
$ns -> tablerender("TinyMCE Configuration", $text);
}
require_once(e_ADMIN."footer.php");

View File

@ -16,8 +16,8 @@
//TODO homogenisation with languagelinks + do not force www + unobtrusive redirect
if ( ! defined('e107_INIT')) { exit(); }
require_once(e_HANDLER.'language_class.php');
$slng = new language;
e107::plugLan('user', null);
$slng = e107::getLanguage();
$languageList = explode(',', e_LANLIST);
sort($languageList);

View File

@ -66,6 +66,8 @@ if (isset($_POST['update_theme']))
}
}
$themeList = array();
if (isset($pref['allowed_themes']))
{
$allThemes = FALSE;

View File

@ -767,28 +767,83 @@ class e107Test extends \Codeception\Test\Unit
//$res = null;
//$this->assertTrue($res);
}
/*
private function clearRelatedRegistry($type)
{
$registry = e107::getRegistry('_all_');
$result = [];
foreach($registry as $reg => $v)
{
if(strpos($reg, $type) !== false)
{
e107::setRegistry($reg);
$result[] = $reg;
}
}
sort($result);
return $result;
}*/
/*
public function testGetTemplatePluginThemeMatch()
{
e107::plugLan('download', 'front', true);
e107::getConfig()->set('sitetheme', 'bootstrap3');
$template = e107::getTemplate('download', null, null);
var_export($template['header']);
echo "\n\n";
e107::getConfig()->set('sitetheme', '_blank');
$template = e107::getTemplate('download', null, null);
var_export($template['header']);
echo "\n\n";
e107::getConfig()->set('sitetheme', 'bootstrap3'); // doesn't have a download template, so fallback.
$template = e107::getTemplate('download', null, null); // theme override is enabled by default.
var_export($template['header']);
echo "\n\n";
e107::getConfig()->set('sitetheme', 'bootstrap3');
}
*/
/**
* This test checks getTemplate() use on loading between the core download plugin template and the _blank theme download template
*/
public function testGetTemplate()
{
// clear all template related registry entries.
// $cleared = $this->clearRelatedRegistry('templates/download');
return null; // FIXME - getTemplate() registry issue.
// cached with bootstrap3 theme template.
//FIXME Remove 'false' from the line below to see Undefined 'header' issue with registry.
$template = e107::getTemplate('download', null, null, false); // theme override is enabled by default.
e107::getConfig()->set('sitetheme', '_blank');
require_once(e_PLUGIN . "download/languages/English/English_front.php"); // LANS in template files.
// e107::getConfig()->set('sitetheme', '_blank');
e107::plugLan('download', 'front', true);
// FIXME getTemplate registry doesn't handle the theme change correctly.
/*
$template = e107::getTemplate('download', null, null); // theme override is enabled by default.
$this->assertEquals('{DOWNLOAD_BREADCRUMB} Custom', $template['header']); // ie. should be from _blank theme download template (override of plugin).
$footer = empty($template['footer']); // theme overrides everything, since merge is not enabled. theme does not contain 'footer'.
$this->assertTrue($footer);
$this->assertTrue($footer);*/
$template = e107::getTemplate('download', null, null, false); // theme override is disabled.
$this->assertEquals("{DOWNLOAD_BREADCRUMB}", $template['header']); // ie. should be from plugin template, not theme.
$this->assertEquals('', $template['footer']); // main plugin template is active, since override is false. 'footer' is set.
/*
$template = e107::getTemplate('download', null, null, true, true); // theme override is enabled, and theme merge is enabled.
$this->assertEquals("{DOWNLOAD_BREADCRUMB} Custom", $template['header']); //from theme
$this->assertEquals("", $template['footer']); // 'footer' missing from theme, so plugin template used. ie. arrays have been merged.
*/
$template = e107::getTemplate('download', null, null, false, true); // theme override is disabled, theme merge is enabled.
$this->assertEquals("{DOWNLOAD_BREADCRUMB}", $template['header']); // ie. should be from plugin template, not theme.
@ -796,7 +851,7 @@ class e107Test extends \Codeception\Test\Unit
// FIXME above..
// var_dump($template['other']);
e107::getConfig()->set('sitetheme', 'bootstrap3');
// e107::getConfig()->set('sitetheme', 'bootstrap3');
}
@ -847,46 +902,51 @@ class e107Test extends \Codeception\Test\Unit
public function testPlugLan()
{
// Make sure nothing else loaded the language files.
// $this->assertFalse(defined('BANNERLAN_19'), 'BANNERLAN_19 is already defined!');
// $this->assertFalse(defined('LAN_FORUM_0002'), 'LAN_FORUM_0002 is already defined!');
$this->assertFalse(defined('LAN_GALLERY_ADMIN_01'), 'LAN_GALLERY_ADMIN_01 is already defined!');
// $this->assertFalse(defined('CM_L1'), 'Comment Menu English file already defined');
$this->assertFalse(defined('LAN_FORUM_MENU_001'), 'LAN_FORUM_MENU_001 is already defined!');
$this->assertFalse(defined('BNRLAN_11'), 'BNRLAN_11 is already defined!');
$this->assertFalse(defined('CHATBOX_L1'), 'CHATBOX_L1 is already defined!');
$this->assertTrue(defined('LAN_PLUGIN_GALLERY_SEF_01')); // global so it is defined already.
$e107 = $this->e107;
// Test 1
$e107::plugLan('banner'); // languages/English_front.php
$this->assertTrue(defined('BANNERLAN_19'), 'plugLan() test #1 failed');
$tests = array(
// plug, param 1, param 2, expected
0 => array('banner', '', false, 'e107_plugins/banner/languages/English_front.php'),
1 => array('forum', 'front', true, 'e107_plugins/forum/languages/English/English_front.php'),
2 => array('gallery', true, true, 'e107_plugins/gallery/languages/English/English_admin.php'),
3 => array('forum', 'menu', true, 'e107_plugins/forum/languages/English/English_menu.php'),
4 => array('banner', true, false, 'e107_plugins/banner/languages/English_admin.php'),
5 => array('chatbox_menu', e_LANGUAGE, false, 'e107_plugins/chatbox_menu/languages/English/English.php'),
6 => array('comment_menu', null, false, 'e107_plugins/comment_menu/languages/English.php'),
7 => array('poll', null, false, 'e107_plugins/poll/languages/English.php'),
8 => array('poll', null, false, 'e107_plugins/poll/languages/English.php'),
);
// Test 2 - conflict with shortcode testing.
// $e107::plugLan('forum', 'front', true); // languages/English/English_front.php
// $this->assertTrue(defined('LAN_FORUM_0002'),'plugLan() test #2 failed');
foreach($tests as $plug=>$var)
{
$result = $e107::plugLan($var[0], $var[1], $var[2], true);
if(!isset($var[3]))
{
echo $result."\n";
continue;
}
$this->assertStringContainsString($var[3], $result);
$e107::plugLan($var[0], $var[1], $var[2]);
}
/*
$registry = $e107::getRegistry('_all_');
foreach($registry as $k=>$v)
{
if(strpos($k, 'core/e107/pluglan/') !== false)
{
echo $k."\n";
}
}*/
// Test 3
$e107::plugLan('gallery', true, true); // languages/English/English_admin.php
$this->assertTrue(defined('LAN_GALLERY_ADMIN_01'), 'plugLan() test #3 failed');
// Test 4
$e107::plugLan('forum', 'menu', true); // languages/English/English_menu.php
$this->assertTrue(defined('LAN_FORUM_MENU_001'), 'plugLan() test #4 failed');
// Test 5
$e107::plugLan('banner', true); // languages/English_admin.php
$this->assertTrue(defined('BNRLAN_11'), 'plugLan() test #5 failed');
// Test 6
$e107::plugLan('chatbox_menu', e_LANGUAGE); // languages/English/English.php
$this->assertTrue(defined('CHATBOX_L1'), 'plugLan() test #6 failed');
// Test 7
$e107::plugLan('comment_menu', null); // languages/English.php - BC path.
$this->assertTrue(defined('CM_L1'), 'plugLan() test #7 failed');
}

View File

@ -132,13 +132,30 @@
}
/*
public function testPluginScripts()
{
$core = e107::getPlug()->getCorePluginList();
$exclude = array('forum_post.php');
$exclude = array(
'forum/forum_post.php',
'forum/forum_viewtopic.php', // needs a major cleanup.
'forum/index.php',
'log/log.php', // headers
'log/loginfo.php', // include.
'log/stats.php', // FIXME or remove the plugin
'log/stats_csv.php',
'online/online_menu.php', // FIXME missing template for member/new
'pm/pm.php', // FIXME contains exit, needs rework.
'poll/admin_config.php', // FIXME convert to admin-ui
'rss_menu/rss.php', // FIXME rework code into class.
'tagcloud/tagcloud_menu.php', // FIXME - strange (PHP bug?), doesn't see the render() method.
'tinymce4/wysiwyg.php', // javascript generator.
);
//DEBUG A SPECIFIC FILE : dir => file
// $focus = array('tagcloud'=>'tagcloud_menu.php');
foreach($core as $plug)
@ -151,19 +168,35 @@
$files = scandir($path);
unset($files[0], $files[1]); // . and ..
if(!empty($focus) && !isset($focus[$plug]))
{
continue;
}
foreach($files as $f)
{
$filePath = $path.'/'.$f;
if(is_dir($filePath) || (strpos($f, '_sql.php') !== false) || strpos($f, '.php') === false || in_array($f, $exclude))
if(!empty($focus) && $f !== $focus[$plug])
{
continue;
}
echo " --- ".$filePath." --- \n";
ob_start();
if(is_dir($filePath) || (strpos($f, '_sql.php') !== false) || strpos($f, '.php') === false || in_array($plug.'/'.$f, $exclude))
{
continue;
}
// echo " --- ".$filePath." --- \n";
if(empty($focus))
{
ob_start();
}
require_once( $filePath);
ob_end_clean();
if(empty($focus))
{
ob_end_clean();
}
// echo $plug.'/'.$f."\n";
}
@ -174,7 +207,7 @@
}
*/

View File

@ -63,7 +63,7 @@ header('Content-type: application/xml', TRUE);
$xml = "<?xml version='1.0' encoding='UTF-8'?>
<urlset xmlns='http://www.sitemaps.org/schemas/sitemap/0.9'>";
$smArray = $sql ->retrieve("gsitemap", "*", "gsitemap_active IN (".USERCLASS_LIST.") ORDER BY gsitemap_order ",true);
$smArray = e107::getDb()->retrieve("gsitemap", "*", "gsitemap_active IN (".USERCLASS_LIST.") ORDER BY gsitemap_order ",true);
foreach($smArray as $sm)
{

View File

@ -327,7 +327,7 @@
if(!isset($gen) || !is_object($gen))
{
$gen = new convert;
$gen = e107::getDate();
}
$siteHistory = e107::getConfig('history')->getPref('');
@ -339,6 +339,7 @@
$scArray['ONLINE_TABLE_MOST_GUESTS_ONLINE'] = ONLINE_EL1 . $siteHistory['most_guests_online'];
$scArray['ONLINE_TABLE_DATESTAMP'] = $datestamp;
$sql = e107::getDb();
$total_members = $sql->count("user", "(*)", "where user_ban = 0");
if($total_members > 1)

View File

@ -37,11 +37,11 @@ if (e_QUERY)
}
if ($action == 'top')
{
define('e_PAGETITLE', LAN_8);
}
e107::title(LAN_8);
}
elseif ($action == 'active')
{
define('e_PAGETITLE', LAN_7);
e107::title(LAN_7);
}
else
{