2009-11-04 10:27:40 +00:00
|
|
|
<?php
|
|
|
|
/*
|
2010-01-15 16:10:20 +00:00
|
|
|
***************************************************************
|
|
|
|
| Copyright (c) 2007-2010 Clip-Bucket.com. All rights reserved.
|
|
|
|
| @ Author : ArslanHassan
|
|
|
|
| @ Software : ClipBucket , © PHPBucket.com
|
|
|
|
****************************************************************
|
2009-11-04 10:27:40 +00:00
|
|
|
*/
|
2010-07-28 11:43:41 +00:00
|
|
|
|
|
|
|
define("THIS_PAGE","edit_account");
|
|
|
|
|
2009-11-04 10:27:40 +00:00
|
|
|
require 'includes/config.inc.php';
|
|
|
|
$userquery->logincheck();
|
|
|
|
|
|
|
|
//Updating Profile
|
|
|
|
if(isset($_POST['update_profile']))
|
|
|
|
{
|
|
|
|
$array = $_POST;
|
|
|
|
$array['userid'] = userid();
|
|
|
|
$userquery->update_user($array);
|
|
|
|
}
|
|
|
|
|
|
|
|
//Updating Avatar
|
|
|
|
if(isset($_POST['update_avatar_bg']))
|
|
|
|
{
|
|
|
|
$array = $_POST;
|
|
|
|
$array['userid'] = userid();
|
|
|
|
$userquery->update_user_avatar_bg($array);
|
|
|
|
}
|
|
|
|
|
|
|
|
//Changing Email
|
|
|
|
if(isset($_POST['change_email']))
|
|
|
|
{
|
|
|
|
$array = $_POST;
|
|
|
|
$array['userid'] = userid();
|
|
|
|
$userquery->change_email($array);
|
|
|
|
}
|
|
|
|
|
|
|
|
//Changing User Password
|
|
|
|
if(isset($_POST['change_password']))
|
|
|
|
{
|
|
|
|
$array = $_POST;
|
|
|
|
$array['userid'] = userid();
|
|
|
|
$userquery->change_password($array);
|
|
|
|
}
|
|
|
|
|
|
|
|
//Banning Users
|
2011-02-10 11:59:27 +00:00
|
|
|
if(isset($_POST['block_users']))
|
2009-11-04 10:27:40 +00:00
|
|
|
{
|
2011-02-10 11:59:27 +00:00
|
|
|
$userquery->block_users($_POST['users']);
|
2009-11-04 10:27:40 +00:00
|
|
|
}
|
|
|
|
|
Added : Photo EXIF Data in insert_photo()
Added : Make Avatar from any photo
Added : Collection cover photo
Added : An array for thumb creations. Includes, code, width, height, watermark, sharpit
Added : Resizer class in common.php
Added : jquery.Jcrop.js in edit_account
Added : A common function called cb_filename. All filenames used in clipbucket follow a specific syntax
Added : Four new function for photos. get_original_photo, insert_photo_colors, insert_exif_data & add_custom_photo_size
Added : User Avatar collection functions. But they are not in use right now. This need proper thinking
Added : New files: mobile-form-class.php, resizer.class.php, exif.php, makers files for exif, jquery.Jcrop plugin, some template files
2012-05-16 07:27:54 +00:00
|
|
|
if ( mysql_clean($_GET['mode']) == 'make_avatar' ) {
|
|
|
|
|
|
|
|
$pid = mysql_clean( $_GET['pid'] );
|
|
|
|
$pid = $cbphoto->decode_key( $pid );
|
|
|
|
$pid = substr( $pid, 12, 12 );
|
|
|
|
$photo = $cbphoto->get_photo( $pid );
|
|
|
|
|
|
|
|
if ( !$photo ) {
|
|
|
|
e( lang('photo_not_exist') );
|
|
|
|
cb_show_page( false );
|
|
|
|
} else {
|
|
|
|
assign( 'photo', $photo );
|
|
|
|
if ( isset($_GET['set_avatar']) ) {
|
2012-05-28 07:10:27 +00:00
|
|
|
/* Run set avatar code */
|
|
|
|
$uid = userid();
|
|
|
|
$db->update( tbl('users'), array('avatar'), array( $uid.'_'.$photo['filename'].'.'.$photo['ext'] ), " userid = '".$uid."' " );
|
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
|
|
|
/* update cover photo of collection */
|
|
|
|
$cbcollection->set_cover_photo( $photo['photo_id'], $photo['collection_id'] );
|
2012-05-28 07:10:27 +00:00
|
|
|
// redirect back to photo
|
Updated : upgrade_3.0.sql
Updated : edit_account.php, Now when avatar is set it redirects to user profile
Updated : EXIF Data url
Updated : queryString function regex. Old one was removing complete query string
Updated : display_manager_links(), now all variables except omo are removed from url
Added : Make profile link for photos @startup.php
Added : return_object_order in template_functions.php, This returns the order of provided omo value
Updated : Order checking @manage_collections.php and @manage_photos.php. Now only return_object_order is used
Updated : Updating of photo when it is uploaded
Updated : photo.html, single_feed.html, single_feed_comment.html, photo_form.html, user.html, video.html, /view_channel/feed.html, manage_photos.html, view_channel.html
Added : user_contacts.html, user_photos.html and user_videos.html
Added : autoComplete parameter for photo tagging
Updated : default.css, feeds.css and view_channel.css
Updated : user_contacts.php
Added : Next and Previous photos links @view_item.php
Fixed : Avatar Delete
Fixed : getProfileItem method of $userquery
2012-12-04 13:27:13 +00:00
|
|
|
redirect_to( $userquery->profile_link( $photo['userid'] ) );
|
Added : Photo EXIF Data in insert_photo()
Added : Make Avatar from any photo
Added : Collection cover photo
Added : An array for thumb creations. Includes, code, width, height, watermark, sharpit
Added : Resizer class in common.php
Added : jquery.Jcrop.js in edit_account
Added : A common function called cb_filename. All filenames used in clipbucket follow a specific syntax
Added : Four new function for photos. get_original_photo, insert_photo_colors, insert_exif_data & add_custom_photo_size
Added : User Avatar collection functions. But they are not in use right now. This need proper thinking
Added : New files: mobile-form-class.php, resizer.class.php, exif.php, makers files for exif, jquery.Jcrop plugin, some template files
2012-05-16 07:27:54 +00:00
|
|
|
} else if( isset( $_POST['set_avatar']) ) {
|
2012-05-18 13:47:20 +00:00
|
|
|
/* Run make avatar code */
|
2012-05-28 07:10:27 +00:00
|
|
|
make_new_avatar();
|
Added : Photo EXIF Data in insert_photo()
Added : Make Avatar from any photo
Added : Collection cover photo
Added : An array for thumb creations. Includes, code, width, height, watermark, sharpit
Added : Resizer class in common.php
Added : jquery.Jcrop.js in edit_account
Added : A common function called cb_filename. All filenames used in clipbucket follow a specific syntax
Added : Four new function for photos. get_original_photo, insert_photo_colors, insert_exif_data & add_custom_photo_size
Added : User Avatar collection functions. But they are not in use right now. This need proper thinking
Added : New files: mobile-form-class.php, resizer.class.php, exif.php, makers files for exif, jquery.Jcrop plugin, some template files
2012-05-16 07:27:54 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2009-11-04 10:27:40 +00:00
|
|
|
$mode = $_GET['mode'];
|
|
|
|
|
Added : Photo EXIF Data in insert_photo()
Added : Make Avatar from any photo
Added : Collection cover photo
Added : An array for thumb creations. Includes, code, width, height, watermark, sharpit
Added : Resizer class in common.php
Added : jquery.Jcrop.js in edit_account
Added : A common function called cb_filename. All filenames used in clipbucket follow a specific syntax
Added : Four new function for photos. get_original_photo, insert_photo_colors, insert_exif_data & add_custom_photo_size
Added : User Avatar collection functions. But they are not in use right now. This need proper thinking
Added : New files: mobile-form-class.php, resizer.class.php, exif.php, makers files for exif, jquery.Jcrop plugin, some template files
2012-05-16 07:27:54 +00:00
|
|
|
|
|
|
|
|
2009-11-04 10:27:40 +00:00
|
|
|
switch($mode)
|
|
|
|
{
|
2011-02-09 13:32:08 +00:00
|
|
|
case 'account':
|
|
|
|
{
|
|
|
|
assign('on','account');
|
|
|
|
assign('mode','profile_settings');
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 'profile':
|
2009-11-04 10:27:40 +00:00
|
|
|
{
|
2011-02-09 13:32:08 +00:00
|
|
|
assign('on','profile');
|
2009-11-04 10:27:40 +00:00
|
|
|
assign('mode','profile_settings');
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 'avatar_bg':
|
|
|
|
{
|
|
|
|
assign('mode','avatar_bg');
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
Added : Photo EXIF Data in insert_photo()
Added : Make Avatar from any photo
Added : Collection cover photo
Added : An array for thumb creations. Includes, code, width, height, watermark, sharpit
Added : Resizer class in common.php
Added : jquery.Jcrop.js in edit_account
Added : A common function called cb_filename. All filenames used in clipbucket follow a specific syntax
Added : Four new function for photos. get_original_photo, insert_photo_colors, insert_exif_data & add_custom_photo_size
Added : User Avatar collection functions. But they are not in use right now. This need proper thinking
Added : New files: mobile-form-class.php, resizer.class.php, exif.php, makers files for exif, jquery.Jcrop plugin, some template files
2012-05-16 07:27:54 +00:00
|
|
|
case 'make_avatar': {
|
|
|
|
assign('mode', 'make_avatar');
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2009-11-04 10:27:40 +00:00
|
|
|
case 'change_email':
|
|
|
|
{
|
|
|
|
assign('mode','change_email');
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 'change_password':
|
|
|
|
{
|
|
|
|
assign('mode','change_password');
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2011-02-10 11:59:27 +00:00
|
|
|
case 'block_users':
|
2009-11-04 10:27:40 +00:00
|
|
|
{
|
2011-02-10 11:59:27 +00:00
|
|
|
assign('mode','block_users');
|
2009-11-04 10:27:40 +00:00
|
|
|
}
|
|
|
|
break;
|
2010-02-01 12:06:13 +00:00
|
|
|
|
|
|
|
case 'subscriptions':
|
|
|
|
{
|
|
|
|
//Removing subscription
|
|
|
|
if(isset($_GET['delete_subs']))
|
|
|
|
{
|
|
|
|
$sid = mysql_clean($_GET['delete_subs']);
|
|
|
|
$userquery->unsubscribe_user($sid);
|
|
|
|
}
|
|
|
|
assign('mode','subs');
|
|
|
|
assign('subs',$userquery->get_user_subscriptions(userid()));
|
|
|
|
}
|
|
|
|
break;
|
2011-02-09 13:32:08 +00:00
|
|
|
|
|
|
|
default:
|
|
|
|
{
|
|
|
|
assign('on','account');
|
|
|
|
assign('mode','profile_settings');
|
|
|
|
}
|
2009-11-04 10:27:40 +00:00
|
|
|
}
|
|
|
|
|
2009-12-31 08:59:12 +00:00
|
|
|
|
2009-11-04 10:27:40 +00:00
|
|
|
$udetails = $userquery->get_user_details(userid());
|
2010-07-28 11:43:41 +00:00
|
|
|
$profile = $userquery->get_user_profile($udetails['userid']);
|
|
|
|
$user_profile = array_merge($udetails,$profile);
|
|
|
|
//pr($Cbucket->header_files);
|
2009-11-04 10:27:40 +00:00
|
|
|
assign('user',$udetails);
|
2010-07-28 11:43:41 +00:00
|
|
|
assign('p',$user_profile);
|
|
|
|
|
2009-11-04 10:27:40 +00:00
|
|
|
|
2009-12-31 08:59:12 +00:00
|
|
|
subtitle(lang("user_manage_my_account"));
|
2009-11-04 10:27:40 +00:00
|
|
|
template_files('edit_account.html');
|
|
|
|
display_it();
|
|
|
|
?>
|