', $name, $hint, @in_array($name, $socialit_plugopts['bookmark'])?'checked="checked" ':"", $name, $name ); } // returns the option tag for a form select element // $opts array expecting keys: field, value, text function socialit_form_select_option($opts) { global $socialit_plugopts; $opts = array_merge( array( 'field'=>'', 'value'=>'', 'text'=>'', ), $opts ); return sprintf('%s', ($socialit_plugopts[$opts['field']]==$opts['value'])?' selected="selected"':"", $opts['value'], $opts['text'] ); } // given an array $options of data and $field to feed into sexy_form_select_option function socialit_select_option_group($field, $options) { $h=''; foreach ($options as $value => $text) { $h .= socialit_form_select_option(array( 'field' => $field, 'value' => $value, 'text' => $text, )); } return $h; } //curl, file get contents or nothing, used for short url and for updater function socialit_nav_browse($url, $method = 'GET', $data = array()){ return wp_remote_retrieve_body( wp_remote_request( $url, array( 'method' => $method, 'body' => $data, 'user-agent' => 'Social It/bbPress v' . SOCIALIT_VER ) ) ); } //check for updates, as bbpress doesnt check itself :( function socialit_update_check(){ $latest_ver = socialit_nav_browse("http://gaut.am/uploads/plugins/updater.php?pid=1&chk=ver&soft=bb¤t=".SOCIALIT_VER); if($latest_ver && version_compare($latest_ver, SOCIALIT_VER, '>')){ return $latest_ver; }else{ return false; } } //add sidebar link to settings page function socialit_menu_link() { bb_admin_add_submenu( __( 'Social It', 'social-it' ), 'administrate', 'socialit_settings_page', 'options-general.php' ); } //write settings page function socialit_settings_page() { global $socialit_plugopts, $socialit_bookmarks_data, $bbdb; echo "\n\n".''."\n"; echo ''; //some links $donate_link = "http://gaut.am/donate/"; $twitter_link = "http://twitter.com/Gaut_am"; // processing form submission $status_message = ""; $error_message = ""; if($_POST['custom-mods'] == 'yes' || $socialit_plugopts['custom-mods'] == 'yes') { if(bb_is_admin() && !is_dir(BB_PATH.'socialit-mods/')) { $socialit_oldloc = SOCIALIT_PLUGDIR; $socialit_newloc = BB_PATH.'socialit-mods/'; mkdir($socialit_newloc, 0755); mkdir($socialit_newloc.'css', 0755); mkdir($socialit_newloc.'images', 0755); mkdir($socialit_newloc.'js', 0755); copy($socialit_oldloc.'css/style.css', $socialit_newloc.'css/style.css'); copy($socialit_oldloc.'js/social-it-public.js', $socialit_newloc.'js/social-it-public.js'); copy($socialit_oldloc.'images/socialit-sprite.png', $socialit_newloc.'images/socialit-sprite.png'); copy($socialit_oldloc.'images/share-enjoy.png', $socialit_newloc.'images/share-enjoy.png'); copy($socialit_oldloc.'images/share-german.png', $socialit_newloc.'images/share-german.png'); copy($socialit_oldloc.'images/share-love-hearts.png', $socialit_newloc.'images/share-love-hearts.png'); copy($socialit_oldloc.'images/share-wealth.png', $socialit_newloc.'images/share-wealth.png'); copy($socialit_oldloc.'images/sharing-caring-hearts.png', $socialit_newloc.'images/sharing-caring-hearts.png'); copy($socialit_oldloc.'images/sharing-caring.png', $socialit_newloc.'images/sharing-caring.png'); copy($socialit_oldloc.'images/sharing-sexy.png', $socialit_newloc.'images/sharing-sexy.png'); } } //check for updates if(socialit_update_check()){ //update available echo '
'. __( '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 '
'.$error_message.'
X
'; } elseif ($status_message != '') { echo '
'.$status_message.' | '. __( 'Maybe you would consider', 'socialit' ) .' '. __( 'donating', 'socialit' ) .' ' . __( 'or following me on', 'socialit' ) . ' Twitter?
X
'; } ?>
    • : 
    •  | 
    •  | 
    •  
  • ALL short URLs. - Are you sure?', 'socialit'); ?>
     
    class="hide">

    class="hide">
    class="hide"> name="shortyapichk-trim" id="shortyapichk-trim" type="checkbox" value="1" />
    class="hide">
    class="hide">
    class="hide"> name="shortyapichk-tinyarrow" id="shortyapichk-tinyarrow" type="checkbox" value="1" />
    class="hide">
    class="hide"> name="shortyapichk-cligs" id="shortyapichk-cligs" type="checkbox" value="1" />
    class="hide">
    class="hide"> name="shortyapichk-supr" id="shortyapichk-supr" type="checkbox" value="1" />
    class="hide">
    class="hide">

    class="hide">



    []

    In Case of Emergency

    1. Social It)', 'socialit'); ?>
    name="custom-mods" id="custom-mods" type="checkbox" value="yes" />
    value="1" />

    name="bgimg-yes" id="bgimg-yes" type="checkbox" value="yes" />
    class="hide">

  • <?php if(function_exists('selfserv_socialit')) { selfserv_socialit(); } ?>

    isActive()){ ?>

    Support Forum plugin Made by Aditya Naik & Sam Bauers. You are seeing these options because that plugin is activated on your forums. With the help of these options you can configure whether to show Social It on non-resolved, resolved or non support topics.', 'socialit'); ?>
    []

    :




'."\n"; wp_register_style('social-it', SOCIALIT_PLUGPATH.'css/admin-style.css', false, SOCIALIT_VER, 'all'); wp_print_styles('social-it'); if (isset($_SERVER['HTTP_USER_AGENT']) && (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 7') !== false)){ //ie, as usual, doesnt render the css properly :| and creates problems for the developers wp_register_style('ie-social-it', SOCIALIT_PLUGPATH.'css/ie7-admin-style.css', false, SOCIALIT_VER, 'all'); wp_print_styles('ie-social-it'); } echo ''; //loads newer version of jquery. bbpress uses old version echo ''; //ui core & sortable script not included in bbpress :-( echo ''; echo ''; //social-it admin js script echo ''; //social-it admin js script echo ''."\n\n"; } } add_action('bb_admin_menu_generator', 'socialit_menu_link', -998); //link in settings add_action('bb_admin_head', 'socialit_admin', 997); //admin css