From 850d47d6760b7c8701128d19fbd74aa0a78f534c Mon Sep 17 00:00:00 2001 From: Bangara Raju Kottedi Date: Wed, 30 Aug 2023 04:02:12 +0530 Subject: [PATCH 1/2] scripts updated --- db_scripts/PostLikeCounter.sql | 9 +++++++++ db_scripts/PostVisitCounter.sql | 9 +++++++++ db_scripts/mysql.sql | 7 +++++-- 3 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 db_scripts/PostLikeCounter.sql create mode 100644 db_scripts/PostVisitCounter.sql diff --git a/db_scripts/PostLikeCounter.sql b/db_scripts/PostLikeCounter.sql new file mode 100644 index 0000000..3dc2919 --- /dev/null +++ b/db_scripts/PostLikeCounter.sql @@ -0,0 +1,9 @@ +CREATE TABLE `PostLikeCounter` ( + `id` int(20) NOT NULL AUTO_INCREMENT, + `siteid` varchar(500), + `postid` varchar(500), + `count` int(20), + `datecreated` timestamp DEFAULT current_timestamp() , + `datemodified` timestamp DEFAULT current_timestamp() ON UPDATE current_timestamp(), + PRIMARY KEY (`id`) +) diff --git a/db_scripts/PostVisitCounter.sql b/db_scripts/PostVisitCounter.sql new file mode 100644 index 0000000..445acdb --- /dev/null +++ b/db_scripts/PostVisitCounter.sql @@ -0,0 +1,9 @@ +CREATE TABLE `PostVisitCounter` ( + `id` int(20) NOT NULL AUTO_INCREMENT, + `siteid` varchar(500), + `postid` varchar(500), + `count` int(20), + `datecreated` timestamp DEFAULT current_timestamp() , + `datemodified` timestamp DEFAULT current_timestamp() ON UPDATE current_timestamp(), + PRIMARY KEY (`id`) +) diff --git a/db_scripts/mysql.sql b/db_scripts/mysql.sql index ce66b43..83a459c 100644 --- a/db_scripts/mysql.sql +++ b/db_scripts/mysql.sql @@ -10,9 +10,12 @@ SHOW GRANTS FOR blog_admin@'%'; FLUSH PRIVILEGES - -- Create Counter Table -- DROP TABLE PostVisitCounter --- create table PostVisitCounter (id INT(20) NOT NULL AUTO_INCREMENT PRIMARY KEY, siteid nvarchar(500), postid nvarchar(500), count INT(20), datecreated TIMESTAMP, datemodified TIMESTAMP); \ No newline at end of file +-- DROP TABLE PostLikeCounter + +-- create table PostVisitCounter (Id INT(20) NOT NULL AUTO_INCREMENT PRIMARY KEY, SiteId nvarchar(500), PostId nvarchar(500), Count INT(20), DateCreated TIMESTAMP, DateModified TIMESTAMP); + +-- create table PostLikeCounter (Id INT(20) NOT NULL AUTO_INCREMENT PRIMARY KEY, SiteId nvarchar(500), PostId nvarchar(500), Count INT(20), DateCreated TIMESTAMP, DateModified TIMESTAMP); \ No newline at end of file From 4a11f0c85075f18ad2c9584717cf9ac7a0aad0ae Mon Sep 17 00:00:00 2001 From: Bangara Raju Kottedi Date: Wed, 6 Sep 2023 18:44:23 +0530 Subject: [PATCH 2/2] Likes and Views as a Single component: Improved ui --- _includes/likes-views.html | 44 ++++++++++++++++++++++++++++++++++++++ _includes/likes.html | 23 ++++---------------- _includes/views.html | 14 +++--------- _layouts/post.html | 5 ++--- 4 files changed, 53 insertions(+), 33 deletions(-) create mode 100644 _includes/likes-views.html diff --git a/_includes/likes-views.html b/_includes/likes-views.html new file mode 100644 index 0000000..a87b243 --- /dev/null +++ b/_includes/likes-views.html @@ -0,0 +1,44 @@ + + + {% include views.html tooltip=true onload=false lang=lang %} + {% include likes.html tooltip=true onload=false lang=lang %} + + \ No newline at end of file diff --git a/_includes/likes.html b/_includes/likes.html index d62bf67..29fce07 100644 --- a/_includes/likes.html +++ b/_includes/likes.html @@ -1,5 +1,3 @@ - -