Quote Originally Posted by vshare View Post
Hi,

If you want to remove random videos, please do the following steps

Find and remove

1.htaccess
Code:
RewriteRule ^random/(.*) video.php?category=random&page=$1
2.video.php

FIND

PHP Code:
$category_all = array(
    
'random',
    
'recent',
    
'viewed',
    
'discussed',
    
'favorites',
    
'rated',
    
'featured'
); 
REPLACE WITH

PHP Code:
$category_all = array(
    
'recent',
    
'viewed',
    
'discussed',
    
'favorites',
    
'rated',
    
'featured'
); 
FIND AND REMOVE

PHP Code:
else if ($category == 'random')
    {
        
$view['html_title'] = 'Random Videos';
        
$view['display_order'] = 'Random';
        
$sql "SELECT * FROM `videos` WHERE
               `video_type`='public' AND
               `video_active`='1' AND
               `video_approve`='1'
                
$channel_sql
                
$sql_adult_filter
                ORDER BY rand()
                LIMIT 
$start_from$config[num_watch_videos]";
    } 
3.templates/menu_watch.tpl

FIND AND REMOVE

Code:
<li><a href="{$base_url}/{if $smarty.request.viewtype eq "detailed"}detailed/{/if}random/">Random</a></li>
Thanks

Buyscripts Team
I got another message from my hosting and i want to ractify the situation could you please help me?
here is the message i got;
Hello,
I wrote you 1 month ago about your database "clovidz" and your use of
"order by rand()". I haven't head a response from you, and this morning
the mysql server had high load due to these queries still causing issues.
The below queries are taking 200 to 300+ seconds to run, processing
53000 records and must randomize a large amount of data to return the 20
records. Due to no response about the slow queries using more than your
fair share of the mysql server, I am moving your databases to a MySQL VPS
until this issue is fixed. You can write me at [email protected] when
this has been removed from your site, and I can move you back to shared
hosting. The first week of MySQL VPS is free, so if you can fix it
within the first week, no charges will be placed on your account.
# Query_time: 395.613946 Lock_time: 0.050090 Rows_sent: 20
Rows_examined: 53224
use clovidz;
SELECT * FROM `videos` WHERE
`video_type`='public' AND
`video_active`='1' AND
`video_approve`='1'
ORDER BY rand()
LIMIT 13900, 20;
# Query_time: 586.654760 Lock_time: 0.008073 Rows_sent: 20
Rows_examined: 49704
use clovidz;
SELECT * FROM `videos` WHERE
`video_type`='public' AND
`video_active`='1' AND
`video_approve`='1'
ORDER BY rand()
LIMIT 10380, 20;
# Query_time: 528.365574 Lock_time: 0.000146 Rows_sent: 20
Rows_examined: 55844
use clovidz;
SELECT * FROM `videos` WHERE
`video_type`='public' AND
`video_active`='1' AND
`video_approve`='1'
ORDER BY rand()
LIMIT 16520, 20;
Thanks!
Justin K