Use this in a text editor that supports regex search (like Sublime Text)
Find all
\{\{#if ([\S]*)\}\}([\s\S]*?)\{\{else\}\}([\s\S]*?)\{\{/if\}\}
Replace With
<!-- IF $1 -->$2<!-- ELSE -->$3<!-- ENDIF $1 -->
Use this in a text editor that supports regex search (like Sublime Text)
Find all
\{\{#if ([\S]*)\}\}([\s\S]*?)\{\{else\}\}([\s\S]*?)\{\{/if\}\}
Replace With
<!-- IF $1 -->$2<!-- ELSE -->$3<!-- ENDIF $1 -->
var async = require('async'), | |
categories = module.parent.require('./categories'); | |
var Plugin = {}; | |
function renderHomepage(req, res, next) { | |
var uid = req.user ? req.user.uid : 0; | |
/* | |
* For reference, this is taken straight from controllers/index.js (controllers.home) |
{ | |
"categories": [ | |
{ | |
"cid": "1", | |
"name": "Announcements", | |
"description": "Announcements regarding our community", | |
"icon": "fa-bullhorn", | |
"bgColor": "#0059B2", | |
"color": "#fff", | |
"slug": "1/announcements", |
{ | |
"id": "nodebb-plugin-blog-comments", | |
"name": "NodeBB Blog Comments", | |
"description": "Lets NodeBB act as a comments engine/widget for your blog.", | |
"url": "https://github.com/psychobunny/nodebb-plugin-blog-comments", | |
"library": "./library.js", | |
"hooks": [ | |
{ | |
"hook": "filter:admin.header.build", "method": "addAdminLink" | |
}, |
<?php | |
if ( post_password_required() ) | |
return; | |
?> | |
<a id="nodebb/comments"></a> | |
<script type="text/javascript"> | |
var nodeBBURL = 'http://forum.burnaftercompiling.com', | |
articleID = '<?php echo the_ID(); ?>'; |
module.listLTrim = function(key, start, stop, callback) { | |
module.getListRange(key, start, stop, function(err, value) { | |
if(err) { | |
if(typeof callback === 'function') { | |
return callback(err); | |
} | |
return; | |
} | |
db.collection('objects').update({_key: key }, {$set: value}, function(err, result) { |
var topics = module.parent.require('./topics'), | |
async = module.parent.require('async'); | |
var plugin = {}; | |
plugin.addPostData = function(data, uid, callback) { | |
async.map(data.topics, function(topic, next) { | |
topics.getMainPost(topic.tid, uid, function(err, mainPost) { | |
topic.mainPost = mainPost; | |
next(err, topic); |
var matches = null, | |
regex = regex = /[ \t]*<!-- IMPORT ([\s\S]*?)? -->[ \t]*/g, | |
apiCalls = [], | |
matchList = [], | |
deferredObjects = []; | |
while((matches = regex.exec(html)) !== null) { | |
var deferredObject = $.Deferred(); | |
deferredObjects.push(deferredObject); |
// paste this in https://github.com/NodeBB/NodeBB/blob/master/src/routes/debug.js | |
// and then don't forget to remove it! | |
router.get('/remove-op', function(req, res) { | |
var db = require('../database'), | |
async = require('async'); | |
db.getSortedSetRange('topics:tid', 0, -1, function(err, tids) { | |
async.eachLimit(tids, 50, function(tid, next) { | |
db.getSortedSetRange('tid:' + tid + ':posts', 0, 0, function(err, pid) { |
define('notifications', ['events', 'components'], function(events, components) { | |
var notifications = {}; | |
notifications.init = function() { | |
events.initialize('notifications', function() { | |
this.register('icon.unread', markUnread); | |
this.register('icon.read', markRead); | |
}); |