modified : channel background feature killed

This commit is contained in:
Fahad Abbas 2016-04-27 17:38:28 +05:00
parent 666a1a70c1
commit d3d51b079a
3 changed files with 33 additions and 151 deletions

View file

@ -1096,32 +1096,6 @@ class Upload{
}
}
break;
case 'b':
case 'bg':
case 'background':
{
if($file['size']/1024 > config('max_bg_size'))
e(sprintf(lang('file_size_exceeds'),config('max_bg_size')));
elseif(file_exists($file['tmp_name']))
{
$ext = getext($file['name']);
$file_name = $uid.'.'.$ext;
$file_path = $bg_dir.$file_name;
if(move_uploaded_file($file['tmp_name'],$file_path))
{
if(!$imgObj->ValidateImage($file_path,$ext))
{
e(lang("Invalid file type"));
@unlink($file_path);
}else{
$imgObj->CreateThumb($file_path,$file_path,BG_SIZE,$ext);
}
}else{
e(lang("An error occured While Uploading File!"));
}
}
}
break;
}
return $file_name;
}else

View file

@ -3159,7 +3159,6 @@ class userquery extends CBCategory{
lang('account_settings') =>'edit_account.php?mode=account',
lang('user_profile_settings') =>'edit_account.php?mode=profile',
lang('change_avatar') => 'edit_account.php?mode=avatar_bg',
lang('change_bg') => 'edit_account.php?mode=channel_bg',
);
if(isSectionEnabled('videos'))

View file

@ -150,132 +150,41 @@
{include file="$style_dir/blocks/manage/userMenuLeft.html"}
</div>
<div class="col-md-9 col-sm-9 col-xs-12">
<div class="tabbable">
<ul class="nav nav-tabs" id="myTab1">
<li class="{if $mode == 'avatar_bg'} active {/if}">
<a href="{$baseurl}/edit_account.php?mode=avatar_bg">
<h5>{lang code='User Avatar'}</h5>
</a>
</li>
<li class="{if $mode == 'channel_bg'} active {/if}">
<a href="{$baseurl}/edit_account.php?mode=channel_bg">
<h5>{lang code='Channel Background'}</h5>
</a>
</li>
</ul>
<div class="tab-content clearfix">
<div id="uavatar" class="tab-pane {if $mode == 'avatar_bg'} active {/if}">
<form method="post" enctype="multipart/form-data">
<h2>{lang code='user_user_avatar'}</h2>
<div class="show-image">
<img src="{$userquery->getUserThumb($user)}" class="edit-img-thumbnail img-responsive" />
</div>
<div class="form-group">
<label for="avatar_file">
<h4>{lang code='user_user_avatar'}</h4>
{lang code='please_select_img_file'}
</label>
<input type="file" name="avatar_file" id="avatar_file" class="the-buttons btn" />
</div>
<h3>{lang code='or'}</h3>
<div class="form-group">
<label for="avatar_url">{lang code='pelase_enter_image_url'}</label>
<input class="form-control" name="avatar_url" type="text" id="avatar_url" value="{$user.avatar_url}" />
</div>
<div class="form-group">
<label class="radio">
<input name="delete_avatar" type="checkbox" id="delete_avatar" value="yes" />
{lang code='delete_this_img'} - (if user has uploaded profile pic)
</label>
<input type="hidden" name="avatar_file_name" value="{$user.avatar}" />
</div>
<div class="form-group">
<button name="update_avatar_bg" id="button1" value="submit" class="btn btn-primary">
{lang code='update'}
</button>
</div>
</form>
</div>
<div id="cbackground" class="tab-pane {if $mode == 'channel_bg'} active {/if}">
<form method="post" enctype="multipart/form-data">
<div class="avatar_bg">
<h2>{lang code='user_bg'}</h2>
<!-- <div class="show-image">
{if $userquery->getUserBg($user)}
<img src="{$userquery->getUserBg($user)}" class="edit-img-thumbnail"/>
<input type="file" name="background_file" id="background_file" value="Change Cover" class="the-buttons btn btn-danger position" />
{else}
<em><strong>No Bg</strong></em>
{/if}
</div>-->
<div class="show-image">
{if $userquery->getUserBg($user)}
<img src="{$userquery->getUserBg($user)}" class="edit-img-thumbnail img-responsive"/>
<input type="file" name="background_file" id="background_file" value="Change Cover" class="the-buttons btn" />
{else}
<input type="file" name="background_file" id="background_file" value="Change Cover" class="the-buttons btn" />
{/if}
</div>
<br>
<h3>{lang code='or'}</h3>
<div class="form-group">
<label for="background_url">{lang code='pelase_enter_image_url'}</label>
<input class="form-control" name="background_url" type="text" id="background_url" value="{$user.background_url}" />
</div>
<h3>{lang code='or'}</h3>
<div class="form-group">
<label for="background_color">{lang code='please_enter_bg_color'}</label>
<input class="form-control" name="background_color" type="text" id="background_color" value="{$user.background_color}" />
<input type="hidden" name="bg_file_name" value="{$user.background}" />
</div>
<div class="form-group">
<label for="background_repeat">{lang code='bg_repeat_type'}</label>
<select class="form-control" name="background_repeat" id="background_repeat" >
<option value="repeat" {if $user.background_repeat=='repeat'} selected="selected"{/if}>
repeat
</option>
<option value="repeat-x" {if $user.background_repeat=='repeat-x'} selected="selected"{/if}>
repeat-x
</option>
<option value="repeat-y" {if $user.background_repeat=='repeat-y'} selected="selected"{/if}>
repeat-y
</option>
<option value="no-repeat" {if $user.background_repeat=='no-repeat'} selected="selected"{/if}>
no-repeat
</option>
</select>
</div>
<div class="form-group">
<label for="background_attachement" class="radio">
<input type="checkbox" {if $user.background_attachement=='yes'} checked="checked"{/if} value="yes" name="background_attachement" id="background_attachement" />
{lang code='fix_bg'}
</label>
</div>
<div class="form-group">
{if $userquery->getUserBg($user)}
<label for="delete_bg" class="checkbox">
<input name="delete_bg" type="checkbox" id="delete_bg" value="yes" />
{lang code='delete_this_img'}
</label>
{/if}
</div>
<div class="form-group">
<button name="update_avatar_bg" id="button2" value="submit" class="btn btn-primary">
{lang code='update'}
</button>
</div>
</div>
</form>
</div>
<div id="uavatar" class="tab-pane {if $mode == 'avatar_bg'} active {/if}">
<form method="post" enctype="multipart/form-data">
<h2>{lang code='user_user_avatar'}</h2>
<div class="show-image">
<img src="{$userquery->getUserThumb($user)}" class="edit-img-thumbnail img-responsive" />
</div>
<div class="form-group">
<label for="avatar_file">
<h4>{lang code='user_user_avatar'}</h4>
{lang code='please_select_img_file'}
</label>
<input type="file" name="avatar_file" id="avatar_file" class="the-buttons btn" />
</div>
<h3>{lang code='or'}</h3>
<div class="form-group">
<label for="avatar_url">{lang code='pelase_enter_image_url'}</label>
<input class="form-control" name="avatar_url" type="text" id="avatar_url" value="{$user.avatar_url}" />
</div>
<div class="form-group">
<label class="radio">
<input name="delete_avatar" type="checkbox" id="delete_avatar" value="yes" />
{lang code='delete_this_img'} - (if user has uploaded profile pic)
</label>
<input type="hidden" name="avatar_file_name" value="{$user.avatar}" />
</div>
<div class="form-group">
<button name="update_avatar_bg" id="button1" value="submit" class="btn btn-primary">
{lang code='update'}
</button>
</div>
</form>
</div>
</div>
</div>
{else if $mode != 'profile_settings' && $mode != 'account_settings'}