2012-08-16 20:10:07 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/*
|
|
|
|
* As the name suggest, this file make everything ready for website
|
|
|
|
* to operate before it goes to give an output
|
|
|
|
*/
|
|
|
|
|
|
|
|
include(BASEDIR.'/modules/uploader/uploader.php');
|
|
|
|
|
|
|
|
|
2012-09-01 23:03:02 +00:00
|
|
|
/***
|
|
|
|
* Adding custom thumb sizes
|
|
|
|
*/
|
2012-09-04 10:38:50 +00:00
|
|
|
add_thumb_size('120x60','default');
|
2012-09-01 23:03:02 +00:00
|
|
|
add_thumb_size('160x120');
|
|
|
|
add_thumb_size('300x250');
|
|
|
|
add_thumb_size('640x360');
|
2012-09-04 10:53:58 +00:00
|
|
|
add_thumb_size('original');
|
2012-09-04 16:28:33 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Register metas
|
|
|
|
*/
|
|
|
|
$cbvid->register_meta('thumbs');
|
|
|
|
|
2012-09-13 12:18:39 +00:00
|
|
|
/**
|
|
|
|
* Registering Photo Embed codes
|
|
|
|
*/
|
|
|
|
add_photo_embed_type(lang('HTML Code'), 'html-code', 'photo_html_code');
|
|
|
|
add_photo_embed_type(lang('Email or IM'), 'email-code', 'photo_email_code');
|
|
|
|
add_photo_embed_type(lang('BB Code'), 'bb-code', 'photo_bb_code');
|
|
|
|
add_photo_embed_type(lang('Linked BB Code'), 'bb-code-linked', 'photo_bb_code_linked');
|
|
|
|
add_photo_embed_type(lang('BB Code Alterantive'), 'bb-code-alternative', 'photo_bb_code_alt');
|
|
|
|
add_photo_embed_type(lang('Linked BB Code Alterantive'), 'bb-code-alternative-linked', 'photo_bb_code_alt_linked');
|
Fixed : Mass Recreation of photos
Fixed : Uploading/Making/Changing user avatar will also update collection cover to current one
Fixed : $crop variable to $cropping in generate_photos. In resizer.class.php we are using $cropping
Added : New cropping case, 10. Read it's example to understand what it does
Added : Documentation for few function in functions_photos.php
Added : new function called display_user_custom_background in functions_users.php
Added : Custom Dimensions for photos in startup.php. Now these will also be produced, 75x75,100x100,150x150,240,320,500,640,800,1024
Updated : default.css
Added : new display_method in blocks/video.html
Added : Change background form
Fixed : photo embed code
2012-09-26 12:35:05 +00:00
|
|
|
|
2012-10-03 19:00:29 +00:00
|
|
|
add_custom_photo_size( 'Small Square', '75x75', 75, 75, 5, false, true );
|
|
|
|
add_custom_photo_size( 'Medium Square', '100x100', 100, 100, 5, false );
|
|
|
|
add_custom_photo_size( 'Big Square', '150x150', 150, 150, 5 );
|
Fixed : Mass Recreation of photos
Fixed : Uploading/Making/Changing user avatar will also update collection cover to current one
Fixed : $crop variable to $cropping in generate_photos. In resizer.class.php we are using $cropping
Added : New cropping case, 10. Read it's example to understand what it does
Added : Documentation for few function in functions_photos.php
Added : new function called display_user_custom_background in functions_users.php
Added : Custom Dimensions for photos in startup.php. Now these will also be produced, 75x75,100x100,150x150,240,320,500,640,800,1024
Updated : default.css
Added : new display_method in blocks/video.html
Added : Change background form
Fixed : photo embed code
2012-09-26 12:35:05 +00:00
|
|
|
add_custom_photo_size( 'Thumb 240', '240', 240, 0, 10 );
|
|
|
|
add_custom_photo_size( 'Thumb 320', '320', 320, 0, 10 );
|
|
|
|
add_custom_photo_size( 'Medium 500', '500', 500, 0, 10, config('watermark_photo') );
|
|
|
|
add_custom_photo_size( 'Medium 640', '640', 640, 0, 10, config('watermark_photo') );
|
|
|
|
add_custom_photo_size( 'Large 800', '800', 800, 0, 10, config('watermark_photo') );
|
|
|
|
add_custom_photo_size( 'Large 1024', '1024', 1024, 0, 10, config('watermark_photo') );
|
2012-10-03 19:00:29 +00:00
|
|
|
|
|
|
|
function _edit_collection_link( $photo ) {
|
|
|
|
global $cbphoto;
|
|
|
|
|
|
|
|
if ( $cbphoto->collection->is_collection_owner( $photo['collection_id'] ) ) {
|
2012-11-27 11:56:45 +00:00
|
|
|
return collection_links( $photo['collection_id'], 'edit_collection' );
|
2012-10-03 19:00:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Add view exif data link
|
|
|
|
*
|
|
|
|
* @global OBJECT $cbphoto
|
|
|
|
* @param ARRAY $photo
|
|
|
|
* @return MIX
|
|
|
|
*/
|
|
|
|
function _view_exif_data_link( $photo ) {
|
|
|
|
global $cbphoto;
|
|
|
|
if ( ( $photo['exif_data'] == 'yes' && $photo['view_exif'] == 'yes' ) || ( $photo['userid'] == userid() && $photo['exif_data'] == 'yes' ) ) {
|
|
|
|
return $cbphoto->photo_links( $photo, 'exif_data' );
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Add link to set as avatar only if photo is avatar and photo is not current avatar
|
|
|
|
*
|
|
|
|
* @global OBJECT $cbphoto
|
|
|
|
* @global ARRAY $userquery
|
|
|
|
* @param ARRAY $photo
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
function _manager_set_avatar_link( $photo ) {
|
|
|
|
global $cbphoto, $userquery;
|
|
|
|
if ( $photo['is_avatar'] == 'yes' && userid().'_'.$photo['filename'].'.'.$photo['ext'] != $userquery->udetails['avatar'] ) {
|
|
|
|
return $cbphoto->photo_links( $photo, 'make_avatar' );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Add set photo as cover for photos that are only not avatars
|
|
|
|
* and photo is not current cover photo
|
|
|
|
*
|
|
|
|
* @global OBJECT $cbphoto
|
|
|
|
* @param ARRAY $photo
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
function _set_cover_photo_link( $photo ) {
|
|
|
|
global $cbphoto;
|
2012-11-27 11:56:45 +00:00
|
|
|
|
|
|
|
if ( $photo['is_avatar'] == 'no' && userid() == $cbphoto->get_photo_owner( $photo['photo_id'] ) ) {
|
2012-10-03 19:00:29 +00:00
|
|
|
return '?cover='.$photo['photo_id'].'&cid='.$photo['collection_id'];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Callback for _set_cover_photo_link
|
|
|
|
*
|
|
|
|
* @global OBJECT $cbcollection
|
|
|
|
* @return boolean
|
|
|
|
*/
|
|
|
|
function _set_cover_photo_callback() {
|
|
|
|
global $cbcollection;
|
|
|
|
$pid = mysql_clean( $_GET['cover'] );
|
|
|
|
$cid = mysql_clean( $_GET['cid'] );
|
|
|
|
|
|
|
|
if ( !$pid || !$cid ) {
|
|
|
|
e( lang('Unable to update collection cover photo.') );
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( $cbcollection->set_cover_photo( $pid, $cid ) ) {
|
|
|
|
e( lang('Collection cover photo has been updated.'), 'm' );
|
|
|
|
} else {
|
|
|
|
e( lang('Unable to update collection cover photo.') );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
add_photo_manager_link( lang('Exif data'), '_view_exif_data_link', false, true );
|
|
|
|
add_photo_manager_link( lang('Edit collection'), '_edit_collection_link', false, true );
|
|
|
|
add_photo_manager_link( lang('Set as avatar'), '_manager_set_avatar_link', false, true );
|
|
|
|
add_photo_manager_link( lang('Make collection cover'), '_set_cover_photo_link', '_set_cover_photo_callback', true );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Adding orders for photo manager
|
|
|
|
*/
|
2012-11-27 11:56:45 +00:00
|
|
|
add_photo_manager_order( lang('Newest'), tbl('photos.date_added desc') );
|
|
|
|
add_photo_manager_order( lang('Oldest'), tbl('photos.date_added asc') );
|
|
|
|
add_photo_manager_order( lang('Most Viewed'), tbl('photos.views desc') );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Adding orders for collection manager
|
|
|
|
*/
|
|
|
|
add_collection_manager_order( lang('Newest'), tbl('collections.date_added desc') );
|
|
|
|
add_collection_manager_order( lang('Oldest'), tbl('collections.date_added asc') );
|
|
|
|
add_collection_manager_order( lang('Most Viewed'), tbl('collections.views desc') );
|
|
|
|
add_collection_manager_order( lang('Most Photos'), tbl('collections.total_objects desc') );
|
|
|
|
add_collection_manager_order( lang('Last Updated'), tbl('collections.last_updated desc') );
|
2012-08-16 20:10:07 +00:00
|
|
|
?>
|