diff --git a/blog/sidebar.js b/blog/sidebar.js index ac82c1a..55950fc 100644 --- a/blog/sidebar.js +++ b/blog/sidebar.js @@ -45,6 +45,26 @@ const getInformationForCategories = function(templateContext) }; +const getInformationForPinnedPosts = function(templateContext) +{ + return new Promise(function(resolve, reject) + { + sql.getPinnedPosts().then(function(posts) + { + posts.forEach(function(p) + { + p.url = '/' + p.category + '/' + p.url; + }); + templateContext.pinnedPosts = posts; + resolve(); + }).catch(function(error) + { + reject(error); + }) + }); +}; + + module.exports= { main: function(templateContext) @@ -53,6 +73,7 @@ module.exports= { Promise.all([includes.fetchTemplate(TEMPLATE_FILE), getInformationForRecentPosts(templateContext), + getInformationForPinnedPosts(templateContext), getInformationForCategories(templateContext)]) .then(function(content) { diff --git a/docs/sqlConfig.md b/docs/sqlConfig.md index cc438d6..867fdb2 100644 --- a/docs/sqlConfig.md +++ b/docs/sqlConfig.md @@ -29,9 +29,11 @@ picture_url varchar(100) not null, published datetime not null, name varchar(100) not null, url varchar(100) not null, +pinned BIT, primary key(post_id) ); +ALTER TABLE posts ADD pinned BIT; create table downloads( download_id mediumint unsigned not null AUTO_INCREMENT, diff --git a/includes/html/incorrectHost.html b/includes/html/incorrectHost.html deleted file mode 100644 index 3822599..0000000 --- a/includes/html/incorrectHost.html +++ /dev/null @@ -1,8 +0,0 @@ -
Someone is trying to rip off my website.
-Click here to go to the genuine site.
-