Search Results for 'code'
-
AuthorSearch Results
-
March 31, 2007 at 5:09 pm #56348
In reply to: Fatal error on my theme
tegolino
Memberit doesn’t work
March 31, 2007 at 4:41 pm #55894In reply to: Plugin: Page links for bbPress
fel64
MemberThanks for this Sam, looking at it I also made a plugin using the Simple Onlinelist which will highlight any new posts made since the last time someone logged in.
Waiting to have it approved as a plugin so I can upload.
March 31, 2007 at 4:32 pm #56325fel64
MemberYou will have to make changes to some core files to make this work properly, as they are in different subdomains.
Find your bbPress
config.php
file and add these lines://try to sync cookies
$bb->cookiedomain = '.mpm.org.au';
$bb->cookiepath = '/';Now go to your wordpress folder, open
wp-settings.php
.#line 190
FROM
define('COOKIE_DOMAIN', false);
TO
define('COOKIE_DOMAIN', '.mpm.org.au');
Make sure that you make note of this change to
wp-settings.php
. Every time you upgrade wordpress this change will be overriden and you will have to make this change again.March 31, 2007 at 3:18 pm #56345In reply to: Fatal error on my theme
tegolino
Memberops sorry for the swiching! I’m doing a tests!
I have my-templates folder, but I want the same theme of my blog http://www.motiongraphics.it . When I switch to MW theme the error is
Fatal error: Call to undefined function: get_settings() in /web/htdocs/www.motiongraphics.it/home/forum/
my-templates/mw1.1/themetoolkit.php on line 331
(((
March 31, 2007 at 3:12 pm #56343In reply to: Fatal error on my theme
chrishajer
ParticipantI just created a login at http://www.motiongraphics.it/forum/ and everything worked fine. I was able to do login and create a topic just fine.
The really weird thing is that the forum initially looked like a standard bbPress install (kakumei or whatever that theme is called) then, after I created a topic, it switched over to what looks like this bbpress.org forum theme. It was so disorienting, I thought I posted on bbpress by mistake!
So, unless you were messing with the templates, something weird is going on. However, I did not see the error you mentioned, I just had the weirdness with the differing templates.
Sorry for my Italian
thegunman
MemberYou say this is bbpress code but after searching through every file I couldn’t find any reference to avatar in any of the code. Where exactly is this block of code placed?
March 31, 2007 at 10:32 am #56297In reply to: config.php
archasek
MemberWarning: Cannot modify header information - headers already sent by (output started at /home/kmr/ftp/forum/config.php:1) in /home/kmr/ftp/forum/bb-includes/pluggable.php on line 166
when i login. i don’t have print_r funciton.
edit:
ok, everything seem to be working ok. thank ya !
March 31, 2007 at 4:23 am #56296In reply to: config.php
Sam Bauers
ParticipantI accidentally left a print_r() command in the first upload of the patch. Check line 64 of db-mysli.php, if it has
print_r($server);
on it, just remove that line completely.print_r() forces output, which may explain the errors. Sorry about that.
March 30, 2007 at 11:39 pm #52212In reply to: Template of this forum??
Trent Adams
MemberI am sure they both are not the same as this forum! I just copied across the stylesheets and then moved a few things around. If I get a chance I might take a closer look at it this weekend, but I was really getting something of a basic template for others to use, not quite 100% perfection as I did it in about 20 minutes…..
Trent
March 30, 2007 at 11:12 pm #56087In reply to: Convert breaks into paragraphs?
fel64
MemberAt a wild guess from memory it’ll be in
/bb-includes/formatingfunctions.php
March 30, 2007 at 10:53 pm #56295In reply to: config.php
chrishajer
ParticipantThe 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
cweb
MemberIt 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" />";
}
March 30, 2007 at 9:29 pm #56086In reply to: Convert breaks into paragraphs?
wittmania
MemberSorry, 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.
March 30, 2007 at 8:56 pm #56176In reply to: Quote Plugin Weirdness
AphelionZ
ParticipantSorry, citizenkeith… we still havent solved the problem
March 30, 2007 at 8:37 pm #52210In reply to: Template of this forum??
thegunman
MemberExcellent 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.
March 30, 2007 at 8:33 pm #56175In reply to: Quote Plugin Weirdness
citizenkeith
ParticipantYou guys are way over my head.
March 30, 2007 at 7:08 pm #56173In reply to: Quote Plugin Weirdness
fel64
MemberNot 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 . '"> » </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 to
str_replace
ing them, which is apparently much faster. Again, though, they’re filtered out.March 30, 2007 at 7:04 pm #52807In reply to: Plugin: Summon user
AphelionZ
ParticipantI 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;
}March 30, 2007 at 6:30 pm #56172In reply to: Quote Plugin Weirdness
AphelionZ
ParticipantRegex’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');
}
}March 30, 2007 at 6:06 pm #56171In reply to: Quote Plugin Weirdness
fel64
MemberKeith: Yeah, it can. Easily. By WP handling it I really meant being smart enough to leave it alone.
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.
March 30, 2007 at 5:50 pm #56324In reply to: export wordpress posts into bbpress forum?
fel64
MemberSpeaking 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?
March 30, 2007 at 5:45 pm #55892In reply to: Plugin: Page links for bbPress
fel64
MemberI 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 thisreturn $title;
}with this
$felgtlpl = get_topic_last_post_link($topic->topic_id);
$title = $title . ' <a href="' . $felgtlpl . '"> » </a>';
return $title;
}March 30, 2007 at 4:12 pm #56169In reply to: Quote Plugin Weirdness
citizenkeith
ParticipantBah, 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?
March 30, 2007 at 3:45 pm #55693In reply to: Plugin: Latest Replies
LMD
ParticipantI’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.
March 30, 2007 at 2:06 pm #56313In reply to: Moving a post
boomanfloral
MemberYes… I would also like this feature a lot
-Thanks!
-
AuthorSearch Results