Search Results for 'code'
-
AuthorSearch Results
-
October 28, 2006 at 4:35 pm #828
Topic: Img tag plugin
in forum PluginsAphelionZ
ParticipantSomebody should take the work done here and make it into a plugin, preferably one that will allow the use of img tags between
codetags.You will be a hero.
AphelionZ
Participantbut that’s exactly what I did but I plugin-ified it instead of just hacking the code…
I just tried what you did and it works! Excellent. There must be something wrong with my plugin approach (aka i don’t fully understand filters).
Great work – my users will be excited.
meeciteewurkor
Memberin formatting-functions.php I added this under the function encode_bad:
$text = preg_replace('|<(/?img.*?)>|', '<$1>', $text);under function bb_allowed_tags() I added this:
'img' => array('src' => array(),
'alt' => array(),
'title' => array()),
for an example see this post I made where it succeeded.
http://meeciteewurkor.com/bbpress/topic/7?replies=2#post-21
I added the /bb-images/bbpress.png image in a post. yay!
meeciteewurkor
Memberyeah, regex is confusing sometimes. I just bought a book on them off of Amazon. I’ll get back with you in a week or so.
jk. I’ll keep fiddling and see what I can turn up, if anything.
AphelionZ
Participantfunction outlet_encode_bad( $text ) {$text = wp_specialchars($text);
$text = preg_replace('|<(/?strong)>|', '<$1>', $text);
$text = preg_replace('|<(/?em)>|', '<$1>', $text);
$text = preg_replace('|<(/?a.*?)>|', '<$1>', $text);
$text = preg_replace('|<(/?ol)>|', '<$1>', $text);
$text = preg_replace('|<(/?p)>|', '<$1>', $text);
$text = preg_replace('|<(/?img.*?)>|', '<$1>', $text);
$text = preg_replace('|
|', '
', $text);$text = preg_replace('|<(/?ul)>|', '<$1>', $text);
$text = preg_replace('|<(/?li)>|', '<$1>', $text);
$text = preg_replace('|<(/?blockquote.*?)>|', '<$1>', $text);
$text = preg_replace('|<(/?code)>|', '<$1>', $text);
$text = preg_replace(“|
(.*?)|se”, “‘' . encodeit('$1') . '‘”, $text);return $text;
}
..should work, but doesn’t.
Ok, how bbPress does it is that it takes every < and > and replaces them with the < and > characters.
Then, it goes through the above list (the exceptions) and turns the lt’s and the gt’s back to actual <‘s and >’s. I can’t get it to recognize the img tag though, because regular expressions confuse the hell out of me. If anybody can get it to recognize the img tags, you’d be making a lot of people happy. For now I am going to take a break…
October 28, 2006 at 2:48 pm #826Topic: How to read bb_topicmeta?
in forum Requests & Feedbackear1grey
MemberI’m writing a plugin and looking for a way to read the bb_topicmeta table without resorting to cranking out SQL. I can find the
bb_update_metamethod but no matchingbb_get_meta.Is there an obvious other metadata retrieval method or is this one for trac?
AphelionZ
ParticipantAdded this to the above function… still nothing
function outlet_encode_bad( $text ) {$text = wp_specialchars($text);
$text = preg_replace('|<(/?strong)>|', '<$1>', $text);
$text = preg_replace('|<(/?em)>|', '<$1>', $text);
$text = preg_replace('|<(/?a.*?)>|', '<$1>', $text);
$text = preg_replace('|<(/?ol)>|', '<$1>', $text);
$text = preg_replace('|<(/?p)>|', '<$1>', $text);
$text = preg_replace('|<(/?img)>|', '<$1>', $text);
$text = preg_replace('|
|', '
', $text);$text = preg_replace('|<(/?ul)>|', '<$1>', $text);
$text = preg_replace('|<(/?li)>|', '<$1>', $text);
$text = preg_replace('|<(/?blockquote.*?)>|', '<$1>', $text);
$text = preg_replace('|<(/?code)>|', '<$1>', $text);
$text = preg_replace(“|
(.*?)|se”, “‘' . encodeit('$1') . '‘”, $text);return $text;
}
add_filter( ‘encode_bad’, ‘outlet_encode_bad’, -1, 3);
There’s also the bb_autop function but that unfortunately is beyond me… I can barely understand regex as it is.
Anyone?
meeciteewurkor
Memberwhat about the encode_bad function in the same formatting-functions.php file?
It has the same list of default allowed html tags. I don’t know enough php yet to understand what it does, though?
Maybe the img tag needs to be placed here as well?
function encode_bad( $text ) {
$text = wp_specialchars($text);
$text = preg_replace('|<(/?strong)>|', '<$1>', $text);
$text = preg_replace('|<(/?em)>|', '<$1>', $text);
$text = preg_replace('|<(/?a.*?)>|', '<$1>', $text);
$text = preg_replace('|<(/?ol)>|', '<$1>', $text);
$text = preg_replace('|<(/?p)>|', '<$1>', $text);
$text = preg_replace('|
|', '
', $text);$text = preg_replace('|<(/?ul)>|', '<$1>', $text);
$text = preg_replace('|<(/?li)>|', '<$1>', $text);
$text = preg_replace('|<(/?blockquote.*?)>|', '<$1>', $text);
$text = preg_replace('|<(/?code)>|', '<$1>', $text);
$text = preg_replace(“|
(.*?)|se”, “‘' . encodeit('$1') . '‘”, $text);return $text;
October 28, 2006 at 2:20 pm #50500In reply to: post count – 1
Shawn Maddock
ParticipantWhoops, I should have specified that the code I posted replaced ear1grey’s. If you keep both then there are two filters being added to your “get_topic_posts”, which would cause the -1’s you’ve been seeing. Sorry ’bout that!
meeciteewurkor
Membernevermind, that list is hard-coded into post-form.php. That would have to be changed, too, just to let people know the tag is allowable. If we can get it to work, of course.
devils_advocate
MemberHOW do you make the plugins work?
the “display-name.php” file adds a header of broken links and mod info (which I don’t understand) to the beginning of every install page but otherwise appears to not do anything.
and the “bbpress-integration.php” plug-in for WordPress (I’m using 2) adds the same “Trac” information at the top of every loaded WP page…(!!!)
very frustrating…

help?
AphelionZ
ParticipantI just tried plugin-izing that but it didn’t work either… what are we missing?
<?php/*
Plugin Name: Allow <img> tags in posts
Plugin URI: https://bbpress.org/forums/topic/149
*/
function outlet_bb_allowed_tags() {
$tags = array(
'a' => array(
'href' => array(),
'title' => array(),
'rel' => array()),
'img' => array(
'src' => array(),
'alt' => array(),
'title' => array()),
'blockquote' => array('cite' => array()),
'br' => array(),
'code' => array(),
'em' => array(),
'strong' => array(),
'ul' => array(),
'ol' => array(),
'li' => array()
);
return apply_filters( 'bb_allowed_tags', $tags );
}
add_filter( 'bb_allowed_tags', 'outlet_bb_allowed_tags', -1, 3);
?>
meeciteewurkor
MemberThis didn’t work:
'img' => array('src' => array(),
'alt' => array(),
'title' => array()),
added that to formatting-function.php in the bb_allowed_tags() function.
Seems like it would have, though?
October 28, 2006 at 12:47 pm #50705In reply to: freshness = -1 years
meeciteewurkor
MemberOk, well that fixed the -1 year “freshness” problem. Now the post times are incorrect by 1hour.
I’m in -5 gmt timezone and my server is in -6gmt timezone.
One issue fixed and another created.
I seem to remember having this problem with WordPress a loooooooong time ago. Like pre 1.0 ago. Can’t remember how that was dealt with.Anyway, I’ll keep tinkering until I figure it out. Thanks for the help, AphelionZ.
October 28, 2006 at 6:49 am #50712In reply to: bbPress 0.73 released
AphelionZ
ParticipantNow you guys just need to make a wiki, and a gallery!!!
October 28, 2006 at 5:52 am #50465In reply to: Hard to warm me up for bbpress
peiqinglong
MemberIt was a bit fustrating in the beginning, but I’m finding it kind of fun. It’s a good back-to-basic-code refresher for me. Here is a little modding I’ve been doing: http://dev.abunchofcars.com/forum/ and I like its pretty easy to integrate into WP since its practically built off the same engine.
October 28, 2006 at 2:26 am #50718In reply to: using wordpress.com akismet spam key?
Nola1974
ParticipantTook me a bit to figure this out… it’s not a true/false configuration.
replace
'$bb->akismet_key = true;'with
'$bb->akismet_key = "123456789";'(123456789 being your key)
October 28, 2006 at 2:23 am #50499In reply to: post count – 1
Nola1974
ParticipantI couldn’t get rid of the -1’s, so I tinkered with it until it was working for me. This is working .73 as well.
<?phpfunction bb_decrement( $value ) {
return $value-1;
}
add_filter( 'get_topic_posts', 'bb_decrement', 1);
?>
<?php
function bb_decrement_topic( $value ) {
global $forum;
return $value;
}
function bb_decrement_forum( $value ) {
global $forum;
return $value-get_forum_topics();
}
add_filter( 'get_topic_posts', 'bb_decrement_topic', 1);
add_filter( 'get_forum_posts', 'bb_decrement_forum', 1);
?>
October 28, 2006 at 1:52 am #821Topic: using wordpress.com akismet spam key?
in forum Troubleshootingmeeciteewurkor
MemberHowdy,
just tinkering around with bbpress.
In the config.php file it has this:
‘$bb->akismet_key = true;’
How do I enter my key into that? Let’s say my key is 12345678. How would the code look after inserting the key?
thanks.
oh, guess I could add that I get this in my dashboard everytime I try to put the key in:
The API key you have specified is invalid. Please double check the ‘$bb->akismet_key’ variable in your config.php file.
October 27, 2006 at 9:59 pm #817Topic: No style sheet
in forum Installationbat755
MemberHi I’ve installed BBPress and I see no style sheet at all
My blog’s URL is http://phlog.it. BBpress is installed in a subdirectory called forum. I can’t see no style sheet. I’ve copied the stylesheet’s URL seen in the source code of the Forum’s homepage (http://phlog.it/forum/bb-templates/style.css) and it doesn’t work. How can I fix that?
October 27, 2006 at 8:51 pm #50675In reply to: User management, WP and BBP
Michael Adams (mdawaffe)
MemberIf
bb_really is your bbPress table prefix, and that is what is entered int the integration plugin page, users registering through bbPress should be given WordPress’ default role upon logging into WP for the first time.So I’m not sure what’s wrong exactly, but it may be caused by the stuff you’re doing manually (as you expect).
October 27, 2006 at 5:18 pm #50286In reply to: sports template
RedSkunk
MemberAww
October 27, 2006 at 2:49 pm #50463In reply to: Hard to warm me up for bbpress
zimpet
MemberHi ear1grey, jepp, you are right… Maybe I am too spoilt by all the coders work on wordpress. In fact, bbpress is a good point to start with, and the idea of having a forum and a blog coming right from “one-stop” is the right decision. So, don’t get me wrong! It is really a wish of mine to have it all “together” and tools get merged this way.
The only thing I want to highlight is, that – I’m not a coder from nature, but a tinckerer – it is not as easy as it sounds to set up the forum and integrate it into a running blog; first of all, if you are using wordpress for more than only as a “blogging-machine”. So, I will report
all bugs I find and – if it is possible for me, give advice how to fix it. In case I have the courage… as mentioned, I’m a tinckerer, not a coder.
October 27, 2006 at 2:37 pm #50085In reply to: Load Bbpress into WordPress
bonnyweb
MemberHi guys,
I’ve tryed to integrate bbpress in my wordpress blog, but I’ve some problems…I think in the configuration file.
I’ll post my config file for semplicity:
wp-config.php:
<?php
define(‘DB_NAME’, ‘blog_wp’);
define(‘DB_USER’, ‘root’);
define(‘DB_PASSWORD’, ‘root’);
define(‘DB_HOST’, ‘localhost’);
$table_prefix = ‘wp_’;
define (‘WPLANG’, ”);
define(‘ABSPATH’, dirname(__FILE__).’/’);
require_once(ABSPATH.’wp-settings.php’);
?>
bb-config.php:
<?php
define(‘BBDB_NAME’, ‘blog_wp’);
define(‘BBDB_USER’, ‘root’);
define(‘BBDB_PASSWORD’, ‘root’);
define(‘BBDB_HOST’, ‘localhost’);
$bb_table_prefix = ‘bb_’;
$bb->domain = ‘http://localhost/neoxyty’;
$bb->path = ‘/forum/’;
$bb->name = ‘Neoxyty forum’;
$bb->admin_email = ‘pippo@pluto.com’;
$bb->mod_rewrite = false;
$bb->page_topics = 30;
$bb->edit_lock = 60;
$bb->gmt_offset = 0;
$bb->akismet_key = false;
$bb->wp_table_prefix = false; // ‘wp_’;
$bb->wp_home = “http://localhost/neoxyty”;
$bb->wp_siteurl = “http://localhost/neoxyty”;
define(‘BBPATH’, dirname(__FILE__) . ‘/’ );
require_once( BBPATH . ‘bb-settings.php’ );
?>
The intallation of the wordpress is ok and it works, and also the installation of bbpress seams to be ok, but when I try to read a post or make some changes in the admin section it doesn’t work…
Some section are ok and other no…
Somebody can help me…please!
P.S. sorry if my english is not so good…
October 27, 2006 at 2:01 pm #50462In reply to: Hard to warm me up for bbpress
ear1grey
MemberHi Zimpet, “alpha”, “beta”, “0.72”; it really doesn’t matter what the label says; any code is only as good as the number of man hours that have been spent writing it, and then refining it.
The ratio of hours spent on WP versus BB is currently* around 100,000:1, so a certain lack of polish is likely.
* educated guess

bbPress has reached the point of maturity where it can have more people developing it, using it, and commenting on it; so this is the point where it’s development can accelerate whilst it’s core capabilities mature into something stable, so if you think you’ve identified problems, then thats a good thing, so be happy.
The best thing that you (and any of us) can do is to isolate and describe each problem (and each suggestion) so it can be entered into trac, prioritized and fixed.
-
AuthorSearch Results