Search Results for 'code'
-
AuthorSearch Results
-
January 27, 2013 at 10:40 am #125626
Topic: Provide custom info with shortcodes
in forum TroubleshootingGiannis Giaou
ParticipantHello everyone.
I would like to know if its possible to provide custom information with shortcodes.
For example i made a static homepage with [bbp-forum-index] shortcode in there,
is it possible to provide only the Topics & Posts counts and not the Freshness information?
Thank you in advance.
January 27, 2013 at 1:54 am #125618Topic: Still can't get a forum tab
in forum Installationweboozle
ParticipantClean wordpress, buddypress and bbpress install (again) and I still can’t get a ‘forums’ tab on the site.
I know this is an extremely basic step, and I’ve spent hours and several re-installs to attempt the ‘forums’ or ‘forum’ or ‘board’ or anything tab to link to a sitewide forum.
I’ve never understood the heirarchy of wordpress (obviously) but I seem to always manage. This one is really has me. I can directly navigate to it in the browser but all I can ever get is a blank page when any tab might appear.
I’m also aware that this isn’t listed in the bbpress codex since I’m sure it’s on page 2 of beginning wordpress.
Any help? Many thanks in advance.
January 26, 2013 at 7:27 pm #125610In reply to: Register for forums
Lynq
ParticipantIf you need to create a register page, then you can add a new page via wordpress and then put this shortcode inside it: [bbp-register] – this will allow people to register for the forum.
January 26, 2013 at 5:55 pm #125601In reply to: Link Forum to WP Page
Stephen Edgar
KeymasterA couple of options:
- Add a link in your menu to http://www.amanofreason.com/forums/
- Add some widgets to your sidebar https://codex.bbpress.org/widgets/
- Add some shortcodes to your WP pages https://codex.bbpress.org/shortcodes
January 26, 2013 at 1:56 pm #125590In reply to: TinyMCE plugins does not work with bbPress
Michael
ParticipantOkay, I think I figured this out on my own, though I don’t quite have the list of usable html matching what the default TinyMCE editor offers. I’ll have to play with that separately.
What I did was add a function in my functions.php file that changed the allowed markup for all bbPress (and blog) posts to include what I think is a reasonable list AND is still safe. I’ve added the IMG tag as well — for my Forum that’s a useful feature, and I’ll just have to monitor what people post in terms of image links.
Here’s the code I added to my functions.php file:
add_action('init', 'my_html_tags_code', 10); function my_html_tags_code() { define('CUSTOM_TAGS', true); global $allowedposttags, $allowedtags; $allowedposttags = array( 'p' => array( 'style' => array()), 'strong' => array(), 'em' => array(), 'i' => array(), 'del' => array(), 'h1' => array(), 'h2' => array(), 'h3' => array(), 'h4' => array(), 'h5' => array(), 'hr' => array(), 'blockquote' => array(), 'q' => array(), 'pre' => array(), 'span' => array( 'style' => array()), 'div' => array( 'style' => array()), 'ul' => array (), 'ol' => array ( 'start' => array()), 'li' => array (), 'a' => array( 'href' => array (), 'title' => array (), 'rel' => array()), 'img' => array ( 'src' => array(), 'width' => array(), 'height' => array(), 'alt' => array()) ); $allowedtags = array( 'p' => array( 'style' => array()), 'strong' => array(), 'em' => array(), 'i' => array(), 'del' => array(), 'h1' => array(), 'h2' => array(), 'h3' => array(), 'h4' => array(), 'h5' => array(), 'hr' => array(), 'blockquote' => array(), 'q' => array(), 'pre' => array(), 'span' => array( 'style' => array()), 'div' => array( 'style' => array()), 'ul' => array (), 'ol' => array ( 'start' => array()), 'li' => array (), 'a' => array( 'href' => array (), 'title' => array (), 'rel' => array()), 'img' => array ( 'src' => array(), 'width' => array(), 'height' => array(), 'alt' => array()) ); }January 26, 2013 at 12:54 pm #125589In reply to: TinyMCE plugins does not work with bbPress
Michael
ParticipantI’ve noticed this problem as well.
I’m running WP 3.5.1 and bbPress 2.2.4. My bbPress area is here: http://www.dalluva.com/member-area/forums/
When a non-Admin user attempts to post a Topic or Reply using the Visual mode (built-in TinyMCE support), they’re led to believe that they can use do things like create ordered/numbered lists, etc.
The visual editor does show it, but when they Submit it, bbPress strips this out.
No surprise there: while the visual Editor bar shows these editing capabilities, the little box below the editor that says “You may use these HTML tags and attributes:” doesn’t list ol, ul, li etc. Doh!
I noticed that posting to this bbPress site, it shows in the little box that I can use ol, ul, li, and it does work.
QUESTION: How can I expand the available HTML tags and attributes (ideally without hacking the bbPress code) to include other tags like ul, ol, li, br, hr, etc?
Thanks.
Michael
January 26, 2013 at 6:52 am #125579Topic: How to get a list of forums
in forum Pluginsaberglas
ParticipantI just want a simple list. I tried
$forums = get_posts( array( ‘post_type’ => bbp_get_forum_post_type(), ‘numberposts’ => 99 ) );
But that does not return private posts. (Digging into get_posts is a huge maze of code.)I was hoping just to use the Admin All Forums code as a guide, but I cannot find it! What in BB Press generates that form?
Thanks,
Anthony
January 26, 2013 at 6:33 am #125578In reply to: Importing Mingle Forums into bbPress?
Stephen Edgar
Keymaster@jiapei100 From the codex docs https://codex.bbpress.org/import-forums/#getting-there
- Log in to your WordPress Admin Dashboard
- Select the ‘Tools’ tab select ‘Forums’ from the navigation menu
- Select the ‘Import Forums’ tab at the top of the screen.
You then need to follow the next steps in the docs linked above for your settings.
Don’t forget to read the docs on Mingle and let us know any issues you find.
https://codex.bbpress.org/import-forums/mingle/January 26, 2013 at 1:57 am #125566In reply to: Vanilla 2 Converter
brokentwig
ParticipantYeah, I think your right. I think we should just leave the `from_expression’ => ‘WHERE User.Deleted = 0′` out completely. It would just orpan items anyway. I pulled my notes from the doc. With all that said, I’ll download the Vanilla.php you posted in the codex and give her a run on my test server. I think she’s done.
January 26, 2013 at 1:48 am #125565In reply to: Vanilla 2 Converter
Stephen Edgar
KeymasterThanks for adding that to the codex, I am not sure we should go that route though, I think we should not advise anyone to modify their existing forum directly with SQL. I think we are better off stating that all users including banned and deleted users are imported into WordPress and after importing you should manually delete these users through the WordPress Users admin panel.
As to the correct code/syntax for the password, honestly I have no idea! Give me a code example and I can hack around and make stuff work but code from scratch I am at noob level 😉
I started learning PHP when I started playing with bbPress not that long ago and along with WordPress they are my only PHP learning resources and a testament to @johnjamesjacoby coding with awesome inline docs.
With all that said though I think it would probably be best if you want Facebook, Twitter, Google, Yahoo, OpenID etc etc logins for WordPress/bbPress it will be much easier to install one of the many WP plugins that offer this. Then have the end users link their existing user profile to Facebook, Twitter or whoever, otherwise there will be all sorts of values we are trying to migrate from Vanilla to support a vast array of different user plugin implementations that are available for WordPress.
January 26, 2013 at 1:39 am #125564In reply to: Vanilla 2 Converter
brokentwig
ParticipantMaybe it will work the way it is. Users who login via some other method still have thier username and email stored in the User table and are for all intents and purposes a “User”. Our converter will convert whatever is in the Password blob, but it won’t match thier 3rd party password (I tested it). These users will need to use the password reset in WP to fix this. I think either you can add this to your codex, or I can make a note at the bottom indicating some users will need to reset thier passwords, so maybe a mass email notifying users of the change will handle it. I don’t think there’s anything we can do with the converter to solve this.
January 26, 2013 at 1:04 am #125560In reply to: Vanilla 2 Converter
brokentwig
ParticipantI’m not 100% confident “Banned” are Role 1, and “Confirm Email” are Role 3 on all Vanilla databases. Due to the complexity, I think it should be left out. I posted my SQL queries in your codex codes under the “Notes” section. Feel free to tweak my comments to your style.
Maybe you can help me with the password checker. It looks like I can reference the entire record row using the callback methods in the converter code. I just don’t know what to do if the password type isn’t a Vanilla password. What is the proper action here, and is this code/syntax correct?
` public function callback_cleanpass( $password, $row) {
if ($row[‘HashMethod’] == ‘Vanilla’) {
return $password;
} else {
return ?????;
}
}`January 26, 2013 at 12:23 am #125556In reply to: Vanilla 2 Converter
Stephen Edgar
KeymasterThe docs are now up also,
@brokentwig Key changes from your great work getting this started- Topic tags are now included
- Once bbPress core converter is updated we can filter the users imported
- Added Topic Closed Status
- Inline docs consistent with other importers
- Whitespace and code formatting improved
- Uses parser.php to convert HTML & Smilies
- Reply status not needed, defaults are built into converter.php
- Reply Order removed, this is calculated during the import
The to do list:
- Remove the `callback_savepass` & `authenticate_pass` as you rightly point out they are not needed and Vanilla uses the same hash as WordPress for passwords so this is too easy.
If you see any bugs with the converter `Vanilla.php` please post these to the trac ticket here.
If there is anything else that needs doing before or after the import that I have not already listed in the codex docs if you could add/update these that would be great.
https://codex.bbpress.org/import-forums/vanilla
(Use the same bbpress.org username and password to login)January 25, 2013 at 11:54 pm #125554In reply to: Vanilla 2 Converter
Stephen Edgar
KeymasterIntroduce Forum Importer template for use with importing from Vanilla 2.0.18.1
bbPress Core Trac Ticket: https://bbpress.trac.wordpress.org/ticket/2179
Codex Docs: https://codex.bbpress.org/import-forums/vanilla/
January 25, 2013 at 11:38 pm #125551In reply to: Vanilla 2 Converter
brokentwig
ParticipantThat’s great your including it in the core. I put the filter back in the Users section that excludes the Deleted users and updated the Gist again. That filter worked, the UserRole join was what we were jacking with up above; never got that to work.
One thing left to do:
1) Passwords with a type of Vanilla are the same hash that WP uses, so they convert over nicely. Vanilla allows you to integrate a user with Facebook, and some other systems. I didn’t have any of those users, but some kind of call-back would need to be built for it. Also, this converter includes some password functions at the bottom, but I don’t think it’s used.
Outside of that, I got a perfect conversion from this one. I would also be happy to post the SQL code I used to clean up the User table, and also SQL code I used to move posts from Vanilla Users that already existed in WP (Admins and authors).
January 25, 2013 at 11:28 pm #125550In reply to: Vanilla 2 Converter
brokentwig
ParticipantJack,
You can try this one, it’s works for me. A couple notes, I didn’t finish the “Tags” section because I don’t have any tags in my Vanilla Forum. Also, I didn’t have any child Categories, but the converter “should” work for parent/child Categories. I also removed the code that excludes Deleted and Comment Email statuses, so those will get imported.https://gist.github.com/4591432
I have a full test server setup however, and would happy to help tweak this converter so it works for you.
January 25, 2013 at 11:26 pm #125549In reply to: Vanilla 2 Converter
Stephen Edgar
KeymasterI have made quite a few tweaks 😉
You can see the revisions I made up until last night here
https://gist.github.com/4633175/revisions
(It is a fork or your gist with my changes)I have just added ‘topic tags’ and just cleaning up the code ready to submit for bbPress core 😉
What else have you changed? If you update your original gist, I can look at any differences and merge those also.
January 25, 2013 at 3:07 pm #125535In reply to: Forum Adopting Parent Theme
mintertweed
ParticipantNope. That did not do it. It reverts back to style.css rather than bbpress.css and I know this because the two styles are two completely separate colors. Also, I just realized something. I deactivated bbPress to see if I had coded style-forums.css correctly (now named bbpress.css) and when I reactivated bbPress, my forums have disappeared. So, I went to Forums > All Forums and it still shows them as being there, but they are not appearing on my Forums page like they were before. So, I guess I now have two problems.
Edit: And I just deleted bbPress and reinstalled it. The various forums still appear in Forums > All Forums, but they are not showing up on my Forums page. Sigh.
January 25, 2013 at 9:59 am #125523choibc
ParticipantI kike your code
January 25, 2013 at 2:55 am #125516In reply to: Problem to convert Simple Press to bbpress
Stephen Edgar
KeymasterAre you using the builtin importer included with bbPress?
https://codex.bbpress.org/import-forums/
https://codex.bbpress.org/import-forums/simplepressWere any replies imported or did the converter stop at topic 490?
Once the conversion stops if you click ‘start’ again without changing any options does it then complete or stop at the same point?
If it does continuously stop in the same position open phpMyAdmin and open the `wp_options` table and bump the value stored in `_bbp_converter_start` by 1 and click start again, if it fails again bump this value again.
When you want to start again fresh and remove all topics, forums, topic tags & replies previously imported check the ‘Start Over’ & ‘Purge Previous Import’ checkboxes.
January 24, 2013 at 8:07 am #125485In reply to: Navigation: topic or reply belongs to which forum?
raygulick
ParticipantCan’t figure out how to display code here. Can’t find a “how-to.”
January 24, 2013 at 8:00 am #125484In reply to: Navigation: topic or reply belongs to which forum?
raygulick
ParticipantExample code (that does not work):
`<nav class="usernav
```">wp_nav_menuJanuary 24, 2013 at 7:49 am #125483In reply to: Navigation: topic or reply belongs to which forum?
raygulick
ParticipantSpoke too soon. Displays extra class at all times, hiliting the nav item when it should not be hilited. Wish I could show the code here, and someone could point out my errors.
This topic should be in “troubleshooting”. Sorry, didn’t see different forums initially.
January 24, 2013 at 6:34 am #125480Topic: Navigation: topic or reply belongs to which forum?
in forum Installationraygulick
ParticipantI have 2 separate forums in 2 separate sections of a website. Adding shortcode to a child page under each top-level parent page, current-page-ancestor allows hiliting of the correct top level nav item.
However, as soon as a topic or reply is clicked, the ancestor/child relationship is lost, and the navigation item is un-hilited. Slugs for topics from one forum look identical to slugs from the other (except for topic name, of course).
If I only had one forum, it would be fairly simple to make all topics and all replies hilite the same nav item, but with 2 forums in separate sections, I need to distinguish between topics and replies that belong with one forum or the other. Is there a conditional that allows me to determine which forum a topic or reply is associated with?
January 24, 2013 at 1:18 am #125474In reply to: Display list of topics under specific forum
Stephen Edgar
KeymasterThis is what I am using as a custom plugin on a site:
if ( bbp_has_topics( array( 'author' => 0, 'show_stickies' => 'false', 'meta_key' => '_bbp_last_active_time', 'orderby' => 'meta_value', 'order' => 'DESC', 'post_parent' => 'any', 'posts_per_page' => 5 ) ) ) bbp_get_template_part( 'bbpress/loop', 'topics' );Where
post_parent= ‘any’ forum or change this to a specific forum idIt is based on this https://gist.github.com/4207064
-
AuthorSearch Results