vincenzon617 (@vincenzon617)

Forum Replies Created

Viewing 23 replies - 1 through 23 (of 23 total)

  • vincenzon617
    Participant

    @vincenzon617

    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!


    vincenzon617
    Participant

    @vincenzon617

    Perfect just what I needed thanks again Robin


    vincenzon617
    Participant

    @vincenzon617

    Great 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


    vincenzon617
    Participant

    @vincenzon617

    Hi 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?


    vincenzon617
    Participant

    @vincenzon617

    Thanks 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.


    vincenzon617
    Participant

    @vincenzon617

    Sorry, 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!


    vincenzon617
    Participant

    @vincenzon617

    I 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


    vincenzon617
    Participant

    @vincenzon617

    Great, 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!!


    vincenzon617
    Participant

    @vincenzon617

    I 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


    vincenzon617
    Participant

    @vincenzon617

    Thanks, Robin I will give this a go!


    vincenzon617
    Participant

    @vincenzon617

    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";


    vincenzon617
    Participant

    @vincenzon617

    Thanks, Robin works great, although the bbp_get_reply_type and bbp_get_topic_type caused an error so I replaced it with bbp_get_all_child_ids($topicID, 'reply'); and it seems to have done the trick!


    vincenzon617
    Participant

    @vincenzon617

    Works great thank you!


    vincenzon617
    Participant

    @vincenzon617

    That 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?


    vincenzon617
    Participant

    @vincenzon617

    Just what I wanted! Thanks again Robin!


    vincenzon617
    Participant

    @vincenzon617

    Hi 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 = 7809

    In 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 topic

    Hopefully that makes more sense above, I would like to know if there is a function similar to ‘get_topic_id’ and ‘get_topic_url’


    vincenzon617
    Participant

    @vincenzon617

    Great thanks!

    In reply to: Edit CSS on topic page

    vincenzon617
    Participant

    @vincenzon617

    Dont 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; 
    }

    vincenzon617
    Participant

    @vincenzon617

    Thanks!


    vincenzon617
    Participant

    @vincenzon617

    Thanks 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.


    vincenzon617
    Participant

    @vincenzon617

    Works perfectly, thanks!


    vincenzon617
    Participant

    @vincenzon617

    Thanks, 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.


    vincenzon617
    Participant

    @vincenzon617

    Where do you recommend to go to to get this feature done?

Viewing 23 replies - 1 through 23 (of 23 total)