Esempio n. 1
0
function socialit_settings_page()
{
    global $socialit_plugopts, $socialit_bookmarks_data, $bbdb;
    echo "\n\n" . '<!-- Start Of Code Generated By Social It Plugin (Admin Area) By www.gaut.am -->' . "\n";
    echo '<h2 class="socialitlogo">' . __('Social It', 'socialit') . '</h2>';
    //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/socialit-trans.png', $socialit_newloc . 'images/socialit-trans.png');
        }
    }
    //check for updates
    if (socialit_update_check()) {
        //update available
        echo '
		<div id="update-message" class="socialit-warning">
			<div class="dialog-left">
				<img src="' . SOCIALIT_PLUGPATH . 'images/error.png" class="dialog-ico" alt=""/>
				' . __('New version of Social It is available! Please download the latest version ', 'socialit') . '<a href="http://bbpress.org/plugins/topic/social-it/">' . __('here', 'socialit') . '</a>
			</div>
		</div>';
        //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) {
            foreach (array('topic', 'xtrastyle', 'reloption', 'targetopt', 'bookmark', 'twittid', 'ybuzzcat', 'ybuzzmed', 'twittcat', 'defaulttags', 'bgimg-yes', 'mobile-hide', 'bgimg', 'feed', 'expand', 'autocenter', 'custom-mods', '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 '<div id="clearurl" class="socialit-warning"><div class="dialog-left fugue f-warn">' . $count . __(' Short URL(s) have been reset.', 'socialit') . '</div><div class="dialog-right"><img src="' . SOCIALIT_PLUGPATH . 'images/warning-delete.jpg" class="del-x" alt=""/></div></div><div style="clear:both;"></div>';
        }
    }
    //if there was an error,
    if ($error_message != '') {
        echo '
		<div id="message" class="socialit-error">
			<div class="dialog-left fugue f-error">
				' . $error_message . '
			</div>
			<div class="dialog-right">
				<img src="' . SOCIALIT_PLUGPATH . 'images/error-delete.jpg" class="del-x" alt="X"/>
			</div>
		</div>';
    } elseif ($status_message != '') {
        echo '
		<div id="message" class="socialit-success">
			<div class="dialog-left fugue f-success">
				' . $status_message . ' | ' . __('Maybe you would consider', 'socialit') . ' <a href="' . $donate_link . '">' . __('donating', 'socialit') . '</a> ' . __('or following me on', 'socialit') . ' <a href="' . $twitter_link . '">Twitter</a>?
			</div>
			<div class="dialog-right">
				<img src="' . SOCIALIT_PLUGPATH . 'images/success-delete.jpg" class="del-x" alt="X"/>
			</div>
		</div>';
    }
    ?>
	<form name="social-it" id="social-it" action="" method="post">
	<div id="socialit-col-left">
		<ul id="socialit-sortables">
			<li>
				<div class="box-mid-head" id="iconator">
					<h2 class="fugue f-globe-plus"><?php 
    _e('Enabled Networks', 'socialit');
    ?>
</h2>
				</div>
				<div class="box-mid-body iconator" id="toggle1">
					<div class="padding">
						<p><?php 
    _e('Select the Networks to display. Drag to reorder.', 'socialit');
    ?>
</p>
						<ul class="multi-selection"> 
 		                                        <li>Select:&nbsp;</li> 
 		                                        <li><a id="sel-all" href="javascript:void(0);"><?php 
    _e('All', 'socialit');
    ?>
</a>&nbsp;|&nbsp;</li> 
 		                                        <li><a id="sel-none" href="javascript:void(0);"><?php 
    _e('None', 'socialit');
    ?>
</a>&nbsp;|&nbsp;</li> 
 		                                        <li><a id="sel-pop" href="javascript:void(0);"><?php 
    _e('Most Popular', 'socialit');
    ?>
</a>&nbsp;</li> 
		                                </ul>
						<div id="socialit-networks">
							<?php 
    foreach ($socialit_plugopts['bookmark'] as $name) {
        print socialit_network_input_select($name, $socialit_bookmarks_data[$name]['check']);
    }
    $unused_networks = array_diff(array_keys($socialit_bookmarks_data), $socialit_plugopts['bookmark']);
    foreach ($unused_networks as $name) {
        print socialit_network_input_select($name, $socialit_bookmarks_data[$name]['check']);
    }
    ?>
						</div>
					</div>
				</div>
			</li>
			<li>
				<div class="box-mid-head">
					<h2 class="fugue f-wrench"><?php 
    _e('Functionality Settings', 'socialit');
    ?>
</h2>
				</div>
				<div class="box-mid-body" id="toggle2">
					<div class="padding">
						<div class="dialog-box-warning" id="clear-warning">
							<div class="dialog-left fugue f-warn">
								<?php 
    _e('This will clear <u>ALL</u> short URLs. - Are you sure?', 'socialit');
    ?>
							</div>
							<div class="dialog-right">
								<label><input name="warn-choice" id="warn-yes" type="radio" value="yes" /><?php 
    _e('Yes', 'socialit');
    ?>
</label> &nbsp;<label><input name="warn-choice" id="warn-cancel" type="radio" value="cancel" /><?php 
    _e('Cancel', 'socialit');
    ?>
</label>
							</div>
						</div>
						<div id="twitter-defaults"<?php 
    if (!in_array('socialit-twitter', $socialit_plugopts['bookmark'])) {
        ?>
 class="hide"<?php 
    }
    ?>
>
							<h3><?php 
    _e('Twitter Options:', 'socialit');
    ?>
</h3>
							<label for="twittid"><?php 
    _e('Twitter ID:', 'socialit');
    ?>
</label>
							<input type="text" id="twittid" name="twittid" value="<?php 
    echo $socialit_plugopts['twittid'];
    ?>
" />
						<div class="clearbig"></div>
						<?php 
    /*
     * Short URL Options
     */
    ?>
							<label for="shorty"><?php 
    _e('Which URL Shortener?', 'socialit');
    ?>
</label>
							<select name="shorty" id="shorty">
							<?php 
    // output shorty select options
    print socialit_select_option_group('shorty', array('b2l' => 'b2l.me', 'bitly' => 'bit.ly', 'trim' => 'tr.im', 'snip' => 'snipr.com', 'tinyarrow' => 'tinyarro.ws', 'cligs' => 'cli.gs', 'supr' => 'su.pr', 'tiny' => 'tinyurl.com'));
    ?>
							</select>
							<label for="clearShortUrls" id="clearShortUrlsLabel"><input name="clearShortUrls" id="clearShortUrls" type="checkbox"/><?php 
    _e('Reset all Short URLs', 'socialit');
    ?>
</label>
							<div id="shortyapimdiv-bitly" <?php 
    if ($socialit_plugopts['shorty'] != 'bitly') {
        ?>
class="hide"<?php 
    }
    ?>
>
							<div class="clearbig"></div>
								<div id="shortyapidiv-bitly">
									<label for="shortyapiuser-bitly">User ID:</label>
									<input type="text" id="shortyapiuser-bitly" name="shortyapiuser-bitly" value="<?php 
    echo $socialit_plugopts['shortyapi']['bitly']['user'];
    ?>
" />
									<label for="shortyapikey-bitly">API Key:</label>
									<input type="text" id="shortyapikey-bitly" name="shortyapikey-bitly" value="<?php 
    echo $socialit_plugopts['shortyapi']['bitly']['key'];
    ?>
" />
								</div>
							</div>
							<div id="shortyapimdiv-trim" <?php 
    if ($socialit_plugopts['shorty'] != 'trim') {
        ?>
class="hide"<?php 
    }
    ?>
>
								<span class="socialit_option" id="shortyapidivchk-trim">
									<input <?php 
    echo $socialit_plugopts['shortyapi']['trim']['chk'] == "1" ? 'checked=""' : "";
    ?>
 name="shortyapichk-trim" id="shortyapichk-trim" type="checkbox" value="1" /> Track Generated Links?
								</span>
								<div class="clearbig"></div>
								<div id="shortyapidiv-trim" <?php 
    if (!isset($socialit_plugopts['shortyapi']['trim']['chk'])) {
        ?>
class="hide"<?php 
    }
    ?>
>
									<label for="shortyapiuser-trim">User ID:</label>
									<input type="text" id="shortyapiuser-trim" name="shortyapiuser-trim" value="<?php 
    echo $socialit_plugopts['shortyapi']['trim']['user'];
    ?>
" />
									<label for="shortyapikey-trim">Password:</label>
									<input type="text" id="shortyapipass-trim" name="shortyapipass-trim" value="<?php 
    echo $socialit_plugopts['shortyapi']['trim']['pass'];
    ?>
" />
								</div>
							</div>
							<div id="shortyapimdiv-snip" <?php 
    if ($socialit_plugopts['shorty'] != 'snip') {
        ?>
class="hide"<?php 
    }
    ?>
>
								<div class="clearbig"></div>
								<div id="shortyapidiv-snip">
									<label for="shortyapiuser-snip">User ID:</label>
									<input type="text" id="shortyapiuser-snip" name="shortyapiuser-snip" value="<?php 
    echo $socialit_plugopts['shortyapi']['snip']['user'];
    ?>
" />
									<label for="shortyapikey-snip">API Key:</label>
									<input type="text" id="shortyapikey-snip" name="shortyapikey-snip" value="<?php 
    echo $socialit_plugopts['shortyapi']['snip']['key'];
    ?>
" />
								</div>
							</div>
							<div id="shortyapimdiv-tinyarrow" <?php 
    if ($socialit_plugopts['shorty'] != 'tinyarrow') {
        ?>
class="hide"<?php 
    }
    ?>
>
								<span class="socialit_option" id="shortyapidivchk-tinyarrow">
									<input <?php 
    echo $socialit_plugopts['shortyapi']['tinyarrow']['chk'] == "1" ? 'checked=""' : "";
    ?>
 name="shortyapichk-tinyarrow" id="shortyapichk-tinyarrow" type="checkbox" value="1" /> Track Generated Links?
								</span>
								<div class="clearbig"></div>
								<div id="shortyapidiv-tinyarrow" <?php 
    if (!isset($socialit_plugopts['shortyapi']['tinyarrow']['chk'])) {
        ?>
class="hide"<?php 
    }
    ?>
>
									<label for="shortyapiuser-tinyarrow">User ID:</label>
									<input type="text" id="shortyapiuser-tinyarrow" name="shortyapiuser-tinyarrow" value="<?php 
    echo $socialit_plugopts['shortyapi']['tinyarrow']['user'];
    ?>
" />
								</div>
							</div>
							<div id="shortyapimdiv-cligs" <?php 
    if ($socialit_plugopts['shorty'] != 'cligs') {
        ?>
class="hide"<?php 
    }
    ?>
>
								<span class="socialit_option" id="shortyapidivchk-cligs">
									<input <?php 
    echo $socialit_plugopts['shortyapi']['cligs']['chk'] == "1" ? 'checked=""' : "";
    ?>
 name="shortyapichk-cligs" id="shortyapichk-cligs" type="checkbox" value="1" /> Track Generated Links?
								</span>
								<div class="clearbig"></div>
								<div id="shortyapidiv-cligs" <?php 
    if (!isset($socialit_plugopts['shortyapi']['cligs']['chk'])) {
        ?>
class="hide"<?php 
    }
    ?>
>
									<label for="shortyapikey-cligs">API Key:</label>
									<input type="text" id="shortyapikey-cligs" name="shortyapikey-cligs" value="<?php 
    echo $socialit_plugopts['shortyapi']['cligs']['key'];
    ?>
" />
								</div>
							</div>
							<div id="shortyapimdiv-supr" <?php 
    if ($socialit_plugopts['shorty'] != 'supr') {
        ?>
class="hide"<?php 
    }
    ?>
>
								<span class="socialit_option" id="shortyapidivchk-supr">
									<input <?php 
    echo $socialit_plugopts['shortyapi']['supr']['chk'] == "1" ? 'checked=""' : "";
    ?>
 name="shortyapichk-supr" id="shortyapichk-supr" type="checkbox" value="1" /> Track Generated Links?
								</span>
								<div class="clearbig"></div>
								<div id="shortyapidiv-supr" <?php 
    if (!isset($socialit_plugopts['shortyapi']['supr']['chk'])) {
        ?>
class="hide"<?php 
    }
    ?>
>
									<label for="shortyapiuser-supr">User ID:</label>
									<input type="text" id="shortyapiuser-supr" name="shortyapiuser-supr" value="<?php 
    echo $socialit_plugopts['shortyapi']['supr']['user'];
    ?>
" />
									<label for="shortyapikey-supr">API Key:</label>
									<input type="text" id="shortyapikey-supr" name="shortyapikey-supr" value="<?php 
    echo $socialit_plugopts['shortyapi']['supr']['key'];
    ?>
" />
								</div>
							</div>
						<?php 
    /*
     * Short URL Options End
     */
    ?>
						<div class="clearbig"></div>
						</div>
						<div id="ybuzz-defaults"<?php 
    if (!in_array('socialit-yahoobuzz', $socialit_plugopts['bookmark'])) {
        ?>
 class="hide"<?php 
    }
    ?>
>
							<h3><?php 
    _e('Yahoo! Buzz Defaults:', 'socialit');
    ?>
</h3>
							<label for="ybuzzcat"><?php 
    _e('Default Content Category: ', 'socialit');
    ?>
</label>
							<select name="ybuzzcat" id="ybuzzcat">
								<?php 
    // output shorty select options
    print socialit_select_option_group('ybuzzcat', array('entertainment' => 'Entertainment', 'lifestyle' => 'Lifestyle', 'health' => 'Health', 'usnews' => 'U.S. News', 'business' => 'Business', 'politics' => 'Politics', 'science' => 'Sci/Tech', 'world_news' => 'World', 'sports' => 'Sports', 'travel' => 'Travel'));
    ?>
							</select>
							<div class="clearbig"></div>
							<label for="ybuzzmed"><?php 
    _e('Default Media Type:', 'socialit');
    ?>
</label>
							<select name="ybuzzmed" id="ybuzzmed">
								<?php 
    print socialit_select_option_group('ybuzzmed', array('text' => 'Text', 'image' => 'Image', 'audio' => 'Audio', 'video' => 'Video'));
    ?>
							</select>
						<div class="clearbig"></div>
						</div>
						<div id="twittley-defaults"<?php 
    if (!in_array('socialit-twittley', $socialit_plugopts['bookmark'])) {
        ?>
 class="hide"<?php 
    }
    ?>
>
							<h3><?php 
    _e('Twittley Defaults:', 'socialit');
    ?>
</h3>
							<label for="twittcat"><?php 
    _e('Primary Content Category:', 'socialit');
    ?>
</label>
							<select name="twittcat" id="twittcat">
								<?php 
    print socialit_select_option_group('twittcat', array('Technology' => 'Technology', 'World &amp; Business' => 'World &amp; Business', 'Science' => 'Science', 'Gaming' => 'Gaming', 'Lifestyle' => 'Lifestyle', 'Entertainment' => 'Entertainment', 'Sports' => 'Sports', 'Offbeat' => 'Offbeat', 'Internet' => 'Internet'));
    ?>
							</select>
							<div class="clearbig"></div>
							<p id="tag-info" class="hide">
								<?php 
    _e("Enter a comma separated list of general tags which describe your site's posts as a whole. Try not to be too specific, as one post may fall into different \"tag categories\" than other posts.", "socialit");
    ?>
<br />
								<?php 
    _e("This list is primarily used as a failsafe in case you forget to enter WordPress tags for a particular post, in which case this list of tags would be used so as to bring at least *somewhat* relevant search queries based on the general tags that you enter here.", "socialit");
    ?>
<br /><span title="<?php 
    _e('Click here to close this message', 'socialit');
    ?>
" class="dtags-close">[<?php 
    _e('close', 'socialit');
    ?>
]</span>
							</p>
							<label for="defaulttags"><?php 
    _e('Default Tags:', 'socialit');
    ?>
</label>
							<input type="text" name="defaulttags" id="defaulttags" value="<?php 
    echo $socialit_plugopts['defaulttags'];
    ?>
" /><span class="dtags-info fugue f-question" title="<?php 
    _e('Click here for help with this option', 'sexybookmarks');
    ?>
"> </span>
							<div class="clearbig"></div>
						</div>
						<div id="genopts">
							<h3><?php 
    _e('General Functionality Options:', 'socialit');
    ?>
</h3>
							<span class="socialit_option"><?php 
    _e('Add nofollow to the links?', 'socialit');
    ?>
</span>
							<label><input <?php 
    echo $socialit_plugopts['reloption'] == "nofollow" ? 'checked="checked"' : "";
    ?>
 name="reloption" id="reloption-yes" type="radio" value="nofollow" /> <?php 
    _e('Yes', 'socialit');
    ?>
</label>
							<label><input <?php 
    echo $socialit_plugopts['reloption'] == "" ? 'checked="checked"' : "";
    ?>
 name="reloption" id="reloption-no" type="radio" value="" /> <?php 
    _e('No', 'socialit');
    ?>
</label>
							<span class="socialit_option"><?php 
    _e('Open links in new window?', 'socialit');
    ?>
</span>
							<label><input <?php 
    echo $socialit_plugopts['targetopt'] == "_blank" ? 'checked="checked"' : "";
    ?>
 name="targetopt" id="targetopt-blank" type="radio" value="_blank" /> <?php 
    _e('Yes', 'socialit');
    ?>
</label>
							<label><input <?php 
    echo $socialit_plugopts['targetopt'] == "_self" ? 'checked="checked"' : "";
    ?>
 name="targetopt" id="targetopt-self" type="radio" value="_self" /> <?php 
    _e('No', 'socialit');
    ?>
</label>
						</div>
					</div>
				</div>
			</li>
			<li>
				<div class="box-mid-head">
					<h2 class="fugue f-pallette"><?php 
    _e('Plugin Aesthetics', 'socialit');
    ?>
</h2>
				</div>
				<div class="box-mid-body" id="toggle3">
					<div class="padding">
						<div id="custom-mods-notice"> 
							<h1><?php 
    _e('Warning!', 'socialit');
    ?>
</h1> 
							<p><?php 
    _e('This option is intended ', 'socialit');
    ?>
<strong><?php 
    _e('STRICTLY', 'socialit');
    ?>
</strong><?php 
    _e(' for users who understand how to edit CSS/JS and intend to change/edit the associated images themselves. No support will be offered for this feature, as I cannot be held accountable for your coding/image-editing mistakes. Furthermore, this feature was implemented as a favor to the thousands of you who asked for such a feature, and as such, I would appreciate it if you could refrain from sending nasty emails when you break the plugin due to coding errors of your own.', 'socialit');
    ?>
</p> 
							<h3><?php 
    _e('How it works...', 'socialit');
    ?>
</h3> 
							<p><?php 
    _e('Since you have chosen for the plugin to override the style settings with your own custom mods, it will now pull the files from the new folders it is going to create on your server as soon as you save your changes. The file/folder locations should be as follows:', 'socialit');
    ?>
</p> 
							<ul>
								<?php 
    $newloc = bb_get_option('uri') . 'socialit-mods/';
    ?>
							      <li class="custom-mods-folder"><a href="<?php 
    echo $newloc;
    ?>
"><?php 
    echo $newloc;
    ?>
</a></li> 
							      <li class="custom-mods-folder"><a href="<?php 
    echo $newloc . 'css';
    ?>
"><?php 
    echo $newloc . 'css';
    ?>
</a></li> 
							      <li class="custom-mods-folder"><a href="<?php 
    echo $newloc . 'js';
    ?>
"><?php 
    echo $newloc . 'js';
    ?>
</a></li> 
							      <li class="custom-mods-folder"><a href="<?php 
    echo $newloc . 'images';
    ?>
"><?php 
    echo $newloc . 'images';
    ?>
</a></li> 
							      <li class="custom-mods-code"><a href="<?php 
    echo $newloc . 'js/social-it-public.js';
    ?>
"><?php 
    echo $newloc . 'js/social-it-public.js';
    ?>
</a></li> 
							      <li class="custom-mods-code"><a href="<?php 
    echo $newloc . 'css/style.css';
    ?>
"><?php 
    echo $newloc . 'css/style.css';
    ?>
</a></li> 
							      <li class="custom-mods-image"><a href="<?php 
    echo $newloc . 'images/socialit-sprite.png';
    ?>
"><?php 
    echo $newloc . 'images/socialit-sprite.png';
    ?>
</a></li> 
							      <li class="custom-mods-image"><a href="<?php 
    echo $newloc . 'images/socialit-trans.png';
    ?>
"><?php 
    echo $newloc . 'images/socialit-trans.png';
    ?>
</a></li> 
							</ul> 
							<p><?php 
    _e('Once you have saved your changes, you will be able to edit the image sprite that holds all of the icons for socialit as well as the CSS which accompanies it. Just be sure that you do in fact edit the CSS if you edit the images, as it is unlikely the heights, widths, and background positions of the images will stay the same after you are done.', 'socialit');
    ?>
</p> 
							<p><?php 
    _e('Just a quick note... When you edit the styles and images to include your own custom backgrounds, icons, and CSS styles, be aware that those changes will not be reflected on the plugin options page. In other words: when you select your networks to be displayed, or when you select the background image to use, it will still be displaying the images from the original plugin directory.', 'socialit');
    ?>
</p> 
							<h3>In Case of Emergency</h3> 
							<p><?php 
    _e('If you happen to completely screw up the code, you can follow these directions to reset the plugin back to normal and try again if you wish:', 'socialit');
    ?>
</p> 
							<ol> 
							      <li><?php 
    _e('Login to your server via FTP or SSH. (whichever you are more comfortable with)', 'socialit');
    ?>
</li> 
							      <li><?php 
    _e('Navigate to your forum\'s root directory.', 'socialit');
    ?>
</li> 
							      <li><?php 
    _e('Delete the directory named "socialit-mods".', 'socialit');
    ?>
</li> 
							      <li><?php 
    _e('Login to your bbPress dashboard.', 'socialit');
    ?>
</li> 
							      <li><?php 
    _e('Go to the Social It plugin options page. (Settings -> Social It)', 'socialit');
    ?>
</li> 
							      <li><?php 
    _e('Deselect the "Use custom mods" option.', 'socialit');
    ?>
</li> 
							      <li><?php 
    _e('Save your changes.', 'socialit');
    ?>
</li> 
							</ol> 
							<span class="fugue f-delete custom-mods-notice-close"><?php 
    _e('Close Message', 'socialit');
    ?>
</span> 
 		                                    </div> 
 		                                    <div class="custom-mod-check fugue f-plugin"> 
 		                                          <label for="custom-mods" class="sexy_option" style="display:inline;"> 
 		                                                <?php 
    _e('Override Styles With Custom Mods Instead?', 'sexybookmarks');
    ?>
 
 		                                          </label> 
 		                                          <input <?php 
    echo $socialit_plugopts['custom-mods'] == "yes" ? 'checked' : "";
    ?>
 name="custom-mods" id="custom-mods" type="checkbox" value="yes" /> 
 		                                    </div>
						<span class="socialit_option"><?php 
    _e('Animate-expand multi-lined bookmarks?', 'socialit');
    ?>
</span>
						<label><input <?php 
    echo $socialit_plugopts['expand'] == "1" ? 'checked="checked"' : "";
    ?>
 name="expand" id="expand-yes" type="radio" value="1" /> <?php 
    _e('Yes', 'socialit');
    ?>
</label>
						<label><input <?php 
    echo $socialit_plugopts['expand'] != "1" ? 'checked="checked"' : "";
    ?>
 name="expand" id="expand-no" type="radio" value="0" /> <?php 
    _e('No', 'socialit');
    ?>
</label>
						<span class="socialit_option"><?php 
    _e('Auto-space/center the bookmarks?', 'socialit');
    ?>
</span>
 		                                <label><input <?php 
    echo $socialit_plugopts['autocenter'] == "2" ? 'checked="checked"' : "";
    ?>
 name="autocenter" id="autocenter-space" type="radio" value="2" /> <?php 
    _e('Space', 'socialit');
    ?>
</label>
 		                                <label><input <?php 
    echo $socialit_plugopts['autocenter'] == "1" ? 'checked="checked"' : "";
    ?>
 name="autocenter" id="autocenter-center" type="radio" value="1" /> <?php 
    _e('Center', 'socialit');
    ?>
</label>
 		                                <label><input <?php 
    echo $socialit_plugopts['autocenter'] == "0" ? 'checked="checked"' : "";
    ?>
 name="autocenter" id="autocenter-no" type="radio" value="0" /> <?php 
    _e('No', 'socialit');
    ?>
</label>
						
						<h2><?php 
    _e('Background Image', 'socialit');
    ?>
</h2>
						<span class="socialit_option">
							<?php 
    _e('Use a background image?', 'socialit');
    ?>
 <input <?php 
    echo $socialit_plugopts['bgimg-yes'] == "yes" ? 'checked=""' : "";
    ?>
 name="bgimg-yes" id="bgimg-yes" type="checkbox" value="yes" />
						</span>
						<div id="bgimgs" <?php 
    if (!isset($socialit_plugopts['bgimg-yes'])) {
        ?>
class="hide"<?php 
    } else {
        echo " ";
    }
    ?>
>
							<label class="bgimg share-sexy">
								<input <?php 
    echo $socialit_plugopts['bgimg'] == "sexy" ? 'checked="checked"' : "";
    ?>
 id="bgimg-sexy" name="bgimg" type="radio" value="sexy" />
							</label>
							<label class="bgimg share-care">
								<input <?php 
    echo $socialit_plugopts['bgimg'] == "caring" ? 'checked="checked"' : "";
    ?>
 id="bgimg-caring" name="bgimg" type="radio" value="caring" />
							</label>
							<label class="bgimg share-care-old">
								<input <?php 
    echo $socialit_plugopts['bgimg'] == "care-old" ? 'checked="checked"' : "";
    ?>
 id="bgimg-care-old" name="bgimg" type="radio" value="care-old" />
							</label>
							<label class="bgimg share-love">
								<input <?php 
    echo $socialit_plugopts['bgimg'] == "love" ? 'checked="checked"' : "";
    ?>
 id="bgimg-love" name="bgimg" type="radio" value="love" />
							</label>
							<label class="bgimg share-wealth">
								<input <?php 
    echo $socialit_plugopts['bgimg'] == "wealth" ? 'checked="checked"' : "";
    ?>
 id="bgimg-wealth" name="bgimg" type="radio" value="wealth" />
							</label>
							<label class="bgimg share-enjoy">
								<input <?php 
    echo $socialit_plugopts['bgimg'] == "enjoy" ? 'checked="checked"' : "";
    ?>
 id="bgimg-enjoy" name="bgimg" type="radio" value="enjoy" />
							</label>
							<label class="bgimg share-german"> 
 		                                                <input <?php 
    echo $socialit_plugopts['bgimg'] == "german" ? 'checked="checked"' : "";
    ?>
 id="bgimg-german" name="bgimg" type="radio" value="german" /> 
							</label>
						</div>
					</div>
				</div>
			</li>
			<li>
				<div class="box-mid-head">
					<h2 class="fugue f-footer"><?php 
    _e('Menu Placement', 'socialit');
    ?>
</h2>
				</div>
				<div class="box-mid-body" id="toggle5">
					<div class="padding">
						<p id="placement-info">
							<?php 
    _e('You can insert the Social It menu anywhere on your forums, the plugin will take appropiate values of that page. By default, Social It menu is displayed below the first post of the topic only, but you can insert it on Forums, Tag pages, or anywhere, just put this code where you want to insert it:', 'socialit');
    ?>
<br />
							&lt;?php if(function_exists('selfserv_socialit')) { selfserv_socialit(); } ?&gt;
						</p>
						<span class="socialit_option"><?php 
    _e('Display below first Post in Topic?', 'socialit');
    ?>
</span>
						<label><input <?php 
    echo $socialit_plugopts['topic'] == "1" ? 'checked="checked"' : "";
    ?>
 name="topic" id="topic-show" type="radio" value="1" /> <?php 
    _e('Yes', 'socialit');
    ?>
</label>
						<label><input <?php 
    echo $socialit_plugopts['topic'] == "0" || empty($socialit_plugopts['topic']) ? 'checked="checked"' : "";
    ?>
 name="topic" id="topic-hide" type="radio" value="0" /> <?php 
    _e('No', 'socialit');
    ?>
</label>
						<span class="socialit_option"><?php 
    _e('Show in RSS feed?', 'socialit');
    ?>
</span>
						<label><input <?php 
    echo $socialit_plugopts['feed'] == "1" ? 'checked="checked"' : "";
    ?>
 name="feed" id="feed-show" type="radio" value="1" /> <?php 
    _e('Yes', 'socialit');
    ?>
</label>
						<label><input <?php 
    echo $socialit_plugopts['feed'] == "0" || empty($socialit_plugopts['feed']) ? 'checked="checked"' : "";
    ?>
 name="feed" id="feed-hide" type="radio" value="0" /> <?php 
    _e('No', 'socialit');
    ?>
</label>
						<label class="socialit_option" style="margin-top:12px;">
							<?php 
    _e('Hide menu from mobile browsers?', 'socialit');
    ?>
 <input <?php 
    echo $socialit_plugopts['mobile-hide'] == "yes" ? 'checked' : "";
    ?>
 name="mobile-hide" id="mobile-hide" type="checkbox" value="yes" />
						</label>
						<?php 
    if (class_exists('Support_Forum')) {
        //compatibility with support forum plugin
        $support_forum = new Support_Forum();
        if ($support_forum->isActive()) {
            ?>
								<div id="genopts">
									<p id="sfi-info" class="hide">
										<?php 
            _e('Social It plugin is compatible with <a href="http://bbpress.org/plugins/topic/support-forum/">Support Forum plugin</a> 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');
            ?>
										<br /><span title="<?php 
            _e('Click here to close this message', 'socialit');
            ?>
" class="sfi-close">[<?php 
            _e('close', 'socialit');
            ?>
]</span>
									</p>
									<h3><?php 
            _e('Compatibility with Support Forum Plugin', 'socialit');
            ?>
: <span class="sfp-info fugue f-question" title="Click here for help with this option"> </span></h3>
									<span class="socialit_option"><?php 
            _e('Display Social It on Non-Resolved Topics?', 'socialit');
            ?>
</span>
									<label><input <?php 
            echo $socialit_plugopts['sfpnonres'] == "yes" ? 'checked="checked"' : "";
            ?>
 name="sfpnonres" id="sfpnonres-yes" type="radio" value="yes" /> <?php 
            _e('Yes', 'socialit');
            ?>
</label>
									<label><input <?php 
            echo $socialit_plugopts['sfpnonres'] == "no" ? 'checked="checked"' : "";
            ?>
 name="sfpnonres" id="sfpnonres-no" type="radio" value="no" /> <?php 
            _e('No', 'socialit');
            ?>
</label>
									<span class="socialit_option"><?php 
            _e('Display Social It on Resolved Topics?', 'socialit');
            ?>
</span>
									<label><input <?php 
            echo $socialit_plugopts['sfpres'] == "yes" ? 'checked="checked"' : "";
            ?>
 name="sfpres" id="sfpres-yes" type="radio" value="yes" /> <?php 
            _e('Yes', 'socialit');
            ?>
</label>
									<label><input <?php 
            echo $socialit_plugopts['sfpres'] == "no" ? 'checked="checked"' : "";
            ?>
 name="sfpres" id="sfpres-no" type="radio" value="no" /> <?php 
            _e('No', 'socialit');
            ?>
</label>
									<span class="socialit_option"><?php 
            _e('Display Social It on Non-Support Topics?', 'socialit');
            ?>
</span>
									<label><input <?php 
            echo $socialit_plugopts['sfpnonsup'] == "yes" ? 'checked="checked"' : "";
            ?>
 name="sfpnonsup" id="sfpnonsup-yes" type="radio" value="yes" /> <?php 
            _e('Yes', 'socialit');
            ?>
</label>
									<label><input <?php 
            echo $socialit_plugopts['sfpnonsup'] == "no" ? 'checked="checked"' : "";
            ?>
 name="sfpnonsup" id="sfpnonsup-no" type="radio" value="no" /> <?php 
            _e('No', 'socialit');
            ?>
</label>
									<br /><br />
								</div>
								<?php 
        }
    }
    ?>
					</div>
				</div>
			</li>
		</ul>
		<input type="hidden" name="save_changes" value="1" />
		<div class="submit"><input type="submit" value="<?php 
    _e('Save Changes', 'socialit');
    ?>
" /></div>
		<hr width=590 align="left" />
	</div>
	</form>
	<div id="socialit-col-left">
	<ul id="socialit-sortables">
		<li>
			<form name="social-it" id="socialit-import-options" method="post" enctype="multipart/form-data">
				<div class="box-mid-head">
					<img src="<?php 
    echo SOCIALIT_PLUGPATH;
    ?>
images/down.png" alt="" class="box-icons" />
					<h2><?php 
    _e('Import Social It Options', 'socialit');
    ?>
</h2>
				</div>
				<div class="box-mid-body" id="toggle6">
					<div class="padding">
						<div class="dialog-box-warning" id="import-warning">
							<div class="dialog-left" fugue f-warn">
								<?php 
    _e('All of your current Social It options will be overwritten by the imported value. Are you sure you want to overwrite all settings?', 'socialit');
    ?>
							</div>
							<div class="dialog-right">
								<label><input name="import-warn-choice" id="import-warn-yes" type="radio" value="yes" onchange="if(this.checked==true){document.forms['socialit-import-options'].submit();jQuery('#import-warning').fadeOut();jQuery(this).is(':not(:checked)');}return;" onclick="document.forms['socialit-import-options'].submit();jQuery('#import-warning').fadeOut();jQuery(this).is(':not(:checked)');" /><?php 
    _e('OK', 'socialit');
    ?>
</label> &nbsp;<label><input name="import-warn-choice" id="import-warn-cancel" type="radio" value="cancel" onchange="if(this.checked==true){this.checked=false;jQuery('#import-warning').fadeOut();}return;" /><?php 
    _e('Cancel', 'socialit');
    ?>
</label>
							</div>
						</div>
						<div class="dialog-box-warning" id="import-short-urls-warning">
							<div class="dialog-left" fugue f-warn">
								<?php 
    _e('Only import the short URLs if you had taken a backup of options from this forum.', 'socialit');
    ?>
							</div>
							<div class="dialog-right">
								<label><input name="import-short-urls-warn-choice" id="import-short-urls-warn-yes" type="radio" value="yes" /><?php 
    _e('OK', 'socialit');
    ?>
</label> &nbsp;<label><input name="import-short-urls-warn-choice" id="import-short-urls-warn-no" type="radio" value="cancel" /><?php 
    _e('Cancel', 'socialit');
    ?>
</label>
							</div>
						</div>
						<p><?php 
    _e('This functionality will restore your entire Social It options from a file.<br /><strong>Make sure you have done an export and backup the exported file before you try this!', 'socialit');
    ?>
</strong></p>
						<input type="file" id="socialit_import_file" name="socialit_import_file" size="40" />
						<div class="clearbig"></div>
						<label id="import_short_urls_label" for="import_short_urls">
							<input type="checkbox" id="import_short_urls" name="import_short_urls" /> <?php 
    _e('Import Generated Short URLs Too', 'socialit');
    ?>
<br />
						</label>
						<input type="hidden" name="import" value="1" />
						<div class="submit">
							<input type="button" id="import-submit" value="<?php 
    _e('Import Options', 'socialit');
    ?>
" />
						</div>
					</div>
					<div class="clearbig"></div>
				</div>
			</form>
		</li>
		<li>
			<form name="social-it" id="socialit-export-options" method="post">
				<div class="box-mid-head">
					<img src="<?php 
    echo SOCIALIT_PLUGPATH;
    ?>
images/up.png" alt="" class="box-icons" />
					<h2><?php 
    _e('Export Social It Options', 'socialit');
    ?>
</h2>
				</div>
				<div class="box-mid-body" id="toggle7">
					<div class="padding">
						<div class="dialog-box-warning" id="export-short-urls-warning">
							<div class="dialog-left" fugue f-warn">
								<?php 
    _e('Only export short URLs if you are backing up the options, and are not importing the options on another forum.', 'socialit');
    ?>
							</div>
							<div class="dialog-right">
								<label><input name="export-short-urls-warn-choice" id="export-short-urls-warn-yes" type="radio" value="yes" /><?php 
    _e('OK', 'socialit');
    ?>
</label> &nbsp;<label><input name="export-short-urls-warn-choice" id="export-short-urls-warn-no" type="radio" value="cancel" /><?php 
    _e('Cancel', 'socialit');
    ?>
</label>
							</div>
						</div>
						<p><?php 
    _e('This functionality will dump your entire Social It options into a file', 'socialit');
    ?>
</p>
						<label id="export_short_urls_label" for="export_short_urls">
							<input type="checkbox" id="export_short_urls" name="export_short_urls" /> <?php 
    _e('Export Generated Short URLs Too', 'socialit');
    ?>
<br />
						</label>
						<input type="hidden" name="export" value="1" />
						<?php 
    if (isset($_POST['export'])) {
        $url = "";
        if ($_POST['export_short_urls'] == "on") {
            $url = "?url=1";
        }
        echo '<iframe src="' . SOCIALIT_PLUGPATH . 'includes/export.php' . $url . '" width=0 height=0></iframe>';
    }
    ?>
						<div class="submit">
							<input type="submit" value="<?php 
    _e('Export Options', 'socialit');
    ?>
" />
						</div>
						<div class="clearbig"></div>
					</div>
				</div>
			</form>
		</li>
	</ul>
	</div>
	<div id="socialit-col-right">
	<div class="box-right">
		<div class="box-right-head">
			<img src="<?php 
    echo SOCIALIT_PLUGPATH;
    ?>
images/icons/information-frame.png" alt="" class="box-icons" />
			<h3 class="fugue f-info-frame"><?php 
    _e('Helpful Plugin Links', 'socialit');
    ?>
</h3>
		</div>
		<div class="box-right-body" id="help-box">
			<div class="padding">
				<ul class="infolinks">
					<li><a href="http://gaut.am/bbpress/plugins/social-it/" target="_blank"><?php 
    _e('Plugin Info', 'socialit');
    ?>
</a> (<?php 
    _e('or', 'socialit');
    ?>
 <a href="http://bbpress.org/plugins/topic/social-it/" target="_blank"><?php 
    _e('here', 'socialit');
    ?>
</a>)</li>
					<li><a href="http://gaut.am/bbpress/plugins/social-it/documentation/usage-and-installation-how-to-guide/" target="_blank"><?php 
    _e('Installation &amp; Usage Guide', 'socialit');
    ?>
</a></li>
					<li><a href="http://gaut.am/bbpress/plugins/social-it/documentation/frequently-asked-questions-faq/" target="_blank"><?php 
    _e('Frequently Asked Questions', 'socialit');
    ?>
</a></li>
					<li><a href="http://forum.gaut.am/" target="_blank"><?php 
    _e('Support Forum', 'socialit');
    ?>
</a></li>
					<li><a href="http://sexybookmarks.net/platforms/" target="_blank"><?php 
    _e('Other Social It Platforms', 'socialit');
    ?>
</a></li>
					<li><a href="http://gaut.am/contact/" target="_blank"><?php 
    _e('Submit a Translation', 'socialit');
    ?>
</a></li>
				</ul>
			</div>
		</div>
	</div>
	<div class="box-right socialit-donation-box">
		<div class="box-right-head">
			<h3 class="fugue f-money"><?php 
    _e('Support by Donating', 'socialit');
    ?>
</h3>
		</div>
		<div class="box-right-body">
			<div class="padding">
				<p><?php 
    _e('If you like Social It and wish to contribute towards it\'s continued development, you can use the form below to do so.', 'socialit');
    ?>
</p>
				<div class="socialit-donate-button">
					<a href="<?php 
    echo $donate_link;
    ?>
" title="<?php 
    _e('Help support the development of this plugin by donating!', 'socialit');
    ?>
" class="socialit-buttons">
						<img src="<?php 
    echo SOCIALIT_PLUGPATH;
    ?>
images/donate.png" alt="" />
					</a>
				</div>
				<div class="socialit-twitter-button">
					<a href="<?php 
    echo $twitter_link;
    ?>
" title="<?php 
    _e('Get the latest information about the plugin and the latest news about Internet & Technology in the world!', 'socialit');
    ?>
" class="socialit-buttons">
						<?php 
    _e('Follow Him on Twitter!', 'socialit');
    ?>
					</a>
				</div>
				<div class="socialit-website-button">
					<a href="http://gaut.am/" title="<?php 
    _e('Get the latest information about the plugin and the latest news about Internet & Technology in the world!', 'socialit');
    ?>
" class="socialit-buttons">
						<?php 
    _e('Visit His Website!', 'socialit');
    ?>
					</a>
				</div>				
			</div>
		</div>
	</div>
	<div class="box-right">
		<div class="box-right-head">
			<h3 class="fugue f-medal"><?php 
    _e('Top Supporters', 'socialit');
    ?>
</h3>
		</div>
		<div class="box-right-body">
			<div class="padding">
				<?php 
    echo socialit_nav_browse("http://gaut.am/uploads/plugins/donations.php?pid=1&chk=ver&soft=bb&current=" . SOCIALIT_vNum);
    ?>
				<p><a href="<?php 
    echo $donate_link;
    ?>
" title="<?php 
    _e('Help support the development of this plugin by donating!', 'socialit');
    ?>
"><?php 
    _e('Donate', 'socialit');
    ?>
</a> <?php 
    _e('now to get to this list and your name with your website link will be here!', 'socialit');
    ?>
</p>
			</div>
		</div>
	</div>
	<div class="box-right">
		<div class="box-right-head">
			<h3 class="fugue f-megaphone"><?php 
    _e('Shout Outs', 'socialit');
    ?>
</h3>
		</div>
		<div class="box-right-body">
			<div class="padding">
				<ul class="credits">
					<li><a href="http://www.pinvoke.com/"><?php 
    _e('Fugue Icons: Pinvoke', 'sexybookmarks');
    ?>
</a></li> 
 		                        <li><a href="http://alisothegeek.com/2009/10/fugue-sprite-css/"><?php 
    _e('Fugue Icon Sprite: Alison Barrett', 'sexybookmarks');
    ?>
</a></li> 
					<li><a href="http://wefunction.com/2008/07/function-free-icon-set/"><?php 
    _e('Original Skin Icons: Function', 'sexybookmarks');
    ?>
</a></li>
				</ul>
			</div>
		</div>
	</div>
	</div>
	<!-- End Of Code Generated By Social It Plugin (Admin Area) By www.gaut.am -->
	<?php 
}
function bb_get_post_delete_link($args = null)
{
    $defaults = array('post_id' => 0, 'before' => '', 'after' => '', 'text' => __('Delete'), 'redirect' => true);
    if (is_numeric($args) || is_object($args)) {
        $args = array('post_id' => $args);
    }
    if (isset($args['delete_text']) && (!isset($args['text']) || !$args['text'])) {
        $args['text'] = $args['delete_text'];
    }
    $args = wp_parse_args($args, $defaults);
    extract($args, EXTR_SKIP);
    $bb_post = bb_get_post(get_post_id($post_id));
    //if ( bb_is_first( $bb_post->post_id ) ) {
    //	$topic = get_topic( $bb_post->topic_id );
    //	if ( 2 > $topic->topic_posts ) {
    // Should delete the whole topic
    //		return;
    //	}
    //}
    if (!bb_current_user_can('delete_post', $bb_post->post_id)) {
        return;
    }
    if (true === $redirect) {
        $redirect = $_SERVER['REQUEST_URI'];
    }
    $uri = bb_get_uri('bb-admin/delete-post.php', array('id' => $bb_post->post_id, 'status' => 1, '_wp_http_referer' => $redirect ? rawurlencode($redirect) : false), BB_URI_CONTEXT_A_HREF + BB_URI_CONTEXT_BB_ADMIN);
    $uri = esc_url(bb_nonce_url($uri, 'delete-post_' . $bb_post->post_id));
    if (bb_is_admin() || isset($_GET['view']) && 'all' == $_GET['view']) {
        $ajax_class = 'dim:thread:post-' . $bb_post->post_id . ':deleted:FF3333:FFFF33:action=delete-post&amp;status=1';
    } else {
        $ajax_class = 'delete:thread:post-' . $bb_post->post_id . '::status=1';
    }
    $text = esc_html($text);
    // Make sure that the last tag in $before gets a class (if it's there)
    if (preg_match('/.*(<[^>]+>)[^<]*/', $before, $_node)) {
        if (preg_match('/class=(\'|")(.*)\\1/U', $_node[1], $_class)) {
            $before = str_replace($_class[0], 'class=' . $_class[1] . 'before-post-delete-link ' . $_class[2] . $_class[1], $before);
        } else {
            $before = preg_replace('/(.*)<([a-z0-9_-]+)(\\s?)([^>]*)>([^<]*)/i', '$1<$2 class="before-post-delete-link"$3$4>$5', $before, 1);
        }
    }
    $r = $before . '<a href="' . $uri . '" class="' . $ajax_class . ' post-delete-link">' . $text . '</a>' . $after;
    $r = apply_filters('post_delete_link', $r, $bb_post->post_status, $bb_post->post_id, $args);
    return $r;
}
function is_bb_admin()
{
    bb_log_deprecated('function', __FUNCTION__, 'bb_is_admin');
    return bb_is_admin();
}
Esempio n. 4
0
 */
bb_load_plugin_textdomain('easy-mentions', dirname(__FILE__) . '/languages');
/* Create Text Domain For Translations */
/* Defines */
define('EM_VER', '0.2');
/* Version */
define('EM_OPTIONS', 'Easy-Mentions');
/* Option Name */
define('EM_PLUGPATH', bb_get_plugin_uri(bb_plugin_basename(__FILE__)));
/* Plugin URL */
/* Get the options, if not found then set them */
$em_plugopts = bb_get_option(EM_OPTIONS);
if (!is_array($em_plugopts)) {
    $em_plugopts = array('link-tags' => 1, 'link-users' => 1, 'link-user-to' => 'profile', 'reply-link' => 0, 'reply-text' => "<em>Replying to @%%USERNAME%%\\'s <a href=\"%%POSTLINK%%\">post</a>:</em>");
    bb_update_option(EM_OPTIONS, $em_plugopts);
}
if ($em_plugopts['link-to']) {
    /* Update the old options, will be removed in v0.4 */
    unset($em_plugopts['link-to']);
    $em_plugopts['link-users'] = 1;
    $em_plugopts['link-tags'] = 1;
    $em_plugopts['link-user-to'] = $em_plugopts['link-to'] == 'website' ? 'website' : 'profile';
    bb_update_option(EM_OPTIONS, $em_plugopts);
}
if (bb_is_admin()) {
    /* Load admin.php file if it is the admin area */
    require_once 'includes/admin.php';
} else {
    /* Else load public.php file if it is the public area */
    require_once 'includes/public.php';
}