Updated : edit_photo.php

Removed : unnecessary code from photo_manager.php
Updated : Edit Photo layout
Updated : Selector for jQuery tooltip plugin
Updated : main.html sub_heading to legends
Updated : Photo Settings save option layout
Updated : Recreate Thumbs save option layout
Fixed : get_photo_tags, get_photo and load_required_forms methods photos.class.php
Fixed : confirm_collection_type function
Added : Inline for documentation for template functions
This commit is contained in:
Fawaz 2012-07-23 19:44:23 +00:00
parent babd8c70b6
commit e8c4e96d8d
12 changed files with 1171 additions and 842 deletions

View file

@ -11,7 +11,7 @@ require'../includes/admin_config.php';
$userquery->admin_login_check();
$userquery->login_check('video_moderation');
$pages->page_redir();
register_filter('photo_manager_links','cb_some_photo_plugin_links');
$id = mysql_clean($_GET['photo']);
@ -25,8 +25,42 @@ if($_GET['mode']!='')
{
$cbphoto->photo_actions($_GET['mode'],$id);
}
$p = $cbphoto->get_photo($id, true);
if ( isset($_GET['view']) ) {
$view = trim($_GET['view']);
switch( $view ) {
case "tags": case "ptags": {
assign('view','tags');
$tags = $cbphoto->get_photo_tags( $id );
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;
}
}
$p = $cbphoto->get_photo($id);
$p['user'] = $p['userid'];
assign('data',$p);

View file

@ -11,7 +11,7 @@ require_once '../includes/admin_config.php';
$userquery->admin_login_check();
$userquery->login_check('video_moderation');
$pages->page_redir();
register_filter('photo_manager_links','cb_some_photo_plugin_links');
//Photo Actions are following
//Feature

View file

@ -1,150 +1,384 @@
<form action="" method="post" name="edit_photo" id="edit_photo">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="50%" valign="top">
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td align="left" class="left_head" style="padding-left:10px"><div class="head">Editing {$data.photo_title}</div></td>
<td width="20" align="right" class="right_head">&nbsp;</td>
</tr>
</table>
<div style="width:98%; margin:auto; padding:10px">
<ul class="admin_links" style="font:bold 11px Tahoma;">
{if $data.collection_id != 0}
<li><a href="edit_collection.php?collection={$data.collection_id}">Edit Collection ({$data.collection_id|get_collection_field})</a></li>
{else}
<li><a href="#collection_id">Photo is orpahn</a></li>
{/if}
{if $data.featured!='yes'}
<li><a href="edit_photo.php?photo={$data.photo_id}&amp;mode=fp">Make Featured</a></li>
{else}
<li><a href="edit_photo.php?photo={$data.photo_id}&amp;mode=ufp">Make Unfeatured</a></li>
{/if}
<li><a href="recreate_thumbs.php?mode=single&amp;photo={$data.photo_id}">Re-create Photo</a></li>
<li><a href="javascript:void(0)" onClick="javascript:Confirm_Delete('photo_manager.php?delete_photo={$data.photo_id}')">Delete This Photo</a></li>
</ul>
{$photo=$data}
{if $view}
{if $view == 'tags'}
<h2>Photo Tags</h2>
<p>Complete list of tags for current photo</p>
<div class="manager-list">
<div class="controller scrtolltoFixed white-grad">
<div class="buttons clearfix">
<div class="btn-toolbar">
<div class="btn-group">
<label class="btn check-all"><input type="checkbox"></label>
</div>
<input name="admin" type="hidden" id="admin" value="true" />
<input name="photo_id" type="hidden" value="{$data.photo_id}" />
<div class="btn-group">
<a href="#" class="btn btn-danger">Delete</a>
</div>
</div>
<div class="right-button">
<a href="edit_photo.php?photo={$photo.photo_id}" class="btn btn-primary">Back to details</a>
</div>
</div>
</div>
<fieldset class="fieldset">
<legend>User Information</legend>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" class="block">
<table id="photo_manager_table" class="table table-striped list-block {if !$tags}display-none{/if}">
<thead>
<tr>
<td width="200"><strong>Useid</strong></td>
<td><a href="view_user.php?uid={$data.userid}">{$data.userid|get_username}</a></td>
<th width="50"></th>
<th width="70">#</th>
<th>Tag Hash <span class="icon-info-sign popover-class" rel="popover" title="What is Tag Hash ?" data-content="Tag Hash is unique identifier for tag string. This helps in keeping tags unique for current photo."></span></th>
<th width="150">Tag</th>
<th width="150">Tagged By</th>
<th width="150">Date</th>
<th width="120"></th>
</tr>
</table>
</fieldset>
</thead>
<fieldset class="fieldset">
<legend>Important Details</legend>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" class="block">
{if $tags}
{foreach $tags as $tag}
<tr>
<td width="200"><strong>Photo ID</strong></td>
<td><input type="checkbox" class="check-item" name="check_tag[]" value="{$tag.pag_id}" /></td>
<td>{$tag.ptag_id}</td>
<td>{$tag.ptag_key}</td>
<td>
<input disabled="disabled" name="photoid" type="text" id="photoid" value="{$data.photo_id}" size="45" />
{if $tag.ptag_isuser}
<a href="view_user.php?uid={$tag.ptag_userid}">{$tag.ptag_username}</a>
{else}
{$tag.ptag_username}
{/if}
</td>
</tr>
<tr>
<td width="200"><strong>Photo Key</strong></td>
<td>
<input disabled="disabled" name="photokey" type="text" id="photokey" value="{$data.photo_key}" size="45" />
</td>
</tr>
<tr>
<td width="200"><strong>Filename</strong></td>
<td>
<input disabled="disabled" name="filename" type="text" id="filename" value="{$data.filename}" size="45" />
</td>
</tr>
<tr>
<td width="200"><strong>Extension</strong></td>
<td>
<input disabled="disabled" name="extension" type="text" id="extension" value="{$data.ext}" size="45" />
</td>
</tr>
</table>
</fieldset>
<fieldset class="fieldset">
<legend>Photo Details</legend>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" class="block">
{foreach from=$requiredFields item=field}
<tr>
<td width="200" ><strong>{$field.title} :</strong></td>
<td>{$field.hint_1}<br />
{$formObj->createField($field)}
{$field.hint_2}</td>
<td><a href="view_user.php?uid={$tag.ptag_by_userid}">{$tag.ptag_by_username}</a></td>
<td>{$tag.date_added|niceTime:true}</td>
<td><a href="#" onclick="cb_confirm('Remove Tag','Are you sure you want to remove this tag ?', function(){
window.location = '?photo={$tag.photo_id}&view=tags&delete_tag={$tag.ptag_id}';
}); return false;" class="btn btn-mini">Remove Tag</a></td>
</tr>
{/foreach}
{/if}
</table>
</fieldset>
<fieldset class="fieldset">
<legend>Photo Stats</legend>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" class="block">
<tr>
<td width="200"><strong>Views:</strong></td>
<td><input name="views" id="views" value="{$data.views}" /></td>
</tr>
<tr>
<td width="200"><strong>Total Favorites:</strong></td>
<td><input name="total_favorites" id="total_favorites" value="{$data.total_favorites}" /></td>
</tr>
<tr>
<td width="200"><strong>Total Comments:</strong></td>
<td><input name="total_comments" id="total_comments" value="{$data.total_comments}" /></td>
</tr>
<tr>
<td width="200"><strong>Total Downloads:</strong></td>
<td><input name="downloaded" id="downloaded" value="{$data.downloaded}" /></td>
</tr>
<tr>
<td width="200"><strong>Rating:</strong></td>
<td><input name="rating" id="rating" disabled="disabled" value="{$data.rating}" /></td>
</tr>
<tr>
<td width="200"><strong>Rated By:</strong></td>
<td><input name="rated_by" id="rated_by" disabled="disabled" value="{$data.rated_by}" /></td>
</tr>
<tr>
<td width="200"><strong>Voters:</strong></td>
<td><textarea name="voters" id="voters" disabled="disabled">{$data.voters}</textarea></td>
</tr>
</table>
</fieldset>
<input type="submit" class="button" value="Update Photo Details" style="margin:15px 0px 0px 15px" name="update">
</td>
{if !$tags}
<div class="alert">This photo has no tags ..</div>
{/if}
</div>
{/if}
<td width="50%" valign="top">
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td align="left" class="left_head" style="padding-left:10px"><div class="head">Photo Preview</div></td>
<td width="20" align="right" class="right_head">&nbsp;</td>
</tr>
</table>
<div style="padding:5px">
<div align="center">{get_photo details=$data size='l' output='html' style='max-width:600px'}</div>
{if $view == 'exif'}
<script>
$(function(){
$('#settings-container').masonry({
// options
itemSelector : '.settings-block',
columnWidth: 400,
isResizable : true
});
});
</script>
<h2>Exif Data</h2>
<p>Exif data is a record of the settings a camera used to take a photo. This information is embedded into the files the camera saves</p>
<div class="manager-list">
<div class="controller scrtolltoFixed white-grad">
<div class="buttons clearfix">
<div class="btn-toolbar">
<div class="btn-group">
<a href="edit_photo.php?photo={$photo.photo_id}" class="btn btn-primary">Back to details</a>
</div>
</div>
</div>
</div>
</div>
<fieldset class="fieldset">
<legend>Other Fields</legend>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" class="block">
{foreach from=$otherFields item=field}
<div id="settings-container">
{if $exif.rest}
<div class="settings-block">
<fieldset>
<legend>Other Information</legend>
<table class="table">
{foreach $exif.rest as $name => $value}
{if $value}
<tr>
<td width="200" ><strong>{$field.title} :</strong></td>
<td>{$field.hint_1}<br />
{$formObj->createField($field)}
{$field.hint_2}</td>
<td>{$name|format_exif_camelCase|capitalize}:</td>
<td>{$value}</td>
</tr>
{/if}
{/foreach}
</table>
</fieldset>
</td>
</div>
{/if}
<div class="settings-block">
<fieldset>
<legend>Dates</legend>
<table class="table">
{if $exif.dates.taken}
<tr>
<td>Taken on:</td>
<td>{$exif.dates.taken} ( {$exif.dates.taken|niceTime} )</td>
</tr>
{/if}
<tr>
<td>{lang code='Added on %s'|sprintf:'here'}:</td>
<td>{$exif.dates.uploaded} ( {$exif.dates.uploaded|niceTime} )</td>
</tr>
</table>
</table>
</fieldset>
</div>
</form>
{if $exif.base}
<div class="settings-block">
<fieldset>
<legend>Base Information</legend>
<table class="table">
{foreach $exif.base as $name => $base}
{if $base}
<tr>
<td>{lang code="$name"|capitalize}</td>
<td>{$base}</td>
</tr>
{/if}
{/foreach}
</table>
</fieldset>
</div>
{/if}
</div>
{/if}
{else}
<h2>Edit Photo : {$photo.photo_title}</h2>
<p>This is a complete list of information that is displayed or used for displaying a photo.</p>
<script>
$(function(){
$('#settings-container').masonry({
// options
itemSelector : '.settings-block',
columnWidth: 400,
isResizable : true
});
});
</script>
<div class="controller scrolltoFixed white-grad">
<div class="buttons">
<div class="btn-toolbar">
<div class="btn-group">
<a class="btn" onclick=""><span class="icon icon-eye-open"></span></a>
</div>
<div class="btn-group dropdown">
<a class="btn">Options</a>
<a class="btn dropdown-toggle" onclick="" data-toggle="dropdown"><span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="{$cbphoto->photo_links($photo,'view_photo')}">View Photo</a></li>
{if $photo.is_mature == 'yes'}
<li><a href="?mode=rm&photo={$photo.photo_id}">Remove Mature Flag</a></li>
{else}
<li><a href="?mode=am&photo={$photo.photo_id}">Add Mature Flag</a></li>
{/if}
{if $photo.featured == 'yes'}
<li><a href="?mode=ufp&photo={$photo.photo_id}">Unfeature It</a></li>
{else}
<li><a href="?mode=fp&photo={$photo.photo_id}">Make Featured</a></li>
{/if}
{if $photo.active == 'yes'}
<li><a href="?mode=dap&photo={$photo.photo_id}">Deactivate</a></li>
{else}
<li><a href="?mode=ap&photo={$photo.photo_id}">Activate</a></li>
{/if}
{display_manager_links($photo)}
<li class="divider"></li>
<li><a href="#" onclick=" cb_confirm('Delete Photo','Are you sure you want to delete this photo ?', function(){
window.location = 'photo_manager.php?delete_photo={$photo.photo_id}'
}); return false;">Delete Photo</a></li>
</ul>
</div>
<div class="btn-group">
<a href="#" class="btn btn-danger" onclick=" cb_confirm('Delete Photo','Are you sure you want to delete this photo ?', function(){
window.location = 'photo_manager.php?delete_photo={$photo.photo_id}'
}); return false;">Delete</a>
</div>
<div class="btn-group">
{$colors=get_photo_meta_value($photo.photo_id,'colors')}
{if $photo.ptags_count > 0}
<a href="edit_photo.php?photo={$photo.photo_id}&view=tags" class="btn">Photo Tags</a>
{/if}
{if $colors}
<a href="#{$photo.photo_id}-colors-modal" class="btn" data-toggle="modal">View Colors</a>
{/if}
{if $photo.exif_data == 'yes'}
<a href="edit_photo.php?photo={$photo.photo_id}&view=exif" class="btn">Exif Data</a>
{/if}
</div>
<div class="right-button">
<button class="btn btn-primary" name="save_photo" value="do-action">Save</button>
</div>
</div>
</div>
</div>
<form action="" method="post" name="edit_photo" id="edit_photo" class="form form-vertical">
<div id="settings-container">
<div class="settings-block">
{get_photo details=$photo size='l' width='360' output='html' style='display:block; margin:auto;'}
</div>
<div class="settings-block">
<fieldset>
<legend>Important Details</legend>
<div class="control-group">
<label class="control-label" for="userid">Uploader Userid</label>
<div class="controls">
<div class=" input-append">
<input type="text" class="input-xlarge" id="userid" name="userid" value="{$photo.userid}"{if $photo.is_avatar == 'yes'} disabled="disabled"{/if}><span class="add-on">{$photo.username}</span>
</div>
</div>
</div>
<div class="control-group">
<label class="control-label" for="photo_id">Photo ID</label>
<div class="controls">
<input disabled="disabled" class="input-xlarge" name="photo_id" type="text" id="photo_id" value="{$data.photo_id}" />
</div>
</div>
<div class="control-group">
<label class="control-label" for="photo_key">Photo Key</label>
<div class="controls">
<input disabled="disabled" class="input-xlarge" name="photo_key" type="text" id="photo_key" value="{$data.photo_key}" />
</div>
</div>
<div class="control-group">
<label class="control-label" for="filename">Filename</label>
<div class="controls">
<input disabled="disabled" class="input-xlarge" name="filename" type="text" id="filename" value="{$data.filename}" />
</div>
</div>
<div class="control-group">
<label class="control-label" for="ext">Extension</label>
<div class="controls">
<input disabled="disabled" class="input-xlarge" name="ext" type="text" id="ext" value="{$data.ext|strtoupper}" />
</div>
</div>
</fieldset>
</div>
<div class="settings-block">
<fieldset>
<legend>Required Fields</legend>
{foreach from=$requiredFields item=field}
<div class="control-group">
<label for="{$field.id}" class="control-label">{$field.title}</label>
<div class="controls">
{$field.class='input-xlarge'}
{$formObj->createField($field)}
{if $field.hint_2}<p class="help-block">{$field.hint_2}</p>{/if}
</div>
</div>
{/foreach}
</fieldset>
</div>
<div class="settings-block">
<fieldset>
<legend>Other Fields</legend>
{foreach from=$otherFields item=field}
<div class="control-group">
<label for="{$field.id}" class="control-label">{$field.title}</label>
<div class="controls">
{$field.class='input-xlarge'}
{if $field.type=='checkbox' || $field.type=='radiobutton'}
{$field.sep=' '}
{if $field.type=='checkbox'}
{$field.class='checkbox'}
{else}
{$field.class='radio'}
{/if}
{/if}
{$formObj->createField($field)}
{if $field.hint_2}<p class="help-block">{$field.hint_2}</p>{/if}
</div>
</div>
{/foreach}
</fieldset>
</div>
<div class="settings-block">
<fieldset>
<legend>Photos Stats and Info</legend>
<div class="control-group">
<label class="control-label" for="views">Views</label>
<div class="controls">
<input type="text" class="input-xlarge" id="views" name="views" value="{$photo.views}" />
<p class="help-block"></p>
</div>
</div>
<div class="control-group">
<label class="control-label" for="total_favorites">Total Favorites</label>
<div class="controls">
<input type="text" class="input-xlarge" id="total_favorites" name="total_favorites" value="{$photo.total_favorites}" />
<p class="help-block"></p>
</div>
</div>
<div class="control-group">
<label class="control-label" for="total_comments">Total Comments</label>
<div class="controls">
<input type="text" class="input-xlarge" id="total_comments" name="total_comments" value="{$photo.total_comments}" />
<p class="help-block"></p>
</div>
</div>
<div class="control-group">
<label class="control-label" for="downloaded">Total Downloads</label>
<div class="controls">
<input type="text" class="input-xlarge" id="downloaded" name="downloaded" value="{$photo.downloaded}" />
<p class="help-block"></p>
</div>
</div>
<div class="control-group">
<label class="control-label" for="rating">Rating</label>
<div class="controls">
<div class=" input-append">
<input class="input-xlarge" name="rating" type="text" id="rating" value="{$photo.rating}"><span class="add-on"> of 10</span>
</div>
<p class="help-block"></p>
</div>
</div>
<div class="control-group">
<label class="control-label" for="rated_by">Rated By</label>
<div class="controls">
<input type="text" class="input-xlarge" id="rated_by" name="rated_by" value="{$photo.rated_by}" />
<p class="help-block"></p>
</div>
</div>
</fieldset>
</div>
</div>
</form>
{if $colors}
<script type="text/javascript">
$(document).ready(function(){
$('div[rel=tooltip]').tooltip();
});
</script>
{$basedir=$smarty.const.STYLES_DIR}
{include file="$basedir/global/colors.html" colors=$colors|json_decode}
{/if}
{/if}

View file

@ -2,7 +2,7 @@
$(document).ready(function()
{
$('.popover-class').popover();
$('a[rel=tooltip]').tooltip();
$('a[rel=tooltip, span[rel=tooltip]').tooltip();
//Setting Up the Left Column and Menu List
$('.nav-sub-menu').each(function(){

View file

@ -106,7 +106,7 @@
</ul>
</div>
<div class="right-button">
<a class="btn btn-primary" onclick="$('#main_form').submit();">Save Settins</a>
<a class="btn btn-primary" onclick="$('#main_form').submit();">Save Settings</a>
</div>
</div>
@ -125,6 +125,7 @@
<input name="baseurl" value="{$row.baseurl}" type="hidden" />
<input name="basedir" value="{$row.baseurl}" type="hidden" />
<input type="hidden" value="Save Settings" name="update" />
<div class="tab-content">
<div id="div_1" class="tab-pane">
@ -324,9 +325,8 @@
</div>
</div>
<h2 class="sub_heading">Emails</h2>
<div class="height20"></div>
<fieldset>
<legend>Emails</legend>
<div class="control-group">
<label class="control-label" for="website_email">Website Email</label>
<div class="controls">
@ -373,11 +373,10 @@
<p class="help-block"></p>
</div>
</div>
</fieldset>
<h2 class="sub_heading">Comments</h2>
<div class="height20"></div>
<fieldset>
<legend>Comments</legend>
<div class="control-group">
<label class="control-label" for="video_comments">Allow Video Comments</label>
<div class="controls">
@ -427,21 +426,9 @@
<p class="help-block"></p>
</div>
</div>
<h2 class="sub_heading">Videos</h2>
<div class="height20"></div>
<div class="control-group">
<label class="control-label" for="videosSection">Enable video section</label>
<div class="controls">
<select name="videosSection" id="videosSection" class="input-xlarge">
<option value="yes" {if $r.videosSection!='no'} selected="selected"{/if}>Yes</option>
<option value="no" {if $r.videosSection=='no'} selected="selected"{/if}>No</option>
</select>
<p class="help-block"></p>
</div>
</div>
</fieldset>
<fieldset>
<legend>Videos</legend>
<div class="control-group">
<label class="control-label" for="facebook_embed">Enable video section</label>
<div class="controls">
@ -523,10 +510,9 @@
<p class="help-block"></p>
</div>
</div>
<h2>Channels</h2>
<div class="height20"></div>
</fieldset>
<fieldset>
<legend>Channels</legend>
<div class="control-group">
<label class="control-label" for="channelsSection">Enable channel section</label>
<div class="controls">
@ -553,10 +539,10 @@
<p class="help-block"></p>
</div>
</div>
</fieldset>
<h2>Groups</h2>
<div class="height20"></div>
<fieldset>
<legend>Groups</legend>
<div class="control-group">
<label class="control-label" for="groupsSection">Enable group section</label>
<div class="controls">
@ -623,10 +609,10 @@
<p class="help-block"></p>
</div>
</div>
</fieldset>
<h2 class="sub_heading">Photos</h2>
<div class="height20"></div>
<fieldset>
<legend>Photos</legend>
<div class="control-group">
<label class="control-label" for="photosSection">Enable photo section</label>
<div class="controls">
@ -637,10 +623,10 @@
<p class="help-block"></p>
</div>
</div>
</fieldset>
<h2 class="sub_heading">Collections</h2>
<div class="height20"></div>
<fieldset>
<legend>Collections</legend>
<div class="control-group">
<label class="control-label" for="collectionsSection">Enable collection section</label>
<div class="controls">
@ -667,7 +653,7 @@
<p class="help-block"></p>
</div>
</div>
</fieldset>
</div>
<div id="div_2" class="tab-pane">
@ -1221,9 +1207,8 @@
</div>
</div>
<h2 class="sub_heading">Profile Settings</h2>
<div class="height20"></div>
<fieldset>
<legend>Profile Settings</legend>
<div class="control-group">
<label class="control-label" for="fname_length">First Name max length</label>
<div class="controls">
@ -1367,10 +1352,10 @@
<p class="help-block"></p>
</div>
</div>
</fieldset>
<h2 class="sub_heading">Profile Pictures &amp; Background</h2>
<div class="height20"></div>
<fieldset>
<legend>Profile Pictures &amp; Background</legend>
<div class="control-group">
<label class="control-label" for="fav_books_length">Use Gravatars</label>
<div class="controls">
@ -1468,7 +1453,7 @@
<p class="help-block"></p>
</div>
</div>
</fieldset>
</div>
</div>

View file

@ -1,11 +1,17 @@
{if $mode == '' || $mode == 'photo_settings'}
<h2>Photo Settings</h2>
<p>Setup your photo resizing settings and photo behavior</p>
<div class="controller scrolltoFixed white-grad" >
<div class="buttons">
<div class="right-button">
<a class="btn btn-primary" onclick="$('#photo_settings').submit();">Update Settings</a>
</div>
</div>
<div class="clearfix"></div>
</div>
<form name="form1" method="post" id="photo_settings" class="form-horizontal">
<h2 class="sub_heading">{lang code='Photo Resizing'}</h2>
<div class="height20"></div>
<fieldset>
<legend>{lang code='Photo Resizing'}</legend>
<div class="control-group">
<label class="control-label" for="site_title">Photo Ratio</label>
<div class="controls">
@ -74,10 +80,12 @@
<p class="help-block"> If Enable, your thumb and medium size will be cropped exactly to above dimensions if required.</p>
</div>
</div>
<h2 class="sub_heading">Photo Behavior</h2>
</fieldset>
<div class="height20"></div>
<fieldset>
<legend>Photo Behavior</legend>
<div class="control-group">
<label for="multi_photo" class="control-label">Multi Upload</label>
<div class="controls">
@ -125,10 +133,9 @@
<p class="help-block"></p>
</div>
</div>
</fieldset>
<input type="submit" name="update" class="button" value="Update Settings" id="udpate" />
<input type="hidden" name="update" value="Update Settings" />
</form>
@ -138,7 +145,16 @@
{if $mode == 'watermark_settings'}
<h2>Watermark Settings</h2>
<p>Here you can upload new watermark, set it's position or set maximum width for watermark</p>
<form action="" method="post" enctype="multipart/form-data" class="form-horizontal">
<div class="controller scrolltoFixed white-grad" >
<div class="buttons">
<div class="right-button">
<a class="btn btn-primary" onclick="$('#watermak_form').submit();">Update Settings</a>
</div>
</div>
<div class="clearfix"></div>
</div>
<form action="" id="watermak_form" method="post" enctype="multipart/form-data" class="form-horizontal">
<div class="control-group">
<label class="control-label" for="watermark_photo">Enable Watermarking</label>
<div class="controls">
@ -175,9 +191,8 @@
</div>
</div>
{assign var=file value=$cbphoto->watermark_file()}
<h2 class="sub_heading">Upload New Watermark - <small rel="popover" class="popover-class" data-content="{if $file}<center><img src='{$file}' /></center>{else}<h4>No watermark found</h4>{/if}" title="Current Watermark">Current Watermark</small></h2>
<div class="height20"></div>
<fieldset>
<legend>Upload New Watermark - <small rel="popover" class="popover-class" data-content="{if $file}<center><img src='{$file}' /></center>{else}<h4>No watermark found</h4>{/if}" title="Current Watermark">Current Watermark</small></legend>
<div class="control-group relative">
<label for="watermark_file" class="control-label">Watermark File</label>
<div class="controls">
@ -185,12 +200,9 @@
<p class="help-block">This will over-write your existing watermark file, if exists.</p>
</div>
</div>
</fieldset>
<div class="clearfix"></div>
<div align="right"class="main_page_div">
<label>
<input type="submit" name="update_watermark" class="button" value="Update Settings" id="update_watermark" />
</label>
</div>
<input type="hidden" name="update_watermark" value="Update Settings" id="update_watermark" />
</form>
{/if}

View file

@ -1,7 +1,20 @@
{if $mode == 'single'}
<h2>Re-create Photo</h2>
<div class="controller scrolltoFixed white-grad" >
<div class="buttons">
<div class="btn-toolbar">
<div class="btn-group">
<a href="edit_photo.php?photo={$p.photo_id}" class="btn">Back to details</a>
</div>
</div>
<div class="right-button">
<a class="btn btn-primary" onclick="$('#mass_recreation').submit();">Re-create Photo</a>
</div>
</div>
<div class="clearfix"></div>
</div>
<form action="recreate_thumbs.php?mode={$mode}&amp;photo={$data.photo_id}" method="post" enctype="multipart/form-data">
<p><a href="edit_photo.php?photo={$p.photo_id}">&laquo; Back to Edit Details</a></p>
{include file="$style_dir/resizing_settings.html"}
<a href="recreate_thumbs.php?mode={$mode}&amp;photo={$p.photo_id}&amp;recreate=true" class="btn btn-large btn-primary moveR">Re-create Photo</a>
</form>
@ -10,19 +23,25 @@
{if $mode == 'mass' || $mode == ''}
<h2>Mass Re-creation of Photos</h2>
<p>This will re-create all the photos uploaded on your website, according to the settings shown below</p>
<div class="controller scrolltoFixed white-grad" >
<div class="buttons">
<div class="right-button">
<a class="btn btn-primary" onclick="$('#mass_recreation').submit();">Start Recreation</a>
</div>
</div>
<div class="clearfix"></div>
</div>
<p class="alert-danger alert">Take caution while using Mass Recreation. Use MAX of 5 photos per GO.</p>
{include file="$style_dir/resizing_settings.html"}
<form name="mass_recreation" method="get" class="form-horizontal" action="">
<form name="mass_recreation" id="mass_recreation" method="get" class="form-horizontal" action="">
<div class="control-group">
<label class="control-label">Loop Size</label>
<label class="control-label" for="the_loop_size">Loop Size</label>
<div class="controls">
<input type="text" name="loop_size" class="input-xlarge" value="{$loop_size}" id="the_loop_size" />
<p class="help-block">Number of photos to re-create in one go.</p>
</div>
</div>
<div class="form-actions">
<input type="submit" name="mass_recreation" id="mass_recreation" value="Start Recreation" class="btn btn-large btn-primary" />
</div>
<input type="hidden" name="mass_recreation" value="Start Recreation" />
</form>
{if $indexing}
@ -49,15 +68,28 @@
{if $mode == "collection"}
<h2>Recreate Photos</h2>
{assign var=cid value=$smarty.get.cid}
{assign var=c_name value=$cid|get_collection_field}
<div class="controller scrolltoFixed white-grad" >
<div class="buttons">
<div class="btn-group">
<a href="{$cbcollection->collection_links($cid,'vc')}" class="btn">{$c_name}</a>
<a href="edit_collection.php?collection={$cid}" class="btn">Edit Collection</a>
{if $items}<a href="manage_items.php?collection={$cid}&type={$cid|get_collection_field:type}" class="btn">Manage Items</a>{/if}
</div>
<div class="right-button">
{if $items}<a class="btn btn-primary" onclick="$('#collection_photos_recreate').submit();">Re-create Photos</a>{else}<a href="manage_items.php?collection={$cid}&type={$cid|get_collection_field:type}" class="btn btn-primary">Manage Items</a>{/if}
</div>
</div>
<div class="clearfix"></div>
</div>
{if $items}
{assign var=cid value=$items[0].collection_id}
{assign var=c_name value=$items[0].collection_id|get_collection_field}
<p><strong>{$c_name}</strong> - <a href="{$cbcollection->collection_links($items[0].collection_id,'vc')}">View Collection</a> - <a href="{$baseurl}/admin_area/edit_collection.php?collection={$cid}">Edit Collection</a> - <a href="{$baseurl}/admin_area/manage_items.php?collection={$cid}&amp;type={$items[0].collection_id|get_collection_field:type}">Manage Items</a></p>
{include file="$style_dir/resizing_settings.html"}
<h2 class="sub_heading">Collection Photos</h2>
<p>Select photos you want re-created or <a href="javascript:void(0);" class="btn btn-small" id='select-all-thumbs'>Click here to select all</a></p>
<div class="height20"></div>
<form action="" method="post" name="collection_photos_recreate">
<form action="" method="post" name="collection_photos_recreate" id="collection_photos_recreate">
<ul class="thumbnails" id="collection-thumbs">
{foreach from=$items item=photo}
<li class="inlineblock relative" style="float: none; vertical-align: top;">
@ -66,10 +98,7 @@
</li>
{/foreach}
</ul>
<div class="form-actions">
<input type="submit" name="recreating" value="Re-create Photos" class="btn btn-large btn-primary"/>
</div>
<input type="hidden" name="recreating" value="Re-create Photos" />
</form>
{else}

View file

@ -1,6 +1,6 @@
<h2 class="sub_heading">Settings on which photos will be re-created</h2>
<div class="height10"></div>
<table class="table table-bordered table-striped">
<div class="height10"></div>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>Property</th>
@ -53,5 +53,5 @@
</td>
</tr>
{/if}
</table>
<div class="height20"></div>
</table>
<div class="height20"></div>

View file

@ -310,11 +310,17 @@ class CBPhotos {
list( $join, $alias ) = join_collection_table();
}
if ( is_numeric( $pid ) )
$result = $db->select( tbl( $this->p_tbl ).$join, "*".$alias, " photo_id = '$pid'" );
else
$result = $db->select( tbl( $this->p_tbl ).$join, "*".$alias, " photo_key = '$pid'" );
$userFields = array('userid','username','avatar','avatar_url','email','total_videos');
$uQueryFields = ',users.'.implode(',users.',$userFields);
if ( is_numeric( $pid ) )
$cond = tbl( $this->p_tbl.".photo_id='$pid'");
else
$cond = tbl( $this->p_tbl.".photo_key='$pid'" );
$result = $db->select( tbl( $this->p_tbl )
.' LEFT JOIN '.tbl('users').' ON '
.tbl($this->p_tbl.'.userid').' = '.tbl('users.userid').$join, tbl($this->p_tbl.".*".$uQueryFields).$alias, $cond );
//echo $db->db_query;
if ( $db->num_rows > 0 )
return $result[0];
@ -1167,9 +1173,11 @@ class CBPhotos {
$p['user'] = userid();
$p['type'] = "photos";
if ( $array['is_avatar'] == 'no' ) {
$collections = $this->collection->get_collections( $p );
$cl_array = $this->parse_array( $collections );
$collection = $array['collection_id'];
}
$this->unique = rand( 0, 9999 );
$fields =
array
@ -1204,8 +1212,11 @@ class CBPhotos {
'db_field' => 'photo_tags',
'required' => 'yes',
'invalid_err' => lang( 'photo_tags_err' )
),
'collection' => array(
)
);
if ( $array['is_avatar'] == 'no' ) {
$fields['collection'] = array(
'title' => lang( 'collection' ),
'id' => 'collection_id',
'name' => 'collection_id',
@ -1215,9 +1226,8 @@ class CBPhotos {
'required' => '',
'checked' => $collection,
'invalid_err' => lang( 'photo_collection_err' )
)
);
}
return $fields;
}
@ -2868,7 +2878,7 @@ class CBPhotos {
$cond = ' AND '.$cond;
}
$results = $db->select( tbl('photo_tags'),'*', " photo_id = '".$photo."' || ptag_key = '".$photo."' || ptag_id = '".$photo."' ".$cond." ", $limit, $order );
$results = $db->select( tbl('photo_tags'),'*', " photo_id = '".$photo."' ".$cond." ", $limit, $order );
if ( $results ) {
return $results;
} else {

View file

@ -51,7 +51,11 @@ function delete_collection_photos( $details ) {
*/
function confirm_collection_type ( $type ) {
global $cbcollection;
if (empty($type) || $type != $cbcollection->types ) {
if ( empty($type) ) {
$type = 'photos';
}
if ($type != $cbcollection->types ) {
if ( VERSION < '3.0' ) {
// Get Deprecated Types;
$dep_types = $cbcollection->deprecated_types;

View file

@ -900,8 +900,9 @@ function display_manager_links( $photo ) {
function cb_some_photo_plugin_links( $links ) {
global $cbphoto;
$photo = $cbphoto->photo;
$link = '?some_var='.$photo['photo_key'];
$links[] = add_photo_manager_link( 'Testing Callbacks', $link, 'test_callback_for_photo' );
$link = 'recreate_thumbs.php?mode=single&photo='.$photo['photo_id'];
$links[] = add_photo_manager_link( lang('Re-create Photo'), $link );
$links[] = add_photo_manager_link( lang('Edit Collection ('. $photo['collection_name'].')'), 'edit_collection.php?collection='.$photo['collection_id'] );
return $links;
}

View file

@ -674,6 +674,14 @@ function head_menu($params = NULL) {
return $Cbucket->head_menu($params);
}
/**
* This function returns the provided menu. If no name is passed
* navigation menu will load automatically.
*
* @global object $Cbucket
* @param array $params
* @return string
*/
function cbMenu($params = NULL) {
global $Cbucket;
$name = $params['name'];
@ -1096,6 +1104,18 @@ function add_menu_items($name, $items) {
}
}
/**
* This adds a new item in provided menu.
* @param $name STRING, Name of the menu in which item will be added
* @param $item STRING|ARRAY, If a string is provided it will be considered as item title
* it should be an array
* @param $link STRING, HTTP URL for provided title
* @param $section STRING, Name of the section
* @param $icon STRING, Add class name for icon. http://twitter.github.com/bootstrap/base-css.html#icon
* contains list of all icons that you can use
* @param $id STRING, Unique id for this item
* @param $target STRING, Set a target for current item
*/
function add_menu_item($name, $item, $link = false, $section = false, $icon = false, $id = false, $target = '_self') {
global $Cbucket;
if (!is_array($item)) {