Forum Replies Created
-
In reply to: Plugin suggestions
I worked on the wp-syntax plugin but it doesn’t parse the code
do you have an idea what’s missing?
function allow_syntax_tag($tags) {
$tags['pre'] = array('lang' => array(), 'line' => array(), 'escaped' => array(), 'style' => array(), 'width' => array());
return $tags;
}
add_filter('bb_allowed_tags', 'allow_syntax_tag');
include_once("geshi/geshi.php");
if (!defined("BB_PLUGIN_URL")) define("BB_PLUGIN_URL", bb_get_uri() . "/my-plugins");
function wp_syntax_head()
{
$css_url = BB_PLUGIN_URL . "wp-syntax/wp-syntax.css";
echo "n".'<link rel="stylesheet" href="' . $css_url . '" type="text/css" media="screen" />'."n";
}
function wp_syntax_code_trim($code)
{
// special ltrim b/c leading whitespace matters on 1st line of content
$code = preg_replace("/^s*n/siU", "", $code);
$code = rtrim($code);
return $code;
}
function wp_syntax_substitute(&$match)
{
global $wp_syntax_token, $wp_syntax_matches;
$i = count($wp_syntax_matches);
$wp_syntax_matches[$i] = $match;
return "nn<p>" . $wp_syntax_token . sprintf("%03d", $i) . "</p>nn";
}
function wp_syntax_line_numbers($code, $start)
{
$line_count = count(explode("n", $code));
$output = "<pre>";
for ($i = 0; $i < $line_count; $i++)
{
$output .= ($start + $i) . "n";
}
$output .= "</pre>";
return $output;
}
function wp_syntax_highlight($match)
{
global $wp_syntax_matches;
$i = intval($match[1]);
$match = $wp_syntax_matches[$i];
$language = strtolower(trim($match[1]));
$line = trim($match[2]);
$escaped = trim($match[3]);
$code = wp_syntax_code_trim($match[4]);
if ($escaped == "true") $code = htmlspecialchars_decode($code);
//$code = clean_pre($code);// new
$geshi = new GeSHi($code, $language);
$geshi->enable_keyword_links(false);
do_action_ref_array('wp_syntax_init_geshi', array(&$geshi));
$output = "n<div class="wp_syntax">";
if ($line)
{
$output .= "<table><tr><td class="line_numbers">";
$output .= wp_syntax_line_numbers($code, $line);
$output .= "</td><td class="code">";
$output .= $geshi->parse_code();
$output .= "</td></tr></table>";
}
else
{
$output .= "<div class="code">";
$output .= $geshi->parse_code();
$output .= "</div>";
}
$output .= "</div>n";
return $output;
}
function wp_syntax_before_filter($content)
{
$content = preg_replace_callback(
"/s*<pre(?:lang=["']([w-]+)["']|line=["'](d*)["']|escaped=["'](true|false)?["']|s)+>(.*)</pre>s*/siU",
"wp_syntax_substitute",
$content
);
return $content;
}
function wp_syntax_after_filter($content)
{
global $wp_syntax_token;
$content = preg_replace_callback(
"/<p>s*".$wp_syntax_token."(d{3})s*</p>/si",
"wp_syntax_highlight",
$content
);
return $content;
}
$wp_syntax_token = md5(uniqid(rand()));
// Add styling
add_action('bb_head', 'wp_syntax_head');
// We want to run before other filters; hence, a priority of 0 was chosen.
// The lower the number, the higher the priority. 10 is the default and
// several formatting filters run at or around 6.
add_filter('post_text', 'wp_syntax_before_filter', 0);
// We want to run after other filters; hence, a priority of 99.
add_filter('post_text', 'wp_syntax_after_filter', 99);In reply to: Where to put adsense code?just example code…
header.php (the two divs between body and wrapper)
<body id="<?php bb_location(); ?>">
<div style="position:relative;width:1200px;border:1px solid red;margin:0 auto;">
<div style="width:120px;left:0;top:200px;position:absolute;height:600px;background-color:yellow;"></div>
<div id="wrapper">footer.php (the div before the action)
</div>
</div>
<?php do_action('bb_foot'); ?>
</body>
</html>I checked this only i firefox (Ubuntu) and of course the header background image is only between the new container (put the background into the body style.
@floor97,
before you’re able to tweak themes you need to know some CSS
In reply to: Important update for bbpress seo tools@dragunoff, upgrade to the latest bbpress version
In reply to: Where to put adsense code?Hi, to place an ad box like this you need to tweak the existing theme.
Try to open an extra div container inside the header tpl file and close the container inside the footer tpl.
inside this container you can place the forum plus a banner (of course you need to change some css code)
EDIT: btw adsense doesn’t have a great CTR for forums
In reply to: Custom registration fields?There are several topic about custom fields, try a search and check this one:
https://bbpress.org/forums/topic/plugin-allow-additional-or-custom-profile-fields
In reply to: can i open a bbpress forum without having a server?or try some other free hosting with php/mysql enabled
In reply to: call register form via php tagright login form is a function and the register form is a complete page.
there is also a login page. The function login form is used inside the header template
In reply to: Free hosting for bbPressI think you need more since there are sites providing buddypress+wordpress+bbpress
success with your free hosting site
In reply to: Lack of bbsync means I might go with SMFSure step over to SMF if you like to have:
– more spam
– more plugins (to get it working as a forum should work)
I never tried to use bbpress with wordpress, but I’m sure that both are able to work together (based on the same script)
In reply to: Login using Facebook Connectlol there are thousands I guess … (check the footer: Powered by vBulletin®)
In reply to: do you think which url is better friendly to seoSomewhere I read that Matt Cutts said that keyword rich URL’s are better (sorry cannot find that site)
but there is more than the URL, try this SEO plugin:
In reply to: canonical URLs for bbPress 1.02?how about canonical links like suggested by Google?
http://googlewebmastercentral.blogspot.com/2009/02/specify-your-canonical.html
In reply to: Hooks & Filters Docuno that is link is Okay, but his server is hacked
In reply to: css problemmight be changed in my own sheet, but this is the class:
#latest th, #forumlist th, #favorites th {
text-align: left;
background-color:#666666;
font: 11px Arial, Helvetica, sans-serif;
font-weight: normal;
padding: 5px 9px;
color:#fff;
white-space: nowrap
}In reply to: Connecting Facebook group to BBPress ?bbpress registrations via facebook connect is not so strange, but there is no plugin at the moment, check facebook connect plugin from wordpress, maybe you can change it that it works.
btw. that would be a great feature.
In reply to: Managing FavoritesSubscribe to the RSS feed in Google reader
I thought long about to have a function like in other forum scripts, but these days RSS is the way how to do it.
I wrote an article about:
http://www.finalwebsites.com/forums/topic/how-to-subscribe-to-topics-from-a-bbpress-forum
In reply to: Failing miserably at porting themestart with the header and footer, keep the “middle part” as it is.
if you can modify create themes for WP, than it’s not so hard to do the same for bbpress
In reply to: 10,000 downloads of bbPress in Augustthat’s a great number! I’m sure that bbpress will become more popular…
In reply to: Alert/notification for new posts in a forum?hehe, I like my plugin very much, most of all if I get a notification mail about a new spam thread and that one was already filtered by Akismet
In reply to: RSS feed for userthis feed is not standard in bbpress, but maybe it’s quite easy to add this function (will check this tomorrow)
In reply to: jquery @ global headerbb_active_theme_uri()
Maybe you need to use a function as
dirname()
or other URL function to get the directory stringIn reply to: Important update for bbpress seo toolsHi,
I used the almost the same version before for bbpress 0.9, it’s just the one important change for old users upgraded to 1.0. Just try it or better upgrade to bbpress 1.02
In reply to: Login using Facebook ConnectI’m using a WP plugin for my blog, can’t imagine it would be that difficult…
https://wordpress.org/extend/plugins/wp-facebookconnect/
The connect button is automatically added to the registration page and a user is created.
These two things need some modifications I guess
In reply to: PHP Help (Compressing code)so you can use a wildcard here?
glob( BB_PATH . 'avatars/' . $current_user->user_login . '.*' )
after 6 years of php programming I found this function, thanks
In reply to: Important update for bbpress seo toolsGreat than it’s time to change that