mirror of
https://github.com/e107inc/e107.git
synced 2025-08-06 06:38:00 +02:00
Merge remote-tracking branch 'e107inc/master'
merging
This commit is contained in:
@@ -185,7 +185,7 @@ class page_chapters_ui extends e_admin_ui
|
||||
|
||||
);
|
||||
|
||||
protected $fieldpref = array('checkboxes', 'chapter_icon', 'chapter_id', 'chapter_name', 'chapter_description','chapter_template', 'chapter_manager', 'chapter_order', 'options');
|
||||
protected $fieldpref = array('checkboxes', 'chapter_icon', 'chapter_id', 'chapter_name', 'chapter_description','chapter_template', 'chapter_visibility', 'chapter_order', 'options');
|
||||
|
||||
protected $books = array();
|
||||
|
||||
|
@@ -1749,7 +1749,7 @@ class lancheck
|
||||
|
||||
$editUrl = e_REQUEST_SELF."?".http_build_query($parms,'&');
|
||||
|
||||
$text .= "<a href='".$editUrl."' class='e-modal btn btn-primary' data-modal-caption='".str_replace("../","",$comp_dir)."' style='width:60px' >".LAN_EDIT."</a> "; // href='".e_REQUEST_URI."&f=".$comp_dir."/languages/".$lnk."&lan=".$target_lan."&type={$mode}'
|
||||
$text .= "<a href='".$editUrl."' class='e-modal btn btn-primary' data-modal-caption='".str_replace("../","",$comp_dir)."'>".LAN_EDIT."</a> "; // href='".e_REQUEST_URI."&f=".$comp_dir."/languages/".$lnk."&lan=".$target_lan."&type={$mode}'
|
||||
// <a href='".$editUrl."' data-modal-caption='".$subpath."' class='e-modal btn btn-primary' type='button' style='width:60px'>".LAN_EDIT."</a>";
|
||||
|
||||
|
||||
|
@@ -71,18 +71,18 @@ class links_admin_ui extends e_admin_ui
|
||||
|
||||
protected $fields = array(
|
||||
'checkboxes' => array('title'=> '', 'width' => '3%', 'forced' => true, 'thclass'=>'center first', 'class'=>'center first'),
|
||||
'link_button' => array('title'=> LAN_ICON, 'type'=>'icon', 'width'=>'5%', 'thclass'=>'center', 'class'=>'center', 'writeParms'=>'glyphs=1'),
|
||||
'link_button' => array('title'=> LAN_ICON, 'type'=>'icon', 'width'=>'5%', 'thclass'=>'center', 'class'=>'center', 'readParms'=>array('legacy'=>'{e_IMAGE}icons/'), 'writeParms'=>'glyphs=1'),
|
||||
'link_id' => array('title'=> LAN_ID, 'type'=>'method', 'readParms'=>'', 'noedit'=>TRUE),
|
||||
'link_name' => array('title'=> LAN_NAME, 'type'=>'text', 'inline'=>true, 'required'=>false, 'validate'=>false, 'width'=>'auto'), // not required as only an icon may be used.
|
||||
'link_category' => array('title'=> LAN_TEMPLATE, 'type'=>'dropdown', 'inline'=>true, 'batch'=>true, 'filter'=>true, 'width'=>'auto'),
|
||||
'link_name' => array('title'=> LAN_NAME, 'type'=>'text', 'inline'=>true, 'required'=>false, 'validate'=>false, 'width'=>'auto', 'writeParms'=>array('size'=>'xlarge')), // not required as only an icon may be used.
|
||||
'link_category' => array('title'=> LAN_TEMPLATE, 'type'=>'dropdown', 'inline'=>true, 'batch'=>true, 'filter'=>true, 'width'=>'auto', 'writeParms'=>array('size'=>'xlarge')),
|
||||
|
||||
'link_parent' => array('title'=> LAN_PARENT, 'type' => 'method', 'data'=>'int', 'width'=>'auto', 'batch'=>true, 'filter'=>true, 'thclass'=>'left first'),
|
||||
'link_parent' => array('title'=> LAN_PARENT, 'type' => 'method', 'data'=>'int', 'width'=>'auto', 'batch'=>true, 'filter'=>true, 'thclass'=>'left first', 'writeParms'=>array('size'=>'xlarge')),
|
||||
'link_url' => array('title'=> LAN_URL, 'width'=>'auto', 'type'=>'method', 'inline'=>true, 'required'=>true,'validate' => true, 'writeParms'=>'size=xxlarge'),
|
||||
'link_sefurl' => array('title'=> LAN_SEFURL, 'type' => 'method', 'inline'=>false, 'width' => 'auto', 'help'=>LCLAN_107),
|
||||
'link_class' => array('title'=> LAN_USERCLASS, 'type' => 'userclass','inline'=>true, 'writeParms' => 'classlist=public,guest,nobody,member,classes,admin,main', 'batch'=>true, 'filter'=>true, 'width' => 'auto'),
|
||||
'link_description' => array('title'=> LAN_DESCRIPTION, 'type' => 'textarea', 'width' => 'auto'), // 'method'=>'tinymce_plugins', ?
|
||||
'link_order' => array('title'=> LAN_ORDER, 'type' => 'number', 'width' => 'auto', 'nolist'=>false, 'inline' => true),
|
||||
'link_open' => array('title'=> LCLAN_19, 'type' => 'dropdown', 'inline'=>true, 'width' => 'auto', 'batch'=>true, 'filter'=>true, 'thclass' => 'left first'),
|
||||
'link_open' => array('title'=> LCLAN_19, 'type' => 'dropdown', 'inline'=>true, 'width' => 'auto', 'batch'=>true, 'filter'=>true, 'thclass' => 'left first', 'writeParms'=>array('size'=>'xlarge')),
|
||||
'link_function' => array('title'=> LCLAN_105, 'type' => 'method', 'data'=>'str', 'width' => 'auto', 'thclass' => 'left first'),
|
||||
'link_owner' => array('title'=> LCLAN_106, 'type' => 'hidden', 'data'=>'str'),
|
||||
'options' => array('title'=> LAN_OPTIONS, 'type' => null, 'forced'=>TRUE, 'width' => '10%', 'thclass' => 'center last', 'class'=>'center','readParms'=>'sort=1') // quick workaround
|
||||
@@ -117,7 +117,7 @@ class links_admin_ui extends e_admin_ui
|
||||
|
||||
function init()
|
||||
{
|
||||
$this->fields['link_category']['writeParms'] = array(
|
||||
$this->fields['link_category']['writeParms']['optArray'] = array(
|
||||
1 => "1 - Main",
|
||||
2 => "2 - Sidebar",
|
||||
3 => "3 - Footer",
|
||||
@@ -131,7 +131,8 @@ class links_admin_ui extends e_admin_ui
|
||||
255 => "(Unassigned)",
|
||||
);
|
||||
|
||||
$this->fields['link_open']['writeParms'] = array(
|
||||
|
||||
$this->fields['link_open']['writeParms']['optArray'] = array(
|
||||
0 => LCLAN_20, // 0 = same window
|
||||
1 => LCLAN_23, // new window
|
||||
4 => LCLAN_24, // 4 = miniwindow 600x400
|
||||
@@ -616,6 +617,37 @@ class links_admin_form_ui extends e_admin_form_ui
|
||||
}
|
||||
$this->linkFunctions[$cat] = $func;
|
||||
}
|
||||
|
||||
$sitetheme = e107::getPref('sitetheme');
|
||||
|
||||
if(!file_exists(e_THEME.$sitetheme.'/theme_shortcodes.php'))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
require_once(e_THEME.$sitetheme.'/theme_shortcodes.php');
|
||||
$methods = get_class_methods('theme_shortcodes');
|
||||
|
||||
asort($methods);
|
||||
|
||||
$cat = defset('LINKLAN_10',"Theme Shortcodes");
|
||||
|
||||
foreach($methods as $func)
|
||||
{
|
||||
if(strpos($func,'sc_') !== 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
$newkey = 'theme::'.$func;
|
||||
|
||||
$this->linkFunctions[$cat][$newkey] = str_replace('sc_','',$func);
|
||||
}
|
||||
|
||||
|
||||
// var_dump($methods );
|
||||
|
||||
|
||||
}
|
||||
|
||||
function link_parent($value, $mode)
|
||||
@@ -647,7 +679,7 @@ class links_admin_form_ui extends e_admin_form_ui
|
||||
$cats = $this->getController()->getLinkArray($catid);
|
||||
$ret = array();
|
||||
$this->_parent_select_array(0, $cats, $ret);
|
||||
return $this->selectbox('link_parent', $ret, $value, array('default' => LAN_SELECT));
|
||||
return $this->selectbox('link_parent', $ret, $value, array('size'=>'xlarge','default' => LAN_SELECT));
|
||||
break;
|
||||
|
||||
case 'batch':
|
||||
@@ -670,7 +702,7 @@ class links_admin_form_ui extends e_admin_form_ui
|
||||
|
||||
if($mode == 'write')
|
||||
{
|
||||
return $this->selectbox('link_function',$this->linkFunctions,$curVal,array('default'=> "(".LAN_OPTIONAL.")"));
|
||||
return $this->selectbox('link_function',$this->linkFunctions,$curVal,array('size'=>'xlarge','default'=> "(".LAN_OPTIONAL.")"));
|
||||
}
|
||||
|
||||
else
|
||||
|
@@ -1274,19 +1274,28 @@ $text .= "
|
||||
</colgroup>
|
||||
<tbody>";
|
||||
|
||||
if(!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') // Only allow if an SSL login has been made.
|
||||
{
|
||||
|
||||
$text .="
|
||||
<tr>
|
||||
<td><label for='ssl-enabled'>".PRFLAN_60."</label></td>
|
||||
|
||||
<td>
|
||||
".$frm->radio_switch('ssl_enabled', $pref['ssl_enabled'])."
|
||||
<div class='field-help'>".PRFLAN_61."</div>
|
||||
<td>";
|
||||
|
||||
if(!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') // Only allow if an SSL login has been made.
|
||||
{
|
||||
$text .= $frm->radio_switch('ssl_enabled', $pref['ssl_enabled']);
|
||||
$text .= "<div class='field-help'>".PRFLAN_61."</div>";
|
||||
}
|
||||
else
|
||||
{
|
||||
$text .= "<div class='label label-primary e-tip' title=\"".PRFLAN_61."\">".PRFLAN_275."</div>";
|
||||
}
|
||||
|
||||
$text .= "
|
||||
</td>
|
||||
</tr>
|
||||
";
|
||||
}
|
||||
|
||||
// Secure Image/ Captcha
|
||||
$secureImage = array('signcode'=>PRFLAN_76, 'logcode'=>PRFLAN_81, "fpwcode"=>PRFLAN_138,'admincode'=>PRFLAN_222);
|
||||
|
||||
|
@@ -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';
|
||||
|
@@ -1323,6 +1323,7 @@ class users_admin_ui extends e_admin_ui
|
||||
$sql = e107::getDb();
|
||||
$e_event = e107::getEvent();
|
||||
$admin_log = e107::getAdminLog();
|
||||
$pref = e107::getPref();
|
||||
|
||||
if (!$_POST['ac'] == md5(ADMINPWCHANGE))
|
||||
{
|
||||
@@ -1401,7 +1402,7 @@ class users_admin_ui extends e_admin_ui
|
||||
|
||||
|
||||
|
||||
$user_data['user_password'] = $userMethods->HashPassword($savePassword, $user_data['user_login']);
|
||||
$user_data['user_password'] = $userMethods->HashPassword($savePassword, $user_data['user_loginname']);
|
||||
$user_data['user_join'] = time();
|
||||
|
||||
e107::getMessage()->addDebug("Password Hash: ".$user_data['user_password']);
|
||||
|
@@ -239,6 +239,13 @@ class news_shortcodes extends e_shortcode
|
||||
}
|
||||
|
||||
|
||||
|
||||
function sc_news_category_id($parm=null)
|
||||
{
|
||||
return (int) $this->news_item['category_id'];
|
||||
}
|
||||
|
||||
|
||||
function sc_news_category_icon($parm=null)
|
||||
{
|
||||
return $this->sc_newscaticon($parm);
|
||||
@@ -274,6 +281,8 @@ class news_shortcodes extends e_shortcode
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//New v2.x Aliases
|
||||
|
||||
public function sc_news_id($parm=null)
|
||||
|
@@ -421,6 +421,137 @@ class news {
|
||||
$original = str_replace('©', '(c)', $original);
|
||||
return htmlspecialchars($original, ENT_COMPAT, CHARSET);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Render a news Grid. (currently used in news_grid_menu ) // new v2.1.5
|
||||
* @param array $parm
|
||||
* @param string $parm['caption'] text or constant
|
||||
* @param integer $parm['titleLimit'] number of chars fo news title
|
||||
* @param integer $parm['summaryLimit'] number of chars for new summary
|
||||
* @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
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function render_newsgrid($parm=null)
|
||||
{
|
||||
$cacheString = 'nq_news_grid_menu_'.md5(serialize($parm));
|
||||
|
||||
$cached = e107::getCache()->retrieve($cacheString);
|
||||
|
||||
if(false === $cached)
|
||||
{
|
||||
e107::plugLan('news');
|
||||
|
||||
if(is_string($parm))
|
||||
{
|
||||
parse_str($parm, $parms);
|
||||
}
|
||||
else
|
||||
{
|
||||
$parms = $parm;
|
||||
|
||||
e107::getDebug()->log($parms);
|
||||
}
|
||||
|
||||
if(isset($parms['caption'][e_LANGUAGE]))
|
||||
{
|
||||
$parms['caption'] = $parms['caption'][e_LANGUAGE];
|
||||
}
|
||||
|
||||
if(!empty($parms['caption']) && defined($parms['caption']))
|
||||
{
|
||||
$parms['caption'] = constant($parms['caption']);
|
||||
}
|
||||
|
||||
|
||||
$ntree = e107::getObject('e_news_tree');
|
||||
|
||||
if($legacyTemplate = e107::getTemplate('news', 'news_menu', 'grid')) // BC
|
||||
{
|
||||
$template = $legacyTemplate;
|
||||
$parms['tmpl'] = 'news_menu';
|
||||
$parms['tmpl_key'] = 'grid';
|
||||
}
|
||||
else // New in v2.1.5
|
||||
{
|
||||
$tmpl = !empty($parms['layout']) ? $parms['layout'] : 'col-md-4';
|
||||
$template = e107::getTemplate('news', 'news_grid', $tmpl);
|
||||
$parms['tmpl'] = 'news_grid';
|
||||
$parms['tmpl_key'] = $tmpl;
|
||||
|
||||
}
|
||||
|
||||
// $gridSize = vartrue($parms['layout'],'col-md-4');
|
||||
|
||||
$parmSrch = array(
|
||||
'{NEWSGRID}',
|
||||
'_titleLimit_',
|
||||
'_summaryLimit_'
|
||||
);
|
||||
|
||||
$parmReplace = array(
|
||||
// $gridSize,
|
||||
// vartrue($parms['titleLimit'], 0),
|
||||
// vartrue($parms['summaryLimit'], 0)
|
||||
);
|
||||
|
||||
$template = str_replace($parmSrch , '', $template); // clean up deprecated elements.
|
||||
|
||||
$render = (empty($parms['caption'])) ? false: true;
|
||||
|
||||
|
||||
|
||||
if(empty($parms['count']))
|
||||
{
|
||||
$parms['count'] = 3;
|
||||
}
|
||||
|
||||
$parms['order'] = 'n.news_datestamp DESC';
|
||||
|
||||
|
||||
$treeparm = array();
|
||||
|
||||
if(!empty($parms['count']))
|
||||
{
|
||||
$treeparm['db_limit'] = '0, '.intval($parms['count']);
|
||||
}
|
||||
|
||||
if(!empty($parms['limit']))
|
||||
{
|
||||
$treeparm['db_limit'] = '0, '.intval($parms['limit']);
|
||||
}
|
||||
|
||||
if(!empty($parms['order']))
|
||||
{
|
||||
$treeparm['db_order'] = e107::getParser()->toDb($parms['order']);
|
||||
}
|
||||
|
||||
$parms['return'] = true;
|
||||
|
||||
if(varset($parms['source']) == 'template')
|
||||
{
|
||||
$treeparm['db_where'] = 'FIND_IN_SET(6, n.news_render_type)';
|
||||
}
|
||||
|
||||
if(varset($parms['source']) == 'sticky')
|
||||
{
|
||||
$treeparm['db_where'] = 'n.news_sticky=1';
|
||||
}
|
||||
|
||||
$cached = $ntree->loadJoinActive(vartrue($parms['category'], 0), false, $treeparm)->render($template, $parms, $render);
|
||||
|
||||
e107::getCache()->set($cacheString, $cached);
|
||||
}
|
||||
|
||||
return $cached;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
|
@@ -1688,25 +1688,33 @@ i.e-cat_users-32{ background-position: -555px 0; width: 32px; height: 32px; }
|
||||
return $row['link_sub'];
|
||||
}
|
||||
|
||||
if(vartrue($row['link_function']))
|
||||
if(!empty($row['link_function']))
|
||||
{
|
||||
$parm = false;
|
||||
|
||||
list($path,$method) = explode("::",$row['link_function']);
|
||||
|
||||
if($path === 'theme')
|
||||
{
|
||||
$text = e107::callMethod('theme_shortcodes',$method, $row); // no parms as theme_shortcodes may be added as needed.
|
||||
|
||||
if(!empty($text))
|
||||
{
|
||||
return '<div class="dropdown-menu">'.$text.'</div>'; // @todo use template?
|
||||
}
|
||||
}
|
||||
|
||||
if(strpos($method,"("))
|
||||
{
|
||||
list($method,$prm) = explode("(",$method);
|
||||
$parm = rtrim($prm,")");
|
||||
}
|
||||
|
||||
|
||||
if(include_once(e_PLUGIN.$path."/e_sitelink.php"))
|
||||
{
|
||||
$class = $path."_sitelink";
|
||||
if($sublinkArray = e107::callMethod($class,$method,$parm,$row)) //TODO Cache it.
|
||||
{
|
||||
|
||||
|
||||
return $sublinkArray;
|
||||
}
|
||||
}
|
||||
|
@@ -79,6 +79,9 @@ define("LINKLAN_6", "Create sublinks from");
|
||||
define("LINKLAN_7", "Create sublinks under which link?");
|
||||
define("LINKLAN_8", "News Categories");
|
||||
define("LINKLAN_9", "Download Categories");
|
||||
|
||||
define("LINKLAN_10", "Theme Shortcodes");
|
||||
_
|
||||
// define("LINKLAN_10", "Create Sublink");
|
||||
// define('LINKLAN_11', 'Nothing changed - not updated');
|
||||
|
||||
|
@@ -293,3 +293,4 @@ define("PRFLAN_271", "Ignore form submissions containing these words or phrases.
|
||||
define("PRFLAN_272", "Session Lifetime");
|
||||
define("PRFLAN_273", "Lifetime in seconds. 0 = until the browser is closed. ");
|
||||
define("PRFLAN_274", "Contact form will only be visible to this userclass group.");
|
||||
define("PRFLAN_275", "View this page using https (SSL) to modify this option");
|
||||
|
@@ -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']))
|
||||
{
|
||||
|
@@ -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'
|
||||
);
|
||||
|
||||
|
@@ -39,12 +39,15 @@ class news_sitelink // include plugin-folder in the name.
|
||||
'name' => "Last 10 News Items",
|
||||
'function' => "last_ten",
|
||||
'description' => ""
|
||||
);
|
||||
);
|
||||
|
||||
|
||||
return $links;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function news_category_page()
|
||||
{
|
||||
return $this->news_category_list('category');
|
||||
@@ -110,14 +113,15 @@ class news_sitelink // include plugin-folder in the name.
|
||||
}
|
||||
|
||||
|
||||
function last_ten()
|
||||
function last_ten()
|
||||
{
|
||||
$sql = e107::getDb();
|
||||
$sublinks = array();
|
||||
|
||||
$nobody_regexp = "'(^|,)(".str_replace(",", "|", e_UC_NOBODY).")(,|$)'";
|
||||
$query = "SELECT * FROM #news WHERE news_class REGEXP '".e_CLASS_REGEXP."' AND NOT (news_class REGEXP ".$nobody_regexp.") ORDER BY news_datestamp DESC LIMIT 10";
|
||||
|
||||
|
||||
|
||||
if($sql->gen($query))
|
||||
{
|
||||
while($row = $sql->fetch())
|
||||
@@ -133,6 +137,8 @@ class news_sitelink // include plugin-folder in the name.
|
||||
'link_open' => '',
|
||||
'link_class' => intval($row['news_class'])
|
||||
);
|
||||
|
||||
|
||||
}
|
||||
|
||||
$sublinks[] = array(
|
||||
@@ -146,6 +152,9 @@ class news_sitelink // include plugin-folder in the name.
|
||||
'link_open' => '',
|
||||
'link_class' => intval($row['news_class'])
|
||||
);
|
||||
|
||||
|
||||
|
||||
|
||||
return $sublinks;
|
||||
};
|
||||
|
@@ -20,113 +20,8 @@ if (!defined('e107_INIT')) { exit; }
|
||||
* @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.
|
||||
*/
|
||||
$cacheString = 'nq_news_grid_menu_'.md5(serialize($parm));
|
||||
|
||||
$cached = e107::getCache()->retrieve($cacheString);
|
||||
|
||||
if(false === $cached)
|
||||
{
|
||||
e107::plugLan('news');
|
||||
|
||||
if(is_string($parm))
|
||||
{
|
||||
parse_str($parm, $parms);
|
||||
}
|
||||
else
|
||||
{
|
||||
$parms = $parm;
|
||||
|
||||
e107::getDebug()->log($parms);
|
||||
}
|
||||
|
||||
if(isset($parms['caption'][e_LANGUAGE]))
|
||||
{
|
||||
$parms['caption'] = $parms['caption'][e_LANGUAGE];
|
||||
}
|
||||
|
||||
if(!empty($parms['caption']) && defined($parms['caption']))
|
||||
{
|
||||
$parms['caption'] = constant($parms['caption']);
|
||||
}
|
||||
|
||||
|
||||
$ntree = e107::getObject('e_news_tree');
|
||||
|
||||
if($legacyTemplate = e107::getTemplate('news', 'news_menu', 'grid')) // BC
|
||||
{
|
||||
$template = $legacyTemplate;
|
||||
$parms['tmpl'] = 'news_menu';
|
||||
$parms['tmpl_key'] = 'grid';
|
||||
}
|
||||
else // New in v2.1.5
|
||||
{
|
||||
$tmpl = !empty($parms['layout']) ? $parms['layout'] : 'col-md-4';
|
||||
$template = e107::getTemplate('news', 'news_grid', $tmpl);
|
||||
$parms['tmpl'] = 'news_grid';
|
||||
$parms['tmpl_key'] = $tmpl;
|
||||
|
||||
}
|
||||
|
||||
// $gridSize = vartrue($parms['layout'],'col-md-4');
|
||||
|
||||
$parmSrch = array(
|
||||
'{NEWSGRID}',
|
||||
'_titleLimit_',
|
||||
'_summaryLimit_'
|
||||
);
|
||||
|
||||
$parmReplace = array(
|
||||
// $gridSize,
|
||||
// vartrue($parms['titleLimit'], 0),
|
||||
// vartrue($parms['summaryLimit'], 0)
|
||||
);
|
||||
|
||||
$template = str_replace($parmSrch , '', $template); // clean up deprecated elements.
|
||||
|
||||
$render = (empty($parms['caption'])) ? false: true;
|
||||
|
||||
|
||||
|
||||
if(empty($parms['count']))
|
||||
{
|
||||
$parms['count'] = 3;
|
||||
}
|
||||
|
||||
$parms['order'] = 'n.news_datestamp DESC';
|
||||
|
||||
|
||||
$treeparm = array();
|
||||
|
||||
if(!empty($parms['count']))
|
||||
{
|
||||
$treeparm['db_limit'] = '0, '.intval($parms['count']);
|
||||
}
|
||||
|
||||
if(!empty($parms['limit']))
|
||||
{
|
||||
$treeparm['db_limit'] = '0, '.intval($parms['limit']);
|
||||
}
|
||||
|
||||
if(!empty($parms['order']))
|
||||
{
|
||||
$treeparm['db_order'] = e107::getParser()->toDb($parms['order']);
|
||||
}
|
||||
|
||||
$parms['return'] = true;
|
||||
|
||||
if(varset($parms['source']) == 'template')
|
||||
{
|
||||
$treeparm['db_where'] = 'FIND_IN_SET(6, n.news_render_type)';
|
||||
}
|
||||
|
||||
if(varset($parms['source']) == 'sticky')
|
||||
{
|
||||
$treeparm['db_where'] = 'n.news_sticky=1';
|
||||
}
|
||||
|
||||
$cached = $ntree->loadJoinActive(vartrue($parms['category'], 0), false, $treeparm)->render($template, $parms, $render);
|
||||
|
||||
e107::getCache()->set($cacheString, $cached);
|
||||
}
|
||||
$cached = e107::getObject('news')->render_newsgrid($parm);
|
||||
|
||||
echo $cached;
|
||||
|
@@ -100,10 +100,15 @@
|
||||
<p>{NEWS_SUMMARY: limit=60}</p>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</ul>
|
||||
</div>';
|
||||
|
||||
|
||||
$NEWS_GRID_TEMPLATE['media-list']['end'] = '</div>';
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@@ -138,7 +138,7 @@ class page_shortcodes extends e_shortcode
|
||||
function sc_chapter_menus($parm=null)
|
||||
{
|
||||
$tp = e107::getParser();
|
||||
$query = "SELECT * FROM #page AS p LEFT JOIN #page_chapters as ch ON p.page_chapter=ch.chapter_id WHERE ch.chapter_visibility IN (" . USERCLASS_LIST . ") AND ch.chapter_sef = '" . $tp->filter($parm['name'],'str') . "' ORDER BY p.page_order ASC ";
|
||||
$query = "SELECT * FROM #page AS p LEFT JOIN #page_chapters as ch ON p.page_chapter=ch.chapter_id WHERE ch.chapter_visibility IN (" . USERCLASS_LIST . ") AND p.menu_class IN (" . USERCLASS_LIST . ") AND ch.chapter_sef = '" . $tp->filter($parm['name'],'str') . "' ORDER BY p.page_order ASC ";
|
||||
|
||||
$text = '';
|
||||
|
||||
|
@@ -575,7 +575,7 @@ if(!class_exists('plugin_pm_pm_shortcodes'))
|
||||
}
|
||||
|
||||
|
||||
if($parm != '')
|
||||
if(!empty($parm))
|
||||
{
|
||||
$extra = '.'.$parm;
|
||||
}
|
||||
|
@@ -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>';
|
@@ -344,4 +344,6 @@ div.login-page-signup-link, div.login-page-fpw-link { text-align:center }
|
||||
|
||||
/* Navigation */
|
||||
.nav-side.listgroup { padding-left:0; }
|
||||
.nav-side li.list-group-item.active { padding:0}
|
||||
.nav-side li.list-group-item.active { padding:0}
|
||||
|
||||
|
||||
|
196
search.php
196
search.php
@@ -51,7 +51,8 @@ class search extends e_shortcode
|
||||
private $auto_order = 1000;
|
||||
private $enhanced = false;
|
||||
private $query = null;
|
||||
private $result_flag = 0;
|
||||
private $doSearch = false;
|
||||
private $result_flag = 0; // same as 'from'
|
||||
private $message = '';
|
||||
public $template = array();
|
||||
private $enhancedTypes = array(
|
||||
@@ -746,6 +747,7 @@ class search extends e_shortcode
|
||||
|
||||
function renderResults()
|
||||
{
|
||||
|
||||
global $query, $search_prefs, $pre_title, $search_chars, $search_res, $result_flag, $advanced_caption;
|
||||
|
||||
$ns = e107::getRender();
|
||||
@@ -778,7 +780,7 @@ class search extends e_shortcode
|
||||
$search_chars = $this->search_info[$key]['chars'];
|
||||
$search_res = $this->search_info[$key]['results'];
|
||||
|
||||
if(vartrue($this->search_info[$key]['sfile']) && file_exists($this->search_info[$key]['sfile'])) // Legacy
|
||||
if(!empty($this->search_info[$key]['sfile']) && file_exists($this->search_info[$key]['sfile'])) // Legacy
|
||||
{
|
||||
$text .= '<div class="search-block">';
|
||||
require_once($this->search_info[$key]['sfile']);
|
||||
@@ -884,6 +886,7 @@ class search extends e_shortcode
|
||||
global $perform_search;
|
||||
$tp = e107::getParser();
|
||||
$sql = e107::getDb();
|
||||
|
||||
|
||||
if (isset($_GET['q']) || isset($_GET['in']) || isset($_GET['ex']) || isset($_GET['ep']) || isset($_GET['beg']))
|
||||
{
|
||||
@@ -892,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'])
|
||||
{
|
||||
@@ -931,7 +934,7 @@ class search extends e_shortcode
|
||||
{
|
||||
$perform_search = false;
|
||||
$this->message = LAN_SEARCH_201;
|
||||
$this->result_flag = 0;
|
||||
$this->result_flag = false;
|
||||
}
|
||||
else if (strlen($full_query) == 0)
|
||||
{
|
||||
@@ -968,23 +971,29 @@ class search extends e_shortcode
|
||||
}
|
||||
}
|
||||
|
||||
if ($perform_search)
|
||||
|
||||
|
||||
$this->query = trim($full_query);
|
||||
|
||||
if ($this->query)
|
||||
{
|
||||
$this->result_flag = intval($_GET['r']);
|
||||
$this->doSearch = true;
|
||||
}
|
||||
|
||||
$query = trim($full_query);
|
||||
|
||||
$this->query = $query;
|
||||
|
||||
return $query;
|
||||
|
||||
return $this->query;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function doSearch()
|
||||
{
|
||||
return $this->doSearch;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -993,101 +1002,11 @@ $srchObj = new search;
|
||||
$search_info = $srchObj->getConfig();
|
||||
$search_prefs = $srchObj->getPrefs();
|
||||
|
||||
// validate search query
|
||||
$perform_search = true;
|
||||
|
||||
// simple parse object
|
||||
$SEARCH_VARS = new e_vars();
|
||||
|
||||
/*
|
||||
function magic_search($data) {
|
||||
foreach ($data as $key => $value) {
|
||||
if (is_array($value)) {
|
||||
$data[$key] = magic_search($value);
|
||||
} else {
|
||||
$data[$key] = stripslashes($value);
|
||||
}
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
|
||||
if (!e_QUERY) {
|
||||
$enhanced = true;
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
|
||||
if (isset($_GET['q']) || isset($_GET['in']) || isset($_GET['ex']) || isset($_GET['ep']) || isset($_GET['beg'])) {
|
||||
if (MAGIC_QUOTES_GPC == true) {
|
||||
$_GET = magic_search($_GET);
|
||||
}
|
||||
$full_query = $_GET['q'];
|
||||
if ($_GET['in']) {
|
||||
$en_in = explode(' ', $_GET['in']);
|
||||
foreach ($en_in as $en_in_key) {
|
||||
$full_query .= " +".$en_in_key;
|
||||
}
|
||||
$enhanced = true;
|
||||
}
|
||||
if ($_GET['ex']) {
|
||||
$en_ex = explode(' ', $_GET['ex']);
|
||||
foreach ($en_ex as $en_ex_key) {
|
||||
$full_query .= " -".$en_ex_key;
|
||||
}
|
||||
$enhanced = true;
|
||||
}
|
||||
if ($_GET['ep']) {
|
||||
$full_query .= " \"".$_GET['ep']."\"";
|
||||
$enhanced = true;
|
||||
}
|
||||
if ($_GET['be']) {
|
||||
$en_be = explode(' ', $_GET['be']);
|
||||
foreach ($en_be as $en_be_key) {
|
||||
$full_query .= " ".$en_be_key."*";
|
||||
}
|
||||
$enhanced = true;
|
||||
}
|
||||
|
||||
if (isset($_GET['r']) && !is_numeric($_GET['r'])) {
|
||||
$perform_search = false;
|
||||
$SEARCH_VARS->SEARCH_MESSAGE = LAN_SEARCH_201;
|
||||
$result_flag = 0;
|
||||
} else if (strlen($full_query) == 0) {
|
||||
$perform_search = false;
|
||||
$SEARCH_VARS->SEARCH_MESSAGE = LAN_SEARCH_201;
|
||||
}
|
||||
elseif (strlen($full_query) < ($char_count = ($search_prefs['mysql_sort'] ? 4 : 3)))
|
||||
{
|
||||
$perform_search = false;
|
||||
$SEARCH_VARS->SEARCH_MESSAGE = str_replace('--CHARS--', $char_count, LAN_417);
|
||||
}
|
||||
elseif ($search_prefs['time_restrict']) {
|
||||
$time = time() - $search_prefs['time_secs'];
|
||||
$query_check = $tp -> toDB($full_query);
|
||||
$ip = e107::getIPHandler()->getIP(FALSE);
|
||||
if ($sql -> db_Select("tmp", "tmp_ip, tmp_time, tmp_info", "tmp_info LIKE 'type_search%' AND tmp_ip='".$ip."'")) {
|
||||
$row = $sql -> db_Fetch();
|
||||
if (($row['tmp_time'] > $time) && ($row['tmp_info'] != 'type_search '.$query_check)) {
|
||||
$perform_search = false;
|
||||
$SEARCH_VARS->SEARCH_MESSAGE = LAN_SEARCH_17.$search_prefs['time_secs'].LAN_SEARCH_18;
|
||||
} else {
|
||||
$sql -> db_Update("tmp", "tmp_time='".time()."', tmp_info='type_search ".$query_check."' WHERE tmp_info LIKE 'type_search%' AND tmp_ip='".$ip."'");
|
||||
}
|
||||
} else {
|
||||
$sql -> db_Insert("tmp", "'".$ip."', '".time()."', 'type_search ".$query_check."'");
|
||||
}
|
||||
}
|
||||
if ($perform_search) {
|
||||
$result_flag = $_GET['r'];
|
||||
}
|
||||
$query = trim($full_query);
|
||||
}*/
|
||||
|
||||
|
||||
$query = $srchObj->searchQuery();
|
||||
|
||||
|
||||
$perform_search = $srchObj->doSearch();
|
||||
$perform_search = true;
|
||||
// forward user if searching in google
|
||||
$search_count = count($search_info);
|
||||
$google_id = $search_count + 1;
|
||||
@@ -1118,77 +1037,6 @@ if ($perform_search)
|
||||
|
||||
$searchtype = $srchObj->searchType();
|
||||
|
||||
|
||||
|
||||
|
||||
// determine areas being searched
|
||||
/*
|
||||
if (!$search_prefs['user_select'] && $_GET['r'] < 1) {
|
||||
foreach($search_info as $key => $value) {
|
||||
$searchtype[$key] = true;
|
||||
}
|
||||
} else {
|
||||
if (isset($_GET['t'])) {
|
||||
if (is_array($_GET['t'])) {
|
||||
$searchtype = $_GET['t'];
|
||||
} else {
|
||||
$searchtype[$_GET['t']] = true;
|
||||
}
|
||||
} else {
|
||||
if (isset($_GET['ref'])) {
|
||||
foreach($search_info as $key => $value) {
|
||||
if ($value['id'] == $_GET['ref']) {
|
||||
$searchtype[$key] = true;
|
||||
$_GET['t'] = $key;
|
||||
}
|
||||
}
|
||||
} else if (e_QUERY) {
|
||||
if (isset($_SERVER['HTTP_REFERER'])) {
|
||||
if (!$refpage = substr($_SERVER['HTTP_REFERER'], (strrpos($_SERVER['HTTP_REFERER'], "/")+1))) {
|
||||
$refpage = "index.php";
|
||||
}
|
||||
} else {
|
||||
$refpage = "";
|
||||
}
|
||||
|
||||
foreach($search_info as $key => $value) {
|
||||
if ($value['refpage']) {
|
||||
if (strpos($refpage, $value['refpage']) !== FALSE) {
|
||||
$searchtype[$key] = true;
|
||||
$_GET['t'] = $key;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!isset($searchtype) && isset($query)) {
|
||||
if ($search_prefs['multisearch']) {
|
||||
$searchtype['all'] = true;
|
||||
} else {
|
||||
$searchtype[0] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
//$value = isset($_GET['q']) ? $tp -> post_toForm($_GET['q']) : "";
|
||||
//$SEARCH_VARS->SEARCH_MAIN_SEARCHFIELD = "<input class='tbox m_search' type='text' id='q' name='q' size='35' value='".$value."' maxlength='50' />";
|
||||
|
||||
|
||||
/*
|
||||
if ($search_prefs['selector'] == 1)
|
||||
{
|
||||
$SEARCH_VARS->SEARCH_MAIN_CHECKALL = "<input type='button' name='CheckAll' value='".LAN_SEARCH_1."' onclick='checkAll(this);' />";
|
||||
$SEARCH_VARS->SEARCH_MAIN_UNCHECKALL = "<input type='button' name='UnCheckAll' value='".LAN_SEARCH_2."' onclick='uncheckAll(this); uncheckG();' />";
|
||||
}
|
||||
*/
|
||||
//$SEARCH_VARS->SEARCH_MAIN_SUBMIT = "<input type='hidden' name='r' value='0' /><input type='submit' name='s' value='".LAN_SEARCH."' />";
|
||||
|
||||
//$SEARCH_VARS->ENHANCED_ICON = "<img src='".e_IMAGE_ABS."generic/search_basic.png' style='width: 16px; height: 16px; vertical-align: top'
|
||||
//alt='".LAN_SEARCH_23."' title='".LAN_SEARCH_23."' onclick=\"expandit('en_in'); expandit('en_ex'); expandit('en_ep'); expandit('en_be')\"/>";
|
||||
|
||||
$enhanced_types['in'] = LAN_SEARCH_24.':';
|
||||
$enhanced_types['ex'] = LAN_SEARCH_25.':';
|
||||
$enhanced_types['ep'] = LAN_SEARCH_26.':';
|
||||
|
Reference in New Issue
Block a user