Navigation

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Popular
    • Tags
    • Users
    • Groups
    1. Home
    2. aneeeshp
    • Profile
    • Following 0
    • Followers 0
    • Topics 4
    • Posts 14
    • Best 2
    • Groups 0

    aneeeshp

    @aneeeshp

    3
    Reputation
    691
    Profile views
    14
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    aneeeshp Follow

    Best posts made by aneeeshp

    • RE: Who is using NodeBB?

      We just started using NodeBB for our community https://www.mbatious.com/

      NodeBB is rocking with an amazing user experience.

      posted in General Discussion
      aneeeshp
      aneeeshp
    • RE: Custom template for a particular topic

      @pitaj Thank you. Issue was with the condition. I have used condition as shown below which solved the problem.

      post.posts[0].tid === 1090
      
      posted in NodeBB Development
      aneeeshp
      aneeeshp

    Latest posts made by aneeeshp

    • RE: where is the api docs for nodebb?

      @creatxr @julian Just tried this code, but, 'csrf_token' value is false. uid value is -1.

      Tried the same query from a web browser, this time there is a csrf_token token returned and uid value is 0.

      Why is this difference? How to avoid this in the python code?

      posted in NodeBB Development
      aneeeshp
      aneeeshp
    • RE: Custom template for a particular topic

      @pitaj Thank you. Issue was with the condition. I have used condition as shown below which solved the problem.

      post.posts[0].tid === 1090
      
      posted in NodeBB Development
      aneeeshp
      aneeeshp
    • RE: Custom template for a particular topic

      Thank you all for the suggestions. I tried @PitaJ `s solution. This is what I have done:

      In library.js in my custom theme, I added:

      benchpress.registerHelper('isTaskList', function (post) {
              return post.tid === 1090;
      });
      

      In lib/persona.js in my custom theme, in the $(document).ready event, i added:

      templates.registerHelper('isTaskList', function (post) {
              return post.tid === 1090;
      });
      

      And then in the templates/partials/topic/post.tpl, I have used:

      <!-- IF function.isTaskList -->
      

      as the condition

      The condition is working as expected when the page is initially loaded for the posts that are loaded/displayed initially, however when I scroll down and when the further posts are getting loaded/displayed at the bottom of the page, the condition is not taking into effect. Could you please advise if something is missing?

      posted in NodeBB Development
      aneeeshp
      aneeeshp
    • RE: Custom template for a particular topic

      @julian Thank you for replying. I am thinking of a small hack in that case. Let me know if this will work. What if I create a custom route and use a modified version of the original topic.tpl as its template?

      
      var controllers = require('./lib/controllers'),
      plugin = {};
      
      plugin.init = function(params, callback) {
      	var router = params.router;
      	var middleware = params.middleware;
      
        // Define the function that renders the custom route.
      	function render(req, res, next) {
      
      		// Get data object corresponding to the specific topic. The topic ID is fixed.
      		var data;
      
      		// This is the path to your template without the .tpl, relative to the templates directory in plugin.json
      		var template = 'my-custom-page'
      
      		// Send the page to the user.
      		res.render(template, data);
      	}
      
      	// This actually creates the routes, you need two routes for every page.
      	// The first parameter is the actual path to your page.
      	router.get('/my-custom-page', middleware.buildHeader, render);
      	router.get('/api/my-custom-page', render);
        
      	callback();
      };
      
      module.exports = plugin;
      

      'data' needs to be filled with information about a specific topic. If this is possible, then how can I get the data object corresponding to a particular topic in the render function? Is there some function that can take a topic id as input and just return 'data'?

      posted in NodeBB Development
      aneeeshp
      aneeeshp
    • Custom template for a particular topic

      Is it possible to have a custom template for a particular topic (identified by a topic id)? Something like topic_tid.tpl somewhere in a plugin or theme? My intention is to be able to theme a specific topic and leave the remaining use the default topic template.

      posted in NodeBB Development
      aneeeshp
      aneeeshp
    • RE: NodeBB WebView App v3

      This app helps a lot. It works well with OneSignal notifications as well. But one doubt. When sending notification from OneSignal, when user clicks on the notification in mobile, can they be redirected to a page in the app?

      posted in NodeBB Plugins
      aneeeshp
      aneeeshp
    • RE: How to use Write API to chat with user in a chat room

      @yariplus Thank you. This helps a lot. 😃

      posted in NodeBB Plugins
      aneeeshp
      aneeeshp
    • RE: How to use Write API to chat with user in a chat room

      Can it be achieved with some code changes in writeapi plugin? Could you help me with some starting point in code to achieve this?

      posted in NodeBB Plugins
      aneeeshp
      aneeeshp
    • How to use Write API to chat with user in a chat room

      Hi,
      I tried to user Write API`s chat route /api/v1/users/<uid>/chats in order to chat with user using a bot. However every time when I am sending a message, it is creating a new chatroom. The POST operation onto /api/v1/users/<uid>/chats is creating a chat room & returning its id.

      {"code":"ok","payload":{"content":"<p>Hello</p>\n","timestamp":1498844643722,"fromuid":18,"roomId":8,"messageId":133,"fromUser":{"username":"mbatious","userslug":"mbatious","picture":"/uploads/profile/18-profileimg.png","status":"offline","uid":18,"icon:text":"M","icon:bgColor":"#f44336"},"self":1,"timestampISO":"2017-06-30T17:44:03.722Z","newSet":true,"cleanedContent":"Hello\n","mid":133}}

      However I am not finding a way use this roomId in further messages. The only parameters accepted in /api/v1/users/<uid>/chats API are message, timestamp & quiet. How to continue chat in a previously created room?

      posted in NodeBB Plugins
      aneeeshp
      aneeeshp
    • Error while using piwik tracking code in custom header

      Re: How To: Piwik and NodeBB

      I tried to use the code mentioned in this topic, but am getting an error in console. Webpage where I added the code is: https://www.mbatious.com/recent

      Error:
      _paq.push() was used but Piwik tracker was not initialized before the piwik.js file was loaded. Make sure to configure the tracker via _paq.push before loading piwik.js. Alternatively, you can create a tracker via Piwik.addTracker() manually and then use _paq.push but it may not fully work as tracker methods may not be executed in the correct order. ["setCustomUrl", "https://www.mbatious.com/recent"]

      Can anybody help me come out of this?

      posted in Technical Support
      aneeeshp
      aneeeshp