Search Results for 'code'
-
AuthorSearch Results
-
April 14, 2008 at 12:23 am #64203
In reply to: Role Integration Problem
skehoe
Membersam is there any way I can edit the role map code to account for this. Changing the prefix could cause a lot of problems.
April 13, 2008 at 11:09 pm #3195Topic: Latest Post in Forum List
in forum Themesberfarah
MemberI want to be able to add the latest post made in a forum section on the front page (and everywhere it lists forums).
If I try to do that, it will just keep repeating the value for the first throughout the list.
It’s on this site, if it makes a difference
Thanks in advance for any help
April 13, 2008 at 11:03 pm #64248In reply to: Change Gravatar Size?
Bloggsbe
MemberWell, if you like to hack you admin files, you can add the following code to the options-general.php file just after line 143, making this code start on line 144;
<label for="avatars_size">
<?php _e('Gravatar Size:'); ?>
</label>
<div>
<select name="avatars_size" id="avatars_size">
<?php
$selected = array();
$selected[bb_get_option('avatars_size')] = ' selected="selected"';
?>
<option value="16"<?php echo $selected[16]; ?>><?php _e('16 px'); ?></option>
<option value="32"<?php echo $selected['32']; ?>><?php _e('32 px'); ?></option>
<option value="36"<?php echo $selected['36']; ?>><?php _e('36 px'); ?></option>
<option value="48"<?php echo $selected['48']; ?>><?php _e('48 px'); ?></option>
<option value="80"<?php echo $selected['80']; ?>><?php _e('80 px'); ?></option>
<?php
unset($selected);
?>
</select>
</div>And in the bb-includes/template-functions.php file, after line 1198 you can add this;
$size = bb_get_option('avatars_size');Then you can change the size in the admin section, and the correct size will show with the posts.
Or you can download the edited files here
—
Rune
April 13, 2008 at 8:24 pm #62868In reply to: Expanding User Profile Details
Detective
MemberIt is really easy to add profile fields.
First, you need to print the fields you need:
add_action('extra_profile_fields', 'print_extra_fields');
function print_extra_fields($user_ID) {
/* get the current values for that user, and print your form items */
}
add_action('profile_edited', 'process_extra_fields');
function process_extra_fields($user_ID){
/* here, $_POST contains the new field values. so you can do things like bb_update_usermeta($user_ID, 'your_field', $_POST['your_field']); ... */
}Please correct me if i’m wrong. I don’t remember the action names. But this works
I use it in WP and BBP.
April 13, 2008 at 6:58 pm #63027In reply to: where can i grab variables like ‘slugs’ and post url
_ck_
ParticipantI believe you are looking for the functions
bb_get_optionandget_post_link.April 13, 2008 at 6:53 pm #63116In reply to: Forumula for converting wordpress plugins
_ck_
ParticipantWell some are far easier than others.
First look for $wpdb and change to $bbdb
Then you have look at things like
get_optionand other functions and see if they can easily use thebb_get_optionor otherbb_version of the function.But even if the alternative function exists you have to be sure that it’s doing what you want. Things that relate to users are similar but things that relate to posts have to be change to topics and then there is comments vs posts.
April 13, 2008 at 6:25 pm #64053In reply to: Only key holders add topics
_ck_
ParticipantAha! I think it’s this simple. Make yourself a mini-plugin and install it containing this:
global $bb_roles;
$bb_roles->remove_cap('member','write_topics');If you don’t know how to make a plugin, it might be possible to just put those two lines into your template’s
header.phpApril 13, 2008 at 6:16 pm #64052In reply to: Only key holders add topics
_ck_
ParticipantUnlike WordPress I don’t believe bbPress has an easy way to do role management (yet). There is a privilege built-in for
bb_current_user_can( 'write_topics' )which means it is technically possible to control who can start topics by taking away that role privilege from the “member” role.In theory a small plugin should be able to do this – I’ll take a look at how it might be done as an exercise in learning more about bbPress roles…
April 13, 2008 at 6:14 pm #64154In reply to: Prblem upgrading
Sam Bauers
ParticipantSorry, that should have been:
$bb->wp_table_prefix = 'wp_';April 13, 2008 at 5:39 pm #64220In reply to: BBpress Admin for WordPress
_ck_
ParticipantSounds interesting but:
Fatal error: Call to undefined function: bb_option() in wp-content/plugins/bbpress-admin/bbpress-options-admin.php on line 38Is this for people who has bbPress running INSIDE WordPress, instead of just stand-alone integration?
April 12, 2008 at 11:34 pm #64101In reply to: PRIORITY #1: ImageFile Attachments
woodsnwind
Memberyes, please, file attachment is valuable for my implementation. I’ll take it as a plugin or hardwired.
April 12, 2008 at 11:17 pm #58948In reply to: User-editable Custom Titles
citizenkeith
ParticipantHmm…. not sure to how to change that code without getting errors (I’m running 0.9.0.1 on this particular forum).
function get_profile_info_keys() {
return apply_filters(
'get_profile_info_keys',
array('user_email' => array(1, __('Email')), 'user_url' => array(0, __('Website')), 'from' => array(0, __('Location')), 'occ' => array(0, __('Occupation')), 'interest' => array(0, __('Interests')))
);
}
function get_profile_admin_keys() {
global $bbdb;
return apply_filters(
'get_profile_admin_keys',
array($bbdb->prefix . 'title' => array(0, __('Custom Title')))
);
}April 12, 2008 at 10:02 pm #64247In reply to: Change Gravatar Size?
citizenkeith
ParticipantThanks Wyvn. It would be nice if there was something in the Admin menu to change this, but for now I’ll just change that file.
April 12, 2008 at 7:11 pm #64029In reply to: avatars in wordpress and bbpress
affacat
Memberto better illustrate my issue, my current code for the profile page is:
if ( avatarupload_get_avatar(ID) ) {
avatarupload_display($user->ID);
} else {
echo bb_get_avatar( $user->ID );
}
which means if uploaded avatar exists then display it, else get gravatar.
but what i really want is:
if uploaded avatar exists then display it, else if gravatar exists then display that, but if neither exists then display the avatar upload default avatar.
Right now it displays gravatar default instead. which isn’t my first choice since avatar upload would give me control over the default image which is better for obvious reasons.
April 12, 2008 at 4:38 am #64120feelie75
MemberThis is the code that was making the call and getting the return false returned to it, thus resulting in this error:
if (!$bbdb->db_connect(‘SHOW TABLES;’)) {
$this->step_status[1] = ‘incomplete’;
$this->strings[1][] = __(‘There was a problem connecting to the database you specified.
Please check the settings, then try again.’);return ‘error’;
}
db_connect was returning false when it detected $this->$dbhname was undef. So by removing the return false when that happened, the db_connect call then succeeded and all was happy
.To answer the other person, I’m hosting on localhost. I have an old PowerPC Mac running OS X 10.4.11 or something. It’s a spare computer; thought I’d stick a forum on it and learn some php.
April 12, 2008 at 12:59 am #64239In reply to: WPMU with BBpress on Subdomain
arlene476
MemberThere is an answer here, https://bbpress.org/forums/topic/require_oncepathtowp-blog-headerphp
Saying:
Put in the full path from the server root instead of the relative path.
But I don’t know how to code it and what line to place it
April 11, 2008 at 9:54 pm #64212In reply to: using bb_users with integrated setup
precious-forever
Memberthis order: WP 2.3, bbpress 0.8 (no integration with plugins at that time!), WP 2.5, bbpress 0.9
I patently waited with integration until 0.9 was out since I did not understand the whole thing before. And everything seems to work fine. Just as soon as I add the WP_ prefix setting to my bbpress config, it seems as if bbpress can only access the WP users anymore (with the correct role mapping i set up etc.).
maybe I should just ask all registered users to reregister after integration, since the forum is pretty new anyway
April 11, 2008 at 7:23 pm #63631chrishajer
ParticipantSorry, I forgot I was talking about tags.php specifically. Here’s a tags URL.
http://www.riversideinfo.org/forum/tags.php?tag%3Dtif
is what’s in the sitemap.
curl -I "http://www.riversideinfo.org/forum/tags.php?tag%3Dtif"returns a 302 header.
If you unencode it, and then curl -I:
curl -I "http://www.riversideinfo.org/forum/tags.php?tag=tif"returns a 200 header.
Maybe it’s just the urlencoding of the = that causes it to redirect? That’s the only difference between the two URLs here.
April 11, 2008 at 7:18 pm #63630chrishajer
ParticipantHere’s an example of a URL in the sitemap.
http://www.riversideinfo.org/forum/topic.php?id%3D3%26page%26replies%3D1
If you do a
curl -I http://www.riversideinfo.org/forum/topic.php?id%3D3%26page%26replies%3D1you get a 302 header back. If you URL unencode the URL and do a curl -I, you get back a proper 200:curl -I "http://www.riversideinfo.org/forum/topic.php?id=3&page&replies=1"I am not using permalinks or slugs, and that plugin author doesn’t seem to have updated it since I installed it long ago. I actually turned it off a while ago because of the amount of time it was taking to generate the sitemap for 5000 posts.
http://boakes.org/talk/topic/31
So, I guess the question is, why does that first URL trigger a 302? Maybe the sitemap plugin is creating URLs that are poorly formed?
April 11, 2008 at 4:43 pm #63629_ck_
ParticipantI am not sure why Google would be seeing redirects. bbPress only redirects after form submits via wp_redirect to the best of my knowledge. Some plugins do too, but usually again after only form submits. Even tag URLs don’t use redirects.
Are you saying the sitemap plugin does not generate permalink urls but rather the non-slug type ie.
?topic=123If so, it’s outdated and if you are using slugs it should be modified to generate results that take advantage of slugs.April 11, 2008 at 4:11 pm #64071In reply to: PHP if… else Help Required
_ck_
ParticipantbbPress has a function to check for administrators.
if (!in_array(intval($GLOBALS['forum']->forum_id), array(2,5,9)) || bb_current_user_can('administrate')) { do something here }where 2,5,9 is the list of forum numbers you want to restrict
what you are trying to do is possible but very tricky
For example the “add new” on the front page offers all the forums for posting and you’d have to write a replacement for the list (bb_new_topic_forum_dropdown)
All the “magic” happens in post-form.php, so you could take that if statement above and wrap the entire template with that (in theory).
April 11, 2008 at 3:58 pm #64208In reply to: Disable “Latest Discussions”
_ck_
ParticipantFind
bb-templateskakumeifront-page.php(or the same template name in any alternate theme you might be using) and find the line that says<?php if ( $topics || $super_stickies ) : ?>(around line 11) and make it say<?php if ( 0 && ( $topics || $super_stickies )) : ?>which will make the if statement always fail and never show the latest discussions. If you ever want to restore it, just remove the zero &&.
April 11, 2008 at 3:38 pm #64156In reply to: New bbPress Theme: Peacemaker
refueled
Member“Interesting design.”
Hopefully that’s a good thing, and not too interesting that it’s junk.

Thanks for adding it to bbshowcase.
April 11, 2008 at 11:12 am #53835In reply to: k2 for bbpress
linickx
ParticipantI had an e-mail saying that the latest bbpress broke my port, so I’ve done a re-release

http://www.linickx.com/archives/402/k2-for-bbpress-updated-v002
April 11, 2008 at 7:17 am #64152In reply to: Prblem upgrading
Sam Bauers
ParticipantIf bbPress and WordPress are in the same database then hopefully all you should have to do is add this line to your bb-config.php after the database definitions:
$wp_table_prefix = 'wp_'; -
AuthorSearch Results