'. __( 'New version of Social It is available! Please download the latest version ', 'socialit' ) . '' . __( 'here', 'socialit' ) . '
'; //box cant (shouldnt) be closed
}
//import functionality
if(isset($_POST['import'])) {
if ( isset($_FILES['socialit_import_file']) && !empty($_FILES['socialit_import_file']['name']) ) {
$socialit_imported_options = join('', file($_FILES['socialit_import_file']['tmp_name']));
$code = '$socialit_imported_options = '.$socialit_imported_options.';';
if(@eval('return true;'.$code)){
if ( eval($code) === null ) {
if($_POST['export_short_urls'] != "on"){
unset($socialit_imported_options['shorturls']);
}
bb_update_option(SOCIALIT_OPTIONS, $socialit_imported_options);
$status_message = __( 'Social It Options Imported Successfully!', 'socialit' );
}else{
$error_message = __( 'Social It Options Import failed!', 'socialit' );
}
}else{
$error_message = __( 'Found syntax errors in file being imported. Social It Options Import failed!', 'socialit' );
}
}else{
$error_message = __( 'Did not receive any file to be imported. Social It Options Import failed!', 'socialit' );
}
}
//changes have been saved
if(isset($_POST['save_changes'])) {
$status_message = __( 'Your changes have been saved successfully!', 'socialit' );
$errmsgmap = array(
'bookmark' => __('You can\'t display the menu if you don\'t choose a few sites to add to it!', 'socialit'),
);
// adding to err msg map if twittley is enabled.
if (in_array('socialit-twittley', $_POST['bookmark'])) {
$errmsgmap['twittcat'] = __('You need to select the primary category for any articles submitted to Twittley.', 'socialit');
$errmsgmap['defaulttags'] = __('You need to set at least 1 default tag for any articles submitted to Twittley.', 'socialit');
}
foreach ($errmsgmap as $field=>$msg) {
if ($_POST[$field] == '') {
$error_message = $msg;
break;
}
}
if (!$error_message) {
//generate a new sprite, to reduce the size of the image, only for PHP 5 with GD
if( phpversion() >= '5' && extension_loaded( 'gd' ) && function_exists( 'gd_info' ) && !$_POST['custom-mods'] ) {
require_once( 'sprite-gen/Sprite.php' ); //main file, which includes other classes
SpriteConfig::set( 'relImageOutputDirectory', SOCIALIT_RELDIR.'/images' ); //relative to web root, this is where the generated sprite images will go
SpriteConfig::set( 'relTmplOutputDirectory', SOCIALIT_RELDIR.'/css' ); //relative to web root, this is where template files and generated CSS will go
SpriteConfig::set( 'cacheTime', 0 ); //Set the cacheTime to 0 to prevent any caching
SpriteConfig::set( 'transparentImagePath', SOCIALIT_RELDIR.'/images/1_1_trans.gif' );
foreach( $_POST['bookmark'] as $bookmark ){
$bookmark = explode( '-', $bookmark );
Sprite::ppRegister( SOCIALIT_RELDIR.'/images/icons/' . $bookmark[1] . '.png' );
}
Sprite::process(); //Now we run the processSprites() function. This MUST be run before you can access any of the Sprites in your template or elsewhere.
$socialit_plugopts['custom-css'] = SOCIALIT_PLUGPATH . 'css/' . trim(SpriteStyleRegistry::getFileName()); //cssfilename
}
foreach (array(
'topic', 'xtrastyle', 'reloption', 'targetopt', 'bookmark',
'twittid', 'ybuzzcat', 'ybuzzmed',
'twittcat', 'defaulttags', 'bgimg-yes', 'mobile-hide', 'bgimg',
'feed', 'expand', 'autocenter', 'custom-mods', 'scriptInFooter',
'sfpnonres', 'sfpres', 'sfpnonsup',
'shorty',
) as $field) $socialit_plugopts[$field] = $_POST[$field];
/* Short URLs */
$socialit_plugopts['shortyapi']['snip']['user'] = trim($_POST['shortyapiuser-snip']);
$socialit_plugopts['shortyapi']['snip']['key'] = trim($_POST['shortyapikey-snip']);
$socialit_plugopts['shortyapi']['bitly']['user'] = trim($_POST['shortyapiuser-bitly']);
$socialit_plugopts['shortyapi']['bitly']['key'] = trim($_POST['shortyapikey-bitly']);
$socialit_plugopts['shortyapi']['supr']['chk'] = $_POST['shortyapichk-supr'];
$socialit_plugopts['shortyapi']['supr']['user'] = trim($_POST['shortyapiuser-supr']);
$socialit_plugopts['shortyapi']['supr']['key'] = trim($_POST['shortyapikey-supr']);
$socialit_plugopts['shortyapi']['trim']['chk'] = $_POST['shortyapichk-trim'];
$socialit_plugopts['shortyapi']['trim']['user'] = trim($_POST['shortyapiuser-trim']);
$socialit_plugopts['shortyapi']['trim']['pass'] = trim($_POST['shortyapipass-trim']);
$socialit_plugopts['shortyapi']['tinyarrow']['chk'] = $_POST['shortyapichk-tinyarrow'];
$socialit_plugopts['shortyapi']['tinyarrow']['user'] = trim($_POST['shortyapiuser-tinyarrow']);
$socialit_plugopts['shortyapi']['cligs']['chk'] = $_POST['shortyapichk-cligs'];
$socialit_plugopts['shortyapi']['cligs']['key'] = trim($_POST['shortyapikey-cligs']);
/* Short URLs End */
bb_update_option(SOCIALIT_OPTIONS, $socialit_plugopts); //update options
}
if ($_POST['clearShortUrls']) {
$count = count($socialit_plugopts['shorturls']);
$socialit_plugopts['shorturls'] = array();
bb_update_option(SOCIALIT_OPTIONS, $socialit_plugopts);
echo '
'.$count. __(' Short URL(s) have been reset.', 'socialit') .'
';
}
}
//if there was an error,
if ($error_message != '') {
echo '