diff --git a/e107_admin/cpage.php b/e107_admin/cpage.php
index f0d2f439a..7c97fe88e 100644
--- a/e107_admin/cpage.php
+++ b/e107_admin/cpage.php
@@ -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();
diff --git a/e107_admin/lancheck.php b/e107_admin/lancheck.php
index db287749d..0ee9f9a0c 100644
--- a/e107_admin/lancheck.php
+++ b/e107_admin/lancheck.php
@@ -1749,7 +1749,7 @@ class lancheck
$editUrl = e_REQUEST_SELF."?".http_build_query($parms,'&');
- $text .= "".LAN_EDIT." "; // href='".e_REQUEST_URI."&f=".$comp_dir."/languages/".$lnk."&lan=".$target_lan."&type={$mode}'
+ $text .= "".LAN_EDIT." "; // href='".e_REQUEST_URI."&f=".$comp_dir."/languages/".$lnk."&lan=".$target_lan."&type={$mode}'
// ".LAN_EDIT."";
diff --git a/e107_admin/links.php b/e107_admin/links.php
index d3d7252f3..585fd50d8 100644
--- a/e107_admin/links.php
+++ b/e107_admin/links.php
@@ -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
diff --git a/e107_admin/prefs.php b/e107_admin/prefs.php
index d1252d7ad..fbee9061d 100644
--- a/e107_admin/prefs.php
+++ b/e107_admin/prefs.php
@@ -1274,19 +1274,28 @@ $text .= "
";
- 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'])."
- ".PRFLAN_61."
+ | ";
+
+ 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 .= " ".PRFLAN_61." ";
+ }
+ else
+ {
+ $text .= "".PRFLAN_275." ";
+ }
+
+ $text .= "
|
";
- }
+
// Secure Image/ Captcha
$secureImage = array('signcode'=>PRFLAN_76, 'logcode'=>PRFLAN_81, "fpwcode"=>PRFLAN_138,'admincode'=>PRFLAN_222);
diff --git a/e107_admin/search.php b/e107_admin/search.php
index 578d985e5..d2e0697a9 100644
--- a/e107_admin/search.php
+++ b/e107_admin/search.php
@@ -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';
diff --git a/e107_admin/users.php b/e107_admin/users.php
index 8ec870817..a1ace3946 100644
--- a/e107_admin/users.php
+++ b/e107_admin/users.php
@@ -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']);
diff --git a/e107_core/shortcodes/batch/news_shortcodes.php b/e107_core/shortcodes/batch/news_shortcodes.php
index aaebd4dab..df9e0fa6b 100644
--- a/e107_core/shortcodes/batch/news_shortcodes.php
+++ b/e107_core/shortcodes/batch/news_shortcodes.php
@@ -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)
diff --git a/e107_handlers/news_class.php b/e107_handlers/news_class.php
index 8caf8a3eb..0481a4273 100644
--- a/e107_handlers/news_class.php
+++ b/e107_handlers/news_class.php
@@ -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;
+
+ }
+
+
}
diff --git a/e107_handlers/search_class.php b/e107_handlers/search_class.php
index 63051d666..9dab98f14 100644
--- a/e107_handlers/search_class.php
+++ b/e107_handlers/search_class.php
@@ -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();
}
diff --git a/e107_handlers/sitelinks_class.php b/e107_handlers/sitelinks_class.php
index 518bcc7ea..983275abb 100644
--- a/e107_handlers/sitelinks_class.php
+++ b/e107_handlers/sitelinks_class.php
@@ -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 ''; // @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;
}
}
diff --git a/e107_languages/English/admin/lan_links.php b/e107_languages/English/admin/lan_links.php
index 10c2502c9..2aea65ae0 100644
--- a/e107_languages/English/admin/lan_links.php
+++ b/e107_languages/English/admin/lan_links.php
@@ -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');
diff --git a/e107_languages/English/admin/lan_prefs.php b/e107_languages/English/admin/lan_prefs.php
index 31de62304..dbb63c8c7 100644
--- a/e107_languages/English/admin/lan_prefs.php
+++ b/e107_languages/English/admin/lan_prefs.php
@@ -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");
diff --git a/e107_plugins/download/e_search.php b/e107_plugins/download/e_search.php
index 4afe14adb..606cada13 100644
--- a/e107_plugins/download/e_search.php
+++ b/e107_plugins/download/e_search.php
@@ -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']))
{
diff --git a/e107_plugins/news/e_search.php b/e107_plugins/news/e_search.php
index 4ce337c77..632c31eb1 100644
--- a/e107_plugins/news/e_search.php
+++ b/e107_plugins/news/e_search.php
@@ -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'
);
diff --git a/e107_plugins/news/e_sitelink.php b/e107_plugins/news/e_sitelink.php
index 2465a0098..36f327204 100644
--- a/e107_plugins/news/e_sitelink.php
+++ b/e107_plugins/news/e_sitelink.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;
};
diff --git a/e107_plugins/news/news_grid_menu.php b/e107_plugins/news/news_grid_menu.php
index eac4a9706..1d20b0cfa 100644
--- a/e107_plugins/news/news_grid_menu.php
+++ b/e107_plugins/news/news_grid_menu.php
@@ -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;
diff --git a/e107_plugins/news/templates/news_grid_template.php b/e107_plugins/news/templates/news_grid_template.php
index 87caeadb5..9e28fcaa8 100644
--- a/e107_plugins/news/templates/news_grid_template.php
+++ b/e107_plugins/news/templates/news_grid_template.php
@@ -100,10 +100,15 @@
{NEWS_SUMMARY: limit=60}
-
+
';
$NEWS_GRID_TEMPLATE['media-list']['end'] = '';
+
+
+
+
+
diff --git a/e107_plugins/page/e_shortcode.php b/e107_plugins/page/e_shortcode.php
index 68145a6b6..9e0b0df7f 100644
--- a/e107_plugins/page/e_shortcode.php
+++ b/e107_plugins/page/e_shortcode.php
@@ -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 = '';
diff --git a/e107_plugins/pm/pm_shortcodes.php b/e107_plugins/pm/pm_shortcodes.php
index d2f2fc912..c31fe8fbe 100644
--- a/e107_plugins/pm/pm_shortcodes.php
+++ b/e107_plugins/pm/pm_shortcodes.php
@@ -575,7 +575,7 @@ if(!class_exists('plugin_pm_pm_shortcodes'))
}
- if($parm != '')
+ if(!empty($parm))
{
$extra = '.'.$parm;
}
diff --git a/e107_plugins/social/e_shortcode.php b/e107_plugins/social/e_shortcode.php
index dd126be4c..e95a9b092 100644
--- a/e107_plugins/social/e_shortcode.php
+++ b/e107_plugins/social/e_shortcode.php
@@ -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'),
diff --git a/e107_plugins/social/templates/social_template.php b/e107_plugins/social/templates/social_template.php
deleted file mode 100644
index 7eb8dd47b..000000000
--- a/e107_plugins/social/templates/social_template.php
+++ /dev/null
@@ -1,17 +0,0 @@
-';
- $SOCIAL_TEMPLATE['xurl_icons']['item'] = '';
- $SOCIAL_TEMPLATE['xurl_icons']['end'] = '';
\ No newline at end of file
diff --git a/e107_plugins/social/templates/social_xurl_template.php b/e107_plugins/social/templates/social_xurl_template.php
new file mode 100644
index 000000000..c566a489d
--- /dev/null
+++ b/e107_plugins/social/templates/social_xurl_template.php
@@ -0,0 +1,17 @@
+';
+ $SOCIAL_XURL_TEMPLATE['default']['item'] = '';
+ $SOCIAL_XURL_TEMPLATE['default']['end'] = '';
\ No newline at end of file
diff --git a/e107_web/css/e107.css b/e107_web/css/e107.css
index 159318aef..b1eadb866 100644
--- a/e107_web/css/e107.css
+++ b/e107_web/css/e107.css
@@ -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}
\ No newline at end of file
+.nav-side li.list-group-item.active { padding:0}
+
+
diff --git a/search.php b/search.php
index ddf75225f..4a0d067d6 100644
--- a/search.php
+++ b/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 .= '';
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 = "
";
-
-
-/*
-if ($search_prefs['selector'] == 1)
-{
- $SEARCH_VARS->SEARCH_MAIN_CHECKALL = "
";
- $SEARCH_VARS->SEARCH_MAIN_UNCHECKALL = "
";
-}
-*/
-//$SEARCH_VARS->SEARCH_MAIN_SUBMIT = "
";
-
-//$SEARCH_VARS->ENHANCED_ICON = "

";
-
$enhanced_types['in'] = LAN_SEARCH_24.':';
$enhanced_types['ex'] = LAN_SEARCH_25.':';
$enhanced_types['ep'] = LAN_SEARCH_26.':';