Results 1 to 1 of 1

Thread: Top Rated - Most Viewed | All Times | 7 Days | 30 Days

  1. #1
    Join Date
    Oct 2010
    Posts
    29

    Default Top Rated - Most Viewed | All Times | 7 Days | 30 Days

    This script will help you to show the Top Rated videos | All Times | 7 Days | 30 Days and Most Viewed | All Times | 7 Days | 30 Days/

    1. open video.php at $category_all = array(
    add
    PHP Code:
    'ratedweekly',
    'ratedmonthly',
    'viewedweekly',
    'viewedmonthly'
    and at the end of else if ($category == 'random')
    add
    PHP Code:
    else if ($category == 'viewedweekly')
        {
            
    $ftime time() - (24 60 60);
            
    $view['html_title'] = 'Most Viewed Weekly';
            
    $view['display_order'] = 'Top Viewed Weekly';
            
    $sql "SELECT * FROM `videos` WHERE
                   `video_type`='public' AND
                   `video_active`='1' AND
                   `video_approve`='1'AND 
                   `video_add_time`>='
    $ftime'
                    ORDER BY `video_view_number` DESC
                    LIMIT 
    $start_from$config[num_watch_videos]";
        }   
      else if (
    $category == 'viewedmonthly')
        {
            
    $ftime time() - (30 24 60 60);
            
    $view['html_title'] = 'Most Viewed Weekly';
            
    $view['display_order'] = 'Top Viewed Monthly';
            
    $sql "SELECT * FROM `videos` WHERE
                   `video_type`='public' AND
                   `video_active`='1' AND
                   `video_approve`='1'AND 
                   `video_add_time`>='
    $ftime'
                    ORDER BY `video_view_number` DESC
                    LIMIT 
    $start_from$config[num_watch_videos]";
        }  
       else if (
    $category == 'ratedweekly')
        {
            
    $ftime time() - (24 60 60);
            
    $view['html_title'] = 'Top Rated Weekly';
            
    $view['display_order'] = 'Top Rated Weekly';
            
    $sql "SELECT * FROM `videos` WHERE
                   `video_type`='public' AND
                   `video_active`='1' AND
                   `video_approve`='1'  AND
                   `video_add_time`>='
    $ftime'
                    ORDER BY (video_rate/video_rated_by) DESC, video_rated_by DESC
                    LIMIT 
    $start_from$config[num_watch_videos]";
        }
       else if (
    $category == 'ratedmonthly')
        {
            
    $ftime time() - (30 24 60 60);
            
    $view['html_title'] = 'Top Rated Monthly';
            
    $view['display_order'] = 'Top Rated Monthly';
            
    $sql "SELECT * FROM `videos` WHERE
                   `video_type`='public' AND
                   `video_active`='1' AND
                   `video_approve`='1'  AND
                   `video_add_time`>='
    $ftime'
                    ORDER BY (video_rate/video_rated_by) DESC, video_rated_by DESC
                    LIMIT 
    $start_from$config[num_watch_videos]";
        } 
    2. open .htaccess
    add
    PHP Code:
    RewriteRule ^viewed-weekly/(.*) video.php?category=viewedweekly&page=$1
    RewriteRule 
    ^viewed-monthly/(.*) video.php?category=viewedmonthly&page=$1
    RewriteRule 
    ^rated-weekly/(.*) video.php?category=ratedweekly&page=$1
    RewriteRule 
    ^rated-monthly/(.*) video.php?category=ratedmonthly&page=$
    This is it
    To show Top Rated add those links in the template
    PHP Code:
    <a href="/rated-weekly/">7 Days</a> | <a href="/rated-monthly/">30 Days</a
    To show Most Viewed add those links in the template
    PHP Code:
    <a href="/viewed-weekly/">7 Days</a> | <a href="/viewed-monthly/">30 Days</a
    Last edited by alotp; 12-06-2010 at 02:11 PM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •