Search Results for 'code'
-
AuthorSearch Results
-
March 23, 2014 at 3:01 pm #143984
In reply to: How return Login Page for Private Forum request?
Robin W
Moderatorok, quick solution for you
This solution
-
uses the restrict content plugin to create a login prompt if the user is not logged in
-
sets the forums to private so that they are not seen on the main index
-
creates a page just for that private forum, which the restrict content plugin can then use to display the need to be logged in message and login boxes
It does rely on you setting your users to at least wordpress subscriber level – as the plugin only works on wordpress levels, but that should be fine for most uses.
1.Install “restrict content” plugin
Dashboard>plugins>add new
search for “Restrict Content” and it’s then one called just that
Install and activate
2. go into dashboard>settings>restrict content and add the following text (you can tailor it to say what you want) to all the options
Sorry, you need to be a member to see this area. Login if needbe [bbp-login]
3. Go into Dashboard>forums>whichever forum and change to visibility ‘private’. This will stop thisn forum being seen in the main index unless logged in, so we’ll need to add a menu item later on so not logged in users can see it
4. Find out the ID of the forum you have set to private
This link shows you how
http://www.authorcode.com/forums/topic/how-to-get-forum-id-in-bbpress/
5. Create a new page called whatever eg “free speech forum”
and put the following code into it
[bbp-single-forum id=2922] where the id number is the number that you found out in 4. above
6. Within this page you’ll also see below the main text you’ve just entered a new box called “restrict content” set this to subscriber (or higher if you’re really restricting).
7. add this page to your menu’s if need beIf a user is logged in, and sleects the menu item, they’ll just go straight into the forum.
If they are not logged in and select the menu item, they’ll get the message you set up in 2. above together with the login boxes and having logged in will see the forum
give it a go, and come back if anything is not clear
March 23, 2014 at 2:33 pm #143983In reply to: Putting the @username below name
Robin W
Moderator@palmdoc – can’t see anything wrong with teppom’s code and just double checked by loading it.
Check that you have added it correctly to your functions file.
March 23, 2014 at 7:54 am #143972In reply to: bbPress not formatting properly
Stephen Edgar
KeymasterTo fix the ‘subscribe’ link add this to your themes
functions.phpfile or yourbbpress-functions.phpfile in your theme directory.To change from
Home › Forums › My ForumSubscribe
To change toHome › Forums › My Forum (Subscribe)function ntwb_forum_subscription_link( $args ) { $args['before'] = ' ('; $args['after'] = ')'; return $args; } add_filter( 'bbp_before_get_forum_subscribe_link_parse_args', 'ntwb_forum_subscription_link' );If you don’t want to add it manually add it to your
functions.phpfile grab the entire file here and add it as a standalone plugin to your WordPress install.https://gist.github.com/ntwb/7686980
I’m not sure/clear what you mean for your ‘freshness’ issue, can you post a screenshot or link to your site please 🙂
March 23, 2014 at 4:10 am #143968In reply to: Remove “Published By” on main forum page
Stephen Edgar
KeymasterThat actually appearing from your themes template and not bbPress’ templates.
If you open up your
page.phptemplate of your theme (Or whatever the primary temmplate is) you will see something similar to this code:<div class="entry-author-meta"> <p class="author-name">Published by <span class="author vcard"><a class="url fn n" href="#" title="#">#</a></span> </p> <p class="author-description"> </p> </div>Now make a copy of your
page.phptemplate (or again the main template your theme uses) and rename the this tobbpress.phpopen up thebbpress.phpin a text editor and remove the section of code that I listed above.bbPress will now use this template rather that your themes default template.
March 22, 2014 at 8:08 pm #143964In reply to: Phorum Import to bbPress
Stephen Edgar
KeymasterNothing in particular except to say that if Phorum has weird/custom BBCode that they won’t be converted standard BBCodes like [b], [url], [img] etc will be converted.
Also I don’t think the passwords will be converted so it is just a matter of the user requesting a password reset to get up and running after the conversion.
I’d also suggest you do this on a test server (local or remote) to get used to the process before you try this on your live server, that way any bugs issues etc will be sorted out first.
Are you talking thousands, tens of thousands, hundreds of thousands, millions of posts?
March 22, 2014 at 10:39 am #143956In reply to: Putting the @username below name
TeppoM
ParticipantThanks for the thread. Based on this I managed to develop a solution that does not require hassling with the template files. Just add this to function.php in your theme:
/** * Add @mentionname after bbpress forum author details */ add_action( 'bbp_theme_after_reply_author_details', 'mentionname_to_bbpress' ); function mentionname_to_bbpress () { $user = get_userdata( bbp_get_reply_author_id() ); if ( !empty( $user->user_nicename ) ) { $user_nicename = $user->user_nicename; echo "@".$user_nicename; } }March 22, 2014 at 8:12 am #143953Topic: Child theme doesn’t work
in forum Themesbeinar
ParticipantI have created a child theme to my Twenty Eleven theme and it is active. But when I want to do changes by inserting code right under the code sector that ends with:
……
@import url(“../twentyeleven/style.css”);it does not take action.
For instance, I want to change the font size in a bbPress forum by putting in:
#bbpress-forums .bbp-forum-info .bbp-forum-content,
#bbpress-forums p.bbp-topic-meta {
font-size: 18px;
margin: 5px 0 5px;
padding: 0;
word-wrap: break-word;
}but nothing happens.
What is wrong?March 21, 2014 at 5:18 pm #143944Robin W
Moderatorforum descriptions do not show on the forums index page.
I’ll try and come up with some code to do this sometime next week
if I fail, post a further response to remind me !
March 21, 2014 at 4:10 pm #143942Magic-Komplex
ParticipantHi,
I’m quite new to bbpress and trying to set up a forum. Now there’s a problem, the forum description is only shown at the single forum pages (after I edited the code using the bbpress documentation), but it’s not shown on the main forum index page, although the documentation says it has to be.
Look for yourself, but please be nice, it’s still under construction and looks like a mess:http://www.thespiritualpath.de
Could anyone help me please? I’m able to alter code if I have a template, but I’m not a programmer, so please try to explain what to do for beginners. 😉
I forgot to mention, category descriptions are shown, but not forum descriptions.
Thanks in advance.March 21, 2014 at 3:40 pm #143941In reply to: Delete Topic Function
gjwarez
ParticipantHey Robin,
I add the line in this php file location
wp-content/plugins/bbpress/includes/core/capabilities.php// Participant/Default case bbp_get_participant_role() : default : $caps = array( // Primary caps 'spectate' => true, 'participate' => true, // Forum caps 'read_private_forums' => true, // Topic caps 'publish_topics' => true, 'delete_topics' => true, 'edit_topics' => true, // Reply caps 'publish_replies' => true, 'edit_replies' => true, // Topic tag caps 'assign_topic_tags' => true, ); break; }In this case the delete_topic does not work,
if i put delete_others_topics there it will work for all users.March 21, 2014 at 2:33 pm #143935In reply to: Where to go for bbPress PHP help?
Robin W
ModeratorI think you need to seriously consider taking some anger management classes.
bbPress is free, it costs you nothing, is developed and maintained by a bunch of nice guys who do this for free, and is supported on this site by more nice guys who again do it for free.
If you cared to read to documentation instead of just hurling abuse at us, you’d find fixes or tools that would let you alter what you are complaining about for instance the inline list is discussed in
and turning off the counts inBecause bbPress is flexible and all of what is displayed can be altered with either a little php or in many cases a plugin.
However in your case I’d simply suggest that you find different forum software and annoy someone else, rather than whinging on this support forum.
March 21, 2014 at 2:00 pm #143933In reply to: Recent topics widget – how to add forum url to title
Robin W
Moderatorok, without me spending hours digging into this, let’s see if we can sort it.
and yes you can cut the code into a functions file by renaming it, but we’ll fix that later.
For the moment, where are you registering the new sidebar? In a main theme for a child theme?
If in a child theme, they won’t register as sidebars have already been loaded. So you need to unload and reload them all in one go (no idea why, it’s just what I learnt when I tried to add a sidebar in my child theme.)
so what my child theme functions file starts with is
remove_action( 'widgets_init', 'twentyten_widgets_init' ); //necessary to replace parent theme's code which is a twentyten theme function twentytenchild_widgets_init() { // Area 1, located at the top of the sidebar. register_sidebar( array( 'name' => __( 'Primary Widget Area', 'twentytenchild' ), 'id' => 'primary-widget-area', 'description' => __( 'The primary widget area', 'twentytenchild' ), 'before_widget' => '<li id="%1$s" class="widget-container %2$s">', 'after_widget' => '</li>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>', ) );so it starts by removing the twentyten sidebar’s and then adds them straight back – my child theme for the twentyten main theme is excitingly called “twentytenchild”!. I have just shown the first widget from the parent theme, all are just copied from the parent theme. Several others follow
Then on the end you add your new sidebar.Then after that you complete and register them viz :
//** Register sidebars by running twentyten_widgets_init() on the widgets_init hook. */ add_action( 'widgets_init', 'twentytenchild_widgets_init' );by the by in your after title you need to change the a/ to /a
Give that a go, and come back if it works, and we’ll then talk about taking the widget into a custom one.
March 21, 2014 at 7:24 am #143926Topic: Recent topics widget – how to add forum url to title
in forum Troubleshootingforwardslashdesigns
ParticipantHi,
Title says it all really. I am trying to customise the recent topics widget; using it to display topics from a specific forum; and I would like the title to link to the forum from which the topics are from.
I have registered a sidebar for this in my functions.php file and I’ve tried the following code, but it doesnt work as its not adding the URL into the title:
register_sidebar( array( 'id' => 'forumcontent', 'name' => __( 'Forum Home Content - Colleges', 'textdomain' ), 'description' => __( 'A short description of the sidebar.', 'textdomain' ), 'before_widget' => '<div id="%1$s" class="widget-topic-list %2$s">', 'after_widget' => '</div>', 'before_title' => '' . apply_filters( 'bbp_get_forum_permalink', get_permalink( $forum_id ) ) . '<h3 class="widget-title">', 'after_title' => '</h3><a/> <br class="clear"/>' ) );I am trying to create something similar to this: http://postimg.org/image/55qwbgoe3/
I am currently editing the the bbpress/includes/common/widgets.php file directly which I know is a BIG NO NO! and I should create a custom widget for this, but I am not really sure how to!
I am currently using WordPress v3.6 and Bbpress v2.5.3
Thanks
March 20, 2014 at 9:49 pm #143923In reply to: Where to go for bbPress PHP help?
Stephen Edgar
KeymasterWow! On the front page of bbpress.org and everywhere we mention bbPress:
"bbPress is forum software, made the WordPress way."bbPress is not like all other forums, it was not made to be like other forums, it was made the WordPress way allowing for customized functionality by plugins and/or themes.
So maybe you should post on http://jobs.wordpress.net/
March 20, 2014 at 3:40 pm #143919In reply to: Use WordPress Page instead of Forum Root
Robmcclel
ParticipantRobin,
Thanks for getting back to me, I’m sorry I was less clear.
The WP page is real and live, and it does work. The issue is, the Index page is still there — I can’t seem to replace it with the WP Page. Breadcrumbs become meaningless, as the forum source will be the Index Page not the WP Page.
The shortcodes allow me to organize the forums but still keep the sub (Genre) and sub-sub (subgenre) forums visible. For example, the “Mysteries, Suspense, Thrillers” genre has the sub-genre “Detectives”. On the WP/Shortcode page you can see that. On the Index Page you can’t.
To change the Index Page takes considerable effort, if it can even be done at all (we have yet to be able to do so, though we can make it better looking). The WP/Shortcode Page, however, is exactly how we want it. The problem is that page competes and cross-connects to the Index Page.
I want to get rid of the Index Page — for real, or for practical purpsoes — so that it is never seen, linked to, or interacted with by a user. Period. ever.
Failing the ability to remove the Index Page from the equation, I would like to modify it so that it looks and acts very similar to the set-up the WP/Shortcode Page provides.
Bottom Line: I want the various descriptions, genres, and subgenres visible to the user from the main forum page they would see and interact with, without any confusion or conflict by any other page or index.
March 20, 2014 at 7:05 am #143902In reply to: SimplePress Import
Stephen Edgar
KeymasterThere we go, that indeed will be the issue.
Essentially after the forum hierarchy is calculated it starts importing the topics (though that’s the last message you see)
We use a custom ‘bbcode’ parser to convert the imported forums BBCodes eg. [url], [b], [img] etc.
So if you are using a plugin that is doing something with BBCodes it’s a high probability that that is the conflict.
Disable said plugin and you should be good to go and/or if you don’t know which plugin it is disable them all, do your import, then enable your plugins again.
March 20, 2014 at 7:01 am #143901In reply to: SimplePress Import
matrixino
ParticipantOk found the problem. The WP plugin Boingball BBcode was using the same class name.
I’m importing now and went to the next step. Finger crossed 🙂 Thanks for your timeMarch 20, 2014 at 6:59 am #143900In reply to: SimplePress Import
matrixino
ParticipantWP 3.8.1 – SP 5.4.1 (but also isn’t working with 5.4, i just upgraded when trying to fix this) – BBP 2.5.3
I’m working on a duplicate copy of my wp db (I always do a test run before working on live site).However I just noticed this error in my php logs:
“PHP message: PHP Fatal error: Cannot redeclare class bbcode in /wp-content/plugins/bbpress/includes/admin/parser.php on line 979” while reading response header from upstreamSo I think some other plugin (or maybe wp itself?) is declaring that class already. I’m going to debug this now.
March 20, 2014 at 4:11 am #143887In reply to: Delete Topic Function
Robin W
Moderatorthere are two capabilities within bbpress roles
‘delete_topics’
‘delete_others_topics’Looks like the plugin is changing the wrong one.
I presume it is the participant role that you like delete topic on ?
If so, please come back and confirm, and I’ll cut a quick filter for you after the weekend if you know how to add some code to your functions file.
March 20, 2014 at 4:04 am #143884In reply to: How to remove IP addresses from bbPress?
Robin W
Moderatorif it worked before, then something has changed.
If you want to stop it using the template then create a ‘bbpress’ folder in the root of your theme, and copy
wp-content/pluigins/bbpress/templates/default/bbpress/loop-single-reply.php across to this new folder.
The edit to remove the code that displays this – lines 47 to 55 have an if(keymaster) statement that display this info
March 20, 2014 at 3:57 am #143883In reply to: Use WordPress Page instead of Forum Root
Robin W
ModeratorOk, so if I understand you problem correctly, what you’d like is the main forum page to show is
1.
Category
Forum
Subforum
forum
subforumThe subforums are not currently showing?
and
2. for each to have a description?
you are trying to achieve this by using a wordpress page and shortcodes.
What confuses me is that you give a link to the page you want to use – if this is a real page, then what is preventing you form using it?
Sorry if I’m not understanding you correctly
March 20, 2014 at 3:08 am #143874Topic: Use WordPress Page instead of Forum Root
in forum TroubleshootingRobmcclel
ParticipantMy objective is to not use the standard forum root index page that is auto-created and instead use a WordPress page with forum shortcodes.
The auto-generated forum root page is here: http://thirdscribe.com/cafe
and I would much rather use this page here: http://thirdscribe.com/cafe-forums
I have not had any success in customizing my root from the settings panel where it says: “Customize your Forums root. Partner with a WordPress Page and use Shortcodes for more flexibility.”
Failing the ability to use the WP page with shortcodes, I would like for the sub-sub forums to be shown, as well as the text descriptions for everything, in the root index. This forum supports a book network, and to have the subgenres showing under the genres is pretty important. Again, I would prefer to just use the page generated using the shortcodes, but I’ll accept just getting the subgenres and descriptions to show.
This is my first time using bbPress — I like it and like the back end administration, but I REALLY need to be able to show more information on this forum page.
I am running WP 3.8.1, Buddypress 1.9.2, and bbPress 2.5.3
Any help or suggestions appreciated.
March 20, 2014 at 1:32 am #143870In reply to: SimplePress Import
Stephen Edgar
KeymasterI was on Simple:Press v5.3.4 and have just now upgraded to v5.4.1
Tested the current bbPress v2.5.3 import using the SimplePress5 importer and everything worked fine.
Repair any missing information: Continue Conversion Complete No reply_to parents to convert Converting replies (0 - 99) No tags to convert No super stickies to stick Calculating topic stickies (0 - 99) Converting topics (0 - 99) Calculating forum hierarchy (0 - 99) Converting forums (0 - 99) Delete users WordPress default passwords (0 - 99) Converting users (0 - 99) Starting ConversionThis is the SQL query that runs the step you are stuck on:
SELECT post_id AS value_id, meta_value FROM sp_postmeta WHERE meta_key = '_bbp_forum_parent_id' AND meta_value > 0 LIMIT 0, 100This shouldn’t really cause any issues, worst case scenario you no longer have your forums grouped in their previous hierarchal structure.
The only other thing I can think of is maybe a SimplePress plugin/extension may have modified the database setup beyond the basic ‘out of the box’ setup I use.
You could also try reordering your SimplePress forums to force an update of their values in the database. Also try removing the forums from the groups and delete the groups. You can easily add the groups/categories again on the bbPress side once the import is completed successfully.
March 19, 2014 at 6:40 pm #143851In reply to: Topics Do Not Appear Under Forum Title
aidibiomed
ParticipantHello: I’m running into the same issue. I’ve created a Page and used the Index Short Code, Created a Forum, and a Topic. I can see the forum, just not the topic. And when I try to access the link it sends me to a 404 error.
March 19, 2014 at 12:10 pm #143840In reply to: Misunderstanding: buddypress groupforums usage
jyd44
ParticipantHi,
your initial question was about replies. In fact, you have exactly the same issues for posting, reading, and so on. You have to use the same kind of trick for every action you want to block.
The best way to find which filter is key to control an action, is to start from the template files, to see which bb_call is made, read the source code of this function and discover which filter is applied. It’s the same also for the buddypress menus (either in the admin bar, either in the body of the page), depending on your requirements (eg. Do you allow a non member to discover the list of member in a group, and so on.)
Yes it’s a huge job. When you complain about the way the access control in bbpress is handled, remember that I told you before that blocking the access to replies will not be the only one issue you will have to face. With roughly the same requirements, I have written more than 1800 lines of code (including comments !) to tune the menus and to refine the access control rules. Fortunately, thanks to the filter and action mechanism of WP and the goodwill of their developpers, bbPress and BuddyPress offer many possibilities for this tuning. -
AuthorSearch Results