• Home
  • Categories
  • Recent
  • Popular
  • Top
  • Tags
  • Users
  • Groups
  • Documentation
    • Home
    • Read API
    • Write API
    • Plugin Development
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
v3.5.2 Latest
Buy Hosting

How to distinguish topic, comment and reply

Scheduled Pinned Locked Moved Solved Technical Support
3 Posts 3 Posters 135 Views
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Arun KA Offline
    Arun KA Offline
    Arun K
    wrote on last edited by
    #1

    2abe945b-12dd-43e9-a884-c9585fae440a-addtext_com_MTMxMzUyMzUzMjU.png

    Hi, nodebb stores everything as post but i want to know how to distinguish

    • mainpost(post created with topic)
    • comment(post to mainpost/topic)
    • reply(post to comment)

    any help would be appreciated. Thanks!

    barisB 1 Reply Last reply
    0
  • PitaJP Offline
    PitaJP Offline
    PitaJ Global Moderator Plugin & Theme Dev
    wrote on last edited by
    #2

    What do you mean by distinguish?

    1 Reply Last reply
    0
  • barisB Offline
    barisB Offline
    <baris> NodeBB
    replied to Arun K on last edited by baris
    #3

    @Arun-K You can look at the data in the post object in a topic. For example in this topic your post is the main one so it has an index of 0.

    A comment like @PitaJ 's post doesn't have a toPid field so it is a top level reply. I have directly replied your post so my post object has a toPid field.

    c40c84ac-34ba-4c71-b3dd-d73334f4eec7-image.png

    1 Reply Last reply
    2
  • Arun KA Arun K has marked this topic as solved on

Copyright © 2023 NodeBB | Contributors
  • Login

  • Don't have an account? Register

  • Login or register to search.
Powered by NodeBB Contributors
  • First post
    Last post
0
  • Home
  • Categories
  • Recent
  • Popular
  • Top
  • Tags
  • Users
  • Groups
  • Documentation
    • Home
    • Read API
    • Write API
    • Plugin Development