1
0
mirror of https://github.com/e107inc/e107.git synced 2025-04-19 20:21:51 +02:00

XURL definitions added for facebook, twitter etc.

This commit is contained in:
Cameron 2013-03-11 02:32:19 -07:00
parent c89363e784
commit 14044fc25a
5 changed files with 45 additions and 29 deletions

View File

@ -992,35 +992,37 @@ $text .= "
<tbody>
<tr>
<th colspan='2'>External Social Pages</th>
</tr>
</tr>";
//XXX XURL Definitions.
$xurls = array(
'facebook' => array('label'=>"Facebook", "placeholder"=>"eg. https://www.facebook.com/e107CMS"),
'twitter' => array('label'=>"Twitter", "placeholder"=>"eg. https://twitter.com/e107"),
'youtube' => array('label'=>"Youtube", "placeholder"=>"eg.https://youtube.com/e107Inc"),
'google' => array('label'=>"Google+", "placeholder"=>"eg.. "),
'linkedin' => array('label'=>"LinkedIn", "placeholder"=>"eg. http://www.linkedin.com/groups?home=&gid=1782682")
);
foreach($xurls as $k=>$var)
{
$keypref = "xurl[".$k."]";
$def = "XURL_". strtoupper($k);
$opts = array('size'=>'xxlarge','placeholder'=> $var['placeholder']);
$text .= "
<tr>
<td>Your Facebook page</td>
<td>Your ".$var['label']." page</td>
<td>
".$frm->text('facebook_link', $pref['facebook_link'])."
<div class='field-help'>Used in some themes to provide a link to your Facebook page. (FACEBOOK_LINK)</div>
</td>
</tr>
<tr>
<td>Your Twitter page</td>
<td>
".$frm->text('twitter_link', $pref['twitter_link'])."
<div class='field-help'>Used in some themes to provide a link to your Twitter page. (TWITTER_LINK)</div>
</td>
</tr>
<tr>
<td>Your Youtube page</td>
<td>
".$frm->text('youtube_link', $pref['youtube_link'])."
<div class='field-help'>Used in some themes to provide a link to your Youtube page. (YOUTUBE_LINK)</div>
".$frm->text($keypref, $pref['xurl'][$k], false, $opts)."
<div class='field-help'>Used by some themes to provide a link to your ".$var['label']." page. (".$def.")</div>
</td>
</tr>
<tr>
<td>Your Google+ page</td>
<td>
".$frm->text('google_link', $pref['google_link'])."
<div class='field-help'>Used in some themes to provide a link to your Google+ page. (GOOGLE_LINK)</div>
</td>
</tr>
";
}
$text .= "
<tr>
<th colspan='2'>Social Logins</th>
</tr>

View File

@ -223,10 +223,13 @@ function update_check()
//--------------------------------------------
function update_core_prefs($type='')
{
global $pref, $e107info;
$pref = e107::getPref();
global $e107info;
$admin_log = e107::getAdminLog();
$do_save = FALSE;
$should = get_default_prefs();
$just_check = $type == 'do' ? FALSE : TRUE; // TRUE if we're just seeing if an update is needed

View File

@ -341,6 +341,7 @@ City, State, Country
<core name="wmessage_sc">0</core>
<core name="wysiwyg">1</core>
<core name="xup_enabled">1</core>
<core name="xurl">1</core>
<core name="xmlfeed_languagepacks">http://www.e107.org/themeupdate.php</core>
<core name="xmlfeed_security">http://www.e107.org/themeupdate.php</core>
<emote name="alien!png">!alien</emote>

View File

@ -2605,6 +2605,8 @@ class e107
define('e_UC_MEMBER', 253);
define('e_UC_ADMIN', 254);
define('e_UC_NOBODY', 255);
return $this;
}
@ -2966,6 +2968,14 @@ class e107
define('e_LOGIN', SITEURL.(file_exists(e_BASE.'customlogin.php') ? 'customlogin.php' : 'login.php'));
}
$pref = e107::getPref('xurl');
define('XURL_FACEBOOK', vartrue($pref['facebook'],false));
define('XURL_TWITTER', vartrue($pref['twitter'],false));
define('XURL_YOUTUBE', vartrue($pref['youtube'],false));
define('XURL_GOOGLE', vartrue($pref['google'],false));
define('XURL_LINKEDIN', vartrue($pref['linkedin'],false));
return $this;
}

View File

@ -221,17 +221,17 @@ class e_form
}
}
if(vartrue($options['size']) && is_numeric($options['size']))
if(vartrue($options['size']) && !is_numeric($options['size']))
{
$options['class'] .= " input-".$options['size'];
unset($options['size']); // don't include in html 'size='.
}
$mlength = vartrue($maxlength) ? "maxlength=".$maxlength : "";
$options = $this->format_options('text', $name, $options);
//never allow id in format name-value for text fields
return "<input type='text' name='{$name}' value='{$value}' maxlength='{$maxlength}'".$this->get_attributes($options, $name)." />";
return "<input type='text' name='{$name}' value='{$value}' {$mlength} ".$this->get_attributes($options, $name)." />";
}