Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 32,326 through 32,350 (of 32,499 total)
  • Author
    Search Results
  • #828

    Topic: Img tag plugin

    in forum Plugins
    AphelionZ
    Participant

    Somebody should take the work done here and make it into a plugin, preferably one that will allow the use of img tags between code tags.

    You will be a hero.

    #50746

    In reply to: img tags

    AphelionZ
    Participant

    but 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.

    #50745

    In reply to: img tags

    in 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!

    #50742

    In reply to: img tags

    yeah, 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.

    #50741

    In reply to: img tags

    AphelionZ
    Participant

    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;

    }

    ..should work, but doesn’t.

    Ok, how bbPress does it is that it takes every < and > and replaces them with the &lt; and &gt; 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…

    #826
    #50739

    In reply to: img tags

    AphelionZ
    Participant

    Added 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?

    #50738

    In reply to: img tags

    what 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;

    #50500

    In reply to: post count – 1

    Shawn Maddock
    Participant

    Whoops, 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!

    #50736

    In reply to: img tags

    nevermind, 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. :)

    #49808

    In reply to: FAQ

    HOW 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?

    #50734

    In reply to: img tags

    AphelionZ
    Participant

    I 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);

    ?>

    #50732

    In reply to: img tags

    This 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?

    #50705

    In reply to: freshness = -1 years

    Ok, 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.

    #50712

    In reply to: bbPress 0.73 released

    AphelionZ
    Participant

    Now you guys just need to make a wiki, and a gallery!!! :-D

    #50465
    peiqinglong
    Member

    It 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.

    #50718
    Nola1974
    Participant

    Took 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)

    #50499

    In reply to: post count – 1

    Nola1974
    Participant

    I 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.

    <?php

    function 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);

    ?>

    #821

    Howdy,

    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.

    #817

    Topic: No style sheet

    in forum Installation
    bat755
    Member

    Hi 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?

    #50675

    If 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).

    #50286

    In reply to: sports template

    RedSkunk
    Member

    Aww ;-)

    #50463
    zimpet
    Member

    Hi 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.

    #50085
    bonnyweb
    Member

    Hi 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&#8217;;

    $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&#8221;;

    $bb->wp_siteurl = “http://localhost/neoxyty&#8221;;

    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… :-)

    #50462
    ear1grey
    Member

    Hi 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.

Viewing 25 results - 32,326 through 32,350 (of 32,499 total)
Skip to toolbar