Search Results for 'code'
-
Search Results
-
Hi there,
I created a couple of custom fields and integrated it with my Group Topics, new topic form. I’d like to be able to just load this new form for specific groups. I ended up creating a little plugin to load the following code found on a tutorial that worked for me.
It took a long time to figure this out and I was hoping to get a bit of direction to expedite figuring this out (the topic of this thread).
Thanks!
add_action ( ‘bbp_theme_before_topic_form_content’, ‘bbp_extra_fields’);
function bbp_extra_fields() {
$value = get_post_meta( bbp_get_topic_id(), ‘bbp_extra_field1’, true);
echo ‘<label for=”bbp_extra_field1″>Seeking Funding? (Yes or no)</label><br>’;
echo “<input type=’text’ name=’bbp_extra_field1′ value='”.$value.”‘><br>”;$value = get_post_meta( bbp_get_topic_id(), ‘bbp_extra_field2’, true);
echo ‘<label for=”bbp_extra_field2″>Resources Needed (talent, knowledge, mentors, etc.)</label><br>’;
echo “<input type=’text’ name=’bbp_extra_field2′ value='”.$value.”‘>”;
}add_action ( ‘bbp_new_topic’, ‘bbp_save_extra_fields’, 10, 1 );
add_action ( ‘bbp_edit_topic’, ‘bbp_save_extra_fields’, 10, 1 );function bbp_save_extra_fields($topic_id=0) {
if (isset($_POST) && $_POST[‘bbp_extra_field1’]!=”)
update_post_meta( $topic_id, ‘bbp_extra_field1’, $_POST[‘bbp_extra_field1’] );
if (isset($_POST) && $_POST[‘bbp_extra_field2’]!=”)
update_post_meta( $topic_id, ‘bbp_extra_field2’, $_POST[‘bbp_extra_field2’] );
}add_action(‘bbp_template_before_replies_loop’, ‘bbp_show_extra_fields’);
function bbp_show_extra_fields() {
$topic_id = bbp_get_topic_id();
$value1 = get_post_meta( $topic_id, ‘bbp_extra_field1’, true);
$value2 = get_post_meta( $topic_id, ‘bbp_extra_field2’, true);
echo “Seeking Funding? “.$value1.”<br>”;
echo “Resources Needed: “.$value2.”<br>”;
}Topic: Forum Layout Problem
Hi
I’ve searched the web but nothing shouts out at me. The only thing I can see is to edit the PHP but I’d rather avoid that if possible
Currently my layout is as follows:
<strong>South Yorkshire</strong> Sheffield & District Fair Play League (2, 6), Sheffield & Hallamshire County Senior (2, 10), The Wragg League (1, 1), Doncaster & District (1, 1) <strong>East Yorkshire</strong> Humber Premier League (0, 0), East Riding Amateur (0, 0), East Riding County (0, 0)But I’d like it as below.
<strong>South Yorkshire</strong> o Sheffield & District Fair Play League (2, 6), o Sheffield & Hallamshire County Senior (2, 10), o The Wragg League (1, 1), o Doncaster & District (1, 1) <strong>East Yorkshire</strong> o Humber Premier League (0, 0), o East Riding Amateur (0, 0), o East Riding County (0, 0)Essentially I want my forums in a nice list rather than in a clump. I’d like the same palyour as most forums (PHPBB etc). Is this possible?
Plugin/ easy setting I’m missing?
Hello I am running the latest version of wordpress and bbpress, I am new to both of the aforementioned products. I have added a header link to my site that looks like
<?php if (is_page(‘Forums’)) { echo ” class=\”current_page_item\””; } ?>
That code works everywhere on my site except for bbpress. Can someone please tell me how to set my header link, and keep it, in the active state when on the forums? I’ve looked on this site and searched google to no avail.
Thanks alot.
Wordpress 3.6, using theme Twenty Eleven
BbPress 2.4 (Just updated this morning, though I had the problem with the previous version as well)
Only other active plugin: Error Log Dashboard Widget 1.0.2 (showing no PHP errors)
Several other plugins are installed, but deactivated while trying to debug this issue.I have the following text on a single page:
Here is the shortcode for the single forum: [ bbp-single-forum id=39 ] [bbp-single-forum id=39] Here is the shortcode for all forums: [ bbp-forum-index ] [bbp-forum-index]The single forum does not display. The forum index does display. I have confirmed that the index is the correct number via the admin forum view. Here is a link to a screenshot. Here is the link from the forum page, showing the forum id: http://[domainremoved].org/wordpress/wp-admin/post.php?post=39&action=edit (Obviously, clicking it won’t work, because it requires a log-in, but this is to confirm that I’m finding the forum index correctly.)
Here is the forum: http://[domainremoved].org/forums/forum/pta-board/
Here is the page it is linked from, showing where the shortcodes do not work: http://[domainremoved].org/pta-board-2/
(Note: I have added spaces between the shortcodes so you can see the text that I used, then repeated the shortcodes without the spaces to display the forums.)I feel like this should be some really simple user error, but given that I have double-checked the shortcode syntax and the forum id, deactivated all other plugins, and chosen the Twenty Eleven theme, I can’t figure out what it could be.
ETA: Wow, that was fast— my page got slammed with spam comments within minutes of posting the links here. I have removed them for now. If a support person needs them to diagnose the issue, I can give them out then.
After weeks trying to find something that would work, I found the code on wordpress forums to remove completely gravatars (and redirects it was causing.. )
here is it:
function bp_remove_gravatar ($image, $params, $item_id, $avatar_dir, $css_id, $html_width, $html_height, $avatar_folder_url, $avatar_folder_dir) { $default = get_stylesheet_directory_uri() .'/images/mystery-man.jpg'; if( $image && strpos( $image, "gravatar.com" ) ){ return '<img src="' . $default . '" alt="avatar" />'; } else { return $image; } } add_filter('bp_core_fetch_avatar', 'bp_remove_gravatar', 1, 9 ); function remove_gravatar ($avatar, $id_or_email, $size, $default, $alt) { $default = get_stylesheet_directory_uri() .'/images/mystery-man.jpg'; return "<img alt='{$alt}' src='{$default}' height='{$size}' width='{$size}' />"; } add_filter('get_avatar', 'remove_gravatar', 1, 5); function bp_remove_signup_gravatar ($image) { $default = get_stylesheet_directory_uri() .'/images/mystery-man.jpg'; if( $image && strpos( $image, "gravatar.com" ) ){ return '<img src="' . $default . '" alt="avatar" width="60" height="60" />'; } else { return $image; } } add_filter('bp_get_signup_avatar', 'bp_remove_signup_gravatar', 1, 1 );As I am now planning to disable buddypress completely. I am looking for an easy way to let users upload their avatars in bbpress, anyone tried it already?
Topic: bbPress
The newest version of bbPress has caused a couple of my sites plugins/short-codes to display incorrectly. The plugin in question is Cookie Law Info, it appears to remove it format i.e. no button image and text not centred etc. Also the short-codes for my elegant themes, theme do not appear to be displaying correctly either.