Search Results for 'code'
-
AuthorSearch Results
-
December 10, 2012 at 11:19 pm #122510
Topic: Change editor button output
in forum Troubleshootingzeaks
ParticipantI want to change the output of the “Code” editor button of the bbpress plugin to use my custom shortcode for posting code in the forums. How can I do this? I’m unable to find any reference to the buttons in any of the templates.
December 10, 2012 at 8:23 pm #122506In reply to: Google Authorship
Jared Atchison
MemberAh in that case, I think thats great. Since the author is the primary content creator of the thread, all things considering, I think it will work well.
You should considering polishing up that code and releasing it as a bbPress plugin on the WordPress.org plugin repository 🙂 You’d have to dynamically hook into the user edit page and maybe a few other changes, but the base of the work there is probably done.
December 10, 2012 at 8:01 pm #122501In reply to: Custom forum login using external database
Jared Atchison
MemberSo here is how I would do it (I think) if I wanted something easy yet half way elegant.
I’d create a /login page in WordPress that has a custom page template (page-login.php) that contains some custom stuff. It still breaks the process up into two parts, which is not ideal, but its the easiest way without putting in some time to get around that.
Essentially, it would be something like this. First ask for the customer ID. They enter that in and submit it. If it’s valid then reload the page and show the bbPress login.
if ( isset( $_GET['cid'] ) && !empty( $_GET['cid'] ) ) {// cid (customer ID) is present, show the bbPress login form
echo 'Please enter your username and password to complete the login process';
echo do_shortcode('bbp-login');} elseif ( $_GET['error'] == true ) {
// cid entered was not valid
echo 'The customer ID you entered is not valid.';} else {
// cid is absent so show the form to validate it
// do your custom form here that asks for the customer ID. Then if the customer ID
// is correct/valid reload this page like /login?cid=123456 which will show
// the bbPress login form.
}Another option would be on the first form to ask for the username. Then you could take that and have it auto fill in on the login form using the WordPress login form function (wouldn’t be able to use the bbPress shortcode for this).
December 10, 2012 at 7:39 pm #122500In reply to: Custom forum login using external database
on3advertising
ParticipantJared, thanks for the feedback. The more I thought about it, about a thousand different ways to do it popped into my head as well (spun my brain into a scrambled egg). At this point, I’ve basically started to write the custom login from the ground up. I’m going to create a shortcode out of it at the end.
I just started it but so far I just have the basic connection and query going:
function restrictForum(){
$db_name = 'dbname';
$con = mysql_connect("URL","username","password*");
mysql_select_db("$db_name")or die("cannot select DB");
$cust_no = $_POST['custno'];
$sql = "SELECT * FROM customer_data WHERE customer_number = $cust_no";
echo('Customer #');
}
I previously had this small bit into a shortcode that just checked if the user was logged in then provided the bbpress login form if they weren’t:
function restrictForum(){if(!is_user_logged_in()){
echo('You must login to access the forum');
echo do_shortcode('[bbp-login]');
}
}add_shortcode('forum-login-restrict','restrictForum');
December 10, 2012 at 6:35 pm #122496In reply to: Allowing inline images uploads in posts?
Jared Atchison
MemberThe thing that makes inline images tough is non-admin users cannot use the
tag and shortcodes are not an option.Currently there is an issue on trac (#1916) that would make it where img tags do not get filtered out. Once that’s done it would open the gate for plugins to handle inline images pretty easily.
December 10, 2012 at 6:30 pm #122495In reply to: Google Authorship
Jared Atchison
MemberThat’s interesting, but not quite the approach he was asking about (from my understanding).
I think he was referring to the google rich snippets that show up if the page supports the appropriate meta (http://yoast.com/push-rel-author-head/)
You could use a good chunk of the code that is posted above (the part where it sets up a field for google+), then on topic pages get the topic user’s ID, and use that to put in the line above.
December 10, 2012 at 6:22 pm #122493In reply to: Custom forum login using external database
Jared Atchison
MemberI think the only way to do what you want wil be using a completely custom login form that you pass to your own server for validation. You won’t be able to use the WordPress login form (or the function that generates it) at all.
There are about a dozen different ways you can take this based on the 5 minutes I’ve thought about it. Really just depends if you’re going for elegant, easy, or some where in between. It’s going to take custom code regardless.
December 10, 2012 at 6:08 pm #122491mamasaywhat
ParticipantThanks guys – what ended up working was putting BOTH of those codes in the css. One or the other alone didn’t do anything. CSS is weird haha. Anyway, problem solved, looking forward to the next update!
December 10, 2012 at 5:58 pm #122490Martin ( Martin_C )
ParticipantI got it to work in firefox by adding this when I had the same problem at appglobe.com:
#bbpress-forums .bbp-user-section ul.bbp-topics {
float: left !important;
width:100% !important; /*forgot this one on my last post @mamasaywhat */
}
Try that or the code above by Jared Atcihison and it should work in firefox.
December 10, 2012 at 5:52 pm #122489In reply to: Roles and Capabilities in bbPress 2.2
mouffles
Participantthe bad tweak :
function bbp_filter_blog_editable_roles( $all_roles = array() ) {// Loop through bbPress roles
foreach ( array_keys( bbp_get_dynamic_roles() ) as $bbp_role ) {// Loop through WordPress roles
foreach ( array_keys( $all_roles ) as $wp_role ) {// If keys match, unset
if ( $wp_role == $bbp_role ) {
//unset( $all_roles[$wp_role] );
}
}
}return $all_roles;
}bbpress/core/capabilities/
And then Moderators are back……. I’m sure i missed something but plugins like “members” don’t do the trick. And i just want basic forum moderation works now.I will never understand why endusers have to put their hands in the mess of bbpress and hack/tweak it just to use this plugin >:( I can’t trust in your plugin every updates are hell.
Then, don’t work as a dirty pig, and update the doc when you change such important things like roles! It just a little more repectfull for end users.
December 10, 2012 at 5:35 pm #122485Jared Atchison
MemberIt’s a Firefox problem. All other browsers should show it correctly. Will be addressed in 2.3.
Until then, this should fix it.
.bbp-user-section {
overflow: auto;
}
December 10, 2012 at 5:07 pm #122484Martin ( Martin_C )
ParticipantOh, I see I forgot a “{” in my first code….it should be:
#bbpress-forums .bbp-user-section ul.bbp-topics {float: left !important;}
December 10, 2012 at 4:47 pm #122481Martin ( Martin_C )
ParticipantTry this at the bottom of your CSS file:
#bbpress-forums .bbp-user-section ul.bbp-topics
float: left !important;
}December 10, 2012 at 4:09 pm #122479In reply to: Google Authorship
Martin ( Martin_C )
ParticipantThe following is what I use at AppGlobe:
/* Add Google+ profile URL as profile contact method */ function appglobe_add_google_profile( $contactmethods ) { $contactmethods['google_profile_url'] = 'Google Profile URL'; return $contactmethods; } add_filter( 'user_contactmethods', 'appglobe_add_google_profile', 10, 1);/* Remove nofollow, and ad author to the profile link */ function appglobe_switch_nofollow_for_author($str) { $str = preg_replace( '~<a ([^>]*)\s*(["|\']{1}\w*)\s*nofollow([^>]*)>~U', '<a ${1}${2}${3}>', $str); return str_replace(array(' rel=""', " rel=''"), 'rel=author', $str); } add_filter( 'bbp_get_topic_author_link', 'appglobe_switch_nofollow_for_author' );And then in your user-profile.php (create a bbpress folder in your theme root, and copy it over) you can add this:
<?php if( bbp_get_displayed_user_field( 'google_profile_url' ) ) : ?> <h2 class="author-subtitle">Google Profile</h2> <?php if( bbp_get_user_role(bbp_get_displayed_user_id()) == 'bbp_keymaster' || bbp_get_user_role(bbp_get_displayed_user_id()) == 'bbp_moderator') : ?> <a rel="me" class="bbp-user-url" href="<?php esc_url(bbp_displayed_user_field( 'google_profile_url' )); ?>"><?php bbp_displayed_user_field( 'google_profile_url' ); ?> </a> <?php else : ?> <a rel="me nofollow" class="bbp-user-url" href="<?php esc_url(bbp_displayed_user_field( 'google_profile_url')); ?>"><?php bbp_displayed_user_field( 'google_profile_url'); ?> </a> <?php endif; ?>Since I beleave only the first rel=me link on a page counts there would be best to use topic lead:
add_filter( 'bbp_show_lead_topic', '__return_true' );…by doing so each page will be considered authored by the topic creator even if its paged.
December 10, 2012 at 1:50 pm #122472Alexander
Participant[WP 3.4.2 + bbPress v2.2.2]
I’ve searched around a bit for a way to do this – but have found no neat solution. All threads relating to this seem to be 2-3 years old and be for the bbPress standalone rather than the plugin.
Basically what I want is a simple list displaying forums + topic count, in my page.php. Example:
<ul>
<li><a href="#">Forum title 1<span>Topic count</span></a></li>
<li><a href="#">Forum title 2<span>Topic count</span></a></li>
<li><a href="#">Forum title 3<span>Topic count</span></a></li>
</ul>
Etc.
I know that there is a widget listing the forums categories, but I need the topic count as well for a better overview. Also, if easily doable, I need to exclude a forum category from the list.
Any help would be greatly appreciated.
December 10, 2012 at 3:07 am #122463Topic: BP – bbP – WordPress SEO integration
in forum PluginsSydneyDesigner
ParticipantTo all those smart coding guys out there, please can someone help me with the bbP functions needed to complete the code below. I think there are two bbP functions needed – see square brackets [??…]. Or maybe someone has a better way of doing it.
I’m trying to integrate BP1.6.1, the new bbP2.2.2 forums and WordPress SEO1.3.1.1 so that the WordPress SEO (meta) page titles are shown when a bbP Topic is being shown within a BP page (just like they are shown for native bbP forum pages).
I’ve hooked functions into ‘bp_modify_page_title’ before and managed to extract ‘_yoast_wpseo_title’ before. So I’m part way there I guess.
I also understand that I need to change the priority from 10 to 16 (or more) in line below (in buddypress>bp-core>bp-core-filters.php), to make bp_modify_page_title filter execute after, and hence overrule, WPSEO title which has priority 15 (in worpress-seo>frontend>class-frontend.php).
add_filter( ‘wp_title’, ‘bp_modify_page_title’, 16, 3 );
add_filter( 'bp_modify_page_title', 'new_page_title', 10, 4 );
function new_page_title( $new_page_title, $title, $sep, $seplocation ) {
global $bp, $bbp;
/** If bbP Topic is being shown within a BP page then replace title with title input via Yoast WordPress SEO plugin */
if ( [?? a bbp function that is true when bbP Topic is being shown within a BP page] && bp_is_active( 'groups' ) && !empty( $bp->groups->current_group ) ) {
[?? a bbp function that loads the bbP Topic Post ID to $topic->ID];
$new_page_title= get_post_meta( $topic->ID, _yoast_wpseo_title, true);
}
return $new_page_title;
}
If you can help please, and I can then get this to work, I’ll post the result back again so others can benefit.
Many thanks.
December 9, 2012 at 4:22 pm #122450In reply to: Forum Icons ?
Martin ( Martin_C )
ParticipantIf you know CSS you can easily add some styles to your to style sheet. If you use the default templete, it could look like this:
.bbPress.forum .entry-title {/*Styles to add icon image to the left of this element goes here*/
}
December 8, 2012 at 10:30 pm #122425In reply to: bbPress + Jetpack = 500 Internal Server Error
Daniel.Haugen
ParticipantWell, this is the logs from the time I activated the plugins:
20121207T212805: www.conatu.net/wp-admin/admin-ajax.php
PHP Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 77824 bytes) in /hermes/bosoraweb064/b1399/ipg.conatunet/wp-includes/class-simplepie.php on line 374320121207T212805: www.conatu.net/wp-admin/admin-ajax.php
PHP Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 77824 bytes) in /hermes/bosoraweb064/b1399/ipg.conatunet/wp-includes/class-simplepie.php on line 374320121207T212806: www.conatu.net/wp-admin/admin-ajax.php
PHP Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 77824 bytes) in /hermes/bosoraweb064/b1399/ipg.conatunet/wp-includes/class-simplepie.php on line 374320121207T213434: www.conatu.net/wp-admin/admin-ajax.php
PHP Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 77824 bytes) in /hermes/bosoraweb064/b1399/ipg.conatunet/wp-includes/class-simplepie.php on line 374320121207T213434: www.conatu.net/wp-admin/admin-ajax.php
PHP Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 77824 bytes) in /hermes/bosoraweb064/b1399/ipg.conatunet/wp-includes/class-simplepie.php on line 352920121207T213436: www.conatu.net/wp-admin/admin-ajax.php
PHP Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 77824 bytes) in /hermes/bosoraweb064/b1399/ipg.conatunet/wp-includes/class-simplepie.php on line 3529And btw, from where can I make forums?
December 8, 2012 at 7:38 pm #122424bruceleebee
ParticipantI’m having the exact same problem. And like ffalder I can’t code, but usually Google my way out of a problem. But this time no luck.
From my research it seems lots of people are having the same problem.
I think the main issue here is the breadcrumbs.
1) You create a custom ‘forum home page’ using short codes (or whatever means you like) to be your default page that users see as the homepage of your forum.
2) A user try’s to get back to the ‘forum home page’ using the breadcrumbs by clicking the text “forums” in the breadcrumbs.
3) Unfortunately it just redirects to the forum slug chosen in Settings, not your actual ‘forum home page’. And that forum slug is always defaulted to an archives page.
4) So setting that slug to the same as your ‘forum home page’ does not work, because woprdpress overrides your ‘forum home page’ created in step 1 and defaults it to an archives page.
Sorry for re-hashing this, but it’s sometimes better to make it a little clearer. At least in my own head anyway.
I don’t know how simple this is or not, but one solution that comes to mind is to have an option in Settings that lets you decide where the ‘forums’ text link in the breadcrumbs will point to. If you can choose to have it point to your ‘forum home page’ then all would be solved right?
This person suggested changing the breadcrumbs in the core of the plugin, but obviously it’s not very desirable since it’s changes to the core. And I also cannot find the file that they edited. Think it might have been a mod to an old version: http://mysitemyway.com/support/topic/infocus-bbpress-20-root-slug
December 8, 2012 at 2:00 pm #122420Pippin Williamson
ParticipantIt should be possible with some custom code tweaks. Are you comfortable with a little PHP?
December 8, 2012 at 9:14 am #122416Martin ( Martin_C )
ParticipantSince I wan’t only replies ( not created topics and replies) I’ve created a filter function:
function ag_force_replies_only( $query, $user_id ) {if( bbp_is_single_user() ) { // Just in case
$query = bbp_has_replies( array(
‘post_type’ => array( bbp_get_reply_post_type() ),
‘post_parent’ => ‘any’,
‘posts_per_page’ => bbp_get_replies_per_page(),
‘paged’ => bbp_get_paged(),
‘orderby’ => ‘date’,
‘order’ => ‘DESC’,
‘author’ => $user_id,
‘show_stickies’ => false,
) );
}return $query;
}
add_filter(‘bbp_get_user_replies_created’, ‘ag_force_replies_only’, 10, 2);Now is shows replies only: http://appglobe.com/forums/users/martin/replies/
December 8, 2012 at 6:15 am #122410In reply to: How to use converter?
Shane Gowland
ParticipantHave you followed the Import Forums guide on the Codex? If so; where did you get stuck?
December 6, 2012 at 5:18 pm #121413In reply to: Why is Forum Index In Bullet Points??
LabSecrets
ParticipantMaking a child theme is beyond the scope of this forum, but there are plenty of good resources if you google “create a wordpress child theme”. In a nutshell, you need “at least” to have a new folder, with a style.css file that references the proper header elements of your parent, including its name and the location of the parent theme’s style sheet.
If you are using the shortcode method, please try the default method instead, which is to change bbPress’s default root slug to something that is “NOT” an existing page (try “sitewide-forums” for example). This will allow you to keep your existing page / shortcut method index. Please show us what happens when you do this? (provide the URL)
December 6, 2012 at 4:36 pm #121409In reply to: Why is Forum Index In Bullet Points??
LabSecrets
ParticipantYou have several issues going on here, but they are directly related to your theme. As is very common, it appears to me that your theme has a conditional statement in the template file that builds archive pages. As such, it’s treating the content for bbPress forums as excerpts, as well as applying some unwanted styling.
Have you tried to build a page using the shortcode method? If so, what was the result? If you found it worked properly, then the issue as suggested above, and you could try to modify your theme or child-theme files to add a similar conditional that looks for bbPress and forces it to use the_content() instead of the_excerpt(). See: https://bbpress.org/forums/topic/non-functional-index-page-when-bbpress-2-1rc4-is-used-with-woothemes-canvas-5-05/
If this page is being built with shortcodes (I don’t think it is from what I see) then what is the result if you try the default forum index method? We outline both methods in our step by step video here: http://labzip.com/the-definitive-guide-to-buddypress-bbpress-configuration/
We’ll get you there… 😉
December 6, 2012 at 4:26 pm #121407In reply to: Add login box to /forum
LabSecrets
ParticipantWhat is your site url? I can give you some suggestions on where to place the code for a login-box so it shows up on the top of a page.
Also, if you prefer, you can build your forum site index using shortcode / page method… this would give you flexibility of having your default theme sidebar, etc. available to you.
Not sure? Check out our updated step by step guide that covers the two methods for creating a forum index page:
http://labzip.com/the-definitive-guide-to-buddypress-bbpress-configuration/
Cheers!
spence
-
AuthorSearch Results