posts, $wpdb->comments WHERE $wpdb->posts.ID=$wpdb->comments.comment_post_ID AND $wpdb->comments.comment_approved = '1' AND $wpdb->comments.comment_type = '' AND comment_author != '' ORDER BY $wpdb->comments.comment_date DESC LIMIT $num");
$result = mysql_query($query);
while ($data = mysql_fetch_row($result)) {
echo '
';
echo '
';
echo '';
echo '';
}
}
?>«';
}
if(empty($nxtlabel)) {
$nxtlabel = '»';
}
$half_pages_to_show = round($pages_to_show/2);
if (!is_single()) {
if(!is_category()) {
preg_match('#FROM\s(.*)\sORDER BY#siU', $request, $matches);
} else {
preg_match('#FROM\s(.*)\sGROUP BY#siU', $request, $matches);
}
$fromwhere = $matches[1];
$numposts = $wpdb->get_var("SELECT COUNT(DISTINCT ID) FROM $fromwhere");
$max_page = ceil($numposts /$posts_per_page);
if(empty($paged)) {
$paged = 1;
}
if($max_page > 1 || $always_show) {
echo "$before Pages ($max_page): ";
if ($paged >= ($pages_to_show-1)) {
echo '
« First ... ';
}
previous_posts_link($prelabel);
for($i = $paged - $half_pages_to_show; $i <= $paged + $half_pages_to_show; $i++) {
if ($i >= 1 && $i <= $max_page) {
if($i == $paged) {
echo "
$i";
} else {
echo '
'.$i.' ';
}
}
}
next_posts_link($nxtlabel, $max_page);
if (($paged+$half_pages_to_show) < ($max_page)) {
echo ' ...
Last »';
}
echo "
$after";
}
}
}
?>'Title:', 'type'=>'text', 'default'=>'');
$twitter_options['widget_fields']['username'] = array('label'=>'Username:', 'type'=>'text', 'default'=>'');
$twitter_options['widget_fields']['num'] = array('label'=>'Number of links:', 'type'=>'text', 'default'=>'5');
$twitter_options['widget_fields']['update'] = array('label'=>'Show timestamps:', 'type'=>'checkbox', 'default'=>true);
$twitter_options['widget_fields']['linked'] = array('label'=>'Linked:', 'type'=>'text', 'default'=>'#');
$twitter_options['widget_fields']['hyperlinks'] = array('label'=>'Discover Hyperlinks:', 'type'=>'checkbox', 'default'=>true);
$twitter_options['widget_fields']['twitter_users'] = array('label'=>'Discover @replies:', 'type'=>'checkbox', 'default'=>true);
$twitter_options['widget_fields']['encode_utf8'] = array('label'=>'UTF8 Encode:', 'type'=>'checkbox', 'default'=>false);
$twitter_options['prefix'] = 'twitter';
function twitter_messages($username = '', $num = 1, $list = false, $update = true, $linked = '#', $hyperlinks = true, $twitter_users = true, $encode_utf8 = false) {
global $twitter_options;
include_once(ABSPATH . WPINC . '/rss.php');
$messages = fetch_rss('http://twitter.com/statuses/user_timeline/'.$username.'.rss');
if ($list) echo '';
}
// Link discover stuff
function hyperlinks($text) {
// match protocol://address/path/file.extension?some=variable&another=asf%
$text = preg_replace("/\s([a-zA-Z]+:\/\/[a-z][a-z0-9\_\.\-]*[a-z]{2,6}[a-zA-Z0-9\/\*\-\?\&\%]*)([\s|\.|\,])/i"," $2", $text);
// match www.something.domain/path/file.extension?some=variable&another=asf%
$text = preg_replace("/\s(www\.[a-z][a-z0-9\_\.\-]*[a-z]{2,6}[a-zA-Z0-9\/\*\-\?\&\%]*)([\s|\.|\,])/i"," $2", $text);
// match name@address
$text = preg_replace("/\s([a-zA-Z][a-zA-Z0-9\_\.\-]*[a-zA-Z]*\@[a-zA-Z][a-zA-Z0-9\_\.\-]*[a-zA-Z]{2,6})([\s|\.|\,])/i"," $2", $text);
return $text;
}
function twitter_users($text) {
$text = preg_replace('/([\.|\,|\:|\�|\�|\>|\{|\(]?)@{1}(\w*)([\.|\,|\:|\!|\?|\>|\}|\)]?)\s/i', "$1$3 ", $text);
return $text;
}
// Twitter widget stuff
function widget_twitter_init() {
if ( !function_exists('register_sidebar_widget') )
return;
$check_options = get_option('widget_twitter');
if ($check_options['number']=='') {
$check_options['number'] = 1;
update_option('widget_twitter', $check_options);
}
function widget_twitter($args, $number = 1) {
global $twitter_options;
// $args is an array of strings that help widgets to conform to
// the active theme: before_widget, before_title, after_widget,
// and after_title are the array keys. Default tags: li and h2.
extract($args);
// Each widget can store its own options. We keep strings here.
include_once(ABSPATH . WPINC . '/rss.php');
$options = get_option('widget_twitter');
// fill options with default values if value is not set
$item = $options[$number];
foreach($twitter_options['widget_fields'] as $key => $field) {
if (! isset($item[$key])) {
$item[$key] = $field['default'];
}
}
$messages = fetch_rss('http://twitter.com/statuses/user_timeline/'.$username.'.rss');
// These lines generate our output.
echo $before_widget . $before_title . $item['title'] . $after_title;
twitter_messages($item['username'], $item['num'], true, $item['update'], $item['linked'], $item['hyperlinks'], $item['twitter_users'], $item['encode_utf8']);
echo $after_widget;
}
// This is the function that outputs the form to let the users edit
// the widget's title. It's an optional feature that users cry for.
function widget_twitter_control($number) {
global $twitter_options;
// Get our options and see if we're handling a form submission.
$options = get_option('widget_twitter');
if ( isset($_POST['twitter-submit']) ) {
foreach($twitter_options['widget_fields'] as $key => $field) {
$options[$number][$key] = $field['default'];
$field_name = sprintf('%s_%s_%s', $twitter_options['prefix'], $key, $number);
if ($field['type'] == 'text') {
$options[$number][$key] = strip_tags(stripslashes($_POST[$field_name]));
} elseif ($field['type'] == 'checkbox') {
$options[$number][$key] = isset($_POST[$field_name]);
}
}
update_option('widget_twitter', $options);
}
foreach($twitter_options['widget_fields'] as $key => $field) {
$field_name = sprintf('%s_%s_%s', $twitter_options['prefix'], $key, $number);
$field_checked = '';
if ($field['type'] == 'text') {
$field_value = htmlspecialchars($options[$number][$key], ENT_QUOTES);
} elseif ($field['type'] == 'checkbox') {
$field_value = 1;
if (! empty($options[$number][$key])) {
$field_checked = 'checked="checked"';
}
}
printf('',
$field_name, __($field['label']), $field_name, $field_name, $field['type'], $field_value, $field['type'], $field_checked);
}
echo '';
}
function widget_twitter_setup() {
$options = $newoptions = get_option('widget_twitter');
if ( isset($_POST['twitter-number-submit']) ) {
$number = (int) $_POST['twitter-number'];
$newoptions['number'] = $number;
}
if ( $options != $newoptions ) {
update_option('widget_twitter', $newoptions);
widget_twitter_register();
}
}
function widget_twitter_page() {
$options = $newoptions = get_option('widget_twitter');
?>
300, 'height' => 300);
$class = array('classname' => 'widget_twitter');
for ($i = 1; $i <= 9; $i++) {
$name = sprintf(__('Twitter #%d'), $i);
$id = "twitter-$i"; // Never never never translate an id
wp_register_sidebar_widget($id, $name, $i <= $options['number'] ? 'widget_twitter' : /* unregister */ '', $class, $i);
wp_register_widget_control($id, $name, $i <= $options['number'] ? 'widget_twitter_control' : /* unregister */ '', $dims, $i);
}
add_action('sidebar_admin_setup', 'widget_twitter_setup');
add_action('sidebar_admin_page', 'widget_twitter_page');
}
widget_twitter_register();
}
add_action('widgets_init', 'widget_twitter_init');
?>current_component;
$current_action = $bp->current_action;
$directory = $bp->is_directory;
if (!is_home() ) {
if(isset($bp->groups->slug)){
if (!$directory && $rr_title == $bp->groups->slug) {
if (!isset($current_action)) {?>
events->slug)){
if (!$directory && $rr_title == $bp->events->slug) {
if (!isset($current_action)) {?>
profile->slug)){
if (!$directory && $rr_title == $bp->profile->slug) { ?>
blogs->slug)){
if (!$directory && $rr_title == $bp->blogs->slug) { ?>
blogs->slug) { ?>
groups->slug)){
if ($directory && $rr_title == $bp->groups->slug) { ?>
events->slug)){
if ($directory && $rr_title == $bp->events->slug) { ?>
friends->slug)){
if (!$directory && $rr_title == $bp->friends->slug) {?>
wire->slug)){
if (!$directory && $rr_title == $bp->wire->slug) {?>
activity->slug)){
if (!$directory && $rr_title == $bp->activity->slug) {?>
Seo for Buddypress Options
special tags:
%username% = user full name of the user displayed
%groupname% = group name of the group displayed
%eventname% = event name of the event displayed
displayed_user->fullname;
$value = str_replace("%username%", $user_tmp, $template);
} else if(strpos($template, '%groupname%') !== false) {
$user_tmp= $bp->bp_options_title;
$value = str_replace("%groupname%", $user_tmp, $template);
} else if(strpos($template, '%eventname%') !== false) {
$pageURL = 'http';
if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";}
$pageURL .= "://";
if ($_SERVER["SERVER_PORT"] != "80") {
$pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
} else {
$pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
}
$teilstring=explode('/',$pageURL);
$user_tmp =$teilstring[4];
$value = str_replace("%eventname%", $user_tmp, $template);
} else{
$value = $template;
}
return $value;
}
### Update the option page data to the option table or delete all data and fields from the option table.
function rr_bp_seo_options_page(){
global $current_user;
get_currentuserinfo();
if (isset($_POST['directory_blogs'])) {
$option_prefix_directory_blogs_title = $_POST['directory_blogs_title'];
$option_prefix_directory_blogs = $_POST['directory_blogs'];
$option_prefix_directory_blogs_tags = $_POST['directory_blogs_tags'];
update_option('rr_bp_seo_directory_blogs_title', $option_prefix_directory_blogs_title);
update_option('rr_bp_seo_directory_blogs', $option_prefix_directory_blogs);
update_option('rr_bp_seo_directory_blogs_tags', $option_prefix_directory_blogs_tags);
update_option('rr_bp_seo_userId', $current_user->ID);
?> Options profile changes saved.
ID);
?> Options profile changes saved.
ID);
?> Options profile changes saved.
ID);
?> Options profile changes saved.
ID);
?> Options profile changes saved.
ID);
?> Options blogs changes saved.
ID);
?> Options blogs forum changes saved.
ID);
?> Options blogs wire changes saved.
ID);
?> Options blogs members changes saved.
ID);
?> Options blogs home changes saved.
ID);
?> Options blogs forum changes saved.
ID);
?> Options blogs forum changes saved.
ID);
?> Options blogs wire changes saved.
ID);
?> Options blogs members changes saved.
ID);
?> Options blogs home changes saved.
ID);
?> Options medien changes saved.
ID);
?> Options friends changes saved.
ID);
?> Options groups changes saved.
ID);
?> Options wire changes saved.
ID);
?> Options activity changes saved.
ID);
?> Options youtube changes saved.
ID);
?> Options flickr changes saved.
Seo for Buddypress filds in option table sugsesful deleeted.