function get_socialit() { global $socialit_plugopts, $bbdb, $public_tags, $socialit_is_mobile, $socialit_is_bot; $dont_get_si = false; $topic = get_topic(get_topic_id()); if (class_exists('Support_Forum') && $topic) { //compatibility with Support Forum plugin for bbPress $support_forum = new Support_Forum(); if ($support_forum->isActive() && in_array($topic->forum_id, $support_forum->enabled)) { if ($socialit_plugopts['sfpnonres'] == "no" && $support_forum->getTopicStatus() == "no" || $socialit_plugopts['sfpres'] == "no" && $support_forum->getTopicStatus() == "yes" || $socialit_plugopts['sfpnonsup'] == "no" && $support_forum->getTopicStatus() == "mu") { $dont_get_si = true; } } } if ($socialit_plugopts['mobile-hide'] == 'yes' && ($socialit_is_mobile || $socialit_is_bot)) { $dont_get_si = true; } if (bb_is_topic() && bb_get_topicmeta($topic->topic_id, 'hide_socialit') == true) { $dont_get_si = true; } if (!$dont_get_si) { if (bb_is_topic()) { $perms = urlencode(get_topic_link()); $title = get_topic_title(); $feedperms = strtolower($perms); // Grab post tags for Twittley tags. If there aren't any, use default tags set in plugin options page $get_tags = bb_get_topic_tags(get_topic_id()); if ($get_tags) { foreach ($get_tags as $tag) { $keywords = $keywords . $tag->name . ','; } } $topic_id_ft = get_topic_id(); //topic id for getting text $first_post = (int) $bbdb->get_var("SELECT post_id FROM {$bbdb->posts} WHERE topic_id = {$topic_id_ft} ORDER BY post_id ASC LIMIT 1"); $socialit_content = get_post_text($first_post); } else { $perms = socialit_get_current_url(); $title = bb_get_title(); $feedperms = strtolower($perms); $socialit_content = bb_get_option('description'); } if (strlen($title) >= 80) { $short_title = urlencode(substr($title, 0, 80) . "[..]"); } else { $short_title = urlencode($title); } $title = urlencode($title); $site_name = bb_get_option('name'); $socialit_content = urlencode(substr(strip_tags(strip_shortcodes($socialit_content)), 0, 300)); $socialit_content = socialit_change_plus_apos($socialit_content); $mail_subject = socialit_change_plus_apos($title); $post_summary = stripslashes($socialit_content); if (!empty($keywords)) { $d_tags = $keywords; } else { $d_tags = $socialit_plugopts['defaulttags']; } $site_name = bb_get_option('name'); $y_cat = $socialit_plugopts['ybuzzcat']; $y_med = $socialit_plugopts['ybuzzmed']; $t_cat = $socialit_plugopts['twittcat']; $short_url = socialit_get_fetch_url(); $current_rss_link = socialit_get_current_rss_link(); // Temporary fix for bug that breaks layout when using NextGen Gallery plugin if (strpos($post_summary, '[') || strpos($post_summary, ']')) { $post_summary = ""; } if (strpos($socialit_content, '[') || strpos($socialit_content, ']')) { $socialit_content = ""; } // select the background if (!isset($socialit_plugopts['bgimg-yes'])) { $bgchosen = ''; } elseif ($socialit_plugopts['bgimg'] == 'sexy') { $bgchosen = ' social-it-bg-sexy'; } elseif ($socialit_plugopts['bgimg'] == 'caring') { $bgchosen = ' social-it-bg-caring'; } elseif ($socialit_plugopts['bgimg'] == 'care-old') { $bgchosen = ' social-it-bg-caring-old'; } elseif ($socialit_plugopts['bgimg'] == 'love') { $bgchosen = ' social-it-bg-love'; } elseif ($socialit_plugopts['bgimg'] == 'wealth') { $bgchosen = ' social-it-bg-wealth'; } elseif ($socialit_plugopts['bgimg'] == 'enjoy') { $bgchosen = ' social-it-bg-enjoy'; } $style = $socialit_plugopts['autocenter'] ? '' : ' style="' . __($socialit_plugopts['xtrastyle']) . '"'; $isfeed = bb_is_feed(); if ($isfeed) { $style = ''; } // do not add inline styles to the feed. $expand = $socialit_plugopts['expand'] ? ' social-it-expand' : ''; if ($socialit_plugopts['autocenter'] == 1) { $autocenter = ' social-it-center'; } elseif ($socialit_plugopts['autocenter'] == 2) { $autocenter = ' social-it-spaced'; } else { $autocenter = ''; } //write the menu $socials = "\n\n" . '<!-- Start Of Code Generated By Social It Plugin By www.gaut.am -->' . "\n" . '<div class="social-it' . $expand . $autocenter . $bgchosen . '"' . $style . '><ul class="socials">'; foreach ($socialit_plugopts['bookmark'] as $name) { if ($name == 'socialit-twitter') { $socials .= bookmark_list_item($name, array('post_by' => !empty($socialit_plugopts['twittid']) ? "(via+@" . $socialit_plugopts['twittid'] . ")" : '', 'short_title' => $short_title, 'fetch_url' => $short_url)); } elseif ($name == 'socialit-mail') { $socials .= bookmark_list_item($name, array('title' => $mail_subject, 'post_summary' => $post_summary, 'permalink' => $perms)); } elseif ($name == 'socialit-diigo') { $socials .= bookmark_list_item($name, array('socialit_teaser' => $socialit_content, 'permalink' => $perms, 'title' => $title)); } elseif ($name == 'socialit-linkedin') { $socials .= bookmark_list_item($name, array('post_summary' => $post_summary, 'site_name' => $site_name, 'permalink' => $perms, 'title' => $title)); } elseif ($name == 'socialit-comfeed') { $socials .= bookmark_list_item($name, array('permalink' => $current_rss_link)); } elseif ($name == 'socialit-yahoobuzz') { $socials .= bookmark_list_item($name, array('permalink' => $perms, 'title' => $title, 'yahooteaser' => $socialit_content, 'yahoocategory' => $y_cat, 'yahoomediatype' => $y_med)); } elseif ($name == 'socialit-twittley') { $socials .= bookmark_list_item($name, array('permalink' => urlencode($perms), 'title' => $title, 'post_summary' => $post_summary, 'twitt_cat' => $t_cat, 'default_tags' => $d_tags)); } else { $socials .= bookmark_list_item($name, array('post_summary' => $post_summary, 'permalink' => $perms, 'title' => $title)); } } $socials .= '</ul><div style="clear:both;"></div></div><!-- End Of Code Generated By Social It Plugin By www.gaut.am -->' . "\n\n"; return $socials; } }
function bb_title($args = '') { echo apply_filters('bb_title', bb_get_title($args)); }