Back to vBulletin 4.x Add-ons

Show bold title on blog entry search results if the entry contains unread comments
Mod Version: 1.00, by Andreas

vB Version: 4.1.7 Rating: (0 vote - 0 average) Installs: 6
Released: 07 Nov 2011 Last Update: Never Downloads: 0
Not Supported  

This little patch against 4.1.8 Beta 1 does make the blog titles bold on blog entry search results if teh blog entry contains unread comments.

No warranties whatsoever, have fun

Code:
--- C:/Users/Andreas.ANDREASKNEU/Desktop/blogentry.php	Mon Nov 07 21:14:48 2011
+++ C:/xampplite/htdocs/vb418/packages/vbblog/search/result/blogentry.php	Mon Nov 07 21:15:12 2011
@@ -69,10 +69,10 @@
 		}
 		$set = $vbulletin->db->query_read_slave("
-			SELECT blog.*, IF(blog_user.title <> '', blog_user.title, blog.username) AS blogtitle,
-			blog_text.pagetext
+			SELECT blog.*, IF(blog_user.title <> '', blog_user.title, blog.username) AS blogtitle, blog_text.pagetext, blog_read.readtime
 			FROM " . TABLE_PREFIX ."blog AS blog
 			LEFT JOIN " . TABLE_PREFIX ."blog_text AS blog_text on blog_text.blogtextid = blog.firstblogtextid
+			LEFT JOIN " . TABLE_PREFIX . "blog_read AS blog_read ON (blog_read.blogid = blog.blogid AND blog_read.userid = " . $vbulletin->userinfo['userid'] . ")
 			$blog_user_join $perm_parts[join]
 			WHERE blog.blogid IN (" . implode(',', array_map('intval', $ids)) . ") AND ($perm_parts[where])
 		");
@@ -149,6 +149,11 @@
 		$blog['time'] = vbdate($vbulletin->options['timeformat'], $blog['dateline']);
 		$blog['date'] = vbdate($vbulletin->options['dateformat'], $blog['dateline'], true);
+		
+		if ($blog['readtime'] < $blog['lastcomment'])
+		{
+			$blog['title'] = '<b>' . $blog['title'] . '</b>';
+		}
 		$templater = vB_Template::create($template_name);
 		$templater->register('blog', $blog);
 		$templater->register('dateline', $blog['dateline']);

Download

No files for download.

Similar Mods

Miscellaneous Hacks Search Controller: New Blog Comments vBulletin 4.x Add-ons
Board Optimization Prevent Duplicate Title from Search Results vBulletin 4.x Add-ons
vBulletin Blog New Blogs/Comments in Forum Search Results vBulletin 3.7 Add-ons

vblts.ru supports vBulletin®, 2022-2024