Search Results for 'code'
-
AuthorSearch Results
-
December 15, 2013 at 9:26 pm #140342
In reply to: List user post total
ronthai
ParticipantI got it working and also Guests Posts (Topics and Replies) don’t return and empty value.
Might not be the best way, but all I got:<?php if ( bbp_is_topic_anonymous() ) { echo "<br>Guest Post"; } elseif ( bbp_is_reply_anonymous() ) { echo "<br>Guest Post"; } else { $post_count = ( bbp_get_user_topic_count_raw ( bbp_get_reply_author_id ( bbp_get_reply_id() ) ) ); echo "<br>Total Topics: " . $post_count; $post_count = ( bbp_get_user_reply_count_raw ( bbp_get_reply_author_id ( bbp_get_reply_id() ) ) ); echo "<br>Total Replies: " . $post_count; } ?>December 15, 2013 at 8:32 pm #140339In reply to: List user post total
ronthai
ParticipantNope, that does not seem to be working.
I tried several different ways, but all just output the same.I got to this code, but still outputs the Totals for guests without a value/number:
<?php if ( bbp_is_anonymous() ) { echo "Guest Post"; } else { $post_count = ( bbp_get_user_topic_count_raw ( bbp_get_reply_author_id ( bbp_get_reply_id() ) ) ); echo "Total Topics: " . $post_count; $post_count = ( bbp_get_user_reply_count_raw ( bbp_get_reply_author_id ( bbp_get_reply_id() ) ) ); echo "Total Replies: " . $post_count; } ?>December 15, 2013 at 8:15 pm #140336In reply to: Replies not showing up in forum
Stephen Edgar
KeymasterI see this at the bottom of your site when viewing a topic
add_shortcode( 'member', 'member_check_shortcode' ); function member_check_shortcode( $atts, $content = null ) { if ( is_user_logged_in() && !is_null( $content ) && !is_feed() ) return $content; return ''; }December 15, 2013 at 7:52 pm #140334In reply to: Sidebars in BBpress profile
Sloppy Buns
ParticipantI have worked part of this out and have implemented a is_bbpress format for forum pages so I can choose what sidebars to put on my forum pages however I am still not able to get sidebars to show up on profile or most popular topics.
What I require is the is_ codex for these pages so I can write a script to place sidebars on these pages, I have found that the User profile has these html body classes:
bbp-user-page single singular bbpress
is_bbpress() does not workand Most Popular Topics:
bbp-view bbpressThis should be is_bbpress() however is_bbpress() does not work.
Any help would be greatly appreciated.
December 15, 2013 at 7:10 pm #140325In reply to: bbPress 2.5.1 is out!
Stephen Edgar
Keymaster@cyberdrone See this to get the translations or get started with translating bbPress. https://wordpress.org/plugins/bbpress-protected-forums/
@david7h6 What shortcode is broken?December 15, 2013 at 6:03 pm #140316In reply to: List user post total
Stephen Edgar
KeymasterTry
bbp_is_anonymousto check if it’s an anonymous user before outputting the post count.December 15, 2013 at 9:02 am #140292In reply to: Two breadcrumbs are showing up
Lynqoid
ParticipantYou could hide the bbPress breadcrumb with some CSS.
.bbp-breadcrumb { display:none; }December 15, 2013 at 8:29 am #140288In reply to: List user post total
ronthai
Participantany idea where to add the code to have it show under the avatar in topics/replies?
I think the count works, just can not get it placed correctly
December 15, 2013 at 6:36 am #140287In reply to: List user post total
Lynqoid
ParticipantGive this a try:
$post_count = ( bbp_get_user_reply_count_raw ( bbp_get_reply_author_id ( bbp_get_reply_id() ) ) ) + ( bbp_get_user_topic_count_raw ( bbp_get_reply_author_id ( bbp_get_reply_id() ) ) ); echo "Total Posts: " . $post_count;December 15, 2013 at 5:12 am #140285In reply to: List Of Shortcodes
ronthai
ParticipantDecember 15, 2013 at 4:57 am #140284Topic: List Of Shortcodes
in forum Themessimon_loke
ParticipantI need a list of shortcodes such as Profile edit,activity,user members and others..
I want to have every shortcode to place different page.December 14, 2013 at 12:33 pm #140270In reply to: Request: Backticks optional?
Hansaplastique
ParticipantHi Stephen,
In my search for a “fix” I totally forgot about the popup “Crayon Syntax Highlighter” offers.
I’ve been playing around with this for about a year now and ended up using “CodeColorer” as I was creating my own WYSIWYG editor. I think I’ll explore the Crayon option again.As for the editor; I don’t know how to start such a wider discussion.
I agree that ideally you’d like to use the editor that comes with WordPress, even if it’s just to stay more consistent (comments vs forum posts).
How would one go about that?December 14, 2013 at 6:59 am #140261Topic: List user post total
in forum Troubleshootingcomagnum
ParticipantI’ve searched everywhere, to no avail. There used to be a plugin for this for older versions of bbpress (post count pro I believe it was called) but there aren’t any plugins for this anymore. I’m limited on my code knowledge, but I’d really like for this to be accheived. We’re a compeitive gaming community and vBulletin has been a staple of our professional/amateur gaming life since the beginning. I’ve decided to make the move to bbpress to have a more seemless site integration between users, posts, and news. My ultimate goal is to make the forums as similar to vBulletin as possible, but all of the plugins that accheived this goal do not work with the newer versions. I’d like for the post total to be listed under the users name when they post, as well as in their profiles. In addition custom user roles would be a plus, but not requred. If anyone can point me in the right direction, I’d be very grateful.
December 14, 2013 at 4:09 am #140258In reply to: Forum Index + Topics by Freshness
Simon Barnett
ParticipantThanks for the detailed reply, Stephen. I probably meant Forum Root rather than Forum Index, but the way you describe it is exactly what I’m after.
I had considered what to do about the list getting too long and it will almost certainly be a matter of listing only the freshest 10 topics per forum. Clicking the Forum title would take you to the full list.
Now that I know where to begin I’ll probably figure it out eventually (new to BBPress but not afraid of code), but if you have some suggestions on where to get started or even a block of code to copy-paste I certainly wouldn’t object to using it : )
If get around to it first I’ll post my findings here for the knowledge base.
December 14, 2013 at 3:23 am #140256In reply to: Arabic bbpress Language in english website
Stephen Edgar
KeymasterArabic is 96% translated already, see this to get you started https://codex.bbpress.org/bbpress-in-your-language/
December 14, 2013 at 3:18 am #140253In reply to: No way for users to register and login
Stephen Edgar
KeymasterYou can add some widgets to your side bar or shortcodes to a page
https://codex.bbpress.org/shortcodes/ https://codex.bbpress.org/widgets/
Also there are a few other docs on the codex worth looking at
December 14, 2013 at 2:40 am #140252In reply to: get a replies parent forum
Stephen Edgar
KeymasterCool, that will work, thanks for the follow up and code example π
December 14, 2013 at 2:32 am #140251Stephen Edgar
KeymasterThanks for adding the Codex page @jwarren π
December 14, 2013 at 2:27 am #140250In reply to: Forum Index + Topics by Freshness
Stephen Edgar
KeymasterI just updated that page to ‘Topics β How many topics to show per page’
As to combining the ‘Forum Index with Topics by Freshness’ I’m not exactly sure what you mean by this, for example look at the following two pages here on bbpress.org
https://bbpress.org/forums/forum/installation/ <- That’s the ‘Instalation’ forum 25 topics/page
https://bbpress.org/forums/forum/troubleshooting/ <- That’s the ‘Troubleshooting’ forum 25 topics/pageIf you wanted to have something like below on a single page then you would have to customize your templates or use some shortcodes on your page to get the layout you want. It is quite doable but once you get 50 topics for example in a forum finding ‘Forum B’ or any other forums below that list will be extremely difficult.
-
Forum A
- Topic 1
- Topic 2
- Topic 3
- … etc
-
Forum B
- Topic 1
- Topic 2
- Topic 3
- … etc
December 14, 2013 at 12:06 am #140248In reply to: miniBB – Import only latest
Stephen Edgar
KeymasterSome seriously nice work in your script π
I have just merged your changes into mine
https://gist.github.com/ntwb/7889409/revisionsAnd I forked your Gist and merged those changes into yours https://gist.github.com/ntwb/7955389/revisions
Both files are the same and you can download either to use and test, using the /revisions it should show you a little clearer the changes I made.
In summary the main updates were:
* Fixes PHP Class name – FromExample_ConvertertominiBB
* Includes forum slug
* Uses thecallback_topic_reply_countfor topic/reply counts
* Added topic Author IP
* Added topic slug
* Added topic status (Open/Closed) and callback
* Added reply post id
* Added reply title and reply title callback
* Added reply slug
* Updated password verify classminiBB
* Stores custom user profile_bbp_minibb_user_instantmessenger,_bbp_minibb_user_occupation,_bbp_minibb_user_location&_bbp_minibb_user_interestsinwp_usermetaDecember 13, 2013 at 11:37 pm #140247Topic: support for sms message when there is a forum update
in forum Installationijourneaux
ParticipantI have bbPress up and running but was wondering how I might be able to allow users to get an sms text message when there is a new forum post. I have played around with the WordPress Text message plugin but Wasn’t able to figure out a way to incert the codes onto the form pages.
Ian
December 13, 2013 at 9:17 pm #140246In reply to: Request: Backticks optional?
Stephen Edgar
KeymasterI see where you are coming from, I just went and took a look around backticks in Crayon Syntax Highligher.
Tex uses backticks and appears to render fine based on this http://aksandbox.webege.com/?p=92, I also tried some MySQL with backticks and that also rendered correctly.
You can also add/create your own languages for Crayon:
https://github.com/aramk/crayon-syntax-highlighter/blob/master/langs/readme.mdSome more background on the issues in the past can be read in these two tickets and this was one the main reasons
backtickswere implemented.
https://bbpress.trac.wordpress.org/ticket/2091 & https://bbpress.trac.wordpress.org/ticket/2317While looking for a solution I noticed that Iβm not the only one experiencing this back tick problem β frankly; the editor for bbPress needs some serious reconsideration β¦ isnβt it time for a capable WYSIWYG editor?
I also think we do need a better editor in bbPress, or more so a better editor in WordPress itself that we can use in the ‘front end’ of bbPress.
The install base and use of bbPress is quite large and varied and we try to make it work for all of these cases and is one of the reasons recommending to use plugins that work with bbPress to support your own use case.
Maybe we should have a wider discussion on the bbPress editor and the options available to us.
December 13, 2013 at 8:42 pm #140244In reply to: get a replies parent forum
serks
ParticipantThanks for response Stephan,
I actually managed to do this by using some code in loop-search.php and I used the same code in loop-replies.php…heres the code that does it…<?php if(get_post_type() == 'reply'):?> <?php // CHECK IF THIS REPLY IS UNDER MEMBERS ONLY FORUM. $parent = array_reverse(get_post_ancestors($post->ID)); // get an array of all the parent pages in order from most distant to closest. $first_parent = get_page($parent[0]); //get the first page in the array, which is the most distant parent $int = apply_filters('the_ID', $first_parent->ID); //filter the $first_parent to get only the wordpress page/post ID, which is an integer like 49 or 565. store it as a variable $int ?> <?php if($int == 48) :?> <?php // DISPLAY A MESSAGE SAYING THE REPLY IS HIDDEN ?> <?php if(!user_subscribed()):?> <?php //bbp_get_template_part( 'loop', 'search-reply-membersonly'); ?> <div class="hidden-forum-comment">This comment is only visible to subscribers. <a href="/join">Click here to subscribe.</a></div> <?php endif;?> <?php else :?> <?php bbp_get_template_part( 'loop', 'search-reply'); ?> <?php endif ;?> <?php elseif(get_post_type() == 'forum'): ?> <?php bbp_get_template_part( 'loop', 'search-forum'); ?> <?php elseif(get_post_type() == 'topic'): ?> <?php bbp_get_template_part( 'loop', 'search-topic'); ?> <?php endif;?>Hope i’ve pasted that correctly.
48 is the ID of the Members Only Forum.
!user_subscribed() is one of my own functions to check if a user is subscribed to a product with DAP (Digital Access Pass).If anyone needs more help with this just ask. Be happy to help.
December 13, 2013 at 6:35 pm #140242Stephen Edgar
KeymasterIt looks like the issue is fixed?
Anyway see the comment on this ticket in Trac for more details https://bbpress.trac.wordpress.org/ticket/2204#comment:3
On each bbPress related page, the bbPress adds a class ‘bbPress’ to the body html element, so adding something like below would solve the problem in a non-obtrusive way.
body.bbPress #nav > li.menu-item-318 > a { formatting for the highlighted menu item class }Where, menu-item-318 is the id of the page which should have been highlighted by the current_page_parent or current_menu_item class, which are not attached (for which this ticket is for).
Of course, this is just a hack, but it does get the work done.December 13, 2013 at 2:14 pm #140229In reply to: Request: Backticks optional?
Hansaplastique
ParticipantThanks Stephen for the reply and suggestion.
I’ve looked at those yes and they work great except for code that has backticks in it π … Some examples shell code that is being posted on my forum actually uses backticks in the code which makes it all a big mess … π
The current “fancy” editor doesn’t work well with code either, specially when switching back and forth between WYSIWYG and code.
In this day and age I’d like to avoid that my visitors have to “code” their own HTML to get a message posted right.What I’ve done so far:
– create my own rich editor
– disable backticks in bbPressThis works pretty good, but it most certainly is not perfect either.
Obviously changing bbPress core files is a no-no from a maintenance perspective (hence my request).While looking for a solution I noticed that I’m not the only one experiencing this back tick problem – frankly; the editor for bbPress needs some serious reconsideration … isn’t it time for a capable WYSIWYG editor?
No disrespect intended to the developers!!
I really appreciate the enormous amount of work they have done, and I understand that my editor issues are maybe not the top priority.
I really like bbPress as a forum for WordPress, and I consider it so far the best option out there. -
AuthorSearch Results