diff --git a/class2.php b/class2.php
index 21d3ec376..cf380eb03 100644
--- a/class2.php
+++ b/class2.php
@@ -226,7 +226,7 @@ e107_require_once($tmp.'/e107_class.php');
unset($tmp);
$e107_paths = compact('ADMIN_DIRECTORY', 'FILES_DIRECTORY', 'IMAGES_DIRECTORY', 'THEMES_DIRECTORY', 'PLUGINS_DIRECTORY', 'HANDLERS_DIRECTORY', 'LANGUAGES_DIRECTORY', 'HELP_DIRECTORY', 'DOWNLOADS_DIRECTORY','UPLOADS_DIRECTORY','SYSTEM_DIRECTORY', 'MEDIA_DIRECTORY','CACHE_DIRECTORY','LOGS_DIRECTORY', 'CORE_DIRECTORY', 'WEB_DIRECTORY');
-$sql_info = compact('mySQLserver', 'mySQLuser', 'mySQLpassword', 'mySQLdefaultdb', 'mySQLprefix');
+$sql_info = compact('mySQLserver', 'mySQLuser', 'mySQLpassword', 'mySQLdefaultdb', 'mySQLprefix', 'mySQLport');
$e107 = e107::getInstance()->initCore($e107_paths, realpath(dirname(__FILE__)), $sql_info, varset($E107_CONFIG, array()));
e107::getSingleton('eIPHandler'); // This auto-handles bans etc
diff --git a/e107_admin/footer.php b/e107_admin/footer.php
index 7fc7279f8..dacce49e9 100644
--- a/e107_admin/footer.php
+++ b/e107_admin/footer.php
@@ -447,68 +447,6 @@ $page = $ehd->getOutput();
echo $page;
-/*
-
-
-$etag = md5($page);
-
-if (isset($_SERVER['HTTP_IF_NONE_MATCH']))
-{
- $IF_NONE_MATCH = str_replace('"','',$_SERVER['HTTP_IF_NONE_MATCH']);
-
- $data = "IF_NON_MATCH = ".$IF_NONE_MATCH;
- $data .= "\nEtag = ".$etag;
- //file_put_contents(e_ADMIN."etag_log.txt",$data);
-
-
- if($IF_NONE_MATCH == $etag || ($IF_NONE_MATCH == ($etag."-gzip")))
- {
- header('HTTP/1.1 304 Not Modified');
- exit();
- }
-}
-
-
-header("Cache-Control: max-age=5,no-cache",true); // XXX testing 'always on' state for now.
-if(!defined('e_NOCACHE'))
-{
- // header("Cache-Control: must-revalidate");
-}
-
-
-$pref['compression_level'] = 6;
-if (strstr(varset($_SERVER["HTTP_ACCEPT_ENCODING"], ""), "gzip"))
-{
-// $browser_support = true;
-}
-if (ini_get("zlib.output_compression") == false && function_exists("gzencode"))
-{
-// $server_support = true;
-}
-if (varset($pref['compress_output'], false) && $server_support == true && $browser_support == true)
-{
- $level = intval($pref['compression_level']);
- header("ETag: \"{$etag}-gzip\"");
- $page = gzencode($page, $level);
- header("Content-Encoding: gzip", true);
- header("Content-Length: ".strlen($page), true);
- echo $page;
-}
-else
-{
- if($browser_support==TRUE)
- {
- header("ETag: \"{$etag}-gzip\"");
- }
- else
- {
- header("ETag: \"{$etag}\"");
- }
-
- header("Content-Length: ".strlen($page), true);
- echo $page;
-}*/
-
unset($In_e107_Footer);
$e107_Clean_Exit = TRUE; // For registered shutdown function -- let it know all is well!
?>
\ No newline at end of file
diff --git a/e107_admin/image.php b/e107_admin/image.php
index 52fe544db..15ba59d1c 100644
--- a/e107_admin/image.php
+++ b/e107_admin/image.php
@@ -1478,7 +1478,7 @@ class media_admin_ui extends e_admin_ui
$data = array();
$data['items'][0]['id']['videoId'] = $searchQry;
- $data['items'][0]['snippet']['thumbnails']['medium']['url'] = "http://i.ytimg.com/vi/".$searchQry."/mqdefault.jpg";
+ $data['items'][0]['snippet']['thumbnails']['medium']['url'] = "https://i.ytimg.com/vi/".$searchQry."/mqdefault.jpg";
$data['items'][0]['snippet']['title'] = 'Specified Video';
}
elseif(substr($searchQry,0,9) == 'playlist:') // playlist
@@ -1633,7 +1633,7 @@ class media_admin_ui extends e_admin_ui
}
- $fileName = str_replace('%','',$fileName);
+ $fileName = str_replace(array('%','+'),'',$fileName);
// remove script extensions.
if(substr($fileName,-4) == ".php" || substr($fileName,-4) == ".htm" || substr($fileName,-5) == ".html" || substr($fileName,-4) == ".asp")
diff --git a/e107_admin/meta.php b/e107_admin/meta.php
index c5fe2ae52..4f3c7e814 100644
--- a/e107_admin/meta.php
+++ b/e107_admin/meta.php
@@ -79,7 +79,7 @@ $text = "
".LAN_DESCRIPTION." |
";
- $text .= $frm->textarea('meta_description',$tp->toForm(varset($meta_diz[e_LANGUAGE])),3);
+ $text .= $frm->textarea('meta_description',$tp->toForm(varset($meta_diz[e_LANGUAGE])),3,80, array('size'=>'xxlarge'));
// $text .= "";
$text .= " |
diff --git a/e107_admin/plugin.php b/e107_admin/plugin.php
index 9174ec71f..0311cd50d 100644
--- a/e107_admin/plugin.php
+++ b/e107_admin/plugin.php
@@ -3887,6 +3887,7 @@ $text .= "
public function customPage()
{
\$text = 'Hello World!';
+ \$otherField = \$this->getController()->getFieldVar('other_field_name');
return \$text;
}
diff --git a/e107_core/shortcodes/batch/news_shortcodes.php b/e107_core/shortcodes/batch/news_shortcodes.php
index 9c2fbdde6..bf2ff3cc0 100644
--- a/e107_core/shortcodes/batch/news_shortcodes.php
+++ b/e107_core/shortcodes/batch/news_shortcodes.php
@@ -560,12 +560,12 @@ class news_shortcodes extends e_shortcode
$breaks = array('
','
');
$text = str_replace($breaks,"\n",$text);
$text = strip_tags($text);
- $tmp = preg_split('/(\.\s|!|\r|\n|\?)/i', trim($text));
+ $tmp = preg_split('/(\.\s|!|\r|\n|\?)/i', trim($text), 2, PREG_SPLIT_DELIM_CAPTURE);
$tmp = array_filter($tmp);
-
+
if($tmp[0])
{
- $text = trim($tmp[0]);
+ $text = trim($tmp[0]).trim($tmp[1]);
}
}
@@ -612,6 +612,7 @@ class news_shortcodes extends e_shortcode
{
$src = $vThumb;
$_src = '#';
+ $dimensions = e107::getParser()->thumbDimensions();
}
else
{
diff --git a/e107_core/shortcodes/batch/page_shortcodes.php b/e107_core/shortcodes/batch/page_shortcodes.php
index de44cb641..4fd859c8f 100644
--- a/e107_core/shortcodes/batch/page_shortcodes.php
+++ b/e107_core/shortcodes/batch/page_shortcodes.php
@@ -301,6 +301,21 @@ class cpage_shortcodes extends e_shortcode
// print_a($this);
return e107::getParser()->toHTML($this->var['menu_text'], true, 'BODY');
}
+
+ /**
+ * @param null $parm
+ * @example {CMENUURL}
+ * @return string
+ */
+ function sc_cmenuurl($parm=null)
+ {
+ if(empty($this->var['menu_button_url']))
+ {
+ return $this->sc_cpageurl();
+ }
+
+ return e107::getParser()->replaceConstants($this->var['menu_button_url']);
+ }
function sc_cmenuimage($parm='')
@@ -534,8 +549,13 @@ class cpage_shortcodes extends e_shortcode
{
$array['types'] = 'page,news';
}
-
- return e107::getForm()->renderRelated($array, $this->var['page_metakeys'], array('page'=>$this->var['page_id']));
+
+ $templateID = vartrue($this->var['page_template'],'default');
+
+ $template = e107::getCoreTemplate('page', $templateID);
+
+
+ return e107::getForm()->renderRelated($array, $this->var['page_metakeys'], array('page'=>$this->var['page_id']), $template['related']);
}
diff --git a/e107_core/templates/header_default.php b/e107_core/templates/header_default.php
index 750f4b68f..f36fc0cdf 100644
--- a/e107_core/templates/header_default.php
+++ b/e107_core/templates/header_default.php
@@ -141,8 +141,10 @@ else
if(vartrue($pref['meta_copyright'][e_LANGUAGE])) e107::meta('dcterms.rights',$pref['meta_copyright'][e_LANGUAGE]);
if(vartrue($pref['meta_author'][e_LANGUAGE])) e107::meta('author',$pref['meta_author'][e_LANGUAGE]);
-if($pref['sitebutton']) e107::meta('og:image',$tp->replaceConstants($pref['sitelogo'],'full'));
-if(defined("VIEWPORT")) e107::meta('viewport',VIEWPORT); //BC ONLY
+$siteButton = (strpos($pref['sitelogo'],'{e_MEDIA') !== false) ? $tp->thumbUrl($pref['sitelogo'],'w=800',false, true) : $tp->replaceConstants($pref['sitelogo'],'full');
+if($pref['sitebutton']) e107::meta('og:image',$siteButton);
+if(defined("VIEWPORT")) e107::meta('viewport',VIEWPORT); //BC ONLY
+unset($siteButton);
// Load Plugin Header Files, allow them to load CSS/JSS/Meta via JS Manager early enouhg
diff --git a/e107_core/templates/navigation_template.php b/e107_core/templates/navigation_template.php
index a8ccbf8de..79d80cc48 100644
--- a/e107_core/templates/navigation_template.php
+++ b/e107_core/templates/navigation_template.php
@@ -97,13 +97,13 @@ $NAVIGATION_TEMPLATE['main']['submenu_end'] = '';
$NAVIGATION_TEMPLATE['side']['start'] = '
@@ -128,9 +128,9 @@ $NAVIGATION_TEMPLATE['side']['submenu_end'] = '';
// Footer links. - ie. 3 columns of links.
$NAVIGATION_TEMPLATE["footer"]["start"] = "\n";
$NAVIGATION_TEMPLATE["footer"]["submenu_start"] = "";
$NAVIGATION_TEMPLATE["footer"]["submenu_item"] = "- {LINK_ICON}{LINK_NAME}
\n";
diff --git a/e107_core/templates/page_template.php b/e107_core/templates/page_template.php
index 817b577e0..574d721d0 100644
--- a/e107_core/templates/page_template.php
+++ b/e107_core/templates/page_template.php
@@ -94,8 +94,18 @@ $sc_style['CPAGENAV|default']['post'] = '';
// define different tablerender mode here
$PAGE_TEMPLATE['default']['tableRender'] = 'cpage';
+
+
+ $PAGE_TEMPLATE['default']['related']['start'] = '{SETIMAGE: w=350&h=350&crop=1}{LAN=LAN_RELATED}
';
+ $PAGE_TEMPLATE['default']['related']['item'] = '
';
+ $PAGE_TEMPLATE['default']['related']['end'] = '
';
+
+
+
#### No table render example template ####
+
+
$PAGE_TEMPLATE['custom']['start'] = '';
$PAGE_TEMPLATE['custom']['body'] = '';
$PAGE_TEMPLATE['custom']['authorize'] = '
diff --git a/e107_handlers/admin_ui.php b/e107_handlers/admin_ui.php
index 80efe6213..e36597212 100644
--- a/e107_handlers/admin_ui.php
+++ b/e107_handlers/admin_ui.php
@@ -2773,6 +2773,31 @@ class e_admin_controller_ui extends e_admin_controller
return $this->_model;
}
+
+ /**
+ * Alias for getModel()->get and getListModel()->get().
+ * May be used inside field-method in read/write mode.
+ *
+ * @param string $key
+ * @return mixed|null - current value of the chosen db field.
+ */
+ public function getFieldVar($key = null)
+ {
+ if(empty($key))
+ {
+ return null;
+ }
+
+ if($this->getAction() == 'list')
+ {
+ return $this->getListModel()->get($key);
+ }
+
+ return $this->getModel()->get($key);
+
+ }
+
+
/**
* Set controller model
* @param e_admin_model $model
diff --git a/e107_handlers/db_verify_class.php b/e107_handlers/db_verify_class.php
index 63519d029..7942a3ba1 100644
--- a/e107_handlers/db_verify_class.php
+++ b/e107_handlers/db_verify_class.php
@@ -201,6 +201,13 @@ class db_verify
$this->currentTable = $selection;
+ if(!isset($this->tables[$selection])) // doesn't have an SQL file.
+ {
+ // e107::getMessage()->addDebug("No SQL File for ".$selection);
+ return false;
+ }
+
+
if(empty($this->tables[$selection]['tables']))
{
//$this->internalError = true;
diff --git a/e107_handlers/form_handler.php b/e107_handlers/form_handler.php
index fe7cd402e..4cb13d7f5 100644
--- a/e107_handlers/form_handler.php
+++ b/e107_handlers/form_handler.php
@@ -157,6 +157,298 @@ class e_form
}
+ /**
+ * Render a country drop-down list.
+ * @param string $name
+ * @param string $value
+ * @param array $options
+ * @return string
+ */
+ public function country($name, $value, $options=array())
+ {
+
+ $arr = $this->getCountry();
+
+ $placeholder = isset($options['placeholder']) ? $options['placeholder'] : ' ';
+
+ return $this->select($name, $arr, $value, $options, $placeholder);
+ }
+
+
+ /**
+ * Get a list of countries.
+ * @param null $iso
+ */
+ public function getCountry($iso=null) // move to parser?
+ {
+
+ $c = array();
+
+ $c['af'] = "Afghanistan";
+ $c['al'] = "Albania";
+ $c['dz'] = "Algeria";
+ $c['as'] = "American Samoa";
+ $c['ad'] = "Andorra";
+ $c['ao'] = "Angola";
+ $c['ai'] = "Anguilla";
+ $c['aq'] = "Antarctica";
+ $c['ag'] = "Antigua and Barbuda";
+ $c['ar'] = "Argentina";
+ $c['am'] = "Armenia";
+ $c['aw'] = "Aruba";
+ $c['au'] = "Australia";
+ $c['at'] = "Austria";
+ $c['az'] = "Azerbaijan";
+ $c['bs'] = "Bahamas";
+ $c['bh'] = "Bahrain";
+ $c['bd'] = "Bangladesh";
+ $c['bb'] = "Barbados";
+ $c['by'] = "Belarus";
+ $c['be'] = "Belgium";
+ $c['bz'] = "Belize";
+ $c['bj'] = "Benin";
+ $c['bm'] = "Bermuda";
+ $c['bt'] = "Bhutan";
+ $c['bo'] = "Bolivia";
+ $c['ba'] = "Bosnia-Herzegovina";
+ $c['bw'] = "Botswana";
+ $c['bv'] = "Bouvet Island";
+ $c['br'] = "Brazil";
+ $c['io'] = "British Indian Ocean Territory";
+ $c['bn'] = "Brunei Darussalam";
+ $c['bg'] = "Bulgaria";
+ $c['bf'] = "Burkina Faso";
+ $c['bi'] = "Burundi";
+ $c['kh'] = "Cambodia";
+ $c['cm'] = "Cameroon";
+ $c['ca'] = "Canada";
+
+ $c['cv'] = "Cape Verde";
+ $c['ky'] = "Cayman Islands";
+ $c['cf'] = "Central African Republic";
+ $c['td'] = "Chad";
+ $c['cl'] = "Chile";
+ $c['cn'] = "China";
+ $c['cx'] = "Christmas Island";
+ $c['cc'] = "Cocos (Keeling) Islands";
+ $c['co'] = "Colombia";
+ $c['km'] = "Comoros";
+ $c['cg'] = "Congo";
+ $c['cd'] = "Congo (Dem.Rep)";
+ $c['ck'] = "Cook Islands";
+ $c['cr'] = "Costa Rica";
+ $c['hr'] = "Croatia";
+ $c['cu'] = "Cuba";
+ $c['cy'] = "Cyprus";
+ $c['cz'] = "Czech Republic";
+ $c['dk'] = "Denmark";
+ $c['dj'] = "Djibouti";
+ $c['dm'] = "Dominica";
+ $c['do'] = "Dominican Republic";
+ $c['tp'] = "East Timor";
+ $c['ec'] = "Ecuador";
+ $c['eg'] = "Egypt";
+ $c['sv'] = "El Salvador";
+ $c['gq'] = "Equatorial Guinea";
+ $c['er'] = "Eritrea";
+ $c['ee'] = "Estonia";
+ $c['et'] = "Ethiopia";
+ $c['fk'] = "Falkland Islands";
+ $c['fo'] = "Faroe Islands";
+ $c['fj'] = "Fiji";
+ $c['fi'] = "Finland";
+ // $c['cs'] = "Former Czechoslovakia";
+ // $c['su'] = "Former USSR";
+ $c['fr'] = "France";
+ // $c['fx'] = "France (European Territory)";
+ $c['gf'] = "French Guyana";
+ $c['tf'] = "French Southern Territories";
+ $c['ga'] = "Gabon";
+ $c['gm'] = "Gambia";
+ $c['ge'] = "Georgia";
+ $c['de'] = "Germany";
+ $c['gh'] = "Ghana";
+ $c['gi'] = "Gibraltar";
+ $c['gr'] = "Greece";
+ $c['gl'] = "Greenland";
+ $c['gd'] = "Grenada";
+ $c['gp'] = "Guadeloupe (French)";
+ $c['gu'] = "Guam (USA)";
+ $c['gt'] = "Guatemala";
+ $c['gn'] = "Guinea";
+ $c['gw'] = "Guinea Bissau";
+ $c['gy'] = "Guyana";
+ $c['ht'] = "Haiti";
+ $c['hm'] = "Heard and McDonald Islands";
+ $c['hn'] = "Honduras";
+ $c['hk'] = "Hong Kong";
+ $c['hu'] = "Hungary";
+ $c['is'] = "Iceland";
+ $c['in'] = "India";
+ $c['id'] = "Indonesia";
+ $c['ir'] = "Iran";
+ $c['iq'] = "Iraq";
+ $c['ie'] = "Ireland";
+ $c['il'] = "Israel";
+ $c['it'] = "Italy";
+ $c['ci'] = "Ivory Coast (Cote D'Ivoire)";
+ $c['jm'] = "Jamaica";
+ $c['jp'] = "Japan";
+ $c['jo'] = "Jordan";
+ $c['kz'] = "Kazakhstan";
+ $c['ke'] = "Kenya";
+ $c['ki'] = "Kiribati";
+ $c['kp'] = "Korea (North)";
+ $c['kr'] = "Korea (South)";
+ $c['kw'] = "Kuwait";
+ $c['kg'] = "Kyrgyzstan";
+ $c['la'] = "Laos";
+ $c['lv'] = "Latvia";
+ $c['lb'] = "Lebanon";
+ $c['ls'] = "Lesotho";
+ $c['lr'] = "Liberia";
+ $c['ly'] = "Libya";
+ $c['li'] = "Liechtenstein";
+ $c['lt'] = "Lithuania";
+ $c['lu'] = "Luxembourg";
+ $c['mo'] = "Macau";
+ $c['mk'] = "Macedonia";
+ $c['mg'] = "Madagascar";
+ $c['mw'] = "Malawi";
+ $c['my'] = "Malaysia";
+ $c['mv'] = "Maldives";
+ $c['ml'] = "Mali";
+ $c['mt'] = "Malta";
+ $c['mh'] = "Marshall Islands";
+ $c['mq'] = "Martinique (French)";
+ $c['mr'] = "Mauritania";
+ $c['mu'] = "Mauritius";
+ $c['yt'] = "Mayotte";
+ $c['mx'] = "Mexico";
+ $c['fm'] = "Micronesia";
+ $c['md'] = "Moldavia";
+ $c['mc'] = "Monaco";
+ $c['mn'] = "Mongolia";
+ $c['me'] = "Montenegro";
+ $c['ms'] = "Montserrat";
+ $c['ma'] = "Morocco";
+ $c['mz'] = "Mozambique";
+ $c['mm'] = "Myanmar";
+ $c['na'] = "Namibia";
+ $c['nr'] = "Nauru";
+ $c['np'] = "Nepal";
+ $c['nl'] = "Netherlands";
+ $c['an'] = "Netherlands Antilles";
+ // $c['net'] = "Network";
+
+ $c['nc'] = "New Caledonia (French)";
+ $c['nz'] = "New Zealand";
+ $c['ni'] = "Nicaragua";
+ $c['ne'] = "Niger";
+ $c['ng'] = "Nigeria";
+ $c['nu'] = "Niue";
+ $c['nf'] = "Norfolk Island";
+
+ $c['mp'] = "Northern Mariana Islands";
+ $c['no'] = "Norway";
+ // $c['arpa'] = "Old style Arpanet";
+ $c['om'] = "Oman";
+ $c['pk'] = "Pakistan";
+ $c['pw'] = "Palau";
+ $c['pa'] = "Panama";
+ $c['pg'] = "Papua New Guinea";
+ $c['py'] = "Paraguay";
+ $c['pe'] = "Peru";
+ $c['ph'] = "Philippines";
+ $c['pn'] = "Pitcairn Island";
+ $c['pl'] = "Poland";
+ $c['pf'] = "Polynesia (French)";
+ $c['pt'] = "Portugal";
+ $c['pr'] = "Puerto Rico";
+ $c['ps'] = "Palestine";
+ $c['qa'] = "Qatar";
+ $c['re'] = "Reunion (French)";
+ $c['ro'] = "Romania";
+ $c['ru'] = "Russia";
+ $c['rw'] = "Rwanda";
+ $c['gs'] = "S. Georgia & S. Sandwich Isls.";
+ $c['sh'] = "Saint Helena";
+ $c['kn'] = "Saint Kitts & Nevis";
+ $c['lc'] = "Saint Lucia";
+ $c['pm'] = "Saint Pierre and Miquelon";
+ $c['st'] = "Saint Tome (Sao Tome) and Principe";
+ $c['vc'] = "Saint Vincent & Grenadines";
+ $c['ws'] = "Samoa";
+ $c['sm'] = "San Marino";
+ $c['sa'] = "Saudi Arabia";
+ $c['sn'] = "Senegal";
+ $c['rs'] = "Serbia";
+ $c['sc'] = "Seychelles";
+ $c['sl'] = "Sierra Leone";
+ $c['sg'] = "Singapore";
+ $c['sk'] = "Slovak Republic";
+ $c['si'] = "Slovenia";
+ $c['sb'] = "Solomon Islands";
+ $c['so'] = "Somalia";
+ $c['za'] = "South Africa";
+
+ $c['es'] = "Spain";
+ $c['lk'] = "Sri Lanka";
+ $c['sd'] = "Sudan";
+ $c['sr'] = "Suriname";
+ $c['sj'] = "Svalbard and Jan Mayen Islands";
+ $c['sz'] = "Swaziland";
+ $c['se'] = "Sweden";
+ $c['ch'] = "Switzerland";
+ $c['sy'] = "Syria";
+ $c['tj'] = "Tadjikistan";
+ $c['tw'] = "Taiwan";
+ $c['tz'] = "Tanzania";
+ $c['th'] = "Thailand";
+ $c['ti'] = "Tibet";
+ $c['tg'] = "Togo";
+ $c['tk'] = "Tokelau";
+ $c['to'] = "Tonga";
+ $c['tt'] = "Trinidad and Tobago";
+ $c['tn'] = "Tunisia";
+ $c['tr'] = "Turkey";
+ $c['tm'] = "Turkmenistan";
+ $c['tc'] = "Turks and Caicos Islands";
+ $c['tv'] = "Tuvalu";
+ $c['ug'] = "Uganda";
+ $c['ua'] = "Ukraine";
+ $c['ae'] = "United Arab Emirates";
+ $c['gb'] = "United Kingdom";
+ $c['us'] = "United States";
+ $c['uy'] = "Uruguay";
+ $c['um'] = "US Minor Outlying Islands";
+ $c['uz'] = "Uzbekistan";
+ $c['vu'] = "Vanuatu";
+ $c['va'] = "Vatican City State";
+ $c['ve'] = "Venezuela";
+ $c['vn'] = "Vietnam";
+ $c['vg'] = "Virgin Islands (British)";
+ $c['vi'] = "Virgin Islands (USA)";
+ $c['wf'] = "Wallis and Futuna Islands";
+ $c['eh'] = "Western Sahara";
+ $c['ye'] = "Yemen";
+
+ // $c['zr'] = "(deprecated) Zaire";
+ $c['zm'] = "Zambia";
+ $c['zw'] = "Zimbabwe";
+
+
+ if(!empty($iso) && !empty($c[$iso]))
+ {
+ return $c[$iso];
+ }
+
+
+ return $c;
+
+ }
+
+
/**
* Get required field markup string
* @return string
@@ -312,21 +604,28 @@ class e_form
$text ='
-
-
-
- ';
+ ';
- $c = 0;
- foreach($array as $key=>$tab)
+ if(count($array) > 1)
{
- $active = ($c == $act) ? ' class="active"' : '';
- $text .= '
';
- $c++;
+ $text .= '
+
+
+ ';
+
+ $c = 0;
+ foreach($array as $key=>$tab)
+ {
+ $active = ($c == $act) ? ' class="active"' : '';
+ $text .= '';
+ $c++;
+ }
+
+ $text .= '
+
';
}
-
+
$text .= '
-
';
@@ -350,15 +649,18 @@ class e_form
$text .= '
';
-
- $text .= '
-
-
-
-
-
- ';
-
+
+ if(count($array) > 1)
+ {
+ $text .= '
+
+
+
+
+
+ ';
+ }
+
$text .= '
';
return $text;
@@ -3463,7 +3765,7 @@ class e_form
$text = "$true, 1=>$false) : array(0=>$false, 1=>$true);
$dispValue = $wparms[$value];
- return $this->renderInline($field, $id, $attributes['title'], $value, $dispValue, 'select', $wparms);
+ return $this->renderInline($field, $id, $attributes['title'], $value, $dispValue, 'select', $wparms, array('class'=>'e-editable-boolean'));
}
if(vartrue($parms['reverse']))
diff --git a/e107_handlers/mysql_class.php b/e107_handlers/mysql_class.php
index 67ed5e5c8..172f0f378 100644
--- a/e107_handlers/mysql_class.php
+++ b/e107_handlers/mysql_class.php
@@ -69,9 +69,10 @@ class e_db_mysql
{
// TODO switch to protected vars where needed
public $mySQLserver;
- public $mySQLuser;
+ public $mySQLuser;
protected $mySQLpassword;
protected $mySQLdefaultdb;
+ protected $mySQLport = 3306;
public $mySQLPrefix;
protected $mySQLaccess;
public $mySQLresult;
@@ -83,7 +84,7 @@ class e_db_mysql
protected $mySQLlastQuery = '';
public $mySQLcurTable;
- public $mySQLlanguage;
+ public $mySQLlanguage;
public $mySQLinfo;
public $tabset;
public $mySQLtableList = array(); // list of all Db tables.
@@ -99,6 +100,7 @@ class e_db_mysql
private $pdo = false; // using PDO or not.
+
/**
* Constructor - gets language options from the cookie or session
* @access public
@@ -113,11 +115,16 @@ class e_db_mysql
{
$this->pdo = true;
}
-
+
e107::getSingleton('e107_traffic')->BumpWho('Create db object', 1);
$this->mySQLPrefix = MPREFIX; // Set the default prefix - may be overridden
+ if($port = e107::getMySQLConfig('port'))
+ {
+ $this->mySQLport = intval($port);
+ }
+
/*$langid = (isset($pref['cookie_name'])) ? 'e107language_'.$pref['cookie_name'] : 'e107language_temp';
if (isset($pref['user_tracking']) && ($pref['user_tracking'] == 'session'))
{
@@ -182,7 +189,7 @@ class e_db_mysql
{
try
{
- $this->mySQLaccess = new PDO("mysql:host=".$this->mySQLserver."; port=3306", $this->mySQLuser, $this->mySQLpassword, array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION));
+ $this->mySQLaccess = new PDO("mysql:host=".$this->mySQLserver."; port=".$this->mySQLport, $this->mySQLuser, $this->mySQLpassword, array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION));
}
catch(PDOException $ex)
@@ -266,12 +273,17 @@ class e_db_mysql
$this->mySQLuser = $mySQLuser;
$this->mySQLpassword = $mySQLpassword;
$this->mySQLerror = false;
+
+ if(strpos($mySQLserver,':')!==false)
+ {
+ list($this->mySQLserver,$this->mySQLport) = explode(':',$mySQLserver,2);
+ }
if($this->pdo) // PDO
{
try
{
- $this->mySQLaccess = new PDO("mysql:host=".$this->mySQLserver."; port=3306", $this->mySQLuser, $this->mySQLpassword, array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION));
+ $this->mySQLaccess = new PDO("mysql:host=".$this->mySQLserver."; port=".$this->mySQLport, $this->mySQLuser, $this->mySQLpassword, array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION));
}
catch(PDOException $ex)
{
diff --git a/e107_handlers/plugin_class.php b/e107_handlers/plugin_class.php
index 5ede03b5d..d076f36b9 100644
--- a/e107_handlers/plugin_class.php
+++ b/e107_handlers/plugin_class.php
@@ -2255,7 +2255,8 @@ class e107plugin
//print_a($tag);
switch ($function)
{
- case 'install':
+ case 'install':
+ case 'refresh':
$c = 1;
foreach($tag['mediaCategories']['category'] as $v)
{
diff --git a/e107_handlers/sitelinks_class.php b/e107_handlers/sitelinks_class.php
index 5a0581f70..bb1cdd6d4 100644
--- a/e107_handlers/sitelinks_class.php
+++ b/e107_handlers/sitelinks_class.php
@@ -1826,6 +1826,14 @@ class navigation_shortcodes extends e_shortcode
*/
function sc_link_description($parm='')
{
+ $toolTipEnabled = e107::pref('core', 'linkpage_screentip', false);
+
+ if($toolTipEnabled == false || empty($this->var['link_description']))
+ {
+ return null;
+ }
+
+
return e107::getParser()->toAttribute($this->var['link_description']);
}
diff --git a/e107_languages/English/lan_news.php b/e107_languages/English/lan_news.php
index e75839e82..d7807b579 100644
--- a/e107_languages/English/lan_news.php
+++ b/e107_languages/English/lan_news.php
@@ -43,6 +43,7 @@ define("LAN_NEWS_85", "Back to category overview");
define("LAN_NEWS_86", "Older News");
define("LAN_NEWS_87", "Newer News");
define("LAN_NEWS_462", "No news items for specified month");
+define("LAN_NEWS_463", "There are no news items for the specified category - please check back soon.");
// Following used by alt_news
// define("LAN_NEWS_99", "Comments");
diff --git a/e107_plugins/banner/e_shortcode.php b/e107_plugins/banner/e_shortcode.php
index b6707a257..37f6d0e7c 100644
--- a/e107_plugins/banner/e_shortcode.php
+++ b/e107_plugins/banner/e_shortcode.php
@@ -91,8 +91,9 @@ class banner_shortcodes extends e_shortcode
$src = e_IMAGE_ABS.'banners/'.$row['banner_image'];
$style = "'border:0'";
}
- // Somehow, can't use vartrue core function when referencing $parm['class'], gives bug....
- $ban_ret = $tp->toImage($src, array('class'=>($parm['class'] == ''?"e-banner img-responsive img-rounded":$parm['class']) , 'alt'=>$row['banner_clickurl'], 'style'=>$style));
+ // Somehow, can't use vartrue core function when referencing $parm['class'], gives bug...
+ $class = empty($parm['class']) ? "e-banner img-responsive" : $parm['class'];
+ $ban_ret = $tp->toImage($src, array('class'=> $class , 'alt'=>$row['banner_clickurl'], 'style'=>$style));
break;
}
diff --git a/e107_plugins/download/includes/admin.php b/e107_plugins/download/includes/admin.php
index f02627cbb..28e8735ea 100644
--- a/e107_plugins/download/includes/admin.php
+++ b/e107_plugins/download/includes/admin.php
@@ -1699,7 +1699,7 @@ $columnInfo = array(
$dlInfo['download_comment'] = $tp->toDB($_POST['download_comment']);
$dlInfo['download_class'] = $tp->toDB($_POST['download_class']);
$dlInfo['download_visible'] = $tp->toDB($_POST['download_visible']);
- $dlInfo['download_datestamp'] = e107::getDate()->convert($_POST['download_datestamp'],'inputdate');
+ $dlInfo['download_datestamp'] = intval($_POST['download_datestamp']);
if($_POST['update_datestamp'])
diff --git a/e107_plugins/forum/forum_viewtopic.php b/e107_plugins/forum/forum_viewtopic.php
index d3c0f8e68..d3af3edc9 100644
--- a/e107_plugins/forum/forum_viewtopic.php
+++ b/e107_plugins/forum/forum_viewtopic.php
@@ -473,6 +473,10 @@ $i = $thread->page;
//---- Moved upwards, to enclose $tVars...
//---- $sc = e107::getScBatch('view', 'forum');
+ $mes = e107::getMessage();
+// $sc->setVars($thread->threadInfo);
+//--->$forend = $tp->simpleParse($FORUMEND, $tVars);
+$forend = $tp->parseTemplate($FORUMEND, true, $sc);
foreach ($postList as $c => $postInfo)
@@ -538,6 +542,7 @@ foreach ($postList as $c => $postInfo)
}
unset($loop_uid);
+/*---->
if ($forum->checkPerm($thread->threadInfo['thread_forum_id'], 'post') && $thread->threadInfo['thread_active'])
{
//XXX Show only on the last page??
@@ -578,11 +583,14 @@ if ($forum->checkPerm($thread->threadInfo['thread_forum_id'], 'post') && $thread
$tVars->QUICKREPLY = $forum_quickreply;
}
}
+<----*/
-
+/*--->
$mes = e107::getMessage();
-$forend = $tp->simpleParse($FORUMEND, $tVars);
-
+ $sc->setVars($thread->threadInfo);
+//--->$forend = $tp->simpleParse($FORUMEND, $tVars);
+$forend = $tp->parseTemplate($FORUMEND, true, $sc);
+<---*/
$forumstring = $forstr . $forthr . vartrue($forrep) . $forend;
//If last post came after USERLV and not yet marked as read, mark the thread id as read
@@ -899,7 +907,7 @@ class e107ForumThread
$ns = e107::getRender();
$sql = e107::getDb();
$tp = e107::getParser();
- $frm = e107::getForm();
+//Orphan $frm variable???? $frm = e107::getForm();
if (empty($_GET['f']))
{
diff --git a/e107_plugins/forum/shortcodes/batch/view_shortcodes.php b/e107_plugins/forum/shortcodes/batch/view_shortcodes.php
index 63044ee45..1031f8720 100644
--- a/e107_plugins/forum/shortcodes/batch/view_shortcodes.php
+++ b/e107_plugins/forum/shortcodes/batch/view_shortcodes.php
@@ -885,5 +885,51 @@ function sc_message()
return $thread->message;
}
+ function sc_quickreply()
+ {
+ global $forum, $forum_quickreply;
+
+if ($forum->checkPerm($this->var['thread_forum_id'], 'post') && $this->var['thread_active'])
+{
+ //XXX Show only on the last page??
+ if (!vartrue($forum_quickreply))
+ {
+ $ajaxInsert = ($thread->pages == $thread->page || $thread->pages == 0) ? 1 : 0;
+ // $ajaxInsert = 1;
+ // echo "AJAX-INSERT=".$ajaxInsert ."(".$thread->pages." vs ".$thread->page.")";
+//Orphan $frm variable???? $frm = e107::getForm();
+
+ $urlParms = array('f'=>'rp','id'=>$this->var['thread_id'], 'post'=>$this->var['thread_id']);
+ $url = e107::url('forum','post', null, array('query'=>$urlParms));; // ."?f=rp&id=".$thread->threadInfo['thread_id']."&post=".$thread->threadInfo['thread_id'];
+
+ return "
+ ";
+
+ if(E107_DEBUG_LEVEL > 0)
+ {
+ // echo "Thread id: ".$threadId."
";
+ // print_a($this);
+ }
+
+
+
+ // Preview should be reserved for the full 'Post reply' page.
+ }
+//---- else
+//---- {
+ return $forum_quickreply;
+//---- }
+}
+ }
+
}
?>
\ No newline at end of file
diff --git a/e107_plugins/gallery/e_header.php b/e107_plugins/gallery/e_header.php
index 46c02e2e8..a07192ab2 100644
--- a/e107_plugins/gallery/e_header.php
+++ b/e107_plugins/gallery/e_header.php
@@ -13,19 +13,21 @@ if(!defined('e107_INIT'))
if(USER_AREA)
{
-// Work-around for indent issue. see: https://github.com/twitter/bootstrap/issues/4890
- e107::css('inline', "
-/* Gallery CSS */
-.thumbnails .span2:nth-child(6n+1) {
-margin-left:0;
-}", 'jquery');
-}
+ // Work-around for indent issue. see: https://github.com/twitter/bootstrap/issues/4890
+ e107::css('inline', "
+ /* Gallery CSS */
+ .thumbnails .span2:nth-child(6n+1) {
+ margin-left:0;
+ }", 'jquery');
-$plugPrefs = e107::getPlugConfig('gallery')->getPref();
-if(vartrue($plugPrefs['pp_global'], false))
-{
- e107_require_once(e_PLUGIN . 'gallery/includes/gallery_load.php');
- // Load prettyPhoto settings and files.
- gallery_load_prettyphoto();
+ $plugPrefs = e107::getPlugConfig('gallery')->getPref();
+
+ if(vartrue($plugPrefs['pp_global'], false))
+ {
+ e107_require_once(e_PLUGIN . 'gallery/includes/gallery_load.php');
+ // Load prettyPhoto settings and files.
+ gallery_load_prettyphoto();
+ }
+
}
diff --git a/e107_plugins/news/templates/news_menu_template.php b/e107_plugins/news/templates/news_menu_template.php
index e7886f93f..4b4c12dc7 100644
--- a/e107_plugins/news/templates/news_menu_template.php
+++ b/e107_plugins/news/templates/news_menu_template.php
@@ -19,7 +19,7 @@ global $sc_style;
$NEWS_MENU_TEMPLATE['category']['start'] = '';
$NEWS_MENU_TEMPLATE['category']['item'] = '
-
+
';
$NEWS_MENU_WRAPPER['category']['NEWS_CATEGORY_NEWS_COUNT'] = "({---})"; // Wrap brackets around the news count when value is returned.
@@ -34,7 +34,7 @@ $NEWS_MENU_WRAPPER['category']['NEWS_CATEGORY_NEWS_COUNT'] = "({---})"; // Wrap
$NEWS_MENU_TEMPLATE['months']['start'] = '';
$NEWS_MENU_TEMPLATE['months']['item'] = '
-
+
';
//$NEWS_MENU_TEMPLATE['months']['separator'] = '
';
@@ -46,7 +46,7 @@ $NEWS_MENU_TEMPLATE['months']['item'] = '
// latest menu
$NEWS_MENU_TEMPLATE['latest']['start'] = ''; // Example: $NEWS_MENU_TEMPLATE['latest']['end'] '
{currentTotal} from {total}';
-$NEWS_MENU_TEMPLATE['latest']['item'] = '';
+$NEWS_MENU_TEMPLATE['latest']['item'] = '';
$NEWS_MENU_WRAPPER['latest']['NEWSCOMMENTCOUNT'] = "({---})";
diff --git a/e107_plugins/page/e_sitelink.php b/e107_plugins/page/e_sitelink.php
index 5c1bb8cbb..d2d951b99 100644
--- a/e107_plugins/page/e_sitelink.php
+++ b/e107_plugins/page/e_sitelink.php
@@ -65,10 +65,22 @@ class page_sitelink // include plugin-folder in the name.
'description' => "A list of all chapters from the book ".$row['chapter_name']
);
}
+
+ $chaps = $sql->retrieve("SELECT * FROM #page_chapters WHERE chapter_parent !=0 ORDER BY chapter_order ASC" , true);
+
+ foreach($chaps as $row)
+ {
+ $links[] = array(
+ 'name' => "All Pages from ".$row['chapter_name'],
+ 'function' => "pagesFromChapter",
+ 'parm' => $row['chapter_id'],
+ 'description' => "A list of all pages from the chapter ".$row['chapter_name']
+ );
+ }
$links[] = array(
'name' => "All Pages",
- 'function' => "pageNav",
+ 'function' => "pageList",
'parm' => "",
'description' => "A list of all pages"
);
@@ -83,7 +95,66 @@ class page_sitelink // include plugin-folder in the name.
{
return $this->pageNav('book=0');
}
-
+
+ public function pagesFromChapter($id)
+ {
+
+ return $this->pageList($id);
+ }
+
+
+ private function pageList($parm)
+ {
+ $sql = e107::getDb();
+ $arr = array();
+
+
+ if(!empty($parm))
+ {
+ $query = "SELECT * FROM `#page` WHERE page_class IN (".USERCLASS_LIST.") AND page_chapter = ".intval($parm)." ORDER BY page_order ASC" ;
+ }
+ else
+ {
+ $query = "SELECT * FROM `#page` WHERE page_class IN (".USERCLASS_LIST.") ORDER BY page_order ASC" ;
+ }
+
+ $pages = $sql->retrieve($query, true);
+
+ foreach($pages as $row)
+ {
+ $chapter_parent = $this->getParent($row['page_chapter']);
+
+ $row['book_sef'] = $this->getSef($chapter_parent);
+
+ $row['chapter_sef'] = $this->getSef($row['page_chapter']);
+
+ if(!vartrue($row['chapter_sef']))
+ {
+ // $row['chapter_sef'] = '--sef-not-assigned--';
+ }
+
+ $arr[] = array(
+ 'link_id' => $row['page_id'],
+ 'link_name' => $row['page_title'] ? $row['page_title'] : 'No title', // FIXME lan
+ 'link_url' => e107::getUrl()->create('page/view', $row, array('allow' => 'page_sef,page_title,page_id,chapter_sef,book_sef')),
+ 'link_description' => '',
+ // 'link_button' => $row['menu_image'],
+ 'link_category' => '',
+ 'link_order' => $row['page_order'],
+ 'link_parent' => $row['page_chapter'],
+ 'link_open' => '',
+ 'link_class' => intval($row['page_class']),
+ 'link_active' => (isset($options['cpage']) && $row['page_id'] == $options['cpage']),
+ 'link_identifier' => 'page-nav-'.intval($row['page_id']) // used for css id.
+
+ );
+
+ }
+
+ return $arr;
+
+ }
+
/**
* Return a list of all chapters from a sepcific book.
*/
diff --git a/e107_plugins/social/font/fontello.woff2 b/e107_plugins/social/font/fontello.woff2
new file mode 100644
index 000000000..1246d0947
Binary files /dev/null and b/e107_plugins/social/font/fontello.woff2 differ
diff --git a/e107_plugins/tinymce4/tinymce4_setup.php b/e107_plugins/tinymce4/tinymce4_setup.php
index b76f52111..a0c5ae5eb 100644
--- a/e107_plugins/tinymce4/tinymce4_setup.php
+++ b/e107_plugins/tinymce4/tinymce4_setup.php
@@ -19,7 +19,7 @@ class tinymce4_setup
{
$list = e107::getConfig()->get('e_meta_list');
- if(in_array('tinymce4',$list))
+ if(!empty($list) && in_array('tinymce4',$list))
{
return true;
}
diff --git a/e107_web/css/backcompat.css b/e107_web/css/backcompat.css
index 4c4de2ad5..f97d9c145 100644
--- a/e107_web/css/backcompat.css
+++ b/e107_web/css/backcompat.css
@@ -21,4 +21,6 @@ mark { text-decoration: underline; color:#FF0000; font-weight:bold; }
.list-unstyled { list-style: outside none none; }
#login-template { width:60%; max-width:350px; margin-right:auto;margin-left:auto; }
-div.form-group { padding-top: 5px }
\ No newline at end of file
+div.form-group { padding-top: 5px }
+
+div.news-empty { text-align:center; font-weight: bold }
\ No newline at end of file
diff --git a/news.php b/news.php
index 43abf8960..03dbb4abb 100644
--- a/news.php
+++ b/news.php
@@ -411,7 +411,7 @@ e107::getDebug()->log("PageTitle: ".e_PAGETITLE);
}
else // No News - empty.
{
- $text .= "".(strstr(e_QUERY, "month") ? LAN_NEWS_462 : LAN_NEWS_83)."
";
+ $text .= "".(strstr(e_QUERY, "month") ? LAN_NEWS_462 : LAN_NEWS_83)."
";
}
if(vartrue($template['end']))
@@ -624,6 +624,8 @@ $order = $tp -> toDB($order, true); /// @todo - try not to use toDB() - trigge
$interval = $pref['newsposts'];
+
+
switch ($action)
{
case "list" :
@@ -639,6 +641,8 @@ switch ($action)
AND n.news_start < ".time()." AND (n.news_end=0 || n.news_end>".time().")
AND n.news_category={$sub_action}
ORDER BY n.news_sticky DESC,".$order." DESC LIMIT ".intval($newsfrom).",".ITEMVIEW;
+
+ $noNewsMessage = LAN_NEWS_463;
break;
@@ -669,8 +673,11 @@ switch ($action)
WHERE n.news_id={$sub_action} AND n.news_class REGEXP '".e_CLASS_REGEXP."' AND NOT (n.news_class REGEXP ".$nobody_regexp.")
AND n.news_start < ".time()." AND (n.news_end=0 || n.news_end>".time().")";
}
+
+ $noNewsMessage = LAN_NEWS_83;
break;
+
case "month" :
case "day" :
$item = $tp -> toDB($sub_action).'20000101';
@@ -700,6 +707,9 @@ switch ($action)
AND n.news_start < ".time()." AND (n.news_end=0 || n.news_end>".time().")
AND (FIND_IN_SET('0', n.news_render_type) OR FIND_IN_SET(1, n.news_render_type)) AND n.news_datestamp BETWEEN {$startdate} AND {$enddate}
ORDER BY ".$order." DESC LIMIT ".intval($newsfrom).",".ITEMVIEW;
+
+ $noNewsMessage = LAN_NEWS_462;
+
break;
case 'default' :
@@ -743,6 +753,8 @@ switch ($action)
AND (FIND_IN_SET('0', n.news_render_type) OR FIND_IN_SET(1, n.news_render_type))
ORDER BY n.news_sticky DESC, ".$order." DESC LIMIT ".intval($newsfrom).",".ITEMVIEW;
}
+
+ $noNewsMessage = LAN_NEWS_83;
} // END - switch($action)
@@ -780,10 +792,10 @@ if($newsCachedPage = checkCache($cacheString)) // normal news front-page - with
}
-if (!($news_total = $sql->db_Select_gen($query)))
+if (!($news_total = $sql->gen($query)))
{ // No news items
require_once(HEADERF);
- echo "
".(strstr(e_QUERY, "month") ? LAN_NEWS_462 : LAN_NEWS_83)."
";
+ echo "";
require_once(FOOTERF);
exit;
}