Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Show off your Forum !!


AdventureCanoe
Member

@adventurecanoe

Adventure Canoe Forum

I started a canoeing specific forum. It’s finally starting to get some traffic. I’ve used some standard plugins as well as writing some of my own.

_CK_’s plugins are indispensable.

here’s a could packed into one that do a lot of SEO stuff like titles, canonical links and opening links in new windows.

<?php
/*
Plugin Name: Target Blank
Description: append target="_blank" to all links and other fun stuff
Author: James
Version: 1
*/
//add rel=external to post links... there's also some stuff in here to allow more tags

function bb_target_blank( $text ) {
$text = preg_replace('|<a (.+?)>|i', '<a $1 target="_blank">', $text);
return $text;
}
add_filter('pre_post', 'bb_target_blank');

// Add Tags with allow_tags

function allow_more_tags( $tags ) {
$tags['p'] = array('style' => array());
$tags['h3'] = array('style' => array());
$tags['span'] = array('style' => array());
$tags['b'] = array('style' => array());
$tags['em'] = array('style' => array());
$tags['ol'] = array('style' => array());
$tags['target'] = array('style' => array());
$tags['iframe'] = array('style' => array());

return $tags;
}

add_filter( 'bb_allowed_tags', 'allow_more_tags' );

function meta_keywords() {
global $tags;
if (!empty($tags)) {
$keywords="";
foreach ($tags as $t) {$keywords.=$t->raw_tag.', ';}
echo "n".'<meta NAME="keywords" CONTENT="'.trim($keywords,", ").'">'."n";
}
} add_action('bb_head', 'meta_keywords',8);

function set_canonical_links() {
global $page;
if (is_front()) {

$url = (!empty($_SERVER['HTTPS'])) ? "https://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'] : "http://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];

echo '
<link rel="canonical" href="'.$url.'" />'.PHP_EOL;
} elseif (bb_is_topic()) {
$tlink = get_topic_link();
if ($page > 1) {
$turl = $tlink.'/page/'.$page;
} else {
$turl = get_topic_link();
}
echo '
<link rel="canonical" href="'.$turl.'" />'.PHP_EOL;
} elseif (is_forum()) {
echo '
<link rel="canonical" href="'.get_forum_link().'" />'.PHP_EOL;
} else {
return;
}
}
add_action('bb_head','set_canonical_links');

?>

This one makes better page titles…it has some canoe specific stuff in it but I think you can see how it works and change it for your needs.

<?php
/*
Plugin Name: Better Titles
Author: James Dixson
*/
add_filter('bb_title', 'titlemodify');

function titlemodify( $title ) {
//your code that does something to $title;

switch ( bb_get_location() ) {
case 'topic-page':
$title = get_topic_title() . ' - ' . get_forum_name() . ' &mdash; Adventure Canoe Forum' ;
break;

case 'front-page':
$title = bb_option('name') . ' &mdash; Canoeing and Paddling Discussion' ;
break;

case 'forum-page':

$find = 'Canoe';
$string = get_forum_name() ;
if(strstr($string,$find)){
$title = get_forum_name() . ' &mdash; Adventure Canoe Forum' ;
}else{
$title = 'Canoe ' . get_forum_name() . ' &mdash; Adventure Canoe Forum' ;
}

break;

case 'profile-page':
$title = 'Profile for ' . get_user_name() . ' - Adventure Canoe Forum &mdash; Canoeing and Paddling Discussion' ;
break;
}
return $title;
}
?>

Anyway enjoy… and if you like canoeing post on the Adventure Canoe Forum

Skip to toolbar