Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 28,126 through 28,150 (of 32,481 total)
  • Author
    Search Results
  • #63258
    _ck_
    Participant

    Wow I can’t believe bbPress doesn’t do that.

    I’ve whipped up a function to do it, should be in the plugin browser soon or try this:

    <?php
    /*
    Plugin Name: New User Notification Email
    */
    add_action('bb_new_user', 'new_user_notification');

    function new_user_notification($user_id=0) {
    if (!$user_id) {$user_id=bb_get_current_user_info( 'id' );}
    $user=bb_get_user($user_id);

    $message = sprintf(__('New user registration on %s:'), bb_get_option('name')) . "rnrn";
    $message .= sprintf(__('Username: %s'), stripslashes($user->user_login)) . "rnrn";
    $message .= sprintf(__('E-mail: %s'), stripslashes($user->user_email)) . "rnrn";

    $message .= sprintf(__('Agent: %s'), substr(stripslashes($_SERVER["HTTP_USER_AGENT"]),0,80)) . "rnrn";
    $message .= sprintf(__('IP: %s'), $_SERVER['REMOTE_ADDR']) . "rnrn";

    $message .= sprintf(__('Profile: %s'), get_user_profile_link($user_id)) . "rnrn";

    @bb_mail(bb_get_option('admin_email') , sprintf(__('[%s] New User Registration'), bb_get_option('name')), $message, '' );
    }
    ?>

    #63270
    Sam Bauers
    Participant

    That plugin is old and won’t work with 0.8.4 (and maybe not with 0.8.3.1)

    Once 0.8.4 is released this should work as a plugin for both WordPress and bbPress:

    <?php
    /*
    Plugin Name: Lax user names
    Plugin URI:
    Description: Makes all user name sanitisation non-strict
    Author: Sam Bauers
    Version: 0.0.1
    Author URI: http://unlettered.org/
    */

    function i18n_sanitize_user($username, $raw_username = false, $strict = false) {
    if ($strict) {
    return sanitize_user($raw_username);
    } else {
    return $username;
    }
    }

    add_filter('sanitize_user', 'i18n_sanitize_user');
    ?>

    #63238

    In reply to: Integration questions

    harryworld
    Member

    zappoman,

    Thanks for your sharing. I am exactly looking for the features. Could I help somehow to make this work? (Even I’m quite new to bbPress :P)

    You may send me an email at harryworld(at)gmail(dot)com

    #56773

    In reply to: Plugin: Avatar Upload

    thierryyyyyyy
    Participant

    Thank you a lot.

    You are right : I updated badly my files, I forgot to uptdate the root directory “avatar-upload.php”.

    Now, it works far better :)

    if I could allow myself to a small advice : it would be far better if the installation where just “put 1 directory in the my-plugins directory”.

    anyway, the readme.txt was clear enougth, it my fault.

    and the plugin is very nice.

    #63318

    In reply to: Pages aren’t working

    chrishajer
    Participant

    Sounds like the rewrite rules are not working. Start by disabling permalinks in your config.php like this:

    $bb->mod_rewrite = false;

    If that change allows things to work, then you know it’s a problem with permalinks on your host.

    #63265

    In reply to: PHP Error

    chrishajer
    Participant

    OK – I still don’t see those actual line numbers in that release (in fact bb_settings.php has only 209 lines.) So, can you open up /home/www/web316/html/ps-t/bb-settings.php and post line 294 (maybe a couple before and after as well) and /home/www/web316/html/ps-t/bb-includes/pluggable.php and post lines 193 and 231. The code on those lines will help point the way to solving these problems.

    My hunch is this is related to the glob issue and there being no underscore plugins in a bb-plugins directory. Because there are no plugins that begin with an underscore, and due to problems with the way the glob function is tested for, an error like this can occur.

    You can try installing this plugin to see if it fixes your error, even though the line numbers and messages really don’t match up:

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

    I think you can also just create a bb-plugins directory in your installation root, then in it create a file called something like _nothing.php – I think that also causes this block of code to NOT fail, so you wouldn’t see these warnings.

    #63310
    chrishajer
    Participant

    Put it here:

    /home/"mywordpressblogsname"/public_html/bbpress/

    Then in config.php set bb->uri:

    $bb->uri = 'http://"mywordpressblogsname"/bbpress/';

    (assuming your blog is visible at http://”mywordpressblogsname”/ not http://”mywordpressblogsname”/public_html)

    You can name the bbpress folder whatever you want. Sometimes people call it forums. Just be sure to change it to the same thing in config.php.

    #63263

    In reply to: PHP Error

    chrishajer
    Participant

    Was that a trunk release or the 0.8.3.1 release?

    Also, can you look at those two files in your installation and post the code from those lines here? Maybe we can find the source of the problem even without matching up the errors in a current download by using your actual installation.

    #2962
    Göran
    Member

    My name is Göran but when I test bbPress and use my name as username I am called Gran and when I try to use Göran to get around the problem I get Goumlran as my name. How can I solve this? I want users to be able to use their real names including all Swedish letters.

    #56768

    In reply to: Plugin: Avatar Upload

    chrishajer
    Participant

    Is it possible the extension was in all caps? I think the plugin expects to see one of a specific list of extensions, and they’re all lower case.

    'file_extns' => array("gif", "jpg", "jpeg", "png")

    If it wasn’t one of those extensions, I think you would get an error.

    #2956
    lucaiz
    Member

    hello,

    I’m working on a two column template.

    in the front-page.php it’s possible to have the forum list in a table.

    I’d like to have this list also in other pages, that is, for instance, in the forum.php or in the topic.php.

    if I try to run this list in other pages than front-page.php I obtain this error:

    Warning: Invalid argument supplied for foreach() in [my template path]forum.php on line 23

    (the line number is not relevant because I modified the code).

    it seem that the variable $Forums in this foreach is not loaded with the needed data.

    foreach ( $forums as $forum ) { ...

    I’ve tried to find out where it is that is loaded, so that I can load it also in forum.php etc., but I was not able to find out.

    someone can tell me where it is that is loaded, and other suggestion on how to have the list of forums in all pages?

    thanks.

    #63013
    zappoman
    Member

    by the way, an even better way to implement this is to use the args of bb_forums() properly… namely if you change your theme to call bb_forums(“depth=1”) you will only get 1 level of forums on the page.

    This change can be made to the front-page or forum of your theme. If your theme calls bb_forums($forum_id) then it is asking for the child forums of the existing forum and you need to change the code to something like this… bb_forums(“depth=1&child_of=$forum_id”)

    #63237

    In reply to: Integration questions

    triipriit
    Member

    That’d be great!

    I’ll be waiting :)

    my e-mail is triipriit at gmail dot com, just in case

    #63234

    In reply to: Integration questions

    zappoman
    Member

    In the interest of sharing what I’ve learned so far, let me describe what I want to do, and what I’ve accomplished so far.

    1) I want to have a stand alone instance of bbPress running on my site that shows ALL the forums.

    2) I want to embed a single forum into a wordpress blog (actually a wordpressmu blog– but there’s nothing mu specific about my work so far)

    3) I want the forums to share the same DB, so if a topic is updated inside of my blog, I also see it updated in the standalone Forum.

    4) I want to be able to essentially allow the bbPress template functions to work inside of a wp page or post… ideally I’d like to implement a simple function like “embedd_bbpress_forum()” on a page template and have it display a fully functioning bbPress instance in the page.

    5) I want to use the chrome/theme from wordpress for the header, sidebar, footer, etc… but I also want to support the basic bbpress template structure as well.

    So far I have this working about 90%…

    What I’ve done is build a WP-plugin, that “includes” bbpress/bb-load.php. And implements a couple functions for embedding the bbpress instance in a page or post or where ever you call the embed functions.

    Things that are working:

    * forum home page

    * topic pages

    * new topic

    * comments

    * profile pages

    * favorites

    Things that aren’t working yet:

    * ajax — none of the ajax stuff is working properly yet…

    * some pages that use wp_redirect – because of how I’m embedding in wordpress, the headers are already sent before I have a chance to do the redirect, so… some functions that rely on this are reporting errors.

    How I did this so far:

    * declare GOBALS!!! – This is the biggest “sneaky trick” – basically, most of bbPress is implemented outside of a function or class context, and so the “local” variables on the bbPress pages are actually global in context. Since I’m wrapping these into a wp-pluing, I need to declare them as explicitly global. If I get all the globals right, then bbPress just works.

    * turn off mod_rewrite support in bbPress… since I want my pages to get handled by WordPress, the URL needs to end at the same location of the wordpress page, this means that my forum page has a url something like:

    http://mydomain.com/blog/forumpage/?command=topic.php&id=1

    Notice I introduced the concept of the “command” parameter, that my plugin then uses as a dispatcher to “load” (include) the right bbPress file. MOSTLY bbPress will do the rest of it’s work from the URL params.

    * Lots of filters – I’ve implemented several filters for URL remapping so that bbPress will override the standard link formation to point to my new embedded page urls

    * A COUPLE HACKS – the only hard part I’ve had to hack so far relates to bbPress’s get_bb_location() function. This function appears to be a bit of bbPresses standard “dispatcher” which tells the rest of bbPress what type of page it’s supposed to be rendering. The only problem with this approach is that in my instance of the code base it does all this logic based on PHP_SELF, SCRIPT_FILENAME, or SCRIPT_NAME… which will be pointing to my wordpress files. I made a small change to add a new filter that allows me to pull out my command param and do the bb_location determination from that.

    Has anyone else attempted this? Have they gotten further? Is there an easier way?

    Mostly this isn’t a lot of code, it’s just discovering how to make it work and testing that everything works as planned.

    #2954
    triipriit
    Member

    Hi!

    I’ve been searching through this forum like a maniac and my bad – I didn’t find any answers for my questions.

    I somehow managed to “integrate” my bbpress with WP (the part of users, cookies), BUT:

    1) How can I wrap the forum inside my WP blog (like in wordpress.com) ?

    2)…. well, the first one actually was the big one :)

    #63204
    Sam Bauers
    Participant

    I meant “guys” in it’s androgynous sense of course. :)

    #63208

    In reply to: Line Break

    Onion
    Member

    I ran into the problem when using imagevenue, a popular image host.

    It breaks the rows by using <BR>

    For me, it’d work fine since I have the plugin to let me post anything, but for users, it outputs the link break code and threats the <BR> as a tag that isn’t allowed.

    I’ll play around with the changes. And the stuff you suggest. I have it working well enough for now, just not “exactly” what I wanted.

    Thanks for the advice _ck_

    Love your plugins btw, great job on them.

    #62457
    _ck_
    Participant

    You’d probably want to try running stand-alone but integrated instead of running both of them at the same time. Loading both at the same time causes nothing but problems and slow downs from all the extra code.

    #63118
    _ck_
    Participant

    you want get_topic_id() for the current topic id

    or get_post_id() for the current post id

    #63174
    _ck_
    Participant

    Integration is better than running under wordpress.

    This allows your wordpress side to be down while the forum still works and via versa.

    Once backpress and talkpress is available I suspect however there will be much more shared code and essentially they will start to merge together in many ways.

    ps. the forum plugin for wordpress supposedly has or had security issues if I remember correctly…

    #62345
    _ck_
    Participant

    You’re asking about gravtars but then talking about uploading avatars which are two different features.

    There are plugins for bbPress to show a user’s gravatar but if it’s a locally uploaded avatar within WordPress, someone would have to come up with some code to display it on the bbPress side. So it’s possible but would take someone to look at it.

    The avatar upload plugin on the bbpress side has some documentation or user comments on how to access the avatar from wordpress.

    #63187
    _ck_
    Participant

    Well you’re asking two different things but the answer to both is yes with some code changes to your templates.

    You can get the last poster for any topic in the list via this:

    <?php echo '<a href="'.get_topic_last_post_link().'">'.get_topic_last_poster().'</a>'; ?>

    but there is also a plugin that I believe will change the last poster’s name into a link too. So either way.

    You might be able to paginate the lastest discussions by putting this at the bottom of latest discussions outside the loop:

    <?php forum_pages(); ?>

    However it’s a 50/50 chance it won’t work.

    Or you can use the “My Views” plugin which will give you a paginated Latest Discussion view that you can link to.

    example:

    http://bbshowcase.org/forums/view/latest-discussions

    plugin:

    https://bbpress.org/plugins/topic/my-views/

    #63228
    _ck_
    Participant

    If the background goes yellow that probably means it flagged you as a “bozo” which is a feature that has never worked quite right in bbpress.

    You can disable the “bozo” feature completely by editing bb-settings.php and commenting out the line:

    // require( BBPATH . BBINC . 'bozo.php');

    around line 110 or so

    #63207

    In reply to: Line Break

    _ck_
    Participant

    I think I better understand what you are asking about after running into a similar problem today on my bbcode lite plugin. I filed a trac ticket:

    https://trac.bbpress.org/ticket/795

    bbPress seems to encode non-ending tags into html entities if you save a post twice. Not good.

    #63206

    In reply to: Line Break

    _ck_
    Participant

    Doesn’t your code zap all BRs?

    This is not quite what you are trying to do, but maybe you can add BR to this list and see if bbpress will bypass the self-closing requirement.

    function bb_allow_extra_tags( $tags ) {
    $tags['del'] = array();
    $tags['strike'] = array();
    $tags['s'] = array();
    $tags['b'] = array();
    $tags['i'] = array();
    $tags['u'] = array();
    $tags['bq'] = array();
    $tags['blockquote'] = array();
    $tags['pre'] = array();
    $tags['hr'] = array();
    $tags['br'] = array(); // see if this allows non-closed br
    $tags['BR'] = array(); // see if this allows uppercase BR
    return $tags;
    }
    add_filter( 'bb_allowed_tags', 'bb_allow_extra_tags' );

    As far as uppercase/lowercase that would be tricker if it’s hard coded in the code. You’d have to filter the post text ahead of time, find all tags and convert them to lowercase. Or try adding $tags['BR'] = array(); to the above list and see if that makes a difference.

    Personally I’d just add the bbcode plugin if you’ve got people trying to make fancier posts. It’s far more common across all forums.

Viewing 25 results - 28,126 through 28,150 (of 32,481 total)
Skip to toolbar