Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 23,551 through 23,575 (of 32,570 total)
  • Author
    Search Results
  • #79229

    In reply to: Google Analytics

    InvTrdr
    Member

    So paste the same code from WP just above the </head> tag?

    Thanks.

    #79330
    Olaf Lederer
    Participant

    Limit page views for guests

    there is no plugin, but it’s easy to create (this is just an example not a full working snippet)

    If your visitors are from the same network you might have problems with this.

    session_start();
    $ipkey = $_SERVER['REMOTE_ADDR'];
    $_SESSION[$ipkey]++;
    if ($_SESSION[$ipkey] >= 10) {
    header("Location: /register.php");
    exit;
    }

    check also the function on my own forum.

    #31786
    Navin
    Member

    Is there a plugin or a way to code this? This was a feature that helped me increase the number of registered users back then when I was using SMF.

    How can this be achieved with bbPress?

    #79314
    InvTrdr
    Member

    Thanks. Below is the code for the menu item in the header. Just one. How do I add a couple more to it?

    Thank you.

    <div id=”access”>

    <div id=”menu”>

    </div>

    </div>

    #79228

    In reply to: Google Analytics

    @Ed

    That’s totally upto you!

    Use the same code which is in WP to track the whole site as one or a different code to track the forum separately.

    #31783
    Burkie
    Participant

    I’m currently adding content to my membership page, using the memberlist plugin. I have added a few extra details to the sign up page e.g. About, Skills etc… I had found the following line echo "<a>user_url."">".$member->user_url."</a>"; so modifying this to echo $member->about; It thought it should work but doesn’t, any ideas?

    #79227

    In reply to: Google Analytics

    mba-studium
    Member

    I think you can track this seperataly with two codes.

    #79252
    johnhiler
    Member

    Check out the comments on the plugin… it’s a bit tricky to configure since you have to make sure to create the upload directory about your webroot (for security reasons):

    # make a directory /bb-attachments/ ABOVE your webroot ie./home/username/bb-attachments/

    # chmod 777 the above /bb-attachments/ directory

    It’s definitely worth it though – the security help keeps your site safe. :-)

    #31778
    Mark
    Member

    v1.0.2

    Even though by technicality you are on your profile page, when I’m viewing my ‘manage favorites’ page (bb-templates/blah/favorites.php) I’m getting ‘profile-page’ returned by bb_get_location() instead of ‘favorites-page’ as I would expect. This also means bb_is_favorites() is of no use to me for this page. :(

    If that’s not the favorites page, what is?

    #79178

    I’ll check the config file to make sure the code is correct. I have no idea where all the spam tags came from. They’re pretty lame though. whoever it is, they are wasting tons of time!

    #79209

    In reply to: Mail me after post

    @Olaf: Your sidebar is going past the end of your main div :(

    #79238
    Olaf Lederer
    Participant

    Hi,

    I don’t think that there is a standard function for that, do you tried some custom code?

    since version 1.0 it’s possible to have custom functions in the template functions.php file. Just like in wordpress.

    #79205

    That code is probably fine, the version number is okay anyway but it’s slightly different to the one above.

    There’s an upload plugin for PostImage: https://bbpress.org/forums/topic/request-image-upload-with-free-image-hosting#post-56890

    That’s the only one I know of

    #79203
    InvTrdr
    Member

    That code above did not work for me chandersbs. The one below did. Is it safe to use the one below?

    <?php

    /*

    Plugin Name: Allow Images

    Plugin URI: https://bbpress.org/#

    Description: Allows <img /> tags to be posted in your forums. The image must be a png, gif or jpeg.

    Author: Michael D Adams

    Author URI: http://blogwaffe.com/

    Version: 0.7.1

    */

    // You can add more tags here

    function allow_images_allowed_tags( $tags ) {

    $tags = array(‘src’ => array(), ‘title’ => array(), ‘alt’ => array());

    return $tags;

    }

    function allow_images( $text ) {

    if ( preg_match_all(‘/<img(.+?)src=(“|’)(.+?)\2(.*?)>/i’, $text, $matches, PREG_SET_ORDER ) ){

    foreach( $matches as $match ){

    if (preg_match(‘/src=/i’, $match[4]) /* multiple src = someone’s trying to cheat */ || !in_array(substr($match[3], -4), array(‘.png’, ‘.jpg’, ‘.gif’)) /*only match .jpg, .gif, .png*/ && ‘.jpeg’ != substr($match[3], -5) /*and .jpeg*/){

    $text = str_replace($match[0], ”, $text);

    }

    }

    }

    return $text;

    }

    add_filter( ‘pre_post’, ‘allow_images’, 52 );

    add_filter( ‘bb_allowed_tags’, ‘allow_images_allowed_tags’ );

    ?>

    #79202
    InvTrdr
    Member

    Thanks. Will the above code posted by chandersbs work in 1.0?

    Thanks.

    #79221

    That’s in a core file… what have you managed to do in your CSS to make it not go underneath? D:

    Short-term fix:

    Put this in your theme’s functions.php

    <?php
    function add_topic_br_special() { ?>
    <br />
    <?php }
    add_action( 'pre_post_form', 'add_topic_br_special');
    ?>

    #79236

    In reply to: Link to Home Page.

    It depends on your theme design.

    In mine, I have four main divs: header, content, sidebar and footer

    So on my footer.php, at the top, I put in this: <?php require('/home/domain/www/forums/my-templates/themename/sidebar.php'); ?> and then built the sidebar as I wanted it.

    #79226

    In reply to: Google Analytics

    So it works similar to WP but just that you cannot do it through Editor in WP, rather do it directly in the files on the server, correct?

    Correct. There’s no theme editor built in to BB at this time, so you have to edit the template file.

    And you can use the same GA code from WP to BB without changing anything, but as it’s a different page, you have to edit the bbPress and WordPress templates separately.

    #79225

    In reply to: Google Analytics

    InvTrdr
    Member

    So it works similar to WP but just that you cannot do it through Editor in WP, rather do it directly in the files on the server, correct? If I have GA code on my site already, will it help as the forum is just an extension of the domain? Or not, as it is a different page altogether?

    Thanks.

    #79235

    In reply to: Link to Home Page.

    InvTrdr
    Member

    Thanks. Where exactly in the header.php do I add it and what is the code to add to it?

    Thanks.

    #79224

    In reply to: Google Analytics

    chrishajer
    Participant

    Just paste the Analytics code in your template’s footer.php.

    #31763

    Topic: Google Analytics

    in forum Installation
    InvTrdr
    Member

    Is it possible to add Google Analytics code to a bbPress forum? Did not see Editor under Appearance.

    Thank you.

    #79087
    kirpiit
    Member

    Thanks Kawauso, it does the trick!

    The Case Is Closed :-)

    [Well, not so closed, actually, as long as the basic Kakumei suffers from this (although tiny) css bug. Maybe this should be noticed to the guys who maintain the theme.]

    #79199
    Navin
    Member

    Copy and paste this code and save it as allow-images.php

    <?php

    /*

    Plugin Name: Allow Images

    Plugin URI: https://bbpress.org/#

    Description: Allows <img /> tags to be posted in your forums. The image must be a png, gif or jpeg.

    Author: Michael D Adams

    Author URI: http://blogwaffe.com/

    Version: 0.7.1

    */

    // You can add more tags here

    function allow_images_allowed_tags( $tags ) {

    $tags = array(‘src’ => array(), ‘title’ => array(), ‘alt’ => array());

    return $tags;

    }

    function allow_images_encode_bad( $text ) {

    $text = wp_specialchars( $text );

    $text = preg_replace(‘|
    |’, ‘
    ‘, $text);

    foreach ( bb_allowed_tags() as $tag => $args ) {

    if ( ‘br’ == $tag )

    continue;

    if ( $args )

    $text = preg_replace(“|<(/?$tag.*?)>|”, ‘<$1>’, $text);

    else

    $text = preg_replace(“|<(/?$tag)>|”, ‘<$1>’, $text);

    }

    $text = preg_replace(“|(.*?)|se”, “‘' . encodeit('$1') . '‘”, $text);

    return $text;

    }

    function allow_images( $text ) {

    if ( preg_match_all(‘/<img(.+?)src=(“|’)(.+?)\2(.+?)>/i’, $text, $matches, PREG_SET_ORDER ) )

    foreach( $matches as $match )

    if (

    preg_match(‘/src=/i’, $match[4]) // multiple src = someone’s trying to cheat

    ||

    !in_array(substr($match[3], -4), array(‘.png’, ‘.jpg’, ‘.gif’)) // only match .jpg, .gif, .png

    &&

    ‘.jpeg’ != substr($match[3], -5) // and .jpeg

    )

    $text = str_replace($match[0], ”, $text);

    return $text;

    }

    remove_filter( ‘pre_post’, ‘encode_bad’ );

    add_filter( ‘pre_post’, ‘allow_images_encode_bad’, 9 );

    add_filter( ‘pre_post’, ‘allow_images’, 52 );

    add_filter( ‘bb_allowed_tags’, ‘allow_images_allowed_tags’ );

    ?>

    Upload it to your my-plugins folder, create if it doesn’t exist. And activate it.

    #79137
    InvTrdr
    Member

    The error message was “DB Error: cannot find”. Figured out that for some reason the database name filled in during step1 was not caught by the bbpress-config.php file as you can see in the code above. The BBDB_NAME has been left “bbpress” as in default. Changed it in the file and it worked. Now onto Step2.

    Thanks.

Viewing 25 results - 23,551 through 23,575 (of 32,570 total)
Skip to toolbar