Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 30,626 through 30,650 (of 32,522 total)
  • Author
    Search Results
  • #56295

    In reply to: config.php

    chrishajer
    Participant

    The error “Warning: Cannot modify header information – headers already sent by” is generally caused by white space before the <?php or after the ?> in a file you edited. Check for that and I think you will find your problem.

    Thanks Sam for submitting that patch :)

    #50826

    In reply to: Avatars

    cweb
    Member

    It works for me, just had to change your variable name $usermail because it’s supposed to be $email – so the code looks like this:

    function get_avatar() {

    global $bbdb;

    $id = get_post_author_id();

    $user = bb_get_user( $id );

    $email = $user->user_email;

    $default = "http://eastcoastwahines.com/images/gravatar.gif"; // Put your default avatar link

    $size = 40;

    $grav_url = "http://www.gravatar.com/avatar.php?gravatar_id=".md5($email)."&default=".urlencode($default)."&size=".$size;

    echo "<img src="$grav_url" alt="Gravatar" width="$size" height="$size" />";

    }

    #56086
    wittmania
    Member

    Sorry, but I wanted to bump this to the front to see if anyone could help me out.

    Where is it in the post/edit routine that BBP converts line breaks to <br> tags and double-line breaks to <p> tags. If someone could point me in the right direction, I’m sure I could just add that routine to the private message post/edit plugin so it would work the same way as normal posts do.

    Thanks in advance for any help you can give.

    #56176

    In reply to: Quote Plugin Weirdness

    AphelionZ
    Participant

    Sorry, citizenkeith… we still havent solved the problem :(

    #52210
    thegunman
    Member

    Excellent it works many thanks to you and great template. :)

    —-edit


    Take a look at a minute it apears as though the search button is in the wrong place, and it shows like that in IE and FireFox.

    #56175

    In reply to: Quote Plugin Weirdness

    citizenkeith
    Participant

    You guys are way over my head. :D

    #56173

    In reply to: Quote Plugin Weirdness

    fel64
    Member

    Not sure what black magic you just haxed up there (MySQL I am fairly clueless about), I just did this:

    $quoted = bb_get_user( $row->poster_id );

    My full modifications are:

    function bb_quote_message() {
    global $bbdb, $topic;
    $post_id = (int)$_GET['quote'];
    if ($post_id) {
    $row = $bbdb->get_row("SELECT * FROM $bbdb->posts WHERE post_id={$post_id} AND topic_id={$topic->topic_id} AND post_status=0");
    $//row->post_text = preg_replace( '(|
    )', '', $row->post_text );
    $row->post_text = preg_replace( '/<blockquote>.*</blockquote>/', '', $row->post_text );
    $row->post_text = str_replace( '', '', $row->post_text );
    $row->post_text = str_replace( '
    ', '', $row->post_text );
    $quoted = bb_get_user( $row->poster_id );
    $quotesince = bb_since( $row->post_time );
    $quotesince = ' - ' . $quotesince . ' ago ';
    $quotelink = get_post_link( $row->post_id );
    $quotelink = '<a href="' . $quotelink . '">&nbsp;&raquo;&nbsp;</a>';
    if ($row) echo htmlentities('<blockquote><cite>'.$quoted->user_login . $quotesince . $quotelink . "</cite>n".$row->post_text.'</blockquote>', ENT_COMPAT, 'UTF-8');
    }
    }

    function fel_addcitetag( $tags )
    { $tags['cite'] = array();
    return( $tags ); }

    add_filter( 'bb_allowed_tags', 'fel_addcitetag' );

    You can see my regex attempt to get rid of blockquotes, although for some reason despite it being marked as code the b-quote tags were still removed.

    I also switched from regexing the paragraph tags tostr_replaceing them, which is apparently much faster. Again, though, they’re filtered out.

    #52807

    In reply to: Plugin: Summon user

    AphelionZ
    Participant

    I added some pizazz to this plugin – If you have the Simple Online list and Posts Since Last Visit Plugin you can run the query on the bb_online table and populate the summon list with only users that have actually logged in. I trimmed about 80 users out of the select list with this, and it still works:

    function summon_get_users() {
    global $bbdb;
    // maybe cached in future versions.
    $users = $bbdb->get_results("SELECT * FROM <code>bb_online</code> INNER JOIN wp_users ON bb_online.user_id = wp_users.ID WHERE 1 ORDER BY <code>wp_users</code>.<code>user_login</code> ASC LIMIT 0 , 30");

    return $users;
    }

    #56172

    In reply to: Quote Plugin Weirdness

    AphelionZ
    Participant

    Regex’s are a mystery to me, but I did end up doing something pretty cool with it – I added an INNER JOIN to the sql to grab the username of the quoted..

    function bb_quote_message() {
    global $bbdb, $topic;
    $post_id = (int)$_GET['quote'];
    if ($post_id) {
    $row = $bbdb->get_row("SELECT * FROM $bbdb->posts INNER JOIN wp_users ON bb_posts.poster_id = wp_users.ID WHERE bb_posts.post_id={$post_id} AND bb_posts.topic_id={$topic->topic_id} AND bb_posts.post_status=0");
    $row->post_text = preg_replace( '(<p>|</p>)', '', $row->post_text );
    if ($row) echo htmlentities('<blockquote>"'.trim($row->post_text).'"<br /><strong>- '.$row->user_login.'</strong></blockquote>', ENT_COMPAT, 'UTF-8');
    }
    }

    #56171

    In reply to: Quote Plugin Weirdness

    fel64
    Member

    Keith: Yeah, it can. Easily. By WP handling it I really meant being smart enough to leave it alone. :P

    Aphelionz, you’re right. I feel stupid for such an oversight to the nesting problem. >_< However, my perl regexes aren’t particularly good and it’s not working (nor is it returning an error).

    $row->post_text = preg_replace( '/<blockquote>.*</blockquote>/', '', $row->post_text );

    If anyone knows how to fix that that’d be great.

    #56324
    fel64
    Member

    Speaking of which, it doesn’t add a topic-slug either, which is required to have permalinks set to slug. I tried adding the topic_slug field and a variable to make it update, but when I did that it didn’t work at all :( Can someone else have a look at this too?

    #55892
    fel64
    Member

    I also added a snippet of code to append a link to the last post.

    Find the end of the function page_links_add_links and replace this

    return $title;
    }

    with this

    $felgtlpl = get_topic_last_post_link($topic->topic_id);
    $title = $title . ' <a href="' . $felgtlpl . '">&nbsp;&raquo;&nbsp;</a>';

    return $title;
    }

    #56169

    In reply to: Quote Plugin Weirdness

    citizenkeith
    Participant

    Bah, this is bb (and WP) trying to be clever. It’s annoying; they both mess with your code too much. Although at least WP can handle nested blockquotes.

    Could nested blockquotes be handled by CSS? Does bbPress need to “handle” nested blockquotes in a special way?

    #55693

    In reply to: Plugin: Latest Replies

    LMD
    Participant

    I’m not that surpised it didn’t work. Here is a different fix, editing the ‘bbPress Post’ plugin itself. I’m using line numbers to reference the code. I’ve based the line numbers on an UNEDITED version of the ‘bbpress_post.php’ file. So, if you open up a fresh version of the file that hasn’t been touched (i.e. do not use the version you previously added my ‘fix’ to – you no longer need that fix).

    Try these code changes:

    Line # 457 – replace with:

    bbpress_bb_new_post($topic_id, $content, $forum, $author, $now, $title);

    Line #533 – replace with:

    $wpdb->query("UPDATE ". $bb_table_prefix ."posts SET post_text='$content', post_title='$title' WHERE post_id=$bbpost_id LIMIT 1;");

    Line #540 – replace with:

    $otherdb->query("UPDATE ". $bb_table_prefix ."posts SET post_text='$content', post_title='$title' WHERE post_id=$bbpost_id LIMIT 1;");

    Line #585 – replace with:

    function bbpress_bb_new_post( $topic_id, $content, $forum, $author, $now, $title ) { // making new post in bbPress

    Line #587 – replace with:

    $wpdb->query("INSERT INTO ". $bb_table_prefix ."posts VALUES ('', $forum, $topic_id, $author, '$content', '$now', '127.0.0.1', 0, 1, $title);");

    Line #591 – replace with:

    $otherdb->query("INSERT INTO ". $bb_table_prefix ."posts VALUES ('', $forum, $topic_id, $author, '$content', '$now', '127.0.0.1', 0, 1, $title);");

    Note: this is assumes two things:

    1. That in the bbPress ‘posts’ table the ‘post_title’ field was added as the last field.

    2. That you do not have any other plugins that have added fields to the bbPress database.

    Let me know how you get on this time.

    #56313

    In reply to: Moving a post

    boomanfloral
    Member

    Yes… I would also like this feature a lot :) -Thanks!

    #56280
    boomanfloral
    Member

    Thanks! What I did is ovewrite some of the php files that I modified and that solved the problem :) Then I uploaded some plugins that did not require to modify those files.

    #56283

    In reply to: config.php

    chrishajer
    Participant

    Sorry, I do not. WordPress is like this too with no provision AFAIK for a non-standard port.

    But, I was looking at bb-includes/db.php just now and the mysql_connect function is being used. That function can user dbservername.com:port by default according to this page: http://www.php.net/function.mysql-connect

    So, in theory, this should work:

    define('BBDB_HOST', 'blabla.bla.pl:3305');

    Did you try that and it does not work?

    #53816
    Atsutane
    Member

    Sorry my bad :) Forgot to update the readme file.

    #56278
    boomanfloral
    Member

    Ok. I deleted all the plugins and then when I try to post I don’t get the error… but a blank page :-/ Any ideas?

    #49578

    ok chrishajer I post now my code

    .HTACCES:


    <ifmodule mod_rewrite.c>

    RewriteEngine On

    RewriteBase /forum/

    RewriteRule ^forum/([0-9]+)/page/([0-9]+)$ /forum/forum.php?id=$1&page=$2 [L,QSA]

    RewriteRule ^forum/([0-9]+)$ /forum/forum.php?id=$1 [L,QSA]

    RewriteRule ^topic/([0-9]+)/page/([0-9]+)$ /forum/topic.php?id=$1&page=$2 [L,QSA]

    RewriteRule ^topic/([0-9]+)$ /forum/topic.php?id=$1 [L,QSA]

    RewriteRule ^tags/(.+)/page/([0-9]+)$ /forum/tags.php?tag=$1&page=$2 [L,QSA]

    RewriteRule ^tags/(.+)/?$ /forum/tags.php?tag=$1 [L,QSA]

    RewriteRule ^tags/?$ /forum/tags.php [L,QSA]

    RewriteRule ^profile/([0-9]+)/page/([0-9]+)$ /forum/profile.php?id=$1&page=$2 [L,QSA]

    RewriteRule ^profile/([0-9]+)/([a-z]+)$ /forum/profile.php?id=$1&tab=$2 [L,QSA]

    RewriteRule ^profile/([0-9]+)/([a-z]+)/page/([0-9]+)$ /forum/profile.php?id=$1&tab=$2&page=$3 [L,QSA]

    RewriteRule ^profile/([0-9]+)$ /forum/profile.php?id=$1 [L,QSA]

    RewriteRule ^view/([a-z-]+)/page/([0-9]+)$ /forum/view.php?view=$1&page=$2 [L,QSA]

    RewriteRule ^view/([a-z-]+)$ /forum/view.php?view=$1 [L,QSA]

    RewriteRule ^rss/$ /forum/rss.php [L,QSA]

    RewriteRule ^rss/forum/([0-9]+)$ /forum/rss.php?forum=$1 [L,QSA]

    RewriteRule ^rss/topic/([0-9]+)$ /forum/rss.php?topic=$1 [L,QSA]

    RewriteRule ^rss/tags/([a-z]+)$ /forum/rss.php?tag=$1 [L,QSA]

    RewriteRule ^rss/profile/([0-9]+)$ /forum/rss.php?profile=$1 [L,QSA]

    </ifmodule>


    CONFIG.PHP:

    <?php

    define(‘BBDB_NAME’, ‘Sql*****_4’);

    define(‘BBDB_USER’, ‘Sql*****’);

    define(‘BBDB_PASSWORD’, ‘********’);

    define(‘BBDB_HOST’, ‘62.149.***.**’);

    $bb_table_prefix = ‘bb_’;

    $bb->domain = ‘http://www.motiongraphics.it&#8217;;

    $bb->path = ‘/forum/’;

    $bb->name = ‘Motiongraphics Forum’;

    $bb->admin_email = ‘info@motiongraphics.it’;

    $bb->mod_rewrite = true;

    $bb->page_topics = 30;

    $bb->edit_lock = 60;

    $bb->gmt_offset = +2;

    define(‘BBLANG’, ”);

    $bb->akismet_key = ‘*********3c’;

    $bb->wp_table_prefix = ‘wp_’;

    $bb->wp_home = ‘http://motiongraphics.it&#8217;;

    $bb->wp_siteurl = ‘http://motiongraphics.it&#8217;;

    if ( !defined(‘BBPATH’) )

    define(‘BBPATH’, dirname(__FILE__) . ‘/’ );

    require_once( BBPATH . ‘bb-settings.php’ );

    ?>

    Many Thanks!

    Null
    Member

    Well title says it al, can’t seem to find them in the db :D

    #56275
    boomanfloral
    Member

    In my plugin directory I have the following

    allow-images.php

    bb-avatar.php

    comment_QT_4_bbpress.php

    fix-bbpress.php

    js_quicktags.js

    Where else should I look for something wrong? I don’t know php or all that stuff. I know basic HTML and how to modify css but I’m not a programmer or anything like that… I’m only a plant grower (horticulturist) :-)

    HELP!

    #53815
    drcmanx
    Member

    doh, thx i was thinking it was going to be added into the plugin (like Akismet) and not the options tab.

    and the part you didn’t know was me thinking that it might be interfering with my other forum topic reader for another board.

    Thx for the plugin support!

    add an updated install readme ;)

    #56281

    In reply to: config.php

    chrishajer
    Participant

    Looking through the source for https://trac.bbpress.org/browser/trunk/bb-includes/db-mysqli.php I don’t see the provision for setting a port number (someone correct me if it is actually accounted for somewhere else.)

    MySQL normally operates on port 3306, not 1337, so I don’t know if you are making up that port or if your host actually runs MySQL on that port. If he does run MySQL on that port, then I don’t know what to do.

    If it’s actually port 3306, everything will work fine if you set this in config.php:

    define('BBDB_HOST', 'blabla.bla.pl'); with no http and no colon and no port.

    HTH

    #56262
    chrishajer
    Participant

    In bb-includes/capabilities.php I changed line 27 (I am using 1.0 Alpha) to the following:

    #26  return array(   'keymaster' => array(
    #27 'name' => __('Admin'),

    You could change “Admin” there to Scott or Chris.

    I have been doing this since .75 with no ill effect. I hated the “Keymaster” name under admin.

Viewing 25 results - 30,626 through 30,650 (of 32,522 total)
Skip to toolbar