Search Results for 'code'
-
AuthorSearch Results
-
April 4, 2014 at 4:50 am #144580
In reply to: Private Messaging
Stephen Edgar
KeymasterAlso BuddyPress, you need only enable the features you want to use đ
April 3, 2014 at 8:32 pm #144569Nino
ParticipantI think I found it at line 811:
<a class="bbp-forum-title" href="<?php bbp_topic_permalink( $topic_id ); ?>"><?php bbp_topic_title( $topic_id ); ?></a>What do You mean (as I am not really firm in php code :-/ )? If I replace it by:
<?php if ( is_user_logged_in() ) ?> //old code for logged in user <a class="bbp-forum-title" href="<?php bbp_topic_permalink( $topic_id ); ?>"><?php bbp_topic_title( $topic_id ); ?></a> <?php else ?> //new code for NOT logged in user <a class="bbp-forum-title" href=""><?php bbp_topic_title( $topic_id ); ?></a> <?php endif ?>April 3, 2014 at 8:02 pm #144567In reply to: Same design a bbpress support forum
Stephen Edgar
KeymasterThe [bbp-topic-index] shortcode will use the default 15 topics based on bbPress ‘Topics per page’ setting, upping this to 25 will show 25 topics per page on the topics view (example.com/topics), the topics page for each single forum and again the same for any place you use the above shortcode.
April 3, 2014 at 7:46 pm #144565In reply to: Discussion list, compact with expand & collaspe
Stephen Edgar
KeymasterI have yet to look closely at the code in each of the following plugin (I’m scared of Javascript, jQuery and AJAX ;)) though they might be a good starter for the functionality you are after.
April 3, 2014 at 7:39 pm #144564In reply to: Latest Topics
Stephen Edgar
KeymasterThis is part of bbPress BTW, just open your site URL and add
/topicseg example.com/topicsApril 3, 2014 at 6:39 pm #144559Nino
ParticipantSame problem as me. I have today 5 projects and only one of them is an internetproject.
But when I have time I will take a look at the code.
And if someone else is interested: I think, this would be a nice feature with not so many work.
If someone will make this, I would be very grateful and thankful đApril 3, 2014 at 6:32 pm #144558In reply to: Password protecting a forum
Robin W
ModeratorI’m tinkering with a plugin as a challenge (by the time I’ve finished Stephen and JJJ will have written it into the core!) which I hopefully will finish in a week or so.
In the meantime I documented a version that uses a Justin Tadlocks’ members plugin and Tehnik BBPress Permissions
http://www.rewweb.co.uk/creating-bbpress-groups/
This seems to work, but I would suggest you test the bbpress search functions (it’s on my list to do) to ensure it hides posts from search results. If not, and you can live without search, then just disable search in forums
April 3, 2014 at 5:28 pm #144552Robin W
Moderatorand to answer Nino’s Q
If youâre into coding, then yes
the widgets code is held in
bbpress/includes/common/widegets.php
you could customise these and create them as new custom widgets
For instance the topics widget starts on line 669, and line 811 does bbp_topic_permalink( $topic_id )
You could add an if statement to create two different outputs logged in vs not logged in and alter not logged in to topic title.
Not something I have time to do, but would be fun if you have the time
April 3, 2014 at 4:20 pm #144537Topic: Same design a bbpress support forum
in forum Themesnirgalo
ParticipantHey, I want to set up the same kind of design bbpress support forum has for my site’s forum:
– main page with latest topics (and page navigation), and forums as widgets on the left pane
– when opening a forum : page with forum topics and forum info as widget on the left pane
– topic page: topic as page and Topic info as widgetHow can I do that? Shortcodes do not seem to be enough. Like [bbp-topic-index] is only displaying the last 15 topics.
April 3, 2014 at 1:30 pm #144535In reply to: Adsense Plugin
Daniel J. Lewis
ParticipantI would love to see this accept shortcodes, too. And it looks like I’m not the only one.
April 3, 2014 at 9:26 am #144531In reply to: Change font size range for tag cloud
batmanfan
Participant@hbombs86, you are good! thank you. This is what I did…
// Output the topic tags wp_tag_cloud( array( 'smallest' => 11, 'largest' => 20, 'number' => 80, 'taxonomy' => bbp_get_topic_tag_tax_id()however, the font size only show 11 on all – same size. Did I do something wrong? I thought it would randomly display 11 to 20?
April 3, 2014 at 7:59 am #144529Robin W
ModeratorIf you’re into coding, then yes
the widgets code is held in
bbpress/includes/common/widegets.php
you could customise these and create them as new custom widgets
For instance the topics widget starts on line 669, and line 811 does bbp_topic_permalink( $topic_id )
You could add an if statement to create two different outputs logged in vs not logged in and alter not logged in to topic title.
Not something I have time to do, but would be fun if you have the time
batmanfan
ParticipantHi Stephen, I like to have it at the ‘sidebar’ please. I tried the code but I must have done it wrong (wrong paste) nothing happens đ help appreciated.
Is there a plugin suitable for this?April 3, 2014 at 7:12 am #144525In reply to: Comment template not appearing in the forums page
Stephen Edgar
KeymasterBasically take your original idea of using comments though substitute part of that idea with replies (or topics if you wanted new topics).
bbPress has ‘mirror’ functions of WordPress for most things, if you could programmatically do ‘xyz’ with a comment in WordPress you can do the same ‘xyz’ function with a topic or reply in bbPress.
Thats the easy bit by saying that, so either start reading our codex on what these functions are or look to hire a programmer who can do that for you. https://codex.bbpress.org/
April 3, 2014 at 7:05 am #144524In reply to: New Forum Form at Forum Root?
Stephen Edgar
KeymasterWhat you would want to do is create a page using the [bbp-forum-index] shortcode and then after that shortcode simply add the shortcode [bbp-topic-form]
Check out the docs in the codex for how to start doing this:
Check out the bbPress conditional tags https://codex.bbpress.org/bbpress-conditional-tags/
April 3, 2014 at 7:01 am #144523In reply to: Import old users without an email / password
Stephen Edgar
KeymasterThis started dues to an issue when importing from phpBB. If a user had depeted their own account on a phpBB forum, phpBB didn’t reattribute the post author to a different author, rather just removed the account from being able to login etc. phpBB stores the author name alongside each topic and reply so once said author has been deleted you have the option to also not delete the users topics or replies and when viewing said topic the original author’s name will still be attributed to the topic or reply.
The goal was then to bbPress support this as when you import from a phpBB if the user doesn’t exist then we wouldn’t create a new user and as seen above if the user doesn’t exist then each topic and reply is attributed to the ‘Anonymous’ user.
Over in bbPress Trac Ticket #2347 we came up with a solution.
If you take a look at the patch I currently have sitting there (Keep in mind the current ‘Example.php’ customised importer you are using)
https://bbpress.trac.wordpress.org/attachment/ticket/2347/2347.diff
The first part in the
phpBB.phpsection I added parts to import the topics user name, the replies username and then added a flag on the user that was being imported_bbp_phpbb_user_type. That gets enough of the data that we need into the WordPress database to enable us to manipulate that once the data has been imported.So at the moment if your Lotus DB has these details already attached to the topics and replies then adding this to your custom import would be the first step.
Firstly in regards to Anonymous users in bbPress, an anonymous user CAN have a username and/or display and this is stored in
wp_postmetatable as_bbp_anonymous_nameand is what my comments in my previous reply were alluding to.Next up I added a new Repair Tool to basically post process this imported data, I create a query that joins all the topics data from
wp_postsandwp_postmetaalong with the topics old phpBB stored username. Once all that is in a SQL result table each topic that is by an ‘anonymous’ author is then updated to change the_bbp_anonymous_nameassociated with that particular topics store phpBB topic author name. Then the same process is repeated for each reply.So now we have deleted, closed, spammed users that were deleted or deactivated in some way form the legacy phpBB forum but the topics and replies were never deleted to keep the context of the original discussions.
These are now all anonymous users in WordPress/bbPress but actually have the original display name/ user name keeping that same original context.
So that is my theory I was getting to, make each of your imported Lotus users an anonymous user using their old original user/display name to keep that context of conversation.
Now this is why you don’t need to worry about email addresses nor passwords as the accounts are not actual accounts just placeholders of the names from the original discussion.
The next part of the puzzle is when your users now sign up to reactivate and participate in the new bbPress they are free to create there account, choose their username, customise their profile, pick a password, use any email address they choose etc etc.
And the final part is now ‘Joe Blogs’ has created a new account on your site we just need a tool that will reattribute the posts currently under the anonymous user account ‘Joe Blogs’ to the now active user ‘Joe Blogs’ and the job is done. You can currently do just that with the standard WordPress User administration to delete a user and then reattribute that users posts to another user during the delete process. We just go and tweak that process to also allow/mimic/recreate that process to be able to reattribute the anonymous ‘Joe Blogs’ topics and replies to now active user ‘Joe Blogs’.
So how’s all that sound? Clear as mud?
I wrote another ‘post import’ repair tool yesterday that I had planned on integrating with the above tool today but time got away from me so hopefully I’ll have time in the morning to do this and will keep the scenario I outlined above in mind so it can be used for more than just imported phpBB forums and can be extended for other imported forums and custom imports.
April 3, 2014 at 6:38 am #144522Topic: New Forum Form at Forum Root?
in forum Troubleshootingmyrko
ParticipantI chose to show the topics by freshness at the forum root.
How can I show the new-topipc form or at least a link to create a new topic there? (I don’t use any sidebars)
Secondly, is there a php-code to determine if we’re looking at the forum root (forum homepage)? Thanks.
April 3, 2014 at 6:15 am #144520Topic: Modify? or Plugin? for WIDGET (bbPress) Recent Topics
in forum TroubleshootingNino
ParticipantHello to all đ
I have a question is it possible to modify by code or by plugin the Widget (bbPress) Recent Topics that way:
For logged in users links are on.
For all not logged in the links are off. They only see the text.Does anyone has a hint for me? It is really important for me!
Thanks and greetings
Nino
April 3, 2014 at 5:56 am #144518Stephen Edgar
KeymasterEssentially you want a WordPress theme that works well on mobile (I haven’t looked at your site) and once that is sorted then replicate the CSS media queries that the theme uses for posts/pages etc for your bbPress templates.
To get started modifying your CSS check out the codex docs https://codex.bbpress.org/
April 3, 2014 at 5:32 am #144516In reply to: Forums not visible on mobile
Stephen Edgar
KeymasterYes, the issue is fixed and will be released as part of WordPress 3.9 on 16th April.
If you want to implement the fix yourself without waiting those 13 days you can grab the code from here and it it to your Twenty Fourteen themes style.css.
https://core.trac.wordpress.org/changeset/27587
EDIT: With or without the shortcodes it only works with the above patch.
April 3, 2014 at 4:43 am #144513In reply to: Import old users without an email / password
Stephen Edgar
KeymasterNice, sad I missed this thread up until now đ
Starting from @adressler 2nd post here are my thoughts:
@adressler wrote…
My crazy idea that I had was to import these âoldâ authors as, effectively, name placeholders. Bogus/null values for user_pass and user_email, a php-generated user_login (something like âjudygarland-oldâ, âabcdef12345-oldâ or similar), user_id (unique Auto Increment #), display_name (âJudy Garlandâ), and maybe user_nicename.I’m with you here and I’ll come back to how to do the above shortly.
@adressler wrote…
These would only be used to show the Authors first + last name next to all of the old topics and replies I just imported from Lotus (they will not be logging in). When users re-register, they would create a completely new WP user (Iâm using s2member to handle subscription info).Still with you, I think this is a good plan.
@adressler wrote…
I realize that ânewâ users will not be able to see their âoldâ userâs topic / reply counts, and total user counts will not be completely accurate, but thatâs okay and manageable.Still a good plan, we can fix the above ‘after’ they registered their new account.
@adressler wrote…
At least they could create their new user accounts themselves, and I wouldnât be responsible for making s2member link up properly with these old users.Correct, let the users do that themselves.
@robin-w wrote…
The real issue here is whether you can get email addresses. If you can, then if you import users as per my previous, they can use âpassword lostâ to re-do their passwords, and then itâll all be fine.As per my first comment of what I will come back to shortly, we don’t need actually need an email address for this.
@robin-w wrote…
Additionally logon names need to be unique so they canât register with any existing username !I’m going to have to check that my solution doesn’t break because of this, it is ready to be committed and ready for bbPress v2.6 đ
@robin-w wrote…
Iâd do as previous and create a user table to import, but call each user âold_xxxâ â you can do this before import, effectively your placeholder.Again, I shall return and no need for the
old_prefix on the username.@robin-w wrote…
As each user registers, you can run some code around the posts to remap them. Youâll get a registration notice, so if you cut some code, then you can just run this each time someone registers. Basically you would just enter there old username and their new one. The code would look up the old ID, the new ID, and then run through posts to remap to the new user. If youâd like help with that, just let me know and Iâll try and cut a quick loop code that you can run straight on the website (pw protected of course)90% of this is actually built into bbPress and again I just need to test this against my solution, as I type this I am thinking maybe a custom one will be needed but shouldn’t be too hard to write a tool for it to integrate with my proposed solution as no doubt others would probably also require this. đ
@adressler wrote…
I was able to export users from Lotus into a new users table. The table structure is:That table looks fine, it shouldn’t matter what the old user_login name is as we will primarily use the user Display Name and/or User Nicename.
@adressler wrote…
I linked up my custom converter and was able to import users successfully into BBPress without the need to include a bogus email or password. In the WP database, all of these âoldâ users have an auto-generated password, and no email address. Now, at least all of these old user display_names are showing next to the posts they authored (instead of all âanonymousâ).Cool, though my plan is to purposely make them Anonymous đ
With a couple of tweaks as we get closer to what I propose I think we can adapt your importer to use the code I have already written.
@adressler wrote…
Is it still possible to write a loop to link these old user accounts to the newly registered users even though thereâs no email addresses? Iâm okay with the forum working the way it is now, but if thereâs a way to link newly registered accounts with the old ones, Iâd sure like to try. Iâm guessing the only way to do it is to match by the old user display_name, which, from what I can tell, is unique to the users db; no two people have the same name. It would just depend on people remembering the name they used to registered on the old site (some people are registered as âJohn and Jane Doeâ). And if someone signs up who coincidentally has the same name as an old user, there could be some confusion.As per what I wrote above, part of this is already built into bbPress and a little bit of testing in what we need to do to handle this properly then tweak the code we should be good.
@adressler wrote…
I just had a thought, what about a checkbox during registration like âAttempt to link my old DynamiteOnline accountâ, and when checked it would try to link up the names?Maybe…
@robin-w wrote…
If auto the system wonât let you have two usernames the same, so youâd need to change your existing usernames to say have a character in front eg x_john smith (sql loop through user database would do that). Then brief your users to register with their existing username eg just john smith.We don’t need to worry about this because each user would be Anonymous đ
@robin-w wrote…
The real solution if you donât have tons of users is to go for a manual registration process, you can of course let then use the same username, as you can then generate a user with a php programme straight into the database.Let the users register whatever name they want as long as it is not already in use they will do the registration and sign up.
Automating this would be a pain for the high chance of abuse that could occur.
As there isn’t old email addresses for the old users verifying who’s who really should be a manual verification process in my opinion.
Nothing pretty or easy !
It took me ~7 months to come up with my solution with a few tips and advice from others who first floated the idea but I think it is relatively pretty now. đ
But a solution is there somewhere !
Yes it is đ
I’ll go dig out now and have a quick read and post it shortly đ
April 2, 2014 at 7:49 pm #144504Topic: Modify? or Plugin? for WIDGET (bbPress) Recent Topics
in forum TroubleshootingNino
ParticipantHello to all đ
I have a question is it possible to modify by code or by plugin the Widget (bbPress) Recent Topics that way:
For logged in users links are on.
For all not logged in the links are off. They only see the text.Does anyone has a hint for me?
Thanks and greetings
Nino
April 2, 2014 at 5:26 pm #144498Topic: 2.5.3 Easy change bbpress title font and color
in forum TroubleshootingPiani
ParticipantAfter looking into child theme and options to make a complete theme for BBPress 2.5 I want to share this. (Unfortunatly the web is flooded with usless 1.0 tips)
If you are not that into setting up a complete BBPpress child theme and hacking CSS, this is one simple way of doing a easy change and customisation of BBPress if u want some personalized look and you already have a child-theme style.css but your main-theme style is messing with BBPress looks.
Add this snippet into your normal child-theme style.css and change the colors and font size as you like.
/* BBPress font fix */ #bbpress-forums li.bbp-header, #bbpress-forums li.bbp-footer { background: #D6E0FF; } #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; }Thats all. All other style is already looking nice I think. I use this blue look in my Techism child-theme and it looks great. Running BBPress 2.5.3.
April 2, 2014 at 3:40 pm #144494Robin W
ModeratorOk, sorry yes I get it now !
Try
function hide_before ($args = array() ) { $args['before'] = ''; return $args; } add_filter ('bbp_before_get_forum_subscribe_link_parse_args','hide_before') ;Let me know if it works – it is blank by default, so not sure why your’s has a | in it.
April 2, 2014 at 2:19 pm #144493Majijiboo
ParticipantThe theme is Divi which is from Elegant Themes and the plugin is BBpress Notify. I used the below function to change it from Subscribe to “Click to receive…”. Thanks.
function change_translate_text4( $translated_text ) { if ( $translated_text == 'Subscribe' ) { $translated_text = 'Click to receive an email notification when a member responds below'; } return $translated_text; } add_filter( 'gettext', 'change_translate_text4', 20 ); -
AuthorSearch Results