mirror of
https://github.com/e107inc/e107.git
synced 2025-03-19 20:09:47 +01:00
commit
1268950c98
@ -17,6 +17,7 @@ if (!getperms("5|J")) { e107::redirect('admin'); exit; }
|
||||
e107::css('inline',"
|
||||
|
||||
.e-wysiwyg { height: 400px }
|
||||
td.menu-field { background-color: rgba(0,0,0,0.07); }
|
||||
");
|
||||
|
||||
e107::coreLan('cpage', true);
|
||||
@ -34,6 +35,12 @@ class page_admin extends e_admin_dispatcher
|
||||
'ui' => 'page_admin_form_ui',
|
||||
'uipath' => null
|
||||
),
|
||||
'overview' => array(
|
||||
'controller' => 'page_admin_ui',
|
||||
'path' => null,
|
||||
'ui' => 'page_admin_form_ui',
|
||||
'uipath' => null
|
||||
),
|
||||
'cat' => array(
|
||||
'controller' => 'page_chapters_ui',
|
||||
'path' => null,
|
||||
@ -56,8 +63,10 @@ class page_admin extends e_admin_dispatcher
|
||||
);
|
||||
|
||||
protected $adminMenu = array(
|
||||
'overview/list' => array('caption'=> CUSLAN_1, 'perm' => '5|J'),
|
||||
'page/list' => array('caption'=> CUSLAN_48, 'perm' => '5'),
|
||||
'menu/list' => array('caption'=> CUSLAN_49, 'perm' => 'J', 'tab' => 2),
|
||||
'menu/list' => array('caption'=> CUSLAN_49, 'perm' => 'J', 'tab' => 2),
|
||||
|
||||
'page/create' => array('caption'=> CUSLAN_12, 'perm' => '5'),
|
||||
'other' => array('divider'=> true),
|
||||
'cat/list' => array('caption'=> CUSLAN_50, 'perm' => '5'), // Create Category.
|
||||
@ -72,6 +81,7 @@ class page_admin extends e_admin_dispatcher
|
||||
|
||||
|
||||
protected $adminMenuAliases = array(
|
||||
'overview/edit' => 'overview/list',
|
||||
'page/edit' => 'page/list',
|
||||
'menu/edit' => 'menu/create',
|
||||
'cat/edit' => 'cat/list'
|
||||
@ -134,9 +144,11 @@ class page_admin_form_ui extends e_admin_form_ui
|
||||
|
||||
$text = "<a href='".e_SELF."?{$query}' class='btn btn-default' title='".LAN_EDIT."' data-toggle='tooltip' data-placement='left'>
|
||||
".ADMIN_EDIT_ICON."</a>";
|
||||
|
||||
$text .= $this->submit_image('menu_delete['.$id.']', $id, 'delete', LAN_DELETE.' [ ID: '.$id.' ]', array('class' => 'action delete btn btn-default'));
|
||||
|
||||
|
||||
if($this->getController()->getMode() === 'overview')
|
||||
{
|
||||
$text .= $this->submit_image('menu_delete['.$id.']', $id, 'delete', LAN_DELETE.' [ ID: '.$id.' ]', array('class' => 'action delete btn btn-default'));
|
||||
}
|
||||
return $text;
|
||||
}
|
||||
}
|
||||
@ -176,7 +188,7 @@ class page_chapters_ui extends e_admin_ui
|
||||
|
||||
'chapter_meta_description' => array('title'=> LAN_DESCRIPTION, 'type' => 'textarea', 'width' => 'auto', 'thclass' => 'left','readParms' => 'expand=...&truncate=150&bb=1', 'writeParms'=>'size=xxlarge', 'readonly'=>FALSE),
|
||||
'chapter_meta_keywords' => array('title'=> LAN_KEYWORDS, 'type' => 'tags', 'inline'=>true, 'width' => 'auto', 'thclass' => 'left', 'readonly'=>FALSE),
|
||||
'chapter_sef' => array('title'=> LAN_SEFURL, 'type' => 'text', 'width' => 'auto', 'readonly'=>FALSE, 'inline'=>true, 'writeParms'=>'size=xxlarge&inline-empty=1&sef=chapter_name', ), // Display name
|
||||
'chapter_sef' => array('title'=> LAN_SEFURL, 'type' => 'text', 'width' => 'auto', 'readonly'=>FALSE, 'batch'=>true, 'inline'=>true, 'writeParms'=>'size=xxlarge&inline-empty=1&sef=chapter_name', ), // Display name
|
||||
'chapter_manager' => array('title'=> CUSLAN_55, 'type' => 'userclass', 'inline'=>true, 'width' => 'auto', 'data' => 'int','batch'=>TRUE, 'filter'=>TRUE),
|
||||
'chapter_order' => array('title'=> LAN_ORDER, 'type' => 'text', 'width' => 'auto', 'thclass' => 'right', 'class'=> 'right' ),
|
||||
'chapter_visibility' => array('title'=> LAN_VISIBILITY, 'type' => 'userclass', 'inline'=>true, 'width' => 'auto', 'data' => 'int','batch'=>TRUE, 'filter'=>TRUE),
|
||||
@ -193,7 +205,7 @@ class page_chapters_ui extends e_admin_ui
|
||||
{
|
||||
$this->addTitle(CUSLAN_63);
|
||||
// e107::getMessage()->addWarning("Experimental: Custom Fields");
|
||||
$this->tabs = array(LAN_GENERAL,"Custom Fields");
|
||||
$this->tabs = array(LAN_GENERAL,CUSLAN_4);
|
||||
$this->fields['chapter_fields'] = array('title'=>"Fields", 'tab'=>1, 'type'=>'method', 'data'=>'json', 'writeParms'=>array('nolabel'=>2));
|
||||
|
||||
if($this->getAction() === 'list')
|
||||
@ -208,7 +220,7 @@ class page_chapters_ui extends e_admin_ui
|
||||
|
||||
$sql = e107::getDb();
|
||||
$sql->gen("SELECT chapter_id,chapter_name FROM #page_chapters WHERE chapter_parent =0");
|
||||
$this->books[0] = "(New Book)";
|
||||
$this->books[0] = CUSLAN_5;
|
||||
|
||||
while($row = $sql->fetch())
|
||||
{
|
||||
@ -556,7 +568,7 @@ class page_admin_ui extends e_admin_ui
|
||||
protected $fields = array(
|
||||
'checkboxes' => array('title'=> '', 'type' => null, 'width' =>'3%', 'forced'=> TRUE, 'thclass'=>'center', 'class'=>'center'),
|
||||
'page_id' => array('title'=> LAN_ID, 'type' => 'text', 'tab' => 0, 'width'=>'5%', 'forced'=> TRUE, 'readParms'=>'link=sef&target=blank'),
|
||||
'page_title' => array('title'=> LAN_TITLE, 'tab' => 0, 'type' => 'text', 'data'=>'str', 'inline'=>true, 'width'=>'25%', 'writeParms'=>'size=block-level'),
|
||||
'page_title' => array('title'=> CUSLAN_2, 'tab' => 0, 'type' => 'text', 'data'=>'str', 'inline'=>true, 'width'=>'25%', 'writeParms'=>'size=block-level'),
|
||||
'page_chapter' => array('title'=> CUSLAN_63, 'tab' => 0, 'type' => 'dropdown', 'width' => '20%', 'filter' => true, 'batch'=>true, 'inline'=>true),
|
||||
|
||||
'page_template' => array('title'=> LAN_TEMPLATE, 'tab' => 0, 'type' => 'dropdown', 'width' => 'auto','filter' => true, 'batch'=>true, 'inline'=>true, 'writeParms'=>array()),
|
||||
@ -571,7 +583,7 @@ class page_admin_ui extends e_admin_ui
|
||||
'page_rating_flag' => array('title'=> LAN_RATING, 'tab' => 1, 'type' => 'boolean', 'data'=>'int', 'width' => '5%', 'thclass' => 'center', 'class' => 'center' ),
|
||||
'page_comment_flag' => array('title'=> LAN_COMMENTS, 'tab' => 1, 'type' => 'boolean', 'data'=>'int', 'width' => '5%', 'thclass' => 'center', 'class' => 'center' ),
|
||||
'page_password' => array('title'=> LAN_PASSWORD, 'tab' => 1, 'type' => 'text', 'data'=>'str', 'width' => 'auto', 'writeParms'=>array('password'=>1, 'nomask'=>1, 'size' => 40, 'class' => 'tbox e-password', 'generate' => 1, 'strength' => 1, 'required'=>0)),
|
||||
'page_sef' => array('title'=> LAN_SEFURL, 'tab' => 1, 'type' => 'text', 'data'=>'str', 'inline'=>true, 'width' => 'auto', 'writeParms'=>'size=xxlarge&sef=page_title'),
|
||||
'page_sef' => array('title'=> LAN_SEFURL, 'tab' => 1, 'type' => 'text', 'batch'=>true, 'data'=>'str', 'inline'=>true, 'width' => 'auto', 'writeParms'=>'size=xxlarge&sef=page_title'),
|
||||
'page_metakeys' => array('title'=> LAN_KEYWORDS, 'tab' => 1, 'type' => 'tags', 'data'=>'str', 'width' => 'auto'),
|
||||
'page_metadscr' => array('title'=> CUSLAN_11, 'tab' => 1, 'type' => 'text', 'data'=>'str', 'width' => 'auto', 'writeParms'=>'size=xxlarge'),
|
||||
|
||||
@ -597,7 +609,7 @@ class page_admin_ui extends e_admin_ui
|
||||
|
||||
// 'page_ip_restrict' => array('title'=> LXXAN_USER_07, 'type' => 'text', 'width' => 'auto'), // Avatar
|
||||
|
||||
'options' => array('title'=> LAN_OPTIONS, 'type' => null, 'forced'=>TRUE, 'width' => '10%', 'thclass' => 'center last', 'class' => 'center','readParms'=>'sort=1')
|
||||
'options' => array('title'=> LAN_OPTIONS, 'type' => null, 'forced'=>TRUE, 'width' => '10%', 'thclass' => 'center last', 'class' => 'center last','readParms'=>'sort=1&deleteClass=e_UC_NOBODY')
|
||||
);
|
||||
|
||||
protected $fieldpref = array("page_id","page_title","page_chapter","page_template","page_author","page_class");
|
||||
@ -606,7 +618,8 @@ class page_admin_ui extends e_admin_ui
|
||||
'listPages' => array('title'=> CUSLAN_29, 'type'=>'boolean'),
|
||||
'listBooks' => array('title'=> CUSLAN_50, 'type'=>'boolean'),
|
||||
'listBooksTemplate' => array('title'=> CUSLAN_72, 'type'=>'dropdown'),
|
||||
'pageCookieExpire' => array('title'=> CUSLAN_30, 'type'=>'number') //TODO Set default value to 84600
|
||||
'pageCookieExpire' => array('title'=> CUSLAN_30, 'type'=>'number'), //TODO Set default value to 84600
|
||||
'admin_page_perpage' => array('title'=> CUSLAN_3, 'type'=>'number'), //TODO Set default value to 84600
|
||||
);
|
||||
|
||||
protected $books = array();
|
||||
@ -617,7 +630,39 @@ class page_admin_ui extends e_admin_ui
|
||||
function init()
|
||||
{
|
||||
|
||||
if($this->getMode() === 'overview')
|
||||
{
|
||||
$this->listQry = "SELECT SQL_CALC_FOUND_ROWS p.*,u.user_id,u.user_name FROM #page AS p LEFT JOIN #user AS u ON p.page_author = u.user_id "; // without any Order or Limit.
|
||||
$this->fieldpref = array("page_id", "page_title", 'page_chapter', 'page_template', "menu_title", 'menu_image', 'menu_template' );
|
||||
|
||||
$this->sortField = false;
|
||||
|
||||
$this->fields['menu_title']['width'] = 'auto';
|
||||
$this->fields['menu_image']['readParms'] = 'thumb=60x55';
|
||||
$this->fields['menu_image']['width'] = 'auto';
|
||||
|
||||
$this->fields['page_title']['width'] = 'auto';
|
||||
|
||||
$this->fields['options']['type'] = 'method';
|
||||
|
||||
|
||||
foreach($this->fieldpref as $k)
|
||||
{
|
||||
$this->fields[$k]['nolist'] = false;
|
||||
|
||||
if($k === 'page_id')
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if(strpos($k,'menu_') === 0)
|
||||
{
|
||||
$this->fields[$k]['class'] = 'menu-field '.$this->fields[$k]['class'];
|
||||
}
|
||||
|
||||
$this->fields[$k]['width'] = '13%';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(vartrue($_POST['menu_delete'])) // Delete a Menu (or rather, remove it's data )
|
||||
@ -631,7 +676,7 @@ class page_admin_ui extends e_admin_ui
|
||||
}
|
||||
|
||||
// USED IN Menu LIST/INLINE-EDIT MODE ONLY.
|
||||
if($this->getMode() == 'menu' && ($this->getAction() == 'list' || $this->getAction() == 'inline'))
|
||||
if($this->getMode() === 'menu' && ($this->getAction() == 'list' || $this->getAction() == 'inline'))
|
||||
{
|
||||
|
||||
$this->listQry = "SELECT SQL_CALC_FOUND_ROWS p.*,u.user_id,u.user_name FROM #page AS p LEFT JOIN #user AS u ON p.page_author = u.user_id WHERE (p.menu_name != '' OR p.menu_image != '' OR p.menu_icon !='') "; // without any Order or Limit.
|
||||
|
@ -207,7 +207,7 @@ class eurl_admin_ui extends e_admin_controller_ui
|
||||
protected function simplePage()
|
||||
{
|
||||
// $this->addTitle("Simple Redirects");
|
||||
$eUrl =e107::getAddonConfig('e_url');
|
||||
$eUrl =e107::getUrlConfig();
|
||||
$frm = e107::getForm();
|
||||
$tp = e107::getParser();
|
||||
$cfg = e107::getConfig();
|
||||
@ -315,8 +315,17 @@ class eurl_admin_ui extends e_admin_controller_ui
|
||||
{
|
||||
// main module pref dropdown
|
||||
$this->prefs['url_main_module']['writeParms'][''] = 'None';
|
||||
|
||||
// e_url.php aliases
|
||||
$tmp = e107::getUrlConfig('alias');
|
||||
foreach($tmp as $plugin=>$alias)
|
||||
{
|
||||
$this->prefs['url_main_module']['writeParms'][$alias] = eHelper::labelize($plugin);
|
||||
}
|
||||
|
||||
// legacy URL (news, pages )
|
||||
$modules = e107::getPref('url_config', array());
|
||||
ksort($modules);
|
||||
|
||||
foreach ($modules as $module => $location)
|
||||
{
|
||||
$labels = array();
|
||||
@ -326,10 +335,11 @@ class eurl_admin_ui extends e_admin_controller_ui
|
||||
if(!$config || !vartrue($config['config']['allowMain'])) continue;
|
||||
$admin = $obj->admin();
|
||||
$labels = vartrue($admin['labels'], array());
|
||||
|
||||
|
||||
|
||||
$this->prefs['url_main_module']['writeParms'][$module] = vartrue($section['name'], eHelper::labelize($module));
|
||||
}
|
||||
|
||||
ksort($this->prefs['url_main_module']['writeParms']);
|
||||
|
||||
// title2sef transform type pref
|
||||
$types = explode('|', 'none|dashl|dashc|dash|underscorel|underscorec|underscore|plusl|plusc|plus');
|
||||
|
@ -465,6 +465,10 @@ if(deftrue('e_MENUMANAGER_ACTIVE'))
|
||||
{
|
||||
$body_onload .= " id=\"layout-".e107::getForm()->name2id(THEME_LAYOUT)."\" ";
|
||||
}
|
||||
else
|
||||
{
|
||||
$body_onload .= " id=\"admin-".str_replace(".php","",e_PAGE)."\" ";
|
||||
}
|
||||
|
||||
//
|
||||
// J: Send end of <head> and start of <body>
|
||||
|
@ -45,14 +45,14 @@ if(e_MENUMANAGER_ACTIVE === false )
|
||||
e107::library('load', 'bootstrap.switch');
|
||||
e107::js('footer', '{e_WEB}js/bootstrap.switch.init.js', 'jquery', 5);
|
||||
|
||||
if(!deftrue("e_DEBUG"))
|
||||
// if(!deftrue("e_DEBUG"))
|
||||
{
|
||||
e107::getJs()->inlineCSS('
|
||||
body { overflow:hidden }
|
||||
');
|
||||
}
|
||||
else
|
||||
{
|
||||
// else
|
||||
/* {
|
||||
e107::js('footer-inline',"
|
||||
$('#menu_iframe').attr('scrolling','no');
|
||||
$('#menu_iframe').load(function() {
|
||||
@ -60,7 +60,7 @@ if(e_MENUMANAGER_ACTIVE === false )
|
||||
$(this).css('height',height);
|
||||
});
|
||||
");
|
||||
}
|
||||
}*/
|
||||
|
||||
e107::getJs()->inlineCSS("
|
||||
.menu-manager-items { padding-right:15px}
|
||||
@ -90,20 +90,20 @@ if(e_MENUMANAGER_ACTIVE === false )
|
||||
|
||||
.menu-selector ul li:nth-child(odd){ background-color:rgba(0,0,0,0.2) }
|
||||
|
||||
.menu-selector { height:330px; display:block; padding-bottom:50px; overflow-y:scroll; margin-bottom:10px }
|
||||
.menu-selector { /*height:330px; */ display:block; padding-bottom:50px; /*overflow-y:scroll;*/ margin-bottom:10px }
|
||||
|
||||
.menu-selector input:checked + span { color: white; }
|
||||
|
||||
@media all and (min-height: 1000px) {
|
||||
|
||||
.menu-selector { height:500px }
|
||||
/*.menu-selector { height:200px }*/
|
||||
}
|
||||
|
||||
@media all and (max-height: 800px) {
|
||||
|
||||
.menu-selector { height:250px }
|
||||
/*.menu-selector { height:250px }*/
|
||||
iframe#menu_iframe { height: 87vh }
|
||||
.menu-selector ul li { font-size: 0.8em }
|
||||
/*.menu-selector ul li { font-size: 0.8em }*/
|
||||
}
|
||||
|
||||
ul.dropdown-menu.e-mm-selector { padding: 10px; margin-top: -2px; margin-right:-2px; }
|
||||
|
@ -440,7 +440,7 @@ class news_admin_ui extends e_admin_ui
|
||||
|
||||
'news_meta_keywords' => array('title' => LAN_KEYWORDS, 'type' => 'tags', 'data'=>'str', 'tab'=>1, 'inline'=>true, 'width' => 'auto', 'thclass' => '', 'class' => null, 'nosort' => false),
|
||||
'news_meta_description' => array('title' => LAN_DESCRIPTION,'type' => 'textarea', 'data'=>'str', 'tab'=>1, 'width' => 'auto', 'thclass' => '', 'class' => null, 'nosort' => false, 'writeParms'=>array('size'=>'xxlarge')),
|
||||
'news_sef' => array('title' => LAN_SEFURL, 'type' => 'text', 'data'=>'str', 'tab'=>1, 'inline'=>true, 'width' => 'auto', 'thclass' => '', 'class' => null, 'nosort' => false, 'writeParms'=>array('size'=>'xxlarge', 'show'=>1, 'sef'=>'news_title')),
|
||||
'news_sef' => array('title' => LAN_SEFURL, 'type' => 'text', 'batch'=>1, 'data'=>'str', 'tab'=>1, 'inline'=>true, 'width' => 'auto', 'thclass' => '', 'class' => null, 'nosort' => false, 'writeParms'=>array('size'=>'xxlarge', 'show'=>1, 'sef'=>'news_title')),
|
||||
'news_ping' => array('title' => LAN_PING, 'type' => 'checkbox', 'tab'=>1, 'data'=>false, 'writeParms'=>'value=0', 'inline'=>true, 'width' => 'auto', 'thclass' => '', 'class' => null, 'nosort' => false),
|
||||
|
||||
'news_author' => array('title' => LAN_AUTHOR, 'type' => 'method', 'tab'=>0, 'readParms'=>'idField=user_id&nameField=user_name', 'width' => 'auto', 'thclass' => '', 'class' => null, 'nosort' => false),
|
||||
@ -1118,14 +1118,14 @@ class news_admin_ui extends e_admin_ui
|
||||
<tr>
|
||||
<td>".NWSLAN_88."</td>
|
||||
<td>
|
||||
".$frm->select('newsposts', $this->_optrange(50, false), $pref['newsposts'], 'class=tbox')."
|
||||
".$frm->select('newsposts', $this->_optrange(50, false), $pref['newsposts'])."
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>".LAN_NEWS_91."</td>
|
||||
<td>
|
||||
".$frm->select('news_list_limit', $this->_optrange(50, false), $pref['news_list_limit'], 'class=tbox')."
|
||||
".$frm->select('news_list_limit', $this->_optrange(50, false), $pref['news_list_limit'])."
|
||||
<div class='field-help'>".LAN_NEWS_92."</div>
|
||||
</td>
|
||||
</tr>
|
||||
@ -1167,13 +1167,13 @@ class news_admin_ui extends e_admin_ui
|
||||
<tr>
|
||||
<td>".NWSLAN_87."</td>
|
||||
<td>
|
||||
".$frm->select('nbr_cols', $this->_optrange(6, false), $pref['nbr_cols'], 'class=tbox')."
|
||||
".$frm->select('nbr_cols', $this->_optrange(6, false), $pref['nbr_cols'])."
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>".NWSLAN_115."</td>
|
||||
<td id='newsposts-archive-cont'>
|
||||
".$frm->select('newsposts_archive', $this->_optrange(intval($pref['newsposts']) - 1), intval($pref['newsposts_archive']), 'class=tbox')."
|
||||
".$frm->select('newsposts_archive', $this->_optrange(intval($pref['newsposts']) - 1), intval($pref['newsposts_archive']))."
|
||||
<div class='field-help'>".NWSLAN_116."</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -5025,8 +5025,11 @@ class ".$table." extends e_admin_ui
|
||||
protected \$batchDelete = true;
|
||||
protected \$batchExport = true;
|
||||
protected \$batchCopy = true;
|
||||
|
||||
// protected \$sortField = 'somefield_order';
|
||||
// protected \$orderStep = 10;
|
||||
// protected \$sortParent = 'somefield_parent';
|
||||
// protected \$treePrefix = 'somefield_title';
|
||||
|
||||
// protected \$tabs = array('Tabl 1','Tab 2'); // Use 'tab'=>0 OR 'tab'=>1 in the \$fields below to enable.
|
||||
|
||||
// protected \$listQry = \"SELECT * FROM `#tableName` WHERE field != '' \"; // Example Custom Query. LEFT JOINS allowed. Should be without any Order or Limit.
|
||||
|
@ -96,6 +96,12 @@ if(isset($_POST['updateprefs']))
|
||||
$mes->addError(PRFLAN_211);
|
||||
}
|
||||
|
||||
|
||||
if(!empty($_POST['passwordEncoding']) || !empty($_POST['ssl_enabled']))
|
||||
{
|
||||
$_POST['password_CHAP'] = 0; // disable chap unless using md5 without SSL.
|
||||
}
|
||||
|
||||
// Table of range checking values - min and max for numerics. Only do the important ones
|
||||
$pref_limits = array('loginname_maxlength' => array('min' => 10, 'max' => 100, 'default' => 30),
|
||||
'displayname_maxlength' => array('min' => 5, 'max' => 100, 'default' => 15),
|
||||
@ -1427,7 +1433,10 @@ $text .= "
|
||||
|
||||
$text .= "
|
||||
<td><label for='password-chap'>".PRFLAN_178."</label></td>
|
||||
<td>".$frm->select('password_CHAP',$CHAP_list,$pref['password_CHAP'] );
|
||||
<td>";
|
||||
|
||||
$CHAPopt = !empty($pref['ssl_enabled']) || !empty($pref['passwordEncoding']) ? array('disabled'=>1) : null;
|
||||
$text .= $frm->select('password_CHAP',$CHAP_list,$pref['password_CHAP'], $CHAPopt );
|
||||
//." ".$frm->select_open('password_CHAP');
|
||||
|
||||
//TODO - user tracking session name - visible only if Cookie is enabled (JS)
|
||||
|
@ -16,7 +16,7 @@ if (!getperms('X'))
|
||||
e107::redirect('admin');
|
||||
exit;
|
||||
}
|
||||
|
||||
e107::coreLan('search');// need LAN_SEARCH_98
|
||||
e107::coreLan('search', true);
|
||||
|
||||
$e_sub_cat = 'search';
|
||||
|
@ -10,6 +10,6 @@
|
||||
|
||||
if (!defined('e107_INIT')) { exit; }
|
||||
|
||||
$e107info['e107_version'] = "2.1.5 (git)";
|
||||
$e107info['e107_version'] = "2.1.6 (git)";
|
||||
|
||||
?>
|
@ -157,12 +157,19 @@ class admin_shortcodes
|
||||
|
||||
if(function_exists('e_help') && ($tmp = e_help())) // new in v2.x for non-admin-ui admin pages.
|
||||
{
|
||||
$ns->setUniqueId('sc-admin-help');
|
||||
$help_text = $ns->tablerender($tmp['caption'],$tmp['text'],'e_help',true);
|
||||
}
|
||||
|
||||
if(e_PAGE === "menus.php") // quite fix to disable e107_admin/menus.php help file in all languages.
|
||||
{
|
||||
return $help_text;
|
||||
}
|
||||
|
||||
|
||||
$helpfile = '';
|
||||
|
||||
if(strpos(e_SELF, e_ADMIN_ABS) !== FALSE)
|
||||
if(strpos(e_SELF, e_ADMIN_ABS) !== false)
|
||||
{
|
||||
if (is_readable(e_LANGUAGEDIR.e_LANGUAGE.'/admin/help/'.e_PAGE))
|
||||
{
|
||||
@ -2169,12 +2176,12 @@ Inverse 10 <span class="badge badge-inverse">10</span>
|
||||
$c = 0;
|
||||
foreach($languages as $lng)
|
||||
{
|
||||
$checked = "<i > </i> ";
|
||||
$checked = "<i class='fa fa-fw'> </i> ";
|
||||
$code = $slng->convert($lng);
|
||||
|
||||
if($lng == e_LANGUAGE)
|
||||
{
|
||||
$checked = $tp->toGlyph('ok')." ";
|
||||
$checked = $tp->toGlyph('fa-check', array('fw'=>1))." ";
|
||||
$link = '#';
|
||||
}
|
||||
elseif(in_array(e_DOMAIN,$multiDoms))
|
||||
|
@ -90,29 +90,45 @@ class contact_shortcodes extends e_shortcode
|
||||
}
|
||||
|
||||
|
||||
/* example {CONTACT_NAME} */
|
||||
/* example {CONTACT_NAME: class=form-control} */
|
||||
/* example {CONTACT_NAME: class=col-md-12&placeholder=".LANCONTACT_03." *} */
|
||||
|
||||
function sc_contact_name($parm='')
|
||||
{
|
||||
$userName = deftrue('USERNAME');
|
||||
|
||||
return "<input type='text' id='contactName' title='".LANCONTACT_17."' name='author_name' required='required' size='30' class='tbox form-control' value=\"".varset($_POST['author_name'],$userName)."\" />";
|
||||
|
||||
$class = (!empty($parm['class'])) ? $parm['class'] : 'tbox form-control';
|
||||
$placeholder = (!empty($parm['placeholder'])) ? " placeholder= '".$parm['placeholder']."'" : '';
|
||||
return "<input type='text' id='contactName' title='".LANCONTACT_17."' name='author_name' required='required' size='30' ".$placeholder." class='".$class."' value=\"".varset($_POST['author_name'],$userName)."\" />";
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* example {CONTACT_EMAIL} */
|
||||
/* example {CONTACT_EMAIL: class=form-control} */
|
||||
/* example {CONTACT_EMAIL: class=col-md-12&placeholder=".LANCONTACT_04." *} */
|
||||
|
||||
function sc_contact_email($parm='')
|
||||
{
|
||||
$userEmail = deftrue('USEREMAIL');
|
||||
$disabled = (!empty($userEmail)) ? 'readonly' : ''; // don't allow change from a verified email address.
|
||||
|
||||
return "<input type='email' ".$disabled." id='contactEmail' title='".LANCONTACT_18."' name='email_send' required='required' size='30' class='tbox form-control' value='".(vartrue($_POST['email_send']) ? $_POST['email_send'] : USEREMAIL)."' />";
|
||||
$class = (!empty($parm['class'])) ? $parm['class'] : 'tbox form-control';
|
||||
$placeholder = (!empty($parm['placeholder'])) ? " placeholder= '".$parm['placeholder']."'" : '';
|
||||
return "<input type='email' ".$disabled." id='contactEmail' title='".LANCONTACT_18."' name='email_send' required='required' size='30' ".$placeholder." class='".$class."' value='".(vartrue($_POST['email_send']) ? $_POST['email_send'] : USEREMAIL)."' />";
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* example {CONTACT_SUBJECT} */
|
||||
/* example {CONTACT_SUBJECT: class=form-control} */
|
||||
/* example {CONTACT_SUBJECT: class=col-md-12&placeholder=".LANCONTACT_05." *} */
|
||||
|
||||
function sc_contact_subject($parm='')
|
||||
{
|
||||
return "<input type='text' id='contactSubject' title='".LANCONTACT_19."' name='subject' required='required' size='30' class='tbox form-control' value=\"".varset($_POST['subject'])."\" />";
|
||||
$class = (!empty($parm['class'])) ? $parm['class'] : 'tbox form-control';
|
||||
$placeholder = (!empty($parm['placeholder'])) ? " placeholder= '".$parm['placeholder']."'" : '';
|
||||
return "<input type='text' id='contactSubject' title='".LANCONTACT_19."' name='subject' required='required' size='30' ".$placeholder." class='".$class."' value=\"".varset($_POST['subject'])."\" />";
|
||||
}
|
||||
|
||||
|
||||
@ -131,18 +147,22 @@ class contact_shortcodes extends e_shortcode
|
||||
{
|
||||
$size = 'input-xxlarge';
|
||||
}
|
||||
|
||||
$class = (!empty($parm['class'])) ? $parm['class'] : 'tbox '.$size.' form-control';
|
||||
|
||||
|
||||
return "<textarea cols='{$cols}' id='contactBody' rows='{$rows}' title='".LANCONTACT_20."' name='body' ".$placeholder." required='required' class='tbox {$size} form-control'>".stripslashes(varset($_POST['body']))."</textarea>";
|
||||
return "<textarea cols='{$cols}' id='contactBody' rows='{$rows}' title='".LANCONTACT_20."' name='body' ".$placeholder." required='required' class='".$class."'>".stripslashes(varset($_POST['body']))."</textarea>";
|
||||
}
|
||||
|
||||
|
||||
/* example {CONTACT_SUBMIT_BUTTON} */
|
||||
/* example {CONTACT_SUBMIT_BUTTON: class=contact submit btn btn-minimal} */
|
||||
function sc_contact_submit_button($parm='')
|
||||
{
|
||||
return "<input type='submit' name='send-contactus' value=\"".LANCONTACT_08."\" class='btn btn-primary button' />";
|
||||
$class = (!empty($parm['class'])) ? $parm['class'] : 'btn btn-primary button';
|
||||
|
||||
return "<input type='submit' name='send-contactus' value=\"".LANCONTACT_08."\" class='".$class."' />";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
@ -5,7 +5,11 @@ e107::includeLan(e_PLUGIN."search_menu/languages/".e_LANGUAGE.".php");
|
||||
$text = "";
|
||||
if (!isset($SEARCH_SHORTCODE))
|
||||
{
|
||||
if (file_exists(THEME."search_template.php"))
|
||||
if (file_exists(THEME."templates/search_template.php"))
|
||||
{
|
||||
include(THEME."templates/search_template.php");
|
||||
}
|
||||
elseif (file_exists(THEME."search_template.php"))
|
||||
{
|
||||
include(THEME."search_template.php");
|
||||
}
|
||||
|
@ -440,7 +440,7 @@ if (!defined('E_16_FAILEDLOGIN')) {
|
||||
define("E_32_TRUE", "<i class='S32 e-true-32'></i>");
|
||||
|
||||
|
||||
|
||||
define("ADMIN_CHILD_ICON", '<img src="'.e_IMAGE_ABS.'generic/branchbottom.gif" class="treeprefix level-x icon" alt="" />'); // must use single quotes.
|
||||
define("ADMIN_TRUE_ICON", "<i class='fa fa-check text-success'></i>");
|
||||
define("ADMIN_FALSE_ICON", "<i class='fa fa-times text-danger'></i>");
|
||||
define("ADMIN_WARNING_ICON", "<i class='fa fa-warning text-warning'></i>");
|
||||
|
@ -168,10 +168,6 @@ echo e107::getUrl()->response()->renderMeta()."\n"; // render all the e107::meta
|
||||
echo "<title>".(defined('e_PAGETITLE') ? e_PAGETITLE.' - ' : (defined('PAGE_NAME') ? PAGE_NAME.' - ' : "")).SITENAME."</title>\n\n";
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//
|
||||
// D: Register CSS
|
||||
//
|
||||
@ -227,7 +223,7 @@ if (is_array($pref['e_meta_list']))
|
||||
|
||||
if(isset($pref['sitebutton']))
|
||||
{
|
||||
$appleIcon = $tp->thumbUrl($pref['sitebutton'],'w=144&h=144&crop=1',true);
|
||||
$appleIcon = $tp->thumbUrl($pref['sitebutton'],'w=144&h=144&crop=1',null, true);
|
||||
echo "<link rel='apple-touch-icon' href='".$appleIcon."' />\n";
|
||||
unset($appleIcon);
|
||||
}
|
||||
@ -273,30 +269,21 @@ else
|
||||
// Theme default
|
||||
|
||||
$e_js->themeCSS(THEME_STYLE, $css_default);
|
||||
|
||||
/* Moved to class2 and defined as THEME_STYLE
|
||||
if($e_pref->get('themecss') && file_exists(THEME.$e_pref->get('themecss')))
|
||||
|
||||
// Support for style.css - override theme default CSS
|
||||
if(file_exists(THEME."style_custom.css"))
|
||||
{
|
||||
//echo "<link rel='stylesheet' href='".THEME_ABS."{$pref['themecss']}' type='text/css' media='{$css_default}' />\n";
|
||||
$e_js->themeCSS($e_pref->get('themecss'), $css_default);
|
||||
$e_js->themeCSS('style_custom.css',$css_default);
|
||||
}
|
||||
else
|
||||
{
|
||||
// echo "<link rel='stylesheet' href='".THEME_ABS."style.css' type='text/css' media='{$css_default}' />\n";
|
||||
$e_js->themeCSS('style.css', $css_default);
|
||||
}
|
||||
*/
|
||||
|
||||
// Support for print and handheld media - override theme default CSS
|
||||
if(file_exists(THEME."style_mobile.css"))
|
||||
{
|
||||
//echo "<link rel='stylesheet' href='".THEME_ABS."style_mobile.css' type='text/css' media='handheld' />\n";
|
||||
//$css_default = "screen";
|
||||
$e_js->themeCSS('style_mobile.css', 'handheld');
|
||||
}
|
||||
|
||||
if(file_exists(THEME."style_print.css"))
|
||||
{
|
||||
// echo "<link rel='stylesheet' href='".THEME_ABS."style_print.css' type='text/css' media='print' />\n";
|
||||
// $css_default = "screen";
|
||||
$e_js->themeCSS('style_print.css', 'print');
|
||||
}
|
||||
}
|
||||
@ -474,7 +461,7 @@ if(function_exists('theme_head'))
|
||||
echo theme_head();
|
||||
}
|
||||
|
||||
// FIXME description and keywords meta tags shouldn't be sent on all pages
|
||||
/* @deprecated */
|
||||
$diz_merge = (defined("META_MERGE") && META_MERGE != FALSE && $pref['meta_description'][e_LANGUAGE]) ? $pref['meta_description'][e_LANGUAGE]." " : "";
|
||||
$key_merge = (defined("META_MERGE") && META_MERGE != FALSE && $pref['meta_keywords'][e_LANGUAGE]) ? $pref['meta_keywords'][e_LANGUAGE]."," : "";
|
||||
|
||||
@ -502,9 +489,15 @@ function render_meta($type)
|
||||
}
|
||||
}
|
||||
|
||||
echo (defined("META_DESCRIPTION")) ? "\n<meta name=\"description\" content=\"".$diz_merge.META_DESCRIPTION."\" />\n" : render_meta('description');
|
||||
echo (defined("META_KEYWORDS")) ? "\n<meta name=\"keywords\" content=\"".$key_merge.META_KEYWORDS."\" />\n" : render_meta('keywords');
|
||||
|
||||
// legay meta-tag checks.
|
||||
if(empty(e107::getUrl()->response()->getMetaKeywords()))
|
||||
{
|
||||
echo (defined("META_KEYWORDS")) ? "\n<meta name=\"keywords\" content=\"".$key_merge.META_KEYWORDS."\" />\n" : render_meta('keywords');
|
||||
}
|
||||
if(empty(e107::getUrl()->response()->getMetaDescription()))
|
||||
{
|
||||
echo (defined("META_DESCRIPTION")) ? "\n<meta name=\"description\" content=\"".$diz_merge.META_DESCRIPTION."\" />\n" : render_meta('description');
|
||||
}
|
||||
|
||||
//echo render_meta('copyright');
|
||||
//echo render_meta('author');
|
||||
|
@ -1092,7 +1092,7 @@ class e_admin_dispatcher
|
||||
if(!$this->checkModeAccess($currentMode))
|
||||
{
|
||||
$request->setAction('e403');
|
||||
e107::getMessage()->addError('You don\'t have permissions to view this page.')
|
||||
e107::getMessage()->addError(LAN_NO_PERMISSIONS)
|
||||
->addDebug('Mode access restriction triggered.');
|
||||
return false;
|
||||
}
|
||||
@ -1103,7 +1103,7 @@ class e_admin_dispatcher
|
||||
if(!$this->checkRouteAccess($route))
|
||||
{
|
||||
$request->setAction('e403');
|
||||
e107::getMessage()->addError('You don\'t have permissions to view this page.')
|
||||
e107::getMessage()->addError(LAN_NO_PERMISSIONS)
|
||||
->addDebug('Route access restriction triggered:'.$route);
|
||||
return false;
|
||||
}
|
||||
@ -1675,7 +1675,7 @@ class e_admin_controller
|
||||
if(!empty($this->disallow) && in_array($currentAction, $this->disallow))
|
||||
{
|
||||
$request->setAction('e403');
|
||||
e107::getMessage()->addError('You don\'t have permissions to view this page.')
|
||||
e107::getMessage()->addError(LAN_NO_PERMISSIONS)
|
||||
->addDebug('Controller action disallowed restriction triggered.');
|
||||
return false;
|
||||
}
|
||||
@ -1684,7 +1684,7 @@ class e_admin_controller
|
||||
if(!empty($this->allow) && !in_array($currentAction, $this->allow))
|
||||
{
|
||||
$request->setAction('e403');
|
||||
e107::getMessage()->addError('You don\'t have permissions to view this page.')
|
||||
e107::getMessage()->addError(LAN_NO_PERMISSIONS)
|
||||
->addDebug('Controller action not in allowed list restriction triggered.');
|
||||
return false;
|
||||
}
|
||||
@ -2167,7 +2167,7 @@ class e_admin_controller
|
||||
|
||||
public function E404Page()
|
||||
{
|
||||
return '<div class="center">'.LAN_UI_404_BODY_ERROR.'</div>'; // TODO - lan
|
||||
return '<div class="center">'.LAN_UI_404_BODY_ERROR.'</div>';
|
||||
}
|
||||
|
||||
|
||||
@ -2184,7 +2184,7 @@ class e_admin_controller
|
||||
|
||||
public function E403Page()
|
||||
{
|
||||
return '<div class="center">'.LAN_UI_403_BODY_ERROR.'</div>'; // TODO - lan
|
||||
return '<div class="center">'.LAN_UI_403_BODY_ERROR.'</div>';
|
||||
}
|
||||
|
||||
|
||||
@ -2345,6 +2345,10 @@ class e_admin_controller_ui extends e_admin_controller
|
||||
/**
|
||||
* @var array UI field data
|
||||
*/
|
||||
|
||||
|
||||
protected $pid;
|
||||
|
||||
protected $fields = array();
|
||||
|
||||
/**
|
||||
@ -2415,6 +2419,16 @@ class e_admin_controller_ui extends e_admin_controller
|
||||
* @var string field containing the order number
|
||||
*/
|
||||
protected $sortField = null;
|
||||
|
||||
/**
|
||||
* @var string field containing the order number
|
||||
*/
|
||||
protected $treePrefix = null;
|
||||
|
||||
/**
|
||||
* @var string field containing the parent field
|
||||
*/
|
||||
protected $sortParent = null;
|
||||
|
||||
/**
|
||||
* @var int reorder step
|
||||
@ -2611,6 +2625,26 @@ class e_admin_controller_ui extends e_admin_controller
|
||||
{
|
||||
return $this->sortField;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Sort Field data
|
||||
* @return string
|
||||
*/
|
||||
public function getSortParent()
|
||||
{
|
||||
return $this->sortParent;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Get Sort Field data
|
||||
* @return string
|
||||
*/
|
||||
public function getTreePrefix()
|
||||
{
|
||||
return $this->treePrefix;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Tab data
|
||||
@ -3140,7 +3174,22 @@ class e_admin_controller_ui extends e_admin_controller
|
||||
switch($trigger[0])
|
||||
{
|
||||
|
||||
case 'sefgen':
|
||||
$field = $trigger[1];
|
||||
$value = $trigger[2];
|
||||
|
||||
//handleListBatch(); for custom handling of all field names
|
||||
if(empty($selected)) return $this;
|
||||
$method = 'handle'.$this->getRequest()->getActionName().'SefgenBatch';
|
||||
if(method_exists($this, $method)) // callback handling
|
||||
{
|
||||
$this->$method($selected, $field, $value);
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case 'export':
|
||||
if(empty($selected)) return $this;
|
||||
$method = 'handle'.$this->getRequest()->getActionName().'ExportBatch';
|
||||
if(method_exists($this, $method)) // callback handling
|
||||
{
|
||||
@ -3246,8 +3295,7 @@ class e_admin_controller_ui extends e_admin_controller
|
||||
// check userclass manager class
|
||||
if (!isset($e_userclass->class_tree[$id]) || !$user->checkClass($e_userclass->class_tree[$id]))
|
||||
{
|
||||
// TODO lan
|
||||
$msg = $tp->lanVars("You don't have management permissions on [x]",$label);
|
||||
$msg = $tp->lanVars(LAN_NO_ADMIN_PERMISSION,$label);
|
||||
$this->getTreeModel()->addMessageWarning($msg);
|
||||
unset($classes[$id],$msg);
|
||||
}
|
||||
@ -3304,11 +3352,11 @@ class e_admin_controller_ui extends e_admin_controller
|
||||
case 'datestamp':
|
||||
|
||||
$dateConvert = array(
|
||||
"hour" => "1 hour ago",
|
||||
"day" => "24 hours ago",
|
||||
"week" => "1 week ago",
|
||||
"month" => "1 month ago",
|
||||
"year" => "1 year ago"
|
||||
"hour" => LAN_UI_FILTER_PAST_HOUR,//"1 hour ago",//etc
|
||||
"day" => LAN_UI_FILTER_PAST_24_HOURS,
|
||||
"week" => LAN_UI_FILTER_PAST_WEEK,
|
||||
"month" => LAN_UI_FILTER_PAST_MONTH,
|
||||
"year" => LAN_UI_FILTER_PAST_YEAR
|
||||
);
|
||||
|
||||
$ky = $filter[2];
|
||||
@ -3998,10 +4046,24 @@ class e_admin_controller_ui extends e_admin_controller
|
||||
$qry .= "\n".implode("\n", $joins);
|
||||
}
|
||||
}
|
||||
else
|
||||
else // default listQry
|
||||
{
|
||||
if(!empty($listQry))
|
||||
{
|
||||
$qry = $this->parseCustomListQry($listQry);
|
||||
}
|
||||
elseif($this->sortField && $this->sortParent) // automated 'tree' sorting.
|
||||
{
|
||||
// $qry = "SELECT SQL_CALC_FOUND_ROWS a. *, CASE WHEN a.".$this->sortParent." = 0 THEN a.".$this->sortField." ELSE b.".$this->sortField." + (( a.".$this->sortField.")/1000) END AS treesort FROM `#".$this->table."` AS a LEFT JOIN `#".$this->table."` AS b ON a.".$this->sortParent." = b.".$this->pid;
|
||||
$qry = $this->getParentChildQry();
|
||||
$this->listOrder = '_treesort '; // .$this->sortField;
|
||||
// $this->orderStep = ($this->orderStep === 1) ? 100 : $this->orderStep;
|
||||
}
|
||||
else
|
||||
{
|
||||
$qry = "SELECT SQL_CALC_FOUND_ROWS ".$tableSFields." FROM ".$tableFrom;
|
||||
}
|
||||
|
||||
$qry = $listQry ? $this->parseCustomListQry($listQry) : "SELECT SQL_CALC_FOUND_ROWS ".$tableSFields." FROM ".$tableFrom;
|
||||
}
|
||||
|
||||
// group field - currently auto-added only if there are joins
|
||||
@ -4118,6 +4180,94 @@ class e_admin_controller_ui extends e_admin_controller
|
||||
return $qry;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return a Parent/Child SQL Query based on sortParent and sortField variables
|
||||
* @param bool|false $orderby - include 'ORDER BY' in the qry.
|
||||
* @return string
|
||||
*/
|
||||
public function getParentChildQry($orderby=false)
|
||||
{
|
||||
|
||||
$parent= $this->getSortParent();
|
||||
$table = $this->getTableName();
|
||||
$pid = $this->getPrimaryName();
|
||||
$order = $this->getSortField();
|
||||
|
||||
|
||||
|
||||
$sql = "DROP FUNCTION IF EXISTS `getDepth` ;";
|
||||
|
||||
e107::getDb()->gen($sql);
|
||||
|
||||
|
||||
$sql = "
|
||||
CREATE FUNCTION `getDepth` (project_id INT) RETURNS int
|
||||
BEGIN
|
||||
DECLARE depth INT;
|
||||
SET depth=1;
|
||||
|
||||
WHILE project_id > 0 DO
|
||||
|
||||
SELECT IFNULL(".$parent.",-1)
|
||||
INTO project_id
|
||||
FROM ( SELECT ".$parent." FROM `#".$table."` WHERE ".$pid." = project_id) AS t;
|
||||
|
||||
IF project_id > 0 THEN
|
||||
SET depth = depth + 1;
|
||||
END IF;
|
||||
|
||||
END WHILE;
|
||||
|
||||
RETURN depth;
|
||||
|
||||
END
|
||||
;
|
||||
";
|
||||
|
||||
|
||||
e107::getDb()->gen($sql);
|
||||
|
||||
$sql = "DROP FUNCTION IF EXISTS `getTreeSort`;";
|
||||
|
||||
e107::getDb()->gen($sql);
|
||||
$sql = "
|
||||
CREATE FUNCTION getTreeSort(incid INT)
|
||||
RETURNS CHAR(255)
|
||||
BEGIN
|
||||
SET @parentstr = CONVERT(incid, CHAR);
|
||||
SET @parent = -1;
|
||||
label1: WHILE @parent != 0 DO
|
||||
SET @parent = (SELECT ".$parent." FROM `#".$table."` WHERE ".$pid." =incid);
|
||||
SET @order = (SELECT ".$order." FROM `#".$table."` WHERE ".$pid." =incid);
|
||||
SET @parentstr = CONCAT(if(@parent = 0,'',@parent), LPAD(@order,4,0), @parentstr);
|
||||
SET incid = @parent;
|
||||
END WHILE label1;
|
||||
|
||||
RETURN @parentstr;
|
||||
END
|
||||
;
|
||||
|
||||
";
|
||||
|
||||
|
||||
e107::getDb()->gen($sql);
|
||||
|
||||
$qry = "SELECT SQL_CALC_FOUND_ROWS *, getTreeSort(".$pid.") as _treesort, getDepth(".$pid.") as _depth FROM `#".$table."` ";
|
||||
|
||||
if($orderby === true)
|
||||
{
|
||||
$qry .= " ORDER BY _treesort";
|
||||
}
|
||||
|
||||
return $qry;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Manage submit item
|
||||
* Note: $callbackBefore will break submission if returns false
|
||||
@ -4164,7 +4314,26 @@ class e_admin_controller_ui extends e_admin_controller
|
||||
|
||||
// - Autoincrement sortField on 'Create'.
|
||||
|
||||
if(($_posted['etrigger_submit'] === 'create') && !empty($this->sortField) && empty($this->sortParent) && empty($_posted[$this->sortField]) )
|
||||
|
||||
// Prevent parent being assigned as self.
|
||||
if(!empty($this->sortParent) && $this->getAction() === 'edit' && ($model->getId() == $_posted[$this->sortParent] ) )
|
||||
{
|
||||
$vars = array(
|
||||
'x'=> $this->getFieldAttr($this->sortParent,'title'),
|
||||
'y'=> $this->getFieldAttr($this->pid,'title'),
|
||||
);
|
||||
|
||||
$message = e107::getParser()->lanVars(LAN_UI_X_CANT_EQUAL_Y, $vars);
|
||||
$model->addMessageWarning($message);
|
||||
$model->setMessages();
|
||||
$this->getUI()->addWarning($this->sortParent);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if(($this->getAction() === 'create') && !empty($this->sortField) && empty($this->sortParent) && empty($_posted[$this->sortField]) )
|
||||
{
|
||||
|
||||
$incVal = e107::getDb()->max($this->table, $this->sortField) + 1;
|
||||
@ -4296,6 +4465,7 @@ class e_admin_ui extends e_admin_controller_ui
|
||||
protected $sortField;
|
||||
protected $sortParent;
|
||||
protected $orderStep;
|
||||
protected $treePrefix;
|
||||
|
||||
|
||||
/**
|
||||
@ -4601,6 +4771,59 @@ class e_admin_ui extends e_admin_controller_ui
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Batch Export trigger
|
||||
* @param array $selected
|
||||
* @return void
|
||||
*/
|
||||
protected function handleListSefgenBatch($selected, $field, $value)
|
||||
{
|
||||
|
||||
$tree = $this->getTreeModel();
|
||||
$c= 0;
|
||||
foreach($selected as $id)
|
||||
{
|
||||
if(!$tree->hasNode($id))
|
||||
{
|
||||
e107::getMessage()->addError('Item #ID '.htmlspecialchars($id).' not found.');
|
||||
continue;
|
||||
}
|
||||
|
||||
$model = $tree->getNode($id);
|
||||
|
||||
$name = $model->get($value);
|
||||
|
||||
$sef = eHelper::title2sef($name,'dashl');
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$model->set($field, $sef);
|
||||
|
||||
|
||||
$model->save();
|
||||
|
||||
$data = $model->getData();
|
||||
|
||||
if($model->isModified())
|
||||
{
|
||||
$this->getModel()->setData($data)->save(false,true);
|
||||
$c++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
$caption = e107::getParser()->lanVars(LAN_UI_BATCH_BOOL_SUCCESS, $c, true);
|
||||
e107::getMessage()->addSuccess($caption);
|
||||
|
||||
// e107::getMessage()->moveToSession();
|
||||
// redirect
|
||||
// $this->redirect();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Batch URL trigger
|
||||
@ -4669,32 +4892,32 @@ class e_admin_ui extends e_admin_controller_ui
|
||||
|
||||
$res = $sql->insert('links', $linkArray);
|
||||
|
||||
// FIXME lans
|
||||
if($res !== FALSE)
|
||||
{
|
||||
e107::getMessage()->addSuccess('Created Sitelink: <b>'.($name ? $name : 'n/a')."</b>");
|
||||
$scount++;
|
||||
e107::getMessage()->addSuccess(LAN_CREATED.": ".LAN_SITELINK.": ".($name ? $name : 'n/a'));
|
||||
$scount++;
|
||||
}
|
||||
else
|
||||
{
|
||||
if($sql->getLastErrorNumber())
|
||||
{
|
||||
e107::getMessage()->addError('SQL Link Creation Error'); //TODO - Lan
|
||||
e107::getMessage()->addError(LAN_CREATED_FAILED.": ".LAN_SITELINK.": ".$name.": ".LAN_SQL_ERROR);
|
||||
e107::getMessage()->addDebug('SQL Link Creation Error #'.$sql->getLastErrorNumber().': '.$sql->getLastErrorText());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
e107::getMessage()->addError('Unknown error: <b>'.$name."</b> not added");
|
||||
e107::getMessage()->addError(LAN_CREATED_FAILED.": ".LAN_SITELINK.": ".$name.": ".LAN_UNKNOWN_ERROR);//Unknown Error
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
if($scount > 0)
|
||||
{
|
||||
e107::getMessage()->addSuccess("<br /><strong>{$scount}</strong> new sitelinks were added but are currently unassigned. You should now modify these links to your liking.<br /><br /><a class='btn btn-small btn-primary' href='".e_ADMIN_ABS."links.php?searchquery=&filter_options=link_category__255'>Modify Links</a>");
|
||||
if($scount > 0)
|
||||
{
|
||||
e107::getMessage()->addSuccess(LAN_CREATED." (".$scount.") ".ADLAN_138);
|
||||
e107::getMessage()->addSuccess("<a class='btn btn-small btn-primary' href='".e_ADMIN_ABS."links.php?searchquery=&filter_options=link_category__255'>".LAN_CONFIGURE." ".ADLAN_138."</a>");
|
||||
return $scount;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
@ -4749,30 +4972,29 @@ class e_admin_ui extends e_admin_controller_ui
|
||||
|
||||
$res = $sql->insert('featurebox', $fbArray);
|
||||
|
||||
// FIXME lans
|
||||
if($res !== FALSE)
|
||||
{
|
||||
e107::getMessage()->addSuccess('Created Featurebox Item: <b>'.($name ? $name : 'n/a')."</b>");
|
||||
$scount++;
|
||||
e107::getMessage()->addSuccess(LAN_CREATED.": ".LAN_PLUGIN_FEATUREBOX_NAME.": ".($name ? $name : 'n/a'));
|
||||
$scount++;
|
||||
}
|
||||
else
|
||||
{
|
||||
if($sql->getLastErrorNumber())
|
||||
{
|
||||
e107::getMessage()->addError('SQL Featurebox Creation Error'); //TODO - Lan
|
||||
e107::getMessage()->addDebug('SQL Featurebox Creation Error #'.$sql->getLastErrorNumber().': '.$sql->getLastErrorText());
|
||||
e107::getMessage()->addError(LAN_CREATED_FAILED.": ".LAN_PLUGIN_FEATUREBOX_NAME.": ".$name.": ".LAN_SQL_ERROR);
|
||||
e107::getMessage()->addDebug('SQL Featurebox Creation Error #'.$sql->getLastErrorNumber().': '.$sql->getLastErrorText());
|
||||
}
|
||||
else
|
||||
{
|
||||
e107::getMessage()->addError('Unknown error: <b>'.$name."</b> not added");
|
||||
e107::getMessage()->addError(LAN_CREATED_FAILED.": ".$name.": ".LAN_UNKNOWN_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if($scount > 0)
|
||||
{
|
||||
e107::getMessage()->addSuccess("<br /><strong>{$scount}</strong> new featurebox items were added but are currently unassigned. You should now modify these items to your liking.<br /><br /><a class='btn btn-small btn-primary' href='".e_PLUGIN_ABS."featurebox/admin_config.php?searchquery=&filter_options=fb_category__{$category}'>Modify Featurebox Items</a>");
|
||||
e107::getMessage()->addSuccess(LAN_CREATED." (".$scount.") ".LAN_PLUGIN_FEATUREBOX_NAME);
|
||||
e107::getMessage()->addSuccess("<a class='btn btn-small btn-primary' href='".e_PLUGIN_ABS."featurebox/admin_config.php?searchquery=&filter_options=fb_category__{$category}'".LAN_CONFIGURE." ".LAN_PLUGIN_FEATUREBOX_NAME."</a>");
|
||||
return $scount;
|
||||
}
|
||||
|
||||
@ -4891,8 +5113,8 @@ class e_admin_ui extends e_admin_controller_ui
|
||||
}
|
||||
else
|
||||
{
|
||||
// TODO lan
|
||||
$this->getTreeModel()->addMessageWarning("Comma list is empty, aborting.")->setMessages();
|
||||
$this->getTreeModel()->addMessageWarning(LAN_UPDATED_FAILED)->setMessages();//"Comma list is empty, aborting."
|
||||
$this->getTreeModel()->addDebug(LAN_UPDATED_FAILED.": Comma list is empty, aborting.")->setMessages();
|
||||
}
|
||||
break;
|
||||
|
||||
@ -4984,7 +5206,10 @@ class e_admin_ui extends e_admin_controller_ui
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$cnt = $this->getTreeModel()->update($field, $val, $selected, true, false);
|
||||
if($cnt)
|
||||
{
|
||||
@ -5139,7 +5364,7 @@ class e_admin_ui extends e_admin_controller_ui
|
||||
{
|
||||
header($protocol.': 404 Not Found', true, 404);
|
||||
header("Status: 404 Not Found", true, 404);
|
||||
echo 'Field not found'; // FIXME lan
|
||||
echo LAN_FIELD.": ".$this->fields[$_POST['name']].": ".LAN_NOT_FOUND; // Field: x: not found!
|
||||
$this->logajax('Field not found');
|
||||
return;
|
||||
}
|
||||
@ -5154,7 +5379,7 @@ class e_admin_ui extends e_admin_controller_ui
|
||||
{
|
||||
header($protocol.': 403 Forbidden', true, 403);
|
||||
header("Status: 403 Forbidden", true, 403);
|
||||
echo 'Forbidden'; // FIXME lan
|
||||
echo ADLAN_86; //Forbidden
|
||||
$this->logajax("Forbidden");
|
||||
return;
|
||||
}
|
||||
@ -5255,10 +5480,18 @@ class e_admin_ui extends e_admin_controller_ui
|
||||
$updated[] = "#".$id." -- ".$this->sortField." = ".$c;
|
||||
}
|
||||
// echo($sql->getLastQuery()."\n");
|
||||
$c += $step;
|
||||
$c++; // += $step;
|
||||
|
||||
}
|
||||
|
||||
|
||||
if(!empty($this->sortParent) && !empty($this->sortField) )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
//file_put_contents(e_LOG."sortAjax.log", print_r($_POST['all'],true));
|
||||
|
||||
// Increment every other record after the current page of records.
|
||||
// $changed = (intval($_POST['neworder']) * $step) + $from ;
|
||||
$changed = $c - $step;
|
||||
@ -5268,10 +5501,10 @@ class e_admin_ui extends e_admin_controller_ui
|
||||
|
||||
|
||||
// ------------ Fix Child Order when parent is used. ----------------
|
||||
|
||||
/*
|
||||
if(!empty($this->sortParent) && !empty($this->sortField) ) // Make sure there is space for at least 99
|
||||
{
|
||||
|
||||
$parent = array();
|
||||
|
||||
$data2 = $sql->retrieve($this->table,$this->pid.','.$this->sortField,$this->sortParent .' = 0',true);
|
||||
foreach($data2 as $val)
|
||||
@ -5307,7 +5540,7 @@ class e_admin_ui extends e_admin_controller_ui
|
||||
|
||||
|
||||
}
|
||||
|
||||
*/
|
||||
$this->afterSort($result, $_POST);
|
||||
|
||||
// e107::getLog()->addDebug(print_r($_POST,true))->toFile('SortAjax','Admin-UI Ajax Sort Log', true);
|
||||
@ -5823,6 +6056,7 @@ class e_admin_form_ui extends e_form
|
||||
protected $_controller = null;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* @param e_admin_ui $controller
|
||||
@ -5876,8 +6110,77 @@ class e_admin_form_ui extends e_form
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @todo Get a 'depth/level' field working with mysql and change the 'level' accordingly
|
||||
* @param mixed $curVal
|
||||
* @param string $mode read|write|inline
|
||||
* @param array $parm
|
||||
* @return array|string
|
||||
*/
|
||||
public function treePrefix($curVal, $mode, $parm)
|
||||
{
|
||||
$controller = $this->getController();
|
||||
$parentField = $controller->getSortParent();
|
||||
$treePrefixField = $controller->getTreePrefix();
|
||||
$parent = $controller->getListModel()->get($parentField);
|
||||
$level = $controller->getListModel()->get("_depth");
|
||||
|
||||
|
||||
if($mode === 'read')
|
||||
{
|
||||
|
||||
$inline = $this->getController()->getFieldAttr($treePrefixField,'inline');
|
||||
|
||||
if($inline === true)
|
||||
{
|
||||
return $curVal;
|
||||
}
|
||||
|
||||
$level_image = $parent ? str_replace('level-x','level-'.$level, ADMIN_CHILD_ICON) : '';
|
||||
|
||||
return ($parent) ? $level_image.$curVal : $curVal;
|
||||
|
||||
}
|
||||
|
||||
|
||||
if($mode === 'inline')
|
||||
{
|
||||
$ret = array('inlineType'=>'text');
|
||||
|
||||
if(!empty($parent))
|
||||
{
|
||||
$ret['inlineParms'] = array('pre'=> str_replace('level-x','level-'.$level, ADMIN_CHILD_ICON));
|
||||
}
|
||||
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
if($mode == 'write') // not used.
|
||||
{
|
||||
// return $frm->text('forum_name',$curVal,255,'size=xxlarge');
|
||||
}
|
||||
|
||||
if($mode == 'filter')
|
||||
{
|
||||
return;
|
||||
}
|
||||
if($mode == 'batch')
|
||||
{
|
||||
return;
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* TODO - lans
|
||||
* Generic DB Record Creation Form.
|
||||
* @return string
|
||||
*/
|
||||
@ -5942,7 +6245,6 @@ class e_admin_form_ui extends e_form
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO - lans
|
||||
* Generic Settings Form.
|
||||
* @return string
|
||||
*/
|
||||
@ -6033,6 +6335,22 @@ class e_admin_form_ui extends e_form
|
||||
$fields['options']['sort'] = false;
|
||||
}
|
||||
|
||||
if($treefld = $controller->getTreePrefix())
|
||||
{
|
||||
$fields[$treefld]['type'] = 'method';
|
||||
$fields[$treefld]['method'] = 'treePrefix'; /* @see e_admin_form_ui::treePrefix(); */
|
||||
|
||||
$tr = $controller->getTreeModel()->toArray();
|
||||
|
||||
foreach($tr as $row)
|
||||
{
|
||||
e107::getDebug()->log($row[$treefld].' > '.$row['_treesort']);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
// ------------------------------------------
|
||||
|
||||
$coreBatchOptions = array(
|
||||
@ -6040,7 +6358,8 @@ class e_admin_form_ui extends e_form
|
||||
'copy' => $controller->getBatchCopy(),
|
||||
'url' => $controller->getBatchLink(),
|
||||
'featurebox' => $controller->getBatchFeaturebox(),
|
||||
'export' => $controller->getBatchExport()
|
||||
'export' => $controller->getBatchExport(),
|
||||
|
||||
|
||||
);
|
||||
|
||||
@ -6399,8 +6718,8 @@ class e_admin_form_ui extends e_form
|
||||
<div class='span6 col-md-6'>";
|
||||
|
||||
$selectStart = "<div class='form-inline input-inline'>
|
||||
<img src='".e_IMAGE_ABS."generic/branchbottom.gif' alt='' class='icon action' />
|
||||
<div class='input-group input-append'>
|
||||
".ADMIN_CHILD_ICON."
|
||||
<div class='input-group input-append'>
|
||||
".$this->select_open('etrigger_batch', array('class' => 'tbox form-control input-large select batch e-autosubmit reset', 'id' => false))."
|
||||
".$this->option(LAN_BATCH_LABEL_SELECTED, '', false);
|
||||
|
||||
@ -6414,6 +6733,10 @@ class e_admin_form_ui extends e_form
|
||||
$selectOpt .= !empty($options['url']) ? $this->option(LAN_UI_BATCH_CREATELINK, 'url', false, array('class' => 'ui-batch-option class', 'other' => 'style="padding-left: 15px"')) : '';
|
||||
$selectOpt .= !empty($options['featurebox']) ? $this->option(LAN_PLUGIN_FEATUREBOX_BATCH, 'featurebox', false, array('class' => 'ui-batch-option class', 'other' => 'style="padding-left: 15px"')) : '';
|
||||
|
||||
// if(!empty($parms['sef'])
|
||||
|
||||
|
||||
|
||||
if(!empty($customBatchOptions))
|
||||
{
|
||||
foreach($customBatchOptions as $key=>$val)
|
||||
@ -6499,6 +6822,17 @@ class e_admin_form_ui extends e_form
|
||||
|
||||
switch($val['type'])
|
||||
{
|
||||
|
||||
case 'text';
|
||||
|
||||
if(!empty($parms['sef']))
|
||||
{
|
||||
$option['sefgen__'.$key.'__'.$parms['sef']] = LAN_GENERATE;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
|
||||
case 'bool':
|
||||
case 'boolean': //TODO modify description based on $val['parm]
|
||||
if(vartrue($parms['reverse'])) // reverse true/false values;
|
||||
@ -6536,12 +6870,12 @@ class e_admin_form_ui extends e_form
|
||||
|
||||
if(isset($options['addAll']))
|
||||
{
|
||||
$option['attach_all__'.$key] = vartrue($options['addAll'], '(add all)');
|
||||
$option['attach_all__'.$key] = vartrue($options['addAll'], "(".LAN_ADD_ALL.")");
|
||||
unset($options['addAll']);
|
||||
}
|
||||
if(isset($options['clearAll']))
|
||||
{
|
||||
$_option['deattach_all__'.$key] = vartrue($options['clearAll'], '(clear all)');
|
||||
$_option['deattach_all__'.$key] = vartrue($options['clearAll'], "(".LAN_CLEAR_ALL.")");
|
||||
unset($options['clearAll']);
|
||||
}
|
||||
|
||||
@ -6549,16 +6883,16 @@ class e_admin_form_ui extends e_form
|
||||
{
|
||||
foreach ($options as $value)
|
||||
{
|
||||
$option['attach__'.$key.'__'.$value] = 'Add '.$value;
|
||||
$_option['deattach__'.$key.'__'.$value] = 'Remove '.$value;
|
||||
$option['attach__'.$key.'__'.$value] = LAN_ADD." ".$value;
|
||||
$_option['deattach__'.$key.'__'.$value] = LAN_REMOVE." ".$value;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach ($options as $value => $label)
|
||||
{
|
||||
$option['attach__'.$key.'__'.$value] = 'Add '.$label;
|
||||
$_option['deattach__'.$key.'__'.$value] = 'Remove '.$label;
|
||||
$option['attach__'.$key.'__'.$value] = LAN_ADD." ".$label;
|
||||
$_option['deattach__'.$key.'__'.$value] = LAN_REMOVE." ".$label;
|
||||
}
|
||||
}
|
||||
$option = array_merge($option, $_option);
|
||||
@ -6648,14 +6982,12 @@ class e_admin_form_ui extends e_form
|
||||
break;
|
||||
|
||||
case 'datestamp':
|
||||
//TODO today, yesterday, this-month, last-month .
|
||||
|
||||
$dateFilters = array (
|
||||
$dateFilters = array (
|
||||
'hour' => LAN_UI_FILTER_PAST_HOUR,
|
||||
"day" => LAN_UI_FILTER_PAST_24_HOURS,
|
||||
"week" => LAN_UI_FILTER_PAST_WEEK,
|
||||
"month" => LAN_UI_FILTER_PAST_MONTH,
|
||||
"year" => LAN_UI_FILTER_PAST_YEAR
|
||||
"day" => LAN_UI_FILTER_PAST_24_HOURS,
|
||||
"week" => LAN_UI_FILTER_PAST_WEEK,
|
||||
"month" => LAN_UI_FILTER_PAST_MONTH,
|
||||
"year" => LAN_UI_FILTER_PAST_YEAR
|
||||
);
|
||||
|
||||
foreach($dateFilters as $k => $name)
|
||||
@ -6679,14 +7011,13 @@ class e_admin_form_ui extends e_form
|
||||
|
||||
if($type === 'batch')
|
||||
{
|
||||
// FIXME Lan
|
||||
foreach ($classes as $k => $v)
|
||||
{
|
||||
$option['ucadd__'.$key.'__'.$k] = LAN_ADD.' '.$v;
|
||||
$_option['ucremove__'.$key.'__'.$k] = 'Remove '.$v;
|
||||
$option['ucadd__'.$key.'__'.$k] = LAN_ADD.' '.$v;
|
||||
$_option['ucremove__'.$key.'__'.$k] = LAN_REMOVE." ".$v;
|
||||
}
|
||||
$option['ucaddall__'.$key] = '(add all)';
|
||||
$_option['ucdelall__'.$key] = '(clear all)';
|
||||
$option['ucaddall__'.$key] = "(".LAN_ADD_ALL.")";
|
||||
$_option['ucdelall__'.$key] = "(".LAN_CLEAR_ALL.")";
|
||||
$option = array_merge($option, $_option);
|
||||
}
|
||||
else
|
||||
@ -6741,7 +7072,7 @@ class e_admin_form_ui extends e_form
|
||||
}
|
||||
else
|
||||
{
|
||||
$option[$key.'__'.$k] = vartrue($data['user_name'],'Unknown');
|
||||
$option[$key.'__'.$k] = vartrue($data['user_name'],LAN_UNKNOWN);
|
||||
}
|
||||
|
||||
|
||||
|
@ -782,7 +782,7 @@ class e107_db_debug {
|
||||
$message = "<pre>".print_r($message,true)."</pre>";
|
||||
}
|
||||
|
||||
if (!E107_DBG_BASIC && !E107_DBG_ALLERRORS && !E107_DBG_SQLDETAILS && !E107_DBG_NOTICES)
|
||||
if (!deftrue('E107_DBG_BASIC') && !deftrue('E107_DBG_ALLERRORS') && !deftrue('E107_DBG_SQLDETAILS') && !deftrue('E107_DBG_NOTICES'))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -2416,6 +2416,73 @@ class e107
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the e_url config - new v2.1.6
|
||||
* @return array
|
||||
*/
|
||||
public static function getUrlConfig($mode='config')
|
||||
{
|
||||
$new_addon = array();
|
||||
|
||||
$filename = 'e_url';
|
||||
$elist = self::getPref($filename.'_list');
|
||||
$className = substr($filename, 2); // remove 'e_'
|
||||
$methodName = 'config';
|
||||
|
||||
$profile = null; // for future use.
|
||||
|
||||
if(!empty($elist))
|
||||
{
|
||||
foreach(array_keys($elist) as $key)
|
||||
{
|
||||
if(is_readable(e_PLUGIN.$key.'/'.$filename.'.php'))
|
||||
{
|
||||
include_once(e_PLUGIN.$key.'/'.$filename.'.php');
|
||||
|
||||
$class_name = $key.'_'.$className;
|
||||
|
||||
if(is_object($class_name))
|
||||
{
|
||||
$obj = $class_name;
|
||||
$class_name = get_class($obj);
|
||||
}
|
||||
else
|
||||
{
|
||||
$obj = new $class_name;
|
||||
}
|
||||
|
||||
if($mode === 'alias')
|
||||
{
|
||||
if(!empty($obj->alias))
|
||||
{
|
||||
$new_addon[$key] = $obj->alias;
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
$array = self::callMethod($obj, $methodName,$profile);
|
||||
|
||||
if($array)
|
||||
{
|
||||
foreach($array as $k=>$v)
|
||||
{
|
||||
if(empty($v['alias']) && !empty($obj->alias))
|
||||
{
|
||||
$v['alias'] = $obj->alias;
|
||||
}
|
||||
$new_addon[$key][$k] = $v;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $new_addon;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get theme name or path.
|
||||
@ -3157,7 +3224,7 @@ class e107
|
||||
|
||||
if(!$tmp = self::getRegistry('core/e107/addons/e_url'))
|
||||
{
|
||||
$tmp = self::getAddonConfig('e_url');
|
||||
$tmp = self::getUrlConfig();
|
||||
self::setRegistry('core/e107/addons/e_url',$tmp);
|
||||
}
|
||||
|
||||
@ -3165,6 +3232,8 @@ class e107
|
||||
|
||||
$pref = self::getPref('e_url_alias');
|
||||
$sefActive = self::getPref('e_url_list');
|
||||
$rootNamespace = self::getPref('url_main_module');
|
||||
|
||||
|
||||
if(is_string($options)) // backwards compat.
|
||||
{
|
||||
@ -3185,12 +3254,22 @@ class e107
|
||||
$options['fragment'] = '#' . $options['fragment'];
|
||||
}
|
||||
|
||||
if(varset($tmp[$plugin][$key]['sef']))
|
||||
if(!empty($tmp[$plugin][$key]['sef']))
|
||||
{
|
||||
if(!empty($tmp[$plugin][$key]['alias']))
|
||||
{
|
||||
$alias = (!empty($pref[e_LAN][$plugin][$key])) ? $pref[e_LAN][$plugin][$key] : $tmp[$plugin][$key]['alias'];
|
||||
$tmp[$plugin][$key]['sef'] = str_replace('{alias}', $alias, $tmp[$plugin][$key]['sef']);
|
||||
|
||||
if(!empty($rootNamespace) && $rootNamespace === $plugin)
|
||||
{
|
||||
$replaceAlias = array('{alias}\/','{alias}/');
|
||||
$tmp[$plugin][$key]['sef'] = str_replace($replaceAlias, '', $tmp[$plugin][$key]['sef']);
|
||||
}
|
||||
else
|
||||
{
|
||||
$tmp[$plugin][$key]['sef'] = str_replace('{alias}', $alias, $tmp[$plugin][$key]['sef']);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -1350,23 +1350,25 @@ class e_parse extends e_parser
|
||||
|
||||
$text = html_entity_decode($text,ENT_QUOTES,'utf-8');
|
||||
|
||||
return mb_strimwidth($text, 0, $len, $more);
|
||||
if(function_exists('mb_strimwidth'))
|
||||
{
|
||||
return mb_strimwidth($text, 0, $len, $more);
|
||||
}
|
||||
|
||||
// $ret = $this->usubstr($text, 0, $len);
|
||||
$ret = $this->usubstr($text, 0, $len);
|
||||
|
||||
// search for possible broken html entities
|
||||
// - if an & is in the last 8 chars, removing it and whatever follows shouldn't hurt
|
||||
// it should work for any characters encoding
|
||||
|
||||
/*
|
||||
|
||||
$leftAmp = $this->ustrrpos($this->usubstr($ret, -8), '&');
|
||||
if($leftAmp)
|
||||
{
|
||||
$ret = $this->usubstr($ret, 0, $this->ustrlen($ret) - 8 + $leftAmp);
|
||||
}
|
||||
|
||||
return $ret.$more;*/
|
||||
return $ret.$more;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -1539,17 +1541,25 @@ class e_parse extends e_parser
|
||||
}
|
||||
|
||||
// Turn off a few things if not enabled in options
|
||||
if(!vartrue($pref['smiley_activate']))
|
||||
if(empty($pref['smiley_activate']))
|
||||
{
|
||||
$opts['emotes'] = FALSE;
|
||||
$opts['emotes'] = false;
|
||||
}
|
||||
if(!vartrue($pref['make_clickable']))
|
||||
|
||||
if(empty($pref['make_clickable']))
|
||||
{
|
||||
$opts['link_click'] = FALSE;
|
||||
$opts['link_click'] = false;
|
||||
}
|
||||
if(!vartrue($pref['link_replace']))
|
||||
|
||||
if(empty($pref['link_replace']))
|
||||
{
|
||||
$opts['link_replace'] = FALSE;
|
||||
$opts['link_replace'] = false;
|
||||
}
|
||||
|
||||
if($this->isHtml($text)) //BC FIx for when HTML is saved without [html][/html]
|
||||
{
|
||||
$opts['nobreak'] = true;
|
||||
$text = trim($text);
|
||||
}
|
||||
|
||||
$fromadmin = $opts['fromadmin'];
|
||||
@ -1568,7 +1578,7 @@ class e_parse extends e_parser
|
||||
$text = strip_tags($text);
|
||||
}
|
||||
|
||||
if (MAGIC_QUOTES_GPC == TRUE) // precaution for badly saved data.
|
||||
if (MAGIC_QUOTES_GPC === true) // precaution for badly saved data.
|
||||
{
|
||||
$text = stripslashes($text);
|
||||
}
|
||||
@ -1590,7 +1600,7 @@ class e_parse extends e_parser
|
||||
|
||||
|
||||
|
||||
if ($parseBB == FALSE)
|
||||
if ($parseBB == false)
|
||||
{
|
||||
$content = array($text);
|
||||
}
|
||||
@ -4077,17 +4087,25 @@ class e_parser
|
||||
*/
|
||||
function isBBcode($text)
|
||||
{
|
||||
$bbsearch = array('[/h]','[/b]','[/link]', '[/right]');
|
||||
|
||||
if(str_replace($bbsearch,'',$text))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
if(preg_match('#(?<=<)\w+(?=[^<]*?>)#', $text))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
$bbsearch = array('[/h]', '[/b]', '[/link]', '[/right]', '[/center]', '[/flash]', '[/code]', '[/table]');
|
||||
|
||||
foreach($bbsearch as $v)
|
||||
{
|
||||
if(strpos($text,$v)!==false)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -66,6 +66,7 @@ class e_form
|
||||
protected $_tabindex_counter = 0;
|
||||
protected $_tabindex_enabled = true;
|
||||
protected $_cached_attributes = array();
|
||||
protected $_field_warnings = array();
|
||||
|
||||
|
||||
|
||||
@ -84,6 +85,13 @@ class e_form
|
||||
$this->setRequiredString('<span class="required">* </span>');
|
||||
}
|
||||
|
||||
|
||||
public function addWarning($field)
|
||||
{
|
||||
$this->_field_warnings[] = $field;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Open a new form
|
||||
* @param string name
|
||||
@ -802,10 +810,22 @@ class e_form
|
||||
function number($name, $value=0, $maxlength = 200, $options = array())
|
||||
{
|
||||
if(is_string($options)) parse_str($options, $options);
|
||||
if (empty($options['maxlength'])) $maxlength = $options['maxlength'];
|
||||
|
||||
if(!empty($options['maxlength']))
|
||||
{
|
||||
$maxlength = $options['maxlength'];
|
||||
}
|
||||
|
||||
unset($options['maxlength']);
|
||||
if(empty($options['size'])) $options['size'] = 15;
|
||||
if(empty($options['class'])) $options['class'] = 'tbox number e-spinner input-small ';
|
||||
|
||||
if(empty($options['size']))
|
||||
{
|
||||
$options['size'] = 15;
|
||||
}
|
||||
if(empty($options['class']))
|
||||
{
|
||||
$options['class'] = 'tbox number e-spinner input-small ';
|
||||
}
|
||||
|
||||
if(!empty($options['size']))
|
||||
{
|
||||
@ -2995,9 +3015,14 @@ class e_form
|
||||
|
||||
$text = '<ul class="breadcrumb">
|
||||
<li>';
|
||||
|
||||
|
||||
foreach($array as $val)
|
||||
{
|
||||
if($val['url'] === e_REQUEST_URI) // automatic link removal for current page.
|
||||
{
|
||||
$val['url']= null;
|
||||
}
|
||||
|
||||
$ret = "";
|
||||
$ret .= vartrue($val['url']) ? "<a href='".$val['url']."'>" : "";
|
||||
$ret .= vartrue($val['text'],'');
|
||||
@ -3995,6 +4020,67 @@ class e_form
|
||||
return $text;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a value should be linked and wrap in <a> tag if required.
|
||||
* @todo global pref for the target option?
|
||||
* @param mixed $value
|
||||
* @param array $parms
|
||||
* @param $id
|
||||
* @return string
|
||||
*/
|
||||
private function renderLink($value, $parms, $id=null)
|
||||
{
|
||||
if(empty($parms['link']) && empty($parms['url']))
|
||||
{
|
||||
return $value;
|
||||
}
|
||||
|
||||
$dialog = vartrue($parms['target']) =='dialog' ? " e-modal" : ""; // iframe
|
||||
$ext = vartrue($parms['target']) =='blank' ? " rel='external' " : ""; // new window
|
||||
$modal = vartrue($parms['target']) =='modal' ? " data-toggle='modal' data-cache='false' data-target='#uiModal' " : "";
|
||||
|
||||
|
||||
if(!empty($parms['url'])) // ie. use e_url.php
|
||||
{
|
||||
$plugin = $this->getController()->getPluginName();
|
||||
$data = $this->getController()->getListModel()->getData();
|
||||
$link = e107::url($plugin,$parms['url'],$data);
|
||||
}
|
||||
else // old way.
|
||||
{
|
||||
$tp = e107::getParser();
|
||||
|
||||
$link = str_replace('[id]',$id,$parms['link']);
|
||||
$link = $tp->replaceConstants($link); // SEF URL is not important since we're in admin.
|
||||
|
||||
|
||||
if($parms['link'] === 'sef' && $this->getController()->getListModel())
|
||||
{
|
||||
$model = $this->getController()->getListModel();
|
||||
|
||||
if(!$model->getUrl())
|
||||
{
|
||||
$model->setUrl($this->getController()->getUrl());
|
||||
}
|
||||
// assemble the url
|
||||
$link = $model->url(null);
|
||||
}
|
||||
elseif(!empty($data[$parms['link']])) // support for a field-name as the link. eg. link_url.
|
||||
{
|
||||
$data = $this->getController()->getListModel()->getData();
|
||||
$link = $tp->replaceConstants(vartrue($data[$parms['link']]));
|
||||
}
|
||||
}
|
||||
// in case something goes wrong...
|
||||
if($link)
|
||||
{
|
||||
return "<a class='e-tip{$dialog}' {$ext} href='".$link."' {$modal} title='".LAN_EFORM_010."' >".$value."</a>";
|
||||
}
|
||||
|
||||
return $value;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
@ -4026,6 +4112,7 @@ class e_form
|
||||
}
|
||||
|
||||
|
||||
|
||||
if(!empty($attributes['inline'])) $parms['editable'] = true; // attribute alias
|
||||
if(!empty($attributes['sort'])) $parms['sort'] = true; // attribute alias
|
||||
|
||||
@ -4034,6 +4121,9 @@ class e_form
|
||||
$attributes['type'] = $parms['type'];
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
$this->renderValueTrigger($field, $value, $parms, $id);
|
||||
|
||||
$tp = e107::getParser();
|
||||
@ -4152,11 +4242,16 @@ class e_form
|
||||
}
|
||||
|
||||
|
||||
if(!vartrue($attributes['noedit']) && vartrue($parms['editable']) && !vartrue($parms['link'])) // avoid bad markup, better solution coming up
|
||||
if(empty($attributes['noedit']) && !empty($parms['editable']) && empty($parms['link'])) // avoid bad markup, better solution coming up
|
||||
{
|
||||
$mode = preg_replace('/[^\w]/', '', vartrue($_GET['mode'], ''));
|
||||
$value = "<a class='e-tip e-editable editable-click' data-name='".$field."' title=\"".LAN_EDIT." ".$attributes['title']."\" data-type='text' data-pk='".$id."' data-url='".e_SELF."?mode={$mode}&action=inline&id={$id}&ajax_used=1' href='#'>".$value."</a>";
|
||||
}
|
||||
else
|
||||
{
|
||||
$value = $this->renderLink($value,$parms,$id);
|
||||
}
|
||||
|
||||
|
||||
$value = vartrue($parms['pre']).$value.vartrue($parms['post']);
|
||||
// else same
|
||||
@ -4303,19 +4398,22 @@ class e_form
|
||||
$value = defset($value, $value);
|
||||
}
|
||||
|
||||
if(vartrue($parms['truncate']))
|
||||
if(!empty($parms['truncate']))
|
||||
{
|
||||
$value = $tp->text_truncate($value, $parms['truncate'], '...');
|
||||
}
|
||||
elseif(vartrue($parms['htmltruncate']))
|
||||
elseif(!empty($parms['htmltruncate']))
|
||||
{
|
||||
$value = $tp->html_truncate($value, $parms['htmltruncate'], '...');
|
||||
}
|
||||
if(vartrue($parms['wrap']))
|
||||
if(!empty($parms['wrap']))
|
||||
{
|
||||
$value = $tp->htmlwrap($value, (int) $parms['wrap'], varset($parms['wrapChar'], ' '));
|
||||
}
|
||||
if(vartrue($parms['link']) && $id/* && is_numeric($id)*/)
|
||||
|
||||
$value = $this->renderLink($value,$parms,$id);
|
||||
/*
|
||||
if(!empty($parms['link']) && $id)
|
||||
{
|
||||
$link = str_replace('[id]', $id, $parms['link']);
|
||||
$link = $tp->replaceConstants($link); // SEF URL is not important since we're in admin.
|
||||
@ -4324,9 +4422,7 @@ class e_form
|
||||
$ext = vartrue($parms['target']) == 'blank' ? " rel='external' " : ""; // new window
|
||||
$modal = vartrue($parms['target']) == 'modal' ? " data-toggle='modal' data-cache='false' data-target='#uiModal' " : "";
|
||||
|
||||
if($parms['link'] == 'sef' && $this->getController()
|
||||
->getListModel()
|
||||
)
|
||||
if($parms['link'] == 'sef' && $this->getController()->getListModel())
|
||||
{
|
||||
$model = $this->getController()->getListModel();
|
||||
// copy url config
|
||||
@ -4337,6 +4433,7 @@ class e_form
|
||||
// assemble the url
|
||||
$link = $model->url();
|
||||
}
|
||||
|
||||
elseif(vartrue($data[$parms['link']])) // support for a field-name as the link. eg. link_url.
|
||||
{
|
||||
$link = $tp->replaceConstants(vartrue($data[$parms['link']]));
|
||||
@ -4347,7 +4444,7 @@ class e_form
|
||||
{
|
||||
$value = "<a class='e-tip{$dialog}' {$ext} href='" . $link . "' {$modal} title='".LAN_EFORM_010."' >" . $value . "</a>";
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
if(empty($value))
|
||||
{
|
||||
@ -4403,7 +4500,11 @@ class e_form
|
||||
{
|
||||
$value = $tp->htmlwrap($value, (int)$parms['wrap'], varset($parms['wrapChar'], ' '));
|
||||
}
|
||||
if(vartrue($parms['link']) && $id/* && is_numeric($id)*/)
|
||||
|
||||
$value = $this->renderLink($value,$parms,$id);
|
||||
|
||||
/*
|
||||
if(vartrue($parms['link']) && $id)
|
||||
{
|
||||
$link = str_replace('[id]',$id,$parms['link']);
|
||||
$link = $tp->replaceConstants($link); // SEF URL is not important since we're in admin.
|
||||
@ -4427,7 +4528,7 @@ class e_form
|
||||
|
||||
// in case something goes wrong...
|
||||
if($link) $value = "<a class='e-tip{$dialog}' {$ext} href='".$link."' {$modal} title='".LAN_EFORM_010."' >".$value."</a>";
|
||||
}
|
||||
}*/
|
||||
|
||||
if(empty($value))
|
||||
{
|
||||
@ -4867,11 +4968,11 @@ class e_form
|
||||
}
|
||||
// print_a($attributes);
|
||||
// Inline Editing.
|
||||
if(!vartrue($attributes['noedit']) && vartrue($parms['editable'])) // avoid bad markup, better solution coming up
|
||||
if(empty($attributes['noedit']) && !empty($parms['editable'])) // avoid bad markup, better solution coming up
|
||||
{
|
||||
|
||||
$mode = preg_replace('/[^\w]/', '', vartrue($_GET['mode'], ''));
|
||||
$methodParms = call_user_func_array(array($this, $method), array($value, 'inline', $parms));
|
||||
$methodParms = call_user_func_array(array($this, $meth), array($value, 'inline', $parms));
|
||||
|
||||
$inlineParms = (!empty($methodParms['inlineParms'])) ? $methodParms['inlineParms'] : null;
|
||||
|
||||
@ -4979,6 +5080,7 @@ class e_form
|
||||
//TODO - order
|
||||
|
||||
default:
|
||||
$value = $this->renderLink($value,$parms,$id);
|
||||
//unknown type
|
||||
break;
|
||||
}
|
||||
@ -5961,7 +6063,17 @@ class e_form
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
if(in_array($key,$this->_field_warnings))
|
||||
{
|
||||
if(is_string($writeParms))
|
||||
{
|
||||
parse_str($writeParms,$writeParms);
|
||||
}
|
||||
|
||||
$writeParms['tdClassRight'] .= ' has-warning';
|
||||
|
||||
}
|
||||
|
||||
$leftCell = $required."<span{$required_class}>".defset(vartrue($att['title']), vartrue($att['title']))."</span>".$label;
|
||||
$rightCell = $this->renderElement($keyName, $model->getIfPosted($valPath), $att, varset($model_required[$key], array()), $model->getId())." {$help}";
|
||||
|
||||
|
@ -1405,7 +1405,7 @@ class e_media
|
||||
$searchPlaceholder = varset($parm['searchPlaceholder'], LAN_SEARCH);
|
||||
|
||||
$text = '<div class="btn-group"><span class="input-append form-inline">';
|
||||
$text .= "<input type='text' class='e-ajax-keyup input-xxlarge ' placeholder= '".$searchPlaceholder."...' title=\"".$searchToolttip."\" name='search' value='' data-target='media-browser-container-".$parm['action']."' data-src='".$data_src."' />";
|
||||
$text .= "<input type='text' class='form-control e-ajax-keyup input-xxlarge ' placeholder= '".$searchPlaceholder."...' title=\"".$searchToolttip."\" name='search' value='' data-target='media-browser-container-".$parm['action']."' data-src='".$data_src."' />";
|
||||
// $text .= "<span class='field-help'>bablalal</span>";
|
||||
// $text .= '<button class="btn btn-primary" name="'.$submitName.'" type="submit">'.LAN_GO.'</button>';
|
||||
$text .= '<a class="btn btn-primary" href="#'.$carouselID.'" data-slide="prev">‹</a><a class="btn btn-primary" href="#'.$carouselID.'" data-slide="next">›</a>';
|
||||
|
@ -328,7 +328,10 @@ class e_db_mysql
|
||||
$this->db_Set_Charset();
|
||||
$this->setSQLMode();
|
||||
|
||||
if ($db_ConnectionID == NULL){ $db_ConnectionID = $this->mySQLaccess; }
|
||||
//if ($db_ConnectionID == NULL){
|
||||
$db_ConnectionID = $this->mySQLaccess;
|
||||
|
||||
// }
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -347,18 +350,26 @@ class e_db_mysql
|
||||
|
||||
/**
|
||||
* Select the database to use.
|
||||
* @param string database name
|
||||
* @param string table prefix . eg. e107_
|
||||
* @param string $database name
|
||||
* @param string $table prefix . eg. e107_
|
||||
* @param boolean $multiple set to maintain connection to a secondary database.
|
||||
* @return boolean true when database selection was successful otherwise false.
|
||||
*/
|
||||
public function database($database, $prefix = MPREFIX)
|
||||
public function database($database, $prefix = MPREFIX, $multiple=false)
|
||||
{
|
||||
$this->mySQLdefaultdb = $database;
|
||||
$this->mySQLPrefix = $prefix;
|
||||
|
||||
|
||||
if($multiple === true)
|
||||
{
|
||||
$this->mySQLPrefix = "`".$database."`.".$prefix;
|
||||
return true;
|
||||
}
|
||||
|
||||
if($this->pdo)
|
||||
{
|
||||
try
|
||||
|
||||
try
|
||||
{
|
||||
$this->mySQLaccess->query("use ".$database);
|
||||
// $this->mySQLaccess->select_db($database); $dbh->query("use newdatabase");
|
||||
@ -1816,7 +1827,8 @@ class e_db_mysql
|
||||
$this->mySQLcurTable = $table;
|
||||
$this->tabset = true;
|
||||
}
|
||||
return ' `'.$this->mySQLPrefix.$table.'`'.substr($matches[0],-1);
|
||||
|
||||
return " ".$this->mySQLPrefix.$table.substr($matches[0],-1);
|
||||
}
|
||||
|
||||
|
||||
|
@ -882,6 +882,12 @@ class e_news_tree extends e_front_tree_model
|
||||
if($tablerender)
|
||||
{
|
||||
$caption = vartrue($parms['caption']) ? defset($parms['caption'], $parms['caption']) : LAN_NEWSLATEST_MENU_TITLE; // found in plugins/news/languages/English.php
|
||||
|
||||
if(!empty($parms['caption'][e_LANGUAGE]))
|
||||
{
|
||||
$caption = $parms['caption'][e_LANGUAGE];
|
||||
}
|
||||
|
||||
$mod = true === $tablerender ? 'news_latest_menu' : $tablerender;
|
||||
return e107::getRender()->tablerender($caption, $ret, varset($parms['mode'], $mod), $return);
|
||||
}
|
||||
@ -1096,6 +1102,12 @@ class e_news_category_tree extends e_front_tree_model
|
||||
if($tablerender)
|
||||
{
|
||||
$caption = vartrue($parms['caption']) ? defset($parms['caption'], $parms['caption']) : LAN_NEWSCAT_MENU_TITLE; // found in plugins/news/languages/English.php
|
||||
|
||||
if(!empty($parms['caption'][e_LANGUAGE]))
|
||||
{
|
||||
$caption = $parms['caption'][e_LANGUAGE];
|
||||
}
|
||||
|
||||
$mod = true === $tablerender ? 'news_categories_menu' : $tablerender;
|
||||
return e107::getRender()->tablerender($caption, $ret, varset($parms['mode'], $mod), $return);
|
||||
}
|
||||
|
@ -226,7 +226,7 @@ class e_search
|
||||
|
||||
foreach ($search_fields as $field_key => $field)
|
||||
{
|
||||
$search_query[] = "(". varset($weights[$field_key],0.6)." * (MATCH(".$field.") AGAINST ('".$this -> query."' IN BOOLEAN MODE)))";
|
||||
$search_query[] = "(". varset($weights[$field_key],0.6)." * (MATCH(".$field.") AGAINST ('".str_replace(" ","+",$this -> query)."' IN BOOLEAN MODE)))";
|
||||
$field_query[] = "MATCH(".$field.") AGAINST ('".$this -> query."' IN BOOLEAN MODE)";
|
||||
}
|
||||
|
||||
@ -239,8 +239,8 @@ class e_search
|
||||
{
|
||||
$sql_order .= ', '.$sort_key.' '.$sort_value;
|
||||
}
|
||||
|
||||
$limit = " LIMIT ".$result_flag.",".$search_res;
|
||||
|
||||
$limit = " LIMIT ".intval($result_flag).",".$search_res;
|
||||
|
||||
$sql_query = "SELECT SQL_CALC_FOUND_ROWS ".$return_fields.", (".$match_query.") AS relevance FROM #".$table." WHERE ".$where." (".$field_query.") HAVING relevance > 0 ORDER BY relevance DESC ".$sql_order.$limit.";";
|
||||
|
||||
@ -250,7 +250,7 @@ class e_search
|
||||
|
||||
if(E107_DBG_SQLQUERIES)
|
||||
{
|
||||
echo e107::getMessage()->addDebug($sql_query)->render();
|
||||
echo e107::getMessage()->addDebug(str_replace('#',MPREFIX,$sql_query))->render();
|
||||
}
|
||||
|
||||
|
||||
|
@ -50,6 +50,7 @@ define("EMESSLAN_TITLE_SUCCESS", "Success");
|
||||
define("EMESSLAN_TITLE_WARNING", "Warning");
|
||||
define("EMESSLAN_TITLE_DEBUG", "System Debug");
|
||||
|
||||
define("LAN_NO_PERMISSIONS", "You do not have permission to view this page.");
|
||||
define("LAN_EDIT","Edit");
|
||||
define("LAN_DELETE","Delete");
|
||||
define("LAN_DEFAULT","Default");
|
||||
|
@ -16,11 +16,6 @@ if (!getperms("2"))
|
||||
exit;
|
||||
}
|
||||
|
||||
if(!deftrue("e_DEBUG_MENUMANAGER"))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
$sql = e107::getDb();
|
||||
$tp = e107::getParser();
|
||||
|
@ -244,6 +244,7 @@ define("LAN_INSTALLED","Installed");//TODO elsewhere
|
||||
define("LAN_LAST_UPDATED","Last Updated");
|
||||
define("LAN_UPDATE_AVAILABLE","Update Available");
|
||||
define("LAN_ADD", "Add");
|
||||
define("LAN_REMOVE", "Remove");
|
||||
define("LAN_ADD_MORE", "Add More");
|
||||
define("LAN_MULTIPLE_CHOICE", "Multiple Choice");
|
||||
|
||||
@ -272,6 +273,9 @@ define("LAN_NEVER", "Never");
|
||||
define("LAN_PRUNE", "Prune");
|
||||
define("LAN_RESET","Reset");
|
||||
define("LAN_CLEAR","Clear");
|
||||
define("LAN_ADD_ALL", "Add All");
|
||||
define("LAN_CLEAR_ALL", "Clear All");
|
||||
define("LAN_UNKNOWN", "Unknown");
|
||||
define("LAN_ALL","All");
|
||||
define("LAN_IMPORT","Import");
|
||||
// define("LAN_OK","OK"); // defined in e107_languages/English/English.php
|
||||
@ -357,6 +361,7 @@ define("LAN_CONFIGURE", "Configure");
|
||||
// define("LAN_BACK", "Back"); @see e107_languages/English.php
|
||||
|
||||
define("LAN_NOPERMISSION", "no permissions");
|
||||
define("LAN_NO_ADMIN_PERMISSION", "You do not have administrator permissions for [x]");
|
||||
|
||||
define("LAN_CREDITS","Credits");
|
||||
define("LAN_NEWVERSION","e107 v[x] Available");
|
||||
@ -444,6 +449,8 @@ define("LAN_UI_404_METHOD_ERROR", "Action [x] not found!");
|
||||
define("LAN_UI_403_BODY_ERROR", "Access to the requested page is denied.");
|
||||
define("LAN_UI_403_TITLE_ERROR", "Access denied");
|
||||
define("LAN_UI_FORM_METHOD_ERROR", "FATAL ERROR: The field name [x] is not allowed. Please rename the key [x] to something else in your fields array and database table (if required).");
|
||||
define("LAN_UNKNOWN_ERROR", "Unknown Error");
|
||||
define("LAN_SQL_ERROR", "SQL Error");
|
||||
|
||||
define("LAN_UI_BATCH_UPDATE_SUCCESS", "[x] set for [y] record(s).");
|
||||
define("LAN_UI_BATCH_REVERSED_SUCCESS", "[x] records successfully reversed.");
|
||||
@ -501,6 +508,7 @@ define("LAN_DASHBOARD_LAYOUT", "Dashboard Layout");
|
||||
define("LAN_UNAVAILABLE", "Unavailable");
|
||||
define("LAN_NO_LABEL_PROVIDED", "No Label Provided");
|
||||
define("LAN_NOT_FOUND", "Not Found!");
|
||||
define("LAN_FIELD", "Field");
|
||||
|
||||
define("LAN_MAINTENANCE", "Maintenance");
|
||||
define("LAN_RETURN_TO_FRONT_PANEL", "Return to Front Panel");
|
||||
@ -516,3 +524,5 @@ define("LAN_ENGINE", "Engine");
|
||||
define("LAN_SOURCE", "Source");
|
||||
|
||||
define("LAN_ERROR_CONNECTION","Unable to connect for updates. Please check firewall and/or internet connection.");
|
||||
|
||||
define("LAN_UI_X_CANT_EQUAL_Y", "[x] cannot be the same as [y]");
|
||||
|
@ -6,6 +6,12 @@
|
||||
*
|
||||
*/
|
||||
|
||||
define("CUSLAN_1", "Overview");
|
||||
define("CUSLAN_2", "Page Title");
|
||||
define("CUSLAN_3", "Items per Page");
|
||||
define("CUSLAN_4", "Custom Fields");
|
||||
define("CUSLAN_5", "(New Book)");
|
||||
|
||||
define("CUSLAN_9", "Text");
|
||||
define("CUSLAN_11", "Meta description");
|
||||
define("CUSLAN_12", "Create Page/Menu");
|
||||
@ -92,4 +98,4 @@ define("CUSLAN_79", "You must enter either a page title or a menu name.");
|
||||
|
||||
|
||||
|
||||
?>
|
||||
?>
|
||||
|
@ -12,7 +12,7 @@
|
||||
define("LAN_LOGIN_1", "User name");
|
||||
define("LAN_LOGIN_2", "User password");
|
||||
define("LAN_LOGIN_3", "Protected server");
|
||||
define("LAN_LOGIN_4", "Please sign in"); // XXX Modified
|
||||
define("LAN_LOGIN_4", "Please sign in"); // XXX Modified
|
||||
define("LAN_LOGIN_5", "Click here to Sign-Up");
|
||||
define("LAN_LOGIN_6", "Not accepting new members at this time");
|
||||
define("LAN_LOGIN_7", "Enter visible code");
|
||||
@ -40,5 +40,8 @@ define("LAN_LOGIN_28", "Email");
|
||||
define("LAN_LOGIN_29", "Username or Email");
|
||||
define("LAN_LOGIN_30", "Error adding new alt_auth user to DB");
|
||||
define("LAN_LOGIN_31", "Your credentials could not be added to the system");
|
||||
|
||||
define("LAN_LOGIN_32", "You are seeing this message because you are currently logged in as the Main Admin.");
|
||||
define("LAN_LOGIN_33", "[Return to the homepage]"); // the [ ] brackets are replaced with a button link
|
||||
define("LAN_LOGIN_34", "User registration and/or login is currently disabled.");
|
||||
define("LAN_LOGIN_35", "[Enable it]"); // the [ ] brackets are replaced with a button link
|
||||
?>
|
@ -98,22 +98,6 @@ class plugin_blank_admin_ui extends e_admin_ui
|
||||
*/
|
||||
protected $table = "blank";
|
||||
|
||||
/**
|
||||
* If present this array will be used to build your list query
|
||||
* You can link fileds from $field array with 'table' parameter, which should equal to a key (table) from this array
|
||||
* 'leftField', 'rightField' and 'fields' attributes here are required, the rest is optional
|
||||
* Table alias is supported
|
||||
* Note:
|
||||
* - 'leftTable' could contain only table alias
|
||||
* - 'leftField' and 'rightField' shouldn't contain table aliases, they will be auto-added
|
||||
* - 'whereJoin' and 'where' should contain table aliases e.g. 'whereJoin' => 'AND u.user_ban=0'
|
||||
*
|
||||
* @var array [optional] table_name => array join parameters
|
||||
*/
|
||||
protected $tableJoin = array(
|
||||
//'u.user' => array('leftField' => 'comment_author_id', 'rightField' => 'user_id', 'fields' => '*'/*, 'leftTable' => '', 'joinType' => 'LEFT JOIN', 'whereJoin' => '', 'where' => ''*/)
|
||||
);
|
||||
|
||||
/**
|
||||
* This is only needed if you need to JOIN tables AND don't wanna use $tableJoin
|
||||
* Write your list query without any Order or Limit.
|
||||
@ -132,14 +116,17 @@ class plugin_blank_admin_ui extends e_admin_ui
|
||||
// optional
|
||||
protected $perPage = 20;
|
||||
|
||||
// default - true - TODO - move to displaySettings
|
||||
protected $batchDelete = true;
|
||||
|
||||
// UNDER CONSTRUCTION
|
||||
protected $displaySettings = array();
|
||||
// protected \$sortField = 'somefield_order';
|
||||
|
||||
|
||||
// protected \$sortParent = 'somefield_parent';
|
||||
|
||||
|
||||
// protected \$treePrefix = 'somefield_title';
|
||||
|
||||
|
||||
// UNDER CONSTRUCTION
|
||||
protected $disallowPages = array('main/create', 'main/prefs');
|
||||
|
||||
//TODO change the blank_url type back to URL before blank.
|
||||
// required
|
||||
|
@ -44,7 +44,6 @@ if (!e107::isInstalled('download'))
|
||||
|
||||
$dl = new download();
|
||||
|
||||
if(!defined("e_PAGETITLE")) {define("e_PAGETITLE", LAN_PLUGIN_DOWNLOAD_NAME);}
|
||||
|
||||
if(!defined("USER_WIDTH") && !deftrue('BOOTSTRAP')) { define("USER_WIDTH","width:100%"); }
|
||||
|
||||
@ -92,6 +91,9 @@ if (!e107::isInstalled('download'))
|
||||
|
||||
$texts = $dl->render(); // Load before header.
|
||||
|
||||
|
||||
if(!defined("e_PAGETITLE")) {define("e_PAGETITLE", LAN_PLUGIN_DOWNLOAD_NAME);}
|
||||
|
||||
require_once (HEADERF);
|
||||
|
||||
|
||||
|
@ -25,6 +25,9 @@ class download_shortcodes extends e_shortcode
|
||||
public $dlsubrow;
|
||||
public $dlsubsubrow;
|
||||
public $mirror;
|
||||
|
||||
public $parent;
|
||||
public $grandparent;
|
||||
|
||||
/**
|
||||
* download_shortcodes constructor
|
||||
@ -43,6 +46,7 @@ class download_shortcodes extends e_shortcode
|
||||
|
||||
$breadcrumb = array();
|
||||
|
||||
|
||||
switch ($this->qry['action'])
|
||||
{
|
||||
case 'mirror':
|
||||
@ -58,6 +62,17 @@ class download_shortcodes extends e_shortcode
|
||||
|
||||
default:
|
||||
$breadcrumb[] = array('text' => LAN_PLUGIN_DOWNLOAD_NAME, 'url' => $url->create('download/index'));
|
||||
|
||||
if(!empty($this->grandparent))
|
||||
{
|
||||
$breadcrumb[] = array('text' => $this->grandparent['download_category_name'], 'url' => ($this->grandparent['download_category_id']) ? $url->create('download/list/category', array('id'=>$this->grandparent['download_category_id'],'name'=>$this->grandparent['download_category_sef'])) : null);
|
||||
}
|
||||
|
||||
if(!empty($this->parent))
|
||||
{
|
||||
$breadcrumb[] = array('text' => $this->parent['download_category_name'], 'url' => ($this->parent['download_category_id']) ? $url->create('download/list/category', array('id'=>$this->parent['download_category_id'],'name'=>$this->parent['download_category_sef'])) : null);
|
||||
}
|
||||
|
||||
$breadcrumb[] = array('text' => $this->var['download_category_name'], 'url' => ($this->var['download_category_id']) ? $url->create('download/list/category', array('id'=>$this->var['download_category_id'],'name'=>$this->var['download_category_sef'])) : null);
|
||||
$breadcrumb[] = array('text' => $this->var['download_name'], 'url' => null);
|
||||
break;
|
||||
@ -154,7 +169,9 @@ class download_shortcodes extends e_shortcode
|
||||
$tp = e107::getParser();
|
||||
if ($this->dlsubsubrow['d_count'])
|
||||
{
|
||||
return "<a class='".$class."' href='".e_PLUGIN_ABS."download/download.php?action=list&id=".$this->dlsubsubrow['download_category_id']."'>".$tp->toHTML($this->dlsubsubrow['download_category_name'], FALSE, 'TITLE')."</a>";
|
||||
$url = e107::getUrl()->create('download/list/category', array('id'=>$this->dlsubsubrow['download_category_id'], 'name'=> vartrue($this->dlsubsubrow['download_category_sef'],'--sef-not-set--')));
|
||||
// e_PLUGIN_ABS."download/download.php?action=list&id=".$this->dlsubsubrow['download_category_id']
|
||||
return "<a class='".$class."' href='".$url."'>".$tp->toHTML($this->dlsubsubrow['download_category_name'], FALSE, 'TITLE')."</a>";
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -944,7 +961,18 @@ class download_shortcodes extends e_shortcode
|
||||
|
||||
function sc_download_back_to_category_list()
|
||||
{
|
||||
return "<a class='btn btn-default btn-xs btn-mini' href='".e_SELF."'>".LAN_dl_9."</a>";
|
||||
$url = e107::getUrl();
|
||||
|
||||
if(!empty($this->parent))
|
||||
{
|
||||
$link = $url->create('download/list/category', array('id'=>$this->parent['download_category_id'],'name'=>$this->parent['download_category_sef']));
|
||||
}
|
||||
else
|
||||
{
|
||||
$link = ($this->var['download_category_id']) ? $url->create('download/list/category', array('id'=>$this->var['download_category_id'],'name'=>$this->var['download_category_sef'])) : null;
|
||||
}
|
||||
|
||||
return "<a class='btn btn-default btn-xs btn-mini' href='".$link."'>".LAN_dl_9."</a>";
|
||||
}
|
||||
|
||||
|
||||
@ -996,7 +1024,7 @@ class download_shortcodes extends e_shortcode
|
||||
if (!$source) return " ";
|
||||
// list($ret[TRUE],$ret[FALSE]) = explode(chr(1), $source.chr(1)); //XXX ???
|
||||
// if (!$ret[FALSE]) $ret[FALSE] = $ret[TRUE]; //XXX ???
|
||||
$parms = array('legacy'=> e_IMAGE."icons/");
|
||||
$parms = array('legacy'=> "{e_IMAGE}icons/");
|
||||
return e107::getParser()->toIcon($source, $parms);
|
||||
//return "<img src='".e_IMAGE."icons/{$ret[($count!=0)]}' alt='*'/>";
|
||||
}
|
||||
|
@ -46,10 +46,10 @@ class download_search extends e_search // include plugin-folder in the name.
|
||||
'author'=> array('type' => 'author', 'text' => LAN_SEARCH_61)
|
||||
),
|
||||
|
||||
'return_fields' => array('d.download_id', 'd.download_sef','d.download_category', 'download_category_id', 'd.download_name', 'd.download_description', 'd.download_author', 'd.download_author_website', 'd.download_datestamp', 'd.download_class', 'c.download_category_name', 'c.download_category_class'),
|
||||
'search_fields' => array('d.download_name'=> '1.2', 'd.download_url' => '0.9', 'd.download_description'=>'0.6', 'd.download_author'=>'0.6', 'd.download_author_website'=>'0.4'), // fields and weights.
|
||||
'return_fields' => array('d.download_id', 'd.download_sef','d.download_category', 'c.download_category_id', 'd.download_name', 'd.download_description', 'd.download_author', 'd.download_author_website', 'd.download_datestamp', 'd.download_class', 'c.download_category_name', 'c.download_category_class'),
|
||||
'search_fields' => array('d.download_name'=> '1.2', 'd.download_url' => '0.9', 'd.download_description'=>'0.6', 'd.download_author'=>'0.6', 'd.download_author_website'=>'0.4'), // fields and weights.
|
||||
|
||||
'order' => array('download_datestamp' => DESC),
|
||||
'order' => array('download_datestamp' => 'DESC'),
|
||||
'refpage' => e_PLUGIN_ABS.'download/download.php'
|
||||
);
|
||||
|
||||
@ -94,7 +94,7 @@ class download_search extends e_search // include plugin-folder in the name.
|
||||
{
|
||||
$tp = e107::getParser();
|
||||
|
||||
$qry = "download_active > '0' AND d.download_visible IN (".USERCLASS_LIST.") AND c.download_category_class IN (".USERCLASS_LIST.") AND".$advanced_where;
|
||||
$qry = "download_active > '0' AND d.download_visible IN (".USERCLASS_LIST.") AND c.download_category_class IN (".USERCLASS_LIST.") AND";
|
||||
|
||||
if (isset($parm['cat']) && is_numeric($parm['cat']))
|
||||
{
|
||||
|
@ -19,6 +19,9 @@ class download
|
||||
|
||||
private $templateHeader = '';
|
||||
private $templateFooter = '';
|
||||
|
||||
private $subCategories = array();
|
||||
private $categories = array();
|
||||
|
||||
function __construct()
|
||||
{
|
||||
@ -35,7 +38,53 @@ class download
|
||||
$this->templateHeader = '';
|
||||
$this->templateFooter = '';
|
||||
}
|
||||
|
||||
|
||||
$pref = e107::getPref();
|
||||
|
||||
// $catObj = new downloadCategory(varset($pref['download_subsub'],1),USERCLASS_LIST,null, varset($pref['download_incinfo'], false));
|
||||
// $this->categories = $catObj->cat_tree;
|
||||
$this->loadCategories();
|
||||
|
||||
|
||||
}
|
||||
|
||||
private function loadCategories()
|
||||
{
|
||||
$sql = e107::getDb();
|
||||
$data = $sql->retrieve("download_category", '*', 'ORDER BY download_category_order',true);
|
||||
|
||||
foreach($data as $row)
|
||||
{
|
||||
|
||||
$id = $row['download_category_parent'];
|
||||
$sub= $row['download_category_id'];
|
||||
|
||||
$this->subCategories[$id][$sub] = $row;
|
||||
if(check_class($row['download_category_class']))
|
||||
{
|
||||
$this->categories[$sub] = $row;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
private function getCategory($id)
|
||||
{
|
||||
return !empty($this->categories[$id]) ? $this->categories[$id] : false;
|
||||
|
||||
}
|
||||
|
||||
private function getParent($id)
|
||||
{
|
||||
$parent = $this->categories[$id]['download_category_parent'];
|
||||
return $this->getCategory($parent);
|
||||
}
|
||||
|
||||
private function getChildren($parent)
|
||||
{
|
||||
return !empty($this->subCategories[$parent]) ? $this->subCategories[$parent] : false;
|
||||
}
|
||||
|
||||
public function init()
|
||||
@ -158,13 +207,14 @@ class download
|
||||
$ns = e107::getRender();
|
||||
$pref = e107::getPref();
|
||||
|
||||
|
||||
|
||||
// if ($cacheData = $e107cache->retrieve("download_cat".$maincatval,720)) // expires every 12 hours. //TODO make this an option
|
||||
{
|
||||
// echo $cacheData;
|
||||
// return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if(deftrue('BOOTSTRAP')) // v2.x
|
||||
{
|
||||
@ -182,6 +232,13 @@ class download
|
||||
}
|
||||
else // Legacy v1.x
|
||||
{
|
||||
$DOWNLOAD_CAT_TABLE_START = null;
|
||||
$DOWNLOAD_CAT_PARENT_TABLE = null;
|
||||
$DOWNLOAD_CAT_CHILD_TABLE = null;
|
||||
$DOWNLOAD_CAT_SUBSUB_TABLE = null;
|
||||
$DOWNLOAD_CAT_TABLE_END = null;
|
||||
|
||||
|
||||
$template_name = 'download_template.php';
|
||||
|
||||
if (is_readable(THEME."templates/".$template_name))
|
||||
@ -234,8 +291,11 @@ class download
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
e107::getDebug()->log($dlcat->cat_tree);
|
||||
|
||||
|
||||
$dl_text .= $tp->parseTemplate($this->templateHeader, TRUE, $sc);
|
||||
$dl_text = $tp->parseTemplate($this->templateHeader, TRUE, $sc);
|
||||
$dl_text .= $tp->parseTemplate($DOWNLOAD_CAT_TABLE_START, TRUE, $sc);
|
||||
$dl_text .= $download_cat_table_string;
|
||||
$dl_text .= $tp->parseTemplate($DOWNLOAD_CAT_TABLE_END, TRUE, $sc);
|
||||
@ -255,8 +315,25 @@ class download
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Meta for 'view' mode..to be expanded to handle list and maincats etc.
|
||||
* @param array $row
|
||||
* @todo modes for different actions based on $this->qry['action']
|
||||
*/
|
||||
private function setMeta($row)
|
||||
{
|
||||
$tp = e107::getParser();
|
||||
|
||||
$metaImage = $tp->thumbUrl($row['download_image'], array('w'=>500), null, true);
|
||||
$metaDescription = $tp->toHtml($row['download_description'],true);
|
||||
|
||||
e107::meta('description', $tp->toText($metaDescription));
|
||||
e107::meta('keywords', $row['download_keywords']);
|
||||
e107::meta('og:description', $tp->toText($metaDescription));
|
||||
e107::meta('og:image', $metaImage);
|
||||
e107::meta('twitter:image:src', $metaImage);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -276,7 +353,7 @@ class download
|
||||
$DOWNLOAD_VIEW_TABLE = $template['item'];
|
||||
$DOWNLOAD_VIEW_TABLE_END = varset($template['end']);
|
||||
$DL_VIEW_NEXTPREV = varset($template['nextprev']);
|
||||
// $DL_VIEW_PAGETITLE = varset($template['pagetitle']);
|
||||
$DL_VIEW_PAGETITLE = varset($template['pagetitle']);
|
||||
$DL_VIEW_CAPTION = varset($template['caption'],"{DOWNLOAD_VIEW_CAPTION}");
|
||||
}
|
||||
else // Legacy v1.x
|
||||
@ -328,27 +405,26 @@ class download
|
||||
//require_once(FOOTERF);
|
||||
//exit;
|
||||
}
|
||||
|
||||
|
||||
$dlrow = $sql->fetch();
|
||||
$sc->setVars($dlrow);
|
||||
|
||||
// $comment_edit_query = 'comment.download.'.$id;
|
||||
|
||||
|
||||
if(!defined("DL_IMAGESTYLE"))
|
||||
{
|
||||
define("DL_IMAGESTYLE","border:0px");
|
||||
}
|
||||
|
||||
|
||||
$dlrow = $sql->fetch();
|
||||
$sc->setVars($dlrow);
|
||||
$this->setMeta($dlrow);
|
||||
|
||||
|
||||
if(!isset($DL_VIEW_PAGETITLE))
|
||||
{
|
||||
$DL_VIEW_PAGETITLE = LAN_PLUGIN_DOWNLOAD_NAME." / {DOWNLOAD_CATEGORY} / {DOWNLOAD_VIEW_NAME}";
|
||||
$DL_VIEW_PAGETITLE = "{DOWNLOAD_VIEW_NAME} / {DOWNLOAD_CATEGORY} / ".LAN_PLUGIN_DOWNLOAD_NAME;
|
||||
}
|
||||
|
||||
$DL_TITLE = $tp->parseTemplate($DL_VIEW_PAGETITLE, TRUE, $sc);
|
||||
|
||||
|
||||
define("e_PAGETITLE", $DL_TITLE);
|
||||
|
||||
|
||||
$DL_TEMPLATE = $DOWNLOAD_VIEW_TABLE_START.$DOWNLOAD_VIEW_TABLE.$DOWNLOAD_VIEW_TABLE_END;
|
||||
|
||||
|
||||
@ -426,8 +502,8 @@ class download
|
||||
$DOWNLOAD_LIST_NEXTPREV = $template['list']['nextprev'];
|
||||
|
||||
$DOWNLOAD_CAT_TABLE_START = varset($template['categories']['start']);
|
||||
$DOWNLOAD_CAT_PARENT_TABLE = $template['categories']['parent'];
|
||||
$DOWNLOAD_CAT_CHILD_TABLE = $template['categories']['child'];
|
||||
// $DOWNLOAD_CAT_PARENT_TABLE = $template['categories']['parent'];
|
||||
// $DOWNLOAD_CAT_CHILD_TABLE = $template['categories']['child'];
|
||||
$DOWNLOAD_CAT_SUBSUB_TABLE = $template['categories']['subchild'];
|
||||
$DOWNLOAD_CAT_TABLE_END = varset($template['categories']['end']);
|
||||
}
|
||||
@ -460,16 +536,29 @@ class download
|
||||
$sc->qry = $this->qry;
|
||||
|
||||
|
||||
|
||||
|
||||
//if (!isset($this->qry['from'])) $this->qry['from'] = 0;
|
||||
|
||||
// Get category type, page title
|
||||
if ($sql->select("download_category", "download_category_name,download_category_sef,download_category_description,download_category_parent,download_category_class", "(download_category_id='{$this->qry['id']}') AND (download_category_class IN (".USERCLASS_LIST."))") )
|
||||
// if ($sql->select("download_category", "download_category_name,download_category_sef,download_category_description,download_category_parent,download_category_class", "(download_category_id='{$this->qry['id']}') AND (download_category_class IN (".USERCLASS_LIST."))") )
|
||||
|
||||
if($dlrow = $this->getCategory($this->qry['id']))
|
||||
{
|
||||
$dlrow = $sql->fetch();
|
||||
$sc->setVars($dlrow); // Used below for header / breadcrumb.
|
||||
$type = $dlrow['download_category_name'];
|
||||
|
||||
// $dlrow = $sql->fetch();
|
||||
|
||||
|
||||
$sc->setVars($dlrow); // Used below for header / breadcrumb.
|
||||
|
||||
$sc->parent = $this->getParent($this->qry['id']);
|
||||
|
||||
if(!empty( $sc->parent['download_category_parent']))
|
||||
{
|
||||
$sc->grandparent = $this->getParent( $sc->parent['download_category_id']);
|
||||
}
|
||||
|
||||
// $type = $dlrow['download_category_name'];
|
||||
|
||||
|
||||
$this->qry['name'] = $dlrow['download_category_sef'];
|
||||
|
||||
define("e_PAGETITLE", LAN_PLUGIN_DOWNLOAD_NAME." / ".$dlrow['download_category_name']);
|
||||
@ -477,7 +566,7 @@ class download
|
||||
else
|
||||
{ // No access to this category
|
||||
define("e_PAGETITLE", LAN_PLUGIN_DOWNLOAD_NAME);
|
||||
return $ns->tablerender(LAN_PLUGIN_DOWNLOAD_NAME, "<div class='alert alert-info' style='text-align:center'>".LAN_dl_3."</div>",'download-list',true);
|
||||
return $ns->tablerender(LAN_PLUGIN_DOWNLOAD_NAME, "<div class='alert alert-info' style='text-align:center'>".LAN_NO_RECORDS_FOUND."</div>",'download-list',true);
|
||||
}
|
||||
|
||||
if ($dlrow['download_category_parent'] == 0) // It's a main category - change the listing type required
|
||||
@ -492,12 +581,9 @@ class download
|
||||
|
||||
|
||||
/* SHOW SUBCATS ... */
|
||||
$qry = "SELECT download_category_id,download_category_class FROM #download_category WHERE download_category_parent=".intval($this->qry['id']);
|
||||
|
||||
if($sql->gen($qry))
|
||||
if($this->getChildren($this->qry['id']))
|
||||
{
|
||||
|
||||
|
||||
|
||||
/* there are subcats - display them ... */
|
||||
$qry = "
|
||||
SELECT dc.*, dc2.download_category_name AS parent_name, dc2.download_category_icon as parent_icon, SUM(d.download_filesize) AS d_size,
|
||||
@ -515,6 +601,8 @@ class download
|
||||
{
|
||||
|
||||
$scArray = $sql->db_getList();
|
||||
|
||||
$subText = "";
|
||||
|
||||
/** @DEPRECATED **/
|
||||
// if(!defined("DL_IMAGESTYLE"))
|
||||
@ -523,20 +611,24 @@ class download
|
||||
// }
|
||||
|
||||
$download_cat_table_string = "";
|
||||
|
||||
$dl_text .= $tp->parseTemplate($DOWNLOAD_CAT_TABLE_PRE, TRUE, $sc);
|
||||
$dl_text .= $tp->parseTemplate($DOWNLOAD_CAT_TABLE_START, TRUE, $sc);
|
||||
|
||||
if(!empty($DOWNLOAD_CAT_TABLE_PRE)) // 0.8 BC Fix.
|
||||
{
|
||||
$subText .= $tp->parseTemplate($DOWNLOAD_CAT_TABLE_PRE, TRUE, $sc);
|
||||
}
|
||||
$subText .= $tp->parseTemplate($DOWNLOAD_CAT_TABLE_START, TRUE, $sc);
|
||||
|
||||
foreach($scArray as $dlsubsubrow)
|
||||
{
|
||||
$sc->dlsubsubrow = $dlsubsubrow;
|
||||
$dl_text .= $tp->parseTemplate($DOWNLOAD_CAT_SUBSUB_TABLE, TRUE, $sc);
|
||||
$sc->dlsubrow = $dlsubsubrow;
|
||||
$subText .= $tp->parseTemplate($DOWNLOAD_CAT_SUBSUB_TABLE, TRUE, $sc);
|
||||
|
||||
}
|
||||
|
||||
$dl_text .= $tp->parseTemplate($DOWNLOAD_CAT_TABLE_END, TRUE, $sc);
|
||||
$subText .= $tp->parseTemplate($DOWNLOAD_CAT_TABLE_END, TRUE, $sc);
|
||||
|
||||
$text = $ns->tablerender($dl_title, $dl_text, 'download-list', true);
|
||||
$dl_text .= $ns->tablerender($dl_title, $subText, 'download-list', true);
|
||||
}
|
||||
|
||||
}// End of subcategory display
|
||||
@ -546,23 +638,15 @@ class download
|
||||
|
||||
if(!check_class($download_category_class))
|
||||
{
|
||||
|
||||
|
||||
$ns->tablerender(LAN_PLUGIN_DOWNLOAD_NAME, "
|
||||
<div style='text-align:center'>
|
||||
" . LAN_dl_3 . "
|
||||
</div>");
|
||||
|
||||
return;
|
||||
// require_once (FOOTERF);
|
||||
// exit ;
|
||||
$ns->tablerender(LAN_PLUGIN_DOWNLOAD_NAME, "<div class='alert alert-info'> " . LAN_NO_RECORDS_FOUND . "</div>");
|
||||
return null;
|
||||
}
|
||||
|
||||
if($total_downloads < $this->qry['view'])
|
||||
{
|
||||
$this->qry['from'] = 0;
|
||||
}
|
||||
|
||||
|
||||
if(!defined("DL_IMAGESTYLE"))
|
||||
{
|
||||
define("DL_IMAGESTYLE", "border:1px solid blue");
|
||||
@ -576,20 +660,27 @@ class download
|
||||
// $this->qry['view'] - number of entries per page
|
||||
// $total_downloads - total number of entries matching search criteria
|
||||
$filetotal = $sql->select("download", "*", "download_category='{$this->qry['id']}' AND download_active > 0 AND download_visible IN (" . USERCLASS_LIST . ") ORDER BY download_{$this->qry['order']} {$this->qry['sort']} LIMIT {$this->qry['from']}, ".$this->qry['view']);
|
||||
|
||||
if($filetotal)
|
||||
|
||||
|
||||
$caption = varset($DOWNLOAD_LIST_CAPTION) ? $tp->parseTemplate($DOWNLOAD_LIST_CAPTION, TRUE, $sc) : LAN_PLUGIN_DOWNLOAD_NAME;
|
||||
|
||||
if(empty($filetotal))
|
||||
{
|
||||
$caption = varset($DOWNLOAD_LIST_CAPTION) ? $tp->parseTemplate($DOWNLOAD_LIST_CAPTION, TRUE, $sc) : LAN_PLUGIN_DOWNLOAD_NAME;
|
||||
|
||||
// Only show list if some files in it
|
||||
$dl_text .= $tp->parseTemplate($DOWNLOAD_LIST_TABLE_START, TRUE, $sc);
|
||||
|
||||
global $dlft, $dltdownloads;
|
||||
|
||||
$dlft = ($filetotal < $this->qry['view'] ? $filetotal: $this->qry['view']);
|
||||
$dl_text .= $tp->parseTemplate($this->templateFooter, TRUE, $sc);
|
||||
return ($dl_text) ? $ns->tablerender($caption, $dl_text, 'download-list', true) : '';
|
||||
}
|
||||
|
||||
while($dlrow = $sql->fetch())
|
||||
{
|
||||
|
||||
// Only show list if some files in it
|
||||
$dl_text .= $tp->parseTemplate($DOWNLOAD_LIST_TABLE_START, TRUE, $sc);
|
||||
|
||||
global $dlft, $dltdownloads;
|
||||
|
||||
$dlft = ($filetotal < $this->qry['view'] ? $filetotal: $this->qry['view']);
|
||||
|
||||
while($dlrow = $sql->fetch())
|
||||
{
|
||||
$sc->setVars($dlrow);
|
||||
|
||||
$agreetext = $tp->toHTML($pref['agree_text'], TRUE, 'DESCRIPTION');
|
||||
@ -603,20 +694,14 @@ class download
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
$dl_text .= $tp->parseTemplate($DOWNLOAD_LIST_TABLE_END, TRUE, $sc);
|
||||
|
||||
if($sql->select("download_category", "*", "download_category_id='{$download_category_parent}' "))
|
||||
{
|
||||
$parent = $sql->fetch();
|
||||
}
|
||||
|
||||
$dl_text .= $tp->parseTemplate($this->templateFooter, TRUE, $sc);
|
||||
|
||||
$text .= $ns->tablerender($caption, $dl_text, 'download-list', true);
|
||||
}
|
||||
|
||||
$dl_text .= $tp->parseTemplate($DOWNLOAD_LIST_TABLE_END, TRUE, $sc);
|
||||
$dl_text .= $tp->parseTemplate($this->templateFooter, TRUE, $sc);
|
||||
|
||||
$text = $ns->tablerender($caption, $dl_text, 'download-list', true);
|
||||
|
||||
|
||||
if(!isset($DOWNLOAD_LIST_NEXTPREV))
|
||||
{
|
||||
$sc_style['DOWNLOAD_LIST_NEXTPREV']['pre'] = "
|
||||
|
@ -126,49 +126,91 @@ class plugin_download_admin extends e_admin_dispatcher
|
||||
|
||||
class download_cat_ui extends e_admin_ui
|
||||
{
|
||||
protected $pluginTitle = LAN_PLUGIN_DOWNLOAD_NAME;
|
||||
protected $pluginName = 'download';
|
||||
protected $table = "download_category";
|
||||
protected $pid = "download_category_id";
|
||||
protected $perPage = 0; //no limit
|
||||
protected $listOrder = 'download_category_order';
|
||||
// protected $defaultOrderField = 'download_category_parent,download_category_order';
|
||||
// protected $listQry = "SELECT * FROM #faq_info"; // without any Order or Limit.
|
||||
// protected $editQry = "SELECT * FROM #faq_info WHERE faq_info_id = {ID}";
|
||||
protected $pluginTitle = LAN_PLUGIN_DOWNLOAD_NAME;
|
||||
protected $pluginName = 'download';
|
||||
protected $table = "download_category";
|
||||
protected $pid = "download_category_id";
|
||||
protected $perPage = 0; //no limit
|
||||
|
||||
protected $batchCopy = true;
|
||||
|
||||
// initiate as a parent/child tree.
|
||||
protected $sortField = 'download_category_order';
|
||||
protected $sortParent = 'download_category_parent';
|
||||
protected $treePrefix = 'download_category_name';
|
||||
// protected $orderStep = // automatic
|
||||
// protected $listOrder = // automatic
|
||||
|
||||
//legacy URL scheme
|
||||
protected $url = array('route'=>'download/list/category', 'vars' => array('id' => 'download_category_id', 'name' => 'download_category_sef'), 'name' => 'download_category_name', 'description' => ''); // 'link' only needed if profile not provided.
|
||||
|
||||
|
||||
protected $fields = array(
|
||||
'checkboxes' => array('title'=> '', 'type' => null, 'width' =>'5%', 'forced'=> TRUE, 'thclass'=>'center', 'class'=>'center'),
|
||||
'download_category_icon' => array('title'=> LAN_ICON, 'type' => 'method', 'width' => '5%', 'thclass' => 'center','class'=>'center','writeParms'=>'glyphs=1' ),
|
||||
'download_category_id' => array('title'=> LAN_ID, 'type' => 'number', 'width' =>'5%', 'forced'=> TRUE),
|
||||
'download_category_name' => array('title'=> LAN_TITLE, 'type' => 'text', 'inline' => true, 'width' => 'auto', 'thclass' => 'left', 'writeParms'=>'size=xxlarge'),
|
||||
'download_category_sef' => array('title'=> LAN_SEFURL, 'type' => 'text', 'inline' => true, 'width' => 'auto', 'thclass' => 'left', 'writeParms'=>'size=xxlarge'),
|
||||
'download_category_id' => array('title'=> LAN_ID, 'type' => 'number', 'width' =>'5%', 'forced'=> TRUE, 'readParms'=>'link=sef&target=blank'),
|
||||
'download_category_name' => array('title'=> LAN_TITLE, 'type' => 'text', 'data'=>'str', 'inline' => true, 'width' => 'auto', 'thclass' => 'left', 'writeParms'=>'size=xxlarge'),
|
||||
'download_category_sef' => array('title'=> LAN_SEFURL, 'type' => 'text', 'data'=>'str', 'batch'=>true, 'inline' => true, 'width' => 'auto', 'thclass' => 'left', 'writeParms'=>'sef=download_category_name&size=xxlarge'),
|
||||
|
||||
'download_category_description' => array('title'=> LAN_DESCRIPTION, 'type' => 'bbarea', 'width' => '30%', 'readParms' => 'expand=...&truncate=50&bb=1'), // Display name
|
||||
'download_category_description' => array('title'=> LAN_DESCRIPTION, 'type' => 'bbarea', 'data'=>'str', 'width' => '30%', 'readParms' => 'expand=...&truncate=50&bb=1'), // Display name
|
||||
'download_category_parent' => array('title'=> LAN_PARENT, 'type' => 'method', 'width' => '5%', 'batch' => TRUE, 'filter'=>TRUE),
|
||||
'download_category_class' => array('title'=> LAN_VISIBILITY, 'type' => 'userclass', 'inline' => true, 'width' => 'auto', 'data' => 'int', 'batch' => TRUE, 'filter'=>TRUE),
|
||||
'download_category_order' => array('title'=> LAN_ORDER, 'type' => 'number', 'data'=>'int', 'width' => '5%', 'thclass' => 'right', 'class'=> 'right' ),
|
||||
'options' => array('title'=> LAN_OPTIONS, 'type' => null, 'width' => '10%', 'forced'=>TRUE, 'thclass' => 'center last', 'class' => 'center')
|
||||
'download_category_order' => array('title'=> LAN_ORDER, 'type' => 'number', 'nolist'=>true, 'data'=>'int', 'width' => '5%', 'thclass' => 'right', 'class'=> 'right' ),
|
||||
'options' => array('title'=> LAN_OPTIONS, 'type' => null, 'width' => '10%', 'forced'=>TRUE, 'thclass' => 'center last', 'class' => 'center', 'sort'=>1)
|
||||
);
|
||||
|
||||
|
||||
function getDownloadCategoryTree($id = false, $default = 'n/a')
|
||||
protected $fieldpref = array('download_category_icon', 'download_category_id', 'download_category_name', 'download_category_sef', 'download_category_class', 'download_category_order');
|
||||
|
||||
protected $downloadCats = array();
|
||||
|
||||
function init()
|
||||
{
|
||||
// TODO get faq category tree
|
||||
if(deftrue('e_DEBUG'))
|
||||
{
|
||||
$this->fields['download_category_order']['nolist'] = false;
|
||||
}
|
||||
|
||||
$this->setDownloadCategoryTree();
|
||||
|
||||
}
|
||||
|
||||
|
||||
private function setDownloadCategoryTree()
|
||||
{
|
||||
|
||||
|
||||
$sql = e107::getDb();
|
||||
$sql -> gen('SELECT * FROM #download_category ORDER BY download_category_order');
|
||||
$cats = array();
|
||||
$cats[0] = $default;
|
||||
$qry = $this->getParentChildQry(true);
|
||||
$sql->gen($qry);
|
||||
|
||||
$this->downloadCats[0] = LAN_NONE;
|
||||
|
||||
while($row = $sql->fetch())
|
||||
{
|
||||
$cats[$row['download_category_id']] = $row['download_category_name'];
|
||||
$num = $row['_depth'] - 1;
|
||||
$id = $row['download_category_id'];
|
||||
$this->downloadCats[$id] = str_repeat(" ",$num).$row['download_category_name'];
|
||||
}
|
||||
|
||||
|
||||
if($this->getAction() === 'edit') // make sure parent is not the same as ID.
|
||||
{
|
||||
$r = $this->getId();
|
||||
unset($this->downloadCats[$r]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
function getDownloadCategoryTree($id = false)
|
||||
{
|
||||
|
||||
if($id)
|
||||
{
|
||||
return $cats[$id];
|
||||
return $this->downloadCats[$id];
|
||||
}
|
||||
|
||||
return $cats;
|
||||
return $this->downloadCats;
|
||||
}
|
||||
|
||||
}
|
||||
@ -187,7 +229,7 @@ class download_cat_form_ui extends e_admin_form_ui
|
||||
break;
|
||||
|
||||
case 'write':
|
||||
return $this->selectbox('download_category_parent', $controller->getDownloadCategoryTree(), $curVal);
|
||||
return $this->select('download_category_parent', $controller->getDownloadCategoryTree(), $curVal);
|
||||
break;
|
||||
|
||||
case 'filter':
|
||||
@ -258,14 +300,17 @@ class download_main_admin_ui extends e_admin_ui
|
||||
// default - true - TODO - move to displaySettings
|
||||
protected $batchDelete = true;
|
||||
|
||||
protected $url = array('route'=>'download/view/item', 'vars' => array('id' => 'download_id', 'name' => 'download_sef'), 'name' => 'download_name', 'description' => ''); // 'link' only needed if profile not provided.
|
||||
|
||||
|
||||
|
||||
protected $fields = array(
|
||||
'checkboxes' => array('title'=> '', 'type' => null, 'data' => null, 'width'=>'5%', 'thclass' =>'center', 'forced'=> TRUE, 'class'=>'center', 'toggle' => 'e-multiselect'),
|
||||
'download_id' => array('title'=> ID, 'type' => 'number', 'data' => 'int', 'width'=>'5%', 'thclass' => '', 'forced'=> TRUE, 'primary'=>TRUE/*, 'noedit'=>TRUE*/), //Primary ID is not editable
|
||||
'download_id' => array('title'=> LAN_ID, 'type' => 'text', 'data' => 'int', 'width'=>'5%', 'thclass' => '', 'forced'=> TRUE, 'readParms'=>'link=sef&target=blank', 'primary'=>TRUE/*, 'noedit'=>TRUE*/), //Primary ID is not editable
|
||||
'download_name' => array('title'=> LAN_TITLE, 'type' => 'text', 'data' => 'str', 'inline'=>true, 'width' => 'auto', 'thclass' => ''),
|
||||
'download_url' => array('title'=> DOWLAN_13, 'type' => 'url', 'data' => 'str', 'width'=>'auto', 'thclass' => '', 'batch' => TRUE, 'filter'=>TRUE),
|
||||
'download_sef' => array('title'=> LAN_SEFURL, 'type' => 'text', 'inline'=>true, 'data' => 'str', 'width'=>'auto', 'thclass' => '', 'batch' => TRUE, 'filter'=>TRUE, 'writeParms'=>'sef=download_name'),
|
||||
'download_keywords' => array('title'=> LAN_KEYWORDS, 'type' => 'tags', 'inline'=>true, 'data' => 'str', 'width'=>'auto', 'thclass' => ''),
|
||||
'download_keywords' => array('title'=> LAN_KEYWORDS, 'type' => 'tags', 'inline'=>true, 'data' => 'str', 'width'=>'auto', 'thclass' => ''),
|
||||
|
||||
'download_author' => array('title'=> LAN_AUTHOR, 'type' => 'user', 'data' => 'str', 'width' => 'auto', 'thclass' => 'left'),
|
||||
'download_author_email' => array('title'=> DOWLAN_16, 'type' => 'email', 'data' => 'str', 'width' => 'auto', 'thclass' => 'left'),
|
||||
@ -619,11 +664,11 @@ $columnInfo = array(
|
||||
<tr>
|
||||
<td>".$row['limit_id']."</td>
|
||||
<td>".r_userclass_name($row['limit_classnum'])."</td>
|
||||
<td>
|
||||
<td class='form-inline'>
|
||||
<input type='text' class='form-control' size='5' name='count_num[{$row['limit_id']}]' value='".($row['limit_count_num'] ? $row['limit_count_num'] : "")."'/> ".DOWLAN_109."
|
||||
<input type='text' class='form-control' size='5' name='count_days[{$row['limit_id']}]' value='".($row['limit_count_days'] ? $row['limit_count_days'] : "")."'/> ".DOWLAN_110."
|
||||
</td>
|
||||
<td>
|
||||
<td class='form-inline'>
|
||||
<input type='text' class='form-control' size='5' name='bw_num[{$row['limit_id']}]' value='".($row['limit_bw_num'] ? $row['limit_bw_num'] : "")."'/> ".DOWLAN_111." ".DOWLAN_109."
|
||||
<input type='text' class='form-control' size='5' name='bw_days[{$row['limit_id']}]' value='".($row['limit_bw_days'] ? $row['limit_bw_days'] : "")."'/> ".DOWLAN_110."
|
||||
</td>
|
||||
@ -643,11 +688,11 @@ $columnInfo = array(
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan='2'>".r_userclass("newlimit_class", 0, "off", "guest, member, admin, classes, language")."</td>
|
||||
<td>
|
||||
<td class='form-inline'>
|
||||
<input type='text' class='form-control' size='5' name='new_count_num' value=''/> ".DOWLAN_109."
|
||||
<input type='text' class='form-control' size='5' name='new_count_days' value=''/> ".DOWLAN_110."
|
||||
</td>
|
||||
<td>
|
||||
<td class='form-inline'>
|
||||
<input type='text' class='form-control' size='5' name='new_bw_num' value=''/> ".DOWLAN_111." ".DOWLAN_109."
|
||||
<input type='text' class='form-control' size='5' name='new_bw_days' value=''/> ".DOWLAN_110."
|
||||
</td>
|
||||
|
@ -215,8 +215,11 @@ if ($type == "file")
|
||||
echo $binary_data;
|
||||
exit();
|
||||
}
|
||||
if (strstr($download_url, "http://") || strstr($download_url, "ftp://") || strstr($download_url, "https://")) {
|
||||
header("Location: {$download_url}");
|
||||
if (strstr($download_url, "http://") || strstr($download_url, "ftp://") || strstr($download_url, "https://"))
|
||||
{
|
||||
$download_url = e107::getParser()->parseTemplate($download_url,true); // support for shortcode-driven dynamic URLS.
|
||||
e107::redirect($download_url);
|
||||
// header("Location: {$download_url}");
|
||||
exit();
|
||||
}
|
||||
else
|
||||
|
@ -419,7 +419,7 @@ $DOWNLOAD_TEMPLATE['categories']['end'] = "
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class='clearfix'>
|
||||
<div class='clearfix table'>
|
||||
<div class='pull-left'><small>{DOWNLOAD_CAT_NEWDOWNLOAD_TEXT}</small></div>
|
||||
<div class='pull-right'>{DOWNLOAD_CAT_SEARCH}</div>
|
||||
</div>";
|
||||
@ -438,8 +438,9 @@ $DOWNLOAD_WRAPPER['view']['DOWNLOAD_VIEW_AUTHORWEBSITE'] = "<td style='width:8
|
||||
$DOWNLOAD_WRAPPER['view']['DOWNLOAD_REPORT_LINK'] = "<tr><td style='width:20%' colspan='2'>{---}</td></tr>";
|
||||
|
||||
|
||||
$DOWNLOAD_TEMPLATE['view']['caption'] = LAN_PLUGIN_DOWNLOAD_NAME;
|
||||
$DOWNLOAD_TEMPLATE['view']['start'] = " ";
|
||||
$DOWNLOAD_TEMPLATE['view']['caption'] = LAN_PLUGIN_DOWNLOAD_NAME;
|
||||
$DOWNLOAD_TEMPLATE['view']['pagetitle'] = "{DOWNLOAD_VIEW_NAME} / {DOWNLOAD_CATEGORY} / ".LAN_PLUGIN_DOWNLOAD_NAME;
|
||||
$DOWNLOAD_TEMPLATE['view']['start'] = "";
|
||||
|
||||
$DOWNLOAD_TEMPLATE['view']['item'] = "
|
||||
<div id='download'>
|
||||
|
@ -390,7 +390,7 @@ foreach ($forumList['parents'] as $parent)
|
||||
|
||||
$sc->setVars($parent);
|
||||
$sc->wrapper('forum/main/parent');
|
||||
$forum_string .= $tp->parseTemplate($FORUM_MAIN_PARENT, false, $sc);
|
||||
$forum_string .= $tp->parseTemplate($FORUM_MAIN_PARENT, true, $sc);
|
||||
if (!count($forumList['forums'][$parent['forum_id']]))
|
||||
{
|
||||
$text .= "<td colspan='5' style='text-align:center' class='forumheader3'>".LAN_FORUM_0068."</td>";
|
||||
@ -424,7 +424,7 @@ foreach ($forumList['parents'] as $parent)
|
||||
if (isset($FORUM_MAIN_PARENT_END))
|
||||
{
|
||||
//-- $forum_string .= $tp->simpleParse($FORUM_MAIN_PARENT_END, $pVars);
|
||||
$forum_string .= $tp->parseTemplate($FORUM_MAIN_PARENT_END, false, $sc);
|
||||
$forum_string .= $tp->parseTemplate($FORUM_MAIN_PARENT_END, true, $sc);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -629,20 +629,20 @@ if (e_QUERY == 'new')
|
||||
|
||||
//-- $forum_newstring .= $tp->simpleParse($FORUM_NEWPOSTS_MAIN, $nVars);
|
||||
$sc->setVars($thread);
|
||||
$forum_newstring .= $tp->parseTemplate($FORUM_NEWPOSTS_MAIN, false, $sc);
|
||||
$forum_newstring .= $tp->parseTemplate($FORUM_NEWPOSTS_MAIN, true, $sc);
|
||||
}
|
||||
|
||||
if (empty($newThreadList))
|
||||
{
|
||||
//-- $nVars->NEWSPOSTNAME = LAN_FORUM_0029;
|
||||
//-- $forum_newstring = $tp->simpleParse($FORUM_NEWPOSTS_MAIN, $nVars);
|
||||
$forum_newstring = $tp->parseTemplate($FORUM_NEWPOSTS_MAIN, false, $sc);
|
||||
$forum_newstring = $tp->parseTemplate($FORUM_NEWPOSTS_MAIN, true, $sc);
|
||||
|
||||
}
|
||||
//-- $forum_new_start = $tp->simpleParse($FORUM_NEWPOSTS_START, $nVars);
|
||||
//-- $forum_new_end = $tp->simpleParse($FORUM_NEWPOSTS_END, $nVars);
|
||||
$forum_new_start = $tp->parseTemplate($FORUM_NEWPOSTS_START, false, $sc);
|
||||
$forum_new_end = $tp->parseTemplate($FORUM_NEWPOSTS_END, false, $sc);
|
||||
$forum_new_start = $tp->parseTemplate($FORUM_NEWPOSTS_START, true, $sc);
|
||||
$forum_new_end = $tp->parseTemplate($FORUM_NEWPOSTS_END, true, $sc);
|
||||
|
||||
if ($forum->prefs->get('enclose'))
|
||||
{
|
||||
@ -664,11 +664,11 @@ $breadarray = array(
|
||||
|
||||
//-- $forum_main_start = $tp->simpleParse($FORUM_MAIN_START, $fVars);
|
||||
$sc->wrapper('forum/main/start');
|
||||
$forum_main_start = $tp->parseTemplate($FORUM_MAIN_START, false, $sc);
|
||||
$forum_main_start = $tp->parseTemplate($FORUM_MAIN_START, true, $sc);
|
||||
//-- $forum_main_end = $tp->simpleParse($FORUM_MAIN_END, $fVars);
|
||||
|
||||
$sc->wrapper('forum/main/end');
|
||||
$forum_main_end = $tp->parseTemplate($FORUM_MAIN_END, false, $sc);
|
||||
$forum_main_end = $tp->parseTemplate($FORUM_MAIN_END, true, $sc);
|
||||
|
||||
if ($forum->prefs->get('enclose'))
|
||||
{
|
||||
|
@ -138,7 +138,7 @@ if(!deftrue('OLD_FORUMADMIN'))
|
||||
'checkboxes' => array ( 'title' => '', 'type' => null, 'data' => null, 'width' => '5%', 'thclass' => 'center', 'forced' => '1', 'class' => 'center', 'toggle' => 'e-multiselect', ),
|
||||
'forum_id' => array ( 'title' => LAN_ID, 'data' => 'int', 'width' => '5%', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ),
|
||||
'forum_name' => array ( 'title' => LAN_TITLE, 'type' => 'method', 'inline'=>true, 'data' => 'str', 'width' => '40%', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ),
|
||||
'forum_sef' => array ( 'title' => LAN_SEFURL, 'type' => 'text', 'inline'=>true, 'noedit'=>false, 'data' => 'str', 'width' => 'auto', 'help' => 'Leave blank to auto-generate it from the title above.', 'readParms' => '', 'writeParms' => 'size=xxlarge', 'class' => 'left', 'thclass' => 'left', ),
|
||||
'forum_sef' => array ( 'title' => LAN_SEFURL, 'type' => 'text', 'batch'=>true, 'inline'=>true, 'noedit'=>false, 'data' => 'str', 'width' => 'auto', 'help' => 'Leave blank to auto-generate it from the title above.', 'readParms' => '', 'writeParms' => 'sef=forum_name&size=xxlarge', 'class' => 'left', 'thclass' => 'left', ),
|
||||
'forum_description' => array ( 'title' => LAN_DESCRIPTION, 'type' => 'textarea', 'data' => 'str', 'width' => '30%', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ),
|
||||
'forum_parent' => array ( 'title' => FORLAN_75, 'type' => 'dropdown', 'data' => 'int', 'width' => '10%', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ),
|
||||
'forum_sub' => array ( 'title' => LAN_FORUM_1002, 'type' => 'dropdown', 'data' => 'int', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'center', 'thclass' => 'center', ),
|
||||
@ -822,7 +822,9 @@ if(!deftrue('OLD_FORUMADMIN'))
|
||||
}
|
||||
|
||||
$linkQ = e_SELF."?searchquery=&filter_options=page_chapter__".$id."&mode=page&action=list";
|
||||
$level_image = $parent ? '<img src="'.e_IMAGE_ABS.'generic/branchbottom.gif" class="icon" alt="" style="margin-left: '.($level * 20).'px" /> ' : '';
|
||||
// $level_image = $parent ? '<img src="'.e_IMAGE_ABS.'generic/branchbottom.gif" class="icon" alt="" style="margin-left: '.($level * 20).'px" /> ' : '';
|
||||
|
||||
$level_image = $parent ? str_replace('level-x','level-'.$level, ADMIN_CHILD_ICON) : '';
|
||||
|
||||
return ($parent) ? $level_image.$curVal : $curVal;
|
||||
}
|
||||
@ -858,7 +860,10 @@ if(!deftrue('OLD_FORUMADMIN'))
|
||||
$level = 2;
|
||||
}
|
||||
|
||||
$ret['inlineParms'] = array('pre'=>'<img src="'.e_IMAGE_ABS.'generic/branchbottom.gif" class="level-'.$level.' icon" alt="" />');
|
||||
// $ret['inlineParms'] = array('pre'=>'<img src="'.e_IMAGE_ABS.'generic/branchbottom.gif" class="level-'.$level.' icon" alt="" />');
|
||||
|
||||
$ret['inlineParms'] = array('pre'=> str_replace('level-x','level-'.$level, ADMIN_CHILD_ICON));
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -559,9 +559,9 @@ if($container_only)
|
||||
|
||||
//var_dump ($FORUM_VIEW_START);
|
||||
// var_dump ($FORUM_VIEW_SUB);
|
||||
$forum_view_start = $tp->parseTemplate($FORUM_VIEW_START_CONTAINER.$FORUM_VIEW_START, false, $sc);
|
||||
$forum_view_forum = $tp->parseTemplate($forum_view_forum, false, $sc);
|
||||
$forum_view_end = $tp->parseTemplate($FORUM_VIEW_END.$FORUM_VIEW_END_CONTAINER, false, $sc);
|
||||
$forum_view_start = $tp->parseTemplate($FORUM_VIEW_START_CONTAINER.$FORUM_VIEW_START, true, $sc);
|
||||
$forum_view_forum = $tp->parseTemplate($forum_view_forum, true, $sc);
|
||||
$forum_view_end = $tp->parseTemplate($FORUM_VIEW_END.$FORUM_VIEW_END_CONTAINER, true, $sc);
|
||||
|
||||
//$forum_view_start .= "<hr><hr>FVARS FORUM<hr><hr>".$tp->simpleParse($FORUM_VIEW_START, $fVars);
|
||||
//$forum_view_end = $tp->simpleParse($FORUM_VIEW_END, $fVars);
|
||||
@ -569,7 +569,7 @@ $forum_view_end = $tp->parseTemplate($FORUM_VIEW_END.$FORUM_VIEW_END_CONTAINER,
|
||||
if ($forum->prefs->get('enclose'))
|
||||
{
|
||||
// $forum_view_subs????
|
||||
$caption = varset($FORUM_VIEW_CAPTION) ? $tp->parseTemplate($FORUM_VIEW_CAPTION, TRUE, $sc) : $forum->prefs->get('title');
|
||||
$caption = varset($FORUM_VIEW_CAPTION) ? $tp->parseTemplate($FORUM_VIEW_CAPTION, true, $sc) : $forum->prefs->get('title');
|
||||
|
||||
$ns->tablerender($caption, $forum_view_start.$forum_view_subs.$forum_view_forum.$forum_view_end, array('forum_viewforum', 'main1'));
|
||||
}
|
||||
|
@ -616,7 +616,7 @@ require_once (HEADERF);
|
||||
|
||||
if ($forum->prefs->get('enclose'))
|
||||
{
|
||||
$forumTitle = empty($FORUMCAPTION) ? e107::pref('forum','title', LAN_PLUGIN_FORUM_NAME) : $tp->parseTemplate($FORUMCAPTION, TRUE, $sc);
|
||||
$forumTitle = empty($FORUMCAPTION) ? e107::pref('forum','title', LAN_PLUGIN_FORUM_NAME) : $tp->parseTemplate($FORUMCAPTION, true, $sc);
|
||||
$ns->tablerender($forumTitle, $mes->render().$forumstring, array('forum_viewtopic', 'main'));
|
||||
}
|
||||
else
|
||||
|
@ -111,7 +111,7 @@ class forum_newforumposts_menu // plugin folder + menu name (without the .php)
|
||||
|
||||
$sc = e107::getScBatch('view', 'forum')->setScVar('param',$param);
|
||||
|
||||
$list = $tp->parseTemplate($template['start'],true);
|
||||
$list = $tp->parseTemplate($template['start'], true);
|
||||
|
||||
while($row = $sql->fetch())
|
||||
{
|
||||
@ -119,7 +119,7 @@ class forum_newforumposts_menu // plugin folder + menu name (without the .php)
|
||||
|
||||
$sc->setScVar('postInfo', $row);
|
||||
$sc->setVars($row);
|
||||
$list .= $tp->parseTemplate($template['item'],false,$sc);
|
||||
$list .= $tp->parseTemplate($template['item'], true, $sc);
|
||||
|
||||
|
||||
/*
|
||||
@ -189,7 +189,7 @@ class forum_newforumposts_menu // plugin folder + menu name (without the .php)
|
||||
|
||||
|
||||
|
||||
$list .= $tp->parseTemplate($template['end'],true);
|
||||
$list .= $tp->parseTemplate($template['end'], true);
|
||||
|
||||
|
||||
$text = $list;
|
||||
|
@ -94,18 +94,21 @@ class import_main_ui extends e_admin_ui
|
||||
// Definitions of available areas to import
|
||||
protected $importTables = array(
|
||||
'users' => array('message' => LAN_CONVERT_25, 'classfile' => 'import_user_class.php', 'classname' => 'user_import'),
|
||||
'userclass' => array('message' => LAN_CONVERT_73, 'nolist'=>true, 'classfile' => 'import_user_class.php', 'classname' => 'userclass_import'),
|
||||
|
||||
'news' => array('message' => LAN_CONVERT_28, 'classfile' => 'import_news_class.php', 'classname' => 'news_import'),
|
||||
'page' => array('message' => "Pages", 'classfile' => 'import_page_class.php', 'classname' => 'page_import'),
|
||||
'links' => array('message' => "Links", 'classfile' => 'import_links_class.php', 'classname' => 'links_import'),
|
||||
'media' => array('message' => "Media", 'classfile' => 'import_media_class.php', 'classname' => 'media_import'),
|
||||
'forum' => array('message' => "Forum", 'classfile' => 'import_forum_class.php', 'classname' => 'forum_import'),
|
||||
'forumthread' => array('message' => "Forum Topics/Threads", 'classfile' => 'import_forum_class.php', 'classname' => 'forumthread_import', 'nolist'=>true),
|
||||
'forumpost' => array('message' => "Forum Posts", 'classfile' => 'import_forum_class.php', 'classname' => 'forumpost_import', 'nolist'=>true),
|
||||
'forumtrack' => array('message' => "Forum Track", 'classfile' => 'import_forum_class.php', 'classname' => 'forumtrack_import', 'nolist'=>true),
|
||||
// 'forumpost' => array('message' => "Media", 'classfile' => 'import_media_class.php', 'classname' => 'media_import'),
|
||||
'comments' => array('message'=> LAN_COMMENTS),
|
||||
// 'forumdefs' => array('message' => LAN_CONVERT_26),
|
||||
// 'forumposts' => array('message' => LAN_CONVERT_48),
|
||||
'newscategory' => array('message' => LAN_CONVERT_74, 'nolist'=>true, 'classfile' => 'import_news_class.php', 'classname' => 'newscategory_import'),
|
||||
|
||||
'page' => array('message' => LAN_CONVERT_65, 'classfile' => 'import_page_class.php', 'classname' => 'page_import'),
|
||||
'pagechapter' => array('message' => LAN_CONVERT_66, 'nolist'=>true, 'classfile' => 'import_page_class.php', 'classname' => 'pagechapter_import'),
|
||||
'links' => array('message' => LAN_CONVERT_67, 'classfile' => 'import_links_class.php', 'classname' => 'links_import'),
|
||||
'media' => array('message' => LAN_CONVERT_68, 'classfile' => 'import_media_class.php', 'classname' => 'media_import'),
|
||||
'forum' => array('message' => LAN_CONVERT_69, 'classfile' => 'import_forum_class.php', 'classname' => 'forum_import'),
|
||||
'forumthread' => array('message' => LAN_CONVERT_70, 'classfile' => 'import_forum_class.php', 'classname' => 'forumthread_import', 'nolist'=>true),
|
||||
'forumpost' => array('message' => LAN_CONVERT_71, 'classfile' => 'import_forum_class.php', 'classname' => 'forumpost_import', 'nolist'=>true),
|
||||
'forumtrack' => array('message' => LAN_CONVERT_72, 'classfile' => 'import_forum_class.php', 'classname' => 'forumtrack_import', 'nolist'=>true),
|
||||
// 'comments' => array('message'=> LAN_COMMENTS),
|
||||
|
||||
// 'polls' => array('message' => LAN_CONVERT_27)
|
||||
);
|
||||
|
||||
@ -121,26 +124,31 @@ class import_main_ui extends e_admin_ui
|
||||
|
||||
foreach($importClassList as $file)
|
||||
{
|
||||
|
||||
|
||||
$tag = str_replace('_class.php','',$file['fname']);
|
||||
|
||||
$key = str_replace("_import_class.php","",$file['fname']);
|
||||
|
||||
if($key === 'template')
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
include_once($file['path'].$file['fname']); // This will set up the variables
|
||||
|
||||
$this->providers[$key] = $this->getMeta($tag);
|
||||
|
||||
if(vartrue($_GET['type']))
|
||||
if(!empty($_GET['type']))
|
||||
{
|
||||
$this->importClass = $_GET['type']."_import";
|
||||
|
||||
$this->importClass = filter_var($_GET['type'])."_import";
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
uksort($this->providers,'strcasecmp');
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -235,13 +243,20 @@ class import_main_ui extends e_admin_ui
|
||||
<legend class='e-hideme'>".'DBLAN_10'."</legend>
|
||||
".$frm->hidden('mode','main')."
|
||||
".$frm->hidden('action','import')."
|
||||
<table class='table adminlist'>
|
||||
<table class='table table-striped table-bordered'>
|
||||
<colgroup>
|
||||
<col />";
|
||||
|
||||
foreach($this->importTables as $key=>$val)
|
||||
{
|
||||
if(!empty($val['nolist'])){ continue; }
|
||||
$text .= "<col style='width:5%' />\n";
|
||||
}
|
||||
|
||||
|
||||
$text .= "
|
||||
<col />
|
||||
<col />
|
||||
<col />
|
||||
<col />
|
||||
<col />
|
||||
|
||||
</colgroup>
|
||||
<thead>
|
||||
<tr>
|
||||
@ -281,7 +296,7 @@ class import_main_ui extends e_admin_ui
|
||||
|
||||
$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'>" : "";
|
||||
$icon = (file_exists($iconFile)) ? "<img src='{$iconFile}' alt='' style='float:left;height:32px;width:32px;margin-right:8px'>" : "";
|
||||
|
||||
$text .= "<!-- $title -->
|
||||
<tr><td >".$icon.$title."<div class='smalltext'>".$info['description']."</div></td>\n";
|
||||
@ -295,7 +310,7 @@ class import_main_ui extends e_admin_ui
|
||||
$text .= "
|
||||
<td class='center middle'>";
|
||||
|
||||
$text .= $frm->admin_button('type', $k, 'other',"Select");
|
||||
$text .= $frm->admin_button('type', $k, 'other',LAN_CONVERT_64);
|
||||
// $text .= $frm->admin_button('import_type', $k, 'other',"Select");
|
||||
|
||||
$text .= "
|
||||
@ -462,8 +477,9 @@ class import_main_ui extends e_admin_ui
|
||||
|
||||
if($proObj->sourceType == 'db' || !$proObj->sourceType) // STANDARD db Setup
|
||||
{
|
||||
|
||||
|
||||
$databases = $this->getDatabases();
|
||||
$prefix = (varset($_POST['dbParamPrefix']) ? $_POST['dbParamPrefix'] : $proObj->mprefix);
|
||||
/*
|
||||
$text .= "
|
||||
<tr>
|
||||
<td>$importType ".LAN_CONVERT_19."</td>
|
||||
@ -480,13 +496,16 @@ class import_main_ui extends e_admin_ui
|
||||
<td >$importType ".LAN_CONVERT_21."</td>
|
||||
<td ><input class='tbox' type='text' name='dbParamPassword' size='30' value='".varset($_POST['dbParamPassword'])."' maxlength='100' /></td>
|
||||
</tr>
|
||||
";*/
|
||||
|
||||
$text .= "
|
||||
<tr>
|
||||
<td >$importType ".LAN_CONVERT_22."</td>
|
||||
<td ><input class='tbox' type='text' name='dbParamDatabase' size='30' value='".varset($_POST['dbParamDatabase'])."' maxlength='100' required /></td>
|
||||
<td >".$frm->select('dbParamDatabase', $databases, null, array('required'=>1), LAN_SELECT)."</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'] : $proObj->mprefix)."' maxlength='100' />
|
||||
<td >".$frm->text('dbParamPrefix', $prefix, 100)."
|
||||
<input type='hidden' name='import_source' value='db' />
|
||||
</td>
|
||||
</tr>";
|
||||
@ -496,16 +515,18 @@ class import_main_ui extends e_admin_ui
|
||||
|
||||
if(method_exists($proObj,"config")) // Config Found in Class - render options from it.
|
||||
{
|
||||
$ops = $proObj->config();
|
||||
foreach($ops as $key=>$val)
|
||||
if($ops = $proObj->config())
|
||||
{
|
||||
$text .= "<tr>
|
||||
<td>".$val['caption']."</td>
|
||||
<td>".$val['html'];
|
||||
$text .= (vartrue($val['help'])) ? "<div class='field-help'>".$val['help']."</div>" : "";
|
||||
$text .= "</td>
|
||||
</tr>\n";
|
||||
}
|
||||
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";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -547,7 +568,8 @@ class import_main_ui extends e_admin_ui
|
||||
$text .= "
|
||||
<tr>
|
||||
<td>".LAN_CONVERT_38."</td>
|
||||
<td>".$frm->checkbox('import_delete_existing_data', 1,$_POST['import_delete_existing_data'], array('label'=>' ','title'=>LAN_CONVERT_39))."</td>
|
||||
<td>".$frm->radio_switch('import_delete_existing_data', $_POST['import_delete_existing_data'])."
|
||||
<div class='field-help'>".LAN_CONVERT_39."</div></td>
|
||||
</tr>";
|
||||
|
||||
//TODO
|
||||
@ -595,7 +617,32 @@ class import_main_ui extends e_admin_ui
|
||||
}
|
||||
|
||||
|
||||
private function getDatabases()
|
||||
{
|
||||
$tmp = e107::getDb()->gen("SHOW DATABASES");
|
||||
$databases = e107::getDb()->db_getList();
|
||||
|
||||
$arr = array();
|
||||
|
||||
$exclude = array('mysql', 'information_schema', 'performance_schema', 'phpmyadmin');
|
||||
|
||||
foreach($databases as $v)
|
||||
{
|
||||
$id = $v['Database'];
|
||||
|
||||
if(in_array($id,$exclude))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
$arr[$id] = $id;
|
||||
|
||||
}
|
||||
|
||||
return $arr;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -635,7 +682,7 @@ class import_main_ui extends e_admin_ui
|
||||
if (class_exists($this->importClass))
|
||||
{
|
||||
$mes->addDebug("dbImport(): Converter Class Available: ".$this->importClass);
|
||||
$converter = new $this->importClass;
|
||||
$converter = new $this->importClass ;
|
||||
$converter->init();
|
||||
}
|
||||
else
|
||||
@ -649,14 +696,17 @@ class import_main_ui extends e_admin_ui
|
||||
|
||||
if($mode == 'db') // Don't do DB check on RSS/XML
|
||||
{
|
||||
if (!isset($_POST['dbParamHost']) || !isset($_POST['dbParamUsername']) || !isset($_POST['dbParamPassword']) || !isset($_POST['dbParamDatabase']))
|
||||
if (empty($_POST['dbParamDatabase']))
|
||||
{
|
||||
$mes->addError(LAN_CONVERT_41);
|
||||
return false;
|
||||
}
|
||||
|
||||
$result = $converter->db_Connect($tp->filter($_POST['dbParamHost']), $tp->filter($_POST['dbParamUsername']), $tp->filter($_POST['dbParamPassword']), $tp->filter($_POST['dbParamDatabase']), $tp->filter($_POST['dbParamPrefix']));
|
||||
if ($result !== TRUE)
|
||||
$result = $converter->database($tp->filter($_POST['dbParamDatabase']), $tp->filter($_POST['dbParamPrefix']));
|
||||
|
||||
// $result = $converter->database($tp->filter($_POST['dbParamDatabase']), $tp->filter($_POST['dbParamPrefix']), true);
|
||||
|
||||
if ($result !== true)
|
||||
{
|
||||
$mes->addError(LAN_CONVERT_43.": ".$result); // db connect failed
|
||||
return false;
|
||||
@ -714,7 +764,7 @@ class import_main_ui extends e_admin_ui
|
||||
|
||||
$result = $converter->setupQuery($k, !$this->deleteExisting);
|
||||
|
||||
if ($result !== TRUE)
|
||||
if ($result !== true)
|
||||
{
|
||||
$mes->addError(LAN_CONVERT_44.' '.$k); // couldn't set query
|
||||
break;
|
||||
@ -732,6 +782,7 @@ class import_main_ui extends e_admin_ui
|
||||
|
||||
if ($this->deleteExisting == true)
|
||||
{
|
||||
$mes->addDebug("dbImport(): Emptying target table. ");
|
||||
$exporter->emptyTargetDB(); // Clean output DB - reasonably safe now
|
||||
}
|
||||
|
||||
@ -1537,6 +1588,7 @@ function csv_split(&$data,$delim=',',$enveloper='')
|
||||
|
||||
function headerjs()
|
||||
{
|
||||
return;
|
||||
// global $import_class_names; // Keys are the various db options
|
||||
global $import_class_support;
|
||||
global $db_import_blocks;
|
||||
@ -1634,4 +1686,4 @@ function headerjs()
|
||||
|
||||
|
||||
|
||||
?>
|
||||
?>
|
||||
|
@ -20,26 +20,27 @@ Root classes for import and saving of data. Application-specific classes build o
|
||||
|
||||
class base_import_class
|
||||
{
|
||||
var $ourDB = NULL;
|
||||
var $DBPrefix = '';
|
||||
var $currentTask = '';
|
||||
var $copyUserInfo = TRUE;
|
||||
var $ourDB = null;
|
||||
var $DBPrefix = '';
|
||||
var $currentTask = '';
|
||||
var $copyUserInfo = true;
|
||||
protected $arrayData = array();
|
||||
|
||||
/**
|
||||
* Connect to the external DB if not already connected
|
||||
*/
|
||||
function db_Connect($server, $user, $password, $database, $prefix)
|
||||
function database($database, $prefix)
|
||||
{
|
||||
if ($this->ourDB == NULL)
|
||||
{
|
||||
$this->ourDB = e107::getDb('ourDB');
|
||||
$result = $this->ourDB->db_Connect($server, $user, $password, $database);
|
||||
$this->DBPrefix = $prefix;
|
||||
$result = $this->ourDB->database($database,$prefix,true);
|
||||
$this->DBPrefix = "`".$database."`.".$prefix;
|
||||
if ($result)
|
||||
{
|
||||
return $result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
@ -62,15 +63,27 @@ class base_import_class
|
||||
case 'users' :
|
||||
return $this->saveUserData($dataRecord);
|
||||
break;
|
||||
|
||||
|
||||
case 'userclass' :
|
||||
return $this->saveUserClassData($dataRecord);
|
||||
break;
|
||||
|
||||
case 'news' :
|
||||
return $this->saveNewsData($dataRecord);
|
||||
break;
|
||||
|
||||
case 'newscategory' :
|
||||
return $this->saveNewsCategoryData($dataRecord);
|
||||
break;
|
||||
|
||||
case 'page' :
|
||||
return $this->savePageData($dataRecord);
|
||||
break;
|
||||
|
||||
case 'pagechapter' :
|
||||
return $this->savePageChapterData($dataRecord);
|
||||
break;
|
||||
|
||||
case 'links' :
|
||||
return $this->saveLinksData($dataRecord);
|
||||
break;
|
||||
@ -110,7 +123,7 @@ class base_import_class
|
||||
{
|
||||
if($mode == 'db')
|
||||
{
|
||||
$result = $this->ourDB->db_Fetch();
|
||||
$result = $this->ourDB->fetch();
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -125,15 +138,27 @@ class base_import_class
|
||||
case 'users' :
|
||||
return $this->copyUserData($initial, $result);
|
||||
break;
|
||||
|
||||
|
||||
case 'userclass' :
|
||||
return $this->copyUserClassData($initial, $result);
|
||||
break;
|
||||
|
||||
case 'news' :
|
||||
return $this->copyNewsData($initial, $result);
|
||||
break;
|
||||
|
||||
|
||||
case 'newscategory' :
|
||||
return $this->copyNewsCategoryData($initial, $result);
|
||||
break;
|
||||
|
||||
case 'page' :
|
||||
return $this->copyPageData($initial, $result);
|
||||
break;
|
||||
|
||||
case 'pagechapter' :
|
||||
return $this->copyPageChapterData($initial, $result);
|
||||
break;
|
||||
|
||||
case 'links' :
|
||||
return $this->copyLinksData($initial, $result);
|
||||
break;
|
||||
@ -187,17 +212,32 @@ class base_import_class
|
||||
{
|
||||
return $target;
|
||||
}
|
||||
|
||||
function copyUserClassData(&$target, &$source)
|
||||
{
|
||||
return $target;
|
||||
}
|
||||
|
||||
function copyNewsData(&$target, &$source)
|
||||
{
|
||||
return $target;
|
||||
}
|
||||
|
||||
function copyNewsCategoryData(&$target, &$source)
|
||||
{
|
||||
return $target;
|
||||
}
|
||||
|
||||
function copyPageData(&$target, &$source)
|
||||
{
|
||||
return $target;
|
||||
}
|
||||
|
||||
|
||||
function copyPageChapterData(&$target, &$source)
|
||||
{
|
||||
return $target;
|
||||
}
|
||||
|
||||
function copyLinksData(&$target, &$source)
|
||||
{
|
||||
return $target;
|
||||
@ -228,7 +268,44 @@ class base_import_class
|
||||
return $target;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $source
|
||||
* @param $target
|
||||
*/
|
||||
public function debug($source,$target)
|
||||
{
|
||||
echo "<table style='width:100%'>
|
||||
<tr><th>Source CMS</th><th>Target e107</th></tr>
|
||||
<tr>
|
||||
<td style='vertical-align:top'>".$this->renderTable($source)."</td>
|
||||
<td style='vertical-align:top'>".$this->renderTable($target)."</td>
|
||||
</tr>
|
||||
</table>";
|
||||
|
||||
}
|
||||
|
||||
private function renderTable($source)
|
||||
{
|
||||
$text = "<table class='table table-striped table-bordered'>
|
||||
<tr><th>Field</th><th>Data</th></tr>";
|
||||
|
||||
foreach($source as $k=>$v)
|
||||
{
|
||||
$text .= "<tr>
|
||||
<td style='width:50%;'>".$k."</td>
|
||||
<td>".htmlentities($v)."</td>
|
||||
</tr>";
|
||||
|
||||
|
||||
}
|
||||
|
||||
$text .= "
|
||||
</table>
|
||||
";
|
||||
|
||||
return $text;
|
||||
|
||||
}
|
||||
|
||||
//===========================================================
|
||||
// UTILITY ROUTINES
|
||||
|
@ -93,13 +93,13 @@ class forum_import
|
||||
function getErrorText($errnum) // these errors are presumptuous and misleading. especially '4' .
|
||||
{
|
||||
$errorTexts = array(
|
||||
0 => 'No error',
|
||||
1 => 'Can\'t change main admin data',
|
||||
2 => 'invalid field passed',
|
||||
3 => 'Mandatory field not set',
|
||||
4 => 'Entry already exists',
|
||||
5 => 'Invalid characters in user or login name',
|
||||
6 => 'Error saving extended user fields'
|
||||
0 => LAN_CONVERT_57,
|
||||
1 => LAN_CONVERT_58,
|
||||
2 => LAN_CONVERT_59,
|
||||
3 => LAN_CONVERT_60,
|
||||
4 => LAN_CONVERT_61,
|
||||
5 => LAN_CONVERT_62,
|
||||
6 => LAN_CONVERT_63
|
||||
);
|
||||
|
||||
if (isset($errorTexts[$errnum])) return $errorTexts[$errnum];
|
||||
@ -197,13 +197,13 @@ class forumthread_import
|
||||
function getErrorText($errnum) // these errors are presumptuous and misleading. especially '4' .
|
||||
{
|
||||
$errorTexts = array(
|
||||
0 => 'No error',
|
||||
1 => 'Can\'t change main admin data',
|
||||
2 => 'invalid field passed',
|
||||
3 => 'Mandatory field not set',
|
||||
4 => 'Entry already exists',
|
||||
5 => 'Invalid characters in user or login name',
|
||||
6 => 'Error saving extended user fields'
|
||||
0 => LAN_CONVERT_57,
|
||||
1 => LAN_CONVERT_58,
|
||||
2 => LAN_CONVERT_59,
|
||||
3 => LAN_CONVERT_60,
|
||||
4 => LAN_CONVERT_61,
|
||||
5 => LAN_CONVERT_62,
|
||||
6 => LAN_CONVERT_63
|
||||
);
|
||||
|
||||
if (isset($errorTexts[$errnum])) return $errorTexts[$errnum];
|
||||
@ -307,13 +307,13 @@ class forumpost_import
|
||||
function getErrorText($errnum) // these errors are presumptuous and misleading. especially '4' .
|
||||
{
|
||||
$errorTexts = array(
|
||||
0 => 'No error',
|
||||
1 => 'Can\'t change main admin data',
|
||||
2 => 'invalid field passed',
|
||||
3 => 'Mandatory field not set',
|
||||
4 => 'Entry already exists',
|
||||
5 => 'Invalid characters in user or login name',
|
||||
6 => 'Error saving extended user fields'
|
||||
0 => LAN_CONVERT_57,
|
||||
1 => LAN_CONVERT_58,
|
||||
2 => LAN_CONVERT_59,
|
||||
3 => LAN_CONVERT_60,
|
||||
4 => LAN_CONVERT_61,
|
||||
5 => LAN_CONVERT_62,
|
||||
6 => LAN_CONVERT_63
|
||||
);
|
||||
|
||||
if (isset($errorTexts[$errnum])) return $errorTexts[$errnum];
|
||||
@ -402,13 +402,13 @@ class forumtrack_import
|
||||
function getErrorText($errnum) // these errors are presumptuous and misleading. especially '4' .
|
||||
{
|
||||
$errorTexts = array(
|
||||
0 => 'No error',
|
||||
1 => 'Can\'t change main admin data',
|
||||
2 => 'invalid field passed',
|
||||
3 => 'Mandatory field not set',
|
||||
4 => 'Entry already exists',
|
||||
5 => 'Invalid characters in user or login name',
|
||||
6 => 'Error saving extended user fields'
|
||||
0 => LAN_CONVERT_57,
|
||||
1 => LAN_CONVERT_58,
|
||||
2 => LAN_CONVERT_59,
|
||||
3 => LAN_CONVERT_60,
|
||||
4 => LAN_CONVERT_61,
|
||||
5 => LAN_CONVERT_62,
|
||||
6 => LAN_CONVERT_63
|
||||
);
|
||||
|
||||
if (isset($errorTexts[$errnum])) return $errorTexts[$errnum];
|
||||
@ -423,4 +423,4 @@ class forumtrack_import
|
||||
|
||||
|
||||
|
||||
?>
|
||||
?>
|
||||
|
@ -107,13 +107,13 @@ class links_import
|
||||
function getErrorText($errnum) // these errors are presumptuous and misleading. especially '4' .
|
||||
{
|
||||
$errorTexts = array(
|
||||
0 => 'No error',
|
||||
1 => 'Can\'t change main admin data',
|
||||
2 => 'invalid field passed',
|
||||
3 => 'Mandatory field not set',
|
||||
4 => 'Entry already exists',
|
||||
5 => 'Invalid characters in user or login name',
|
||||
6 => 'Error saving extended user fields'
|
||||
0 => LAN_CONVERT_57,
|
||||
1 => LAN_CONVERT_58,
|
||||
2 => LAN_CONVERT_59,
|
||||
3 => LAN_CONVERT_60,
|
||||
4 => LAN_CONVERT_61,
|
||||
5 => LAN_CONVERT_62,
|
||||
6 => LAN_CONVERT_63
|
||||
);
|
||||
|
||||
if (isset($errorTexts[$errnum])) return $errorTexts[$errnum];
|
||||
@ -127,4 +127,4 @@ class links_import
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
?>
|
||||
|
@ -66,16 +66,14 @@ class news_import
|
||||
// Constructor
|
||||
function __construct()
|
||||
{
|
||||
global $sql;
|
||||
$this->newsDB = new db; // Have our own database object to write to the news table
|
||||
$this->newsDB = e107::getDb('news'); // Have our own database object to write to the news table
|
||||
}
|
||||
|
||||
|
||||
// Empty the news DB
|
||||
function emptyTargetDB($inc_admin = FALSE)
|
||||
{
|
||||
// leave existing
|
||||
// $this->newsDB->db_Delete('news');
|
||||
$this->newsDB->truncate('news');
|
||||
}
|
||||
|
||||
|
||||
@ -103,7 +101,7 @@ class news_import
|
||||
*/
|
||||
function saveData($row)
|
||||
{
|
||||
if(!$result = $this->newsDB->db_Insert('news',$row))
|
||||
if(!$result = $this->newsDB->insert('news',$row))
|
||||
{
|
||||
return 4;
|
||||
}
|
||||
@ -118,13 +116,13 @@ class news_import
|
||||
function getErrorText($errnum) // these errors are presumptuous and misleading. especially '4' .
|
||||
{
|
||||
$errorTexts = array(
|
||||
0 => 'No error',
|
||||
1 => 'Can\'t change main admin data',
|
||||
2 => 'invalid field passed',
|
||||
3 => 'Mandatory field not set',
|
||||
4 => 'Entry already exists',
|
||||
5 => 'Invalid characters in user or login name',
|
||||
6 => 'Error saving extended user fields'
|
||||
0 => LAN_CONVERT_57,
|
||||
1 => LAN_CONVERT_58,
|
||||
2 => LAN_CONVERT_59,
|
||||
3 => LAN_CONVERT_60,
|
||||
4 => LAN_CONVERT_61,
|
||||
5 => LAN_CONVERT_62,
|
||||
6 => LAN_CONVERT_63
|
||||
);
|
||||
|
||||
if (isset($errorTexts[$errnum])) return $errorTexts[$errnum];
|
||||
@ -138,4 +136,88 @@ class news_import
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
|
||||
class newscategory_import
|
||||
{
|
||||
var $newsDB = NULL;
|
||||
var $blockMainAdmin = TRUE;
|
||||
var $error;
|
||||
|
||||
var $default = array(
|
||||
|
||||
// 'category_id' => '', // auto-increment
|
||||
'category_name' => '',
|
||||
'category_sef' => '',
|
||||
'category_meta_description' => '',
|
||||
'category_meta_keywords' => '',
|
||||
'category_manager' => e_UC_ADMIN,
|
||||
'category_icon' => '',
|
||||
'category_order' => 0,
|
||||
);
|
||||
|
||||
/* Fields which must be set up by the caller. */
|
||||
var $mandatory = array(
|
||||
'category_id',
|
||||
'category_name',
|
||||
);
|
||||
|
||||
// Constructor
|
||||
function __construct()
|
||||
{
|
||||
$this->newsDB = e107::getDb('newscat'); // Have our own database object to write to the news table
|
||||
}
|
||||
|
||||
|
||||
// Empty the news DB
|
||||
function emptyTargetDB($inc_admin = FALSE)
|
||||
{
|
||||
$this->newsDB->truncate('news_category');
|
||||
}
|
||||
|
||||
|
||||
// Set a new default for a particular field
|
||||
function overrideDefault($key, $value)
|
||||
{
|
||||
// echo "Override: {$key} => {$value}<br />";
|
||||
if (!isset($this->default[$key])) return FALSE;
|
||||
$this->default[$key] = $value;
|
||||
}
|
||||
|
||||
|
||||
// Returns an array with all relevant fields set to the current default
|
||||
function getDefaults()
|
||||
{
|
||||
return $this->default;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Insert data into e107 DB
|
||||
* @param row - array of table data
|
||||
* @return integer, boolean - error code on failure, TRUE on success
|
||||
*/
|
||||
function saveData($row)
|
||||
{
|
||||
if(!$result = $this->newsDB->insert('news_category',$row))
|
||||
{
|
||||
return 4;
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
function getErrorText($errnum) // these errors are presumptuous and misleading. especially '4' .
|
||||
{
|
||||
return $this->newsDB->getLastErrorText();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
|
@ -41,14 +41,14 @@ class page_import
|
||||
'page_metakeys' => '',
|
||||
'page_metadscr' => '',
|
||||
'page_text' => '',
|
||||
'page_author' => 1,
|
||||
'page_author' => USERID,
|
||||
'page_datestamp' => '',
|
||||
'page_rating_flag' => '0',
|
||||
'page_comment_flag' => '0',
|
||||
'page_password' => '',
|
||||
'page_class' => '0',
|
||||
'page_ip_restrict' => '',
|
||||
'menu_name' => '',
|
||||
'menu_name' => '',
|
||||
'page_template' => 'default'
|
||||
|
||||
);
|
||||
@ -61,15 +61,14 @@ class page_import
|
||||
// Constructor
|
||||
function __construct()
|
||||
{
|
||||
global $sql;
|
||||
$this->pageDB = new db; // Have our own database object to write to the table
|
||||
$this->pageDB = e107::getDb('page'); // Have our own database object to write to the table
|
||||
}
|
||||
|
||||
|
||||
// Empty the DB - not necessary
|
||||
function emptyTargetDB($inc_admin = FALSE)
|
||||
{
|
||||
// $this->pageDB->db_Delete('page');
|
||||
$this->pageDB->truncate('page');
|
||||
}
|
||||
|
||||
|
||||
@ -95,7 +94,7 @@ class page_import
|
||||
*/
|
||||
function saveData($row)
|
||||
{
|
||||
if(!$result = $this->pageDB->db_Insert('page',$row))
|
||||
if(!$result = $this->pageDB->insert('page',$row))
|
||||
{
|
||||
return 4;
|
||||
}
|
||||
@ -109,20 +108,8 @@ class page_import
|
||||
|
||||
function getErrorText($errnum) // these errors are presumptuous and misleading. especially '4' .
|
||||
{
|
||||
$errorTexts = array(
|
||||
0 => 'No error',
|
||||
1 => 'Can\'t change main admin data',
|
||||
2 => 'invalid field passed',
|
||||
3 => 'Mandatory field not set',
|
||||
4 => 'Entry already exists',
|
||||
5 => 'Invalid characters in user or login name',
|
||||
6 => 'Error saving extended user fields'
|
||||
);
|
||||
|
||||
if (isset($errorTexts[$errnum])) return $errorTexts[$errnum];
|
||||
|
||||
return 'Unknown: '.$errnum;
|
||||
|
||||
return $this->pageDB->getLastErrorText();
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -130,4 +117,133 @@ class page_import
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
class pagechapter_import
|
||||
{
|
||||
var $pageDB = null;
|
||||
var $blockMainAdmin = true;
|
||||
var $error;
|
||||
|
||||
var $defaults = array(
|
||||
'chapter_id' => '',
|
||||
'chapter_parent' => 1,
|
||||
'chapter_name' => '',
|
||||
'chapter_sef' => '',
|
||||
'chapter_meta_description' => '',
|
||||
'chapter_meta_keywords' => '',
|
||||
'chapter_manager' => e_UC_ADMIN,
|
||||
'chapter_icon' => '',
|
||||
'chapter_order' => 0,
|
||||
'chapter_template' => 'default',
|
||||
'chapter_visibility' => 0,
|
||||
'chapter_fields' => null
|
||||
|
||||
);
|
||||
|
||||
// Fields which must be set up by the caller.
|
||||
var $mandatory = array(
|
||||
'chapter_name'
|
||||
);
|
||||
|
||||
// Constructor
|
||||
function __construct()
|
||||
{
|
||||
$this->pageDB = e107::getDb('pagechapter'); // Have our own database object to write to the table
|
||||
}
|
||||
|
||||
|
||||
// Empty the DB
|
||||
function emptyTargetDB($inc_admin = FALSE)
|
||||
{
|
||||
$this->pageDB->truncate('page_chapters');
|
||||
|
||||
$insert = array(
|
||||
'chapter_id' => '1',
|
||||
'chapter_parent' => '0',
|
||||
'chapter_name' => 'General',
|
||||
'chapter_sef' => 'general',
|
||||
'chapter_meta_description' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec et tempor odio. Quisque volutpat lorem nec lectus congue suscipit. In hac habitasse platea dictumst. Etiam odio nisi, egestas vitae amet.',
|
||||
'chapter_meta_keywords' => '',
|
||||
'chapter_manager' => '0',
|
||||
'chapter_icon' => '',
|
||||
'chapter_order' => '0',
|
||||
'chapter_template' => 'default',
|
||||
'chapter_visibility' => '0',
|
||||
'chapter_fields' => null
|
||||
);
|
||||
|
||||
|
||||
$this->pageDB->insert('page_chapters',$insert); // insert a default book.
|
||||
}
|
||||
|
||||
|
||||
// Set a new default for a particular field
|
||||
function overrideDefault($key, $value)
|
||||
{
|
||||
// echo "Override: {$key} => {$value}<br />";
|
||||
if (!isset($this->defaults[$key])) return FALSE;
|
||||
$this->defaults[$key] = $value;
|
||||
}
|
||||
|
||||
|
||||
// Returns an array with all relevant fields set to the current default
|
||||
function getDefaults()
|
||||
{
|
||||
return $this->defaults;
|
||||
}
|
||||
|
||||
/**
|
||||
* Insert data into e107 DB
|
||||
* @param row - array of table data
|
||||
* @return integer, boolean - error code on failure, TRUE on success
|
||||
*/
|
||||
function saveData($row)
|
||||
{
|
||||
|
||||
if(empty($row['chapter_name']))
|
||||
{
|
||||
return 3;
|
||||
}
|
||||
|
||||
|
||||
if(!$result = $this->pageDB->insert('page_chapters',$row))
|
||||
{
|
||||
return 4;
|
||||
}
|
||||
|
||||
//if ($result === FALSE) return 6;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
function getErrorText($errnum) // these errors are presumptuous and misleading. especially '4' .
|
||||
{
|
||||
$errorTexts = array(
|
||||
0 => LAN_CONVERT_57,
|
||||
1 => LAN_CONVERT_58,
|
||||
2 => LAN_CONVERT_59,
|
||||
3 => LAN_CONVERT_60,
|
||||
4 => LAN_CONVERT_61,
|
||||
5 => LAN_CONVERT_62,
|
||||
6 => LAN_CONVERT_63
|
||||
);
|
||||
|
||||
if (isset($errorTexts[$errnum])) return $errorTexts[$errnum];
|
||||
|
||||
return $this->pageDB->getLastErrorText();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
|
@ -238,13 +238,13 @@ class user_import
|
||||
function getErrorText($errnum) // these errors are presumptuous and misleading. especially '4' .
|
||||
{
|
||||
$errorTexts = array(
|
||||
0 => 'No error',
|
||||
1 => 'Can\'t change main admin data',
|
||||
2 => 'invalid field passed',
|
||||
3 => 'Mandatory field not set',
|
||||
4 => 'User already exists',
|
||||
5 => 'Invalid characters in user or login name',
|
||||
6 => 'Error saving extended user fields'
|
||||
0 => LAN_CONVERT_57,
|
||||
1 => LAN_CONVERT_58,
|
||||
2 => LAN_CONVERT_59,
|
||||
3 => LAN_CONVERT_60,
|
||||
4 => LAN_CONVERT_61,
|
||||
5 => LAN_CONVERT_62,
|
||||
6 => LAN_CONVERT_63
|
||||
);
|
||||
|
||||
if (isset($errorTexts[$errnum])) return $errorTexts[$errnum];
|
||||
@ -253,4 +253,111 @@ class user_import
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
|
||||
|
||||
class userclass_import
|
||||
{
|
||||
var $ucdb = null;
|
||||
var $blockMainAdmin = true;
|
||||
var $error;
|
||||
|
||||
var $defaults = array(
|
||||
'userclass_id' => 0,
|
||||
'userclass_name' => 0,
|
||||
'userclass_description' => 0,
|
||||
'userclass_editclass' => 0,
|
||||
'userclass_parent' => 0,
|
||||
'userclass_accum' => 0,
|
||||
'userclass_visibility' => 0,
|
||||
'userclass_type' => 0,
|
||||
'userclass_icon' => 0,
|
||||
'userclass_perms' => 0,
|
||||
|
||||
);
|
||||
|
||||
// Fields which must be set up by the caller.
|
||||
var $mandatory = array(
|
||||
'userclass_name'
|
||||
);
|
||||
|
||||
// Constructor
|
||||
function __construct()
|
||||
{
|
||||
$this->ucdb = e107::getDb('pagechapter'); // Have our own database object to write to the table
|
||||
}
|
||||
|
||||
|
||||
// Empty the DB
|
||||
function emptyTargetDB($inc_admin = FALSE)
|
||||
{
|
||||
$this->ucdb->truncate('userclass_classes');
|
||||
|
||||
}
|
||||
|
||||
|
||||
// Set a new default for a particular field
|
||||
function overrideDefault($key, $value)
|
||||
{
|
||||
// echo "Override: {$key} => {$value}<br />";
|
||||
if (!isset($this->defaults[$key])) return FALSE;
|
||||
$this->defaults[$key] = $value;
|
||||
}
|
||||
|
||||
|
||||
// Returns an array with all relevant fields set to the current default
|
||||
function getDefaults()
|
||||
{
|
||||
return $this->defaults;
|
||||
}
|
||||
|
||||
/**
|
||||
* Insert data into e107 DB
|
||||
* @param row - array of table data
|
||||
* @return integer, boolean - error code on failure, TRUE on success
|
||||
*/
|
||||
function saveData($row)
|
||||
{
|
||||
|
||||
if(empty($row['userclass_name']))
|
||||
{
|
||||
return 3;
|
||||
}
|
||||
|
||||
|
||||
if(!$result = $this->ucdb->insert('userclass_classes',$row))
|
||||
{
|
||||
return 4;
|
||||
}
|
||||
|
||||
//if ($result === FALSE) return 6;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
function getErrorText($errnum) // these errors are presumptuous and misleading. especially '4' .
|
||||
{
|
||||
$errorTexts = array(
|
||||
0 => LAN_CONVERT_57,
|
||||
1 => LAN_CONVERT_58,
|
||||
2 => LAN_CONVERT_59,
|
||||
3 => LAN_CONVERT_60,
|
||||
4 => LAN_CONVERT_61,
|
||||
5 => LAN_CONVERT_62,
|
||||
6 => LAN_CONVERT_63
|
||||
);
|
||||
|
||||
if (isset($errorTexts[$errnum])) return $errorTexts[$errnum];
|
||||
|
||||
return $this->ucdb->getLastErrorText();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
?>
|
||||
|
@ -75,7 +75,6 @@ define("LAN_CONVERT_45","Cannot read import code file");
|
||||
define("LAN_CONVERT_46","Error: --ERRNUM-- while writing to --DB-- database, line ");
|
||||
define("LAN_CONVERT_47","Batch --BLOCK-- import completed. --LINES-- read, --USERS-- added, --ERRORS-- errors");
|
||||
define("LAN_CONVERT_48","Forum posts");
|
||||
|
||||
define("LAN_CONVERT_49","Drupal");
|
||||
define("LAN_CONVERT_50","Basic import");
|
||||
define("LAN_CONVERT_51","The version of targeted Drupal.");
|
||||
@ -84,3 +83,21 @@ define("LAN_CONVERT_53","The base URL of Drupal website (e.g., http://mydrupalsi
|
||||
define("LAN_CONVERT_54","Drupal Base URL");
|
||||
define("LAN_CONVERT_55","The base URL path (i.e., directory) of the Drupal installation (e.g., /drupal/).");
|
||||
define("LAN_CONVERT_56","Drupal Base Path");
|
||||
define("LAN_CONVERT_57", "No error");
|
||||
define("LAN_CONVERT_58", "Can\'t change main admin data");
|
||||
define("LAN_CONVERT_59", "invalid field passed");
|
||||
define("LAN_CONVERT_60", "Mandatory field not set");
|
||||
define("LAN_CONVERT_61", "User already exists");
|
||||
define("LAN_CONVERT_62", "Invalid characters in user or login name");
|
||||
define("LAN_CONVERT_63", "Error saving extended user fields");
|
||||
define("LAN_CONVERT_64", "Select");
|
||||
define("LAN_CONVERT_65", "Pages");
|
||||
define("LAN_CONVERT_66", "Page Chapters");
|
||||
define("LAN_CONVERT_67", "Links");
|
||||
define("LAN_CONVERT_68", "Media");
|
||||
define("LAN_CONVERT_69", "Forum");
|
||||
define("LAN_CONVERT_70", "Forum Topics/Threads");
|
||||
define("LAN_CONVERT_71", "Forum Posts");
|
||||
define("LAN_CONVERT_72", "Forum Track");
|
||||
define("LAN_CONVERT_73", "Userclasses");
|
||||
define("LAN_CONVERT_74", "News Categories");
|
||||
|
@ -25,9 +25,9 @@ class PHPFusion_import extends base_import_class
|
||||
{
|
||||
|
||||
public $title = 'PHP Fusion';
|
||||
public $description = 'Based on V5.1';
|
||||
public $supported = array('users');
|
||||
public $mprefix = false;
|
||||
public $description = 'Based on v9';
|
||||
public $supported = array('users', 'userclass');
|
||||
public $mprefix = 'fusion_';
|
||||
|
||||
// Set up a query for the specified task.
|
||||
// Returns TRUE on success. FALSE on error
|
||||
@ -37,9 +37,17 @@ class PHPFusion_import extends base_import_class
|
||||
switch ($task)
|
||||
{
|
||||
case 'users' :
|
||||
$result = $this->ourDB->db_Select_gen("SELECT * FROM {$this->DBPrefix}users");
|
||||
$result = $this->ourDB->gen("SELECT * FROM {$this->DBPrefix}users");
|
||||
if ($result === FALSE) return FALSE;
|
||||
break;
|
||||
|
||||
|
||||
case 'userclass' :
|
||||
$result = $this->ourDB->gen("SELECT * FROM {$this->DBPrefix}user_groups");
|
||||
if ($result === FALSE) return FALSE;
|
||||
break;
|
||||
|
||||
|
||||
default :
|
||||
return FALSE;
|
||||
}
|
||||
@ -54,36 +62,293 @@ class PHPFusion_import extends base_import_class
|
||||
//------------------------------------
|
||||
|
||||
// Copy data read from the DB into the record to be returned.
|
||||
function copyUserData(&$target, &$source)
|
||||
{
|
||||
if ($this->copyUserInfo) $target['user_id'] = $source['user_id'];
|
||||
$target['user_name'] = $source['user_name'];
|
||||
$target['user_loginname'] = $source['user_name'];
|
||||
$target['user_password'] = $source['user_password'];
|
||||
$target['user_email'] = $source['user_email'];
|
||||
$target['user_hideemail'] = $source['user_hide_email'];
|
||||
$target['user_image'] = $source['user_avatar'];
|
||||
$target['user_signature'] = $source['user_sig'];
|
||||
$target['user_forums'] = $source['user_posts'];
|
||||
$target['user_join'] = $source['user_joined'];
|
||||
$target['user_lastvisit'] = $source['user_lastvisit'];
|
||||
$target['user_location'] = $source['user_location'];
|
||||
$target['user_birthday'] = $source['user_birthdate'];
|
||||
$target['user_aim'] = $source['user_aim'];
|
||||
$target['user_icq'] = $source['user_icq'];
|
||||
$target['user_msn'] = $source['user_msn'];
|
||||
$target['user_yahoo'] = $source['user_yahoo'];
|
||||
$target['user_homepage'] = $source['user_web'];
|
||||
$target['user_timezone'] = $source['user_offset']; // guess - may need conversion
|
||||
$target['user_ip'] = $source['user_ip'];
|
||||
// $target['user_'] = $source[''];
|
||||
// $target['user_'] = $source[''];
|
||||
|
||||
// $target['user_ban'] = ($source['user_status'] ? 2 : 0); // Guess
|
||||
return $target;
|
||||
}
|
||||
function copyUserData(&$target, &$source)
|
||||
{
|
||||
if ($this->copyUserInfo) $target['user_id'] = $source['user_id'];
|
||||
$target['user_name'] = $source['user_name'];
|
||||
$target['user_loginname'] = $source['user_name'];
|
||||
$target['user_password'] = $source['user_password'];
|
||||
$target['user_email'] = $source['user_email'];
|
||||
$target['user_hideemail'] = $source['user_hide_email'];
|
||||
$target['user_image'] = $source['user_avatar'];
|
||||
$target['user_signature'] = $source['user_sig'];
|
||||
$target['user_forums'] = $source['user_posts'];
|
||||
$target['user_join'] = $source['user_joined'];
|
||||
$target['user_lastvisit'] = $source['user_lastvisit'];
|
||||
$target['user_location'] = $source['user_location'];
|
||||
$target['user_birthday'] = $source['user_birthdate'];
|
||||
$target['user_aim'] = $source['user_aim'];
|
||||
$target['user_icq'] = $source['user_icq'];
|
||||
$target['user_msn'] = $source['user_msn'];
|
||||
$target['user_yahoo'] = $source['user_yahoo'];
|
||||
$target['user_homepage'] = $source['user_web'];
|
||||
$target['user_timezone'] = $source['user_offset']; // guess - may need conversion
|
||||
$target['user_ip'] = $source['user_ip'];
|
||||
// $target['user_'] = $source[''];
|
||||
// $target['user_'] = $source[''];
|
||||
|
||||
// $target['user_ban'] = ($source['user_status'] ? 2 : 0); // Guess
|
||||
|
||||
|
||||
|
||||
//return $target;
|
||||
|
||||
$this->debug($source,$target);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Align source data to e107 User Table
|
||||
* @param $target array - default e107 target values for e107_user table.
|
||||
* @param $source array - WordPress table data
|
||||
*/
|
||||
function copyUserClassData(&$target, &$source)
|
||||
{
|
||||
|
||||
$target['userclass_id'] = $source['group_id'];
|
||||
$target['userclass_name'] = $source['group_name'];
|
||||
$target['userclass_description'] = $source['group_description'];
|
||||
$target['userclass_editclass'] = e_UC_ADMIN;
|
||||
$target['userclass_parent'] = 0;
|
||||
$target['userclass_accum'] = '';
|
||||
$target['userclass_visibility'] = e_UC_ADMIN;
|
||||
$target['userclass_type'] = '';
|
||||
$target['userclass_icon'] = '';
|
||||
$target['userclass_perms'] = '';
|
||||
|
||||
// return $target;
|
||||
|
||||
$this->debug($source,$target);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Align source data with e107 News Table
|
||||
* @param $target array - default e107 target values for e107_news table.
|
||||
* @param $source array - other cms table data
|
||||
*/
|
||||
function copyNewsData(&$target, &$source)
|
||||
{
|
||||
|
||||
$target['news_id'] = $source['']; // leave empty to auto-increment.
|
||||
$target['news_title'] = $source[''];
|
||||
$target['news_sef'] = $source[''];
|
||||
$target['news_body'] = $source['']; // wrap in [html] tags if required.
|
||||
$target['news_extended'] = $source['']; // wrap in [html] tags if required.
|
||||
$target['news_meta_keywords'] = $source[''];
|
||||
$target['news_meta_description'] = $source[''];
|
||||
$target['news_datestamp'] = $source['datestamp'];
|
||||
$target['news_author'] = $source[''];
|
||||
$target['news_category'] = $source[''];
|
||||
$target['news_allow_comments'] = $source[''];
|
||||
$target['news_start'] = $source[''];
|
||||
$target['news_end'] = $source[''];
|
||||
$target['news_class'] = $source[''];
|
||||
$target['news_render_type'] = $source[''];
|
||||
$target['news_comment_total'] = $source[''];
|
||||
$target['news_summary'] = $source[''];
|
||||
$target['news_thumbnail'] = $source[''];
|
||||
$target['news_sticky'] = $source[''];
|
||||
|
||||
return $target; // comment out to debug
|
||||
|
||||
// $this->renderDebug($source,$target);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Align source data with e107 News Table
|
||||
* @param $target array - default e107 target values for e107_news table.
|
||||
* @param $source array - other cms table data
|
||||
*/
|
||||
function copyNewsCategoryData(&$target, &$source)
|
||||
{
|
||||
$target['category_id'] = $source[''];
|
||||
$target['category_name'] = $source[''];
|
||||
$target['category_sef'] = $source[''];
|
||||
$target['category_meta_description'] = $source[''];
|
||||
$target['category_meta_keywords'] = $source[''];
|
||||
$target['category_manager'] = $source[''];
|
||||
$target['category_icon'] = $source[''];
|
||||
$target['category_order'] = $source[''];
|
||||
|
||||
return $target; // comment out to debug
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Align source data to e107 Page Table
|
||||
* @param $target array - default e107 target values for e107_page table.
|
||||
* @param $source array - other cms table data
|
||||
*/
|
||||
function copyPageData(&$target, &$source)
|
||||
{
|
||||
|
||||
|
||||
$target['page_id'] = $source[''];
|
||||
$target['page_title'] = $source[''];
|
||||
$target['page_sef'] = $source[''];
|
||||
$target['page_text'] = $source[''];
|
||||
$target['page_metakeys'] = $source[''];
|
||||
$target['page_metadscr'] = $source[''];
|
||||
$target['page_datestamp'] = $source[''];
|
||||
$target['page_author'] = $source[''];
|
||||
$target['page_category'] = $source[''];
|
||||
$target['page_comment_flag'] = $source[''];
|
||||
$target['page_password'] = $source[''];
|
||||
$target['page_class'] = $source[''];
|
||||
|
||||
return $target; // comment out to debug
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* $target - e107_forum table
|
||||
* $source - other cms
|
||||
*/
|
||||
function copyForumData(&$target, &$source)
|
||||
{
|
||||
|
||||
$target['forum_id'] = $source[''];
|
||||
$target['forum_name'] = $source[''];
|
||||
$target['forum_description'] = $source[''];
|
||||
$target['forum_parent'] = $source[''];
|
||||
$target['forum_sub'] = $source[''];
|
||||
$target['forum_datestamp'] = $source[''];
|
||||
$target['forum_moderators'] = $source[''];
|
||||
|
||||
$target['forum_threads'] = $source[''];
|
||||
$target['forum_replies'] = $source[''];
|
||||
$target['forum_lastpost_user'] = $source[''];
|
||||
$target['forum_lastpost_user_anon'] = $source[''];
|
||||
$target['forum_lastpost_info'] = $source[''];
|
||||
$target['forum_class'] = $source[''];
|
||||
$target['forum_order'] = $source[''];
|
||||
$target['forum_postclass'] = $source[''];
|
||||
$target['forum_threadclass'] = $source[''];
|
||||
$target['forum_options'] = $source[''];
|
||||
$target['forum_sef'] = $source[''];
|
||||
|
||||
return $target;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* $target - e107 forum_threads
|
||||
* $source - other cms
|
||||
*/
|
||||
function copyForumThreadData(&$target, &$source)
|
||||
{
|
||||
|
||||
$target['thread_id'] = $source[''];
|
||||
$target['thread_name'] = $source[''];
|
||||
$target['thread_forum_id'] = $source[''];
|
||||
$target['thread_views'] = $source[''];
|
||||
$target['thread_active'] = $source[''];
|
||||
$target['thread_lastpost'] = $source[''];
|
||||
$target['thread_sticky'] = $source[''];
|
||||
$target['thread_datestamp'] = $source[''];
|
||||
$target['thread_user'] = $source[''];
|
||||
$target['thread_user_anon'] = $source[''];
|
||||
$target['thread_lastuser'] = $source[''];
|
||||
$target['thread_lastuser_anon'] = $source[''];
|
||||
$target['thread_total_replies'] = $source[''];
|
||||
$target['thread_options'] = $source[''];
|
||||
|
||||
return $target;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* $target - e107_forum_post table
|
||||
* $source - other cms
|
||||
*/
|
||||
function copyForumPostData(&$target, &$source)
|
||||
{
|
||||
|
||||
$target['post_id'] = $source[''];
|
||||
$target['post_entry'] = $source[''];
|
||||
$target['post_thread'] = $source[''];
|
||||
$target['post_forum'] = $source[''];
|
||||
$target['post_status'] = $source[''];
|
||||
$target['post_datestamp'] = $source[''];
|
||||
$target['post_user'] = $source[''];
|
||||
$target['post_edit_datestamp'] = $source[''];
|
||||
$target['post_edit_user'] = $source[''];
|
||||
$target['post_ip'] = $source[''];
|
||||
$target['post_user_anon'] = $source[''];
|
||||
$target['post_attachments'] = $source[''];
|
||||
$target['post_options'] = $source[''];
|
||||
|
||||
|
||||
return $target;
|
||||
|
||||
$this->debug($source,$target);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Align source data to e107 Links Table
|
||||
* @param $target array - default e107 target values for e107_links table.
|
||||
* @param $source array - WordPress table data
|
||||
*/
|
||||
function copyLinksData(&$target, &$source)
|
||||
{
|
||||
|
||||
/* e107 Link Targets.
|
||||
0 => LCLAN_20, // 0 = same window
|
||||
1 => LCLAN_23, // new window
|
||||
4 => LCLAN_24, // 4 = miniwindow 600x400
|
||||
5 => LINKLAN_1 // 5 = miniwindow 800x600
|
||||
*/
|
||||
|
||||
$target['link_id'] = $source['']; // leave blank to auto-increment
|
||||
$target['link_name'] = $source[''];
|
||||
$target['link_url'] = $source[''];
|
||||
$target['link_description'] = $source['']; // wrap with [html] [/html] if necessary.
|
||||
$target['link_button'] = $source['']; // image file.
|
||||
$target['link_category'] = $source['']; // integer
|
||||
$target['link_order'] = $source['']; // integer
|
||||
$target['link_parent'] = $source['']; // integer
|
||||
$target['link_open'] = $source['']; // link_target
|
||||
$target['link_class'] = $source[''];
|
||||
$target['link_sefurl'] = $source[''];
|
||||
|
||||
|
||||
|
||||
|
||||
return $target; // comment out to debug
|
||||
|
||||
$this->debug($source,$target);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
?>
|
@ -26,25 +26,95 @@ class PHPNuke_import extends base_import_class
|
||||
|
||||
|
||||
public $title = 'PHP Nuke 8.2';
|
||||
public $description = 'Supports users only';
|
||||
public $supported = array('users'); // add news and page to test.
|
||||
public $description = '';
|
||||
public $supported = array('users', 'news', 'newscategory'); // add news and page to test.
|
||||
public $mprefix = 'nuke_';
|
||||
|
||||
|
||||
// Set up a query for the specified task.
|
||||
// Returns TRUE on success. FALSE on error
|
||||
function setupQuery($task, $blank_user=FALSE)
|
||||
// Returns TRUE on success. false on error
|
||||
function setupQuery($task, $blank_user=false)
|
||||
{
|
||||
if ($this->ourDB == NULL) return FALSE;
|
||||
if ($this->ourDB == NULL) return false;
|
||||
switch ($task)
|
||||
{
|
||||
case 'users' :
|
||||
$result = $this->ourDB->gen("SELECT * FROM {$this->DBPrefix}users WHERE `user_active`=1");
|
||||
if ($result === FALSE) return FALSE;
|
||||
if ($result === false) return false;
|
||||
break;
|
||||
|
||||
case 'news' :
|
||||
$query = "SELECT *, UNIX_TIMESTAMP(time) as datestamp FROM {$this->DBPrefix}stories ORDER BY sid";
|
||||
$result = $this->ourDB->gen($query);
|
||||
if ($result === false) return false;
|
||||
break;
|
||||
|
||||
case 'newscategory' :
|
||||
$query = "SELECT * FROM {$this->DBPrefix}topics ORDER BY topicid";
|
||||
$result = $this->ourDB->gen($query);
|
||||
if ($result === false) return false;
|
||||
break;
|
||||
|
||||
|
||||
case 'userclass' :
|
||||
$query = "SELECT * FROM {$this->DBPrefix}mytable ORDER BY my_id";
|
||||
$result = $this->ourDB->gen($query);
|
||||
if ($result === false) return false;
|
||||
break;
|
||||
|
||||
case 'page' :
|
||||
$query = "SELECT * FROM {$this->DBPrefix}mytable ORDER BY my_id";
|
||||
$result = $this->ourDB->gen($query);
|
||||
if ($result === false) return false;
|
||||
break;
|
||||
|
||||
case 'pagechapter' :
|
||||
$query = "SELECT * FROM {$this->DBPrefix}mytable ORDER BY my_id";
|
||||
$result = $this->ourDB->gen($query);
|
||||
if ($result === false) return false;
|
||||
break;
|
||||
|
||||
case 'media' :
|
||||
$query = "SELECT * FROM {$this->DBPrefix}mytable ORDER BY my_id";
|
||||
$result = $this->ourDB->gen($query);
|
||||
if ($result === false) return false;
|
||||
break;
|
||||
|
||||
case 'links':
|
||||
$query = "SELECT * FROM {$this->DBPrefix}mytable ORDER BY my_id";
|
||||
$result = $this->ourDB->gen($query);
|
||||
if ($result === false) return false;
|
||||
break;
|
||||
|
||||
|
||||
case 'forum' :
|
||||
$query = "SELECT * FROM {$this->DBPrefix}mytable ORDER BY my_id";
|
||||
$result = $this->ourDB->gen($query);
|
||||
if ($result === false) return false;
|
||||
break;
|
||||
|
||||
case 'forumthread' :
|
||||
$query = "SELECT * FROM {$this->DBPrefix}mytable ORDER BY my_id";
|
||||
$result = $this->ourDB->gen($query);
|
||||
if ($result === false) return false;
|
||||
break;
|
||||
|
||||
case 'forumpost' :
|
||||
$query = "SELECT * FROM {$this->DBPrefix}mytable ORDER BY my_id";
|
||||
$result = $this->ourDB->gen($query);
|
||||
if ($result === false) return false;
|
||||
break;
|
||||
|
||||
case 'forumtrack' :
|
||||
$query = "SELECT * FROM {$this->DBPrefix}mytable ORDER BY my_id";
|
||||
$result = $this->ourDB->gen($query);
|
||||
if ($result === false) return false;
|
||||
break;
|
||||
|
||||
default :
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->copyUserInfo = !$blank_user;
|
||||
$this->currentTask = $task;
|
||||
return TRUE;
|
||||
@ -91,151 +161,76 @@ class PHPNuke_import extends base_import_class
|
||||
$target['user_homepage'] = $source['user_website'];
|
||||
$target['user_ip'] = $source['last_ip'];
|
||||
|
||||
return $target;
|
||||
return $target; // comment out to debug.
|
||||
|
||||
|
||||
// Php Nuke Field Reference.
|
||||
$source['user_id'];
|
||||
$source['name'];
|
||||
$source['username'];
|
||||
$source['user_email'];
|
||||
$source['femail'];
|
||||
$source['user_website'];
|
||||
$source['user_avatar'];
|
||||
$source['user_regdate'];
|
||||
$source['user_icq'];
|
||||
$source['user_occ'];
|
||||
$source['user_from'];
|
||||
$source['user_interests'];
|
||||
$source['user_sig'];
|
||||
$source['user_viewemail'];
|
||||
$source['user_theme'];
|
||||
$source['user_aim'];
|
||||
$source['user_yim'];
|
||||
$source['user_msnm'];
|
||||
$source['user_password'];
|
||||
$source['storynum'];
|
||||
$source['umode'];
|
||||
$source['uorder'];
|
||||
$source['thold'];
|
||||
$source['noscore'];
|
||||
$source['bio'];
|
||||
$source['ublockon'];
|
||||
$source['ublock'];
|
||||
$source['theme'];
|
||||
$source['commentmax'];
|
||||
$source['counter'];
|
||||
$source['newsletter'];
|
||||
$source['user_posts'];
|
||||
$source['user_attachsig'];
|
||||
$source['user_rank'];
|
||||
$source['user_level'];
|
||||
$source['broadcast'];
|
||||
$source['popmeson'];
|
||||
$source['user_active'];
|
||||
$source['user_session_time'];
|
||||
$source['user_session_page'];
|
||||
$source['user_lastvisit'];
|
||||
$source['user_timezone'];
|
||||
$source['user_style'];
|
||||
$source['user_lang'];
|
||||
$source['user_dateformat'];
|
||||
$source['user_new_privmsg'];
|
||||
$source['user_unread_privmsg'];
|
||||
$source['user_last_privmsg'];
|
||||
$source['user_emailtime'];
|
||||
$source['user_allowhtml'];
|
||||
$source['user_allowbbcode'];
|
||||
$source['user_allowsmile'];
|
||||
$source['user_allowavatar'];
|
||||
$source['user_allow_pm'];
|
||||
$source['user_allow_viewonline'];
|
||||
$source['user_notify'];
|
||||
$source['user_notify_pm'];
|
||||
$source['user_popup_pm'];
|
||||
$source['user_avatar_type'];
|
||||
$source['user_sig_bbcode_uid'];
|
||||
$source['user_actkey'];
|
||||
$source['user_newpasswd'];
|
||||
$source['points'];
|
||||
$source['last_ip'];
|
||||
$source['karma'];
|
||||
$this->debug($source,$target);
|
||||
|
||||
|
||||
|
||||
|
||||
// old data.
|
||||
|
||||
|
||||
|
||||
if ($this->copyUserInfo) $target['user_id'] = $source['user_id'];
|
||||
$target['user_name'] = $source['username'];
|
||||
$target['user_loginname'] = $source['username'];
|
||||
$target['user_loginname'] = $source['name'];
|
||||
$target['user_password'] = $source['user_password'];
|
||||
$target['user_join'] = strtotime($source['user_regdate']);
|
||||
$target['user_email'] = $source['user_email'];
|
||||
$target['user_hideemail'] = $source['user_viewemail'];
|
||||
$target['user_image'] = $source['user_avatar'];
|
||||
$target['user_signature'] = $source['user_sig'];
|
||||
$target['user_forums'] = $source['user_posts'];
|
||||
$target['user_lastvisit'] = $source['user_lastvisit'];
|
||||
$target['user_image'] = $source['user_avatar'];
|
||||
|
||||
$target['user_timezone'] = $source['user_timezone']; // source is decimal(5,2)
|
||||
$target['user_language'] = $source['user_lang']; // May need conversion
|
||||
$target['user_location'] = $source['user_from'];
|
||||
$target['user_icq'] = $source['user_icq'];
|
||||
$target['user_aim'] = $source['user_aim'];
|
||||
$target['user_yahoo'] = $source['user_yim'];
|
||||
$target['user_msn'] = $source['user_msnm'];
|
||||
$target['user_homepage'] = $source['user_website'];
|
||||
$target['user_ip'] = $source['last_ip'];
|
||||
// $target['user_'] = $source[''];
|
||||
|
||||
// $source['user_rank'];
|
||||
// $target['user_admin'] = ($source['user_level'] == 1) ? 1 : 0; // Guess
|
||||
// if ($target['user_admin'] != 0) $target['user_perms'] = '0.';
|
||||
// $target['user_ban'] = ($source['ublockon'] ? 2 : 0); // Guess
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
/**
|
||||
* Align source data with e107 News Table
|
||||
* @param $target array - default e107 target values for e107_news table.
|
||||
* @param $source array - RSS data
|
||||
* @param $source array - other cms table data
|
||||
*/
|
||||
function copyNewsData(&$target, &$source)
|
||||
{
|
||||
|
||||
$target['news_id'] = (int) $source['sid'];
|
||||
$target['news_title'] = $source['title'];
|
||||
$target['news_sef'] = '';
|
||||
$target['news_body'] = "[html]".$source['hometext']."[/html]";
|
||||
$target['news_extended'] = "[html]".$source['bodytext']."[/html]";
|
||||
$target['news_meta_keywords'] = '';
|
||||
$target['news_meta_description'] = '';
|
||||
$target['news_datestamp'] = $source['datestamp'];
|
||||
$target['news_author'] = $source[''];
|
||||
$target['news_category'] = (int) $source['topic'];
|
||||
$target['news_allow_comments'] = (int) $source['acomm'];
|
||||
$target['news_start'] = '';
|
||||
$target['news_end'] = '';
|
||||
// $target['news_class'] = '';
|
||||
// $target['news_render_type'] = '';
|
||||
$target['news_comment_total'] = $source['comments'];
|
||||
// $target['news_summary'] = $source[''];
|
||||
$target['news_thumbnail'] = '';
|
||||
$target['news_sticky'] = '';
|
||||
|
||||
// $target['news_title'] = '';
|
||||
// $target['news_sef'] = '';
|
||||
// $target['news_body'] = "[html]something[/html]";
|
||||
// $target['news_extended'] = '';
|
||||
//$target['news_meta_keywords'] = implode(",",$keywords);
|
||||
// $target['news_meta_description'] = '';
|
||||
// $target['news_datestamp'] = strtotime($source['pubDate'][0]);
|
||||
// $target['news_author'] = $source['post_author'];
|
||||
// $target['news_category'] = '';
|
||||
// $target['news_allow_comments'] = ($source['comment_status']=='open') ? 1 : 0;
|
||||
// $target['news_start'] = '';
|
||||
// $target['news_end'] = '';
|
||||
/// $target['news_class'] = '';
|
||||
// $target['news_render_type'] = '';
|
||||
// $target['news_comment_total'] = $source['comment_count'];
|
||||
// $target['news_summary'] = $source['post_excerpt'];
|
||||
// $target['news_thumbnail'] = '';
|
||||
// $target['news_sticky'] = '';
|
||||
return $target; // comment out to debug.
|
||||
|
||||
return $target; // comment out to debug
|
||||
$this->debug($source,$target);
|
||||
|
||||
// $this->renderDebug($source,$target);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Align source data with e107 News Table
|
||||
* @param $target array - default e107 target values for e107_news table.
|
||||
* @param $source array - other cms table data
|
||||
*/
|
||||
function copyNewsCategoryData(&$target, &$source)
|
||||
{
|
||||
$target['category_id'] = (int) $source['topicid'];
|
||||
$target['category_name'] = $source['topictext'];
|
||||
$target['category_sef'] = eHelper::title2sef($source['topicname'],'dashl');
|
||||
// $target['category_meta_description'] = $source[''];
|
||||
// $target['category_meta_keywords'] = $source[''];
|
||||
$target['category_manager'] = e_UC_ADMIN;
|
||||
$target['category_icon'] = $source['topicimage'];
|
||||
// $target['category_order'] = $source[''];
|
||||
|
||||
return $target; // comment out to debug.
|
||||
|
||||
$this->debug($source,$target);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -243,33 +238,131 @@ class PHPNuke_import extends base_import_class
|
||||
/**
|
||||
* Align source data to e107 Page Table
|
||||
* @param $target array - default e107 target values for e107_page table.
|
||||
* @param $source array - WordPress table data
|
||||
* @param $source array - other cms table data
|
||||
*/
|
||||
function copyPageData(&$target, &$source)
|
||||
{
|
||||
|
||||
|
||||
// $target['page_id'] = $source['ID']; // auto increment
|
||||
// $target['page_title'] = $source['post_title']);
|
||||
// $target['page_sef'] = $source['post_name'];
|
||||
// $target['page_text'] = (vartrue($source['post_content'])) ? "[html]".$source['post_content']."[/html]" : "";
|
||||
// $target['page_metakeys'] = '';
|
||||
// $target['page_metadscr'] = '';
|
||||
// $target['page_datestamp'] = strtotime($source['post_date']);
|
||||
// $target['page_author'] = $source['post_author'];
|
||||
// $target['page_category'] = '',
|
||||
// $target['page_comment_flag'] = ($source['comment_status']=='open') ? 1 : 0;
|
||||
// $target['page_password'] = $source['post_password'];
|
||||
// $target['page_class'] = e_UC_ADMIN;
|
||||
$target['page_id'] = $source[''];
|
||||
$target['page_title'] = $source[''];
|
||||
$target['page_sef'] = $source[''];
|
||||
$target['page_text'] = $source[''];
|
||||
$target['page_metakeys'] = $source[''];
|
||||
$target['page_metadscr'] = $source[''];
|
||||
$target['page_datestamp'] = $source[''];
|
||||
$target['page_author'] = $source[''];
|
||||
$target['page_category'] = $source[''];
|
||||
$target['page_comment_flag'] = $source[''];
|
||||
$target['page_password'] = $source[''];
|
||||
$target['page_class'] = $source[''];
|
||||
|
||||
return $target; // comment out to debug
|
||||
// return $target; // comment out to debug.
|
||||
|
||||
$this->debug($source,$target);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* $target - e107_forum table
|
||||
* $source - other cms
|
||||
*/
|
||||
function copyForumData(&$target, &$source)
|
||||
{
|
||||
|
||||
$target['forum_id'] = $source[''];
|
||||
$target['forum_name'] = $source[''];
|
||||
$target['forum_description'] = $source[''];
|
||||
$target['forum_parent'] = $source[''];
|
||||
$target['forum_sub'] = $source[''];
|
||||
$target['forum_datestamp'] = $source[''];
|
||||
$target['forum_moderators'] = $source[''];
|
||||
|
||||
$target['forum_threads'] = $source[''];
|
||||
$target['forum_replies'] = $source[''];
|
||||
$target['forum_lastpost_user'] = $source[''];
|
||||
$target['forum_lastpost_user_anon'] = $source[''];
|
||||
$target['forum_lastpost_info'] = $source[''];
|
||||
$target['forum_class'] = $source[''];
|
||||
$target['forum_order'] = $source[''];
|
||||
$target['forum_postclass'] = $source[''];
|
||||
$target['forum_threadclass'] = $source[''];
|
||||
$target['forum_options'] = $source[''];
|
||||
$target['forum_sef'] = $source[''];
|
||||
|
||||
// return $target; // comment out to debug.
|
||||
|
||||
$this->debug($source,$target);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* $target - e107 forum_threads
|
||||
* $source - other cms
|
||||
*/
|
||||
function copyForumThreadData(&$target, &$source)
|
||||
{
|
||||
|
||||
$target['thread_id'] = $source[''];
|
||||
$target['thread_name'] = $source[''];
|
||||
$target['thread_forum_id'] = $source[''];
|
||||
$target['thread_views'] = $source[''];
|
||||
$target['thread_active'] = $source[''];
|
||||
$target['thread_lastpost'] = $source[''];
|
||||
$target['thread_sticky'] = $source[''];
|
||||
$target['thread_datestamp'] = $source[''];
|
||||
$target['thread_user'] = $source[''];
|
||||
$target['thread_user_anon'] = $source[''];
|
||||
$target['thread_lastuser'] = $source[''];
|
||||
$target['thread_lastuser_anon'] = $source[''];
|
||||
$target['thread_total_replies'] = $source[''];
|
||||
$target['thread_options'] = $source[''];
|
||||
|
||||
// return $target; // comment out to debug.
|
||||
|
||||
$this->debug($source,$target);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* $target - e107_forum_post table
|
||||
* $source - other cms
|
||||
*/
|
||||
function copyForumPostData(&$target, &$source)
|
||||
{
|
||||
|
||||
$target['post_id'] = $source[''];
|
||||
$target['post_entry'] = $source[''];
|
||||
$target['post_thread'] = $source[''];
|
||||
$target['post_forum'] = $source[''];
|
||||
$target['post_status'] = $source[''];
|
||||
$target['post_datestamp'] = $source[''];
|
||||
$target['post_user'] = $source[''];
|
||||
$target['post_edit_datestamp'] = $source[''];
|
||||
$target['post_edit_user'] = $source[''];
|
||||
$target['post_ip'] = $source[''];
|
||||
$target['post_user_anon'] = $source[''];
|
||||
$target['post_attachments'] = $source[''];
|
||||
$target['post_options'] = $source[''];
|
||||
|
||||
|
||||
// return $target; // comment out to debug.
|
||||
|
||||
$this->debug($source,$target);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
?>
|
@ -34,11 +34,33 @@ class e107_import extends base_import_class
|
||||
|
||||
public $title = 'e107';
|
||||
public $description = 'Reads 0.7 and 0.8 version files';
|
||||
public $supported = array('users');
|
||||
public $supported = array('users', 'page', 'pagechapter');
|
||||
public $mprefix = 'e107_';
|
||||
|
||||
|
||||
|
||||
function init()
|
||||
{
|
||||
|
||||
$this->pcontent = intval($_POST['pcontent']);
|
||||
|
||||
}
|
||||
|
||||
|
||||
function config()
|
||||
{
|
||||
$frm = e107::getForm();
|
||||
|
||||
$present = e107::getDb()->isTable('pcontent');
|
||||
|
||||
$var[0]['caption'] = "Use old 'Content Management' tables for Pages";
|
||||
$var[0]['html'] = $frm->radio_switch('pcontent',$present);
|
||||
// $var[0]['help'] = "Change the author of the news items";
|
||||
|
||||
// $var[1]['caption'] = "Include revisions";
|
||||
// $var[1]['html'] = $frm->checkbox('news_revisions',1);
|
||||
// $var[1]['help'] = "Change the author of the news items";
|
||||
|
||||
return $var;
|
||||
}
|
||||
|
||||
// Set up a query for the specified task.
|
||||
// Returns TRUE on success. FALSE on error
|
||||
@ -47,13 +69,27 @@ class e107_import extends base_import_class
|
||||
if ($this->ourDB == NULL) return FALSE;
|
||||
switch ($task)
|
||||
{
|
||||
case 'users' :
|
||||
$query = "SELECT * FROM {$this->DBPrefix}user WHERE `user_id` != 1";
|
||||
$result = $this->ourDB->db_Select_gen($query);
|
||||
case 'users' :
|
||||
$query = "SELECT * FROM {$this->DBPrefix}user WHERE `user_id` != 1";
|
||||
$result = $this->ourDB->db_Select_gen($query);
|
||||
|
||||
if ($result === FALSE) return FALSE;
|
||||
if ($result === false) return false;
|
||||
break;
|
||||
|
||||
|
||||
case 'page' :
|
||||
$query = "SELECT * FROM {$this->DBPrefix}pcontent WHERE `content_parent` > 0";
|
||||
$result = $this->ourDB->gen($query);
|
||||
|
||||
if ($result === false) return false;
|
||||
break;
|
||||
|
||||
case 'pagechapter' :
|
||||
$query = "SELECT * FROM {$this->DBPrefix}pcontent WHERE `content_parent` = '0'";
|
||||
$result = $this->ourDB->gen($query);
|
||||
|
||||
if ($result === false) return false;
|
||||
break;
|
||||
|
||||
|
||||
|
||||
default :
|
||||
@ -66,6 +102,81 @@ class e107_import extends base_import_class
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Align source data to e107 Page Table
|
||||
* @param $target array - default e107 target values for e107_page table.
|
||||
* @param $source array - WordPress table data
|
||||
*/
|
||||
function copyPageData(&$target, &$source)
|
||||
{
|
||||
|
||||
|
||||
|
||||
// $target['page_id'] = $source['ID']; // auto increment
|
||||
$target['page_title'] = $source['content_heading'];
|
||||
$target['page_sef'] = eHelper::title2sef($source['content_heading'], 'dashl');
|
||||
$target['page_text'] = $this->checkHtml($source['content_text']) ;
|
||||
$target['page_chapter'] = $source['content_parent'];
|
||||
// $target['page_metakeys'] = '';
|
||||
$target['page_metadscr'] = $source['content_summary'];
|
||||
$target['page_datestamp'] = $source['content_datestamp'];
|
||||
$target['page_author'] = (int) $source['content_author'];
|
||||
// $target['page_category'] = '',
|
||||
$target['page_comment_flag'] = (int) $source['content_comment'];
|
||||
$target['page_rating_flag'] = (int) $source['content_rate'];
|
||||
// $target['page_password'] = $source['post_password'];
|
||||
$target['page_order'] = (int) $source['content_order'];
|
||||
$target['page_class'] = (int) $source['content_class'];
|
||||
|
||||
|
||||
|
||||
return $target; // comment out to debug
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
private function checkHtml($text)
|
||||
{
|
||||
$tp = e107::getParser();
|
||||
if($tp->isHtml($text) && strpos($text,'[html]')!==0)
|
||||
{
|
||||
return "[html]".$text."[/html]";
|
||||
}
|
||||
|
||||
return $text;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Align source data to e107 Page Table
|
||||
* @param $target array - default e107 target values for e107_page table.
|
||||
* @param $source array - WordPress table data
|
||||
*/
|
||||
function copyPageChapterData(&$target, &$source)
|
||||
{
|
||||
$target['chapter_id'] = $source['content_id'];
|
||||
$target['chapter_parent'] = empty($source['content_parent']) ? 1 : (int) $source['content_parent'];
|
||||
$target['chapter_name'] = $source['content_heading'];
|
||||
$target['chapter_sef'] = eHelper::title2sef($source['content_heading'], 'dashl');
|
||||
$target['chapter_meta_description'] = $source['content_text'];
|
||||
$target['chapter_meta_keywords'] = '';
|
||||
// $target['chapter_manager'] = '';
|
||||
$target['chapter_icon'] = $source['content_icon'];
|
||||
$target['chapter_order'] = 0;
|
||||
// $target['chapter_template'] = '';
|
||||
// $target['chapter_visibility'] = 0;
|
||||
// $target['chapter_fields'] = '';
|
||||
|
||||
return $target; // comment out to debug
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//------------------------------------
|
||||
// Internal functions below here
|
||||
//------------------------------------
|
||||
|
@ -80,19 +80,19 @@ class phpbb3_import extends base_import_class
|
||||
break;
|
||||
|
||||
case 'forum' :
|
||||
$result = $this->ourDB->gen("SELECT * FROM `{$this->DBPrefix}forums`");
|
||||
$result = $this->ourDB->gen("SELECT * FROM {$this->DBPrefix}forums");
|
||||
if ($result === FALSE) return FALSE;
|
||||
break;
|
||||
|
||||
case 'forumthread' :
|
||||
$result = $this->ourDB->gen("SELECT * FROM `{$this->DBPrefix}topics`");
|
||||
$result = $this->ourDB->gen("SELECT * FROM {$this->DBPrefix}topics");
|
||||
|
||||
if ($result === FALSE) return FALSE;
|
||||
break;
|
||||
|
||||
case 'forumpost' :
|
||||
|
||||
if($this->ourDB->gen("SELECT * FROM `{$this->DBPrefix}attachments`"))
|
||||
if($this->ourDB->gen("SELECT * FROM {$this->DBPrefix}attachments"))
|
||||
{
|
||||
while($row = $this->ourDB->fetch())
|
||||
{
|
||||
@ -101,12 +101,12 @@ class phpbb3_import extends base_import_class
|
||||
$this->forum_attachments[$id][$key] = $row['real_filename'];
|
||||
}
|
||||
}
|
||||
$result = $this->ourDB->gen("SELECT * FROM `{$this->DBPrefix}posts`");
|
||||
$result = $this->ourDB->gen("SELECT * FROM {$this->DBPrefix}posts");
|
||||
if ($result === FALSE) return FALSE;
|
||||
break;
|
||||
|
||||
case 'forumtrack' :
|
||||
$result = $this->ourDB->gen("SELECT * FROM `{$this->DBPrefix}forums_track`");
|
||||
$result = $this->ourDB->gen("SELECT * FROM {$this->DBPrefix}forums_track");
|
||||
if ($result === FALSE) return FALSE;
|
||||
break;
|
||||
|
||||
|
@ -15,22 +15,41 @@ class smf_import extends base_import_class
|
||||
{
|
||||
|
||||
public $title = 'SMF v2.x (Simple Machines Forum)';
|
||||
public $description = 'Supports users only';
|
||||
public $supported = array('users');
|
||||
public $description = 'Currently does not import membergroups or more than 1 post attachment ';
|
||||
public $supported = array('users','forum','forumthread','forumpost');
|
||||
public $mprefix = 'smf_';
|
||||
public $sourceType = 'db';
|
||||
|
||||
function init()
|
||||
{
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
function config()
|
||||
{
|
||||
|
||||
return;
|
||||
|
||||
$frm = e107::getForm();
|
||||
|
||||
$var[0]['caption'] = "Path to phpBB3 Attachments folder (optional)";
|
||||
$var[0]['html'] = $frm->text('forum_attachment_path',null,40,'size=xxlarge');
|
||||
$var[0]['help'] = "Relative to the root folder of your e107 installation";
|
||||
|
||||
return $var;
|
||||
}
|
||||
|
||||
|
||||
// Set up a query for the specified task.
|
||||
// Returns TRUE on success. FALSE on error
|
||||
function setupQuery($task, $blank_user=FALSE)
|
||||
{
|
||||
if ($this->ourDB == NULL) return FALSE;
|
||||
if ($this->ourDB == null)
|
||||
{
|
||||
e107::getMessage()->addDebug("Unable to connext");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
switch ($task)
|
||||
{
|
||||
@ -43,23 +62,45 @@ class smf_import extends base_import_class
|
||||
}
|
||||
|
||||
$result = $this->ourDB->gen("SELECT * FROM {$this->DBPrefix}members WHERE `is_activated`=1");
|
||||
if ($result === FALSE) return FALSE;
|
||||
if ($result === false)
|
||||
{
|
||||
$message = $this->ourDB->getLastErrorText();
|
||||
e107::getMessage()->addError($message);
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case 'forum' :
|
||||
$result = $this->ourDB->gen("SELECT * FROM `{$this->DBPrefix}boards`");
|
||||
if ($result === FALSE) return FALSE;
|
||||
$qry = "SELECT f.*, m.id_member, m.poster_name, m.poster_time FROM {$this->DBPrefix}boards AS f LEFT JOIN {$this->DBPrefix}messages AS m ON f.id_last_msg = m.id_msg GROUP BY f.id_board ";
|
||||
|
||||
$result = $this->ourDB->gen($qry);
|
||||
if ($result === false)
|
||||
{
|
||||
$message = $this->ourDB->getLastErrorText();
|
||||
e107::getMessage()->addError($message);
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'forumthread' :
|
||||
$result = $this->ourDB->gen("SELECT t.*,m.* FROM `{$this->DBPrefix}topics` AS t LEFT JOIN `{$this->DBPrefix}messages` AS m ON t.id_first_msg = m.id_msg GROUP BY t.id_topic");
|
||||
if ($result === FALSE) return FALSE;
|
||||
|
||||
$qry = "SELECT t.*, m.poster_name, m.subject, m.poster_time, m.id_member, l.poster_name as lastpost_name, l.poster_time as lastpost_time, l.id_member as lastpost_user FROM {$this->DBPrefix}topics AS t
|
||||
LEFT JOIN {$this->DBPrefix}messages AS m ON t.id_first_msg = m.id_msg
|
||||
LEFT JOIN {$this->DBPrefix}messages AS l ON t.id_last_msg = l.id_msg
|
||||
GROUP BY t.id_topic";
|
||||
|
||||
$result = $this->ourDB->gen($qry);
|
||||
if ($result === false) return false;
|
||||
|
||||
break;
|
||||
|
||||
case 'forumpost' :
|
||||
//$result = $this->ourDB->gen("SELECT * FROM `{$this->DBPrefix}posts`");
|
||||
//if ($result === FALSE) return FALSE;
|
||||
|
||||
$qry = "SELECT m.*, a.filename, a.fileext, a.size FROM {$this->DBPrefix}messages AS m LEFT JOIN {$this->DBPrefix}attachments AS a ON m.id_msg = a.id_msg GROUP BY m.id_msg ORDER BY m.id_msg ASC ";
|
||||
|
||||
$result = $this->ourDB->gen($qry);
|
||||
if ($result === false) return false;
|
||||
break;
|
||||
|
||||
case 'forumtrack' :
|
||||
@ -80,12 +121,27 @@ class smf_import extends base_import_class
|
||||
|
||||
function convertUserclass($data)
|
||||
{
|
||||
|
||||
if($data == 1)
|
||||
if(empty($data))
|
||||
{
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
$convert = array(
|
||||
// 1 => e_UC_ADMINMOD,
|
||||
2 => e_UC_ADMINMOD,
|
||||
3 => e_UC_MODS,
|
||||
4 => e_UC_NEWUSER,
|
||||
|
||||
);
|
||||
|
||||
if(!empty($convert[$data]))
|
||||
{
|
||||
return $convert[$data];
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
|
||||
/*
|
||||
1 Administrator #FF0000 -1 0 5#staradmin.gif 1 0 -2
|
||||
2 Global Moderator #0000FF -1 0 5#stargmod.gif 0 0 -2
|
||||
@ -143,8 +199,8 @@ class smf_import extends base_import_class
|
||||
$target['user_ip'] = $source['member_ip'];
|
||||
$target['user_homepage'] = $source['website_url'];
|
||||
$target['user_birthday'] = $source['birthdate'];
|
||||
$target['user_admin'] = $this->convertadmin($source['id_group']);
|
||||
$target['user_class'] = $this->convertadmin($source['id_group']);
|
||||
$target['user_admin'] = $this->convertAdmin($source['id_group']);
|
||||
$target['user_class'] = $this->convertUserclass($source['id_group']);
|
||||
|
||||
$target['user_plugin_forum_viewed'] = 0;
|
||||
$target['user_plugin_forum_posts'] = $source['posts'];
|
||||
@ -166,54 +222,24 @@ class smf_import extends base_import_class
|
||||
$target['forum_name'] = $source['name'];
|
||||
$target['forum_description'] = $source['description'];
|
||||
$target['forum_parent'] = $source['id_parent'];
|
||||
$target['forum_sub'] = "";
|
||||
$target['forum_sub'] = ($source['child_level'] > 1) ? $source['id_parent'] : 0;
|
||||
$target['forum_datestamp'] = time();
|
||||
$target['forum_moderators'] = "";
|
||||
|
||||
$target['forum_threads'] = $source['num_topics'];
|
||||
$target['forum_replies'] = $source['num_posts'];
|
||||
$target['forum_lastpost_user'] = '';
|
||||
$target['forum_lastpost_user_anon'] = '';
|
||||
$target['forum_lastpost_info'] = '';
|
||||
// $target['forum_class'] = "";
|
||||
$target['forum_lastpost_user'] = $source['id_member'];
|
||||
$target['forum_lastpost_user_anon'] = empty($source['id_member']) ? $source['poster_name'] : null;
|
||||
$target['forum_lastpost_info'] = $source['poster_time'].'.'.$source['id_last_msg'];
|
||||
$target['forum_class'] = e_UC_MEMBER;
|
||||
$target['forum_order'] = $source['board_order'];
|
||||
// $target['forum_postclass']
|
||||
// $target['forum_threadclass']
|
||||
// $target['forum_options']
|
||||
$target['forum_postclass'] = e_UC_MEMBER;
|
||||
$target['forum_threadclass'] = e_UC_MEMBER;
|
||||
$target['forum_options'] = e_UC_MEMBER;
|
||||
$target['forum_sef'] = eHelper::title2sef($source['name'],'dashl');
|
||||
|
||||
return $target;
|
||||
|
||||
|
||||
/*
|
||||
|
||||
CREATE TABLE {$db_prefix}boards (
|
||||
id_board smallint(5) unsigned NOT NULL auto_increment,
|
||||
id_cat tinyint(4) unsigned NOT NULL default '0',
|
||||
child_level tinyint(4) unsigned NOT NULL default '0',
|
||||
id_parent smallint(5) unsigned NOT NULL default '0',
|
||||
board_order smallint(5) NOT NULL default '0',
|
||||
id_last_msg int(10) unsigned NOT NULL default '0',
|
||||
id_msg_updated int(10) unsigned NOT NULL default '0',
|
||||
member_groups varchar(255) NOT NULL default '-1,0',
|
||||
id_profile smallint(5) unsigned NOT NULL default '1',
|
||||
name varchar(255) NOT NULL default '',
|
||||
description text NOT NULL,
|
||||
num_topics mediumint(8) unsigned NOT NULL default '0',
|
||||
num_posts mediumint(8) unsigned NOT NULL default '0',
|
||||
count_posts tinyint(4) NOT NULL default '0',
|
||||
id_theme tinyint(4) unsigned NOT NULL default '0',
|
||||
override_theme tinyint(4) unsigned NOT NULL default '0',
|
||||
unapproved_posts smallint(5) NOT NULL default '0',
|
||||
unapproved_topics smallint(5) NOT NULL default '0',
|
||||
redirect varchar(255) NOT NULL default '',
|
||||
PRIMARY KEY (id_board),
|
||||
UNIQUE categories (id_cat, id_board),
|
||||
KEY id_parent (id_parent),
|
||||
KEY id_msg_updated (id_msg_updated),
|
||||
KEY member_groups (member_groups(48))
|
||||
) ENGINE=MyISAM;
|
||||
* */
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -225,126 +251,96 @@ class smf_import extends base_import_class
|
||||
function copyForumThreadData(&$target, &$source)
|
||||
{
|
||||
|
||||
$target['thread_id'] = $source['topic_id'];
|
||||
$target['thread_name'] = $source['topic_title'];
|
||||
$target['thread_forum_id'] = $source['forum_id'];
|
||||
$target['thread_views'] = $source['topic_views'];
|
||||
// $target['thread_active'] = $source['topic_status'];
|
||||
$target['thread_lastpost'] = $source['topic_last_post_id'];
|
||||
$target['thread_sticky'] = $source['topic_time_limit'];
|
||||
$target['thread_datestamp'] = $source['topic_time'];
|
||||
$target['thread_user'] = $source['topic_poster'];
|
||||
$target['thread_user_anon'] = $source['topic_first_poster_name'];
|
||||
$target['thread_lastuser'] = $source['topic_last_poster_id'];
|
||||
$target['thread_lastuser_anon'] = $source['topic_last_poster_name'];
|
||||
$target['thread_total_replies'] = $source['topic_replies'];
|
||||
// $target['thread_options'] = $source['topic_'];
|
||||
$target['thread_id'] = (int) $source['id_topic'];
|
||||
$target['thread_name'] = $source['subject'];
|
||||
$target['thread_forum_id'] = (int) $source['id_board'];
|
||||
$target['thread_views'] = (int) $source['num_views'];
|
||||
$target['thread_active'] = intval($source['locked']) === 0 ? 1 : 0;
|
||||
$target['thread_lastpost'] = (int) $source['lastpost_time'];
|
||||
$target['thread_sticky'] = (int) $source['id_sticky'];
|
||||
$target['thread_datestamp'] = (int) $source['poster_time'];
|
||||
$target['thread_user'] = (int) $source['id_member_started'];
|
||||
$target['thread_user_anon'] = empty($source['id_member']) ? $source['poster_name'] : null;
|
||||
$target['thread_lastuser'] = (int) $source['lastpost_user'];
|
||||
$target['thread_lastuser_anon'] = empty($source['lastpost_user']) ? $source['lastpost_name'] : null;
|
||||
$target['thread_total_replies'] = (int) $source['num_replies'];
|
||||
$target['thread_options'] = null;
|
||||
|
||||
return $target;
|
||||
|
||||
/*
|
||||
CREATE TABLE {$db_prefix}topics (
|
||||
id_topic mediumint(8) unsigned NOT NULL auto_increment,
|
||||
is_sticky tinyint(4) NOT NULL default '0',
|
||||
id_board smallint(5) unsigned NOT NULL default '0',
|
||||
id_first_msg int(10) unsigned NOT NULL default '0',
|
||||
id_last_msg int(10) unsigned NOT NULL default '0',
|
||||
id_member_started mediumint(8) unsigned NOT NULL default '0',
|
||||
id_member_updated mediumint(8) unsigned NOT NULL default '0',
|
||||
id_poll mediumint(8) unsigned NOT NULL default '0',
|
||||
id_previous_board smallint(5) NOT NULL default '0',
|
||||
id_previous_topic mediumint(8) NOT NULL default '0',
|
||||
num_replies int(10) unsigned NOT NULL default '0',
|
||||
num_views int(10) unsigned NOT NULL default '0',
|
||||
locked tinyint(4) NOT NULL default '0',
|
||||
unapproved_posts smallint(5) NOT NULL default '0',
|
||||
approved tinyint(3) NOT NULL default '1',
|
||||
PRIMARY KEY (id_topic),
|
||||
UNIQUE last_message (id_last_msg, id_board),
|
||||
UNIQUE first_message (id_first_msg, id_board),
|
||||
UNIQUE poll (id_poll, id_topic),
|
||||
KEY is_sticky (is_sticky),
|
||||
KEY approved (approved),
|
||||
KEY id_board (id_board),
|
||||
KEY member_started (id_member_started, id_board),
|
||||
KEY last_message_sticky (id_board, is_sticky, id_last_msg),
|
||||
KEY board_news (id_board, id_first_msg)
|
||||
) ENGINE=MyISAM;
|
||||
*/
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* $target - e107_forum_post table
|
||||
* $source -smf //TODO
|
||||
* $source -smf
|
||||
*/
|
||||
function copyForumPostData(&$target, &$source)
|
||||
{
|
||||
$target['post_id'] = $source['post_id'];
|
||||
$target['post_entry'] = $source['post_text'];
|
||||
$target['post_thread'] = $source['topic_id'];
|
||||
$target['post_forum'] = $source['forum_id'];
|
||||
// $target['post_status'] = $source[''];
|
||||
$target['post_datestamp'] = $source['post_time'];
|
||||
$target['post_user'] = $source['poster_id'];
|
||||
$target['post_edit_datestamp'] = $source['post_edit_time'];
|
||||
$target['post_id'] = (int)$source['id_msg'];
|
||||
$target['post_entry'] = $source['body'];
|
||||
$target['post_thread'] = (int) $source['id_topic'];
|
||||
$target['post_forum'] = (int) $source['id_board'];
|
||||
$target['post_status'] = intval($source['approved']) === 1 ? 0 : 1;
|
||||
$target['post_datestamp'] = (int) $source['poster_time'];
|
||||
$target['post_user'] = (int) $source['id_member'];
|
||||
$target['post_edit_datestamp'] = (int) $source['modified_time'];
|
||||
$target['post_edit_user'] = $source['post_edit_user'];
|
||||
$target['post_ip'] = $source['poster_ip'];
|
||||
// $target['post_user_anon'] = $source[''];
|
||||
// $target['post_attachments'] = $source[''];
|
||||
// $target['post_options'] = $source[''];
|
||||
|
||||
|
||||
$target['post_ip'] = e107::getIPHandler()->ipEncode($source['poster_ip']);
|
||||
$target['post_user_anon'] = empty($source['id_member']) ? $source['poster_name'] : null;
|
||||
$target['post_attachments'] = $this->processAttachments($source);
|
||||
$target['post_options'] = null;
|
||||
|
||||
|
||||
return $target;
|
||||
|
||||
|
||||
/*CREATE TABLE {$db_prefix}messages (
|
||||
id_msg int(10) unsigned NOT NULL auto_increment,
|
||||
id_topic mediumint(8) unsigned NOT NULL default '0',
|
||||
id_board smallint(5) unsigned NOT NULL default '0',
|
||||
poster_time int(10) unsigned NOT NULL default '0',
|
||||
id_member mediumint(8) unsigned NOT NULL default '0',
|
||||
id_msg_modified int(10) unsigned NOT NULL default '0',
|
||||
subject varchar(255) NOT NULL default '',
|
||||
poster_name varchar(255) NOT NULL default '',
|
||||
poster_email varchar(255) NOT NULL default '',
|
||||
poster_ip varchar(255) NOT NULL default '',
|
||||
smileys_enabled tinyint(4) NOT NULL default '1',
|
||||
modified_time int(10) unsigned NOT NULL default '0',
|
||||
modified_name varchar(255) NOT NULL default '',
|
||||
body text NOT NULL,
|
||||
icon varchar(16) NOT NULL default 'xx',
|
||||
approved tinyint(3) NOT NULL default '1',
|
||||
PRIMARY KEY (id_msg),
|
||||
UNIQUE topic (id_topic, id_msg),
|
||||
UNIQUE id_board (id_board, id_msg),
|
||||
UNIQUE id_member (id_member, id_msg),
|
||||
KEY approved (approved),
|
||||
KEY ip_index (poster_ip(15), id_topic),
|
||||
KEY participation (id_member, id_topic),
|
||||
KEY show_posts (id_member, id_board),
|
||||
KEY id_topic (id_topic),
|
||||
KEY id_member_msg (id_member, approved, id_msg),
|
||||
KEY current_topic (id_topic, id_msg, id_member, approved),
|
||||
KEY related_ip (id_member, poster_ip, id_msg)
|
||||
) ENGINE=MyISAM;
|
||||
*
|
||||
|
||||
INSERT INTO {$db_prefix}messages
|
||||
(id_msg, id_msg_modified, id_topic, id_board, poster_time, subject, poster_name, poster_email, poster_ip, modified_name, body, icon)
|
||||
VALUES (1, 1, 1, 1, UNIX_TIMESTAMP(), '{$default_topic_subject}', 'Simple Machines', 'info@simplemachines.org', '127.0.0.1', '', '{$default_topic_message}', 'xx');
|
||||
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* todo copyForumPostAttachments()
|
||||
* @param $source
|
||||
* @return null|string
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @todo Support for multiple attachments.
|
||||
* @param $source
|
||||
* @return null|string
|
||||
*/
|
||||
private function processAttachments($source)
|
||||
{
|
||||
if(empty($source['filename']))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
if($source['fileext'] == 'png' || $source['fileext'] == 'jpg' || $source['fileext'] == 'jpg')
|
||||
{
|
||||
$type = 'img';
|
||||
}
|
||||
else
|
||||
{
|
||||
$type = 'file';
|
||||
}
|
||||
|
||||
$arr = array();
|
||||
$arr[$type][0] = array(
|
||||
'file' => $source['filename'],
|
||||
'name' => $source['filename'],
|
||||
'size' => $source['size']
|
||||
);
|
||||
|
||||
return e107::serialize($arr);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* $target - e107_forum_track
|
||||
* $source - phpbb_forums_track : https://wiki.phpbb.com/Table.phpbb_forums_track
|
||||
* $source -???
|
||||
*/
|
||||
function copyForumTrackData(&$target, &$source)
|
||||
{
|
||||
|
466
e107_plugins/import/providers/template_import_class.php
Normal file
466
e107_plugins/import/providers/template_import_class.php
Normal file
@ -0,0 +1,466 @@
|
||||
<?php
|
||||
/**
|
||||
* e107 website system
|
||||
*
|
||||
* Copyright (C) 2008-2017 e107 Inc (e107.org)
|
||||
* Released under the terms and conditions of the
|
||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
require_once('import_classes.php');
|
||||
|
||||
/**
|
||||
* @usage replace 'template' with the name of the other cms and rename this file.
|
||||
*/
|
||||
class template_import extends base_import_class
|
||||
{
|
||||
public $title = 'Template';
|
||||
public $description = 'Import Users, News, Content and Links';
|
||||
public $supported = array('users','news','page','links'); // import methods which are completed.
|
||||
public $mprefix = 'template_'; // default prefix used by other CMS.
|
||||
|
||||
private $myparam = false; // custom param.
|
||||
|
||||
|
||||
function init()
|
||||
{
|
||||
// check $_POST; from config() if required.
|
||||
|
||||
$this->myparam = intval($_POST['news_author']);
|
||||
|
||||
}
|
||||
|
||||
function config()
|
||||
{
|
||||
|
||||
$frm = e107::getForm();
|
||||
|
||||
$mylist = array(1=>'Param 1', 2=>'Param 2');
|
||||
|
||||
$var[0]['caption'] = "Optional Parameter";
|
||||
$var[0]['html'] = $frm->select('myparam',$mylist);
|
||||
$var[0]['help'] = "Change the author of the news items";
|
||||
|
||||
// $var[1]['caption'] = "Include revisions";
|
||||
// $var[1]['html'] = $frm->checkbox('news_revisions',1);
|
||||
// $var[1]['help'] = "Change the author of the news items";
|
||||
|
||||
return $var;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Set up a query for the specified task.
|
||||
* @param $task
|
||||
* @param bool|false $blank_user
|
||||
* @return bool TRUE on success. false on error
|
||||
*/
|
||||
function setupQuery($task, $blank_user=false)
|
||||
{
|
||||
if ($this->ourDB == NULL) return false;
|
||||
|
||||
switch ($task)
|
||||
{
|
||||
case 'users' :
|
||||
$query = "SELECT * FROM {$this->DBPrefix}mytable ORDER BY my_id";
|
||||
$result = $this->ourDB->gen($query);
|
||||
if ($result === false) return false;
|
||||
|
||||
break;
|
||||
|
||||
case 'userclass' :
|
||||
$query = "SELECT * FROM {$this->DBPrefix}mytable ORDER BY my_id";
|
||||
$result = $this->ourDB->gen($query);
|
||||
if ($result === false) return false;
|
||||
break;
|
||||
|
||||
case 'news' :
|
||||
$query = "SELECT * FROM {$this->DBPrefix}mytable ORDER BY my_id";
|
||||
$result = $this->ourDB->gen($query);
|
||||
if ($result === false) return false;
|
||||
break;
|
||||
|
||||
case 'newschapter' :
|
||||
$query = "SELECT * FROM {$this->DBPrefix}mytable ORDER BY my_id";
|
||||
$result = $this->ourDB->gen($query);
|
||||
if ($result === false) return false;
|
||||
break;
|
||||
|
||||
case 'page' :
|
||||
$query = "SELECT * FROM {$this->DBPrefix}mytable ORDER BY my_id";
|
||||
$result = $this->ourDB->gen($query);
|
||||
if ($result === false) return false;
|
||||
break;
|
||||
|
||||
case 'pagechapter' :
|
||||
$query = "SELECT * FROM {$this->DBPrefix}mytable ORDER BY my_id";
|
||||
$result = $this->ourDB->gen($query);
|
||||
if ($result === false) return false;
|
||||
break;
|
||||
|
||||
case 'media' :
|
||||
$query = "SELECT * FROM {$this->DBPrefix}mytable ORDER BY my_id";
|
||||
$result = $this->ourDB->gen($query);
|
||||
if ($result === false) return false;
|
||||
break;
|
||||
|
||||
case 'links':
|
||||
$query = "SELECT * FROM {$this->DBPrefix}mytable ORDER BY my_id";
|
||||
$result = $this->ourDB->gen($query);
|
||||
if ($result === false) return false;
|
||||
break;
|
||||
|
||||
|
||||
case 'forum' :
|
||||
$query = "SELECT * FROM {$this->DBPrefix}mytable ORDER BY my_id";
|
||||
$result = $this->ourDB->gen($query);
|
||||
if ($result === false) return false;
|
||||
break;
|
||||
|
||||
case 'forumthread' :
|
||||
$query = "SELECT * FROM {$this->DBPrefix}mytable ORDER BY my_id";
|
||||
$result = $this->ourDB->gen($query);
|
||||
if ($result === false) return false;
|
||||
break;
|
||||
|
||||
case 'forumpost' :
|
||||
$query = "SELECT * FROM {$this->DBPrefix}mytable ORDER BY my_id";
|
||||
$result = $this->ourDB->gen($query);
|
||||
if ($result === false) return false;
|
||||
break;
|
||||
|
||||
case 'forumtrack' :
|
||||
$query = "SELECT * FROM {$this->DBPrefix}mytable ORDER BY my_id";
|
||||
$result = $this->ourDB->gen($query);
|
||||
if ($result === false) return false;
|
||||
break;
|
||||
|
||||
|
||||
default :
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->copyUserInfo = !$blank_user;
|
||||
$this->currentTask = $task;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------
|
||||
// Internal functions below here
|
||||
//------------------------------------
|
||||
|
||||
/**
|
||||
* Align source data to e107 User Table
|
||||
* @param $target array - default e107 target values for e107_user table.
|
||||
* @param $source array - WordPress table data
|
||||
*/
|
||||
function copyUserData(&$target, &$source)
|
||||
{
|
||||
$target['user_name'] = $source[''];
|
||||
$target['user_loginname'] = $source[''];
|
||||
$target['user_password'] = $source[''];
|
||||
$target['user_email'] = $source[''];
|
||||
$target['user_hideemail'] = $source[''];
|
||||
$target['user_join'] = $source[''];
|
||||
$target['user_admin'] = $source[''];
|
||||
$target['user_lastvisit'] = $source[''];
|
||||
$target['user_login'] = $source[''];
|
||||
$target['user_ban'] = $source[''];
|
||||
$target['user_customtitle'] = $source[''];
|
||||
$target['user_sess'] = $source['']; // Photo
|
||||
$target['user_signature'] = $source[''];
|
||||
$target['user_image'] = $source['']; // Avatar
|
||||
$target['user_currentvisit'] = $source[''];
|
||||
$target['user_lastpost'] = $source[''];
|
||||
$target['user_chats'] = $source[''];
|
||||
$target['user_comments'] = $source[''];
|
||||
|
||||
$target['user_ip'] = $source[''];
|
||||
$target['user_prefs'] = $source[''];
|
||||
$target['user_visits'] = $source[''];
|
||||
$target['user_class'] = $source[''];
|
||||
$target['user_perms'] = $source[''];
|
||||
$target['user_xup'] = $source[''];
|
||||
$target['user_language'] = $source[''];
|
||||
$target['user_country'] = $source[''];
|
||||
$target['user_location'] = $source[''];
|
||||
$target['user_aim'] = $source[''];
|
||||
$target['user_icq'] = $source[''];
|
||||
$target['user_yahoo'] = $source[''];
|
||||
$target['user_msn'] = $source[''];
|
||||
$target['user_homepage'] = $source[''];
|
||||
$target['user_birthday'] = $source[''];
|
||||
$target['user_timezone'] = $source[''];
|
||||
|
||||
$this->debug($source,$target);
|
||||
|
||||
//return $target;
|
||||
}
|
||||
|
||||
/**
|
||||
* Align source data to e107 User Table
|
||||
* @param $target array - default e107 target values for e107_user table.
|
||||
* @param $source array - WordPress table data
|
||||
*/
|
||||
function copyUserClassData(&$target, &$source)
|
||||
{
|
||||
|
||||
$target['userclass_id'] = $source[''];
|
||||
$target['userclass_name'] = $source[''];
|
||||
$target['userclass_description'] = $source[''];
|
||||
$target['userclass_editclass'] = $source[''];
|
||||
$target['userclass_parent'] = $source[''];
|
||||
$target['userclass_accum'] = $source[''];
|
||||
$target['userclass_visibility'] = $source[''];
|
||||
$target['userclass_type'] = $source[''];
|
||||
$target['userclass_icon'] = $source[''];
|
||||
$target['userclass_perms'] = $source[''];
|
||||
|
||||
return $target;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Align source data with e107 News Table
|
||||
* @param $target array - default e107 target values for e107_news table.
|
||||
* @param $source array - other cms table data
|
||||
*/
|
||||
function copyNewsData(&$target, &$source)
|
||||
{
|
||||
|
||||
$target['news_id'] = $source['']; // leave empty to auto-increment.
|
||||
$target['news_title'] = $source[''];
|
||||
$target['news_sef'] = $source[''];
|
||||
$target['news_body'] = $source['']; // wrap in [html] tags if required.
|
||||
$target['news_extended'] = $source['']; // wrap in [html] tags if required.
|
||||
$target['news_meta_keywords'] = $source[''];
|
||||
$target['news_meta_description'] = $source[''];
|
||||
$target['news_datestamp'] = $source['datestamp'];
|
||||
$target['news_author'] = $source[''];
|
||||
$target['news_category'] = $source[''];
|
||||
$target['news_allow_comments'] = $source[''];
|
||||
$target['news_start'] = $source[''];
|
||||
$target['news_end'] = $source[''];
|
||||
$target['news_class'] = $source[''];
|
||||
$target['news_render_type'] = $source[''];
|
||||
$target['news_comment_total'] = $source[''];
|
||||
$target['news_summary'] = $source[''];
|
||||
$target['news_thumbnail'] = $source[''];
|
||||
$target['news_sticky'] = $source[''];
|
||||
|
||||
return $target; // comment out to debug
|
||||
|
||||
// $this->renderDebug($source,$target);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Align source data with e107 News Table
|
||||
* @param $target array - default e107 target values for e107_news table.
|
||||
* @param $source array - other cms table data
|
||||
*/
|
||||
function copyNewsCategoryData(&$target, &$source)
|
||||
{
|
||||
$target['category_id'] = $source[''];
|
||||
$target['category_name'] = $source[''];
|
||||
$target['category_sef'] = $source[''];
|
||||
$target['category_meta_description'] = $source[''];
|
||||
$target['category_meta_keywords'] = $source[''];
|
||||
$target['category_manager'] = $source[''];
|
||||
$target['category_icon'] = $source[''];
|
||||
$target['category_order'] = $source[''];
|
||||
|
||||
return $target; // comment out to debug
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Align source data to e107 Page Table
|
||||
* @param $target array - default e107 target values for e107_page table.
|
||||
* @param $source array - other cms table data
|
||||
*/
|
||||
function copyPageData(&$target, &$source)
|
||||
{
|
||||
|
||||
|
||||
$target['page_id'] = $source[''];
|
||||
$target['page_title'] = $source[''];
|
||||
$target['page_sef'] = $source[''];
|
||||
$target['page_text'] = $source[''];
|
||||
$target['page_metakeys'] = $source[''];
|
||||
$target['page_metadscr'] = $source[''];
|
||||
$target['page_datestamp'] = $source[''];
|
||||
$target['page_author'] = $source[''];
|
||||
$target['page_category'] = $source[''];
|
||||
$target['page_comment_flag'] = $source[''];
|
||||
$target['page_password'] = $source[''];
|
||||
$target['page_class'] = $source[''];
|
||||
|
||||
return $target; // comment out to debug
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* $target - e107_forum table
|
||||
* $source - other cms
|
||||
*/
|
||||
function copyForumData(&$target, &$source)
|
||||
{
|
||||
|
||||
$target['forum_id'] = $source[''];
|
||||
$target['forum_name'] = $source[''];
|
||||
$target['forum_description'] = $source[''];
|
||||
$target['forum_parent'] = $source[''];
|
||||
$target['forum_sub'] = $source[''];
|
||||
$target['forum_datestamp'] = $source[''];
|
||||
$target['forum_moderators'] = $source[''];
|
||||
|
||||
$target['forum_threads'] = $source[''];
|
||||
$target['forum_replies'] = $source[''];
|
||||
$target['forum_lastpost_user'] = $source[''];
|
||||
$target['forum_lastpost_user_anon'] = $source[''];
|
||||
$target['forum_lastpost_info'] = $source[''];
|
||||
$target['forum_class'] = $source[''];
|
||||
$target['forum_order'] = $source[''];
|
||||
$target['forum_postclass'] = $source[''];
|
||||
$target['forum_threadclass'] = $source[''];
|
||||
$target['forum_options'] = $source[''];
|
||||
$target['forum_sef'] = $source[''];
|
||||
|
||||
return $target;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* $target - e107 forum_threads
|
||||
* $source - other cms
|
||||
*/
|
||||
function copyForumThreadData(&$target, &$source)
|
||||
{
|
||||
|
||||
$target['thread_id'] = $source[''];
|
||||
$target['thread_name'] = $source[''];
|
||||
$target['thread_forum_id'] = $source[''];
|
||||
$target['thread_views'] = $source[''];
|
||||
$target['thread_active'] = $source[''];
|
||||
$target['thread_lastpost'] = $source[''];
|
||||
$target['thread_sticky'] = $source[''];
|
||||
$target['thread_datestamp'] = $source[''];
|
||||
$target['thread_user'] = $source[''];
|
||||
$target['thread_user_anon'] = $source[''];
|
||||
$target['thread_lastuser'] = $source[''];
|
||||
$target['thread_lastuser_anon'] = $source[''];
|
||||
$target['thread_total_replies'] = $source[''];
|
||||
$target['thread_options'] = $source[''];
|
||||
|
||||
return $target;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* $target - e107_forum_post table
|
||||
* $source - other cms
|
||||
*/
|
||||
function copyForumPostData(&$target, &$source)
|
||||
{
|
||||
|
||||
$target['post_id'] = $source[''];
|
||||
$target['post_entry'] = $source[''];
|
||||
$target['post_thread'] = $source[''];
|
||||
$target['post_forum'] = $source[''];
|
||||
$target['post_status'] = $source[''];
|
||||
$target['post_datestamp'] = $source[''];
|
||||
$target['post_user'] = $source[''];
|
||||
$target['post_edit_datestamp'] = $source[''];
|
||||
$target['post_edit_user'] = $source[''];
|
||||
$target['post_ip'] = $source[''];
|
||||
$target['post_user_anon'] = $source[''];
|
||||
$target['post_attachments'] = $source[''];
|
||||
$target['post_options'] = $source[''];
|
||||
|
||||
|
||||
return $target;
|
||||
|
||||
$this->debug($source,$target);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Align source data to e107 Links Table
|
||||
* @param $target array - default e107 target values for e107_links table.
|
||||
* @param $source array - WordPress table data
|
||||
*/
|
||||
function copyLinksData(&$target, &$source)
|
||||
{
|
||||
|
||||
/* e107 Link Targets.
|
||||
0 => LCLAN_20, // 0 = same window
|
||||
1 => LCLAN_23, // new window
|
||||
4 => LCLAN_24, // 4 = miniwindow 600x400
|
||||
5 => LINKLAN_1 // 5 = miniwindow 800x600
|
||||
*/
|
||||
|
||||
$target['link_id'] = $source['']; // leave blank to auto-increment
|
||||
$target['link_name'] = $source[''];
|
||||
$target['link_url'] = $source[''];
|
||||
$target['link_description'] = $source['']; // wrap with [html] [/html] if necessary.
|
||||
$target['link_button'] = $source['']; // image file.
|
||||
$target['link_category'] = $source['']; // integer
|
||||
$target['link_order'] = $source['']; // integer
|
||||
$target['link_parent'] = $source['']; // integer
|
||||
$target['link_open'] = $source['']; // link_target
|
||||
$target['link_class'] = $source[''];
|
||||
$target['link_sefurl'] = $source[''];
|
||||
|
||||
|
||||
|
||||
|
||||
return $target; // comment out to debug
|
||||
|
||||
$this->debug($source,$target);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Custom Method if needed.
|
||||
* @param $text
|
||||
* @return string
|
||||
*/
|
||||
private function convertText($text)
|
||||
{
|
||||
//$text = e107::getParser()->toDb($text);
|
||||
return $text;
|
||||
|
||||
$text = html_entity_decode($text,ENT_QUOTES,'UTF-8');
|
||||
|
||||
$detected = mb_detect_encoding($text); // 'ISO-8859-1'
|
||||
$text = iconv($detected,'UTF-8',$text);
|
||||
|
||||
|
||||
|
||||
return $text;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
?>
|
@ -55,7 +55,7 @@ class news_search extends e_search // include plugin-folder in the name.
|
||||
'return_fields' => array('n.news_id', 'n.news_title', 'n.news_sef', 'n.news_body', 'n.news_extended', 'n.news_allow_comments', 'n.news_datestamp', 'n.news_category', 'c.category_name'),
|
||||
'search_fields' => array('n.news_title' => '1.2', 'n.news_body' => '0.6', 'n.news_extended' => '0.6', 'n.news_summary' => '1.2'), // fields and their weights.
|
||||
|
||||
'order' => array('news_datestamp' => DESC),
|
||||
'order' => array('news_datestamp' => 'DESC'),
|
||||
'refpage' => 'news.php'
|
||||
);
|
||||
|
||||
|
@ -15,7 +15,7 @@ if (!defined('e107_INIT')) { exit; }
|
||||
* @param string $parm['source'] latest (latest news items) | sticky (news items) | template (assigned to news-grid layout)
|
||||
* @param integer $parm['order'] n.news_datestamp DESC
|
||||
* @param integer $parm['limit'] 10
|
||||
* @param string $parm['template'] default | or any key as defined in news_grid_template.php
|
||||
* @param string $parm['layout'] default | or any key as defined in news_grid_template.php
|
||||
*
|
||||
* @example hard-coded {MENU: path=news/news_grid&limit=6&source=latest&featured=2&template=other}
|
||||
* @example admin assigned - Add via Media-Manager and then configure.
|
||||
|
@ -61,7 +61,9 @@ class social_shortcodes extends e_shortcode
|
||||
function sc_xurl_icons($parm='')
|
||||
{
|
||||
$tp = e107::getParser();
|
||||
$template = e107::getTemplate('social','social','xurl_icons');
|
||||
$tmpl = !empty($parm['template']) ? $parm['template'] : 'default';
|
||||
|
||||
$template = e107::getTemplate('social','social_xurl',$tmpl);
|
||||
|
||||
$social = array(
|
||||
'rss' => array('href'=> (e107::isInstalled('rss_menu') ? e107::url('rss_menu', 'index', array('rss_url'=>'news')) : ''), 'title'=>'RSS/Atom Feed'),
|
||||
|
@ -1,17 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* e107 website system
|
||||
*
|
||||
* Copyright (C) 2008-2017 e107 Inc (e107.org)
|
||||
* Released under the terms and conditions of the
|
||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* {XURL_ICONS} template
|
||||
*/
|
||||
$SOCIAL_TEMPLATE['xurl_icons']['start'] = '<p class="xurl-social-icons hidden-print">';
|
||||
$SOCIAL_TEMPLATE['xurl_icons']['item'] = '<a rel="external" href="{XURL_ICONS_HREF}" data-tooltip-position="top" class="e-tip social-icon social-{XURL_ICONS_ID}" title="{XURL_ICONS_TITLE}"><span class="fa fa-fw fa-{XURL_ICONS_ID} {XURL_ICONS_CLASS}"></span></a>';
|
||||
$SOCIAL_TEMPLATE['xurl_icons']['end'] = '</p>';
|
17
e107_plugins/social/templates/social_xurl_template.php
Normal file
17
e107_plugins/social/templates/social_xurl_template.php
Normal file
@ -0,0 +1,17 @@
|
||||
<?php
|
||||
/**
|
||||
* e107 website system
|
||||
*
|
||||
* Copyright (C) 2008-2017 e107 Inc (e107.org)
|
||||
* Released under the terms and conditions of the
|
||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* {XURL_ICONS} template
|
||||
*/
|
||||
$SOCIAL_XURL_TEMPLATE['default']['start'] = '<p class="xurl-social-icons hidden-print">';
|
||||
$SOCIAL_XURL_TEMPLATE['default']['item'] = '<a rel="external" href="{XURL_ICONS_HREF}" data-tooltip-position="top" class="e-tip social-icon social-{XURL_ICONS_ID}" title="{XURL_ICONS_TITLE}"><span class="fa fa-fw fa-{XURL_ICONS_ID} {XURL_ICONS_CLASS}"></span></a>';
|
||||
$SOCIAL_XURL_TEMPLATE['default']['end'] = '</p>';
|
@ -1488,6 +1488,98 @@ footer {
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
body#admin-menus > .container-fluid > .row,
|
||||
body#admin-menus .admin-left-panel,
|
||||
|
||||
.row-flex,
|
||||
.row-flex > div[class*='col-'] {
|
||||
display: -webkit-box;
|
||||
display: -moz-box;
|
||||
display: -ms-flexbox;
|
||||
display: -webkit-flex;
|
||||
display: flex;
|
||||
flex:1 1 auto;
|
||||
|
||||
}
|
||||
|
||||
body#admin-menus > .container-fluid > .row {
|
||||
height: 92vh;
|
||||
}
|
||||
|
||||
body#admin-menus .admin-left-panel {
|
||||
flex-flow: column nowrap;
|
||||
}
|
||||
|
||||
.row-flex > div[class*='col-'], .container-flex > div[class*='col-'] {
|
||||
margin:-.2px; /* hack adjust for wrapping */
|
||||
}
|
||||
|
||||
.container-flex > div[class*='col-'] div,
|
||||
.row-flex > div[class*='col-'] div {
|
||||
width:100%;
|
||||
}
|
||||
|
||||
body#admin-menus #sc-admin-help,
|
||||
body#admin-menus #sc-admin-help .panel-body,
|
||||
.flex-col {
|
||||
display: flex;
|
||||
display: -webkit-flex;
|
||||
flex: 1 100%;
|
||||
flex-flow: column nowrap;
|
||||
}
|
||||
|
||||
.flex-grow {
|
||||
display: flex;
|
||||
-webkit-flex: 2;
|
||||
flex: 2;
|
||||
}
|
||||
|
||||
body#admin-menus #sc-admin-help {
|
||||
overflow-y:hidden;
|
||||
}
|
||||
|
||||
body#admin-menus #sc-admin-help .panel-body {
|
||||
overflow-y:scroll;
|
||||
}
|
||||
|
||||
.form-control[disabled] { opacity: 0.5; }
|
||||
|
||||
.e-image-preview { display:inline-block }
|
||||
|
||||
td img.thumbnail { margin-bottom:0 }
|
||||
|
||||
|
||||
/* Parent/Child Indicator */
|
||||
.treeprefix {margin-right:4px}
|
||||
.treeprefix.level-2 { margin-left:10px }
|
||||
.treeprefix.level-3 { margin-left:35px }
|
||||
.treeprefix.level-4 { margin-left:60px }
|
||||
.treeprefix.level-5 { margin-left:85px }
|
||||
|
||||
/* Cleanup tables for light themes */
|
||||
.adminlist.table-bordered > thead > tr > th,
|
||||
.adminlist.table-bordered > thead > tr > td,
|
||||
.adminlist.table-bordered > tbody > tr > th,
|
||||
.adminlist.table-bordered > tbody > tr > td,
|
||||
.adminlist.table-bordered > tfoot > tr > th,
|
||||
.adminlist.table-bordered > tfoot > tr > td {
|
||||
border-left: 0;
|
||||
border-right:0;
|
||||
}
|
||||
|
||||
/* Cleanup table borders/headers */
|
||||
#admin-ui-list-batch ,
|
||||
.adminlist > thead > tr { background-color: rgba(0,0,0,0.1); }
|
||||
|
||||
.adminlist { border:1px solid rgba(0,0,0,0.1); }
|
||||
|
||||
.nav-admin .fa { font-size:18px }
|
||||
|
||||
|
||||
|
||||
@media (min-width: 1101px ){
|
||||
.navbar-fixed-top { height: 51px; }
|
||||
}
|
||||
|
@ -20,14 +20,14 @@ if (!defined('e107_INIT')) { exit(); }
|
||||
//e107::lan('theme', 'admin',true);
|
||||
|
||||
|
||||
$E_ADMIN_NAVIGATION['start'] = '<ul class="nav navbar-nav navbar-left">';
|
||||
$E_ADMIN_NAVIGATION['start'] = '<ul class="nav nav-admin navbar-nav navbar-left">';
|
||||
|
||||
$E_ADMIN_NAVIGATION['start_other'] = '<ul class="nav navbar-nav navbar-right">';
|
||||
$E_ADMIN_NAVIGATION['start_other'] = '<ul class="nav nav-admin navbar-nav navbar-right">';
|
||||
|
||||
$E_ADMIN_NAVIGATION['button'] = '
|
||||
<li class="dropdown">
|
||||
<a class="dropdown-toggle" role="button" data-toggle="dropdown" data-target="#" href="{LINK_URL}" title="{LINK_TEXT}">
|
||||
{LINK_IMAGE} {LINK_TEXT}
|
||||
{LINK_IMAGE}
|
||||
<b class="caret"></b>
|
||||
</a>
|
||||
{SUB_MENU}
|
||||
@ -39,7 +39,7 @@ $E_ADMIN_NAVIGATION['button'] = '
|
||||
$E_ADMIN_NAVIGATION['button_active'] = '
|
||||
<li class="dropdown active">
|
||||
<a class="dropdown-toggle" role="button" data-toggle="dropdown" data-target="#" href="{LINK_URL}">
|
||||
{LINK_IMAGE} {LINK_TEXT}
|
||||
{LINK_IMAGE}
|
||||
<b class="caret"></b>
|
||||
</a>
|
||||
{SUB_MENU}
|
||||
@ -155,7 +155,7 @@ $E_ADMIN_NAVIGATION['end'] = '</ul>';
|
||||
</div>
|
||||
*/
|
||||
|
||||
$inverse = (e107::getPref('admincss') == "admin_light.css") ? "navbar-inverse" : "";
|
||||
// $inverse = (e107::getPref('admincss') == "admin_light.css") ? "navbar-inverse" : "";
|
||||
|
||||
|
||||
$ADMIN_MODAL = '
|
||||
|
@ -192,7 +192,12 @@ class bootstrap3_admintheme
|
||||
|
||||
case 'core-infopanel':
|
||||
case 'site_info':
|
||||
echo '<div class="panel ' . $panelType[$style] . '">
|
||||
echo '<div class="panel ' . $panelType[$style] . '"';
|
||||
if(!empty($data['uniqueId']))
|
||||
{
|
||||
echo ' id="'.$data['uniqueId'].'" ';
|
||||
}
|
||||
echo ' >
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title">' . $caption . '</h3>
|
||||
</div>
|
||||
|
5638
e107_themes/bootstrap3/css/corporate.css
Normal file
5638
e107_themes/bootstrap3/css/corporate.css
Normal file
File diff suppressed because it is too large
Load Diff
@ -156,6 +156,23 @@ li.dropdown-submenu.lower ul.submenu-start li:hover { background-color:#f5f5f5;
|
||||
.news-grid-default .featured { margin-bottom:30px; }
|
||||
.news-grid-other .featured { margin-bottom:30px; }
|
||||
|
||||
|
||||
/* MENU MENU Example*/
|
||||
|
||||
|
||||
|
||||
.theme-sc-bootstrap-megamenu-example { position: static !important; }
|
||||
|
||||
.theme-sc-bootstrap-megamenu-example .dropdown-menu {
|
||||
padding: 20px 15px 15px;
|
||||
width: 100%;
|
||||
}
|
||||
.theme-sc-bootstrap-megamenu-example .dropdown-menu ul.media-list {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* CUSTOM Responsive Styles */
|
||||
|
||||
|
||||
|
@ -25,6 +25,7 @@
|
||||
<stylesheets>
|
||||
<css file="style.css" name="Default"/>
|
||||
<css file="css/bootstrap-dark.min.css" name="Bootstrap3 Dark Admin" scope='admin' exclude='bootstrap'/>
|
||||
<css file="css/corporate.css" name="Corporate" scope='admin' exclude='bootstrap' />
|
||||
<css file="https://maxcdn.bootstrapcdn.com/bootswatch/3.3.7/flatly/bootstrap.min.css" name="Flatly" scope='admin' exclude='bootstrap'/>
|
||||
<css file="https://maxcdn.bootstrapcdn.com/bootswatch/3.3.7/sandstone/bootstrap.min.css" name="Sandstone" scope='admin' exclude='bootstrap'/>
|
||||
<css file="https://maxcdn.bootstrapcdn.com/bootswatch/3.3.7/superhero/bootstrap.min.css" name="Superhero" scope='admin' exclude='bootstrap'/>
|
||||
|
@ -261,6 +261,36 @@ class theme_shortcodes extends e_shortcode
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Mega-Menu Shortcode Example.
|
||||
* @usage Select "bootstrap_megamenu_example" in Admin > Sitelinks > Create/Edit > Function
|
||||
* @notes Changing the method name will require changing .theme-sc-bootstrap-megamenu-example in style.css
|
||||
* @param null $data Link data.
|
||||
* @return string
|
||||
*/
|
||||
function sc_bootstrap_megamenu_example($data)
|
||||
{
|
||||
// include a plugin, custom code, whatever you wish.
|
||||
|
||||
// return print_a($data,true);
|
||||
|
||||
$parm= array();
|
||||
$parm['caption'] = '';
|
||||
$parm['titleLimit'] = 25; // number of chars fo news title
|
||||
$parm['summaryLimit'] = 50; // number of chars for new summary
|
||||
$parm['source'] = 'latest'; // latest (latest news items) | sticky (news items) | template (assigned to news-grid layout)
|
||||
$parm['order'] = 'DESC'; // n.news_datestamp DESC
|
||||
$parm['limit'] = '6'; // 10
|
||||
$parm['layout'] = 'media-list'; // default | or any key as defined in news_grid_template.php
|
||||
$parm['featured'] = 0;
|
||||
|
||||
|
||||
return "<div class='container'>". e107::getObject('news')->render_newsgrid($parm) ."</div>";
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -340,6 +340,17 @@
|
||||
<field name="media_cat_image">{e_THEME}landingzero/install/beach.jpg</field>
|
||||
<field name="media_cat_order">0</field>
|
||||
</item>
|
||||
<item>
|
||||
<field name="media_cat_id">14</field>
|
||||
<field name="media_cat_owner">_icon</field>
|
||||
<field name="media_cat_category">_icon_svg</field>
|
||||
<field name="media_cat_title">Icons SVG</field>
|
||||
<field name="media_cat_sef"></field>
|
||||
<field name="media_cat_diz">Available where icons are used in admin.</field>
|
||||
<field name="media_cat_class">253</field>
|
||||
<field name="media_cat_image"></field>
|
||||
<field name="media_cat_order">0</field>
|
||||
</item>
|
||||
</dbTable>
|
||||
<dbTable name="links">
|
||||
<item>
|
||||
|
@ -775,9 +775,13 @@ $(document).ready(function()
|
||||
|
||||
$(selector).toggle();
|
||||
|
||||
// $('.menu-selector input[type="checkbox"]').removeAttr("checked");
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
$(".e-mm-selector li input").click(function(e){
|
||||
|
||||
|
23
index.php
23
index.php
@ -95,7 +95,8 @@
|
||||
}
|
||||
else*/
|
||||
{
|
||||
$tmp = e107::getAddonConfig('e_url');
|
||||
// $tmp = e107::getAddonConfig('e_url');
|
||||
$tmp = e107::getUrlConfig();
|
||||
// e107::getCache()->set('Addon_url',e107::serialize($tmp,'json'),true,true,true);
|
||||
}
|
||||
|
||||
@ -104,6 +105,8 @@
|
||||
|
||||
if(count($tmp))
|
||||
{
|
||||
$rootNamespace = e107::getPref('url_main_module');
|
||||
$replaceAlias = array('{alias}\/?','{alias}/?','{alias}\/','{alias}/',);
|
||||
|
||||
foreach($tmp as $plug=>$cfg)
|
||||
{
|
||||
@ -127,7 +130,15 @@
|
||||
{
|
||||
$alias = (!empty($pref['e_url_alias'][e_LAN][$plug][$k])) ? $pref['e_url_alias'][e_LAN][$plug][$k] : $v['alias'];
|
||||
// e107::getMessage()->addDebug("e_url alias found: <b>".$alias."</b>");
|
||||
$v['regex'] = str_replace('{alias}', $alias, $v['regex']);
|
||||
if(!empty($rootNamespace) && $rootNamespace === $plug)
|
||||
{
|
||||
$v['regex'] = str_replace($replaceAlias, '', $v['regex']);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
$v['regex'] = str_replace('{alias}', $alias, $v['regex']);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -163,7 +174,15 @@
|
||||
}
|
||||
elseif(getperms('0'))
|
||||
{
|
||||
require_once(HEADERF);
|
||||
echo "<div class='alert alert-warning'>";
|
||||
echo "<h3>SEF Debug Info</h3>";
|
||||
echo "File missing: ".$file;
|
||||
echo "<br />Matched key: <b>".$k."</b>";
|
||||
|
||||
print_a($v);
|
||||
echo "</div>";
|
||||
require_once(FOOTERF);
|
||||
exit;
|
||||
}
|
||||
|
||||
|
47
login.php
47
login.php
@ -1,20 +1,13 @@
|
||||
<?php
|
||||
/*
|
||||
+ ----------------------------------------------------------------------------+
|
||||
| e107 website system
|
||||
|
|
||||
| Copyright (C) 2008-2009 e107 Inc
|
||||
| http://e107.org
|
||||
|
|
||||
|
|
||||
| Released under the terms and conditions of the
|
||||
| GNU General Public License (http://gnu.org).
|
||||
|
|
||||
| $Source: /cvs_backup/e107_0.8/login.php,v $
|
||||
| $Revision$
|
||||
| $Date$
|
||||
| $Author$
|
||||
+----------------------------------------------------------------------------+
|
||||
* e107 website system
|
||||
*
|
||||
* Copyright (C) e107 Inc (e107.org)
|
||||
* Released under the terms and conditions of the
|
||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||
*
|
||||
* Login routine
|
||||
*
|
||||
*/
|
||||
|
||||
require_once("class2.php");
|
||||
@ -34,7 +27,7 @@ if ((USER || e_LOGIN != e_SELF || (empty($pref['user_reg']) && empty($pref['soci
|
||||
exit();
|
||||
}
|
||||
|
||||
e107::includeLan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_'.e_PAGE);
|
||||
e107::coreLan('login');
|
||||
|
||||
if(!defined('e_IFRAME')) define('e_IFRAME',true);
|
||||
require_once(HEADERF);
|
||||
@ -42,18 +35,18 @@ $use_imagecode = ($pref['logcode'] && extension_loaded("gd"));
|
||||
|
||||
define("LOGIN_CAPTCHA", $use_imagecode);
|
||||
|
||||
//if (LOGIN_CAPTCHA)
|
||||
//if (LOGIN_CAPTCHA)
|
||||
//{
|
||||
//require_once(e_HANDLER."secure_img_handler.php");
|
||||
//$sec_img = new secure_image;
|
||||
//}
|
||||
|
||||
if (!USER || getperms('0'))
|
||||
if (!USER || getperms('0'))
|
||||
{
|
||||
if (!defined('LOGINMESSAGE')) define('LOGINMESSAGE', ''); // LOGINMESSAGE only appears with errors
|
||||
require_once(e_HANDLER.'form_handler.php'); // required for BC
|
||||
$rs = new form; // required for BC
|
||||
|
||||
|
||||
if (empty($LOGIN_TABLE))
|
||||
{
|
||||
|
||||
@ -90,21 +83,29 @@ if (!USER || getperms('0'))
|
||||
$LOGIN_TABLE = "<form id='login-page' class='form-signin' method='post' action='".e_SELF."' onsubmit='hashLoginPassword(this)' >".$LOGIN_TEMPLATE['page']['body']."</form>";
|
||||
$LOGIN_TABLE_FOOTER = $LOGIN_TEMPLATE['page']['footer'];
|
||||
}
|
||||
|
||||
|
||||
|
||||
$text = $tp->parseTemplate($LOGIN_TABLE,true, $sc);
|
||||
|
||||
if(getperms('0'))
|
||||
{
|
||||
echo "<div class='alert alert-block alert-error alert-danger center'> You are currently logged in as the Main Admin.</div>"; //TODO LAN
|
||||
$find = array('[', ']');
|
||||
$replace = array("<a href='".e_HTTP."index.php' class='btn btn-primary' role='button'>", "</a>");
|
||||
$return_link = str_replace($find, $replace, LAN_LOGIN_33);
|
||||
|
||||
echo "<div class='alert alert-block alert-error alert-danger center'>".LAN_LOGIN_32." <br /><br />".$return_link."</div>";
|
||||
|
||||
if(empty($pref['user_reg']))
|
||||
{
|
||||
echo "<div class='alert alert-block alert-error alert-danger center'>User registration and/or login is currently disabled. <a class='alert-link' target='_blank' href='".e_ADMIN_ABS."prefs.php#nav-core-prefs-registration'>Go here to enable it.</a></div>"; //TODO LAN
|
||||
$find = array('[', ']');
|
||||
$replace = array("<a href='".e_ADMIN_ABS."prefs.php#nav-core-prefs-registration' class='btn btn-primary' role='button' target='_blank'>", "</a>");
|
||||
$pref_link = str_replace($find, $replace, LAN_LOGIN_35);
|
||||
|
||||
echo "<div class='alert alert-block alert-error alert-danger center'>".LAN_LOGIN_34." <br /><br />".$pref_link."</div>";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
$login_message = SITENAME; // $login_message = LAN_LOGIN_3." | ".SITENAME;
|
||||
if(strpos($LOGIN_TABLE_HEADER,'LOGIN_TABLE_LOGINMESSAGE') === false && strpos($LOGIN_TABLE,'LOGIN_TABLE_LOGINMESSAGE') === false)
|
||||
|
11
search.php
11
search.php
@ -51,7 +51,8 @@ class search extends e_shortcode
|
||||
private $auto_order = 1000;
|
||||
private $enhanced = false;
|
||||
private $query = null;
|
||||
private $result_flag = false;
|
||||
private $doSearch = false;
|
||||
private $result_flag = 0; // same as 'from'
|
||||
private $message = '';
|
||||
public $template = array();
|
||||
private $enhancedTypes = array(
|
||||
@ -894,7 +895,7 @@ class search extends e_shortcode
|
||||
$_GET = $this->magic_search($_GET);
|
||||
}
|
||||
|
||||
$full_query = $tp->filter($_GET['q'],'w');
|
||||
$full_query = $tp->filter($_GET['q']);
|
||||
|
||||
if ($_GET['in'])
|
||||
{
|
||||
@ -976,9 +977,11 @@ class search extends e_shortcode
|
||||
|
||||
if ($this->query)
|
||||
{
|
||||
$this->result_flag = true; // intval($_GET['r']);
|
||||
$this->result_flag = intval($_GET['r']);
|
||||
$this->doSearch = true;
|
||||
}
|
||||
|
||||
|
||||
return $this->query;
|
||||
}
|
||||
|
||||
@ -988,7 +991,7 @@ class search extends e_shortcode
|
||||
|
||||
public function doSearch()
|
||||
{
|
||||
return $this->result_flag;
|
||||
return $this->doSearch;
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user