Is there a shortcode to display same thing as the widget used on the support forum, listing all the available forums with post count for each? I am using the forum index widget but this one is only listing the forum names.
I guess I can write some code using bbp_list_forums, then looping over the results and usnig bbp_get_forum_post_count for each one. If there is some sample code out there to do this I’d rather use it too 🙂 Thanks.
Meanwhile I’ve solved the problem myself; it was a just a silly exception, which caused the page not to load wholly. Here’s my solution:
in the /themes/academica/functions/theme/functions.php change this part (lines 143-149):
} elseif ( is_single() ) {
if (!is_attachment()) {
$cat = get_the_category(); $cat = $cat[0];
echo get_category_parents($cat, TRUE, ' ' . $delimiter . ' ');
echo $currentBefore;
the_title();
echo $currentAfter; }
to this:
} elseif ( is_single() ) {
if (!is_attachment()) {
$cat = get_the_category(); $cat = $cat[0];
//support bbPress
if (empty($cat)) {
echo $currentBefore;
the_title();
echo $currentAfter;
} else {
echo get_category_parents($cat, TRUE, ' ' . $delimiter . ' ');
echo $currentBefore;
the_title();
echo $currentAfter;
}
}
That’s it, bbPress now works like a charm! 😉
Cheers!
If this challenge I am having is beyond the scope of help in the bbpress forums, then I understand. The below code is a function that allows the user to submit a search request for a book title via the google books api. When the user clicks “search”, the function works great and returns results in a Jquery window. The problem I am having; it triggers a submit of the bbpress topic, and I get the errors “cannot submit a topic with the subject line blank.”
If there is a simple fix I am not seeing, can someone please help me?
function book_search_google () {
//set API version for Google Book Search API
$v = isset($_POST['v']) ? $_POST['v'] : '1';
//set user API key for Google Book Search API
$key = isset($_POST['key']) ? $_POST['key'] : 'key goes here';
//set user IP for Google Book Search API
//$ip = isset($_POST['ip']) ? $_POST['ip'] : $_SERVER['REMOTE_ADDR'];
//set default value for query to Google Book Search API 0307387941
$query = isset($_POST['q']) ? $_POST['q'] : '0307387941';
//set default value for search type to Google Book Search API
$type = isset($_POST['type']) ? $_POST['type'] : 'all';
//check and assign page of search results - are we on the first page?
$start = isset($_POST['start']) ? $_POST['start'] : 1;
//set default value for number of results
$limit = isset($_POST['limit']) ? $_POST['limit'] : '10';
switch ($type) {
case 'all':
$params = 'q='.urlencode($query).'&startIndex='.$start.'&maxResults='.$limit;
break;
case 'isbn':
$params = 'q=isbn:'.urlencode($query).'';
break;
case 'lccn':
$params ='q=lccn:'.urlencode($query).'';
break;
case 'oclc':
$params = 'q=oclc:'.urlencode($query).'';
break;
default:
echo '<p>You must specify a search type such as "all" or "book". Check the url to make sure "type=" has a value.</p>';
exit;
}
//set URL for the Google Book Search API
$url = 'https://www.googleapis.com/books/v'.$v.'/volumes?key='.$key.'&'.$params.'';
if(isset($_POST['q'])):
//build request and send to Google Ajax Search API
$request = file_get_contents($url);
//decode json object(s) out of response from Google Ajax Search API
$data = json_decode($request,true);
$totalItems = $data['totalItems'];
pagination mainHeading
if ($totalItems > 0) {
?>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>jQuery UI Dialog - Default functionality</title>
<link rel="stylesheet" href="//whosgotbooks.com/jquery/jquery-ui-1.10.4.custom.css">
<script src="//whosgotbooks.com/jquery/jquery-1.10.2.js"></script>
<script src="//whosgotbooks.com/jquery/jquery-ui-1.10.4.custom.js"></script>
</head>
<body>
<div id="dialog" title="Google Books Search Results" style="display:none;">
<script>
$(function() {
$( "#dialog" ).dialog({
height: 550, width: 450});
$( "#returnvalues" ).click(function(){
$( "#dialog" ).dialog( "close" );
});
});
</script>
<strong><p style="font-size: 16px; text-align: center";>Top 10 Results for "<?php echo @$_POST['q']; ?>"</p></strong>
<strong><p style="font-size: 14px; text-align: center";>choose a book to select as your topic</p></strong>
<table style="width:400px">
<col width="325">
<col width="75">
<?php foreach ($data['items'] as $item) { ?>
<tr>
<td>
<strong><u><div style="font-size: 14px";><?php printf($item['volumeInfo']['title'])?></u></div></strong>
<strong>Author: </strong><?php printf( $item['volumeInfo']['authors'][0]); ?><br />
<strong>Published: </strong><?php printf( $item['volumeInfo']['publishedDate']); ?><br />
<strong>Page(s): </strong><?php printf( $item['volumeInfo']['pageCount']); ?><br />
<strong>Publisher: </strong><?php printf( $item['volumeInfo']['publisher']); ?><br />
<strong>Category: </strong><?php printf( strtolower($item['volumeInfo']['printType']).', '.strtolower($item['volumeInfo']['categories'][0])); ?>
<strong>ISBN: </strong><?php printf( $item['volumeInfo']['industryIdentifiers'][0]['identifier']); ?></td>
<td><p><input type="submit" name="submit" value="Select" id="returnvalues"/></p>
<img src="<?php printf( rawurldecode($item['volumeInfo']['imageLinks']['smallThumbnail'])); ?>" />
</td>
<tr><td style="width:420px"><p><strong>Description: </strong><?php printf( $item['volumeInfo']['description']); ?><br /></p></td>
</tr>
</tr>
<?php } }
else {
?>
<p><strong>Sorry, there were no results</strong></p>
<?php }
/* for testing purposes show actual request to API - REMOVE when finished
$apiRequest = $url;
echo '<p>API request: '.$apiRequest.'</p>'; */ ?>
</table>
</div>
</body>
</html>
<?php
else: //show form and allow the user to check for Google Book search results
?>
<p><form id="searchForm" name="searchForm" method="post">
<fieldset id="searchBox">
<label>Search for a Book:</label>
<input class="text" id="q" name="q" type="text" value="Powered by Google" onfocus="this.value=''; this.onfocus=null;" />
<select id="type" name="type" size="1">
<option selected value="all">Book Title</option>
<option value="isbn">Books by ISBN</option>
<option value="lccn">Books by LCCN #</option>
<option value="oclc">Books by OCLC #</option>
</select>
<input class="submit" id="submit" name="submit" type="submit" value="Search" />
</fieldset>
</form></p>
<?php
//end submit isset if statement on line 73
endif;
}
Hi,
To start off, I followed the directions I found here, and I have a child theme set up.
The text and background from my forum are both very white. I’d like to change the background to something darker. Ideally, it would match the look of my widgets, but at this point, I’d take a plain black background.
Here’s my site: http://www.lagsquid.com/forums
Here’s what I’ve been trying:
#bbpress-forums li.bbp-header,
#bbpress-forums li.bbp-footer {
background: #4b8e2c;
}
#bbpress-forums {
margin-bottom: 10px;
border: 1px solid #666;
padding: 12px;
background-color: #000000;
color: #ffffff;
}
#bbpress-forums div.bbp-forum-title h3,
#bbpress-forums div.bbp-topic-title h3,
#bbpress-forums div.bbp-reply-title h3,
#bbpress-forums a.bbp-forum-title,
#bbpress-forums a.bbp-topic-permalink {
font-size: 16px;
color: #0066FF;
}
#bbpress-forums a.bbp-author-name {
font-size: 12px;
color: #75A3FF;
}
Now, as I said, I’d really like to make the background of my forums look like the widgets. I’m not sure, but I think the code is this:
.widget{
margin-bottom: 10px;
border: 1px solid #666;
padding: 12px;
background: url('images/footer-bg.png') repeat left top;
}
Only, I can’t seem to get url('images/footer-bg.png') repeat left top; to work. Any help would be appreciated!
My apologies if this doesn’t make any sense as it’s 2am and I’ve been working on this for quite a bit 😛
Pete I’d really like to use both.
Is it difficult to edit the plugin code and change the short code name?
Hi, thanks for trying out my plugin – I hope you enjoy using it. But sorry yes you are right; any two plugins that use the same shortcode are never going to work together. I trust you can figure out which of the two you want to continue using.
Regards,
Pete
@shpitzyl Thanks for sharing your code, now I need to come up with a way to keep and organize all these snippets of code…
@batmanfan Instead of making this second user a ‘keymaster’ you should make them a ‘moderator’ and this will disable the backend access for you.
Look at the docs here on what each role can and cannot do by default
https://codex.bbpress.org/bbpress-user-roles-and-capabilities/
There’s probably a plugin for it but I would cheat and make an email address that forwarded to all of the email addresses I wanted. I’ve had a couple of email customisation plugins fail over various updates, so I don’t have any to recommend!
Otherwise, the new user notification emails are pluggable functions which means that you need to override them in a plugin. The function in question starts at line 1569 here: https://github.com/WordPress/WordPress/blob/master/wp-includes/pluggable.php
Don’t edit that code – it will get overwritten in a future update – that’s just the function that you would use to make your own plugin (or what any plugin that does it will use).
Can anyone help on this wp-modal plugin?
http://codex.bbpress.org/modal-login-in-a-menu/#%c2%a01-install-wp-modal-login
I managed to follow the set up instruction all ok and can see the login/out pop up and can login ok. But can’t register new user! after entering new username/email and click ‘signup’ it’s reading…’checking credential’ and then back to register page again, nothing happens.
What have I done wrong?
Sure – this is what I did on a test install. The current menu item class in mine is “current-menu-item” and I added a custom class “forum-class” to the forum menu item in my custom menu. I *always* forget that I need to unhide the css class input by ticking the box in “Screen options” at the top of the “edit menus” screen in admin. You probably don’t but I thought I’d mention. 🙂 Then I use that for the jQuery.
So:
1 – add “forum-class” to your forums menu item in your custom menu
2 – add this to your js file with YOURURL = the url of your site and forums = your forums slug :
$(function() {
var forumURL = window.location.href.indexOf("YOURURL/forums/");
if(forumURL > -1){
$('li.forum-class').addClass('current-menu-item');
}
});
nb: addClass won’t add duplicate classes so no need to test if it’s already there.
Thanks for your attention.
I have copied the template (fullpage.php), renamed to (bbpress.php) and put into the root.
But, the sidebar shown, because calling code of sidebar in the “footer.php” template.
And when i delete the calling code of footer from bbpress.php i have lost all plugins (counters in footer) which shown in the bbpress.php page.
Thanks in advance.
My ites forum: http://med.gn24.net/forum
Shortcode support now added to 0.4.
I’ll have a look at some of the other points above. I’ve begun working on 0.5!
* Visit Admin > Users
* Tick the box next to your account
* Use the right-most drop-down and select “Key Master”
* Save the page
I’ll note again that under normal circumstances this should happen automatically when activating bbPress. Sorry it didn’t, and I’m curious to know any other plugins you may have installed (to see if there’s some conflict with one of them that prevented this.)
Thank you so much, tharsheblows! And your answer is very helpful to me.
I also suppose your method is the right choice than the former which has a flurry of IF statements. Could you post your code for me, please?
Thanks again. 🙂
You can take out <?php bbp_forum_subscription_link(); ?> in content-single-forum.php . I have a bbpress directory in my theme (eg mytheme/bbpress/) where I’ve copied the entire default template and those files overwrite the default theme which I got from templates/default/bbpress in the plugin.
So you’d have something like yourtheme/bbpress/content-single-forum.php. I’m looking at this https://codex.bbpress.org/theme-compatibility/step-by-step-guide-to-creating-a-custom-bbpress-theme/ and getting confused but I have a feeling you’ll work it out! Anyway, that’s where that code is.
Thank you, where do I insert this code though. I’m new to this whole wordpress thing.
For the topics archive showing all topics, you can use the shortcode [bbp-topic-index] on a normal WordPress page.
“All replies” is slightly different. You could use the Recent Replies widget (https://codex.bbpress.org/widgets/) if you had a page with a widget for the content but if you wanted a proper archive page, I think you’d have to make a new template for it. I think it’s one of those things that if enough people ask for it, it might get prioritised for future versions but that’s just a guess. If you are comfortable making page templates, I can post how I did a “latest posts” page (posts = new topics + replies).
I’m not sure what part of the menu you mean, I’m sorry. Do you mean how “support” (with a link to /forums) is highlighted above even when you’re on a topic page? They use a custom nav file:
https://meta.trac.wordpress.org/browser/sites/trunk/buddypress.org/public_html/wp-content/themes/bb-base/header-nav.php
If I were trying to replicate that, I would use jQuery to add the current-menu-item class to the top forums list item – not that it’s is the right way to do it, it would just be the easiest for me to do and to maintain. You’d need to add it to a javascript file in your template or make one and then include it. If you’re interested, I can post that code – you will need to add a custom class to your forums menu item too.
Sorry, I know that wasn’t too terribly helpful!
From bbPress.org:
bbp_reply_author_link( array( 'sep' => '<br />', 'show_role' => true, 'size' => 100 ) );
To set a good expectation, these forums move relatively slowly. If you’re anxious about replies to this topic, tick the “Notify me” box and you’ll get an email when someone replies without the need to bump the topic.
What are some options that serve the same function as these two buttons and that don’t require custom code? What plugin will I need? Thank you.
I’ve been looking through code and settings for a few hours now.
I actually found that I can manually set topics to private by editing their visibility in the dashboard. This provides the exact functionality I need, other than it being manual. Is there anyway to let users set their topics as private when they publish them? Or automatically set topics in a certain forum to private?
Hi,
I’m running a WP site along with bbPress and BP. My problems began when I accidentally disabled bbPress and enabled it back again. From then on TinyMCE shows a blank space, no buttons and visual/text tabs are just dead, so users can hardly post a new topic.
I’ve tried nearly every possible trick known to man (cache, plugins, code lines..) but after 6~7 hours of failure I’m exhausted and frustrated. And what’s even worse: now the login bar (on top) and Twitter widget aren’t visible unless I (you) log in. Both were visible before the incident.
I hope anyone can help me sort this thing out. I’m not exactly an expert, so please keep that in mind before telling me what to do. Thanks in advance.
I’m using:
WP 3.8.1
bbPress 2.5.3-5249
my site: grafiscopio.com
Note: bbpress content is restricted for non-registered visitors
I would like users to be able to create a topic inside the applications forum, once the topic is published only the user who made it and admins can view it.
After some more searching I’ve found;
http://codecanyon.net/item/bbpress-private-content-wordpress-plugin/6390878
This is essentially what I would like but to do, but would have it auto enabled inside the applications forum.
Start here https://codex.wordpress.org/Editor_Style
Then here https://codex.wordpress.org/Function_Reference/add_editor_style
There are also quite a few WordPress plugins that will do the ‘PHP’ part for you, creating the correct functions and the like and you then just add the CSS you want.
Robin,
I am not exactly sure what you mean here. I do know what the permalink for the forum is and /forums/ is part of it, but it doesn’t end the permalink. This is the permalink, with the website and forum name made generic for posting purposes:
http://www.mywebsite.com/forums/forum/ourgroup/
Is the second “/forum/” the issue? If I change this now, after many months, won’t this mess things up like bookmarks, menu links within the site and google records? There are three forums under /forums/ with different names.
The topic that the person would like to reply to is this (a topic she started on a desktop):
http://www.mywebsite.com/forums/topic/needadvice/#post-3735
To repeat, she was able to start topics and reply to topics in the text field prior to the ios upgrade. I guess I don’t understand how the permalink is conflicting with the display of the keyboard when she wants to enter text in the form on the page.
I do understand that js probably plays a role in how taps and drags operate on tablets and phones. In this case these are not triggering the code to display a keyboard but I wouldn’t know where to look for that code and determine what the issue is. Is it a general theme function or is specific to bbPress forms?
my best, matoca