• 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. Landa
    L
    • Profile
    • Following 0
    • Followers 0
    • Topics 3
    • Posts 10
    • Best 0
    • Controversial 0
    • Groups 0

    Landa

    @Landa

    0
    Reputation
    507
    Profile views
    10
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    Landa Unfollow Follow

    Latest posts made by Landa

    • RE: Redirection to route in plugin

      Up,
      Can anyone help me, please?

      posted in NodeBB Development
      L
      Landa
    • RE: Redirection to route in plugin

      I'm up to date, in fact I wrote your commit in my nodebb core yesterday.

      2- Now I rewrite the code and I have This

      [...]
        if(topicTitle.indexOf('+hd')  >= 0) {
        //Contiene la etiqueta +HD
        if (userid <= 1 || tagsTitle.postCount  == 0 ) {
          //Redireccionar
          callback({
            status: 302,
            path: '/topicerror'
          }, postContent);
      }
        }
      [...]
      

      But console give me the same error, ''error: [plugins] filter:topic.get, undefined''

      posted in NodeBB Development
      L
      Landa
    • RE: Redirection to route in plugin

      @psychobunny

      Well, Now I have this code:

      plugin.filterTopicGetMethod = function (postContent, callback) {
         if(awesomeCondition == true ) {
             //Do a redirection
                 callback({
            status: 302,
            path: '/topicerror'
          });
         }
       callback(null, postContent)
       };
      

      And the console give me this error:
      Selección_003.png

      posted in NodeBB Development
      L
      Landa
    • RE: Redirection to route in plugin

      Thanks for your colaboration, I'm going to try this

      posted in NodeBB Development
      L
      Landa
    • RE: Redirection to route in plugin

      The GitHub project

      https://github.com/rbbau/nodebb-plugin-tagstitle

      posted in NodeBB Development
      L
      Landa
    • Redirection to route in plugin

      I have a plugin that executes a "filter:topic.get"

      I need to doing a redirection to custom server route (localhost:4567/topicerror) when a "if clause" is true.

      I need that

      plugin.filterTopicGetMethod = function (postContent, callback) {
         if(awesomeCondition == true ) {
             //Do a redirection
         }
      callback(null, postContent)
      };
      

      What is the way for doing this?

      Thanks

      posted in NodeBB Development
      L
      Landa
    • RE: What is the problem in this library.js?

      Thanks, problem solved, it was the nodebb version. Now I have 0.6.1

      posted in NodeBB Development
      L
      Landa
    • What is the problem in this library.js?

      I have this

      var tagsTitle = {};
      
        tagsTitle.init = function(params, callback) {
      var app = params.app;
      var controllers = params.controllers;
      callback();
      };
      
      module.exports = tagsTitle;
      

      But the console give me this error:

      "Type error: Object is not a function at Object.tagsTitle.init"

      What is the problem?

      Thanks for the help

      posted in NodeBB Development
      L
      Landa
    • RE: Do an action when users go to topics

      Thanks, I have just solved the error.

      But the code doesn't work for now. How can I do execute a function when user go to topic?

      Thanks

      posted in NodeBB Development
      L
      Landa
    • Do an action when users go to topics

      Hello guys. First I need apologize for my bad expression because in this moment I'm learning English and my control of the English language is very poor.

      My problem is the next, I'm developing a plugin that allows users to write special tags in title (For example, "+nsfw" or "+private". This tags grant some features to post. What hook do I need use?

      In this moment I have that, but it doesn't work.

      Plugin.json

      {
        "id": "nodebb-plugin-tagstitle"
      , "name": "Special Tags in Title for NodeBB"
      , "description": "This plugin allows users create new topics with special restrictions with special tags, for example, +hd, +prv, +nsfw..."
      , "url": "https://github.com/rbbau/nodebb-plugin-tags-title"
      , "library": "./library.js"
      ,"hooks": [
      	{ "hook": "filter:category.topics.get", "method": "goPage" },
      ]
      }
      

      Library.js

      Topics = module.parent.require('./topics'),
      User = module.parent.require('./user'),
      
      var TagsTitle = {};
      	
      	TagsTitle.goPage = function(postData) {
      	//Conseguimos el título del post en minúsculas
      	var topicTitle = function() {
      		var topicTitle = postData;
      		var topicTitleLower = topicTitle.toLowerCase();
      		return topicTitleLower;
          };
      	alert(postData);
      	//Analizamos si existe el título o no para aplicar medidas
      	if(topicTitle == null) {  
      	//Don't do anything  
      	console.log('Título sin etiquetas');
          }		
      	else {
      		console.log('Título con etiquetas');
      		if(topicTitle.includes('+hd') == true)
      		{
      			//The topic titles contains +HD
      		}
      		else if(topicTitle.includes('+prv') == true)
      		{
      			//The topic titles contains +prv
      		}
      		else if(topicTitle.includes('+18') == true)
      		{
      			//The topic titles contains +18
      		}
      		else if(topicTitle.includes('+nsfw') == true)
      		{
      			//The topic titles contains +nsfw
      		}		 			
      	}
      	}
      module.exports = TagsTitle;
      
      posted in NodeBB Development
      L
      Landa

    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