@baris I want chage the language in admin panel (if the language can be changed in admin panel) .
I don't know how I must do to do it.
@baris I want chage the language in admin panel (if the language can be changed in admin panel) .
I don't know how I must do to do it.
I want change language in IT but I don't know where I must do to change this settting. Anyone can help me to resolve this problem?
I want to use my flag.json or my error.json in my plugin and not the files that are in public/language/en-GB/flags.json
. My plugin's structure folder is this:
languages
----->flag.json
----->error.json
I want read my text in these files, How can I do that?
Example
<div class="col-md-4 col-xs-12 ">
<button class="btn btn-default flag-reason" disabled="true" name="bottone_flag">[[flags:modal-reason-offensive]]</button>
</div>
In this way I read the default value but I want to customize with my file so something like this:
[[languages flags:modal-reason-offensive]]
But this it doesn't work. Anyone can help me?
Suppose to have the default text that it is the value of:
[[user:bookmarks]]
I want put this text in html component that I create with a function:
function createElement(pid) {
return '<a name="pid' + pid + '" role="menuitem" tabindex="-1" href="#" data-favourited="false"><span class="favourite-text">[[user:bookmarks]]</span> <i component="post/bookmark/on" class="fa fa-heart hidden"></i><i component="post/bookmark/off" class="fa fa-heart-o"></i></a>' }
The problem is when the link appears, the text is "[[user:bookmarks]]" and not the real text that [[user:bookmarks]] refers. Anyone can help me?
The problem is that when I reload tpl page, I view the correct data for one instant and after the date value are replaced about "invalid date" . It not a problem about my controller.js because it sends the correct values to my tpl page.
This is the hmtl code problem is:
<small class="hidden-xs"><span class="timeago" title="{element.title}" datetime="{element.datatime}">{element.text}</span></small>
@julian I have a timestamp and I need to schedule the topic at this timestamp. So suppose that I want schedule topic at 01/12/2017(only) how can I modify the code to schedule the topic at these date?
I want schedule topic in the future with node-cron module. In details I want delay the topic creation at some timestamp. So in my plugin.jso I put this hook:
{
"hook": "filter:topic.create", "method": "editTopic"
}
and in my library.js
I do:
converter.editTopic = function(data, callback) {
var task = cron.schedule('* * * * *', function() {
return callback(null, data);
}, false);
task.start();
};
If I execute my code, the topic creation is schedule after a minute but in this minute the composer to write topics and posts is blocked. After that node-cron executes its task the composer become unblocked.
I don't know if I can schedule topic in the future with node-cron
, Anyone can help me to understand or I can do that?
Suppose to have this hook:
"hook": "filter:topics.get", "method": "orderTopics"
I know that when the hook is called the method is execute, but I don't want always execute the method. For some url like this:
/station
I don't want that the hook is throwed and I want specify this in the method:
//server side library.js
converter.orderTopics = function(data, callback) {
//Something like this
var url_station=url.getUrl() // give me the current url
}
Anyone can help me?
in my centos console, after that I start nodebb , I read this error:
/usr/bin/node: relocation error: /usr/bin/node: symbol SSL_set_cert_cb, version libssl.so.10 not defined in file libssl.so.10 with link time reference
[cluster] Child Process (8285) has exited (code: 127, signal: null)
[cluster] Spinning up another process...
Anyone can help me to resolve this error?
@PitaJ can you write me the steps that I must do to obtain my purpose?
@PitaJ Yes I want to schedulate a notification in the future in a plugin and I want know if it is possibile or not!
I need to schedulate notification in the future is it possible?
@julian I have just implemented my solution with setTimeout(). I think that is a good solution:
Julian can explain me if my solution can be good or not for you? and can you explain the problem to use setTimeout()?
I would know if it exists some method (API) that let me to schedule task in future in nodebb, or I must use setTimeout()?
I think that the default topics order is " creation" . The last creation topic is at the top. Now I need to order with "timestamp", there is some method in admin or I must do with hooks?
@baris I need override the path because I need modify some values, so the default path is not correct for me, My question is how can I override the default "/api/categories" path and modify some value?
@julian I need to override "/categories". I don't know how is it possible that when the
"ajaxify.loadData(url, function(err, data) {"
is called, with url="categories", the response is an HTML page and not a object
The problem is that when I write the path " /categories" ,a function "ajaxify.go = function (url, callback, quiet)" is called and I obtain the error. My purpose is overwrite the path" /categories" with my code:
This is my code:
{
"hook": "static:app.preload", "method": "preload"
},
This is my library.js:
converter.preload = function(params, callback) {
var app = params.app,
hostMiddleware = params.middleware;
helpers.setupPageRoute(app,'/categories', hostMiddleware,[], controllers.renderCategories);
helpers.setupPageRoute(app,'/api/categories', hostMiddleware,[], controllers.renderCategories);
callback();
};
This is my controllers.js:
Controllers.renderCategories1 = function(req, res, callback) {
res.locals.metaTags = [{
name: "title",
content: validator.escape(String(meta.config.title || 'NodeBB'))
}, {
name: "description",
content: validator.escape(String(meta.config.description || ''))
}, {
property: 'og:title',
content: '[[pages:categories]]'
}, {
property: 'og:type',
content: 'website'
}];
var ogImage = meta.config['og:image'] || meta.config['brand:logo'] || '';
if (ogImage) {
if (!ogImage.startsWith('http')) {
ogImage = nconf.get('url') + ogImage;
}
res.locals.metaTags.push({
property: 'og:image',
content: ogImage
});
}
var categoryData;
async.waterfall([
function(next) {
categories.getCategoriesByPrivilege('cid:0:children', req.uid, 'find', next);
},
function(_categoryData, next) {
categoryData = _categoryData;
var allCategories = [];
categories.flattenCategories(allCategories, categoryData);
categories.getRecentTopicReplies(allCategories, req.uid, next);
}
], function(err) {
if (err) {
return next(err);
}
var data = {
title: '[[pages:categories]]',
categories: categoryData
};
//console.log("TITE "+data.title);
if (req.path.startsWith('/api/categories') || req.path.startsWith('/categories')) {
data.breadcrumbs = helpers.buildBreadcrumbs([{
text: data.title
}]);
}
data.categories.forEach(function(category) {
if (category && Array.isArray(category.posts) && category.posts.length) {
category.teaser = {
url: nconf.get('relative_path') + '/topic/' + category.posts[0].topic.slug + '/' + category.posts[0].index,
timestampISO: category.posts[0].timestampISO,
pid: category.posts[0].pid
};
}
});
res.render('categories', data);
});
};
This is ajaxify.js and the error is at line " app.template=data.template.name"
ajaxify.go = function (url, callback, quiet) {
if (!socket.connected) {
if (ajaxify.reconnectAction) {
$(window).off('action:reconnected', ajaxify.reconnectAction);
}
ajaxify.reconnectAction = function(e) {
ajaxify.go(url, callback, quiet);
$(window).off(e);
};
$(window).on('action:reconnected', ajaxify.reconnectAction);
}
if (ajaxify.handleRedirects(url)) {
return true;
}
app.leaveCurrentRoom();
$(window).off('scroll');
if ($('#content').hasClass('ajaxifying') && apiXHR) {
apiXHR.abort();
}
if (!window.location.pathname.match(/\/(403|404)$/g)) {
app.previousUrl = window.location.href;
}
url = ajaxify.start(url);
// If any listeners alter url and set it to an empty string, abort the ajaxification
if (url === null) {
$(window).trigger('action:ajaxify.end', {url: url, tpl_url: ajaxify.data.template.name, title: ajaxify.data.title});
return false;
}
console.log("UR "+JSON.stringify(url));
previousBodyClass = ajaxify.data.bodyClass;
$('#footer, #content').removeClass('hide').addClass('ajaxifying');
ajaxify.loadData(url, function(err, data) {
if (!err || (err && err.data && (parseInt(err.data.status, 10) !== 302 && parseInt(err.data.status, 10) !== 308))) {
ajaxify.updateHistory(url, quiet);
}
if (err) {
return onAjaxError(err, url, callback, quiet);
}
retry = true;
//console.log(data);
app.template = data.template.name;
console.log("DATA "+JSON.stringify(data));
require(['translator'], function(translator) {
translator.load(config.defaultLang, data.template.name);
renderTemplate(url, data.template.name, data, callback);
});
});
return true;
};
when the path go on the "/categories" and the method ajaxify.go is called (ajaxify.loadData()) , it returns the HTML code of page and not an object and so it shows me this error.
Anyone can help me to resolve this?