• HOME
    • PRODUCT
    • PRICING
    • ABOUT
    • COMMUNITY
    Menu
    • HOME
    • PRODUCT
    • PRICING
    • ABOUT
    • COMMUNITY
    Get in touch
    Get in touch
    Menu
    • HOME
    • PRODUCT
    • PRICING
    • ABOUT
    • COMMUNITY
    • Sign in
    • Start free trial
    • Get in touch
    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Popular
    • Tags
    • Users
    • Groups
    • Documentation
      • Home
      • Read API
      • Write API
      • Plugin Development
    1. Home
    2. madwyn
    3. Posts
    M
    • Profile
    • Following 0
    • Followers 0
    • Topics 1
    • Posts 7
    • Best 0
    • Controversial 0
    • Groups 0

    Posts made by madwyn

    • RE: How to properly add HTML elements

      @yariplus, thank you very much! I found that composer is really the way to go.

      I'm currently reading the code of default composer, it looks like a really good starting point.

      There are two options: one is to modify the default composer; another is to implement something like "nodebb-plugin-poll" which basically injects HTML to composer.

      I will need to read more code to get a better idea.

      posted in NodeBB Plugins
      M
      madwyn
    • RE: How to properly add HTML elements

      @yariplus and @BDHarrington7 , thanks for your reply.

      I want to build something like "kindwave", but not as heavy. The plan it to build something based on NodeBB, rather than modify it. It's also because NodeBB is not mature, the internal structure evolves rapidly.

      The final goal it to make one or more sections to have different create/display pages, at the meantime keeping the NodeBB forum functional as it is.

      As for the second question. The threads in customised sections have new attributes, so these threads can be sorted/searched using these attributes. But if these attributes are embedded with tags in content, then I would assume searching and sorting won't be very efficient.

      @BDHarrington7, I have done several small projects using Node.js, but I am still learning.

      @yariplus, I have similar findings. There doesn't seem to have APIs for extend create/display pages, but I've seen plugins insert HTML elements into DOM. To me, this is kind of a hack. Maybe this is the only way (for now).

      posted in NodeBB Plugins
      M
      madwyn
    • How to properly add HTML elements

      I am writing a plugin which will modify the post create/display pages, it will enable the post to contain some more attributes, e.g., topic and city.

      The goal is to add selectors and input boxes in the create page and also to render the display page differently.

      I have read some code/docs and played with the hooks, but I'm not clear of how to modify the create page in the "right" way.

      Beside this, I also have another question. I know that I could put the extra stuff in the post content, wrapped with tags, but what if I want to search or sort the new elements?

      Please point me a direction or throw some useful links. Thanks!

      posted in NodeBB Plugins
      M
      madwyn
    • RE: How to debug particular functionality in NodeBB

      @Schamper I have found the cause for the port problem, it's related to "debugging a clustered app" and it's an known issue with Node.js.

      I resolved this issue by not using the Node.js from either yum or brew repositories, instead, I built it from source.

      It is nice that the poll plugin will be updated.

      I'll try to figure out the second problem. Meanwhile, wait @julian for some hints.

      posted in NodeBB Plugins
      M
      madwyn
    • RE: How to debug particular functionality in NodeBB

      @Schamper Thank you very much!

      I followed your instructions, now the NodeBB can run in IntelliJ and I can set break points.

      However, in the console still prints similar error messages:

      Failed to open socket on port 53969, waiting 1000 ms before retrying

      Is this normal?

      I have one more problem. It seems that one cannot log in, register account or create new topic in the debugging mode.

      When I tried to log in, got

      4/2 22:25 [1213] - error: /login Error: invalid csrf token at verifytoken (/Users/madwyn/projects/nodebb/node_modules/csurf/index.js:237:11) at csrf (/Users/madwyn/projects/nodebb/node_modules/csurf/index.js:100:7) at Layer.handle [as handle_request] (/Users/madwyn/projects/nodebb/node_modules/express/lib/router/layer.js:82:5) at next (/Users/madwyn/projects/nodebb/node_modules/express/lib/router/route.js:110:13) at Route.dispatch (/Users/madwyn/projects/nodebb/node_modules/express/lib/router/route.js:91:3) at Layer.handle [as handle_request] (/Users/madwyn/projects/nodebb/node_modules/express/lib/router/layer.js:82:5) at proto.handle.c (/Users/madwyn/projects/nodebb/node_modules/express/lib/router/index.js:267:22) at Function.proto.process_params (/Users/madwyn/projects/nodebb/node_modules/express/lib/router/index.js:321:12) at next (/Users/madwyn/projects/nodebb/node_modules/express/lib/router/index.js:261:10) at Function.proto.handle (/Users/madwyn/projects/nodebb/node_modules/express/lib/router/index.js:166:3)

      Then the page shows Forbidden, from the code I can tell it is 403.

      Actually before your reply, I knew you from one of your plugins. I think that might be a good start for me to dig and eventually write something new.

      Thanks!

      posted in NodeBB Plugins
      M
      madwyn
    • RE: How to debug particular functionality in NodeBB

      Hi @julian , would you please give me a hint of how to debug NodeBB using IntelliJ or similar IDE?

      posted in NodeBB Plugins
      M
      madwyn
    • RE: How to debug particular functionality in NodeBB

      I'm new to NodeBB and node.js.

      Before trying to debug NodeBB, set the NodeBB to working condition.

      I use IntelliJ for development, so I created an empty "web static" to where NodeBB is located, then create a new "node.js" configuration. "JavaScript file" set to "app.js".

      The NodeBB on my machine runs with MongDB.

      After started NodeBB via the IDE, I can visit the forum, but there are some noticeable differences visually. Some buttons don't work neither, e.g., New Topic.

      I also got the following error:

      Failed to open socket on port 53023, waiting 1000 ms before retrying

      I got some clue for the error, it might be related to "debugging a clustered app".

      The whole message:

      /usr/bin/node --debug-brk=57296 --nolazy app.js dev
      debugger listening on port 57296
      2/2 18:32 [19242] - info: NodeBB v0.6.1-dev Copyright (C) 2013-2014 NodeBB Inc.
      2/2 18:32 [19242] - info: This program comes with ABSOLUTELY NO WARRANTY.
      2/2 18:32 [19242] - info: This is free software, and you are welcome to redistribute it under certain conditions.
      2/2 18:32 [19242] - info:
      2/2 18:32 [19242] - info: Time: Mon Feb 02 2015 18:32:10 GMT+0000 (GMT)
      2/2 18:32 [19242] - info: Initializing NodeBB v0.6.1-dev
      2/2 18:32 [19242] - warn: [socket.io] Clustering detected, you are advised to configure Redis as a websocket store.
      debugger listening on port 57296
      2/2 18:32 [19242] - info: NodeBB is now listening on: 0.0.0.0:4567
      Failed to open socket on port 57296, waiting 1000 ms before retrying
      Failed to open socket on port 57296, waiting 1000 ms before retrying

      posted in NodeBB Plugins
      M
      madwyn

    Get Started

    • Product
    • Pricing

    Resources

    • Demo Site
    • Answers
    • Docs
    • Bug Bounty

    Company

    • About
    • Blog
    • Contact
    Start Free Trial
    Github Facebook Instagram Twitter
    © 2014 – 2022 NodeBB, Inc. — Made in Canada.
    • Terms
    • Privacy
    • GDPR
    • DMCA
    • Contact
    Menu
    • Terms
    • Privacy
    • GDPR
    • DMCA
    • Contact