s1r0n (@s1r0n)

Forum Replies Created

Viewing 25 replies - 1 through 25 (of 26 total)
  • In reply to: Need Help Reinstalling

    s1r0n
    Participant

    @s1r0n

    can anybody help with this I wonder.

    In reply to: Need Help Reinstalling

    s1r0n
    Participant

    @s1r0n

    oh it did remove data. but then when I added a new forum, and new post, the same problem exists. i.e. the forums show up, but there’s no listing of hte available topic

    In reply to: Need Help Reinstalling

    s1r0n
    Participant

    @s1r0n

    tried that. still not working.

    In reply to: Need Help Reinstalling

    s1r0n
    Participant

    @s1r0n

    you can see the problem here

    General Discussion

    there are two test posts in the forum. It says “This forum contains 2 topics” but the topics are not properly listed

    In reply to: Need Help Reinstalling

    s1r0n
    Participant

    @s1r0n

    tried that


    s1r0n
    Participant

    @s1r0n

    Thx

    In reply to: Dynamic Profile Link

    s1r0n
    Participant

    @s1r0n

    ah yes. I see. thx

    In reply to: Dynamic Profile Link

    s1r0n
    Participant

    @s1r0n

    So, another question, does somebody know how to generate the nice layout of the above menu?

    How bout positioning? The default position is at the very top. How does bbpress get it to render underneath the header?

    In reply to: Dynamic Profile Link

    s1r0n
    Participant

    @s1r0n

    Right thanks!

    In reply to: Post submission hooks

    s1r0n
    Participant

    @s1r0n

    Ah you’ll have to do that again. the code above has a line commented out that shouldn’t be. sorry for the hassle

    add_action('bbp_theme_after_topic_form_content','lp_add_honeypot');
    add_action('bbp_theme_after_reply_form_content','lp_add_honeypot');
    function lp_add_honeypot() {
    
        if (is_user_logged_in())
            return;
        ?>
    <p>
        <label for="lp_post_honey_pot">I am a robot (yes/no)</label><br />
        <input type="text" value="" tabindex="103" size="40" name="lp_post_honey_pot" id="lp_post_honey_pot"  />
    </p>
    <?php     
    }
    
    //https://core.trac.wordpress.org/browser/tags/4.1.1/src/wp-includes/post.php#L0
    add_filter('wp_insert_post_empty_content', 'lp_check_honeypot', 10, 2);
    function lp_check_honeypot($is_empty, $postarr) {
        
         if (is_user_logged_in())
            return false;
        
    
        if ($postarr['post_type'] == 'topic' || $postarr['post_type'] == 'reply') {//only do this for bbspress
            if ($postarr['bbp_post_as_submitted']['POST_lp_post_honey_pot'] == 'no') {
                return false; //treat this post as good
            }
    
            return true;
        }
        return false;
    }

    I only need this to work for users who are not logged in, guests, so i’ve added a couple of lines to turn this off when users are logged in. if you want to test even registered users just leave those lines in.

    When I have a bit of time I’ll look into bbpress errors and find a way to set an appropriate error message.

    Have fun and let us know if you use it and it works for you or not

    In reply to: Post submission hooks

    s1r0n
    Participant

    @s1r0n

    it will work now

    In reply to: Post submission hooks

    s1r0n
    Participant

    @s1r0n

    oops. had a mistake in code. this one works better

    
    add_action('bbp_theme_after_topic_form_content','lp_add_honeypot');
    add_action('bbp_theme_after_reply_form_content','lp_add_honeypot');
    function lp_add_honeypot() {
    
        if (is_user_logged_in())
            return;
        ?>
    <p>
        <label for="lp_post_honey_pot">I am a robot (yes/no)</label><br />
        <input type="text" value="" tabindex="103" size="40" name="lp_post_honey_pot" id="lp_post_honey_pot"  />
    </p>
    <?php     
    }
    
    //https://core.trac.wordpress.org/browser/tags/4.1.1/src/wp-includes/post.php#L0
    //add_filter('wp_insert_post_empty_content', 'lp_check_honeypot', 10, 2);
    function lp_check_honeypot($is_empty, $postarr) {
        
    //   print_r($postarr);exit;
        if ($postarr['post_type'] == 'topic' || $postarr['post_type'] == 'reply') {//only do this for bbspress
            if ($postarr['bbp_post_as_submitted']['POST_lp_post_honey_pot'] == 'no') {
                return false; //treat this post as good
            }
    
            return true;
        }
        return false;
    }
    In reply to: Post submission hooks

    s1r0n
    Participant

    @s1r0n

    Ya ok i got something figured out. its very basic but you can easily add to this. here’s the code

    This basically ads a field call ‘lp_post_honey_post’ with the question “I am a robot”. if the user answers anything other than ‘no’ the post craps out with an error. currently the error message is that the post parameters are wrong, but maybe if somebody can tell me how to set the bbpress error message I can fix that.

    You can see the filter in action here

    http://www.thelightningpath.com/forums/room/lobby/pre-registration/

    There are a few tweaks you could make to this. if you have a plugin like piklist you can easily have a settings page where you could set both the question and the answer. And of course you can change the question in the hard code.

    I choose the wp_insert_post_empty_content filter because it fires early on in the wp_update_post routine, saving some CPU cycles.

    If somebody wants to help me set this up as a wordpress plugin we could make this a plugin pretty easily. I’m guessing there would be a lot of interest in this.
    incorrect code removed ! - correct version below

    In reply to: Post submission hooks

    s1r0n
    Participant

    @s1r0n

    ok i will share.

    In reply to: Post submission hooks

    s1r0n
    Participant

    @s1r0n

    ok that’s a start. where can I find the hooks to deal with the post content just before it gets posted into the database. so somebody hits the submit button and I can intercept that submission with what action/filter.

    I tried searching the bbs code, but faster if somebody can just say

    In reply to: bbpress post hook

    s1r0n
    Participant

    @s1r0n

    oh, i think I figured it out. now I can setup BBS press to send gajillions of unsolicited emails, mwa ha ha ha ha ha ha ha ha. How will you ever sleep at night anymore?

    signed

    Dr. Spambot.

    just kidding of course. just scarring the kiddies.

    In reply to: bbpress post hook

    s1r0n
    Participant

    @s1r0n

    i really don’t need a lesson in spam. What I need is the hook so that I can send to users who opt in to an announcements board email when an announcement was posted. I’m not going to tell you why I need this, or what I am doing with it, because frankly it is none of your business. You’re just going to give me the hook, or not. If not then I will bitch an complain about the lack of documentation for BBSPRESS, and the terrible support you get from the plugin folks, who can’t answer a simple question without making all sorts of presumptions and assumptions, and go waste a whole bunch of time that I could be spending with my kids, and find it myself.

    m


    s1r0n
    Participant

    @s1r0n

    thx. i was hoping for tha filter or action but I can look in the plugin code for the answer.

    have a great day!


    s1r0n
    Participant

    @s1r0n

    no, i mean the default loaded for people who don’t have a gravatar. the one that is assigned by bbpress. I know how to change my gravatar


    s1r0n
    Participant

    @s1r0n

    i don’t know why this one was so hard for the support people to answer, but the hook I was looking for was

    add_filter( 'bbp_get_reply_content', 'lp_access_enforcement', 99,2);

    this allows me to take the content just before it is posted on the screen and manipulate it how I want. now my forums here

    http://thelightningpath.com/forum/subject/the-need-for-spirit-to-sustain-a-growing-baby/

    can be locked down. people now need to pay for a subscription to get access to certain forums on my site.

    i’m posting this for anybody else that might want to expand on bbpress’s limited access functionality.


    s1r0n
    Participant

    @s1r0n

    Stephen, while I got your attention.

    is there a hook to get access to bbpress posts as they are submitted into the database, similiar to wordpress hooks like wp_insert_post_data, where I can get access to the post body and alter it?


    s1r0n
    Participant

    @s1r0n

    that worked like a charm. thanks!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!


    s1r0n
    Participant

    @s1r0n

    Hi, sorry about being so obtuse.

    I’m using woocommerce groups. it stores its stuff in several non-standard wordpress tables. I need to be able to replace the bbpress roles as displayed in the forum iteration with the group the user is assigned to. I want to be able to do that without hacking the core, for obvious reasons.

    does this help.

    m

    In reply to: accessing post display

    s1r0n
    Participant

    @s1r0n

    hello, echo, echo, echo


    s1r0n
    Participant

    @s1r0n

    HI Stephen, thanks for the reply. this is not what I want to do though. I don’t want the role names to appear in the profile, I want my “group” names to appear. Since these groups are not mapped to role names, I can’t map them using these functions you provide. I need something that hooks right into the output. maybe this requires me to hardmodify the template?

Viewing 25 replies - 1 through 25 (of 26 total)