Search Results for 'code'
-
AuthorSearch Results
-
September 8, 2009 at 4:26 am #78748
In reply to: Plugin to display photos and html
Olaf Lederer
Participantyou can put html in code tags like
<h3>Hello World</h3>
September 7, 2009 at 8:56 pm #78741In reply to: Private Messaging
Olaf Lederer
ParticipantHi,
personal messaging is not a default function in bbpress, bbpress is great because of other features
September 7, 2009 at 8:52 pm #67520In reply to: Plugin suggestions
Olaf Lederer
ParticipantI get it working!
I added those two replace function before the geshi object is created:
$code = str_replace("& lt;", "<", $code);
$code = str_replace("& gt;", ">", $code);and I use the default priority for the filters. Are the replacements a problem?
September 7, 2009 at 8:44 pm #78687In reply to: call register form via php tag
johnnydoe
Memberjust a another one quick…
i’d like to create a sidebar.php , and i’d like to add
<?php bb_get_sidebar(); ?>
to a particular page (so not a global call to all pages).my experiment was:
<script>
function bb_get_sidebar() {
bb_load_template( 'sidebar.php' );
}
</script>in header.php (inside head).
2.
<?php bb_get_sidebar(); ?>
(inside body).but no success, what am I doing wrong?
September 7, 2009 at 7:55 pm #67518In reply to: Plugin suggestions
Olaf Lederer
ParticipantI 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);September 7, 2009 at 7:55 pm #31668Topic: WPMU 2.8.4a deep integration breaks RSS feed
in forum TroubleshootingGreg
ParticipantI have BP 1.0.2 and WPMU 2.8.4 with deep integration (I call wp-blog-header.php in ‘bb-config.php’).
All of the forum RSS feeds work, except the top level feed of all new posts across the forum: <site URL>/<forum name>/rss/
This is true for FF, IE and Safari.
In IE, I see the error:
Invalid xml declaration.
Line: 13 Character: 3
<?xml version="1.0" encoding="UTF-8"?>Viewing the source, it looks like WPMU is inserting an XML header above the bbPress XML header:
<?xml version="1.0" encoding="UTF-8"?><!-- generator="WordPress/2.8.4" -->
<rss version="0.92">
<channel>
<title>[SITE NAME] » Page not found</title>
<link>[SITE URL]</link>
<description>Just another [SITE NAME] weblog</description>
<lastBuildDate>Sun, 06 Sep 2009 14:07:54 +0000</lastBuildDate>
<docs>http://backend.userland.com/rss092</docs>
<language>en</language>
</channel>
</rss>
<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.2" -->
ETC...Does anyone else have this issue.
I have repo’d something very similar on a previous version of the site that is using WPMU 2.2.
September 7, 2009 at 7:46 pm #78745In reply to: Plugin to display photos and html
kirpiit
MemberFor images you might want to try https://bbpress.org/plugins/topic/allow-images/
As for the html I’m not sure I understand your question.
Plain html should work
<img src="http://image-location.jpeg" />
September 7, 2009 at 7:35 pm #77519In reply to: All RSS Feeds Broken?
Greg
Participant@kawauso, that line in the error is the source on line 13: “<?xml version=”1.0″?><!– generator=”bbPress” –>”
I should have looked at the source though. It seems that the xml has two headers. Could this be related to deep integration?
<?xml version="1.0" encoding="UTF-8"?><!-- generator="WordPress/2.8.4" -->
<rss version="0.92">
<channel>
<title>[SITENAME] » Page not found</title>
<link>http://[HOST]</link>
<description>Just another [HOST] weblog</description>
<lastBuildDate>Sun, 06 Sep 2009 14:07:54 +0000</lastBuildDate>
<docs>http://backend.userland.com/rss092</docs>
<language>en</language>
</channel>
</rss>
<?xml version="1.0"?><!-- generator="bbPress" -->
<rss version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
>
<channel>
<title>[SITENAME] Forum » Recent Posts</title>
<link>http://[FORUM URL]b/</link>
<description>[SITENAME] » Recent Posts</description>
<language>en</language>
<pubDate>Mon, 07 Sep 2009 19:27:36 +0000</pubDate>
<item>September 7, 2009 at 7:34 pm #77518In reply to: All RSS Feeds Broken?
kirpiit
MemberOk, I got it! Or close to that…
I happen to have this patch on my system
https://bbpress.org/forums/topic/updated-to-desmond-but-theme-not-working#post-4254
As I disable that, the magic is done and rss comes back to life!
While I cannot say “what” is wrong with such a patch, I’m happy to confirm that just eliminating it does the trick. In case anybody else has the same issue…
Thanks for the kind help to everybody, with a special thank to kawauso
September 7, 2009 at 7:01 pm #78735In reply to: Where to put adsense code?
fl00r97
MemberBrilliant!
I copied the code into header.php and tweaked it a bit to show the ad. Here’s the result: http://www.qtext.nl
Thank you so much.
P.s.: ik zie net in je profiel dat je ook uit Nederland komt!
September 7, 2009 at 6:34 pm #77517In reply to: All RSS Feeds Broken?
Adam Harley (Kawauso)
MemberAh crap, everything is breaking today
@Reboot Now: That looks like a different issue. Could you post line 13 of the broken RSS feed (view source)?
September 7, 2009 at 6:26 pm #77516In reply to: All RSS Feeds Broken?
Greg
ParticipantNot sure whether this is the same issue, but thought I’d post it here just in case. Before and after the above patch, I get exactly the same result. All of the RSS feeds display correctly, except the feed for all posts across the forums, that is, “<forum URL>/rss/”, which displays a blank page.
This is true for Firefox and IE7. On the problem page, IE gives the message “feed code error”, with the following details:
Invalid xml declaration.
Line: 13 Character: 3
<?xml version="1.0" encoding="UTF-8"?>[update] One difference between before and after the patch is the IE error. *Before* the patch it says:
Invalid xml declaration.
Line: 13 Character: 3
<?xml version="1.0"?><!-- generator="bbPress" -->One interesting thing: if I browse to “<forum URL>/rss.php” (note the php extension I added), then the top level feed displays fine.
Here are the details of the pages I browsed and the results. All well, except for the top level feed.
<forum URL>/rss/ [blank page] – this is the published feed
<forum URL>/rss [blank page]
<forum URL>/rss/topic/<topic name> [correct feed displays]
<forum URL>/rss/forum/<forum name> [correct feed displays]
<forum URL>/rss/forum/<forum name>/topics [correct feed displays]
But…
<forum URL>/rss.php [correct feed displays]
September 7, 2009 at 6:14 pm #78734In reply to: Where to put adsense code?
Olaf Lederer
Participantjust 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
September 7, 2009 at 4:05 pm #78716In reply to: How to load the header of my theme?
pixelgirl
MemberI guessed I’ll have to do that, but I have no idea which files I need to edit. The bbpress header file looks so much different from the wp file. It works somehow on the buddypress page. I want the same for me
Another option might be, that I just work on the existing bbpress theme and try to adjust the design as good as possible. I’d be happy to be able to load my buddypress navigation at least, the rest can be done with using the local css files. Other good ideas are welcome.
pxlgirl.
September 7, 2009 at 2:14 pm #78249In reply to: New Theme – Need Theme Name
_asg_
MemberThe slider won’t open for me.
Firebug states:
$("#open") is undefined
anonymous() slide.js (line 4)
anonymous() jquery-1....2.min.js (line 19)
anonymous([function(), function()], function(), Object name=F) jquery-1....2.min.js (line 12)
anonymous() jquery-1....2.min.js (line 19)
anonymous() jquery-1....2.min.js (line 19)
[Break on this error] $("#open").click(function(){n slide.js (line 4)The forum url is http://rainrider.eu/bbpress if you would like to take a look
September 7, 2009 at 12:56 pm #78686In reply to: call register form via php tag
johnnydoe
Memberah alright i see,
thank’s for the clear explanation kawauso, sounds plausible, thank’s olaf.
see you around
September 7, 2009 at 12:47 pm #78733In reply to: Where to put adsense code?
Adam Harley (Kawauso)
MemberOkay I can’t work out how to get it to position relative to the theme, since it just… disappears if I try aligning it properly at
left: -1000px
. Putting<div style="position: absolute; left: 100px;">
and</div>
around it will put it on the left of the screen outside the layout though, just fixed against the side of the screen rather than the layout.@Olaf: this theme does some awful things if you try aligning anything to its left using a div
September 7, 2009 at 12:41 pm #78732In reply to: Where to put adsense code?
fl00r97
MemberThanks for your reply Olaf, but I think this is beyond my understanding.
Can you please elaborate?
Thanks!
Ben
September 7, 2009 at 12:39 pm #78036In reply to: Important update for bbpress seo tools
Olaf Lederer
Participant@dragunoff, upgrade to the latest bbpress version
September 7, 2009 at 12:36 pm #78731In reply to: Where to put adsense code?
Olaf Lederer
ParticipantHi, 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
September 7, 2009 at 11:52 am #78730In reply to: Where to put adsense code?
fl00r97
MemberSeptember 7, 2009 at 11:49 am #76218In reply to: Closed registrations
Adam Harley (Kawauso)
Member@pixelgirl Give me your forums’ link and I’ll see if I can register ;P you might still get spambots if they work out how to spam bbPress forums. Brutally brutal way would be to change
$_POST && 'post' == strtolower($_SERVER['REQUEST_METHOD'])
inregister.php
in bbPress’ base directory tofalse
, which would turn off processing for any data passed to the register page.September 7, 2009 at 11:43 am #76217In reply to: Closed registrations
pixelgirl
MemberI closed the registrations the brutal way.
I removed all <form></form> in register.php and added a message instead. Quick and dirty, but effective since I’m using bbpress with wpmu+buddypress, so users don’t need to register in the forums.
pxlgirl.
September 7, 2009 at 11:42 am #78729In reply to: Where to put adsense code?
Adam Harley (Kawauso)
MemberI don’t usually work with adsense so I don’t know what the div it’s in is called. If you can post a link to your site with AdSense running I can probably work out some CSS though.
September 7, 2009 at 11:39 am #78728In reply to: Where to put adsense code?
fl00r97
MemberIncredible fast response, thanks!
I corrected the link, please try again.
Ben
-
AuthorSearch Results