• Downloading from our site will require you to have a paid membership. Upgrade to a Premium Membership from 10$ a month today!

    Dont forget read our Rules! Also anyone caught Sharing this content will be banned. By using this site you are agreeing to our rules so read them. Saying I did not know is simply not an excuse! You have been warned.

Widget: CMS Most Viewed Articles This Week

Admin

Well-Known Member
Staff member
Administrator
Most Viewed Articles This Week

1. Installation

1. Goto Admincp->vBullietin CMS->Widgets->Create New Widget
2. Choose PHP Direct Execution as Widget's Type
3. Insert a title. This Week's Most Popular for example.
4. Click Save
5. Click Configure on the right of the newly created widget.
6. Remove the default code that appears.
7. Copy and Paste the code in item 2 below.
8. Save
9. Goto Admincp->vBullietin CMS->Layout Manager
10. Add the Widget to your Layout
11. Click Save

2. PHP Code
PHP:
      // Current Week Most Viewed
  $starttime = time() - (3600*24*7);
  $mostpopularweek_get = vB::$db->query_read("
  SELECT DISTINCT
                 ca.contentid,
                 cn.publishdate,
                 cn.nodeid,
                 cni.title,
                 cni.viewcount
  FROM
   ".TABLE_PREFIX."cms_nodecategory cnc
  JOIN
   ".TABLE_PREFIX."cms_node cn
  ON 
  cnc.nodeid = cn.nodeid
  JOIN
   ".TABLE_PREFIX."cms_article ca
  ON
   cn.contentid = ca.contentid
  JOIN
   ".TABLE_PREFIX."cms_nodeinfo cni 
  ON
  cn.nodeid = cni.nodeid
  WHERE
  cn.setpublish = 1
  AND
  cn.publishdate>'".$starttime."'
  ORDER BY
  cni.viewcount desc
  LIMIT 5
     ");
  $output = '';
  while($article = vB::$db->fetch_array($mostpopularweek_get))
  {
            $output .='<div class = "cms_widget_post_bit"><h4 class="cms_widget_post_header"><a href="content.php?r='.$article[nodeid].'">'.$article[title].'</a> </h4></div>';
  }
 

Facebook Comments

Similar threads
Thread starter Title Forum Replies Date
Admin [CJ] Staff online widget vB5 Add-ons 0
Admin Yilmaz - Recent Visitors of the Profiles (vb5.6.x widget) Add-ons 0
Admin [EAE Add-ons] Thread preview widget Xenforo 0
Admin Resource Manger Stats Widget Xenforo 0
Admin [OzzModz] Attachment Stats Widget Xenforo 0
Admin Members online widget permission xenforo 2 Xenforo 0
Admin XFMG media widget type icons xenforo 2 Xenforo 0
Admin [AwesomeForo] - Node List widget xenforo 2 Xenforo 0
Admin How to make a tabbed widget xenforo 2 Xenforo 0
Admin [SC] TeamSpeak Widget in SideBar 1.1.0 xenforo 2.x Xenforo 0
Smobi Share Widget Framework Thread Thumbnails giống Tinh Tế Xenforo 0
Admin Thủ thuật kích hoạt lại tính năng gắn widget ra màn hình khóa của Android 4.4 Thủ thuật ĐTDĐ 0
Admin vBSocial.com LifeStream Widget - Combine all feeds into one Add-ons 0
Admin [ozzy47] Homeland Security Terror Alert Widget Vbb tutorial 0
Admin [WIDGET] Users Registered This Week Vbb tutorial 0
Myshare Share [XtWidget] Like-Dislike widget Wap builder, wapego, xtgem, wen.ru, wapka, wap4 0
Admin Kickstarter/IndieGoGo Widget BBcode Vbulletin 0
Admin Hướng dẫn hiển thị chuyên mục ra index khi theme không hỗ trợ Widget Wordpress 0
Admin [Plugin] Authors widget Wordpress 0
Admin Widget Framework for XenForo Xenforo 0
Admin [XtWidget] Like-Dislike widget Wap builder, wapego, xtgem, wen.ru, wapka, wap4 0
Admin Hướng dẫn Tạo alexa widget Thảo luận SEO 0
C CMS Brute Force 1.8 Tut, tool, mmo 0
cuongpro9x Bottle CMS All Shared Scripts 0
S Hỏi Về Tool leech cho john cms Thảo luận wap việt 0
K Anh Admin và mọi người giúp em tạo blog john cms với Johncms 2
S Xin [Xin] Tool Leech Từ user Mwork Cho John CMS Johncms 0
H Hỏi Code không cho sử dụng BBCode cho john cms Johncms 0
H Share mod xóa file đính kèm cho john cms Johncms 0
H Mod loa phóng thanh cho john cms Johncms 0
H Share mod sitemap rewrite cho john cms Johncms 0
H Share mod dislike cho john cms Johncms 0
H Share mod chatbox autoload cho john cms Johncms 1
C Help Mọi người vào fix lỗi mod like/dislike john cms giúp mình Johncms 2
C Code john cms 510 mod tạm Mã nguồn wap 0
T Hỏi Ai pro john cms júp em với Johncms 4
Admin WOW Slider for CMS & VBadvanced CMPS Vbulletin 0
Admin CMS là gì? Kiến thức lập trình 0
Admin CMS Misc Site Icons Vbulletin 0
Admin Share mod slide bài viết ra forumhome, cms - yilmaz thread slider navigation 2.2.2 Add-ons 0
nhokzodanh Share tự động cài đặt cmsinstall cms Johncms 8
J Xin HD làm john cms cho hostvina đi huhu Johncms 5
V Share Code auto leech john cms All Shared Scripts 0
NamTruc Share code john cms v3 by vnwapsite.com Johncms 6
V share code john cms v2 by vnwapsite.com Johncms 4
V share code john cms by vnwapsite.com Johncms 0
V share code john cms by vnwapsite.com Johncms 0
yoona Share Share mod tu khoa john cms Johncms 1
K Tạo CMS Như Trang Chủ Diễn Đàn HSVFORUM. Vbb tutorial 0
Admin Hướng dẫn fix lỗi khi uninstall và nâng cấp CMS VBB 4 "cms_widgettype doesn't exist eror" Vbb tutorial 0

Similar threads

New posts New threads New resources

Back
Top