Search Results for 'code'
-
AuthorSearch Results
-
October 23, 2006 at 10:56 am #50259
In reply to: Users dont receive password after registration
Pravin ParateyParticipantFinally got it to work. Patch:
Index: bb-includes/registration-functions.php
===================================================================
--- bb-includes/registration-functions.php (revision 502)
+++ bb-includes/registration-functions.php (working copy)
@@ -35,9 +35,9 @@
return array($user_id, $password);
} else {
bb_update_usermeta( $user_id, $bb_table_prefix . 'capabilities', array('member' => true) );
- bb_send_pass( $user_id, $password );
+ #bb_send_pass( $user_id, $password );
do_action('bb_new_user', $user_id);
- return $user_id;
+ return array($user_id, $password);
}
}
Index: bb-templates/register-success.php
===================================================================
— bb-templates/register-success.php (revision 502)
+++ bb-templates/register-success.php (working copy)
@@ -4,6 +4,6 @@
<h2 id="register"><?php _e('Great!'); ?></h2>
-<p><?php printf(__('Your registration as <strong>%s</strong> was successful. Within a few minutes you should receive an email with your password.'), $user_login) ?></p>
+<p><?php printf(__('Your registration was successful.<br /><br />Username: <b>%s</b><br />Password: <b>%s</b>'), $user_login, $user_password) ?></p>
<?php bb_get_footer(); ?>
Index: register.php
===================================================================
— register.php (revision 502)
+++ register.php (working copy)
@@ -28,7 +28,9 @@
$user_safe = false;
if ( $user_login && $user_safe && $user_email && !$bad_input) :
– $user_id = bb_new_user( $user_login, $user_email, $user_url );
+ $userinfo = bb_new_user( $user_login, $user_email, $user_url );
+ $user_id = $userinfo[0];
+ $user_password = $userinfo[1];
foreach( $profile_info_keys as $key => $label )
if ( strpos($key, 'user_') !== 0 && $$key !== '' )
bb_update_usermeta( $user_id, $key, $$key );
October 23, 2006 at 9:16 am #50258In reply to: Users dont receive password after registration
Pravin ParateyParticipantUmm, sourceforge has stopped the ablity for webservers to send email.
http://sourceforge.net/docman/display_doc.php?docid=4297&group_id=1
point 12.
Now I’ll have to figure out how to use cron
October 23, 2006 at 8:34 am #50257In reply to: Users dont receive password after registration
Pravin ParateyParticipantThe email functions are in
registration-functions.php
inbb-includes
.The mail function doesnt do anything on sourceforge. I wrote a sample php file and ran it:
<html>
<body>
<?php
mail( ‘pravinp[at]gmail[dot]com’, “subject”, “message”, ‘From: pravinp[at]gmail[at]com’);
?>
</body>
</html>
And it didnt send me the email.
Anybody know how I can fix this?
October 23, 2006 at 8:08 am #50124In reply to: Controlling the Number of Latest Discussions
planetphillipMemberWorks for me too. Thanks to both of you!
NO, wait when I try to open the tags.php I recieve this message:
Warning: Cannot modify header information - headers already sent by (output started at /home/username/public_html/forum/my-plugins/latest-topics.php:9) in /home/username/public_html/forum/bb-includes/functions.php on line 1304
TIA
October 23, 2006 at 6:59 am #50142In reply to: Adjust Size of Hot Tags
ear1greyMember<?php tag_heat_map( 60, 150, '%', 40); ?>
Yay, percentages work too! It’s not 8am yet and that’s made my day.
October 23, 2006 at 3:48 am #50177In reply to: How to upgrade to bbpress 0.72
travelsuperlinkMembermdswaffe,
many thanks. you guys did an awesome job. I wish more and more people join the bbpress. :
Franky
October 22, 2006 at 10:41 pm #50212In reply to: Change Post Order Question
Michael Adams (mdawaffe)MemberThe easy way is to find
get_thread( $topic_id, $page )
in/topic.php
and change it toget_thread( $topic_id, $page, true )
.The better way is to use a plugin so that you aren’t modifying any core files. (This is untested)
<?php
/*
Plugin Name: Reverse Post Order
Plugin URI: https://bbpress.org/forums/topic/76
*/
function reverse_post_order() {
global $topic_id, $page, $topic, $bb_current_user;
global $bb_db_override, $posts, $forum, $tags, $user_tags, $other_tags, $list_start;
$bb_db_override = true;
$posts = get_thread( $topic_id, $page );
$forum = get_forum ( $topic->forum_id );
$tags = get_topic_tags ( $topic_id );
if ( $bb_current_user && $tags ) {
$user_tags = get_user_tags ( $topic_id, $bb_current_user->ID );
$other_tags = get_other_tags ( $topic_id, $bb_current_user->ID );
} elseif ( is_array($tags) ) {
$user_tags = false;
$other_tags = get_public_tags( $topic_id );
} else {
$user_tags = false;
$other_tags = false;
}
$list_start = ($page – 1) * bb_get_option(‘page_topics’) + 1;
post_author_cache($posts);
}
add_action( ‘bb_topic.php_pre_db’, ‘reverse_post_order’ );
?>
October 22, 2006 at 10:30 pm #50241In reply to: Error when using wordpress functions
Michael Adams (mdawaffe)MemberTry
require_once('/path/to/wp-blog-header.php');
instead of wp-config.php.October 22, 2006 at 10:28 pm #50227In reply to: Cookies and WPMU
Michael Adams (mdawaffe)Member$bb->passcookie = PASS_COOKIE
Might work if you load wp before you load bb.
Is your bbPress URL a sudbirectory of your mu URL? If so, you should be able to use the $bb->wp_home and $bb->wp_siteurl variables.
October 22, 2006 at 10:21 pm #50122In reply to: Controlling the Number of Latest Discussions
Michael Adams (mdawaffe)MemberOops, my fault. Do exactly what you did but put
global $bb;
directly under the
function
line.<?php
function front_page_topics() {
global $bb;
$bb->page_topics = 2;
}
add_action( ‘bb_index.php_pre_db’, ‘front_page_topics’ );
?>
October 22, 2006 at 10:19 pm #50174In reply to: How to upgrade to bbpress 0.72
Michael Adams (mdawaffe)MemberIf you have any blocked users, you should run
upgrade_160()
found in bb-admin/upgrade.php. Otherwise, you shouldn’t have to worry about anything.Just overwrite the files and you should be good to go (backup first!)
October 22, 2006 at 3:45 pm #50186In reply to: Changing background color on forums listing
ZambuMemberOK, I figured it out finally…you can control the color of these background fields on the front page by changing the color code in the style.css file at these lines:
.deleted.alt {
background: #ff9999;
}
Of course! “deleted.alt”…so obvious of a name for this option in the style sheets…why didn’t I think of this 9 hours ago!
October 22, 2006 at 3:08 pm #743Topic: Cookies and WPMU
in forum InstallationmozeyMemberi managed to get bb and mu working from mu’s users tables THANK GOD. Now, i need them to have the same sessions,
“name $bb->usercookie USER_COOKIE
name $bb->passcookie PASS_COOKIE
path $bb->cookiepath COOKIEPATH
path $bb->sitecookiepath SITECOOKIEPATH
domain $bb->cookiedomain COOKIE_DOMAIN”
(documentation)
SO, what would the code look like in my config.php?
$bb->passcookie = $wp->{‘PASS_COOKIE’}; ?
..
This is not workig as nice. any clues?
October 22, 2006 at 11:05 am #741Topic: Limiting moderator privilege to specific forums
in forum Requests & Feedbackear1greyMemberGiving someone moderator rights across the whole site seems a bit generous. Is there any way I can restrict Moderator privileges to specific forums?
i.e.
Fred moderates Forum A,
Jim moderates Forum B,
Sheila moderates Forum A and C, etc…
EDIT: Moderator, this is probably better suited to “Requests and Feedback”, but I can’t move it… be my guest if you agree
October 22, 2006 at 9:29 am #50193In reply to: About Freshness
eddyshiMemberthanks your reply
October 22, 2006 at 9:10 am #50101In reply to: Integration with WP
lstelieMemberHello,
Another thing.
It would be great to have bbpress CSS (DIV and others) named bb_mydivname, because curently the naming sheme interferes a lot with WP one (for example both can have a
<div="header">
)October 22, 2006 at 4:48 am #49408In reply to: Importing from phpBB
brunotorresMemberI did this: http://brunotorres.net/unsorted/phpbb2bbpress.phps
Worked fine to me, importing a phpBB database with about 30000 records, including users, metadata, topics and posts. It takes a lot of time to finish, but works.
The code is a mess. I just finished doing this. Maybe I’ll make it better, if there’s people interested.
You have to use it on a fresh instalation, since it’ll delete any existing data.
It was just tested by me and I can’t ensure it’ll work for anyone, but I’d like some feedback.
Enjoy!
October 22, 2006 at 2:53 am #50081In reply to: Load Bbpress into WordPress
AtsutaneMemberThanks It work now
October 22, 2006 at 1:49 am #50121In reply to: Controlling the Number of Latest Discussions
ZambuMemberI am not sure what you mean by that, as I have never created a plug-in before. Anways, I gave it a try as follows:
Created a blank file with the following content:
<?php
function front_page_topics() {
$bb->page_topics = 2;
}
add_action( ‘bb_index.php_pre_db’, ‘front_page_topics’ );
?>
Then saved it as “latest-posts.php” and stored it in my newly created “my-plugins” folder.
But it did not seem to have any effect as the front page of the forum would still display more that 2 latest posts (I selected to limit the topics to 2 so it would be asier to test).
The only other thing I can think of is that this code needs to instead be added to one of the regular scripts, but I have no idea which one.
thanks,
thomas
October 21, 2006 at 9:17 pm #50112In reply to: Integration and second database
Michael Adams (mdawaffe)Memberandrea_r,
What is the goal? Are you trying to to have mu and bbPress share the same user table? bbPress and mu are using different databases (as opposed to different tables in the same database)?
I can help, but I need to know exactly how things are and how you want them to work.
I think this is your situation (apologies if I misunderstood you):
You have mu and bbPress installed and working off of different databases. You want bbPress to store its content in that separate database, but you want it to draw its users from mu’s database.
If that is the case, this is what should work. The top of bbPress’ config.php should look like:
//These are for the information about the database into which bbPress should store its content
define('BBDB_NAME', 'bbpress');
define('BBDB_USER', 'username');
define('BBDB_PASSWORD', 'password');
define('BBDB_HOST', 'localhost');
// This is the information about mu's database. bbPress will look for users in this database
define('USER_BBDB_NAME', 'mu');
define('USER_BBDB_USER', 'mu username');
define('USER_BBDB_PASSWORD', 'mu password');
define('USER_BBDB_HOST', 'localhost');
// You just told bbPress to use that mu database to look for users, but it doesn't yet know the name of the *table* to use.
// Change 'wp_users' and 'wp_usermeta' to be the table names of mu's user tables.
define('CUSTOM_USER_TABLE', 'wp_users');
define('CUSTOM_USER_META_TABLE', 'wp_usermeta');
October 21, 2006 at 9:04 pm #49855In reply to: loading wordpress with bbpress
Michael Adams (mdawaffe)MemberWhat you’re trying to do should be done in bbPress’ config.php file, but you’re really close
Put your index.php back the way it was. In bbPress’ config.php file, put the following two lines right after the
<?php
line.require_once('/path/to/wp-blog-header.php');
define('WP_BB', true);
It seems you’ve found the correct path to use in you system: /home/myusername/public_html/blog/wp-blog-header.php
So it should now look like:
<?php
require_once('/home/myusername/public_html/blog/wp-blog-header.php');
define('WP_BB', true);
Then, copy your
bb-templates/
directory tomy-templates/
this is so you can modify the template files without editing the original ones; bbPress will use the files in that directory automatically instead of the original ones.In
my-templates/front-page.php
(and any of your other template iles), you can now call any WordPress template function, evenget_header()
.October 21, 2006 at 8:47 pm #50120In reply to: Controlling the Number of Latest Discussions
Michael Adams (mdawaffe)MemberHow about this plugin?
function front_page_topics() {
$bb->page_topics = 10;
}
add_action( 'bb_index.php_pre_db', 'front_page_topics' );
October 21, 2006 at 8:44 pm #50171In reply to: tagsize plugin
Michael Adams (mdawaffe)MemberI don’t believe a plugin is necessary for this. The core function
tag_heat_map()
is just the same, isn’t it?See my comment here: https://bbpress.org/forums/topic/67?replies=3#post-295
October 21, 2006 at 8:38 pm #50141In reply to: Adjust Size of Hot Tags
Michael Adams (mdawaffe)MemberThere is no need to edit any core files.
Copy
bb-template/front-page.php
tomy-templates/front-page.php
and then in that file find<?php tag_heat_map(); ?>
and replace it with:
<?php tag_heat_map( 10, 30, 'px', 40); ?>
to generate a tag cloud of the top 40 tags where the smallest tag displays with a 10px font-size and the largest with a 30px font-size.
The first parameter is the size of the smallest tag, the second is the size of the largest tag, the third is what unit to use (’em’, ‘px’, ‘pt’, …) and the last is how many tags to show.
October 21, 2006 at 8:29 pm #50080In reply to: Load Bbpress into WordPress
Michael Adams (mdawaffe)MemberYou should be able to use any bbPress functions you like in WordPress as long as you
require_once('path/to/bbpress/config.php');
-
AuthorSearch Results