Search Results for 'code'
-
AuthorSearch Results
-
February 5, 2010 at 8:03 pm #84695
In reply to: Call wordpress functions in bbpress
chrishajer
ParticipantIf you’re getting a blank screen, it’s likely a 500 Internal Server Error. If you have access to logs you will be able to resolve this.
Where did you put that code? It should start at the 2nd line of bb-config.php, right after the opening
<?php. If not, use a syntax highlighting editor to see what’s going on with the bb-config.php file.February 5, 2010 at 5:36 pm #33050Topic: Call wordpress functions in bbpress
in forum Installationroamfox
MemberI have search the forum and find there is a slolution like this
put following code in to bb-config.php
Code:require_once(‘path/wp/wp-blog-header.php’);that I can call wordpress functions in bbpress template
but once I add the line to bb-config.php . The homepage of the forum became a blank page. no html , no error hints, just a blank page
I am sure the path to wp-blog-header.php is correct . I do not know what happend and how to fix .
The wordpress version is 2.91 and the bbpress is 1.02 .
Thank you for your help
February 5, 2010 at 1:35 pm #84683In reply to: bbPress Signatures (0.2.0) installation?
citizenkeith
ParticipantPerhaps that’s implicitly done by activating the plugin itself?
That’s correct. You should be good to go.
February 5, 2010 at 3:29 am #84648In reply to: Notify all forum users of new topic
kevinjohngallagher
MemberHi Neotoxic,
No i’m afraid you’ll have to figure out your own SQL script for the users. My code isn’t tested or anything, i’m afraid you’ll have to write teh custom code for your own specific solution yourself. the code i’ve posted above just does 95% of the work for you
February 5, 2010 at 2:48 am #82904In reply to: How to integrate with WP? Instructions not clear.
LeftCoastMichael
MemberIt’s done. We’re good.
February 4, 2010 at 8:34 pm #84495In reply to: Email to members
kevinjohngallagher
Member4 topics below your topic is your answer mate

https://bbpress.org/forums/topic/notify-all-forum-users-of-new-topic
February 4, 2010 at 6:16 pm #84530In reply to: Blocked user login (back link)
kvener
MemberHere is a solution I found…
There is probably a better solution, but this fixes the going back to front page for blocked users…
Add this code to bb-includes/functions.bb-core.php line 1183
// If user blocked logout user and clear auth_cookie
if ( $id = bb_get_current_user_info( ‘id’ ) ) {
if( bb_get_usermeta( $id, ‘been_blocked’ ) === “1”) {
bb_logout();
bb_clear_auth_cookie();
}
}
February 4, 2010 at 5:46 pm #84635chrishajer
ParticipantCan you get the phpinfo for your installation and see if there IS a tmp folder?
Put this into a file called whatever.php, then access it with your browser at http://www.example.com/bbpress/whatever.php
<?php
phpinfo();
?>I think you’re looking for a value called
upload_tmp_dirIf it’s not there someone will need to look at the plugin and see what’s actually needed.
Please post a link to the plugin you’re using too.
February 4, 2010 at 5:44 pm #84647In reply to: Notify all forum users of new topic
neotoxic
Memberkevinjohngallagher – Thank you very much for your help. I understand you caution completely, however given the nature of my community I am sure that this will be appreciated.
Can you confirm that the following will only select users who are bbpress members and above, and not all users in my WordPress users table.
$bbdb->users WHERE user_status=0"February 4, 2010 at 5:42 pm #82701In reply to: bbBlog 2.0 (plugin)
chrishajer
ParticipantYou will always have the code you have right now, which is standalone. The old version will always be available. (I know nothing is forever, but if you want a copy of the standalone version, grab it now to ensure you have it.) It might not keep up with developments, but you’d at least have a version to use. Barring any security problems, I don’t see why you couldn’t just keep using that.
February 4, 2010 at 5:08 pm #84646In reply to: Notify all forum users of new topic
kevinjohngallagher
MemberDepending on how many members you are talking about, or how many time you expect a new post to be on the forum, i would definitely be sceptical of something like this. It’s a massive hark back to the old ways of doing things.
So my suggestions:
1) When you make a new post, physically email everyone.
I’m not sure when e-mail became incredibly difficult to do manually.
2) If you really want to write a plugin it should go something like:
function notification_new_post($post_id=0) {
global $bbdb, $bb_table_prefix, $topic_id, $bb_current_user;
$all_users = $bbdb->get_results("SELECT ID, user_email FROM $bbdb->users WHERE user_status=0");
foreach ($all_users as $userdata)
{
$message = __("There is a new post on: %1$s nReply by: %2$s nText: %3$s nn%4$s ");
mail( $userdata->user_email, bb_get_option('name') . ': ' . __('Notification'),
sprintf( $message, get_topic_title($topic_id), get_user_name($bb_current_user->ID), strip_tags(get_post_text($post_id)), get_topic_link($topic_id) ),
'From: '.bb_get_option('name').' <'.bb_get_option('from_email').'>'
);
} //foreach
}
add_action('bb_new_post', 'notification_new_post');You may need to edit some of that code, but found that by searing for email notification on this website (props to Thomas Klaiber who’s code i quickly edited). Amazing what searching first does

Again Neotoxic, i strongly suggest against this unless you know for sure that everyone’s going to be ok with getting an email everytime. RSS readers on email clients, phones, browsers etc save so much hassle…
Take Care
February 4, 2010 at 3:21 pm #33010Topic: BBPress Auto Login
in forum Installationphpbroker1982
MemberI need to implement the Auto Login to BBPress. I have the steps of Auto Login to WordPress and here are the steps:
require_once (‘blog/wp-blog-header.php’);
$user_login = ‘screen_name’;
$user = get_userdatabylogin($user_login);
$user_id = $user->ID;
wp_set_current_user($user_id, $user_login);
wp_set_auth_cookie($user_id);
do_action(‘wp_login’, $user_login);
Could you please help me to change this code for BBPress Login?
Thank You.
February 4, 2010 at 1:31 pm #84628In reply to: BBPM Translation
kevinjohngallagher
MemberStep 1: open google.com
Step 2: type in ‘bbpress process translation file “.pot” ‘
Step 3: click on the first link.
Step 4: do what it says
Step 5: ???
Step 6: Profit

And Jongeren Forum, with all due respect, we answer your questions, and you don’t seem happy. We’re not going to do it all for you, this isn’t our job

Maybe next time follow the advice given and also say THANK YOU to people like Olaf that reply, whether you think it’s “not usefull for me” or not. Manners cost nothing
February 4, 2010 at 1:24 pm #61353In reply to: get favorites list
kevinjohngallagher
MemberThe entire website?
So it’s going in an infinte loop?
Please, be less specific, don’t post any code, oooh and don’t include a screenshot. Guessing is a really worth while use of my time
February 4, 2010 at 1:02 pm #61352In reply to: get favorites list
56alifar
BlockedLike i said, i got the entire website loading serveral times in my sidebar where i put the code.
February 4, 2010 at 9:50 am #61351In reply to: get favorites list
kevinjohngallagher
MemberWhat error do you get mate?
February 4, 2010 at 9:47 am #84188In reply to: Thanks plugin
bingsterloot
Member@ Paulhawke
I rest my case
) works perfectly now. Thanks a lot for your fast updates.
February 4, 2010 at 7:55 am #61350In reply to: get favorites list
56alifar
BlockedNope didn’t work, i got the entire website loading serveral times in my sidebar where i put the following code:
<?php$topics = get_user_favorites( $user->ID, true );
$favorites_total = isset($user->favorites) ? count(explode(',', $user->favorites)) : 0;
bb_load_template( 'favorites.php', array('favorites_total') );
?>
February 4, 2010 at 5:58 am #77325In reply to: Sneak peek at bbPress.org 2.0
Michael
Participant@Shagalaga – That has already been mentioned in this post.
@Sam – Nice to see you’re still checking bbPress updates.
February 4, 2010 at 12:12 am #61349In reply to: get favorites list
chrishajer
ParticipantWas that snippet of code wrapped in
<?php tags ?>?<?php
$topics = get_user_favorites( $user->ID, true );
$favorites_total = isset($user->favorites) ? count(explode(',', $user->favorites)) : 0;
bb_load_template( 'favorites.php', array('favorites_total') );
?>February 3, 2010 at 6:02 pm #61347In reply to: get favorites list
56alifar
BlockedSorry, a bit of a PHP Noob, if I insert the following code in my template:
$topics = get_user_favorites( $user->ID, true );
$favorites_total = isset($user->favorites) ? count(explode(‘,’, $user->favorites)) : 0;
bb_load_template( ‘favorites.php’, array(‘favorites_total’) );
I get an error
February 3, 2010 at 5:41 pm #61346In reply to: get favorites list
kevinjohngallagher
MemberTwo ways:
1) It’s an array, so just cycle through it and output the bits you want, this will allow you to style it as you please. If you’re unsure of what it returns use: print_r($topics);
2) Alternatively, you could just copy all 3 lines from the Favourites.php file:
$topics = get_user_favorites( $user->ID, true );
$favorites_total = isset($user->favorites) ? count(explode(‘,’, $user->favorites)) : 0;
bb_load_template( ‘favorites.php’, array(‘favorites_total’) );
This will output the favourites in the way you’ve described in your template folder.
==========================================
At the end of the day, BBpress has a number of issues, but if it can already do something, all you really need to do is copy and paste the code
February 3, 2010 at 4:33 pm #61344In reply to: get favorites list
kevinjohngallagher
MemberLooking in “favourites.php”, right in the root of BBpress (so its not hidden), i found this:
$topics = get_user_favorites( $user->ID, true );
I’d use that and output the array, but then again, i’d not have bumped 2 different 2 year old threads, let alone doing it before looking in the file cunningly named Favourites.php
February 3, 2010 at 11:21 am #84185In reply to: Thanks plugin
bingsterloot
MemberHi Paulhawke
Thanks a bundle, it works like a charm
). I have only one thing left which is very minor.Would it be possible to use Ajax when you have voted, so the vote appears right away, instead of having to reload the page before it appears?
Bingster
February 3, 2010 at 4:46 am #84591In reply to: BBPM Problem
paulhawke
MemberI installed the plugin, deleted the table … then walked through rebuilding the database from what I saw in the code. The following SQL is an export of my bb_bbpm table direct from mySQL. If you run it, you should get PMs back up and running.
CREATE TABLE IF NOT EXISTS bb_bbpm (
ID bigint(20) unsigned NOT NULL auto_increment,
pm_title varchar(100) collate utf8_unicode_ci NOT NULL,
pm_read tinyint(1) NOT NULL default 0,
pm_from bigint(20) unsigned NOT NULL,
pm_to bigint(20) unsigned NOT NULL,
pm_text text collate utf8_unicode_ci NOT NULL,
sent_on int(10) NOT NULL,
del_sender tinyint(1) NOT NULL default 0,
del_reciever tinyint(1) NOT NULL default 0,
reply_to bigint(20) unsigned default NULL,
thread_depth int(10) unsigned NOT NULL default 0,
pm_thread bigint(20) unsigned NOT NULL,
PRIMARY KEY (ID),
KEY pm_to (pm_to,pm_from,reply_to),
KEY pm_thread (pm_thread)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ;
-
AuthorSearch Results