diff --git a/e107_core/shortcodes/batch/signup_shortcodes.php b/e107_core/shortcodes/batch/signup_shortcodes.php index 07e40eda9..d52e5a4ca 100755 --- a/e107_core/shortcodes/batch/signup_shortcodes.php +++ b/e107_core/shortcodes/batch/signup_shortcodes.php @@ -89,7 +89,7 @@ class signup_shortcodes extends e_shortcode // 'signup' Creates a new XUP user if not found, otherwise it logs the person in. $button = (defset('FONTAWESOME') === 4) ? $tp->toGlyph('fa-'.$ic, array('size'=>$size)) : ""; - $text .= " ".$button." "; + $text .= " ".$button." "; } //TODO different icon options. see: http://zocial.smcllns.com/ } @@ -129,7 +129,7 @@ class signup_shortcodes extends e_shortcode $ic = 'windows'; } - $button = (defset('FONTAWESOME') === 4) ? "".$tp->toGlyph('fa-'.$ic, array('size'=>$size))."" : ""; + $button = (defset('FONTAWESOME') === 4) ? "".$tp->toGlyph('fa-'.$ic, array('size'=>$size))."" : ""; $text .= " ".$button." "; } diff --git a/e107_handlers/user_handler.php b/e107_handlers/user_handler.php index ecb41581a..e0e8ec42c 100644 --- a/e107_handlers/user_handler.php +++ b/e107_handlers/user_handler.php @@ -50,7 +50,7 @@ define ('PASSWORD_DEFAULT_TYPE',PASSWORD_E107_MD5); //define ('PASSWORD_DEFAULT_TYPE',PASSWORD_E107_SALT); // Required language file - if not loaded elsewhere, uncomment next line -//include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_user.php'); +include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_user.php'); class UserHandler { diff --git a/e107_languages/English/lan_email.php b/e107_languages/English/lan_email.php index 2b366dc55..5ad09f082 100644 --- a/e107_languages/English/lan_email.php +++ b/e107_languages/English/lan_email.php @@ -33,5 +33,6 @@ define("LAN_EMAIL_187", "Email address to send to"); define("LAN_EMAIL_188", "I thought you might be interested in this news story from"); define("LAN_EMAIL_189", "I thought you might be interested in this article from"); define("LAN_EMAIL_190", "Enter visible code"); +define("LAN_SOCIAL_LINK_CHK", "Check out this link: "); //called in soc.plugin ?> \ No newline at end of file diff --git a/e107_languages/English/lan_user.php b/e107_languages/English/lan_user.php index f2941a779..b34598712 100644 --- a/e107_languages/English/lan_user.php +++ b/e107_languages/English/lan_user.php @@ -115,6 +115,14 @@ define("LAN_USER_84", "This will prevent your email address from being displayed define("LAN_USER_85", "If you want to change your user name, you must ask a site administrator"); define("LAN_USER_86", "Maximum avatar size is --WIDTH-- x --HEIGHT-- pixels"); +// social plugin +define("LAN_XUP_ERRM_01", "Signup failed! This feature is disabled."); +define("LAN_XUP_ERRM_02", "Signup failed! Wrong provider."); +define("LAN_XUP_ERRM_03", "Log in Failed! Wrong provider."); +define("LAN_XUP_ERRM_04", "Signup failed! User already signed in."); +define("LAN_XUP_ERRM_05", "Signup failed! User already exists. Please use 'login' instead."); +define("LAN_XUP_ERRM_06", "Signup failed! Can't access user email - registration without an email is impossible."); + // Error messages for when user data is missing. Done this way so that other code can override the default messages diff --git a/e107_plugins/social/admin_config.php b/e107_plugins/social/admin_config.php index c16ae10a5..a7a67d666 100644 --- a/e107_plugins/social/admin_config.php +++ b/e107_plugins/social/admin_config.php @@ -9,6 +9,8 @@ if (!getperms('P')) exit; } +e107::lan('social',true, true); +e107::lan('social',false, true); class social_adminarea extends e_admin_dispatcher { @@ -71,29 +73,29 @@ class social_ui extends e_admin_ui protected $fieldpref = array(); - protected $preftabs = array("Sharing", 'Facebook Comments', 'Facebook Menu', 'Twitter Menu', ); + protected $preftabs = array(" ".LAN_SOCIAL_ADMIN_14." ", LAN_SOCIAL_ADMIN_15, LAN_SOCIAL_ADMIN_16, LAN_SOCIAL_ADMIN_17, ); protected $prefs = array( - 'facebook_comments_limit' => array('title'=> 'Limit', 'type'=>'number', 'tab'=>1, 'data' => 'int','help'=>'Number of comments to display.'), - 'facebook_comments_theme' => array('title'=> 'Theme', 'type'=>'dropdown', 'tab'=>1, 'writeParms'=>array('optArray'=>array('light'=>'Light','dark'=>'Dark')), 'data' => 'str','help'=>''), - 'facebook_comments_loadingtext' => array('title'=> 'Text while loading', 'type'=>'text', 'tab'=>1, 'data' => 'str', 'writeParms'=>array('placeholder'=>'Loading...'), 'help'=>''), + 'facebook_comments_limit' => array('title'=> LAN_SOCIAL_ADMIN_18, 'type'=>'number', 'tab'=>1, 'data' => 'int','help'=>LAN_SOCIAL_ADMIN_29), + 'facebook_comments_theme' => array('title'=> LAN_SOCIAL_ADMIN_19, 'type'=>'dropdown', 'tab'=>1, 'writeParms'=>array('optArray'=>array('light'=>LAN_SOCIAL_ADMIN_35,'dark'=>LAN_SOCIAL_ADMIN_36)), 'data' => 'str','help'=>''), + 'facebook_comments_loadingtext' => array('title'=> LAN_SOCIAL_ADMIN_21, 'type'=>'text', 'tab'=>1, 'data' => 'str', 'writeParms'=>array('placeholder'=>LAN_SOCIAL_ADMIN_30), 'help'=>''), - 'facebook_like_menu_theme' => array('title'=> 'Theme', 'type'=>'dropdown', 'tab'=>2, 'writeParms'=>array('optArray'=>array('light'=>'Light','dark'=>'Dark')), 'data' => 'str'), - 'facebook_like_menu_action' => array('title'=> 'Action', 'type'=>'dropdown', 'tab'=>2, 'writeParms'=>array('optArray'=>array('like'=>'Like','recommend'=>'Recommend')), 'data' => 'str'), - 'facebook_like_menu_width' => array('title'=> 'Width', 'type'=>'number', 'tab'=>2, 'data' => 'int','help'=>'Width in px'), + 'facebook_like_menu_theme' => array('title'=> LAN_SOCIAL_ADMIN_19, 'type'=>'dropdown', 'tab'=>2, 'writeParms'=>array('optArray'=>array('light'=>LAN_SOCIAL_ADMIN_35,'dark'=>LAN_SOCIAL_ADMIN_36)), 'data' => 'str'), + 'facebook_like_menu_action' => array('title'=> LAN_SOCIAL_ADMIN_20, 'type'=>'dropdown', 'tab'=>2, 'writeParms'=>array('optArray'=>array('like'=>'Like','recommend'=>LAN_SOCIAL_ADMIN_32)), 'data' => 'str'), + 'facebook_like_menu_width' => array('title'=> LAN_SOCIAL_ADMIN_22, 'type'=>'number', 'tab'=>2, 'data' => 'int','help'=>LAN_SOCIAL_ADMIN_31), // 'facebook_like_menu_ref' => array('title'=> "Referrer", 'type'=>'text', 'tab'=>2, 'data' => 'str', 'writeParms'=>'size=xxlarge', 'help'=>'Leave blank to use Site Url'), - 'twitter_menu_theme' => array('title'=> 'Theme', 'type'=>'dropdown', 'tab'=>3, 'writeParms'=>array('optArray'=>array('light'=>'Light','dark'=>'Dark')), 'data' => 'str'), - 'twitter_menu_height' => array('title'=> 'Height', 'type'=>'number', 'tab'=>3, 'data' => 'int','help'=>'Height in px'), - 'twitter_menu_limit' => array('title'=> 'Limit', 'type'=>'number', 'tab'=>3, 'data' => 'int','help'=>'Number of tweets to display.'), + 'twitter_menu_theme' => array('title'=> LAN_SOCIAL_ADMIN_19, 'type'=>'dropdown', 'tab'=>3, 'writeParms'=>array('optArray'=>array('light'=>LAN_SOCIAL_ADMIN_35,'dark'=>LAN_SOCIAL_ADMIN_36)), 'data' => 'str'), + 'twitter_menu_height' => array('title'=> LAN_SOCIAL_ADMIN_23, 'type'=>'number', 'tab'=>3, 'data' => 'int','help'=>LAN_SOCIAL_ADMIN_33), + 'twitter_menu_limit' => array('title'=> LAN_SOCIAL_ADMIN_18, 'type'=>'number', 'tab'=>3, 'data' => 'int','help'=>LAN_SOCIAL_ADMIN_34), - 'sharing_mode' => array('title'=> 'Display Mode', 'type'=>'dropdown', 'tab'=>0, 'writeParms'=>array('optArray'=>array('normal'=>'Normal','dropdown'=>'Dropdown','off'=>'Disabled')), 'data' => 'str','help'=>''), - 'sharing_hashtags' => array('title'=> 'Hashtags', 'type'=>'tags', 'tab'=>0, 'data' => 'str','help'=>'Excluding the # symbol.'), + 'sharing_mode' => array('title'=> LAN_SOCIAL_ADMIN_24, 'type'=>'dropdown', 'tab'=>0, 'writeParms'=>array('optArray'=>array('normal'=>LAN_SOCIAL_ADMIN_25,'dropdown'=>LAN_SOCIAL_ADMIN_26,'off'=>LAN_SOCIAL_ADMIN_27)), 'data' => 'str','help'=>''), + 'sharing_hashtags' => array('title'=> 'Hashtags', 'type'=>'tags', 'tab'=>0, 'data' => 'str','help'=>LAN_SOCIAL_ADMIN_28), 'sharing_providers' => array('title'=> 'Providers', 'type'=>'checkboxes', 'tab'=>0, 'writeParms'=>array(), 'data' => 'str','help'=>''), ); @@ -263,14 +265,13 @@ class social_ui extends e_admin_ui { $this->testUrl = SITEURL."?route=system/xup/test"; - $notice = "Note: In most cases you will need to obtain an id and secret key from one of the providers. Click the blue links to the right to configure. -
You may test your configuration with the following URL:
".$this->testUrl.""; + $notice = "".LAN_SOCIAL_ADMIN_08."
".$this->testUrl.""; $callBack = SITEURL."index.php"; - $notice .= "

Your callback URL is:
".$callBack.""; + $notice .= "

".LAN_SOCIAL_ADMIN_09."
".$callBack.""; - return array("caption"=>"Help",'text'=> $notice); + return array("caption"=>LAN_HELP,'text'=> $notice); } @@ -294,11 +295,11 @@ class social_ui extends e_admin_ui - + ".$frm->radio_switch('social_login_active', $pref['social_login_active'])." -
Allows users to signup/login with their social media accounts. When enabled, this option will still allow users to signup/login even if the core user registration system above is disabled.
+
".LAN_SOCIAL_ADMIN_07."
@@ -315,10 +316,10 @@ class social_ui extends e_admin_ui - Provider - Key/ID - Secret - Signup/Login + ".LAN_SOCIAL_ADMIN_04." + ".LAN_SOCIAL_ADMIN_05." + ".LAN_SOCIAL_ADMIN_06." + ".LAN_SOCIAL_ADMIN_03." @@ -334,7 +335,7 @@ class social_ui extends e_admin_ui $textKeys = ''; $textScope = ''; $keyCount= array(); - $label = varset($this->social_external[$prov]) ? "".$prov."" : $prov; + $label = varset($this->social_external[$prov]) ? "".$prov."" : $prov; $radio_label = strtolower($prov); $text .= " @@ -450,10 +451,10 @@ class social_ui extends e_admin_ui $text2 .= " - + ".$frm->text($keypref, $pref['xurl'][$k], false, $opts)." -
Used by some themes to provide a link to your ".$var['label']." page. (".$def.")
+
".LAN_SOCIAL_ADMIN_13." ".$var['label']." ".LAN_SOCIAL_ADMIN_12." (".$def.")
"; @@ -468,8 +469,8 @@ class social_ui extends e_admin_ui "; $tabs = array(); - $tabs[] = array('caption'=>"Applications", 'text'=>$text); - $tabs[] = array('caption'=>'Pages', 'text'=>$text2); + $tabs[] = array('caption'=> LAN_SOCIAL_ADMIN_00, 'text'=>$text); + $tabs[] = array('caption'=> LAN_SOCIAL_ADMIN_01, 'text'=>$text2); $ret = $frm->open('social','post',null, 'class=form-horizontal').$frm->tabs($tabs); diff --git a/e107_plugins/social/e_shortcode.php b/e107_plugins/social/e_shortcode.php index 0e4a11735..e97e3d8ff 100644 --- a/e107_plugins/social/e_shortcode.php +++ b/e107_plugins/social/e_shortcode.php @@ -7,7 +7,7 @@ */ if (!defined('e107_INIT')) { exit; } - +e107::lan('social',false, true); @@ -18,25 +18,24 @@ class social_shortcodes extends e_shortcode public function getProviders() { - $emailMessage = "Check out this link: "; //TODO LAN + $emailMessage = LAN_SOCIAL_LINK_CHK; - //TODO LANS ie. "Share on [x]" in English_global.php - - $providers = array( - 'email' => array('icon' => 'e-social-mail', 'title'=>"Email to someone", 'url' => "mailto:EMAIL_RECIPIENT?subject=[t]&body=".rawurlencode($emailMessage)."[u]"), - 'facebook-like' => array('icon' => 'e-social-thumbs-up', 'title'=>"Like on Facebook", 'url' => "http://www.facebook.com/plugins/like.php?href=[u]"), - 'facebook-share' => array('icon' => 'e-social-facebook', 'title'=>"Share on Facebook", 'url' => "http://www.facebook.com/sharer.php?u=[u]&t=[t]"), - 'twitter' => array('icon' => 'e-social-twitter', 'title'=>"Share on Twitter", 'url' => "http://twitter.com/share?url=[u]&text=[t]"), - 'google-plus1' => array('icon' => 'e-social-gplus', 'title'=>"+1 on Google", 'url' => "https://apis.google.com/_/+1/fastbutton?usegapi=1&size=large&hl=en&url=[u]"), + + $providers = array( + 'email' => array('icon' => 'e-social-mail', 'title'=>" ".LAN_SOCIAL_002." ", 'url' => "mailto:EMAIL_RECIPIENT?subject=[t]&body=".rawurlencode($emailMessage)."[u]"), + 'facebook-like' => array('icon' => 'e-social-thumbs-up', 'title'=>" ".LAN_SOCIAL_001." Facebook", 'url' => "http://www.facebook.com/plugins/like.php?href=[u]"), + 'facebook-share' => array('icon' => 'e-social-facebook', 'title'=>" ".LAN_SOCIAL_000." Facebook", 'url' => "http://www.facebook.com/sharer.php?u=[u]&t=[t]"), + 'twitter' => array('icon' => 'e-social-twitter', 'title'=>"".LAN_SOCIAL_000." Twitter", 'url' => "http://twitter.com/share?url=[u]&text=[t]"), + 'google-plus1' => array('icon' => 'e-social-gplus', 'title'=>" ".LAN_SOCIAL_003." ", 'url' => "https://apis.google.com/_/+1/fastbutton?usegapi=1&size=large&hl=en&url=[u]"), // 'google-plus' => array('icon' => 'fa-google-plus', 'title'=>"On Google Plus", 'url' => "https://plusone.google.com/_/+1/confirm?hl=en&url=[u]"), - 'linkedin' => array('icon' => 'e-social-linkedin', 'title'=>"Share on LinkedIn", 'url' => "http://www.linkedin.com/shareArticle?mini=true&url=[u]"), - 'pinterest' => array('icon' => 'e-social-pinterest', 'title'=>"Share on Pinterest", 'url' => "http://www.pinterest.com/pin/create/button/?url=[u]&description=[t]&media=[m]"), + 'linkedin' => array('icon' => 'e-social-linkedin', 'title'=>"".LAN_SOCIAL_000." LinkedIn", 'url' => "http://www.linkedin.com/shareArticle?mini=true&url=[u]"), + 'pinterest' => array('icon' => 'e-social-pinterest', 'title'=>"".LAN_SOCIAL_000." Pinterest", 'url' => "http://www.pinterest.com/pin/create/button/?url=[u]&description=[t]&media=[m]"), // 'thumblr' => array('icon' => 'fa-tumblr', 'title'=>"On Tumblr", 'url' => "http://www.tumblr.com/share/link?url=[u]&name=[t]&description=[d]"), - 'stumbleupon' => array('icon' => 'e-social-stumbleupon', 'title'=>"Share on StumbleUpon",'url' => "http://www.stumbleupon.com/submit?url=[u]&title=[t]"), - 'reddit' => array('icon' => 'e-social-reddit', 'title'=>"Share on Reddit", 'url' => "http://reddit.com/submit?url=[u]&title=[t]"), - 'digg' => array('icon' => 'e-social-digg', 'title'=>"Share on Digg", 'url' => "http://www.digg.com/submit?url=[u]"), - + 'stumbleupon' => array('icon' => 'e-social-stumbleupon', 'title'=>"".LAN_SOCIAL_000." StumbleUpon",'url' => "http://www.stumbleupon.com/submit?url=[u]&title=[t]"), + 'reddit' => array('icon' => 'e-social-reddit', 'title'=>"".LAN_SOCIAL_000." Reddit", 'url' => "http://reddit.com/submit?url=[u]&title=[t]"), + 'digg' => array('icon' => 'e-social-digg', 'title'=>"".LAN_SOCIAL_000." Digg", 'url' => "http://www.digg.com/submit?url=[u]"), + //http://reddit.com/submit?url=http%3A%2F%2Fwebsite.com&title=Website%20Title // no fa icon available //http://www.digg.com/submit?url=http%3A%2F%2Fwebsite.com // no fa icon available ); @@ -135,7 +134,7 @@ class social_shortcodes extends e_shortcode if(!empty($parm['label'])) { - $text .= "

Sign in with:

"; + $text .= "

".LAN_PLUGIN_SOCIAL_SIGNIN."

"; } $text .= $sc->sc_signup_xup_login($parm); @@ -351,7 +350,7 @@ class social_shortcodes extends e_shortcode $account = basename(XURL_TWITTER); //data-related="twitterapi,twitter" - $text = 'Tweets by @'.$account.''; + $text = ''.LAN_SOCIAL_201.'@'.$account.''; $text .= <<"; e107::getRender()->tablerender('Facebook',$text,'twitter-menu'); } \ No newline at end of file diff --git a/e107_plugins/social/languages/English/English_admin.php b/e107_plugins/social/languages/English/English_admin.php new file mode 100644 index 000000000..64fd8fe51 --- /dev/null +++ b/e107_plugins/social/languages/English/English_admin.php @@ -0,0 +1,49 @@ + Click the blue links to the right to configure.

You may test your configuration with the following URL:"); +define("LAN_SOCIAL_ADMIN_09", "Your callback URL is: "); +define("LAN_SOCIAL_ADMIN_10", "Get a key from the provider"); +define("LAN_SOCIAL_ADMIN_11", "Your"); +define("LAN_SOCIAL_ADMIN_12", "page"); +define("LAN_SOCIAL_ADMIN_13", "Used by some themes to provide a link to your "); +define("LAN_SOCIAL_ADMIN_14", "Sharing"); +define("LAN_SOCIAL_ADMIN_15", "Facebook Comments"); +define("LAN_SOCIAL_ADMIN_16", "Facebook Menu"); +define("LAN_SOCIAL_ADMIN_17", "Twitter Menu"); +define("LAN_SOCIAL_ADMIN_18", "Limit"); +define("LAN_SOCIAL_ADMIN_19", "Theme"); +define("LAN_SOCIAL_ADMIN_20", "Action"); +define("LAN_SOCIAL_ADMIN_21", "Text while loading"); +define("LAN_SOCIAL_ADMIN_22", "Width"); +define("LAN_SOCIAL_ADMIN_23", "Height"); +define("LAN_SOCIAL_ADMIN_24", "Display Mode"); +define("LAN_SOCIAL_ADMIN_25", "Normal"); +define("LAN_SOCIAL_ADMIN_26", "Dropdown"); +define("LAN_SOCIAL_ADMIN_27", "Disabled"); +define("LAN_SOCIAL_ADMIN_28", "Excluding the # symbol."); +define("LAN_SOCIAL_ADMIN_29", "Number of comments to display."); +define("LAN_SOCIAL_ADMIN_30", "Loading..."); +define("LAN_SOCIAL_ADMIN_31", "Width in px"); +define("LAN_SOCIAL_ADMIN_32", "Recommend"); +define("LAN_SOCIAL_ADMIN_33", "Height in px"); +define("LAN_SOCIAL_ADMIN_34", "Number of tweets to display."); +define("LAN_SOCIAL_ADMIN_35", "Light"); +define("LAN_SOCIAL_ADMIN_36", "Dark"); + + +?> \ No newline at end of file diff --git a/e107_plugins/social/languages/English/English_front.php b/e107_plugins/social/languages/English/English_front.php new file mode 100644 index 000000000..cd26e8165 --- /dev/null +++ b/e107_plugins/social/languages/English/English_front.php @@ -0,0 +1,25 @@ + \ No newline at end of file diff --git a/e107_plugins/social/languages/English/English_global.php b/e107_plugins/social/languages/English/English_global.php new file mode 100644 index 000000000..53da5bccb --- /dev/null +++ b/e107_plugins/social/languages/English/English_global.php @@ -0,0 +1,17 @@ + \ No newline at end of file diff --git a/e107_plugins/social/plugin.xml b/e107_plugins/social/plugin.xml index ef0ddefcb..3fae77705 100644 --- a/e107_plugins/social/plugin.xml +++ b/e107_plugins/social/plugin.xml @@ -2,8 +2,8 @@ settings - Adds Facebook, Twitter and other social media widgets to e107. - Adds options to replace the e107 comment engine with Facebook. Add Twitter feeds to your site. etc. + Adds Facebook, Twitter and other social media widgets to e107. + Adds options to replace the e107 comment engine with Facebook. Add Twitter feeds to your site. etc. facebook twitter diff --git a/e107_plugins/social/twitter_menu.php b/e107_plugins/social/twitter_menu.php index f3ed8821b..a209c13fe 100644 --- a/e107_plugins/social/twitter_menu.php +++ b/e107_plugins/social/twitter_menu.php @@ -9,8 +9,9 @@ */ //@see https://dev.twitter.com/web/embedded-timelines +e107::lan('social',false, true); -if(deftrue('XURL_TWITTER')) +if(deftrue('XURL_TWITTER')) { e107::js('footer-inline', ' @@ -30,14 +31,14 @@ if(deftrue('XURL_TWITTER')) - $text = ''; + $text = ''; e107::getRender()->tablerender('Twitter',$text,'twitter-menu'); }elseif(ADMIN) { - $text = "
Unable to display feed. Twitter URL has not been defined in preferences.
"; + $text = "
".LAN_SOCIAL_200."
"; e107::getRender()->tablerender('Twitter',$text,'twitter-menu'); } \ No newline at end of file