How to reset the counting of topic and post each categories

Technical Support

Suggested Topics

  • 0 Votes
    17 Posts

    You are using the wrong hook name => for new topic
    action:composer.posts.reply => for new reply

  • Post queue too big (crashing site)

    Unsolved Technical Support
    0 Votes
    2 Posts

    I will post a couple queries to help with this.

    Get number of queued posts

    db.objects.count({_key: "post:queue"});

    Get latest 20 post queue objects ids

    db.objects.find({_key: "post:queue"}).sort({score: -1}).limit(20);

    Using ids from above query you can get the queued posts with

    db.objects.find({_key: "post:queue:<replace_with_id_from_above_query"});

    To delete a post queue from the db with id 123456

    db.objects.remove({_key: "post:queue", value: "123456"}); db.objects.remove({_key: "post:queue:123456"});

    To remove all queued posts

    db.objects.remove({_key: /^post:queue/});

    Hope that helps.

  • 0 Votes
    1 Posts

    Hi all,

    I'm trying to use the recently introduced WriteAPI to create topics and concurrently upload a file.
    I'm doing it via Python and I've already succeeded in create a simple topic without a file using something lilke

    payload = { "cid": cid, "title": title, "content": message } headers = { 'Authorization': 'Bearer '+nodebbToken, 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=json.dumps(payload))

    but when it's about files using

    payload = { "cid": backstage_cid, "title": backstage_title, "content": backstage_message } headers = { 'Authorization': 'Bearer '+nodebbToken, 'Content-Type': 'multipart/form-data' } verifySSL = False print (payload) if (useFile): with open(backstage_file, 'rb') as f: response = requests.request("POST", url, headers=headers, data=payload, verify=verifySSL, files={backstage_file: f})

    it returns
    Error: Required parameters were missing from this API call: cid, title, content cause passing the parameters in a plain dictionary rather than a JSON object seems not doable.

    The switch from JSON to dictionary is needed otherwise I wouldn't have been able to pass a file together with such header

    headers = { 'Authorization': 'Bearer '+nodebbToken, 'Content-Type': 'multipart/form-data' }

    Has anybody valuable suggestions here?

    Thanks in advance, Riccardo

  • 0 Votes
    5 Posts

    Thanks @baris

    I managed to fix it by disabling the plugin, which let me then edit the post and I've also replaced the plugin with one that's actually maintained.

    Thanks again for the help in locating this error.

  • Dont get category teaser for parent?

    Unsolved Technical Support
    1 Votes
    2 Posts

    Unfortunately, I was unable to find a solution problem...

    But I found the problem for you!

    - Category teaser for parent still displayed if in the previous categories are no posts:


    - When refresh the page is duplicated name of the topic.


    - Bug timeago.

    If instead of seconds: "less than a minute" set seconds: "%d seconds" then post the time is 10 seconds, and will slowly drop to zero.