Announcement

Collapse
No announcement yet.

How to display all posts by specific users in a specific topic/thread

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • delicjous
    replied
    $conversation is an array that hold nodeid and starter. Just like the username. Look into debugvardumps result to find it...


    Edit: Because you are interested and learn some stuff by your self (some others just asking and get pissed if they dont get any answer) here are a changed version of your mod with xour search in conversation_userstats separated by thread and post.

    Attached Files
    Last edited by delicjous; Sat 12 Sep '20, 9:27pm.

    Leave a comment:


  • Mot235
    commented on 's reply
    Yeah, I tried the if conditions in the conversation_sharing and conversation_userstats area but for whatever reason the if condition
    Code:
    <vb:if condition="$conversationtype == 'reply'">
    or starter don't pull in any values in this area. So yeah I set it up the way that I have right now because the two hook locations I've set it in atm do that for me already. I think I might have to try to call a template that sets that information but I'll keep working at it. For now it works and people will be happy and I'm just being nit picky.

  • delicjous
    replied
    You need to pass the conversation variable with the hook arguments (change the hook and place conversation=conversation into arguments). Then you could make an if (search templates for vb:if for examples and the condition needs to check if nodeid = starter . Use {vb:debugvardump conversation} in to check what you get in your Template.

    edit: just saw you did... so you could use 2 different templates for each hook to show different search results or use the if conditions
    Last edited by delicjous; Thu 10 Sep '20, 11:59pm.

    Leave a comment:


  • Mot235
    replied
    I thought I'd give an update to this after having worked on it for some time. I would first like to give my personal thanks to @delicjous for giving me the last piece of the puzzle to accomplish my goal. I am very much a vbulletin nooby but willing to learn and it was their comment on post 5 of this thread that helped me be able to implement my first simple hook!

    In the game we play, when searching for user posts in a thread, we call it isolating their posts, also ISO for short. I created two templates one for conversation starters and one for replies to add a link to the starter and reply_threadview_text_1 hooks. I had to do it like this because I haven't yet figured out how to pass whether or not the post is a starter post, or a reply post so that an if condition could switch between the two links. I pass in the nodeid of the conversation starter post to filter by the thread, but of course replies would need to pass in the conversation parentid.


    Starter
    Code:
    <a href="{vb:url 'search'}?searchJSON=%7B%22author%22:%22{vb:raw conversation.authorname}%22,%22exactname%22:%221%22,%22channel%22:[{vb:raw conversation.nodeid}]%7D">[ISO {vb:raw conversation.authorname}]</a>
    Reply
    Code:
    [<a href="{vb:url 'search'}?searchJSON=%7B%22author%22:%22{vb:raw conversation.authorname}%22,%22exactname%22:%221%22,%22channel%22:[{vb:raw conversation.parentid}]%7D">[ISO {vb:raw conversation.authorname}] </a>]]>
    Once hooked the link appears next to the post# checkbox and clicking on this link will bring up a search for all of that users post in that particular thread. Exactly what I needed. I've provided my meager product in case anyone else is interested in it. Who knows.



    I would actually like to try to figure out how to place that link in the users postbit using any one of the hooks available there, such as conversation_sharing, or conversation_userstats but I've yet to figure out how to pass that information along to this area so that the template could differentiate between starter posts and replies. If anyone could point me in the right direction for that it would be greatly appreciated, but at least I can get things going with this!

    I'm also very excited now that I'm learning more to make more changes and hope to pass along anything I find to help others aswell.
    Attached Files

    Leave a comment:


  • Mot235
    commented on 's reply
    Oh I just caught this. I've been toying around with this myself. Thanks for your tips! I've been doing a lot of learning and everyday it gets a bit easier to implement the things I want.

  • Mot235
    replied
    That is what I was afraid of. I guess I will just have to bite the bullet and accept that I bought the software and now cannot use it for what I wanted unless I learn a lot on how to write my own mod for this.

    It's my fault for not doing the research first.

    Thank you for your help anyways.

    Leave a comment:


  • Mark.B
    replied
    To the original question, there's no way to do this without custom code.

    Leave a comment:


  • delicjous
    commented on 's reply
    Did try something... try this: https://forum.vbulletin.com/search?searchJSON={%20%22author%22:%22delicjous%22,%22exactname%22:%221%22,%22channel%22:[4446047]%20}

  • delicjous
    commented on 's reply
    Did not mention JS... If I have to do something like that I would create an addon to do that (not necessarily JS, more php). Most forum-owners don't want to change any stuff/ games on the forum.

  • In Omnibus
    replied
    If I were you I would change the way you have the game constructed. It would be easier.

    Either have each player have their own thread (Groups are ideal for this purpose)

    Or have each player only reply to their own posts in the thread

    Or have each player only comment to their own posts in the thread.

    Or have each player use a unique tag that identifies their posts from other players.

    There are a number of ways of achieving your end goal without having to construct a virtually impossible JS string (as Delicjous pointed out)

    Leave a comment:


  • delicjous
    commented on 's reply
    Sorry, this is not possible if you don,t know/ have the nodeids of all posts in that thread. https://forum.vbulletin.com/search?searchJSON={ "author":"delicjous","exactname":"1","specific":[4446047,4446073,4446107,4446109,4446120] }

  • Mot235
    replied
    That's not what I'm looking for either.

    What I would like is to be able to find all posts from a user in a topic, so for example if I were able to see all your posts in this thread. I would be able to search and only see posts number 2 and 4 by you.

    Leave a comment:


  • delicjous
    replied
    https://forum.vbulletin.com/search?s...%7D&btnSubmit=

    There is a starter only right of member-field in advanced search.

    Leave a comment:


  • Mot235
    replied
    Originally posted by delicjous View Post
    https://forum.vbulletin.com/articles...he-search-json

    You could use the search to get all the posts from a user (author or exctname) and by channel (channel or specific).
    There are example on that page to use the extended search
    This seems to be about as far as I've gotten. I guess there's no way to do it by topic specific?

    Leave a comment:


  • delicjous
    replied
    https://forum.vbulletin.com/articles...he-search-json

    You could use the search to get all the posts from a user (author or exctname) and by channel (channel or specific).
    There are example on that page to use the extended search

    Leave a comment:

Related Topics

Collapse

Working...
X