_ck_ (@_ck_)

Forum Replies Created

Viewing 11 replies - 2,176 through 2,186 (of 2,186 total)
  • In reply to: Plugin: Avatar Upload

    _ck_
    Participant

    @_ck_

    I found visitors were getting really hassled by the filename restrictions so I decided to relax them while still keeping some safety since you already check mime types & file extensions

    instead of:

    !eregi("^([-a-z0-9_]+).([a-z]+)$", $img_name)

    I reduced it to only exclude the four bad characters I can think of:

    eregi("#|?|&|%", $img_name)

    What do you think? Safe enough?

    Is your mime check from the physical file itself or just the sent headers? Hopefully the physical file or it’s not secure enough.

    My change allows people to click browse and enter a url into their file browser, which forces Windows to pull down the file first, then upload it to the site. Not sure what other OS’s will do. Windows adds [1] to the filename in the temp area, so your name filter was blocking it from uploading.

    My next ideas are to give lazy people a section of default avatars to choose from instead, and to allow members several stored avatars to chose from (your table should allow multiple entries per member I think, though the code to deal with it will have to be changed of course).


    _ck_
    Participant

    @_ck_

    Yay! I figured out how to hack it to make it happen.

    To leave the core files alone, I did it through a plugin.

    The balancetags in bbpress takes less parameters than from WP.

    function force_balance_tags($text) { return balanceTags($text, true);}

    add_filter('pre_post', 'force_balance_tags');

    Tested working.

    Another nice addition in there would be to add nofollow to any post links.

    add_filter('pre_post', 'bb_rel_nofollow');


    _ck_
    Participant

    @_ck_

    AHA!

    I found a bug. Finally I can contribute.

    WordPress does indeed auto-close tags and has a fantastic routine, the balancetags I mentioned above.

    HOWEVER

    it was copied raw into BBpress and it won’t work by default because it’s looking for an option that will never be set because BBpress doesn’t have it

    function balanceTags($text, $is_comment = 0, $force = false) {

    if ( !$force && get_option(‘use_balanceTags’) == 0 )

    return $text;

    See what I mean? There’s no manually way to set use_balanceTags in BBpress.

    So how do we force the filter on? I know it has to be balanceTags ($text,1,1) to work.


    _ck_
    Participant

    @_ck_

    Actually I may be wrong about this.

    I dug through the default filters and I see this:

    add_filter(‘pre_post’, ‘balanceTags’);

    Does balancetags == auto-close tags?

    Looking at the function it would seem to be so.

    Perhaps I have a plugin conflict or does this behaviour exist on even on a default install?

    added: I just tested here and yup, it doesn’t auto-close


    _ck_
    Participant

    @_ck_

    I’ve now learned that this is from posts being moderation.

    It may be a badly behaving plugin.


    _ck_
    Participant

    @_ck_

    Ah I’ve now learned this is from the moderation plugin which apparently is moderating ALL posts even though it’s set not to :(


    _ck_
    Participant

    @_ck_

    after studying this for awhile I guess I need someone to explain to me why BBpress hides posts and needs a view=all for view all posts? Can view all be on by default?


    _ck_
    Participant

    @_ck_

    Okay by dropping the $bb->page_topics to 5 I can now suddenly see pagination become active.

    But why does it show “+2 more” when page_topics was set to 30 and not show the pagination?

    In reply to: BB Moderation Hold

    _ck_
    Participant

    @_ck_

    Is it possible to make this plugin use the existing wordpress moderated word list? (and optionally the link count limit moderation setting)

    In reply to: Emoticons For bbPress?

    _ck_
    Participant

    @_ck_

    I’ve now made a smilie plugin here:

    https://bbpress.org/plugins/topic/bb-smilies

    By the way, WordPress’s default smilie detection code and therefore the code converted here in the earlier post are very flawed when it comes to whitespace issues.

    I created a patch awhile back that made it work 99% of the time regardless of spaces before, after or at the end/beginning of a sentence.

    add this function:

    function prepSmilies($string) {return "/(s|^)".quotemeta(trim($string))."(s|$)/";}

    then add this near the start of function convert_smilies:

    $prep_search = array_map('prepSmilies', $wp_smiliessearch);

    then change the $contenst=str_replace line near the end of function covert_smilies:

    $content = preg_replace($prep_search, $wp_smiliesreplace, $content);

    Now if only it was this easy to tweak wp/bb’s search function to be so much more intelligent.


    _ck_
    Participant

    @_ck_

    Aha!

    I thought the hash value was unique for each user.

    Apparently it’s unique for each blog.

    so

    $bb->usercookie = ‘wordpressuser_full.hash.number”;

    $bb->passcookie = ‘wordpresspass_full.hash.number”;

    Did the trick in config.php

    Since WP 2.1+ uses the hash number, probably should update the instructions around the site. Thanks again!

Viewing 11 replies - 2,176 through 2,186 (of 2,186 total)