vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   vBulletin CMS Widgets - Widget: CMS Most Viewed Articles This Week (https://vborg.vbsupport.ru/showthread.php?t=240904)

dnk.it 04-05-2011 02:00 PM

this work great for vbulletin 4.1.1, thanks

Quote:

Originally Posted by magmf (Post 2102365)
My fault


try this

Code:

ob_start();
  // Current Week Most Viewed
  $starttime = time() - (3600*24*7);
  $mostpopularweekget = vB::$db->query_read("
select ".TABLE_PREFIX."cms_node.nodeid as nodeid, ".TABLE_PREFIX."cms_nodeinfo.title as title FROM ".TABLE_PREFIX."cms_node, ".TABLE_PREFIX."cms_nodeinfo where ".TABLE_PREFIX."cms_node.nodeid = vbcms_nodeinfo.nodeid AND ".TABLE_PREFIX."cms_node.setpublish = 1 AND ".TABLE_PREFIX."cms_node.publishdate >'".$starttime."' ORDER BY ".TABLE_PREFIX."cms_nodeinfo.viewcount desc LIMIT 5;
    ");
  $outputbits = '';
  while($article = vB::$db->fetch_array($mostpopularweekget))
  {

          $outputbits .='<div class = "cms_widget_post_bit"><h4 class = "cms_widget_post_header">
                          <a rel="nofollow" href="content.php?r='.$article[nodeid].'">'.$article[title].'</a> </h4>                      </div>';
  }
  $output = $outputbits;
  ob_end_clean();



Anopheles 06-17-2011 10:17 PM

Works on 4.1.4 THANX!

romaszek 09-16-2011 07:04 AM

1 Attachment(s)
Hey.
Why there are no separators ?

Thanks.

doctorsexy 09-16-2011 08:06 AM

not working on my 4.1.5.... sql errors

jGas 10-04-2011 02:09 PM

It's not working on 4.1.6 .

This version of the code is working for me: https://vborg.vbsupport.ru/showpost....79&postcount=5

dang3rzon3 10-07-2011 06:17 PM

it is possible to add image's article?

mircea1st 11-30-2011 09:44 AM

I have this code:

ob_start();
// Current Week Most Viewed
$mostpopularweekget = vB::$db->query_read("
select ".TABLE_PREFIX."cms_node.nodeid as nodeid, ".TABLE_PREFIX."cms_nodeinfo.title as title FROM ".TABLE_PREFIX."cms_node, ".TABLE_PREFIX."cms_nodeinfo where ".TABLE_PREFIX."cms_node.nodeid = ".TABLE_PREFIX."cms_nodeinfo.nodeid AND ".TABLE_PREFIX."cms_node.setpublish = 1 AND ".TABLE_PREFIX."cms_node.publishdate >'".$starttime."' ORDER BY ".TABLE_PREFIX."cms_nodeinfo.viewcount desc LIMIT 10;
");
$outputbits = '';
while($article = vB::$db->fetch_array($mostpopularweekget))
{

$outputbits .='<div class = "cms_widget_post_bit"><h4 class = "cms_widget_post_header">
<a rel="nofollow" href="content.php?r='.$article[nodeid].'">'.$article[title].'</a> </h4> </div>';
}
$output = $outputbits;
ob_end_clean();

Can we add a bullet at the begining of each article title ?
Thay are not separated at all .

sspeed 03-19-2012 07:37 PM

Sooo... I think I'm noticing a discrepancy... the link has it go to the article plus nodeid, for instance, on my site it's:

http://www.homenetworkenabled.com/content.php?r=129

The actual article address is:

http://www.homenetworkenabled.com/co...edia-appliance

Which includes the "SEO URL Alias"... both get there, but it appears to be making the viewcount inconsistent... Any way to include the SEO URL Alias so it goes to the correct URL?

sspeed 03-19-2012 09:02 PM

I think I've done what I've mentioned in the post above, who knows if it's right though... you can see it http://www.homenetworkenabled.com

PHP Code:

// Most popular articles
  
$starttime time() - (3600*24*18250);
  
$mostpopularweek_get vB::$db->query_read("
  SELECT DISTINCT
                 ca.contentid,
                 cn.publishdate,
                 cn.url,
                 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 6
     "
);
  
$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?'.$article[nodeid].'-'.$article[url].'">'.$article[title].'</a> ('.$article[viewcount].' views) </h4></div><br>';
  } 


sspeed 03-19-2012 09:09 PM

Quote:

Originally Posted by mircea1st (Post 2273336)

Can we add a bullet at the begining of each article title ?
Thay are not separated at all .

I noticed that as well, it was pretty gross looking, I just added a <br>, check out my site above and the code I posted..


All times are GMT. The time now is 07:45 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01169 seconds
  • Memory Usage 1,754KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (1)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete