2010-12-14 13:53:51 +00:00
|
|
|
<?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();
|
2012-09-14 09:46:27 +00:00
|
|
|
//register_filter('photo_manager_links','cb_some_photo_plugin_links');
|
2010-12-14 13:53:51 +00:00
|
|
|
$id = mysql_clean($_GET['photo']);
|
|
|
|
|
|
|
|
|
|
|
|
if(isset($_POST['update']))
|
|
|
|
{
|
|
|
|
$cbphoto->update_photo();
|
|
|
|
}
|
|
|
|
|
|
|
|
//Performing Actions
|
|
|
|
if($_GET['mode']!='')
|
|
|
|
{
|
|
|
|
$cbphoto->photo_actions($_GET['mode'],$id);
|
|
|
|
}
|
2012-07-23 19:44:23 +00:00
|
|
|
$p = $cbphoto->get_photo($id, true);
|
|
|
|
|
|
|
|
if ( isset($_GET['view']) ) {
|
|
|
|
$view = trim($_GET['view']);
|
|
|
|
switch( $view ) {
|
|
|
|
case "tags": case "ptags": {
|
|
|
|
assign('view','tags');
|
|
|
|
|
2012-07-25 11:53:42 +00:00
|
|
|
if ( isset($_GET['delete_tag']) ) {
|
|
|
|
$tag_id = mysql_clean( $_GET['delete_tag'] );
|
|
|
|
if ( $cbphoto->remove_photo_tag( $tag_id ) ) {
|
|
|
|
e(lang('Photo tag has been deleted successfully'),'m');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
$action = mysql_clean( $_POST['action'] );
|
|
|
|
|
|
|
|
switch( $action ) {
|
|
|
|
case 'delete_selected': {
|
|
|
|
$tags = $_POST['check_tag'];
|
|
|
|
$total_tags = count( $tags );
|
2012-07-25 21:17:44 +00:00
|
|
|
if ( $total_tags > 0 ) {
|
|
|
|
foreach( $tags as $tag_id ) {
|
|
|
|
$tag_id = mysql_clean($tag_id);
|
|
|
|
$cbphoto->remove_photo_tag( $tag_id );
|
|
|
|
}
|
|
|
|
$eh->flush_msg();
|
|
|
|
e( lang('Selected photo tags have been deleted successfully'), 'm' );
|
|
|
|
} else {
|
|
|
|
e( lang('Please select tags you want to delete') );
|
2012-07-25 11:53:42 +00:00
|
|
|
}
|
|
|
|
} break;
|
|
|
|
}
|
|
|
|
|
|
|
|
$array = array();
|
|
|
|
$array['pid'] = $id;
|
|
|
|
if( isset($_GET['search']) ) {
|
|
|
|
$array['tag'] = $_GET['tag'];
|
|
|
|
$array['order'] = $_GET['order'];
|
|
|
|
$array['tagger'] = $_GET['tagger'];
|
|
|
|
$array['tagged'] = $_GET['tagged'];
|
|
|
|
$array['orderby'] = $_GET['orderby'];
|
|
|
|
$array['user_tagged_only'] = $_GET['only_user'];
|
|
|
|
}
|
|
|
|
|
|
|
|
$array['order'] = $array['order'] ? $array['order'] : 'date_added';
|
|
|
|
$array['orderby'] = $array['orderby'] ? $array['orderby'] : 'desc';
|
|
|
|
$array['order'] = tbl('photo_tags.'.$array['order'].' '.$array['orderby']);
|
|
|
|
|
|
|
|
$tags = $cbphoto->get_photo_tags( $array );
|
2012-07-23 19:44:23 +00:00
|
|
|
if ( $tags ) {
|
|
|
|
assign('tags',$tags);
|
|
|
|
}
|
|
|
|
//pr( $tags, true );
|
|
|
|
subtitle("Photo Tags");
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case "exif": case "exif_data": {
|
|
|
|
assign('view','exif');
|
|
|
|
$exif = get_photo_meta_value( $id, 'exif_data');
|
|
|
|
if ( $exif ) {
|
|
|
|
$exif = json_decode( $exif, true );
|
|
|
|
|
|
|
|
$template_ready_data = ready_exif_data( $exif, $p );
|
|
|
|
|
|
|
|
assign( 'photo', $photo );
|
|
|
|
assign('exif', $template_ready_data );
|
|
|
|
|
|
|
|
subtitle( 'Exif Data' );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-09-14 09:46:27 +00:00
|
|
|
// Add photo actions links
|
|
|
|
add_photo_manager_link(lang('Recreate Photo'), 'recreate_thumbs.php?mode=single&photo='.$p['photo_id'] );
|
|
|
|
if ( $p['collection_id'] != 0 ) {
|
|
|
|
add_photo_manager_link( lang('Edit Collection ('. $p['collection_name'].')'), 'edit_collection.php?collection='.$p['collection_id'] );
|
|
|
|
} else {
|
|
|
|
add_photo_manager_link(lang('Photo is orphan'),'javascript:void(0)');
|
|
|
|
}
|
|
|
|
|
|
|
|
photo_manager_link_callbacks();
|
2010-12-14 13:53:51 +00:00
|
|
|
|
2010-12-28 13:56:44 +00:00
|
|
|
$p['user'] = $p['userid'];
|
2010-12-14 13:53:51 +00:00
|
|
|
|
|
|
|
assign('data',$p);
|
|
|
|
|
|
|
|
$requiredFields = $cbphoto->load_required_forms($p);
|
|
|
|
$otherFields = $cbphoto->load_other_forms($p);
|
|
|
|
assign('requiredFields',$requiredFields);
|
|
|
|
assign('otherFields',$otherFields);
|
|
|
|
|
|
|
|
subtitle("Edit Photo");
|
|
|
|
template_files('edit_photo.html');
|
|
|
|
display_it();
|
|
|
|
?>
|