Adding: Reindexing of Clipbucet

Added : 404 and 403(html) pages
This commit is contained in:
Fawaz 2010-07-14 11:18:13 +00:00
parent 3970c8c12a
commit adbc010aaa
4 changed files with 98 additions and 0 deletions

View file

@ -0,0 +1,61 @@
<?php
/*
***************************************************************
| Copyright (c) 2007-2010 Clip-Bucket.com. All rights reserved.
| @ Author : ArslanHassan
| @ Software : ClipBucket , © PHPBucket.com
| @ File : Sometime stats of Clipbucket get messed up.
| This file will re-index all stats of videos, users and
| groups to provide most accurate results.
***************************************************************
*/
//including config file..
require'../includes/admin_config.php';
$userquery->admin_login_check();
$pages->page_redir();
$vtbl = tbl("video");
$utbl = tbl("users");
$gtbl = tbl("groups");
//Reindex CB Videos
if(isset($_POST['index_vids'])) {
$videos = get_videos(array("active"=>"yes","status"=>"Successful"));
$total_videos = get_videos(array("count_only"=>true,"active"=>"yes","status"=>"Successful"));
$percent = number_format(50 * $total_videos / 100);
}
//Reindex CB Users
if(isset($_POST['index_usrs'])) {
$users = get_users(array("usr_status"=>"Ok"));
$total_users = get_users(array("count_only"=>true,"usr_status"=>"Ok"));
$percent = number_format(50 * $total_users / 100);
if(empty($_GET['continue_from'])) {
for($i=0;$i<$percent;$i++) {
$video_count = $db->count($vtbl,$vtbl.".videoid"," $vtbl.userid = ".$users[$i]['userid']." AND $vtbl.active='yes' AND $vtbl.status='Successful'");
$db->update($utbl,array($utbl.".total_videos"),array($video_count)," $utbl.userid = ".$users[$i]['userid']."");
}
redirect_to("?continue_from=".$percent."");
} else {
$new_index = $_GET['continue_from'];
for($i=$new_index;$i<$total_users;$i++) {
$video_count = $db->count($vtbl,$vtbl.".videoid"," $vtbl.userid = ".$users[$i]['userid']." AND $vtbl.active='yes' AND $vtbl.status='Successful'");
$db->update($utbl,array($utbl.".total_videos"),array($video_count)," $utbl.userid = ".$users[$i]['userid']."");
}
e(lang("User Indexing Completed"),"m");
}
}
//Reindex CB Grous
if(isset($_POST['index_gps'])) {
}
subtitle("Re-index Clipbucket");
template_files('reindex_cb.html');
display_it();
?>

View file

@ -0,0 +1,31 @@
<span class="page_title">Re-index Clipbucket <img src="{$imageurl}/help.png" border="0" class="tipsy_tip" title="Re-index simples means to recount everything and update it." /></span>
<div style="height:3px;"></div>
Here you can re-index your videos, users or groups statistics. From below select which thing you want to re-index.
<div style="height:25px; clear:both"></div>
<table width="600" border="0" cellpadding="2" cellspacing="2">
<tr>
<td align="left"><h4>Reindex Videos</h4></td>
<td align="right">
<form name="reindex_videos" method="post" action="">
<input type="submit" name="index_vids" id="index_vids" value="Reindex Videos" class="button"/>
</form></td>
</tr>
<tr>
<td align="left"><h4>Reindex Users</h4></td>
<td align="right">
<form name="reindex_users" method="post" action="">
<input type="submit" name="index_usrs" id="index_usrs" value="Reindex Users" class="button"/>
</form></td>
</tr>
<tr>
<td align="left"><h4>Reindex Groups</h4></td>
<td align="right">
<form name="reindex_groups" method="post" action="">
<input type="submit" name="index_gps" id="index_gps" value="Reindex Groups" class="button"/>
</form></td>
</tr>
</table>

View file

@ -0,0 +1,2 @@
<h2>403 Error</h2>
<p>Sorry, you cannot access this page.</p>

View file

@ -0,0 +1,4 @@
<div style='padding:10px;'>
<h2>404 Error</h2>
<p>Requested page not found.</p>
</div>