• 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

Data API and hook

Scheduled Pinned Locked Moved Feature Requests
7 Posts 4 Posters 2.1k 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.
  • X Offline
    X Offline
    Xevious
    wrote on last edited by
    #1

    Hi,

    first request
    on the home page, the API is like :

    {
    "categories": [{
        "posts": [{
            "user": {
            },
            "topic": {
                "tid": "x",
                "title": "myTitle",
                "cid": "x",
                "slug": "x/myTitle",
                "deleted": "0",
    			"aid": "Author uid"
            },
            "category": {
            },
        }]  
    }],
    }
    

    The author uid field (which is the uid of the user who created the topic) is actually missing. Could you add it to the API?

    Second request
    This one will probably require some more work.
    I'd like to parse topics title (not only on the topic page, but everywhere they are displayed). There's already a filter:post.parse hook which is just great for the posts, and a filter:title.parse would be really appreciated (passing at leat 2 args to the callback: title string, and author uid).

    Thanks for the good work.

    esiaoE 1 Reply Last reply
    1
  • esiaoE Offline
    esiaoE Offline
    esiao
    replied to Xevious on last edited by esiao
    #2

    @Xevious I've counter the problem by calling the topic/tid API.
    But I agree it's needed.
    Second point too and need to say it should concern title in breadcrump too.

    Thanks for your work for the future version of nodebb-plugin-topic-color mate greatly appreciated but you already know this 🙂

    Ping @baris, @julian and @psychobunny for this to be seen.

    1 Reply Last reply
    0
  • julianJ Offline
    julianJ Offline
    julian GNU/Linux
    wrote on last edited by julian
    #3

    @Xevious The author uid seems to be in the API return, no?

    Example: https://community.nodebb.org/api/

    "posts": [
      {
        "pid": "17438",
        "tid": "2021",
        "content": "<p>Added <a class=\"plugin-mentions-a\" href=\"/user/akoch\">@akoch</a> to the translation team for Norwegian <img class=\"emoji\" title=\":grinning:\" alt=\"grinning\" src=\"https://community.nodebb.org/plugins/nodebb-plugin-emoji-extended/images/grinning.png\" /></p>\n\n    \n",
        "uid": "3",
    
    esiaoE 1 Reply Last reply
    0
  • julianJ Offline
    julianJ Offline
    julian GNU/Linux
    wrote on last edited by
    #4

    @frissdiegurke Something tells me that Emoji shouldn't be inside that code block 😄

    1 Reply Last reply
    0
  • esiaoE Offline
    esiaoE Offline
    esiao
    replied to julian on last edited by
    #5

    @julian
    There's an uid but not from the author.
    In fact it's the replier uid that is displayed.



    And I agree the emote is not at her place xD
    Thanks.

    1 Reply Last reply
    0
  • barisB Offline
    barisB Offline
    <baris> NodeBB
    wrote on last edited by
    #6

    https://github.com/NodeBB/NodeBB/commit/83de5ba5a43c15157ac2f879f44f857638325981 this does the first request, although I am not sure how useful it is without the data as the other user block (ie username,userslug, picture)

    esiaoE 1 Reply Last reply
    0
  • esiaoE Offline
    esiaoE Offline
    esiao
    replied to <baris> on last edited by
    #7

    @baris In our case it's for testing user groups and so permission to color the title or not depending on the author and not the replier 😉

    1 Reply Last reply
    0

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