1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-06 06:38:00 +02:00

Merge pull request #34 from e107inc/master

.
This commit is contained in:
rica-carv
2016-12-09 11:07:19 +00:00
committed by GitHub
30 changed files with 578 additions and 335 deletions

View File

@@ -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("<p>Connect with our community for <a href='http://e107help.org' rel='external'>free support</a> with any e107 issues you may encounter. </p>")->render();
}
elseif($pref < $v2ReleaseDate && !file_exists($upgradeAlertFlag)) // installed prior to v2 release.
{
$message = "Connect with our community for <a href='http://e107help.org' rel='external'>free support</a> with any upgrading issues you may encounter.";
$message .= "<div class='text-right'><a class='btn btn-xs btn-primary ' href='admin.php?dismiss=upgrade'>Don't show again</a></div>"; //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();

View File

@@ -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<!-- eplug_js -->\n";
echo "<script type='text/javascript' src='{$eplug_js}'></script>\n";
if(!is_array($eplug_js))
{
$eplug_js = array($eplug_js);
}
foreach($eplug_js as $vjss)
{
echo "<script type='text/javascript' src='{$vjss}'></script>\n";
}
}
//FIXME - theme.js/user.js should be registered/rendered through e_jsmanager

View File

@@ -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']);

View File

@@ -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

View File

@@ -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 = "<pre>".print_r($message,true)."</pre>";
}

View File

@@ -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);
}

View File

@@ -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 = "<img id='{$name_id}_prev' src='".$thpath."' alt='{$default_url}' class='well well-small image-selector img-responsive' style='display:block;' />";
if($cat != 'news' && $cat !='page' && $cat !='')
if($cat != 'news' && $cat !='page' && $cat !='' && strpos($cat,'_image')===false)
{
$cat = $cat . "_image";
}

View File

@@ -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

View File

@@ -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"]);

View File

@@ -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
*

View File

@@ -1,8 +1,5 @@
<?php
use Facebook\Exceptions\FacebookSDKException;
use Facebook\Facebook as FacebookSDK;
/* !
* HybridAuth
* http://hybridauth.sourceforge.net | http://github.com/hybridauth/hybridauth
@@ -11,291 +8,424 @@ use Facebook\Facebook as FacebookSDK;
/**
* Hybrid_Providers_Facebook provider adapter based on OAuth2 protocol
*
* Hybrid_Providers_Facebook use the Facebook PHP SDK created by Facebook
*
* http://hybridauth.sourceforge.net/userguide/IDProvider_info_Facebook.html
*/
class Hybrid_Providers_Facebook extends Hybrid_Provider_Model {
/**
* Default permissions, and a lot of them. You can change them from the configuration by setting the scope to what you want/need.
* For a complete list see: https://developers.facebook.com/docs/facebook-login/permissions
*
* @link https://developers.facebook.com/docs/facebook-login/permissions
* @var array $scope
*/
public $scope = ['email', 'user_about_me', 'user_birthday', 'user_hometown', 'user_location', 'user_website', 'publish_actions', 'read_custom_friendlists'];
/**
* default permissions, and a lot of them. You can change them from the configuration by setting the scope to what you want/need
* {@inheritdoc}
*/
public $scope = "email, user_about_me, user_birthday, user_hometown, user_location, user_website, publish_actions, read_custom_friendlists";
/**
* Provider API client
*
* @var \Facebook\Facebook
*/
public $api;
/**
* Provider API client
* @var Facebook
*/
public $api;
public $useSafeUrls = true;
/**
* {@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);
}
/**
* {@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;
}
}

View File

@@ -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 = '';
}

View File

@@ -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'};

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -0,0 +1,13 @@
<?php
/**
* HybridAuth
* http://hybridauth.sourceforge.net | http://github.com/hybridauth/hybridauth
* (c) 2009-2015, HybridAuth authors | http://hybridauth.sourceforge.net/licenses.html
*/
// ------------------------------------------------------------------------
// HybridAuth End Point
// ------------------------------------------------------------------------
$_REQUEST['hauth_done'] = 'Live';
require_once( "Hybrid/Auth.php" );
require_once( "Hybrid/Endpoint.php" );
Hybrid_Endpoint::process();

View File

@@ -836,7 +836,7 @@ class e_news_category_item extends e_front_model
{
return '';
}
return (string) $this->cat('news_count');
return (string) e107::getParser()->toBadge( $this->cat('news_count'));
}
}

View File

@@ -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 @@

View File

@@ -35,7 +35,7 @@ if (!isset($COMMENT_MENU_TEMPLATE))
$COMMENT_MENU_TEMPLATE['item'] = "<li>
{CM_URL_PRE}{CM_TYPE} {CM_HEADING}{CM_URL_POST}
<div>{CM_COMMENT}</div>
<small class='muted'>{CM_AUTHOR} {CM_DATESTAMP}</small>
<small class='text-muted muted'>{CM_AUTHOR} {CM_DATESTAMP}</small>
</li>";
$COMMENT_MENU_TEMPLATE['end'] = "</ul>";

View File

@@ -1415,7 +1415,7 @@ $columnInfo = array(
$text .= " </select>";
*/
$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 .= " </select>";
*/
$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 .= "

View File

@@ -507,7 +507,7 @@ class forum_shortcodes extends e_shortcode
// code to be executed if n is different from all labels;
}
}
return $relativeDate.'<br />'.$lastpost_username." <a href='".$url."'>".IMAGE_post2.'</a>';
return $lastpost_username." <a href='".$url."'>".$relativeDate.'</a>';
}
function sc_startertitle()

View File

@@ -134,9 +134,11 @@ $FORUM_TEMPLATE['main']['forum'] = "<tr>
<td>{FORUMNAME}<br /><small>{FORUMDESCRIPTION}</small>{FORUMSUBFORUMS}</td>
<td class='hidden-xs text-center'>{REPLIESX}</td>
<td class='text-center'>{THREADSX}</td>
<td class='hidden-xs text-center'><small>{LASTPOSTUSER} {LASTPOSTDATE}</small></td>
<td class='hidden-xs text-center'><small>{LASTPOST:type=username} {LASTPOST:type=datelink}</small></td>
</tr>";
//{LASTPOST:type=username} + {LASTPOST:type=datelink} can also be replaced by the legacy shortcodes {LASTPOST} or {LASTPOSTUSER} + {LASTPOSTDATE}
$FORUM_TEMPLATE['main']['end'] = "</table><div class='forum-footer center'><small>{USERINFOX}</small></div></div>";
// $FORUM_WRAPPER['main']['forum']['USERINFOX'] = "{FORUM_BREADCRUMB}(html before){---}(html after)";

View File

@@ -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; }

View File

@@ -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 ------------

View File

@@ -124,7 +124,7 @@ if(false === $cached)
$cached = $template['start'].implode(varset($template['separator'],''), $menu_text).$template['end'];
if($cached)
{
if(!$parms['showarchive']) $cached .= '<ul class="nav nav-list e-menu-link news-menu-archive"><li><a href="'.e_PLUGIN_ABS.'blogcalendar_menu/archive.php">'.BLOGCAL_L2.'</a></li></ul>';
if(!$parms['showarchive']) $cached .= '<div class="e-menu-link news-menu-archive"><a class="btn btn-default btn-sm" href="'.e_PLUGIN_ABS.'blogcalendar_menu/archive.php">'.BLOGCAL_L2.'</a></div>';
$cached = $ns->tablerender(BLOGCAL_L1." ".$req_year, $cached, 'news_months_menu', true);
}
e107::getCache()->set($cString, $cached);

View File

@@ -16,25 +16,21 @@ global $sc_style;
// category menu
$NEWS_MENU_TEMPLATE['category']['start'] = '<ul class="nav nav-list news-menu-category">';
$NEWS_MENU_TEMPLATE['category']['start'] = '<ul class="news-menu-category">';
$NEWS_MENU_TEMPLATE['category']['end'] = '</ul>';
$NEWS_MENU_TEMPLATE['category']['item'] = '
<li><a class="e-menu-link newscats{active}" href="{NEWS_CATEGORY_URL}">{NEWS_CATEGORY_TITLE} <span>{NEWS_CATEGORY_NEWS_COUNT}</span></a></li>
<li><a class="e-menu-link newscats{active}" href="{NEWS_CATEGORY_URL}">{NEWS_CATEGORY_TITLE}{NEWS_CATEGORY_NEWS_COUNT}</a></li>
';
$NEWS_MENU_WRAPPER['category']['NEWS_CATEGORY_NEWS_COUNT'] = "({---})"; // Wrap brackets around the news count when value is returned.
//$NEWS_MENU_TEMPLATE['category']['separator'] = '<br />';
// months menu
$NEWS_MENU_TEMPLATE['months']['start'] = '<ul class="nav nav-list news-menu-months">';
$NEWS_MENU_TEMPLATE['months']['start'] = '<ul class="news-menu-months">';
$NEWS_MENU_TEMPLATE['months']['end'] = '</ul>';
$NEWS_MENU_TEMPLATE['months']['item'] = '
<li><a class="e-menu-link newsmonths{active}" href="{url}">{month} <span>({count})</span></a></li>
<li><a class="e-menu-link newsmonths{active}" href="{url}">{month} <span class="badge">{count}</span></a></li>
';
//$NEWS_MENU_TEMPLATE['months']['separator'] = '<br />';
@@ -44,11 +40,10 @@ $NEWS_MENU_TEMPLATE['months']['item'] = '
// latest menu
$NEWS_MENU_TEMPLATE['latest']['start'] = '<ul class="nav nav-list news-menu-latest">';
$NEWS_MENU_TEMPLATE['latest']['start'] = '<ul class="news-menu-latest">';
$NEWS_MENU_TEMPLATE['latest']['end'] = '</ul>'; // Example: $NEWS_MENU_TEMPLATE['latest']['end'] '<br />{currentTotal} from {total}';
$NEWS_MENU_TEMPLATE['latest']['item'] = '<li><a class="e-menu-link newsmonths" href="{NEWSURL}">{NEWSTITLE} <span>{NEWSCOMMENTCOUNT}</span></a></li>';
$NEWS_MENU_TEMPLATE['latest']['item'] = '<li><a class="e-menu-link newsmonths" href="{NEWSURL}">{NEWSTITLE} <span class="badge">{NEWSCOMMENTCOUNT}</span></a></li>';
$NEWS_MENU_WRAPPER['latest']['NEWSCOMMENTCOUNT'] = "({---})";

View File

@@ -83,7 +83,7 @@ else
{ONLINE_MEMBER_NEWEST}
<li>
{ONLINE_MOST}
<small class='muted'>
<small class='text-muted muted'>
{ONLINE_MOST_GUESTS}
{ONLINE_MOST_MEMBERS}
{ONLINE_MOST_DATESTAMP}

View File

@@ -136,6 +136,12 @@ table label.checkbox {
margin-left: 20px;
}
/* Fix sidebar list alignments */
#sidebar .panel-body span.badge { float:right}
#sidebar .panel-body ul { padding-left:15px }
#sidebar .panel-body ul li { padding-bottom:8px }
#sidebar .panel-body ul.list-unstyled { padding-left:0}

View File

@@ -190,12 +190,14 @@ class theme_shortcodes extends e_shortcode
// Logged in.
//TODO Generic LANS. (not theme LANs)
$userNameLabel = !empty($parm['username']) ? USERNAME : '';
$text = '
<ul class="nav navbar-nav navbar-right'.$direction.'">
<li class="dropdown">{PM_NAV}</li>
<li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown">{SETIMAGE: w=20} {USER_AVATAR: shape=circle} '. USERNAME.' <b class="caret"></b></a>
<li class="dropdown dropdown-avatar"><a href="#" class="dropdown-toggle" data-toggle="dropdown">{SETIMAGE: w=30} {USER_AVATAR: shape=circle} '. $userNameLabel.' <b class="caret"></b></a>
<ul class="dropdown-menu">
<li>
<a href="{LM_USERSETTINGS_HREF}"><span class="glyphicon glyphicon-cog"></span> '.LAN_SETTINGS.'</a>

View File

@@ -529,6 +529,12 @@ img.news-image-1 { margin-bottom:15px }
.othernews2-block a.btn { display: none; }
.othernews2-block img { width:72px; }
.menu span.badge { float:right}
.menu ul { padding-left:15px; margin-left:15px }
.menu ul li { padding-bottom:8px }
.menu ul.list-unstyled { padding-left:0}
/* Extra small devices Phones (<768px) .col-xs */