diff --git a/e107_admin/admin.php b/e107_admin/admin.php
index d2f33c6e3..86cf3ad19 100644
--- a/e107_admin/admin.php
+++ b/e107_admin/admin.php
@@ -138,7 +138,7 @@ class admin_start
$this->deleteDeprecated();
}
-
+ $this->checkNewInstall();
$this->checkPaths();
$this->checkTimezone();
$this->checkWritable();
@@ -197,6 +197,43 @@ class admin_start
}
+ /**
+ *
+ */
+ private function checkNewInstall()
+ {
+
+ $upgradeAlertFlag = e_CACHE.'dismiss.upgrade.alert.txt';
+
+ if(!empty($_GET['dismiss']) && $_GET['dismiss'] == 'upgrade')
+ {
+ file_put_contents($upgradeAlertFlag,'true');
+ }
+
+ $pref = e107::getPref('install_date');
+
+ $v2ReleaseDate = strtotime('August 27, 2015');
+
+ $numDays = (abs($pref - time())/60/60/24);
+
+ if($numDays < 3) // installed in the past 3 days.
+ {
+ echo e107::getMessage()->setTitle('Need Help?',E_MESSAGE_INFO)->addInfo("
Connect with our community for free support with any e107 issues you may encounter.
")->render();
+ }
+ elseif($pref < $v2ReleaseDate && !file_exists($upgradeAlertFlag)) // installed prior to v2 release.
+ {
+ $message = "Connect with our community for free support with any upgrading issues you may encounter.";
+ $message .= ""; //todo do it with class=e-ajax and data-dismiss='alert'
+ echo e107::getMessage()->setTitle('Upgrading?',E_MESSAGE_INFO)->addInfo($message)->render();
+ }
+
+ e107::getMessage()->setTitle(null,E_MESSAGE_INFO);
+
+
+ }
+
+
+
function checkWritable()
{
$mes = e107::getMessage();
diff --git a/e107_admin/header.php b/e107_admin/header.php
index 601603e27..873da70bf 100644
--- a/e107_admin/header.php
+++ b/e107_admin/header.php
@@ -336,12 +336,22 @@ $jslib->renderHeader('admin', false);
e107::getJs()->renderJs('header', 2);
e107::getJs()->renderJs('header_inline', 2);
-//DEPRECATED - use e107::getJs()->headerFile('{e_PLUGIN}myplug/js/my.js', $zone = 2)
-if (isset($eplug_js) && $eplug_js)
+/* @deprecated -use e107::js('myplug','js/my.js') instead; */
+if (!empty($eplug_js))
{
- e107::getMessage()->addDebug('Deprecated $eplug_js method detected. Use e107::js() function inside an e_header.php file instead.'.print_a($eplug_js,true));
+ e107::getMessage()->addDebug('Deprecated $eplug_js method detected. Use e107::js() function inside an e_header.php file instead.'.print_a($eplug_js,true));
echo "\n\n";
- echo "\n";
+
+ if(!is_array($eplug_js))
+ {
+ $eplug_js = array($eplug_js);
+ }
+
+ foreach($eplug_js as $vjss)
+ {
+ echo "\n";
+ }
+
}
//FIXME - theme.js/user.js should be registered/rendered through e_jsmanager
diff --git a/e107_core/url/user/rewrite_url.php b/e107_core/url/user/rewrite_url.php
index 8566b3cd3..f0e31a309 100644
--- a/e107_core/url/user/rewrite_url.php
+++ b/e107_core/url/user/rewrite_url.php
@@ -92,7 +92,8 @@ class core_user_rewrite_url extends eUrlConfig
$sql = e107::getDb('url');
$name = e107::getParser()->toDB($name);
- if($sql->select('user', 'user_id', "user_name='{$name}'")) // XXX - new user_sef field? Discuss.
+
+ if($sql->select('user', 'user_id', "user_name='{$name}' OR REPLACE(user_name, ' ', '-') ='{$name}' " )) // XXX - new user_sef field? Discuss.
{
$name = $sql->fetch();
$request->setRequestParam('id', $name['user_id']);
diff --git a/e107_handlers/application.php b/e107_handlers/application.php
index d6d20ea76..24456f072 100644
--- a/e107_handlers/application.php
+++ b/e107_handlers/application.php
@@ -2402,7 +2402,7 @@ class eUrlRule
if(is_array($route)) $route = implode('/', $route);
-
+
$tr = array();
if ($route !== $this->route)
@@ -2472,18 +2472,24 @@ class eUrlRule
}
}
}
-
+
+ $tp = e107::getParser();
+ $urlFormat = e107::getConfig()->get('url_sef_translate');
+
foreach ($this->params as $key => $value)
{
// FIX - non-latin URLs proper encoded
- $tr["<$key>"] = rawurlencode($params[$key]);
+ $tr["<$key>"] = rawurlencode($params[$key]); //todo transliterate non-latin
+ // $tr["<$key>"] = eHelper::title2sef($tp->toASCII($params[$key]), $urlFormat); // enabled to test.
unset($params[$key]);
}
$suffix = $this->urlSuffix === null ? $manager->urlSuffix : $this->urlSuffix;
// XXX TODO Find better place for this check which will affect all types of SEF URL configurations. (@see news/sef_noid_url.php for duplicate)
- $urlFormat = e107::getConfig()->get('url_sef_translate');
+
+
+
if($urlFormat == 'dashl' || $urlFormat == 'underscorel' || $urlFormat == 'plusl') // convert template to lowercase when using lowercase SEF URL format.
{
@@ -2491,7 +2497,13 @@ class eUrlRule
}
$url = strtr($this->template, $tr);
-
+
+ // Work-around fix for lowercase username
+ if($urlFormat == 'dashl' && $this->route == 'profile/view')
+ {
+ $url = str_replace('%20','-', strtolower($url));
+ }
+
if(empty($params))
{
return $url !== '' ? $url.$suffix : $url;
@@ -4359,7 +4371,7 @@ class eHelper
*/
public static function title2sef($title, $type = null)
{
- $char_map = array(
+ /*$char_map = array(
// Latin
'À' => 'A', 'Á' => 'A', 'Â' => 'A', 'Ã' => 'A', 'Ä' => 'A', 'Å' => 'A', 'Æ' => 'AE', 'Ç' => 'C',
'È' => 'E', 'É' => 'E', 'Ê' => 'E', 'Ë' => 'E', 'Ì' => 'I', 'Í' => 'I', 'Î' => 'I', 'Ï' => 'I',
@@ -4416,9 +4428,11 @@ class eHelper
'Š' => 'S', 'Ū' => 'u', 'Ž' => 'Z',
'ā' => 'a', 'č' => 'c', 'ē' => 'e', 'ģ' => 'g', 'ī' => 'i', 'ķ' => 'k', 'ļ' => 'l', 'ņ' => 'n',
'š' => 's', 'ū' => 'u', 'ž' => 'z'
- );
+ );*/
- $title = str_replace(array_keys($char_map), $char_map, $title);
+ $tp = e107::getParser();
+
+ $title = $tp->toASCII($title);
$title = str_replace(array('/',' '),' ',$title);
$title = str_replace(array("&",",","(",")"),'',$title);
@@ -4436,7 +4450,7 @@ class eHelper
{
$type = e107::getPref('url_sef_translate');
}
- $tp = e107::getParser();
+
switch ($type)
{
case 'dashl': //dasherize, to lower case
diff --git a/e107_handlers/db_debug_class.php b/e107_handlers/db_debug_class.php
index 06d198197..dd0f1bd8b 100644
--- a/e107_handlers/db_debug_class.php
+++ b/e107_handlers/db_debug_class.php
@@ -659,7 +659,7 @@ class e107_db_debug {
function log($message,$TraceLev=1)
{
- if(is_array($message))
+ if(is_array($message) || is_object($message))
{
$message = "".print_r($message,true)."
";
}
diff --git a/e107_handlers/e_parse_class.php b/e107_handlers/e_parse_class.php
index 9e387137f..91fe86888 100644
--- a/e107_handlers/e_parse_class.php
+++ b/e107_handlers/e_parse_class.php
@@ -1993,7 +1993,71 @@ class e_parse extends e_parser
}
+ function toASCII($text)
+ {
+ $char_map = array(
+ // Latin
+ 'À' => 'A', 'Á' => 'A', 'Â' => 'A', 'Ã' => 'A', 'Ä' => 'A', 'Å' => 'A', 'Æ' => 'AE', 'Ç' => 'C',
+ 'È' => 'E', 'É' => 'E', 'Ê' => 'E', 'Ë' => 'E', 'Ì' => 'I', 'Í' => 'I', 'Î' => 'I', 'Ï' => 'I',
+ 'Ð' => 'D', 'Ñ' => 'N', 'Ò' => 'O', 'Ó' => 'O', 'Ô' => 'O', 'Õ' => 'O', 'Ö' => 'O', 'Ő' => 'O',
+ 'Ø' => 'O', 'Ù' => 'U', 'Ú' => 'U', 'Û' => 'U', 'Ü' => 'U', 'Ű' => 'U', 'Ý' => 'Y', 'Þ' => 'TH',
+ 'ß' => 'ss',
+ 'à' => 'a', 'á' => 'a', 'â' => 'a', 'ã' => 'a', 'ä' => 'a', 'å' => 'a', 'æ' => 'ae', 'ç' => 'c',
+ 'è' => 'e', 'é' => 'e', 'ê' => 'e', 'ë' => 'e', 'ì' => 'i', 'í' => 'i', 'î' => 'i', 'ï' => 'i',
+ 'ð' => 'd', 'ñ' => 'n', 'ò' => 'o', 'ó' => 'o', 'ô' => 'o', 'õ' => 'o', 'ö' => 'o', 'ő' => 'o',
+ 'ø' => 'o', 'ù' => 'u', 'ú' => 'u', 'û' => 'u', 'ü' => 'u', 'ű' => 'u', 'ý' => 'y', 'þ' => 'th',
+ 'ÿ' => 'y',
+ // Latin symbols
+ '©' => '(c)',
+ // Greek
+ 'Α' => 'A', 'Β' => 'B', 'Γ' => 'G', 'Δ' => 'D', 'Ε' => 'E', 'Ζ' => 'Z', 'Η' => 'H', 'Θ' => '8',
+ 'Ι' => 'I', 'Κ' => 'K', 'Λ' => 'L', 'Μ' => 'M', 'Ν' => 'N', 'Ξ' => '3', 'Ο' => 'O', 'Π' => 'P',
+ 'Ρ' => 'R', 'Σ' => 'S', 'Τ' => 'T', 'Υ' => 'Y', 'Φ' => 'F', 'Χ' => 'X', 'Ψ' => 'PS', 'Ω' => 'W',
+ 'Ά' => 'A', 'Έ' => 'E', 'Ί' => 'I', 'Ό' => 'O', 'Ύ' => 'Y', 'Ή' => 'H', 'Ώ' => 'W', 'Ϊ' => 'I',
+ 'Ϋ' => 'Y',
+ 'α' => 'a', 'β' => 'b', 'γ' => 'g', 'δ' => 'd', 'ε' => 'e', 'ζ' => 'z', 'η' => 'h', 'θ' => '8',
+ 'ι' => 'i', 'κ' => 'k', 'λ' => 'l', 'μ' => 'm', 'ν' => 'n', 'ξ' => '3', 'ο' => 'o', 'π' => 'p',
+ 'ρ' => 'r', 'σ' => 's', 'τ' => 't', 'υ' => 'y', 'φ' => 'f', 'χ' => 'x', 'ψ' => 'ps', 'ω' => 'w',
+ 'ά' => 'a', 'έ' => 'e', 'ί' => 'i', 'ό' => 'o', 'ύ' => 'y', 'ή' => 'h', 'ώ' => 'w', 'ς' => 's',
+ 'ϊ' => 'i', 'ΰ' => 'y', 'ϋ' => 'y', 'ΐ' => 'i',
+ // Turkish
+ 'Ş' => 'S', 'İ' => 'I', 'Ç' => 'C', 'Ü' => 'U', 'Ö' => 'O', 'Ğ' => 'G',
+ 'ş' => 's', 'ı' => 'i', 'ç' => 'c', 'ü' => 'u', 'ö' => 'o', 'ğ' => 'g',
+ // Russian
+ 'А' => 'A', 'Б' => 'B', 'В' => 'V', 'Г' => 'G', 'Д' => 'D', 'Е' => 'E', 'Ё' => 'Yo', 'Ж' => 'Zh',
+ 'З' => 'Z', 'И' => 'I', 'Й' => 'J', 'К' => 'K', 'Л' => 'L', 'М' => 'M', 'Н' => 'N', 'О' => 'O',
+ 'П' => 'P', 'Р' => 'R', 'С' => 'S', 'Т' => 'T', 'У' => 'U', 'Ф' => 'F', 'Х' => 'H', 'Ц' => 'C',
+ 'Ч' => 'Ch', 'Ш' => 'Sh', 'Щ' => 'Sh', 'Ъ' => '', 'Ы' => 'Y', 'Ь' => '', 'Э' => 'E', 'Ю' => 'Yu',
+ 'Я' => 'Ya',
+ 'а' => 'a', 'б' => 'b', 'в' => 'v', 'г' => 'g', 'д' => 'd', 'е' => 'e', 'ё' => 'yo', 'ж' => 'zh',
+ 'з' => 'z', 'и' => 'i', 'й' => 'j', 'к' => 'k', 'л' => 'l', 'м' => 'm', 'н' => 'n', 'о' => 'o',
+ 'п' => 'p', 'р' => 'r', 'с' => 's', 'т' => 't', 'у' => 'u', 'ф' => 'f', 'х' => 'h', 'ц' => 'c',
+ 'ч' => 'ch', 'ш' => 'sh', 'щ' => 'sh', 'ъ' => '', 'ы' => 'y', 'ь' => '', 'э' => 'e', 'ю' => 'yu',
+ 'я' => 'ya',
+ // Ukrainian
+ 'Є' => 'Ye', 'І' => 'I', 'Ї' => 'Yi', 'Ґ' => 'G',
+ 'є' => 'ye', 'і' => 'i', 'ї' => 'yi', 'ґ' => 'g',
+ // Czech
+ 'Č' => 'C', 'Ď' => 'D', 'Ě' => 'E', 'Ň' => 'N', 'Ř' => 'R', 'Š' => 'S', 'Ť' => 'T', 'Ů' => 'U',
+ 'Ž' => 'Z',
+ 'č' => 'c', 'ď' => 'd', 'ě' => 'e', 'ň' => 'n', 'ř' => 'r', 'š' => 's', 'ť' => 't', 'ů' => 'u',
+ 'ž' => 'z',
+ // Polish
+ 'Ą' => 'A', 'Ć' => 'C', 'Ę' => 'e', 'Ł' => 'L', 'Ń' => 'N', 'Ó' => 'o', 'Ś' => 'S', 'Ź' => 'Z',
+ 'Ż' => 'Z',
+ 'ą' => 'a', 'ć' => 'c', 'ę' => 'e', 'ł' => 'l', 'ń' => 'n', 'ó' => 'o', 'ś' => 's', 'ź' => 'z',
+ 'ż' => 'z',
+ // Latvian
+ 'Ā' => 'A', 'Č' => 'C', 'Ē' => 'E', 'Ģ' => 'G', 'Ī' => 'i', 'Ķ' => 'k', 'Ļ' => 'L', 'Ņ' => 'N',
+ 'Š' => 'S', 'Ū' => 'u', 'Ž' => 'Z',
+ 'ā' => 'a', 'č' => 'c', 'ē' => 'e', 'ģ' => 'g', 'ī' => 'i', 'ķ' => 'k', 'ļ' => 'l', 'ņ' => 'n',
+ 'š' => 's', 'ū' => 'u', 'ž' => 'z'
+ );
+
+ return str_replace(array_keys($char_map), $char_map, $text);
+
+ }
diff --git a/e107_handlers/form_handler.php b/e107_handlers/form_handler.php
index cccb72fcf..1b641438e 100644
--- a/e107_handlers/form_handler.php
+++ b/e107_handlers/form_handler.php
@@ -1097,14 +1097,14 @@ class e_form
}
- // print_a($sc_parameters);
-
if(empty($sc_parameters['media']))
{
$sc_parameters['media'] = '_common';
}
+e107::getDebug()->log($sc_parameters);
+
$default_thumb = $default;
$class = '';
@@ -1181,7 +1181,7 @@ class e_form
$label = "
";
- if($cat != 'news' && $cat !='page' && $cat !='')
+ if($cat != 'news' && $cat !='page' && $cat !='' && strpos($cat,'_image')===false)
{
$cat = $cat . "_image";
}
diff --git a/e107_handlers/hybridauth/Hybrid/Auth.php b/e107_handlers/hybridauth/Hybrid/Auth.php
index 9e094e5f3..b3506d561 100644
--- a/e107_handlers/hybridauth/Hybrid/Auth.php
+++ b/e107_handlers/hybridauth/Hybrid/Auth.php
@@ -15,7 +15,7 @@
*/
class Hybrid_Auth {
- public static $version = "2.8.0";
+ public static $version = "2.7.0";
/**
* Configuration array
@@ -352,9 +352,6 @@ class Hybrid_Auth {
* @param string $mode PHP|JS
*/
public static function redirect($url, $mode = "PHP") {
- if(!$mode){
- $mode = 'PHP';
- }
Hybrid_Logger::info("Enter Hybrid_Auth::redirect( $url, $mode )");
// Ensure session is saved before sending response, see https://github.com/symfony/symfony/pull/12341
diff --git a/e107_handlers/hybridauth/Hybrid/Provider_Adapter.php b/e107_handlers/hybridauth/Hybrid/Provider_Adapter.php
index 30db81d74..d5bcf40d9 100644
--- a/e107_handlers/hybridauth/Hybrid/Provider_Adapter.php
+++ b/e107_handlers/hybridauth/Hybrid/Provider_Adapter.php
@@ -153,26 +153,11 @@ class Hybrid_Provider_Adapter {
# for default HybridAuth endpoint url hauth_login_start_url
# auth.start required the IDp ID
# auth.time optional login request timestamp
- if (!isset($this->params["login_start"]) ) {
- $this->params["login_start"] = $HYBRID_AUTH_URL_BASE . ( strpos($HYBRID_AUTH_URL_BASE, '?') ? '&' : '?' ) . "hauth.start={$this->id}&hauth.time={$this->params["hauth_time"]}";
- }
+ $this->params["login_start"] = $HYBRID_AUTH_URL_BASE . ( strpos($HYBRID_AUTH_URL_BASE, '?') ? '&' : '?' ) . "hauth.start={$this->id}&hauth.time={$this->params["hauth_time"]}";
# for default HybridAuth endpoint url hauth_login_done_url
# auth.done required the IDp ID
- if (!isset($this->params["login_done"]) ) {
- $this->params["login_done"] = $HYBRID_AUTH_URL_BASE . ( strpos($HYBRID_AUTH_URL_BASE, '?') ? '&' : '?' ) . "hauth.done={$this->id}";
- }
-
- # workaround to solve windows live authentication since microsoft disallowed redirect urls to contain any parameters
- # http://mywebsite.com/path_to_hybridauth/?hauth.done=Live will not work
- if ($this->id=="Live") {
- $this->params["login_done"] = $HYBRID_AUTH_URL_BASE."live.php";
- }
-
- # Workaround to fix broken callback urls for the Facebook OAuth client
- if ($this->adapter->useSafeUrls) {
- $this->params['login_done'] = str_replace('hauth.done', 'hauth_done', $this->params['login_done']);
- }
+ $this->params["login_done"] = $HYBRID_AUTH_URL_BASE . ( strpos($HYBRID_AUTH_URL_BASE, '?') ? '&' : '?' ) . "hauth.done={$this->id}";
if (isset($this->params["hauth_return_to"])) {
Hybrid_Auth::storage()->set("hauth_session.{$this->id}.hauth_return_to", $this->params["hauth_return_to"]);
diff --git a/e107_handlers/hybridauth/Hybrid/Provider_Model.php b/e107_handlers/hybridauth/Hybrid/Provider_Model.php
index a84d618ab..d044bd540 100644
--- a/e107_handlers/hybridauth/Hybrid/Provider_Model.php
+++ b/e107_handlers/hybridauth/Hybrid/Provider_Model.php
@@ -64,9 +64,6 @@ abstract class Hybrid_Provider_Model {
*/
public $compressed = false;
- /** @var bool $useSafeUrls Enable this to replace '.' with '_' characters in the callback urls */
- public $useSafeUrls = false;
-
/**
* Common providers adapter constructor
*
diff --git a/e107_handlers/hybridauth/Hybrid/Providers/Facebook.php b/e107_handlers/hybridauth/Hybrid/Providers/Facebook.php
index ca6029480..bd05baeeb 100644
--- a/e107_handlers/hybridauth/Hybrid/Providers/Facebook.php
+++ b/e107_handlers/hybridauth/Hybrid/Providers/Facebook.php
@@ -1,8 +1,5 @@
config["keys"]["id"] || !$this->config["keys"]["secret"]) {
+ throw new Exception("Your application id and secret are required in order to connect to {$this->providerId}.", 4);
+ }
- /**
- * {@inheritdoc}
- */
- function initialize() {
- if (!$this->config["keys"]["id"] || !$this->config["keys"]["secret"]) {
- throw new Exception("Your application id and secret are required in order to connect to {$this->providerId}.", 4);
- }
+ if (!class_exists('FacebookApiException', false)) {
+ require_once Hybrid_Auth::$config["path_libraries"] . "Facebook/base_facebook.php";
+ require_once Hybrid_Auth::$config["path_libraries"] . "Facebook/facebook.php";
+ }
- if (isset($this->config['scope'])) {
- $scope = $this->config['scope'];
- if (is_string($scope)) {
- $scope = explode(",", $scope);
- }
- $scope = array_map('trim', $scope);
- $this->scope = $scope;
- }
+ if (isset(Hybrid_Auth::$config["proxy"])) {
+ BaseFacebook::$CURL_OPTS[CURLOPT_PROXY] = Hybrid_Auth::$config["proxy"];
+ }
- $trustForwarded = isset($this->config['trustForwarded']) ? (bool)$this->config['trustForwarded'] : false;
+ $trustForwarded = isset($this->config['trustForwarded']) ? (bool) $this->config['trustForwarded'] : false;
+ $this->api = new Facebook(array('appId' => $this->config["keys"]["id"], 'secret' => $this->config["keys"]["secret"], 'trustForwarded' => $trustForwarded));
- $this->api = new FacebookSDK([
- 'app_id' => $this->config["keys"]["id"],
- 'app_secret' => $this->config["keys"]["secret"],
- 'default_graph_version' => 'v2.8',
- 'trustForwarded' => $trustForwarded,
- ]);
- }
+ if ($this->token("access_token")) {
+ $this->api->setAccessToken($this->token("access_token"));
+ $this->api->setExtendedAccessToken();
+ $access_token = $this->api->getAccessToken();
- /**
- * {@inheritdoc}
- */
- function loginBegin() {
+ if ($access_token) {
+ $this->token("access_token", $access_token);
+ $this->api->setAccessToken($access_token);
+ }
- $this->endpoint = $this->params['login_done'];
- $helper = $this->api->getRedirectLoginHelper();
+ $this->api->setAccessToken($this->token("access_token"));
+ }
- // Use re-request, because this will trigger permissions window if not all permissions are granted.
- $url = $helper->getReRequestUrl($this->endpoint, $this->scope);
+ $this->api->getUser();
+ }
- // Redirect to Facebook
- Hybrid_Auth::redirect($url);
- }
+ /**
+ * {@inheritdoc}
+ */
+ function loginBegin() {
+ $parameters = array("scope" => $this->scope, "redirect_uri" => $this->endpoint, "display" => "page");
+ $optionals = array("scope", "redirect_uri", "display", "auth_type");
- /**
- * {@inheritdoc}
- */
- function loginFinish() {
+ foreach ($optionals as $parameter) {
+ if (isset($this->config[$parameter]) && !empty($this->config[$parameter])) {
+ $parameters[$parameter] = $this->config[$parameter];
- $helper = $this->api->getRedirectLoginHelper();
- try {
- $accessToken = $helper->getAccessToken();
- } catch (Facebook\Exceptions\FacebookResponseException $e) {
- throw new Hybrid_Exception('Facebook Graph returned an error: ' . $e->getMessage());
- } catch (Facebook\Exceptions\FacebookSDKException $e) {
- throw new Hybrid_Exception('Facebook SDK returned an error: ' . $e->getMessage());
- }
+ //If the auth_type parameter is used, we need to generate a nonce and include it as a parameter
+ if ($parameter == "auth_type") {
+ $nonce = md5(uniqid(mt_rand(), true));
+ $parameters['auth_nonce'] = $nonce;
- if (!isset($accessToken)) {
- if ($helper->getError()) {
- throw new Hybrid_Exception(sprintf("Could not authorize user, reason: %s (%d)", $helper->getErrorDescription(), $helper->getErrorCode()));
- } else {
- throw new Hybrid_Exception("Could not authorize user. Bad request");
- }
- }
+ Hybrid_Auth::storage()->set('fb_auth_nonce', $nonce);
+ }
+ }
+ }
- try {
- // Validate token
- $oAuth2Client = $this->api->getOAuth2Client();
- $tokenMetadata = $oAuth2Client->debugToken($accessToken);
- $tokenMetadata->validateAppId($this->config["keys"]["id"]);
- $tokenMetadata->validateExpiration();
+ if (isset($this->config['force']) && $this->config['force'] === true) {
+ $parameters['auth_type'] = 'reauthenticate';
+ $parameters['auth_nonce'] = md5(uniqid(mt_rand(), true));
- // Exchanges a short-lived access token for a long-lived one
- if (!$accessToken->isLongLived()) {
- $accessToken = $oAuth2Client->getLongLivedAccessToken($accessToken);
- }
- } catch (FacebookSDKException $e) {
- throw new Hybrid_Exception($e->getMessage(), 0, $e);
- }
+ Hybrid_Auth::storage()->set('fb_auth_nonce', $parameters['auth_nonce']);
+ }
- $this->setUserConnected();
- $this->token("access_token", $accessToken->getValue());
- }
+ // get the login url
+ $url = $this->api->getLoginUrl($parameters);
- /**
- * {@inheritdoc}
- */
- function logout() {
- parent::logout();
- }
+ // redirect to facebook
+ Hybrid_Auth::redirect($url);
+ }
- /**
- * {@inheritdoc}
- */
- function getUserProfile() {
- try {
- $fields = [
- 'id',
- 'name',
- 'first_name',
- 'last_name',
- 'link',
- 'website',
- 'gender',
- 'locale',
- 'about',
- 'email',
- 'hometown',
- 'location',
- 'birthday'
- ];
- $response = $this->api->get('/me?fields=' . implode(',', $fields), $this->token('access_token'));
- $data = $response->getDecodedBody();
- } catch (FacebookSDKException $e) {
- throw new Exception("User profile request failed! {$this->providerId} returned an error: {$e->getMessage()}", 6, $e);
- }
+ /**
+ * {@inheritdoc}
+ */
+ function loginFinish() {
+ // in case we get error_reason=user_denied&error=access_denied
+ if (isset($_REQUEST['error']) && $_REQUEST['error'] == "access_denied") {
+ throw new Exception("Authentication failed! The user denied your request.", 5);
+ }
- // Store the user profile.
- $this->user->profile->identifier = (array_key_exists('id', $data)) ? $data['id'] : "";
- $this->user->profile->displayName = (array_key_exists('name', $data)) ? $data['name'] : "";
- $this->user->profile->firstName = (array_key_exists('first_name', $data)) ? $data['first_name'] : "";
- $this->user->profile->lastName = (array_key_exists('last_name', $data)) ? $data['last_name'] : "";
- $this->user->profile->photoURL = !empty($this->user->profile->identifier) ? "https://graph.facebook.com/" . $this->user->profile->identifier . "/picture?width=150&height=150" : '';
- $this->user->profile->profileURL = (array_key_exists('link', $data)) ? $data['link'] : "";
- $this->user->profile->webSiteURL = (array_key_exists('website', $data)) ? $data['website'] : "";
- $this->user->profile->gender = (array_key_exists('gender', $data)) ? $data['gender'] : "";
- $this->user->profile->language = (array_key_exists('locale', $data)) ? $data['locale'] : "";
- $this->user->profile->description = (array_key_exists('about', $data)) ? $data['about'] : "";
- $this->user->profile->email = (array_key_exists('email', $data)) ? $data['email'] : "";
- $this->user->profile->emailVerified = (array_key_exists('email', $data)) ? $data['email'] : "";
- $this->user->profile->region = (array_key_exists("location", $data) && array_key_exists("name", $data['location'])) ? $data['location']["name"] : "";
+ // in case we are using iOS/Facebook reverse authentication
+ if (isset($_REQUEST['access_token'])) {
+ $this->token("access_token", $_REQUEST['access_token']);
+ $this->api->setAccessToken($this->token("access_token"));
+ $this->api->setExtendedAccessToken();
+ $access_token = $this->api->getAccessToken();
- if (!empty($this->user->profile->region)) {
- $regionArr = explode(',', $this->user->profile->region);
- if (count($regionArr) > 1) {
- $this->user->profile->city = trim($regionArr[0]);
- $this->user->profile->country = trim($regionArr[1]);
- }
- }
+ if ($access_token) {
+ $this->token("access_token", $access_token);
+ $this->api->setAccessToken($access_token);
+ }
- if (array_key_exists('birthday', $data)) {
- $birtydayPieces = explode('/', $data['birthday']);
+ $this->api->setAccessToken($this->token("access_token"));
+ }
- if (count($birtydayPieces) == 1) {
- $this->user->profile->birthYear = (int)$birtydayPieces[0];
- } elseif (count($birtydayPieces) == 2) {
- $this->user->profile->birthMonth = (int)$birtydayPieces[0];
- $this->user->profile->birthDay = (int)$birtydayPieces[1];
- } elseif (count($birtydayPieces) == 3) {
- $this->user->profile->birthMonth = (int)$birtydayPieces[0];
- $this->user->profile->birthDay = (int)$birtydayPieces[1];
- $this->user->profile->birthYear = (int)$birtydayPieces[2];
- }
- }
- return $this->user->profile;
- }
+ // if auth_type is used, then an auth_nonce is passed back, and we need to check it.
+ if (isset($_REQUEST['auth_nonce'])) {
- /**
- * Since the Graph API 2.0, the /friends endpoint only returns friend that also use your Facebook app.
- * {@inheritdoc}
- */
- function getUserContacts() {
- $apiCall = '?fields=link,name';
- $returnedContacts = [];
- $pagedList = true;
+ $nonce = Hybrid_Auth::storage()->get('fb_auth_nonce');
- while ($pagedList) {
- try {
- $response = $this->api->get('/me/friends' . $apiCall, $this->token('access_token'));
- $response = $response->getDecodedBody();
- } catch (FacebookSDKException $e) {
- throw new Hybrid_Exception("User contacts request failed! {$this->providerId} returned an error {$e->getMessage()}", 0, $e);
- }
+ //Delete the nonce
+ Hybrid_Auth::storage()->delete('fb_auth_nonce');
- // Prepare the next call if paging links have been returned
- if (array_key_exists('paging', $response) && array_key_exists('next', $response['paging'])) {
- $pagedList = true;
- $next_page = explode('friends', $response['paging']['next']);
- $apiCall = $next_page[1];
- } else {
- $pagedList = false;
- }
+ if ($_REQUEST['auth_nonce'] != $nonce) {
+ throw new Exception("Authentication failed! Invalid nonce used for reauthentication.", 5);
+ }
+ }
- // Add the new page contacts
- $returnedContacts = array_merge($returnedContacts, $response['data']);
- }
+ // try to get the UID of the connected user from fb, should be > 0
+ if (!$this->api->getUser()) {
+ throw new Exception("Authentication failed! {$this->providerId} returned an invalid user id.", 5);
+ }
- $contacts = [];
+ // set user as logged in
+ $this->setUserConnected();
- foreach ($returnedContacts as $item) {
+ // store facebook access token
+ $this->token("access_token", $this->api->getAccessToken());
+ }
- $uc = new Hybrid_User_Contact();
- $uc->identifier = (array_key_exists("id", $item)) ? $item["id"] : "";
- $uc->displayName = (array_key_exists("name", $item)) ? $item["name"] : "";
- $uc->profileURL = (array_key_exists("link", $item)) ? $item["link"] : "https://www.facebook.com/profile.php?id=" . $uc->identifier;
- $uc->photoURL = "https://graph.facebook.com/" . $uc->identifier . "/picture?width=150&height=150";
+ /**
+ * {@inheritdoc}
+ */
+ function logout() {
+ $this->api->destroySession();
+ parent::logout();
+ }
- $contacts[] = $uc;
- }
+ /**
+ * {@inheritdoc}
+ */
+ function getUserProfile() {
+ // request user profile from fb api
+ try {
+ $fields = array(
+ 'id', 'name', 'first_name', 'last_name', 'link', 'website',
+ 'gender', 'locale', 'about', 'email', 'hometown', 'location',
+ 'birthday'
+ );
- return $contacts;
- }
+ $data = $this->api->api('/me?fields=' . implode(',', $fields));
+ } catch (FacebookApiException $e) {
+ throw new Exception("User profile request failed! {$this->providerId} returned an error: {$e->getMessage()}", 6, $e);
+ }
- /**
- * Load the user latest activity, needs 'read_stream' permission
- *
- * @param string $stream Which activity to fetch:
- * - timeline : all the stream
- * - me : the user activity only
- * {@inheritdoc}
- */
- function getUserActivity($stream = 'timeline') {
- try {
- if ($stream == "me") {
- $response = $this->api->get('/me/feed', $this->token('access_token'));
- } else {
- $response = $this->api->get('/me/home', $this->token('access_token'));
- }
- } catch (FacebookSDKException $e) {
- throw new Hybrid_Exception("User activity stream request failed! {$this->providerId} returned an error: {$e->getMessage()}", 0, $e);
- }
+ // if the provider identifier is not received, we assume the auth has failed
+ if (!isset($data["id"])) {
+ throw new Exception("User profile request failed! {$this->providerId} api returned an invalid response: " . Hybrid_Logger::dumpData( $data ), 6);
+ }
- if (!$response || !count($response['data'])) {
- return [];
- }
+ # store the user profile.
+ $this->user->profile->identifier = (array_key_exists('id', $data)) ? $data['id'] : "";
+ $this->user->profile->username = (array_key_exists('username', $data)) ? $data['username'] : "";
+ $this->user->profile->displayName = (array_key_exists('name', $data)) ? $data['name'] : "";
+ $this->user->profile->firstName = (array_key_exists('first_name', $data)) ? $data['first_name'] : "";
+ $this->user->profile->lastName = (array_key_exists('last_name', $data)) ? $data['last_name'] : "";
+ $this->user->profile->photoURL = "https://graph.facebook.com/" . $this->user->profile->identifier . "/picture?width=150&height=150";
+ $this->user->profile->coverInfoURL = "https://graph.facebook.com/" . $this->user->profile->identifier . "?fields=cover&access_token=" . $this->api->getAccessToken();
+ $this->user->profile->profileURL = (array_key_exists('link', $data)) ? $data['link'] : "";
+ $this->user->profile->webSiteURL = (array_key_exists('website', $data)) ? $data['website'] : "";
+ $this->user->profile->gender = (array_key_exists('gender', $data)) ? $data['gender'] : "";
+ $this->user->profile->language = (array_key_exists('locale', $data)) ? $data['locale'] : "";
+ $this->user->profile->description = (array_key_exists('about', $data)) ? $data['about'] : "";
+ $this->user->profile->email = (array_key_exists('email', $data)) ? $data['email'] : "";
+ $this->user->profile->emailVerified = (array_key_exists('email', $data)) ? $data['email'] : "";
+ $this->user->profile->region = (array_key_exists("location", $data) && array_key_exists("name", $data['location'])) ? $data['location']["name"] : "";
- $activities = [];
+ if (!empty($this->user->profile->region)) {
+ $regionArr = explode(',', $this->user->profile->region);
+ if (count($regionArr) > 1) {
+ $this->user->profile->city = trim($regionArr[0]);
+ $this->user->profile->country = trim($regionArr[1]);
+ }
+ }
- foreach ($response['data'] as $item) {
+ if (array_key_exists('birthday', $data)) {
+ list($birthday_month, $birthday_day, $birthday_year) = explode("/", $data['birthday']);
- $ua = new Hybrid_User_Activity();
+ $this->user->profile->birthDay = (int) $birthday_day;
+ $this->user->profile->birthMonth = (int) $birthday_month;
+ $this->user->profile->birthYear = (int) $birthday_year;
+ }
- $ua->id = (array_key_exists("id", $item)) ? $item["id"] : "";
- $ua->date = (array_key_exists("created_time", $item)) ? strtotime($item["created_time"]) : "";
+ return $this->user->profile;
+ }
- if ($item["type"] == "video") {
- $ua->text = (array_key_exists("link", $item)) ? $item["link"] : "";
- }
+ /**
+ * Attempt to retrieve the url to the cover image given the coverInfoURL
+ *
+ * @param string $coverInfoURL coverInfoURL variable
+ * @return string url to the cover image OR blank string
+ */
+ function getCoverURL($coverInfoURL) {
+ try {
+ $headers = get_headers($coverInfoURL);
+ if (substr($headers[0], 9, 3) != "404") {
+ $coverOBJ = json_decode(file_get_contents($coverInfoURL));
+ if (array_key_exists('cover', $coverOBJ)) {
+ return $coverOBJ->cover->source;
+ }
+ }
+ } catch (Exception $e) {
- if ($item["type"] == "link") {
- $ua->text = (array_key_exists("link", $item)) ? $item["link"] : "";
- }
+ }
- if (empty($ua->text) && isset($item["story"])) {
- $ua->text = (array_key_exists("link", $item)) ? $item["link"] : "";
- }
+ return "";
+ }
- if (empty($ua->text) && isset($item["message"])) {
- $ua->text = (array_key_exists("message", $item)) ? $item["message"] : "";
- }
+ /**
+ * {@inheritdoc}
+ */
+ function getUserContacts() {
+ $apiCall = '?fields=link,name';
+ $returnedContacts = array();
+ $pagedList = false;
- if (!empty($ua->text)) {
- $ua->user->identifier = (array_key_exists("id", $item["from"])) ? $item["from"]["id"] : "";
- $ua->user->displayName = (array_key_exists("name", $item["from"])) ? $item["from"]["name"] : "";
- $ua->user->profileURL = "https://www.facebook.com/profile.php?id=" . $ua->user->identifier;
- $ua->user->photoURL = "https://graph.facebook.com/" . $ua->user->identifier . "/picture?type=square";
+ do {
+ try {
+ $response = $this->api->api('/me/friends' . $apiCall);
+ } catch (FacebookApiException $e) {
+ throw new Exception("User contacts request failed! {$this->providerId} returned an error {$e->getMessage()}", 0, $e);
+ }
- $activities[] = $ua;
- }
- }
+ // Prepare the next call if paging links have been returned
+ if (array_key_exists('paging', $response) && array_key_exists('next', $response['paging'])) {
+ $pagedList = true;
+ $next_page = explode('friends', $response['paging']['next']);
+ $apiCall = $next_page[1];
+ } else {
+ $pagedList = false;
+ }
- return $activities;
- }
+ // Add the new page contacts
+ $returnedContacts = array_merge($returnedContacts, $response['data']);
+ } while ($pagedList == true);
+
+ $contacts = array();
+
+ foreach ($returnedContacts as $item) {
+
+ $uc = new Hybrid_User_Contact();
+ $uc->identifier = (array_key_exists("id", $item)) ? $item["id"] : "";
+ $uc->displayName = (array_key_exists("name", $item)) ? $item["name"] : "";
+ $uc->profileURL = (array_key_exists("link", $item)) ? $item["link"] : "https://www.facebook.com/profile.php?id=" . $uc->identifier;
+ $uc->photoURL = "https://graph.facebook.com/" . $uc->identifier . "/picture?width=150&height=150";
+
+ $contacts[] = $uc;
+ }
+
+ return $contacts;
+ }
+
+ /**
+ * Update user status
+ *
+ * @param mixed $status An array describing the status, or string
+ * @param string $pageid (optional) User page id
+ * @return array
+ * @throw Exception
+ */
+ function setUserStatus($status, $pageid = null) {
+ if (!is_array($status)) {
+ $status = array('message' => $status);
+ }
+
+ if (is_null($pageid)) {
+ $pageid = 'me';
+
+ // if post on page, get access_token page
+ } else {
+ $access_token = null;
+ foreach ($this->getUserPages(true) as $p) {
+ if (isset($p['id']) && intval($p['id']) == intval($pageid)) {
+ $access_token = $p['access_token'];
+ break;
+ }
+ }
+
+ if (is_null($access_token)) {
+ throw new Exception("Update user page failed, page not found or not writable!");
+ }
+
+ $status['access_token'] = $access_token;
+ }
+
+ try {
+ $response = $this->api->api('/' . $pageid . '/feed', 'post', $status);
+ } catch (FacebookApiException $e) {
+ throw new Exception("Update user status failed! {$this->providerId} returned an error {$e->getMessage()}", 0, $e);
+ }
+
+ return $response;
+ }
+
+ /**
+ * {@inheridoc}
+ */
+ function getUserStatus($postid) {
+ try {
+ $postinfo = $this->api->api("/" . $postid);
+ } catch (FacebookApiException $e) {
+ throw new Exception("Cannot retrieve user status! {$this->providerId} returned an error: {$e->getMessage()}", 0, $e);
+ }
+
+ return $postinfo;
+ }
+
+ /**
+ * {@inheridoc}
+ */
+ function getUserPages($writableonly = false) {
+ if (( isset($this->config['scope']) && strpos($this->config['scope'], 'manage_pages') === false ) || (!isset($this->config['scope']) && strpos($this->scope, 'manage_pages') === false ))
+ throw new Exception("User status requires manage_page permission!");
+
+ try {
+ $pages = $this->api->api("/me/accounts", 'get');
+ } catch (FacebookApiException $e) {
+ throw new Exception("Cannot retrieve user pages! {$this->providerId} returned an error: {$e->getMessage()}", 0, $e);
+ }
+
+ if (!isset($pages['data'])) {
+ return array();
+ }
+
+ if (!$writableonly) {
+ return $pages['data'];
+ }
+
+ $wrpages = array();
+ foreach ($pages['data'] as $p) {
+ if (isset($p['perms']) && in_array('CREATE_CONTENT', $p['perms'])) {
+ $wrpages[] = $p;
+ }
+ }
+
+ return $wrpages;
+ }
+
+ /**
+ * load the user latest activity
+ * - timeline : all the stream
+ * - me : the user activity only
+ * {@inheritdoc}
+ */
+ function getUserActivity($stream) {
+ try {
+ if ($stream == "me") {
+ $response = $this->api->api('/me/feed');
+ } else {
+ $response = $this->api->api('/me/home');
+ }
+ } catch (FacebookApiException $e) {
+ throw new Exception("User activity stream request failed! {$this->providerId} returned an error: {$e->getMessage()}", 0, $e);
+ }
+
+ if (!$response || !count($response['data'])) {
+ return array();
+ }
+
+ $activities = array();
+
+ foreach ($response['data'] as $item) {
+ if ($stream == "me" && $item["from"]["id"] != $this->api->getUser()) {
+ continue;
+ }
+
+ $ua = new Hybrid_User_Activity();
+
+ $ua->id = (array_key_exists("id", $item)) ? $item["id"] : "";
+ $ua->date = (array_key_exists("created_time", $item)) ? strtotime($item["created_time"]) : "";
+
+ if ($item["type"] == "video") {
+ $ua->text = (array_key_exists("link", $item)) ? $item["link"] : "";
+ }
+
+ if ($item["type"] == "link") {
+ $ua->text = (array_key_exists("link", $item)) ? $item["link"] : "";
+ }
+
+ if (empty($ua->text) && isset($item["story"])) {
+ $ua->text = (array_key_exists("link", $item)) ? $item["link"] : "";
+ }
+
+ if (empty($ua->text) && isset($item["message"])) {
+ $ua->text = (array_key_exists("message", $item)) ? $item["message"] : "";
+ }
+
+ if (!empty($ua->text)) {
+ $ua->user->identifier = (array_key_exists("id", $item["from"])) ? $item["from"]["id"] : "";
+ $ua->user->displayName = (array_key_exists("name", $item["from"])) ? $item["from"]["name"] : "";
+ $ua->user->profileURL = "https://www.facebook.com/profile.php?id=" . $ua->user->identifier;
+ $ua->user->photoURL = "https://graph.facebook.com/" . $ua->user->identifier . "/picture?type=square";
+
+ $activities[] = $ua;
+ }
+ }
+
+ return $activities;
+ }
}
diff --git a/e107_handlers/hybridauth/Hybrid/Providers/Google.php b/e107_handlers/hybridauth/Hybrid/Providers/Google.php
index 3644493fb..4b75ce496 100644
--- a/e107_handlers/hybridauth/Hybrid/Providers/Google.php
+++ b/e107_handlers/hybridauth/Hybrid/Providers/Google.php
@@ -158,16 +158,16 @@ class Hybrid_Providers_Google extends Hybrid_Provider_Model_OAuth2 {
} else {
$this->user->profile->webSiteURL = '';
}
- // google API returns age ranges min and/or max as of https://developers.google.com/+/web/api/rest/latest/people#resource
+ // google API returns age ranges or min. age only (with plus.login scope)
if (property_exists($response, 'ageRange')) {
if (property_exists($response->ageRange, 'min') && property_exists($response->ageRange, 'max')) {
$this->user->profile->age = $response->ageRange->min . ' - ' . $response->ageRange->max;
} else {
if (property_exists($response->ageRange, 'min')) {
- $this->user->profile->age = '>= ' . $response->ageRange->min;
+ $this->user->profile->age = '> ' . $response->ageRange->min;
} else {
if (property_exists($response->ageRange, 'max')) {
- $this->user->profile->age = '<= ' . $response->ageRange->max;
+ $this->user->profile->age = '< ' . $response->ageRange->max;
} else {
$this->user->profile->age = '';
}
diff --git a/e107_handlers/hybridauth/Hybrid/Providers/LinkedIn.php b/e107_handlers/hybridauth/Hybrid/Providers/LinkedIn.php
index 6d3438ebf..5e3d8b32f 100644
--- a/e107_handlers/hybridauth/Hybrid/Providers/LinkedIn.php
+++ b/e107_handlers/hybridauth/Hybrid/Providers/LinkedIn.php
@@ -30,7 +30,7 @@ class Hybrid_Providers_LinkedIn extends Hybrid_Provider_Model {
}
if (empty($this->config['fields'])) {
- $this->config['fields'] = array(
+ $this->config['fields'] = [
'id',
'first-name',
'last-name',
@@ -40,8 +40,7 @@ class Hybrid_Providers_LinkedIn extends Hybrid_Provider_Model {
'date-of-birth',
'phone-numbers',
'summary',
- 'positions'
- );
+ ];
}
if (!class_exists('OAuthConsumer', false)) {
@@ -133,11 +132,6 @@ class Hybrid_Providers_LinkedIn extends Hybrid_Provider_Model {
$this->user->profile->email = (string) $data->{'email-address'};
$this->user->profile->emailVerified = (string) $data->{'email-address'};
- if ($data->{'positions'}) {
- $this->user->profile->job_title = (string) $data->{'positions'}->{'position'}->{'title'};
- $this->user->profile->organization_name = (string) $data->{'positions'}->{'position'}->{'company'}->{'name'};
- }
-
if (isset($data->{'picture-url'})) {
$this->user->profile->photoURL = (string) $data->{'picture-url'};
diff --git a/e107_handlers/hybridauth/Hybrid/Providers/Twitter.php b/e107_handlers/hybridauth/Hybrid/Providers/Twitter.php
index 6ea623134..dad718f3f 100644
--- a/e107_handlers/hybridauth/Hybrid/Providers/Twitter.php
+++ b/e107_handlers/hybridauth/Hybrid/Providers/Twitter.php
@@ -131,8 +131,7 @@ class Hybrid_Providers_Twitter extends Hybrid_Provider_Model_OAuth1 {
$this->user->profile->webSiteURL = (property_exists($response, 'url')) ? $response->url : "";
$this->user->profile->region = (property_exists($response, 'location')) ? $response->location : "";
if($includeEmail) $this->user->profile->email = (property_exists($response, 'email')) ? $response->email : "";
- if($includeEmail) $this->user->profile->emailVerified = (property_exists($response, 'email')) ? $response->email : "";
-
+
return $this->user->profile;
}
diff --git a/e107_handlers/hybridauth/Hybrid/User_Profile.php b/e107_handlers/hybridauth/Hybrid/User_Profile.php
index 403be89c2..6a4070cd6 100644
--- a/e107_handlers/hybridauth/Hybrid/User_Profile.php
+++ b/e107_handlers/hybridauth/Hybrid/User_Profile.php
@@ -149,15 +149,4 @@ class Hybrid_User_Profile {
*/
public $zip = null;
- /**
- * Job title
- * @var string
- */
- public $job_title = null;
-
- /**
- * Organization name
- * @var string
- */
- public $organization_name = null;
}
diff --git a/e107_handlers/hybridauth/live.php b/e107_handlers/hybridauth/live.php
new file mode 100644
index 000000000..e992784b7
--- /dev/null
+++ b/e107_handlers/hybridauth/live.php
@@ -0,0 +1,13 @@
+cat('news_count');
+ return (string) e107::getParser()->toBadge( $this->cat('news_count'));
}
}
diff --git a/e107_plugins/_blank/css/blank.css b/e107_plugins/_blank/css/blank.css
index 5832b22e0..1c45f2bc7 100644
--- a/e107_plugins/_blank/css/blank.css
+++ b/e107_plugins/_blank/css/blank.css
@@ -10,14 +10,15 @@
width: 100%;
}
-.nav-list { border-bottom: 0 solid #eee; }
-.nav-list > li {
+
+.-blank-megamenu .nav-list { border-bottom: 0 solid #eee; }
+.-blank-megamenu .nav-list > li {
padding: 20px 15px 15px;
}
-.nav-list > li:last-child { border-right: 0 solid #eee; }
-.nav-list > li > a:hover { text-decoration: none; }
-.nav-list > li > a > span {
+.-blank-megamenu .nav-list > li:last-child { border-right: 0 solid #eee; }
+.-blank-megamenu .nav-list > li > a:hover { text-decoration: none; }
+.-blank-megamenu .nav-list > li > a > span {
display: block;
font-weight: bold;
text-transform: uppercase;
@@ -25,3 +26,4 @@
+
diff --git a/e107_plugins/comment_menu/comment_menu_template.php b/e107_plugins/comment_menu/comment_menu_template.php
index 0bc25a435..6ee1d84a9 100644
--- a/e107_plugins/comment_menu/comment_menu_template.php
+++ b/e107_plugins/comment_menu/comment_menu_template.php
@@ -35,7 +35,7 @@ if (!isset($COMMENT_MENU_TEMPLATE))
$COMMENT_MENU_TEMPLATE['item'] = "
{CM_URL_PRE}{CM_TYPE} {CM_HEADING}{CM_URL_POST}
{CM_COMMENT}
- {CM_AUTHOR} {CM_DATESTAMP}
+ {CM_AUTHOR} {CM_DATESTAMP}
";
$COMMENT_MENU_TEMPLATE['end'] = "";
diff --git a/e107_plugins/download/includes/admin.php b/e107_plugins/download/includes/admin.php
index 746270f88..b2a0d6c0e 100644
--- a/e107_plugins/download/includes/admin.php
+++ b/e107_plugins/download/includes/admin.php
@@ -1415,7 +1415,7 @@ $columnInfo = array(
$text .= " ";
*/
- $text .= $frm->imagepicker('download_image', $download_image,'',array('mode'=>'download_image', 'legacyPath'=>'{e_FILE}downloadimages'));
+ $text .= $frm->imagepicker('download_image', $download_image,'',array('media'=>'download_image', 'legacyPath'=>'{e_FILE}downloadimages'));
if ($subAction == "dlm" && $download_image)
{
@@ -1446,7 +1446,7 @@ $columnInfo = array(
$text .= " ";
*/
- $text .= $frm->imagepicker('download_thumb', $download_thumb,'',array('mode'=>'download_thumb', 'legacyPath'=>'{e_FILE}downloadthumbs'));
+ $text .= $frm->imagepicker('download_thumb', $download_thumb,'',array('media'=>'download_thumb', 'legacyPath'=>'{e_FILE}downloadthumbs'));
$text .= "
diff --git a/e107_plugins/forum/shortcodes/batch/forum_shortcodes.php b/e107_plugins/forum/shortcodes/batch/forum_shortcodes.php
index d2176836a..ceaabd52d 100644
--- a/e107_plugins/forum/shortcodes/batch/forum_shortcodes.php
+++ b/e107_plugins/forum/shortcodes/batch/forum_shortcodes.php
@@ -507,7 +507,7 @@ class forum_shortcodes extends e_shortcode
// code to be executed if n is different from all labels;
}
}
- return $relativeDate.'
'.$lastpost_username." ".IMAGE_post2.'';
+ return $lastpost_username." ".$relativeDate.'';
}
function sc_startertitle()
diff --git a/e107_plugins/forum/templates/forum_template.php b/e107_plugins/forum/templates/forum_template.php
index 877873553..33661636f 100644
--- a/e107_plugins/forum/templates/forum_template.php
+++ b/e107_plugins/forum/templates/forum_template.php
@@ -134,9 +134,11 @@ $FORUM_TEMPLATE['main']['forum'] = "
{FORUMNAME} {FORUMDESCRIPTION}{FORUMSUBFORUMS} |
{REPLIESX} |
{THREADSX} |
- {LASTPOSTUSER} {LASTPOSTDATE} |
+ {LASTPOST:type=username} {LASTPOST:type=datelink} |
";
+//{LASTPOST:type=username} + {LASTPOST:type=datelink} can also be replaced by the legacy shortcodes {LASTPOST} or {LASTPOSTUSER} + {LASTPOSTDATE}
+
$FORUM_TEMPLATE['main']['end'] = "";
// $FORUM_WRAPPER['main']['forum']['USERINFOX'] = "{FORUM_BREADCRUMB}(html before){---}(html after)";
diff --git a/e107_plugins/gallery/css/gallery.css b/e107_plugins/gallery/css/gallery.css
index c3f9231c7..b016f4882 100644
--- a/e107_plugins/gallery/css/gallery.css
+++ b/e107_plugins/gallery/css/gallery.css
@@ -17,13 +17,13 @@ ul.gallery-cat > li > div > h3 { text-align: center }
/* SLIDESHOW */
-#gallery-slideshow-wrapper { display:block; -webkit-border-radius:5px; -moz-border-radius:5px; border-radius:5px; width: 664px; height: 146px; overflow: hidden; background: #000000; margin-left:auto;margin-right:auto }
+#gallery-slideshow-wrapper { display:block; -webkit-border-radius:5px; -moz-border-radius:5px; border-radius:5px; width: 664px; height: 146px; overflow: hidden; background: #000000; margin-left:auto;margin-right:auto; max-width:100% }
#gallery-slideshow-content { width: 3500px; }
#gallery-slideshow-content .slide { float: left; width: 679px; padding:12px; height: 146px; white-space:nowrap }
-.gallery-slideshow-controls { clear:both; width: 664px; margin-left:auto; margin-right:auto; padding-top:5px; padding-bottom:10px; }
+.gallery-slideshow-controls { clear:both; width: 664px; margin-left:auto; margin-right:auto; padding-top:5px; padding-bottom:10px; max-width:100%; }
.gallery-slide-item { margin-right:8px; display: inline-block; }
diff --git a/e107_plugins/login_menu/login_menu.php b/e107_plugins/login_menu/login_menu.php
index 14ccb84ab..e1a76af21 100644
--- a/e107_plugins/login_menu/login_menu.php
+++ b/e107_plugins/login_menu/login_menu.php
@@ -137,7 +137,7 @@ if (USER == TRUE || ADMIN == TRUE)
$menu_data['listnew_link'] = '';
if ($menu_data['new_total'] && array_key_exists('list_new', $pref['plug_installed']))
{
- $menu_data['listnew_link'] = e_PLUGIN.'list_new/list.php?new';
+ $menu_data['listnew_link'] = e_PLUGIN_ABS.'list_new/list.php?new';
}
// ------------ Pass the data & parse ------------
diff --git a/e107_plugins/news/news_months_menu.php b/e107_plugins/news/news_months_menu.php
index 77ccc5ea3..21dd51a5c 100644
--- a/e107_plugins/news/news_months_menu.php
+++ b/e107_plugins/news/news_months_menu.php
@@ -124,7 +124,7 @@ if(false === $cached)
$cached = $template['start'].implode(varset($template['separator'],''), $menu_text).$template['end'];
if($cached)
{
- if(!$parms['showarchive']) $cached .= '';
+ if(!$parms['showarchive']) $cached .= '';
$cached = $ns->tablerender(BLOGCAL_L1." ".$req_year, $cached, 'news_months_menu', true);
}
e107::getCache()->set($cString, $cached);
diff --git a/e107_plugins/news/templates/news_menu_template.php b/e107_plugins/news/templates/news_menu_template.php
index 4b4c12dc7..5a78e3a0a 100644
--- a/e107_plugins/news/templates/news_menu_template.php
+++ b/e107_plugins/news/templates/news_menu_template.php
@@ -16,25 +16,21 @@ global $sc_style;
// category menu
-$NEWS_MENU_TEMPLATE['category']['start'] = '