Register Members List Search Today's Posts Mark Forums Read

Reply
 
Mod Options
Widget: CMS Most Viewed Articles This Week Details »»
Widget: CMS Most Viewed Articles This Week
Mod Version: 1.02, by reefland (Coder) reefland is offline
Developer Last Online: Jan 2012 I like it Show Printable Version Email this Page

vB Version: 4.0.6 Rating: (6 votes - 4.67 average) Installs: 77
Released: 21 Apr 2010 Last Update: Never Downloads: 0
Not Supported Re-usable Code Translations  

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

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.



3. Change Log


[Version 1.02 9-23-2010]
Removed unnecessary ob*() calls.
Changed output_bits to just output.

[Version 1.01 4-21-2010]
Fixed a bug show the correct URL was used for each article.

Download Now

Only licensed members can download files, Click Here for more information.

Screenshots

Click image for larger version

Name:	widget_screen_shot.gif
Views:	1168
Size:	6.2 KB
ID:	116124

Show Your Support

  • To receive notifications regarding updates -> Click to Mark as Installed.
  • This modification may not be copied, reproduced or published elsewhere without author's permission.
Similar Mod
Mod Developer Type Replies Last Post
Widget: last articles blogs in CMS - by omardealo omardealo vBulletin 4.x Add-ons 15 10 Feb 2013 23:47
3x CMS widget : Widget with 3 tabs, like on Blogs page. Vaupell vBulletin 4.x Add-ons 55 23 Oct 2012 22:06
Widget: Top 5 Posters this Week MaryTheG(r)eek Modification Graveyard 43 14 Sep 2010 04:10

Comments
  #2  
Old 21 Apr 2010, 07:58
RedHacker RedHacker is offline
 
Join Date: Jan 2009
Please one screenshot or demo....?
Reply With Quote
  #3  
Old 21 Apr 2010, 13:09
reefland reefland is offline
 
Join Date: Jan 2002
PHP Code updated and screen shot attached.
__________________
Kentucky Wildcats Sports
Reply With Quote
  #4  
Old 22 Apr 2010, 08:54
blue6995 blue6995 is offline
 
Join Date: Oct 2005
When does it get populated with the names of the Articles? I have installed and carried out the instructions above, but the 'This Week's Most Popular Article Box is empty!

Thanks
Reply With Quote
  #5  
Old 22 Apr 2010, 20:27
giorgino giorgino is offline
 
Join Date: Dec 2009
Same for me. Empty
Reply With Quote
  #6  
Old 22 Apr 2010, 21:54
vbgser vbgser is offline
 
Join Date: Feb 2010
Same for me
Reply With Quote
  #7  
Old 22 Apr 2010, 22:57
reefland reefland is offline
 
Join Date: Jan 2002

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Can one of you copy and paste this code and see if it populates? It should show immediately.
__________________
Kentucky Wildcats Sports
Reply With Quote
  #8  
Old 23 Apr 2010, 05:54
blue6995 blue6995 is offline
 
Join Date: Oct 2005
Originally Posted by reefland View Post
Can one of you copy and paste this code and see if it populates? It should show immediately.
When I cut and paste that in I get the following error message at the top of the Home Page


Parse error: syntax error, unexpected T_STRING in /home2/rwfforum/public_html/vBulletin/packages/vbcms/widget/execphp.php(177) : eval()'d code on line 43
Reply With Quote
  #9  
Old 23 Apr 2010, 19:18
reefland reefland is offline
 
Join Date: Jan 2002
can you post your code for me?
__________________
Kentucky Wildcats Sports
Reply With Quote
  #10  
Old 24 Apr 2010, 05:45
blue6995 blue6995 is offline
 
Join Date: Oct 2005
Originally Posted by reefland View Post
can you post your code for me?
It is working now, using the new code. Thanks
Reply With Quote
  #11  
Old 24 Apr 2010, 13:50
giorgino giorgino is offline
 
Join Date: Dec 2009
Not for me.
This is the code I've inserted:

ob_start();

// 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_bits = '';
while($article = vB::$db->fetch_array($mostpopularweek_get))
{

$output_bits .='<div class = "cms_widget_post_bit"><h4 class = "cms_widget_post_header">
<a href="content.php?r='.$article[nodeid].'">'.$article[title].'</a></h4></div>';

}
$output = $output_bits;
ob_end_clean();
Reply With Quote
  #12  
Old 25 Apr 2010, 00:43
betts02's Avatar
betts02 betts02 is offline
 
Join Date: Jun 2009
Any chance to make this work for a forum block ?

Cheers
Reply With Quote
  #13  
Old 28 May 2010, 20:32
g10net g10net is offline
 
Join Date: Jan 2010
it works,thanks. How can be done by daily?
Reply With Quote
  #14  
Old 30 May 2010, 01:50
reefland reefland is offline
 
Join Date: Jan 2002
g10net,

You could just change the $starttime to:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

__________________
Kentucky Wildcats Sports
Reply With Quote
  #15  
Old 30 May 2010, 05:24
uaewebmaster uaewebmaster is offline
 
Join Date: Aug 2005
Installed, Working 100%, Thanks
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Mod Options

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Jump


New To Site? Need Help?

All times are GMT. The time now is 11:11.

Layout Options | Width: Wide Color: