Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 23,476 through 23,500 (of 32,468 total)
  • Author
    Search Results
  • #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
    chandersbs
    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.

    #79173
    chrishajer
    Participant

    I just checked out 1.0.2 via svn and I see backpress is included as an external:

    Fetching external item into 'bb-includes/backpress/pomo'
    A bb-includes/backpress/pomo/mo.php
    A bb-includes/backpress/pomo/sample
    A bb-includes/backpress/pomo/sample/app.php
    A bb-includes/backpress/pomo/sample/languages
    A bb-includes/backpress/pomo/sample/languages/app.pot
    A bb-includes/backpress/pomo/sample/languages/bg.mo
    A bb-includes/backpress/pomo/sample/languages/app-side.pot
    A bb-includes/backpress/pomo/sample/languages/bg-side.mo
    A bb-includes/backpress/pomo/sample/languages/bg.po
    A bb-includes/backpress/pomo/sample/languages/bg-side.po
    A bb-includes/backpress/pomo/po.php
    A bb-includes/backpress/pomo/streams.php
    A bb-includes/backpress/pomo/entry.php
    A bb-includes/backpress/pomo/translations.php
    Checked out external at revision 191.

    It’s actually included in the packaged download here too:

    https://bbpress.org/latest.zip

    https://bbpress.org/latest.tar.gz

    I don’t think using trac to grab the source is the same as actually downloading the package. Maybe that was the problem?

    #79188
    Mark
    Member

    It does. ;)

    <?php printf(__('%1$s'), bb_get_profile_link(bb_get_current_user_info( 'name' )));?>

    #79165
    62gr
    Member

    I paste this code

    into my-profile-fields.php file

    into my-plugins

    but its not working !!

    this code :

    <?php

    /*

    Plugin Name: My Profile Fields

    Description: My profile fields for my lovely forums

    Version 1.0

    */

    function my_profile_fields( $fields ) {

    /* This removes the Occupation profile field: */

    unset( $fields );

    /* This adds a new optional field called Favourite Band: */

    $fields = array(0,’Favourite Band’);

    /* This adds a new *required* field called State: */

    $fields = array(1,’State’);

    /* You must return the array at the end of the function: */

    return $fields;

    }

    add_filter( ‘get_profile_info_keys’, ‘my_profile_fields’ );

    ?>

    morgan-wick
    Member

    I’m trying to install a new bbPress forum at http://forums.morganwick.com. The “wrapper” div is set in style.css (the only file I’ve changed) to have position:static. It appears to be absolutely positioned, and I don’t see anything in either style.css or in the code that appears when I “view source” that would overrule style.css (the only places in style.css where anything is absolutely positioned either have “display” set to “none” or don’t appear on all pages) unless I have to go hunting through JavaScript. Having to deal with absolutely positioned elements is a pain for an amateur developer like me, and I’d much rather have elements appear as part of the normal flow, like I can do in WordPress; what’s the problem here?

    UPDATE: I just removed the background image from “wrapper” and added it to “header”, but it doesn’t show up at all. I’m trying to make it look as much like http://www.morganwick.com as possible.

    #74583
    chandersbs
    Member

    I’m sure it has to do with if and else things but how to code it :(

    #79164
    johnhiler
    Member

    Did you paste the code into a my-profile-fields.php file, and move it into your my-plugins directory… then activate the plugin?

    #79163
    62gr
    Member

    sorry but Its not working

    Is there another way ?

    For example, put in the code style.css ?

    #79154
    snails07
    Member

    @batrachoid are you using IE 6 or IE 7 because I just checked the site in IE 7 and the login form and registration info were almost completely hidden.

    I’ve fixed the problem now, although it still doesn’t look quite right in IE 7, but at least it can be seen and people can register now :)

    #79151
    Mark
    Member

    @batrachoid,

    ? It’s right above the login form. ;)

    Looks good, the only thing I noticed you might want to address is that when you’re not logged in and viewing a post page, the “You must log in to post” appears floated to the right and a little above the “New Topic In This Forum” header.

    #77304
    Mark
    Member

    Honestly can’t say I’m a fan of the green, and I’m not too sure what the red, green and white dots are for either?

    I don’t want to be the only person with issues, but I’m sure you guys are capable of handling criticism. ;) Outside of those two things, I think it’s looking pretty darn snazzy. Can’t wait to see it go live!

    #50304
    Mark
    Member

    It’s a microwave dinner world… I hate registering on sites that have a mile long page full of demographic information that is an absolute invasion of privacy – I usually move on when I come across those. But when registration consists of username+email+submit… if it ain’t microwaveable, it ain’t worth the effort, I guess. ;)

    #75802
    Mark
    Member

    @gerikg,

    Thanks for the link, I downloaded that plugin to give it a go… but apparently it isn’t yet compatible with 1.0.2 as it won’t activate. Just keeps returning a failed notice. :(

    #79170
    chrishajer
    Participant

    That very simple error means that the file is not there, or maybe it’s there but has wrong permissions.

    Is this file present:

    '/XXXXX/StealthEmployed/forum/bb-includes/backpress/class.bp-log.php

    If not, FTP the files up there again maybe one was missed. I don’t think it has anything to do with WordPress because it’s bb-settings.php complaining about a missing bbPress file.

    #79105

    In reply to: Events plugin needed

    bbP’s database is essentially the same as WP’s ;) that’s how I can actually work out how to manipulate it most of the time. Basic functionality is the same, just different variables so you can get the table name for forums, etc. Give writing it a shot though, it’s not hard.

    #79161
    crguy
    Member

    Fixed it.

    I logged into phpMyAdmin

    Default Database Setting on My Server:

    MySQL connection collation: utf8_unicode_ci

    I changed it to utf8_general_ci and deleted the bb_ tables in the database and removed the bb-config.php file and went through installation again.

    All appears to be good now.

    #79103

    In reply to: Events plugin needed

    I’d do this but I simply haven’t got the time. It’d be easy enough to store meta data if you added an action hook for ‘bb-post.php’ that got all the event-related form data from the post form and WP’s database handling makes storing it a breeze, so that wouldn’t be too hard. Throw in a ‘bb_head’ action hook to pull up data for a given topic (do a is_topic() check and check the forum ID, that’s floating around in a global variable iirc, probably $forum), load it into global variables and then let those be added in by the template. Main issue for me would be the testing and actually having to support something after I write it for once ;)

    #79097

    Easiest way would be to add <?php $post_forum = bb_get_forum( $bb_post->forum_id ); echo $post_forum->forum_name; ?> inside your theme’s rss2.php, after it says <?php foreach ($posts as $bb_post) : ?>, possibly inside the <title> part.

    i.e.

    <title><?php post_author(); ?> <?php _e('on')?> "<?php topic_title( $bb_post->topic_id ); ?>" <?php _e('in')?> "<?php $post_forum = bb_get_forum( $bb_post->forum_id ); echo $post_forum->forum_name; ?>"</title>

    #79134
    Olaf Lederer
    Participant

    strange is that without these replacements the posted code / content is formatted as well.

    the make sense of you have all posted html elements without any whitespace.

    Back to the reason why I started this topic, it’s not an important one right? :)

Viewing 25 results - 23,476 through 23,500 (of 32,468 total)
Skip to toolbar