Search Results for 'code'
-
AuthorSearch Results
-
April 19, 2014 at 4:38 pm #145230
In reply to: Removing Dividers When Viewing a Category
tharsheblows
ParticipantI’m not quite clear on your code, so can’t help with the last piece.
As I mentioned, I did it differently and specific to the forum I was working on which has categories with forums but no sub-forums and one single forum without a category. I don’t think this will help you unless you decide to try something different but this is what I did – in loop-forums.php replace the while loop with :
<?php while ( bbp_forums() ) : bbp_the_forum(); ?> <?php if( !bbp_is_forum_category() ) { bbp_get_template_part( 'loop', 'single-forum' ); } else { bbp_get_template_part( 'loop', 'single-categories' ); } ?> <?php endwhile; ?>and then I made a loop-single-categories.php https://bbpress.trac.wordpress.org/attachment/ticket/1958/loop-single-categories.php
April 19, 2014 at 4:13 pm #145229In reply to: Removing Dividers When Viewing a Category
DeanGrey
ParticipantWhat the image shows is already using Bob1nz’s provided code. Bob1nz’s seems to not correct the issue like Lynq’s does. I am aware that Lynq has made some code available on github but I don’t know what to modify to get those to go away. I have worked my way to getting everything else the way I want it, this is just the last piece.
April 19, 2014 at 3:44 pm #145225In reply to: How do I add timestamp to posts within a topic?
tharsheblows
ParticipantYep – use get_post_time() – https://codex.wordpress.org/Template_Tags/get_post_time
function mjj_post_reply_date(){ printf('<div class="mjj-post-date">'); $reply_id = bbp_get_reply_id( $reply_id ); printf( get_post_time( get_option( 'date_format' ), false, $reply_id, true ) ); printf('</div>'); } add_action ('bbp_theme_before_reply_content', 'mjj_post_reply_date') ;April 19, 2014 at 3:33 pm #145223In reply to: How do I add timestamp to posts within a topic?
Majijiboo
ParticipantThanks. It works. Is there a way to only show the date and not the hour/minute? Maybe using code similar to the below could help?
function short_freshness_time( $output) { $output = preg_replace( '/, .*[^ago]/', ' ', $output ); return $output; }April 19, 2014 at 3:29 pm #145222In reply to: Moderator Unable To Post To Forum: iPhone iPad
tharsheblows
Participant@Matoca it sounds like you’re still using tinyMCE? Do you have something like this in your functions file –
function bbp_enable_visual_editor( $args = array() ) { $args['tinymce'] = true; return $args; } add_filter( 'bbp_after_get_the_content_parse_args', 'bbp_enable_visual_editor' );(from https://codex.bbpress.org/enable-visual-editor/ )
I might be confused (if we had signatures and I used signatures on forums mine would be “I might be confused”) but I wouldn’t think you’d have a text / visual tab on the non-tinyMCE editor, would you?
If it were me, I’d also try disabling “Post Formatting” in Settings -> Forums in the admin area. I have no clue whatsoever if that would work though, it’s just something I’d try.
I’m really interested to see what works! My guess is that something will end up working but we’ll never quite know what did it.
April 19, 2014 at 3:07 pm #145220In reply to: How do I add timestamp to posts within a topic?
tharsheblows
ParticipantYou can use bbp_reply_post_date for it – it will give you “August 4, 2012 at 2:37 pm”. I mean, it would give you that for posts on Aug 4, 2012 at 2.37pm and similar things for other dates.
But you want to style it a bit, so something like:
function mjj_post_reply_date(){ printf('<div class="mjj-post-date">'); bbp_reply_post_date(); printf('</div>'); } add_action ('bbp_theme_before_reply_content', 'mjj_post_reply_date') ;April 19, 2014 at 2:22 pm #145216In reply to: Register / Login or Username
tharsheblows
ParticipantOh good – I have this in a header – it’s about the same but $user_identity is the display name rather than the login. This explains the different global variables from get_currentuserinfo() – https://codex.wordpress.org/Function_Reference/get_currentuserinfo . Just in case you want the full reference – I hadn’t really looked at it before and noticed we used different variables and wondered why and thought you might be interested too. 🙂
<?php if ( is_user_logged_in() ) { ?> <span class="break-me"> Welcome, <?php global $user_identity; get_currentuserinfo(); printf('%s', $user_identity); ?>! </span> <span class="break-me"> <a href="<?php echo wp_logout_url( get_permalink() ); ?>" title="Logout">Log out?</a> • <a href="<?php echo bbp_get_user_profile_url(get_current_user_id()); ?>" name="Your profile and posts">Your profile</a> </span> <?php } ?>April 19, 2014 at 8:04 am #145209In reply to: Register / Login or Username
Sascha.H
ParticipantWell this is now my solution. Seems ok
<?php if ( ! is_user_logged_in() ) { wp_nav_menu( array( 'theme_location' => 'Register or Login' ) ); } else { global $current_user; get_currentuserinfo(); $current_user->user_login; echo "Logged in as: ";?> <a href="<?php echo get_edit_user_link(); ?>"> <?php echo $current_user->user_login; ?> </a> <?php } ?>April 18, 2014 at 2:45 pm #145204In reply to: edit on the Front-end doesn't work anymore
bustel
ParticipantAfter a long search I found a solution for my problem…
instead of:
$uri = bbp_get_reply_edit_url( $r['id'] );
set:
$uri = $_SERVER['REQUEST_URI'].( '/../../../give-reaction/' . $r['id'] . '?edit=1' );
on line: 1923April 18, 2014 at 2:05 pm #145202In reply to: edit on the Front-end doesn't work anymore
bustel
ParticipantAnd if i set it to:
$uri = ( '?edit=1' );
then I get the topic to change and not the reply….April 18, 2014 at 2:02 pm #145201In reply to: edit on the Front-end doesn't work anymore
bustel
ParticipantIt works for the topics but not for the replies, I don’t know why it doesn’t work…
I have tested with
1)
$uri = ( '/?edit=1' );
in the topic: http://www.mysite.com/?edit=1
it isn’t correct
it go to the home of the site, that’s it.2)
$uri = bbp_get_reply_edit_url( $r['id'] ) . '?edit=1';
in the topic: http://www.mysite.com/map/map/1827/edit/?edit=1
and it isn’t correct eather…
it says: The page you requested could not be found.April 18, 2014 at 8:06 am #145189In reply to: How do I add timestamp to posts within a topic?
Majijiboo
ParticipantThanks for responding. I made the below code and unfortunately didn’t work. When you have time in a week or 2, would love to know what went wrong. Thanks.
function post_time ( $output) { $output = preg_replace( '/, .*[^ago]/', ' ', $output ); echo $output; } add_action ('bbp_theme_before_reply_content', 'post_time') ;April 18, 2014 at 3:01 am #145185In reply to: change forum sidebar
April 18, 2014 at 2:59 am #145184In reply to: How do I add timestamp to posts within a topic?
Robin W
Moderatorbasically you’d need to cut some code to display the date/time, put it in a function that echo’s it, and then hook it to the following action
add_action (‘bbp_theme_before_reply_content’, ‘your_function’) ;
see
sorry am up to my armpits in other code, or I’d cut it for you !
April 17, 2014 at 4:13 pm #145174In reply to: Basic syntax question for items like this <
Robin W
Moderatorshould read
<p><a href="<?php bbp_user_profile_url( bbp_get_current_user_id() ); ?>edit" >Amend Profile/Change password</a></p>sorry, wordpress tends to not like code, and keeps trying to edit it !
have amended the codex !
April 17, 2014 at 3:53 pm #145172In reply to: edit on the Front-end doesn't work anymore
bustel
ParticipantDo the same thing for:
edit function: bbp-reply-edit-link
in the file: wp-content/plugins/bbpress/includes/replies/template.phpon line 1922
// Get uri // $uri = bbp_get_reply_edit_url( $r['id'] ); $uri = ( '?edit=1' );April 17, 2014 at 3:45 pm #145171In reply to: edit on the Front-end doesn't work anymore
bustel
Participant// Get uri // $uri = bbp_get_topic_edit_url( $r['id'] ); $uri = ( '?edit=1' );April 17, 2014 at 1:44 pm #145168Topic: Basic syntax question for items like this <
in forum TroubleshootingMajijiboo
ParticipantIs the syntax for this
<a href=""<?php">edit" >Amend Profile/Change password</a>suppose to be this<a href="&"<?php">edit">Amend Profile/Change password</a>? Thanks.April 17, 2014 at 11:28 am #145163Halo Diehard
Participant@foxden-vixen That’s awesome you figured it out! Often it is hit and miss for me too.
I use FireFox FireBug and right-click, “Inspect Element” anywhere on a webpage and it tells me what that element is called. The “Read More” element on your page is called a.readmore and the ‘display none’ css should work for that. Maybe:
.forum-archive a.readmore { display: none; }I should encourage you to start a new thread for topics that don’t go with the topic you are in, though 🙂
April 17, 2014 at 10:42 am #145161In reply to: creating a child-theme
Robin W
Moderatorwhich parts of the plugin do you want to re-write?
You will always be prompted for bbpress updates, so no code you write will be lost by mistake.
If it is templates that you want to alter, then copy only the ones you alter to
wp-content/your-theme/bbpress
see
https://codex.bbpress.org/step-by-step-guide-to-setting-up-a-bbpress-forum-part-3/ section 3of it’s functions, then you should change these using filters see
April 17, 2014 at 9:32 am #145160In reply to: creating a child-theme
Sascha.H
ParticipantWell the problem isnt that i cant install it. Actually i had installed both plugins but i dont want to rewrite the plugin code because when the plugins will be updated my code will be overwrited thats why i want a child-theme but i dont know which parts from the plugin in which folder.
1. Thank you
2. The Problem is the basic URL is http://www.myurl.de/forums/forum/test and when i disable the thickbox its http://www.myurl.de/forum/test. But i want zero tags before. And when i delete the forum field and save than it appears again.April 17, 2014 at 9:00 am #145157foxden-vixen
BlockedThe site is back up today and I tested it out. It did not work the way you wrote the code.
.forum-archive DIV.sidebar.right, .bbpress .single-forum DIV.sidebar.right, .bbpress .single-topic DIV.sidebar.right { display: none !important; }should be
.forum-archive DIV.sidebar.right, .bbpress.single-forum DIV.sidebar.right, .bbpress.single-topic DIV.sidebar.right { display: none !important; }Just taking out the spaces between bbpress and single worked. The syntax was incorrect.
One other stupid question…at the bottom of the main page, which I guess now is called the archive page, there is the “read more” tag. How do I get rid of that? Doesn’t that have to do with the loop?
April 17, 2014 at 8:40 am #145155In reply to: Full Width for bbpress forums root page
Robin W
Moderatorfind your themes full width page template and then follow the instructions below to get bbpress to use it
April 17, 2014 at 8:23 am #145149In reply to: How to make forums look better/prettier
Robin W
ModeratorI’d start by reviewing the layout and functionality
the look at
to get some widgets in your sidebars
then
to get some styling.
April 16, 2014 at 6:23 pm #145134Halo Diehard
Participant@foxden-vixen try adding a comma and:
.bbpress .single-forum DIV.sidebar.right, .bbpress .single-topic DIV.sidebar.rightafter where you already have in the css:
.forum-archive DIV.sidebar.rightso it says:
.forum-archive DIV.sidebar.right, .bbpress .single-forum DIV.sidebar.right, .bbpress .single-topic DIV.sidebar.right { display: none !important; } -
AuthorSearch Results