Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- "use strict";
- var replyThread = require("../../form/replyThread");
- var newThread = require("../../form/newThread");
- exports.engineVersion = "2.4";
- exports.setTitles = function(parameters) {
- for (var i = 0; i < parameters.files.metadata.length; ++i) {
- var oldTitle = parameters.files.metadata[i].title;
- var newTitle = Math.floor(new Date() / 1000);
- var periodIndex = oldTitle.lastIndexOf(".");
- if (periodIndex !== -1)
- newTitle += oldTitle.substring(periodIndex, oldTitle.length);
- parameters.files.metadata[i].title = newTitle;
- }
- };
- exports.init = function() {
- var oldCreatePost = replyThread.createPost;
- replyThread.createPost = function(json, req, userData, parameters, captchaId, res, auth) {
- exports.setTitles(parameters);
- oldCreatePost(json, req, userData, parameters, captchaId, res, auth);
- };
- var oldCreateThread = newThread.createThread;
- newThread.createThread = function(json, req, user, parameters, captchaId, res, auth) {
- exports.setTitles(parameters);
- oldCreateThread(json, req, user, parameters, captchaId, res, auth);
- };
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement