Navigation

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Popular
    • Tags
    • Users
    • Groups
    1. Home
    2. Michael Joseph Aubry
    • Profile
    • Following 0
    • Followers 0
    • Topics 9
    • Posts 29
    • Best 5
    • Groups 0

    Michael Joseph Aubry

    @Michael Joseph Aubry

    8
    Reputation
    640
    Profile views
    29
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    Michael Joseph Aubry Follow

    Best posts made by Michael Joseph Aubry

    • RE: Filtering posts based on a few paramaters?

      Ok so I have successfully done this with solr!

      This is probably obvious to all expert nodebb people here, but for me I had to really look at the source code/docs/google to understand how the eco system works.

      After configuring the nodebb-plugin-solr the api call out of the box looks like /api/search/KEYWORD?in=titlespost I am still trying to figure out how the plugin is hooked up with the core and how this route triggers the solr query.

      Simply with ajax I just make a get request to the route and with the response I see now how I can use ajaxify.

      // search function
      $('form.search').on('submit', function(e) {
          e.preventDefault();
      
          var word = $(this).find('input.searchV').val();
      
          $.ajax({
              url: '/api/search/'+word+'?in=titlesposts',
              type: 'get',
              dataType: 'html',
              success: function (data) {
                  var parsed = JSON.parse(data);
                  var results = parsed;
      
                  console.log(results);
                  
                  // TODO: pass results.posts into template
                  ajaxify.loadTemplate('partials/search_results_topic', function(resultItem) {
                      var html = templates.parse(resultItem, results);
                      $('.topic-list').html(html);
                  });
      
              },error: function(data) {
      
                  // TODO: error handling
                  console.log(data);
              }
          });
      
      });
      posted in NodeBB Plugins
      Michael Joseph Aubry
      Michael Joseph Aubry
    • RE: Nodebb Docker commands?

      @qgp9 said:

      vertheless, I don't discourage you to use docker!!, I encourage it
      I'm just giving a most important tip here. "Don't use docker for production before you know how to deal with a concept of a temporary container" but GOOD FOR TEST AND LEARN.

      Thanks for the positive answer, it was fun playing around with docker. I ended up realizing the most simple solution was just to share one redis db, duh right. It was good to play around with docker though I did learn a bit.

      posted in NodeBB Development
      Michael Joseph Aubry
      Michael Joseph Aubry
    • Error: Cannot find module './Categories' linux?

      On my mac I have everything working smoothly when I deployed it on my linux server everything runs fine except for the call to the Categories module.

      Here is how I call the module inside my /theme.js file inside the root of my theme.

      console.log(module.parent)
      var Categories = module.parent.require("./Categories");
      

      I took a look at the result of module.parent and I am not seeing categories available, but I do see it available locally.

      I tried hard linking to the module ../../src/Categories but no luck.

      Does anyone have a clue why this is happening?

      posted in Technical Support
      Michael Joseph Aubry
      Michael Joseph Aubry
    • RE: Is there a way to separate a question block from all answers block?

      I found the answer https://docs.nodebb.org/en/latest/themes/templates.html

      <!-- BEGIN posts -->
      <!-- IF @first -->
      <h1>Main Author: {posts.username}</h1>
      <!-- ENDIF @first -->
      {posts.content}
      <!-- IF @last -->
      End of posts. Click here to scroll to the top.
      <!-- ENDIF @last -->
      <!-- END posts -->

      posted in Technical Support
      Michael Joseph Aubry
      Michael Joseph Aubry
    • How do I override nodebb-plugin-composer-default?

      If I want to preserve the functionality of the nodebb-plugin-composer-default but insert my own template how can I do that?

      posted in Technical Support
      Michael Joseph Aubry
      Michael Joseph Aubry

    Latest posts made by Michael Joseph Aubry

    • Can't figure out why ajaxify is not loading for profile link?

      Ajaxify is working for all categories, but when I click to go to the profile ajaxify gets hung up.

      It is showing the profile data, but I have no clue why is not rendering the profile. I have a highly customized theme, I think it's some bug I have created but I cannot debug this. I was hoping someone has a possible idea why this may be happening.

      Let me know if you need more information.

      0_1459187058979_Screen Shot 2016-03-28 at 10.43.55 AM.png image url)

      posted in NodeBB Development
      Michael Joseph Aubry
      Michael Joseph Aubry
    • RE: Nodebb Docker commands?

      @qgp9 said:

      vertheless, I don't discourage you to use docker!!, I encourage it
      I'm just giving a most important tip here. "Don't use docker for production before you know how to deal with a concept of a temporary container" but GOOD FOR TEST AND LEARN.

      Thanks for the positive answer, it was fun playing around with docker. I ended up realizing the most simple solution was just to share one redis db, duh right. It was good to play around with docker though I did learn a bit.

      posted in NodeBB Development
      Michael Joseph Aubry
      Michael Joseph Aubry
    • RE: Nodebb Docker commands?

      Here is a possible solution, looks good I havent tested it yet because I am being blocked by this error warn: NodeBB Setup Aborted. getaddrinfo ENOTFOUNDhttp://stackoverflow.com/questions/36072140/docker-issue-commands-to-an-app-inside-container

      posted in NodeBB Development
      Michael Joseph Aubry
      Michael Joseph Aubry
    • Nodebb Docker commands?

      With NodeBB you can run ./nodebb start to stop you can do ./nodebb stop. Now that I have dockerized it http://nodebb-francais.readthedocs.org/projects/nodebb/en/latest/installing/docker/nodebb-redis.html I am not sure how I can interact with it.

      I have followed the steps "Using docker-machine mac os x"

      docker run --name my-forum-redis -d -p 6379:6379 nodebb/docker:ubuntu-redis
      

      Then

      docker run --name my-forum-nodebb --link my-forum-redis:redis -p 80:80 -p 443:443 -p 4567:4567 -P -t -i nodebb/docker:ubuntu
      

      Then

      docker start my-forum-nodebb
      

      I had an issue with redis address in use, so I want to fix that and restart but I am not sure how? Also I would like to issue the command grunt in the project directory, again not sure how?

      My question is how can I interact with an app inside a docker container as if I had direct access to the project folder itself? Am I missing something?

      I hate inconsistent environments, configuring stuff locally and on cloud to create consistency, also DB content, so I figured docker would be great for this. I would like to run docker on my mac using docker-machine, but I am not sure if it has the ability to use grunt etc?

      posted in NodeBB Development
      Michael Joseph Aubry
      Michael Joseph Aubry
    • RE: Custom api router?

      Oh damn lol I messed that up. Ok cool thanks!

      posted in Technical Support
      Michael Joseph Aubry
      Michael Joseph Aubry
    • RE: Custom api router?

      Figured it out res.res.json({"test": true})

      Edit:

      @psychobunny why dont you do req.req.params.id inside your custom pages plugin instead of parsing the url?

      posted in Technical Support
      Michael Joseph Aubry
      Michael Joseph Aubry
    • RE: Custom api router?

      @Michael-Joseph-Aubry I found to get the is I can use req.req.params, now I am going to figure out how to do res.json

      posted in Technical Support
      Michael Joseph Aubry
      Michael Joseph Aubry
    • Custom api router?

      I want to build my own api, I have a custom composer and a custom post type that consists of only an image and title, it acts as a feed.

      Inside my theme I want to build a custom api router, for now I have figured out how to add data to the database, but I am limited in the router.

      var theme = {};
      var db = module.parent.require('./database');
      var Categories = module.parent.require("./categories");
      
      theme.init = function(params, callback) {
      	var app = params.app;
      	var router = params.router;
      
      	app.get('/api/test/:id', function(res, req, next) {
      		console.log(req.params);
      		res.json(req)
      		// db.set('test', req.params.id, function() {
      		// 	res.json({working:true});
      		// });
      	});
      
      	callback(null);
      };
      

      The app in this case is not the typical express app, it doesn't seem. So I see in the nodebb-custom-pages plugin bunny parses the url, which is ok I guess, but I am still limited it seems I can only res.render() I cant use methods like res.json().

      Any advice?

      posted in Technical Support
      Michael Joseph Aubry
      Michael Joseph Aubry
    • RE: Error: Cannot find module './Categories' linux?

      @baris Holy shit it actually worked but I dont see it in the console.log?

      posted in Technical Support
      Michael Joseph Aubry
      Michael Joseph Aubry
    • RE: Error: Cannot find module './Categories' linux?

      I can require other modules that are exposed inside the module.parent but I am so confused why Categories is not exposed?

      posted in Technical Support
      Michael Joseph Aubry
      Michael Joseph Aubry