Forum Replies Created
-
I have now created the function that sorts each topic in my forum in order of the number of replies they have for the current day and these are stored in a multidimensional array.
From here, how do I put them in the loop in order to display them to the frontend?
The array has two indexes, [0] => number of daily replies, [1] => topicID, if that is of any help!
In reply to: Remove comment “reply” buttonPerfect just what I needed thanks again Robin
In reply to: Remove comment “reply” buttonGreat thank you! Another thing about the admin links, is there a way to allow the user to delete their own comments? I am unsure if there are certain permissions that disable this option
In reply to: Remove comment “reply” buttonHi Robin, the newest replies are shown at the top of the screen and as well as this, I have a “back to top” button so if the user goes to the end of the page they don’t have to scroll all the way back up. There is only a limited amount of comments per page anyway so the majority of the time the reply form is in view to the user. Because of this, there is no need for me to have the text/button there and so I wanted to remove it, but keep the links for admins. Any ideas on how I could do this?
In reply to: Remove comment “reply” buttonThanks for your reply. This is what I thought originally but I checked it and I have already turned this off so I am unsure. I could remove the code <?php bbp_reply_admin_links(); ?> from my ‘loop-single-reply.php’ file but this means I cannot moderate the comments which isn’t ideal.
In reply to: Adding post meta to user repliesSorry, I should have been more clear. I did post a reply but it got deleted while I was trying to get the code in the correct format to make it clearer to read!
The form that I am adding to is within the ‘form-reply.php’ file and I have the checkbox working fine. The struggle I have is that even when the checkbox is clicked the
$_POST['my_parameter']
is always empty and so the wrong value is being added as metadata. I have looked up some solutions to this, and the majority of them are suggesting it is something to do with the “action” part of the form, so I am wondering if this is the case or possibly something else?If you would like me to post the code I will try again!
In reply to: Adding post meta to user repliesI have been implementing this feature to my site today and I have managed to add the metadata to the database however, I can’t seem to be able to receive the POST variable. I have added this checkbox within the form:
<form id="new-post" name="new-post" method="post" action="<?php the_permalink(); ?>">
. This is the form used to get the user’s reply but as you can see the ‘action’ is set to<?php the_permalink(); ?>
. Would this still allow me to access the variable within my functions.php file or will I have to change the action / create another form and submit button?Many thanks
In reply to: Adding post meta to user repliesGreat, many thanks! This has clarified it for me and I now understand what I need to do :). PHP might be something I need to start learning!!
In reply to: Adding post meta to user repliesI am having some difficulty figuring out what this does, apologies, my PHP knowledge is very minimal. What exactly is the
if (! empty($_POST[‘my_parameter’] ) ) { $myvalue = $_POST[‘my_parameter’] ; } else $myvalue='empty';
part doing? Specifically, what would ‘my_parameter’ be? Would this be the name or value of what I would like the meta to be?
I have looked up what $_POST does, and the variables that I am using are declared using JavaScript. Now I am wondering if I will have to change my approach to checking the user input for the checkbox (something which isn’t related to bbpress).Many thanks
In reply to: Adding post meta to user repliesThanks, Robin I will give this a go!
In reply to: Using JavaScript to append text to the reply form.I have managed to find the solution! For anyone else who may have this problem, change this part of the code above:
.innerHTML = "clicked";
to
.value += "clicked";
In reply to: Get reply IDs from topicThanks, Robin works great, although the
bbp_get_reply_type
andbbp_get_topic_type
caused an error so I replaced it withbbp_get_all_child_ids($topicID, 'reply');
and it seems to have done the trick!Works great thank you!
In reply to: Code which links to shortcodeThat explains why it wasnt working thanks! Is there also a way to limit the amount of topics that are displayed in the most popular such as top 10 topics?
In reply to: Redirect to topic page by IDJust what I wanted! Thanks again Robin!
In reply to: Redirect to topic page by IDHi Robin, this is for the activity feed in the user profiles that I have, and so there are many urls that I need. So what I was going to do was get the reply ID of the users reply (using the BuddyPress function bp_get_activity_item_id()) and then hopefully pass this into a function which takes the reply ID and ouputs the associated topic ID. Then with this topic ID I wanted to return the URL of the page which is linked to that topicID.
Example to make it clearer:
TopicID = 6507
User replies to this topic -> replyID = 7809In activity section of profile:
id-reply = get_reply_id() -> returns the value of 7809 (already have this function)
id-topic = get_topic_id(id-reply) -> returns 6507 as that is the topic that the reply is in
url-topic = get_topic_url(id-topic) -> retuns the url of the topicHopefully that makes more sense above, I would like to know if there is a function similar to ‘get_topic_id’ and ‘get_topic_url’
In reply to: Access sidebar on topic pageGreat thanks!
In reply to: Edit CSS on topic pageDont worry I have just found the solution myself!
Here it is for anyone who has the same issue:
div.bbp-forum-header, div.bbp-reply-header, div.bbp-topic-header { padding: 0px; }
In reply to: Automatically unsubscribing to a topic when replyingThanks!
In reply to: Automatically unsubscribing to a topic when replyingThanks again works great!
Purely for graphical reasons is there a way that this would work if the checkbox and text (‘Notify me of follow-up replies via email’) were removed? So the user stays subscribed (like the plugin does) but they don’t see the check box or text, if that makes sense.
In reply to: Replace topic subscription textWorks perfectly, thanks!
In reply to: Replace topic subscription textThanks, the code works however only when loading onto the page. When I click to either ‘Watch’ or ‘Unwatch’ the text reverts back to ‘Unsubscribe’ or ‘Subscribe’ until I refresh the page again.
In reply to: Forum ID and user fourm creationWhere do you recommend to go to to get this feature done?