
Fixed : edit_photo.php. Moved photo_manager_link_callbacks() at top of page Updated : set_cover_photo method in collection.class.php Added : Manage Avatars link in account manager Added : Documentation for functions @functions_photos.php Fixed : Few functions Added : Front end dynamic photo manager links Added : New functions @functions_photos.php at the end Added : New functions for adding/displaying/getting manager orders Added : Dynamic order and Avatar manager in Photos Manager for front end Changed : view_channel playlist according to widgets. Now they will display perfect on both sides Added : images and css file
126 lines
No EOL
3.5 KiB
PHP
126 lines
No EOL
3.5 KiB
PHP
<?php
|
|
/*
|
|
***********************************************************************
|
|
| Copyright (c) 2007-2010 Clip-Bucket.com. All rights reserved.
|
|
| @ Author : ArslanHassan
|
|
| @ Software : ClipBucket , © PHPBucket.com
|
|
*************************************************************************
|
|
*/
|
|
|
|
require'../includes/admin_config.php';
|
|
$userquery->admin_login_check();
|
|
$userquery->login_check('video_moderation');
|
|
$pages->page_redir();
|
|
|
|
$mode = $_GET['mode'];
|
|
$photo = mysql_clean($_GET['photo']);
|
|
|
|
|
|
switch($mode)
|
|
{
|
|
case "single":
|
|
{
|
|
assign('mode',$mode);
|
|
if($cbphoto->photo_exists($photo))
|
|
{
|
|
|
|
|
|
if($_GET['recreate'])
|
|
{
|
|
$cbphoto->generate_photos($photo);
|
|
e("Photo has been re-created. Please remove cache if you dont see any change.","m");
|
|
}
|
|
|
|
$files = $cbphoto->get_image_file($photo,'t',TRUE);
|
|
$p = $cbphoto->get_photo($photo);
|
|
|
|
assign('files',$files);
|
|
assign('p',$p);
|
|
} else
|
|
e("Photo does not exist");
|
|
}
|
|
break;
|
|
|
|
case "mass":
|
|
default:
|
|
{
|
|
assign('mode',$mode);
|
|
$start_index = $_GET['start_index'] ? $_GET['start_index'] : 0;
|
|
$loop_size = $_GET['loop_size'];
|
|
$loop_size = $loop_size ? $loop_size : 2;
|
|
assign('loop_size',$loop_size);
|
|
$next_index = $start_index+$loop_size;
|
|
assign('next_index',$next_index);
|
|
if(isset($_GET['mass_recreation']))
|
|
{
|
|
$photos = $cbphoto->get_photos(array("limit"=>$start_index.",".$loop_size));
|
|
$total = $cbphoto->get_photos(array("count_only"=>true));
|
|
$i = 0;
|
|
|
|
assign('total',$total);
|
|
assign('from',$start_index+1);
|
|
$to = $start_index+$loop_size;
|
|
if($to>$total)
|
|
{
|
|
$to = $total;
|
|
e($total." photos image have been recreated.","m");
|
|
$stop_loop = "yes";
|
|
assign("stop_loop","yes");
|
|
assign('from',$total);
|
|
}
|
|
assign('to',$to);
|
|
|
|
while($i < $total)
|
|
{
|
|
if($photos[$i]['photo_id'])
|
|
{
|
|
$cbphoto->generate_photos($photos[$i]['photo_id']);
|
|
$msg[] = $photos[$i]['photo_id'].": Re-created '<strong>".$photos[$i]['photo_title']."</strong>'";
|
|
}
|
|
$i++;
|
|
}
|
|
|
|
if ( $stop_loop != 'yes' ) {
|
|
e($start_index+1 ." - ".$to." photos image have been recreated.","m");
|
|
}
|
|
|
|
assign("index_msgs",$msg);
|
|
assign("indexing","yes");
|
|
assign('button','mass_recreation');
|
|
if ( !$stop_loop ) {
|
|
$url = queryString( "loop_size=$loop_size&start_index=$next_index&mass_recreation=yes", array("loop_size", "start_index","button") );
|
|
header( "Refresh: 2; url=" . BASEURL . "/admin_area/recreate_thumbs.php$url" );
|
|
}
|
|
}
|
|
}
|
|
break;
|
|
|
|
case "collection":
|
|
{
|
|
assign('mode',$mode);
|
|
$cid = mysql_clean($_GET['cid']);
|
|
if($cbphoto->collection->collection_exists($cid))
|
|
{
|
|
if(isset($_POST['recreating']))
|
|
{
|
|
$total = count($_POST['check_photo']);
|
|
for($i=0;$i<$total;$i++)
|
|
{
|
|
$cbphoto->generate_photos($_POST['check_photo'][$i]);
|
|
}
|
|
$eh->flush();
|
|
e($total." photo(s) have been re-created. Please remove browser cache if you don't see any change.","m");
|
|
}
|
|
$items = $cbphoto->collection->get_collection_items_with_details($cid);
|
|
assign('items',$items);
|
|
} else {
|
|
e(lang("Collection does not exist"));
|
|
}
|
|
}
|
|
break;
|
|
}
|
|
|
|
subtitle("Recreate Photos");
|
|
template_files('recreate_thumbs.html');
|
|
display_it();
|
|
?>
|