From fdc6ebbd82acfaed644341774ad6ed708d93ef01 Mon Sep 17 00:00:00 2001 From: Arslan Hassan Date: Wed, 4 Nov 2009 10:27:40 +0000 Subject: [PATCH] Removed : actual_upload.php and ActualUpload.php Added : User Ban System Added : New User My account Added : Video Manage System Added : Favorite Manage System Added : Private Messaging System --- upload/ActualUpload.php | 32 - upload/actions/update_configs.php | 16 +- upload/actual_upload.php | 42 - upload/admin_area/edit_member.php | 36 +- upload/admin_area/members.php | 187 +-- .../cbadmin/layout/blocks/access_log.html | 10 + .../styles/cbadmin/layout/body.html | 7 +- .../styles/cbadmin/layout/left_menu.html | 3 +- .../styles/cbadmin/layout/manage_players.html | 40 +- .../styles/cbadmin/layout/members.html | 70 + .../admin_area/styles/cbadmin/layout/msg.html | 2 +- .../styles/cbadmin/layout/video_manager.html | 8 +- .../styles/cbadmin/layout/view_user.html | 313 ++++ .../styles/cbadmin/theme/stylesheet.css | 4 +- upload/admin_area/video_manager.php | 2 +- upload/admin_area/view_user.php | 33 + upload/channels.php | 99 +- upload/convert_process.php | 13 - upload/edit_account.php | 92 ++ upload/edit_video.php | 77 +- upload/includes/classes/actions.class.php | 48 +- upload/includes/classes/category.class.php | 4 +- upload/includes/classes/image.class.php | 74 +- upload/includes/classes/my_queries.class.php | 41 +- upload/includes/classes/pages.class.php | 50 +- upload/includes/classes/search.class.php | 9 +- upload/includes/classes/signup.class.php | 34 +- upload/includes/classes/upload.class.php | 74 +- upload/includes/classes/user.class.php | 1264 +++++++++++++---- upload/includes/classes/video.class.php | 162 ++- upload/includes/common.php | 31 +- upload/includes/config.inc.php | 4 - upload/includes/dbconnect.php | 2 - upload/includes/functions.php | 337 ++++- upload/includes/plugin.functions.php | 2 +- upload/includes/plugins_functions.php | 11 + upload/includes/whois/whois.php | 120 ++ upload/index.php | 2 + upload/js/functions.js | 13 + .../compressed/jquery.scrollTo-min.js | 11 + upload/manage_videos.php | 187 ++- upload/myaccount.php | 30 +- upload/player/cbplayer/cbplayer.plug.php | 2 +- upload/player/flow_player/flow_player.php | 2 +- upload/plugins/cb_bbcodes/cb_bbcode.php | 4 +- upload/private_message.php | 162 +++ upload/styles/cbv2/images/blocks.png | Bin 0 -> 2196 bytes upload/styles/cbv2/images/buttons.png | Bin 0 -> 2204 bytes upload/styles/cbv2/images/gradients.png | Bin 315 -> 376 bytes upload/styles/cbv2/images/icons.png | Bin 5443 -> 6706 bytes upload/styles/cbv2/images/small_stars.png | Bin 554 -> 526 bytes .../styles/cbv2/layout/blocks/comments.html | 18 +- .../layout/blocks/manage/account_head.html | 24 + .../layout/blocks/manage/account_left.html | 11 + .../layout/blocks/manage/account_video.html | 44 + .../manage/user_account_pagination.html | 8 + .../cbv2/layout/blocks/pm/messages.html | 84 ++ upload/styles/cbv2/layout/blocks/user.html | 19 + upload/styles/cbv2/layout/blocks/video.html | 8 +- upload/styles/cbv2/layout/body.html | 10 +- upload/styles/cbv2/layout/channels.html | 12 + upload/styles/cbv2/layout/edit_account.html | 254 ++++ upload/styles/cbv2/layout/edit_video.html | 131 ++ upload/styles/cbv2/layout/global_header.html | 12 + upload/styles/cbv2/layout/header.html | 2 +- upload/styles/cbv2/layout/manage_videos.html | 121 ++ upload/styles/cbv2/layout/message.html | 5 +- upload/styles/cbv2/layout/myaccount.html | 23 + .../styles/cbv2/layout/private_message.html | 51 + upload/styles/cbv2/layout/upload.html | 251 ++-- upload/styles/cbv2/layout/user_videos.html | 29 + upload/styles/cbv2/layout/view_channel.html | 225 +++ upload/styles/cbv2/layout/watch_video.html | 2 +- upload/styles/cbv2/theme/blocks.css | 59 + upload/styles/cbv2/theme/body.css | 34 +- upload/styles/cbv2/theme/buttons.css | 10 + upload/styles/cbv2/theme/main.css | 2 + upload/styles/cbv2/theme/view_channel.css | 58 + .../clipbucketblue/layout/user_account.html | 2 +- upload/tabs01.php | 49 - upload/tabs02.php | 87 -- upload/tabs03.php | 76 - upload/upload.php | 3 +- upload/user_account.php | 58 - upload/user_videos.php | 93 +- upload/videos.php | 2 +- upload/view_channel.php | 153 +- upload/watch_video.php | 10 +- 88 files changed, 4254 insertions(+), 1552 deletions(-) delete mode 100644 upload/ActualUpload.php delete mode 100644 upload/actual_upload.php create mode 100644 upload/admin_area/styles/cbadmin/layout/blocks/access_log.html create mode 100644 upload/admin_area/styles/cbadmin/layout/members.html create mode 100644 upload/admin_area/styles/cbadmin/layout/view_user.html create mode 100644 upload/admin_area/view_user.php delete mode 100644 upload/convert_process.php create mode 100644 upload/edit_account.php create mode 100644 upload/includes/whois/whois.php create mode 100644 upload/js/jquery_plugs/compressed/jquery.scrollTo-min.js create mode 100644 upload/private_message.php create mode 100644 upload/styles/cbv2/images/blocks.png create mode 100644 upload/styles/cbv2/images/buttons.png create mode 100644 upload/styles/cbv2/layout/blocks/manage/account_head.html create mode 100644 upload/styles/cbv2/layout/blocks/manage/account_left.html create mode 100644 upload/styles/cbv2/layout/blocks/manage/account_video.html create mode 100644 upload/styles/cbv2/layout/blocks/manage/user_account_pagination.html create mode 100644 upload/styles/cbv2/layout/blocks/pm/messages.html create mode 100644 upload/styles/cbv2/layout/blocks/user.html create mode 100644 upload/styles/cbv2/layout/channels.html create mode 100644 upload/styles/cbv2/layout/edit_account.html create mode 100644 upload/styles/cbv2/layout/edit_video.html create mode 100644 upload/styles/cbv2/layout/manage_videos.html create mode 100644 upload/styles/cbv2/layout/myaccount.html create mode 100644 upload/styles/cbv2/layout/private_message.html create mode 100644 upload/styles/cbv2/layout/user_videos.html create mode 100644 upload/styles/cbv2/layout/view_channel.html create mode 100644 upload/styles/cbv2/theme/buttons.css create mode 100644 upload/styles/cbv2/theme/view_channel.css delete mode 100644 upload/tabs01.php delete mode 100644 upload/tabs02.php delete mode 100644 upload/tabs03.php delete mode 100644 upload/user_account.php diff --git a/upload/ActualUpload.php b/upload/ActualUpload.php deleted file mode 100644 index 1f1b5dee..00000000 --- a/upload/ActualUpload.php +++ /dev/null @@ -1,32 +0,0 @@ -ConvertFile($newfilename,$filename); -} - -?> \ No newline at end of file diff --git a/upload/actions/update_configs.php b/upload/actions/update_configs.php index c458657c..9671ea31 100644 --- a/upload/actions/update_configs.php +++ b/upload/actions/update_configs.php @@ -7,10 +7,11 @@ require'../includes/admin_config.php'; $userquery->login_check('admin_access'); -if(isset($_POST['update_player_size'])) +if($_POST['update_player_size']=='yes') { $height = mysql_clean($_POST['height']); $width = mysql_clean($_POST['width']); + $config_name = mysql_clean($_POST['width']); if(!is_numeric($height) || $height <=100) $height = 100; if(!is_numeric($width) || $width <=100) @@ -19,4 +20,17 @@ if(isset($_POST['update_player_size'])) $myquery->Set_Website_Details('player_width',$width); echo "Player size has been updated"; } +if($_POST['update_channel_player_size']=='yes') +{ + $height = mysql_clean($_POST['height']); + $width = mysql_clean($_POST['width']); + $config_name = mysql_clean($_POST['width']); + if(!is_numeric($height) || $height <=100) + $height = 100; + if(!is_numeric($width) || $width <=100) + $width = 100; + $myquery->Set_Website_Details('channel_player_height',$height); + $myquery->Set_Website_Details('channel_player_width',$width); + echo "Channel Player size has been updated"; +} ?> \ No newline at end of file diff --git a/upload/actual_upload.php b/upload/actual_upload.php deleted file mode 100644 index 5d845aa1..00000000 --- a/upload/actual_upload.php +++ /dev/null @@ -1,42 +0,0 @@ -UploadProcess(); - - $filename = $_POST['flvname']; - $new_name = substr($filename, 0, strrpos($filename, '.')); - $ext = substr($_FILES['filename']['name'], strrpos($_FILES['filename']['name'],'.') + 1); - $newfilename = $new_name.".".$ext; - - $path = BASEDIR."/files/temp/".$newfilename; - copy($_FILES['filename']['tmp_name'], $path); - setcookie('flv_upload',$filename); - $php_path = PHP_PATH; - $ffmpeg->ConvertFile($newfilename,$filename); - redirect_to(BASEURL.'/videouploadsuccess.php?show=success'); -} elseif(isset($_POST['snatch_file'])) { - - $Upload->UploadProcess(); - $file = $_POST['file']; - $flvname = $_POST['flvname']; - $php_path = PHP_PATH; - exec("$php_path cUrldownload.php $file $flvname >> ".BASEDIR."/logs/logs.txt &"); - redirect_to(BASEURL.'/videouploadsuccess.php?show=success'); - -} -?> diff --git a/upload/admin_area/edit_member.php b/upload/admin_area/edit_member.php index 9bd18805..3b9ff5f8 100644 --- a/upload/admin_area/edit_member.php +++ b/upload/admin_area/edit_member.php @@ -8,40 +8,6 @@ */ require'../includes/admin_config.php'; -$userquery->admin_login_check(); -$pages->page_redir(); - -$page = $pages->show_admin_page(clean(@$_GET['settings'])); -if(!empty($page)){ -$pages->redirect($page); -} -if(@$_GET['msg']){ -$msg = clean(@$_GET['msg']); -} -$user = mysql_clean(@$_GET['userid']); - - - //Check User Exists or Not - if($userquery->Check_User_Exists($user)){ - //Update User - if(isset($_POST['button'])){ - $msg = $signup->Admin_Edit_User(); - } - //Get User Details - $data = $userquery->GetUserData($user); - CBTemplate::assign('data',$data); - - }else{ - $msg[] = "User Doesn't Exist"; - } - -//Assing Template -CBTemplate::assign('country',$signup->country()); -CBTemplate::assign('msg',@$msg); -CBTemplate::display(LAYOUT.'/header.html'); -CBTemplate::display(LAYOUT.'/leftmenu.html'); -CBTemplate::display(LAYOUT.'/message.html'); -CBTemplate::display(LAYOUT.'/edit_member.html'); -CBTemplate::display(LAYOUT.'/footer.html'); +header('location:view_user.php?uid='.$_GET['uid']); ?> \ No newline at end of file diff --git a/upload/admin_area/members.php b/upload/admin_area/members.php index 534d5119..40e56b86 100644 --- a/upload/admin_area/members.php +++ b/upload/admin_area/members.php @@ -1,40 +1,16 @@ admin_login_check(); +$userquery->login_check('member_moderation'); $pages->page_redir(); -$page = $pages->show_admin_page(clean(@$_GET['settings'])); -if(!empty($page)){ -$pages->redirect($page); -} -if(@$_GET['msg']){ -$msg = clean(@$_GET['msg']); -} -//Show Requested Options -$property_values = array( 'showall' => 'Show All', - 'inactive' => 'Inactive Only', - 'active' => 'Active Only', - 'addmember' => 'Add Member', - 'search' => 'Search Members' - ); - -$view = clean(@$_GET['view']); - -if(empty($view)){ $view = 'showall'; } -while(list($property['value'],$property['name']) = each($property_values)){ - if($property['value'] == $view){ - CBTemplate::assign("property",$property); - } -} - //-------TIME TO DO SOME ACTION-------// //Delete User @@ -154,151 +130,20 @@ if(isset($_GET['unban'])){ //-------TIME END TO DO SOME ACTION-------// -//Form Processing And Validation - //User Registration Form Processing and Validation - if(isset($_POST['button'])){ - $msg = $signup->Admin_Add_User(); - } - -//Assigning Default Values in Form -@$values= array( - 'default_uname' => mysql_clean($_POST['username']), - 'default_email' => mysql_clean($_POST['email']), - 'default_pass' => pass_code(mysql_clean($_POST['password'])), - 'default_fname' => mysql_clean($_POST['fname']), - 'default_lname' => mysql_clean($_POST['lname']), - 'default_gender' => mysql_clean($_POST['gender']), - 'default_level' => mysql_clean($_POST['level']), - 'default_m' => $_POST['month'], - 'default_d' => $_POST['day'], - 'default_y' => $_POST['year'], - 'default_ht' => mysql_clean($_POST['hometown']), - 'default_city' => mysql_clean($_POST['city']), - 'default_country' => $_POST['country'], - 'default_zip' => mysql_clean($_POST['zip']) - ); - while(list($name,$value) = each($values)){ - CBTemplate::assign($name,$value); - } +//Getting Member List +$page = mysql_clean($_GET['page']); +$get_limit = create_query_limit($page,RESULTS); +$users = $db->select("users",'*',$cond,$get_limit,"doj DESC"); +Assign('users', $users); + +//Collecting Data for Pagination +$total_rows = $db->count('users','*',$cond); +$total_pages = count_pages($total_rows,VLISTPP); + +//Pagination +$pages->paginate($total_pages,$page); - @$values_search= array( - 'search_uname' => mysql_clean($_GET['username']), - 'search_email' => mysql_clean($_GET['email']), - 'search_fname' => mysql_clean($_GET['fname']), - 'search_lname' => mysql_clean($_GET['lname']), - 'search_country' => mysql_clean($_GET['country']), - 'search_status' => mysql_clean($_GET['status']), - 'search_sort' => mysql_clean($_GET['sort']), - 'search_order' => mysql_clean($_GET['order']) - ); - while(list($name,$value) = each($values_search)){ - CBTemplate::assign($name,$value); - } - -//Jump To The page -if(isset($_POST['display_page'])){ - redirect_to($_POST['page_number']); -} - -//Users Array - $limit = RESULTS; - Assign('limit',$limit); - $page = clean(@$_GET['page']); - if(empty($page) || $page == 0){ - $page = 1; - } - $from = $page-1; - $from = $from*$limit; - - $query_limit = "limit $from,$limit"; - $order = "ORDER BY doj DESC"; - - $sql = "SELECT * from users $order $query_limit"; - $sql_p = "SELECT * from users"; - if(empty($view) || $view == 'showall'){ - $sql = "SELECT * from users $order $query_limit"; - } - if($view == 'inactive'){ - $sql = "SELECT * from users WHERE usr_status='ToActivate' $order $query_limit"; - $sql_p = "SELECT * from users WHERE usr_status='ToActivate'"; - } - if($view == 'active'){ - $sql = "SELECT * from users WHERE usr_status='OK' $order $query_limit"; - $sql_p = "SELECT * from users WHERE usr_status='OK'"; - } - -//Search -if(isset($_GET['search'])){ - $username = mysql_clean($_GET['username']); - $email = mysql_clean($_GET['email']); - $fname = mysql_clean($_GET['fname']); - $lname = mysql_clean($_GET['lname']); - $country = mysql_clean($_GET['country']); - $status = mysql_clean($_GET['status']); - $sort = mysql_clean($_GET['sort']); - $order = mysql_clean($_GET['order']); - - if($order == 'ASC'){ - if($sort == 'username'){$orderby = 'ORDER BY username ASC';} - if($sort == 'doj'){ $orderby = 'ORDER BY doj ASC';} - if($sort == 'country'){ $orderby = 'ORDER BY country ASC';} - if($sort == 'lname'){ $orderby = 'ORDER BY last_name ASC';} - if($sort == 'fname'){ $orderby = 'ORDER BY first_name ASC';} - }else{ - if($sort == 'username'){$orderby = 'ORDER BY username DESC';} - if($sort == 'doj'){ $orderby = 'ORDER BY doj DESC';} - if($sort == 'country'){ $orderby = 'ORDER BY country DESC';} - if($sort == 'lname'){ $orderby = 'ORDER BY last_name DESC';} - if($sort == 'fname'){ $orderby = 'ORDER BY first_name DESC'; -} - } - - - $sql = "SELECT * from users "; - $sql .= "WHERE username like '%$username%' AND - email like '%$email%' AND - first_name like '%$fname%' AND - last_name like '%$lname%' AND - country like '%$country%' AND - usr_status like '%$status%' - $orderby $query_limit - "; - $sql_p = "SELECT * from users WHERE username like '%$username%' AND - email like '%$email%' AND - first_name like '%$fname%' AND - last_name like '%$lname%' AND - country like '%$country%' AND - usr_status like '%$status%' - $orderby "; - } - -//Assing User Data Values - - $rs = $db->Execute($sql); - $total = $rs->recordcount() + 0; - $users = $rs->getrows(); - - for($id=0;$id<$total;$id++){ - $users[$id]['age'] = $calcdate->age($users[$id]['dob']); - $users[$id]['total_videos'] = $userquery->TotalVideos($users[$id]['username']); - $users[$id]['total_friends'] = $userquery->TotalFriends($users[$id]['username']); - $users[$id]['total_groups'] = $userquery->TotalGroups($users[$id]['username']); - } - Assign('total', $total + 0); - Assign('user', $users); - -//Pagination #A Tough Job# -if($view == 'search'){ -@$link = '&username=' .mysql_clean($_GET['username']). '&email=' .mysql_clean($_GET['email']).'&fname=' .mysql_clean($_GET['fname']).'&lname=' .mysql_clean($_GET['lname']).'&country='.mysql_clean($_GET['country']).'&status='.mysql_clean($_GET['status']).'&sort='.mysql_clean($_GET['sort']).'&order='.mysql_clean($_GET['order']).'&search='.mysql_clean($_GET['search']); -Assign('link',$link); -} - -Assign('msg',@$msg); -Template('header.html'); -Template('leftmenu.html'); -Template('message.html'); -Template('members.html'); -Template('footer.html'); - +template_files('members.html'); +display_it(); ?> diff --git a/upload/admin_area/styles/cbadmin/layout/blocks/access_log.html b/upload/admin_area/styles/cbadmin/layout/blocks/access_log.html new file mode 100644 index 00000000..417d63b6 --- /dev/null +++ b/upload/admin_area/styles/cbadmin/layout/blocks/access_log.html @@ -0,0 +1,10 @@ + + + + +Untitled Document + + + + + diff --git a/upload/admin_area/styles/cbadmin/layout/body.html b/upload/admin_area/styles/cbadmin/layout/body.html index 9a8e0105..cfb68289 100644 --- a/upload/admin_area/styles/cbadmin/layout/body.html +++ b/upload/admin_area/styles/cbadmin/layout/body.html @@ -13,9 +13,12 @@ - + + + - diff --git a/upload/admin_area/styles/cbadmin/layout/left_menu.html b/upload/admin_area/styles/cbadmin/layout/left_menu.html index 900a2a9d..5d635e8c 100644 --- a/upload/admin_area/styles/cbadmin/layout/left_menu.html +++ b/upload/admin_area/styles/cbadmin/layout/left_menu.html @@ -1,4 +1,5 @@ -
+
+ {assign var='menu' value = $Cbucket->AdminMenu} {foreach from=$menu key=name item=menu} diff --git a/upload/admin_area/styles/cbadmin/layout/manage_players.html b/upload/admin_area/styles/cbadmin/layout/manage_players.html index 418bae9e..841ee7d5 100644 --- a/upload/admin_area/styles/cbadmin/layout/manage_players.html +++ b/upload/admin_area/styles/cbadmin/layout/manage_players.html @@ -29,14 +29,15 @@ Website : {$curplayer.website} {/literal} @@ -74,6 +91,19 @@ Website : {$curplayer.website}
+ +Channel Player +
+ +
+

Actual Player Size

+
+ + + + +
+

diff --git a/upload/admin_area/styles/cbadmin/layout/members.html b/upload/admin_area/styles/cbadmin/layout/members.html new file mode 100644 index 00000000..bbb96840 --- /dev/null +++ b/upload/admin_area/styles/cbadmin/layout/members.html @@ -0,0 +1,70 @@ +Member Manager + + + +
{include file="$style_dir/left_menu.html" } + Toggle Menu
{include file="$style_dir/left_menu.html" } + {foreach from=$template_files item=file} {include file="$style_dir/$file" } {/foreach}
+ + + + + + +
+ UID
User Details
 
+ + + + + +{foreach from=$users item=u} + + + + + + +{if $bgcolor == ""} +{assign var = bgcolor value = "#EEEEEE"} +{else} +{assign var = bgcolor value = ""} +{/if} +{/foreach} + + +
{$u.userid} +
+ + {$u.username} + — + Email:{$u.email} • + Status:{$u.usr_status} • + Level:{$u.level|get_user_level} • + Last Active:{$u.last_active} + + +
style="display:none" +
+ + View or + Edit | + {if $u.usr_status == Ok} + Deactivate + {elseif $u.usr_status == ToActivate} + Activate + {/if} | + {if $u.ban_status == yes} + Unban Member + {/if} + {if $u.ban_status == no} + Ban Member + {/if}| + Add To Editor's Pick | + File conversion details | + Delete +
+
 
+ + +{include file="$style_dir/blocks/pagination.html" } diff --git a/upload/admin_area/styles/cbadmin/layout/msg.html b/upload/admin_area/styles/cbadmin/layout/msg.html index a70ea544..407b83e0 100644 --- a/upload/admin_area/styles/cbadmin/layout/msg.html +++ b/upload/admin_area/styles/cbadmin/layout/msg.html @@ -2,7 +2,7 @@ {assign var=msg value=$eh->message_list} {assign var=err value=$eh->error_list} -{if $err.0 neq ''} +{if $err.0 neq '' || $err.1 neq ''}
diff --git a/upload/admin_area/styles/cbadmin/layout/video_manager.html b/upload/admin_area/styles/cbadmin/layout/video_manager.html index 8892b0fc..b02834bc 100644 --- a/upload/admin_area/styles/cbadmin/layout/video_manager.html +++ b/upload/admin_area/styles/cbadmin/layout/video_manager.html @@ -30,7 +30,7 @@
- +
@@ -45,7 +45,7 @@
- +
@@ -59,7 +59,7 @@ -
+
{assign var = bgcolor value = ""} {section name=list loop=$videos} @@ -106,7 +106,7 @@
- +
diff --git a/upload/tabs01.php b/upload/tabs01.php deleted file mode 100644 index 87ca8e27..00000000 --- a/upload/tabs01.php +++ /dev/null @@ -1,49 +0,0 @@ -Execute($query); -$random = $rs->getrows(); -$total_random = $rs->recordcount() + 0; - for($id=0;$id<$total_random;$id++){ - $flv = $random[$id]['flv']; - $thumb = GetThumb($flv); - $random[$id]['thumb'] = $thumb; - $random[$id]['url'] = VideoLink($random[$id]['videokey'],$random[$id]['title']); - } -Assign('random',$random); - -//Getting Newest Added - -$query = "SELECT * FROM video WHERE $query_param ORDER BY date_added DESC $limit "; - -$rs = $db->Execute($query); -$latest = $rs->getrows(); -$total_latest = $rs->recordcount() + 0; - for($id=0;$id<$total_latest;$id++){ - $flv = $latest[$id]['flv']; - $thumb = GetThumb($flv); - $latest[$id]['thumb'] = $thumb; - $latest[$id]['url'] = VideoLink($latest[$id]['videokey'],$latest[$id]['title']); - } -Assign('latest',$latest); - -Assign('show',$_GET['show']); - -Template('tabs01.html'); - -?> \ No newline at end of file diff --git a/upload/tabs02.php b/upload/tabs02.php deleted file mode 100644 index 831f9710..00000000 --- a/upload/tabs02.php +++ /dev/null @@ -1,87 +0,0 @@ -GetUserData_username($user); -$query_param = "broadcast='public' AND active='yes' AND status='Successful'"; -if($show=='contacts'){ - //Listing Contacts - $limit = CLISTPT; - Assign('limit',$limit); - @$page = clean($_GET['page']); - if(empty($page) || $page == 0 || !is_numeric($page)){ - $page = 1; - } - $from = $page-1; - $from = $from*$limit; - $query_limit = "limit $from,$limit"; - $orderby = " ORDER BY date_added DESC"; - - $sql = "SELECT * FROM contacts WHERE username='".$user."' $orderby $query_limit"; - - $contacts_data = $db->Execute($sql); - $total_contacts = $contacts_data->recordcount() + 0; - $contacts = $contacts_data->getrows(); - - for($id=0;$id<$total_contacts;$id++){ - $contact_details = $userquery->GetUserData_username($contacts[$id]['friend_username']); - $contacts[$id]['avatar'] = $contact_details['avatar']; - $contacts[$id]['views'] = $contact_details['profile_hits']; - $contacts[$id]['videos'] = $contact_details['total_videos']; - $contacts[$id]['comments'] = $contact_details['total_comments']; - $contacts[$id]['doj'] = $contact_details['doj']; - } - - Assign('total_contacts',$total_contacts); - Assign('contacts',$contacts); - -} - -if($show=='fav_videos'){ - //Listing Contacts - $limit = VLISTPT; - Assign('limit',$limit); - @$page = clean($_GET['page']); - if(empty($page) || $page == 0 || !is_numeric($page)){ - $page = 1; - } - $from = $page-1; - $from = $from*$limit; - $query_limit = "limit $from,$limit"; - $orderby = " ORDER BY date_added DESC"; - - $sql = "SELECT * FROM video_favourites WHERE userid='".$userdetails['userid']."' $orderby $query_limit"; - - $video_Data = $db->Execute($sql); - $total_videos = $video_Data->recordcount() + 0; - $videos = $video_Data->getrows(); - - for($id=0;$id<$total_videos;$id++){ - $videos_details = $myquery->GetVideoDetails($videos[$id]['videoid']); - $flv = $videos_details['flv']; - $videos[$id]['thumb'] = GetThumb($flv); - $videos[$id]['show_rating'] = pullRating($videos_details['videoid'],false,false,false,@novote); - $videos[$id]['title'] = $videos_details['title']; - $videos[$id]['description'] = $videos_details['description']; - $videos[$id]['videokey'] = $videos_details['videokey']; - $videos[$id]['views'] = $videos_details['views']; - $videos[$id]['duration'] = SetTime($videos_details['duration']); - $videos[$id]['url'] = VideoLink($videos[$id]['videokey'],$videos[$id]['title']); - } - - Assign('total_videos',$total_videos); - Assign('videos',$videos); - -} -Template('tabs02.html'); -?> \ No newline at end of file diff --git a/upload/tabs03.php b/upload/tabs03.php deleted file mode 100644 index dc040868..00000000 --- a/upload/tabs03.php +++ /dev/null @@ -1,76 +0,0 @@ - 0 AND $query_param ORDER BY comments_count DESC LIMIT 0,8"; -} -//Getting Highest Rated -if($show == 'highest_rated'){ -$query = "SELECT * FROM video WHERE rating > 0 AND $query_param ORDER BY rating DESC LIMIT 0,8"; -} - -//Getting Whats Hot -$list = array( - 'featured' => $LANG['featured'], - 'latest' => $LANG['recently_added'], - 'most_viewed' => $LANG['most_viewed'], - 'most_discussed' => $LANG['most_discussed'], - 'highest_rated' => $LANG['highest_rated'], - 'link01' => BASEURL.videos_link.'?order=fr', - 'link02' => BASEURL.videos_link.'?order=mr', - 'link03' => BASEURL.videos_link.'?order=mv', - 'link04' => BASEURL.videos_link.'?order=md', - 'link05' => BASEURL.videos_link.'?order=hr', - ); -$text = $list[$show]; -Assign('text',$text); - -@$link = $_GET['link']; -@$link = $list[$link]; -Assign('link',$link); - -$data = $db->Execute($query); -if($data) -{ -$videos = $data->getrows(); -$total = $data->recordcount() + 0; - - for($id=0;$id<$total;$id++){ - $videos[$id]['thumb'] = GetThumb($videos[$id]['flv']); - $videos[$id]['description'] = nl2br($videos[$id]['description']); - $videos[$id]['duration'] = SetTime($videos[$id]['duration']); - $videos[$id]['comments'] = $myquery->GetTotalVideoComments($videos[$id]['videoid']); - $videos[$id]['show_rating'] = pullRating($videos[$id]['videoid'],false,false,false,@novote); - $videos[$id]['url'] = VideoLink($videos[$id]['videokey'],$videos[$id]['title']); - } - -Assign('videos',$videos); -} - -Assign('show',$_GET['show']); -Template('tabs03.html'); - -?> \ No newline at end of file diff --git a/upload/upload.php b/upload/upload.php index ae24c910..18919c2e 100644 --- a/upload/upload.php +++ b/upload/upload.php @@ -10,7 +10,8 @@ define("PAGE","upload_video"); require 'includes/config.inc.php'; -$userquery->login_check('upload_access'); +$userquery->logincheck(); +$userquery->login_check('allow_video_upload'); $pages->page_redir(); subtitle('upload'); diff --git a/upload/user_account.php b/upload/user_account.php deleted file mode 100644 index 8a67c131..00000000 --- a/upload/user_account.php +++ /dev/null @@ -1,58 +0,0 @@ -logincheck(); -$pages->page_redir(); - -if(@$_GET['updated']){ -$msg = $LANG['usr_pof_upd_msg']; -} -//Updating User Record - if(isset($_POST['update'])){ - $userquery->UpdateUserProfile($_COOKIE['userid']); - } - -//Update User Email Settings - if(isset($_POST['update_email'])){ - $msg = $userquery->UpdateUserEmailSettings($_COOKIE['userid']); - } - -//Update User Email Settings - if(isset($_POST['change_password'])){ - $msg = $userquery->ChangeUserPassword($_COOKIE['userid']); - } - -//Get User Details - $user = $_COOKIE['userid']; - $data = $userquery->GetUserData($user); - list($data['y'],$data['m'],$data['d']) = explode('-',$data['dob']); - - Assign('data',$data); - -//Getting User Videos - $sql = "SELECT * from video WHERE username = '".$data['username']."'"; - $rs = $db->Execute($sql); - $videos = $rs->getrows(); - Assign('videos',$videos); - -//GET setting options -@$show = $_GET['settings']; -Assign('show',$show); - -@Assign('msg',$msg); -subtitle('my_account'); -if(empty($_GET['show'])){ -Template('header.html'); -Template('message.html'); -} -Template('user_account.html'); -if(empty($_GET['show'])){ -Template('footer.html'); -} -?> \ No newline at end of file diff --git a/upload/user_videos.php b/upload/user_videos.php index 140cd946..59896d89 100644 --- a/upload/user_videos.php +++ b/upload/user_videos.php @@ -1,71 +1,56 @@ page_redir(); -$user = mysql_clean($_GET['user']); -Assign('user',$user); -$query_param = "broadcast='public' AND active='yes' AND status='Successful'"; -//Listing Videos +$userquery->perm_check('view_videos',true); - $limit = VLISTPP; - Assign('limit',$limit); - $page = clean(@$_GET['page']); - if(empty($page) || $page == 0 || !is_numeric($page)){ - $page = 1; +$u = $_GET['user']; +$u = $u ? $u : $_GET['userid']; +$u = $u ? $u : $_GET['username']; +$u = $u ? $u : $_GET['uid']; +$u = $u ? $u : $_GET['u']; + +$udetails = $userquery->get_user_details($u); +$page = mysql_clean($_GET['page']); +$get_limit = create_query_limit($page,VLISTPP); + +if($udetails) +{ + assign("u",$udetails); + $mode = $_GET['mode']; + + switch($mode) + { + case 'uploads': + default: + { + $videos = get_videos(array('user'=>$udetails['userid'],'limit'=>$get_limit)); + $total_rows = get_videos(array('user'=>$udetails['userid'],'count_only'=>true)); + } } - $from = $page-1; - $from = $from*$limit; - $query_limit = "limit $from,$limit"; - $orderby = " ORDER BY date_added DESC"; - - $sql = "SELECT * FROM video WHERE username='".$user."' AND $query_param $orderby $query_limit"; - $sql_p = "SELECT * FROM video WHERE username='".$user."' AND $query_param "; - $vdo_data = $db->Execute($sql); - $total_vdo = $vdo_data->recordcount() + 0; - $videos = $vdo_data->getrows(); - - for($id=0;$id<$total_vdo;$id++){ - $videos[$id]['thumb'] = GetThumb($videos[$id]['flv']); - $videos[$id]['duration'] = SetTime($videos[$id]['duration']); - $videos[$id]['show_rating'] = pullRating($videos[$id]['videoid'],false,false,false); - $videos[$id]['url'] = VideoLink($videos[$id]['videokey'],$videos[$id]['title']); - } - Assign('videos',$videos); - //Pagination - $link = '?user='.$user; - Assign('link',$link); - $query= mysql_query($sql_p); - Assign('grand_total',mysql_num_rows($query)); - $total_rows = mysql_num_rows($query); - $page_id=1; - $id = 1; - //$all_pages[0]['page'] = $page_id; - $records = $total_rows/$limit; - $pages = round($records+0.49,0); - -$show_pages = ShowPagination($pages,$page,$link); -Assign('show_pages',$show_pages); - -Assign('pages',$pages); -Assign('cur_page',$page); -Assign('nextpage',$page+1); -Assign('prepage',$page-1); -Assign('total_pages',$page_id); +Assign('videos', $videos); +//Collecting Data for Pagination +$total_pages = count_pages($total_rows,VLISTPP); -Assign('subtitle',$user."'s Videos"); +//Pagination +$pages->paginate($total_pages,$page); -Assign('msg',@$msg); -Template('header.html'); -Template('message.html'); -Template('user_videos.html'); -Template('footer.html'); +}else{ + e(lang("usr_exist_err")); + $Cbucket->show_page = false; +} + + +template_files('user_videos.html'); +display_it(); ?> \ No newline at end of file diff --git a/upload/videos.php b/upload/videos.php index 9aeab1f5..e2ca5c4f 100644 --- a/upload/videos.php +++ b/upload/videos.php @@ -9,7 +9,7 @@ define("THIS_PAGE",'videos'); require 'includes/config.inc.php'; $pages->page_redir(); - +$userquery->perm_check('view_videos',true); //Getting Video List $page = mysql_clean($_GET['page']); diff --git a/upload/view_channel.php b/upload/view_channel.php index 0280d321..8b5cf8fa 100644 --- a/upload/view_channel.php +++ b/upload/view_channel.php @@ -1,142 +1,47 @@ page_redir(); -$query_param = "broadcast='public' AND active='yes' AND status='Successful'"; +$userquery->perm_check('view_channel',true); -//Get User Details - if($_GET['user'] != 'Array'){ - $user = mysql_clean($_GET['user']); - } - $data = $userquery->GetUserData_username($user); - $data['total_videos'] = $userquery->TotalVideos($user); - //$userquery->UpdateSubscribers($user); - $data['age'] = $calcdate->age($data['dob']); - $show_education = array( - '0'=>$LANG['usr_arr_no_ans'], - '1'=>$LANG['usr_arr_elementary'], - '2'=>$LANG['usr_arr_hi_school'], - '3'=>$LANG['usr_arr_some_colg'], - '4'=>$LANG['usr_arr_assoc_deg'], - '5'=>$LANG['usr_arr_bach_deg'], - '6'=>$LANG['usr_arr_mast_deg'], - '7'=>$LANG['usr_arr_phd'], - '8'=>$LANG['usr_arr_post_doc'] - ); - - $show_relation = array( - '0'=>$LANG['usr_arr_no_ans'], - '1'=>$LANG['usr_arr_single'], - '2'=>$LANG['usr_arr_married'], - '3'=>$LANG['usr_arr_comitted'], - '4'=>$LANG['usr_arr_open_marriage'], - '5'=>$LANG['usr_arr_open_relate'] - ); - - @$data['show_relation']=$show_relation[$data['relation_status']]; - @$data['show_education']=$show_education[$data['education']]; - $pattern = array('/http:\/\//','/www\./'); - $replace = array('',''); - if(!empty($data['web_url'])) - $data['web_url'] = 'http://'.preg_replace($pattern,$replace,$data['web_url']); - Assign('data',$data); - -//Adding Comment - if(isset($_POST['add_comment'])){ - $comment = mysql_clean($_POST['comment']); - $msg = $userquery->AddChannelComment($data['username'],$comment); - } - -//Getting Channel Featured Video - $data['featured_video']; - $vkey = $data['featured_video']; - if(!empty($vkey)){ - $f_video = $myquery->GetVideDetails($vkey); - $f_video['url'] = VideoLink($f_video['videokey'],$f_video['title']); - $myquery->UpdateVideoViews($vkey); - Assign('f_video',$f_video); - } +$u = $_GET['user']; +$u = $u ? $u : $_GET['userid']; +$u = $u ? $u : $_GET['username']; +$u = $u ? $u : $_GET['uid']; +$u = $u ? $u : $_GET['u']; -Assign('subtitle',$data['username'].$LANG['title_view_channel']); - -//Update Number Of Channel Views - - if(!empty($data['userid'])){ - $userquery->UpdateChannelViews($user); +$udetails = $userquery->get_user_details($u); +if($udetails) +{ + //Subscribing User + if($_GET['subscribe']) + { + $userquery->subscribe_user($udetails['userid']); } -if(empty($data['userid'])){ - $msg = $LANG['usr_exist_err2']; + //Adding Comment + if(isset($_POST['add_comment'])) + { + $userquery->add_comment($_POST['comment'],$udetails['userid']); } + assign("u",$udetails); + assign('p',$userquery->get_user_profile($udetails['userid'])); -//Getting Video List Of Videos - $limit = VLISTPT; - $sql = "SELECT * FROM video WHERE username='".$user."' AND $query_param ORDER BY views DESC LIMIT $limit"; - $vdo_data = $db->Execute($sql); - $total_vdo = $vdo_data->recordcount() + 0; - $videos = $vdo_data->getrows(); - - for($id=0;$id<$total_vdo;$id++){ - $videos[$id]['thumb'] = GetThumb($videos[$id]['flv']); - $videos[$id]['duration'] = SetTime($videos[$id]['duration']); - $videos[$id]['show_rating'] = pullRating($videos[$id]['videoid'],false,false,false,'novote'); - $videos[$id]['url'] = VideoLink($videos[$id]['videokey'],$videos[$id]['title']); - } - - - Assign('videos',$videos); - -//Subscribing User -if(isset($_POST['subscribe'])){ - $userquery->logincheck(); - $sub_user = $_COOKIE['username']; - $sub_to = $user; - $msg = $userquery->SubscribeUser($sub_user,$sub_to); - } - -//Getting Comments -@$limit = $_GET['comments']; -if(empty($limit) || $limit != 'all'){ - $limit = " LIMIT 0,10"; }else{ - $limit = " "; + e(lang("usr_exist_err")); + $Cbucket->show_page = false; } - $sql = "Select * FROM channel_comments WHERE channel_user='".$user."' ORDER BY date_added DESC $limit"; - $rs = $db->Execute($sql); - $total_comments = $rs->recordcount() + 0; - $comments = $rs->getrows(); - for($id=0;$id<$total_comments;$id++){ - $user_data = $userquery->GetUserData_username($comments[$id]['username']); - $thumb = $user_data['avatar']; - $smallthumb = substr($thumb, 0, strrpos($thumb, '.')).'-small.'; - $smallthumb .= substr($thumb, strrpos($thumb,'.') + 1); - $smallthumb; - $comments[$id]['small_thumb'] = $smallthumb; - } - -Assign('total_comments',$total_comments); -Assign('comments',$comments); - -//Add Contact to FriendsList -if(isset($_POST['friend_username'])){ - $userquery->logincheck(); - $friend = $_POST['friend_username']; - $msg = $userquery->AddContact($friend,$_COOKIE['username']); -} - -@Assign('msg',$msg); -Template('header.html'); -Template('message.html'); +if($Cbucket->show_page) Template('view_channel.html'); -Template('footer.html'); - +else +display_it(); ?> \ No newline at end of file diff --git a/upload/watch_video.php b/upload/watch_video.php index 63f68537..0d4786f9 100644 --- a/upload/watch_video.php +++ b/upload/watch_video.php @@ -28,14 +28,20 @@ if(video_playable($vkey)) $cbvid->action->share_content($vdo['videoid']); } - //Calling Functions When Video Is Called + //Calling Functions When Video Is going to play call_watch_video_function($vdo); - //Addming Comment + //adding Comment if(isset($_POST['add_comment'])) { $cbvideo->add_comment($_POST['comment'],$vdo['videoid']); } + + //Adding Video To Favorites + if(isset($_REQUEST['favorite'])) + { + $cbvideo->action->add_to_fav($vdo['videoid']); + } } //Displaying The Template
diff --git a/upload/admin_area/styles/cbadmin/layout/view_user.html b/upload/admin_area/styles/cbadmin/layout/view_user.html new file mode 100644 index 00000000..b3eb8a1c --- /dev/null +++ b/upload/admin_area/styles/cbadmin/layout/view_user.html @@ -0,0 +1,313 @@ +Edit User +{assign var="user_fields" value=$userquery->load_profile_fields($p)} +{assign var="user_custom_profile_fields" value=$userquery->load_custom_profile_fields($p)} +{assign var="user_custom_signup_fields" value=$userquery->load_custom_signup_fields($p)} + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
 User Info 
+ + + + + +
 User Stats 
+ +
+ ClipBucket User Info + + + + + + + + + + + + + + + + + + + + + + + + + + +
User Id + + +
User name + + + +
Email
User Level +
Country +
Gender + + + + +

+
+ + +
+ Profile Details + + {foreach from=$user_fields item=field} + + + + + {/foreach} + +
{$field.title}{$field.hint_1}{ANCHOR place=$field.anchor_before}{$formObj->createField($field)} +
+ {$field.hint_2}
+
+ + + + + + + + +
+ User Custom Signup Fields + {if $user_custom_signup_fields} + + + {foreach from=$user_custom_signup_fields item=field} + + + +
+ {$field.hint_2} + + {/foreach} + +
{$field.title}{$field.hint_1}{ANCHOR place=$field.anchor_before}{$formObj->createField($field)}
+ {else}
No custom field found
{/if} +
+ + + + + +
+ User Activity + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Date of birth{$u.dob}
Joined - IP{$u.doj|date_format} - {$u.signup_ip}
Last Login - Login IP{$u.last_logged} - {$u.ip}
Last Active - Online {$u.last_active} - {$u.last_active|is_online}
Profile Views +
Videos Watched
Videos Uploaded
Total Profile Comments
Profile Rating + 0-10
Profile Rated by
Subscribers
+
+ Recent Activity Log + + + + + + + + + +
IDUID
Username
Date
Detail
 
+ + +{assign var="logs" value=$userquery->get_user_action_log($u.userid,10)} +{section loop=$logs name=log} + + + + + + + + +{sectionelse} + +{/section} +
{$logs[log].action_id}{$logs[log].action_userid}
{$logs[log].action_username}
{$logs[log].date_added}
Type : {$logs[log].action_type} –{if $logs[log].action_details!=''}{$logs[log].action_details} –{/if} Success : {$logs[log].action_success} – {$logs[log].action_ip}
+ +
+ User Avatar and Background + + + + + + + + + + + +
User Avatar/Profile Pic
+ Please select image file
+ + + OR
+ Please Enter Image URL
+ + +
+ + + +
 
{if $userquery->getUserBg($u)}{else}No Bg{/if}User Background Image +
+ Please Select Image File +
+ +OR
+Please Enter Image URL
+ + +OR
+Please Enter Background Color
+ + + +
+Background Repeat Type (if using image as a background)
+ + +
+ +{if $userquery->getUserBg($u)}{/if}
+
+ + + + + + +
+ User Custom Profile Fields {if $user_custom_profile_fields} + + + {foreach from=$user_custom_profile_fields item=field} + + + +
+ {$field.hint_2} + + {/foreach} + +
{$field.title}{$field.hint_1}{ANCHOR place=$field.anchor_before}{$formObj->createField($field)}
{else}
No custom field found
{/if} +
+ + +
  
+  
+
+ + + + + + + + + + +
Profile Comments
 
{assign var=id value=$u.userid}{include file="$style_dir/blocks/comments.html" type=pr id=$u.userid link="uid=$id"}
+
+ + diff --git a/upload/admin_area/styles/cbadmin/theme/stylesheet.css b/upload/admin_area/styles/cbadmin/theme/stylesheet.css index 5afb0f78..f4c6cdd8 100644 --- a/upload/admin_area/styles/cbadmin/theme/stylesheet.css +++ b/upload/admin_area/styles/cbadmin/theme/stylesheet.css @@ -135,4 +135,6 @@ padding-left:5px; font-size:16px; font-weight:bold; font-family:Arial, Helvetica .templates_container .template_box:hover{background-color:#F3E8FF} -.preview_thumb{max-width:175px; max-height:175px} \ No newline at end of file +.preview_thumb{max-width:175px; max-height:175px} + +.mid_user_thumb{max-width:30px; min-height:30px} \ No newline at end of file diff --git a/upload/admin_area/video_manager.php b/upload/admin_area/video_manager.php index d81c2363..dc72bf9a 100644 --- a/upload/admin_area/video_manager.php +++ b/upload/admin_area/video_manager.php @@ -1,7 +1,7 @@ page_redir(); +$userquery->login_check('admin_access'); + +$uid = $_GET['uid']; +$udetails = $userquery->get_user_details($uid); + +if($udetails) +{ + if(isset($_POST['update_user'])) + { + $userquery->update_user($_POST); + if(!error()) + $udetails = $userquery->get_user_details($uid); + } + + assign('u',$udetails); + assign('p',$userquery->get_user_profile($udetails['userid'])); +}else{ + e("No User Found"); + $CBucket->show_page = false; +} + + +template_files("view_user.html"); +display_it(); +?> \ No newline at end of file diff --git a/upload/channels.php b/upload/channels.php index f95a0c41..f480bf86 100644 --- a/upload/channels.php +++ b/upload/channels.php @@ -7,96 +7,21 @@ **************************************************************************************************** */ require 'includes/config.inc.php'; -$pages->page_redir(); -subtitle('channels'); +$userquery->perm_check('view_channel',true); -//Getting Order - @$order = $_GET['order']; - if(empty($order) || is_array($_GET['order'])){ - $order = "ra"; - } -$orders = array( - "mv" => "ORDER BY profile_hits DESC", - "fr" => "WHERE featured='yes'", - "ra" => "ORDER BY doj DESC", - "vd" => "ORDER BY total_videos DESC", - "ct" => "ORDER BY total_comments DESC" - ); - -@$show_order = array( - "mv" => $LANG['mostly_viewed'], - "fr" => $LANG['featured'], - "ra" => $LANG['recently_added'], - "vd" => $LANG['most_videos'], - "ct" => $LANG['most_comments'] - ); -Assign('show_order',$show_order[$order]); - -//Setting Up Queries - - $limit = CLISTPP; - Assign('limit',$limit); - @$page = clean($_GET['page']); - if(empty($page) || $page == 0 || !is_numeric($page) || $page < 0){ - $page = 1; - } - $from = $page-1; - $from = $from*$limit; - $query_limit = "limit $from,$limit"; - - $orderby = $orders[$order]; +//Getting Video List +$page = mysql_clean($_GET['page']); +$get_limit = create_query_limit($page,VLISTPP); +$users = $db->select("users",'*',$cond,$get_limit,"doj DESC"); +Assign('users', $users); - //$sql = "SELECT * FROM users WHERE usr_status='Ok' $orderby $query_limit"; - //$sql_p = "SELECT * FROM users WHERE usr_status='Ok' $orderby"; - - $sql = "SELECT * FROM users $orderby $query_limit"; - $sql_p = "SELECT * FROM users $orderby "; +//Collecting Data for Pagination +$total_rows = $db->count('users','*',$cond); +$total_pages = count_pages($total_rows,VLISTPP); - $user_data = $db->Execute($sql); - $total_users = $user_data->recordcount() + 0; - $users = $user_data->getrows(); - - for($id=0;$id<$total_users;$id++){ - - $sql = "Select * FROM channel_comments WHERE channel_user='".$users[$id]['username']."'"; - $rs = $db->Execute($sql); - $users[$id]['total_comments'] = $rs->recordcount() + 0; - - $sql = "Select * FROM video WHERE username='".$users[$id]['username']."'"; - $rs = $db->Execute($sql); - $users[$id]['total_videos'] = $rs->recordcount() + 0; - - } - - Assign('users',$users); - //Pagination -$link = '?order='.$order; -Assign('link',$link); - - $query = mysql_query($sql_p); - Assign('grand_total',mysql_num_rows($query)); - $total_rows = mysql_num_rows($query); - $page_id=1; - $id = 1; - //$all_pages[0]['page'] = $page_id; - $records = $total_rows/$limit; - $pages = round($records+0.49,0); - - -$show_pages = ShowPagination($pages,$page,$link); -Assign('show_pages',$show_pages); - -Assign('pages',$pages); -Assign('cur_page',$page); -Assign('nextpage',$page+1); -Assign('prepage',$page-1); -Assign('total_pages',$page_id); - -@Assign('msg',$msg); -Template('header.html'); -Template('message.html'); -Template('channels.html'); -Template('footer.html'); +$pages->paginate($total_pages,$page); +template_files('channels.html'); +display_it(); ?> \ No newline at end of file diff --git a/upload/convert_process.php b/upload/convert_process.php deleted file mode 100644 index 7af9ec05..00000000 --- a/upload/convert_process.php +++ /dev/null @@ -1,13 +0,0 @@ -ConvertFile($newfilename,$filename); -} - -?> \ No newline at end of file diff --git a/upload/edit_account.php b/upload/edit_account.php new file mode 100644 index 00000000..68071d18 --- /dev/null +++ b/upload/edit_account.php @@ -0,0 +1,92 @@ +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 +if(isset($_POST['ban_users'])) +{ + $userquery->ban_users($_POST['users']); +} + +$mode = $_GET['mode']; + +switch($mode) +{ + case 'profile_settings': + default: + { + assign('mode','profile_settings'); + } + break; + + case 'avatar_bg': + { + assign('mode','avatar_bg'); + } + break; + + case 'change_email': + { + assign('mode','change_email'); + } + break; + + case 'change_password': + { + assign('mode','change_password'); + } + break; + + case 'ban_users': + { + assign('mode','ban_users'); + } + break; +} + +$udetails = $userquery->get_user_details(userid()); +assign('user',$udetails); +assign('p',$userquery->get_user_profile($udetails['userid'])); + +template_files('edit_account.html'); +display_it(); +?> \ No newline at end of file diff --git a/upload/edit_video.php b/upload/edit_video.php index fd783c20..30f1accd 100644 --- a/upload/edit_video.php +++ b/upload/edit_video.php @@ -1,60 +1,41 @@ logincheck(); -$pages->page_redir(); -$user = $_SESSION['username']; +$udetails = $userquery->get_user_details(userid()); +assign('user',$udetails); +assign('p',$userquery->get_user_profile($udetails['userid'])); -$videoid = $_REQUEST['videoid']; +$vid = mysql_clean($_GET['vid']); +//get video details +$vdetails = $cbvid->get_video_details($vid); -if($userquery->CheckVideoOwner($videoid,$user) == 1 || $is_admin == 1) +if($vdetails['userid'] != userid()) { -//Getting Video Id - - if($myquery->VideoExists($videoid)){ - //Updating Video - if(isset($_POST['update'])){ - $msg = $Upload->ValidateUploadForm(); - if(empty($msg)){ - $msg = $myquery->UpdateVideo($videoid); - } - } - - $data = $myquery->GetVideoDetails($videoid); - //Assigning Thumbs - $data['thumb1'] = GetThumb($data['flv'],1); - $data['thumb2'] = GetThumb($data['flv'],2); - $data['thumb3'] = GetThumb($data['flv'],3); - $data['url'] = VideoLink($data['videokey'],$data['title']); - Assign('data',$data); - Assign('country',$signup->country()); - }else{ - $msg = $LANG['class_vdo_del_err']; - Assign('show_form','no'); - } - - //Assigning Category List - $sql = "SELECT * from category"; - $rs = $db->Execute($sql); - $total_categories = $rs->recordcount() + 0; - $category = $rs->getrows(); - Assign('category', $category); + e(lang('no_edit_video')); + $Cbucket->show_page = false; +}else{ -Assign('subtitle',$LANG['title_edit_video'].$data['title']); -@Assign('msg',$msg); -Template('header.html'); -Template('message.html'); -Template('edit_video.html'); -Template('footer.html'); -} -else -{ -header( 'Location: '.videos_link.'' ) ; + //Updating Video Details + if(isset($_POST['update_video'])){ + $Upload->validate_video_upload_form(); + if(empty($eh->error_list)) + { + $_POST['videoid'] = $vid; + $cbvid->update_video(); + $cbvid->set_default_thumb($vid,mysql_clean(post('default_thumb'))); + } + } + + assign('v',$vdetails); } + +template_files('edit_video.html'); +display_it(); ?> \ No newline at end of file diff --git a/upload/includes/classes/actions.class.php b/upload/includes/classes/actions.class.php index fa34b33e..4f6d8d29 100644 --- a/upload/includes/classes/actions.class.php +++ b/upload/includes/classes/actions.class.php @@ -34,6 +34,9 @@ class cbactions var $fav_tbl = 'favorites'; var $flag_tbl = 'flags'; + var $type_tbl = 'videos'; + var $type_id_field = 'videoid'; + /** * Class variable ie $somevar = SomeClass; * $obj_class = 'somevar'; @@ -107,10 +110,12 @@ class cbactions /** * Function used to check weather object already added to favorites or not */ - function fav_check($id) + function fav_check($id,$uid=NULL) { global $db; - $results = $db->select($this->fav_tbl,"favorite_id"," id='".$id."' AND userid='".userid()."'"); + if(!$uid) + $uid =userid(); + $results = $db->select($this->fav_tbl,"favorite_id"," id='".$id."' AND userid='".$uid."' AND type='".$this->type."'"); if($db->num_rows>0) return true; else @@ -222,7 +227,7 @@ class cbactions //Setting Emails $emails = implode(',',$emails_array); //Now Finally Sending Email - cbmail(array('to'=>$emails,'from'=>username(),'subject'=>$subj,'content'=>$msg)); + cbmail(array('to'=>$emails,'from'=>username(),'subject'=>$subj,'content'=>$msg,'use_boundary'=>true)); } }else{ e(sprintf(lang("share_video_no_user_err"),$this->name)); @@ -235,6 +240,43 @@ class cbactions e(sprintf(lang("obj_not_exists"),$this->name)); } } + + + /** + * Get Used Favorites + */ + function get_favorites($uid=NULL,$limit=NULL,$cond=NULL,$order=NULL) + { + global $db; + if(!$uid) + $uid=userid(); + if($cond) + $cond = " AND ".$cond; + $results = $db->select($this->fav_tbl.",".$this->type_tbl,"*"," ".$this->fav_tbl.".type='".$this->type."' + AND ".$this->fav_tbl.".userid='".$uid."' + AND ".$this->type_tbl.".".$this->type_id_field." = ".$this->fav_tbl.".id".$cond,$limit,$order); + if($db->num_rows>0) + return $results; + else + return false; + } + + + /** + * Function used remove video from favorites + */ + function remove_favorite($fav_id,$uid=NULL) + { + global $db; + if(!$uid) + $uid=userid(); + if($this->fav_check($fav_id,$uid)) + { + $db->delete($this->fav_tbl,array('userid','type','id'),array($uid,$this->type,$fav_id)); + e(sprintf(lang('fav_remove_msg'),$this->name),m); + }else + e(sprintf(lang('unknown_favorite'),$this->name)); + } } ?> \ No newline at end of file diff --git a/upload/includes/classes/category.class.php b/upload/includes/classes/category.class.php index 12d7c8ae..e2ae9bd7 100644 --- a/upload/includes/classes/category.class.php +++ b/upload/includes/classes/category.class.php @@ -5,8 +5,8 @@ * This class is used to create * and manage categories * its an abstract class - * it will be used in custom plugins or built-in plugins - * sections also use category system like videos, groups , channels etc + * it will be used in custom plugins or built-in sections + * sections like videos, groups , channels etc use this category system * * this abstract class has some rules * each section's category column should be named as "category" diff --git a/upload/includes/classes/image.class.php b/upload/includes/classes/image.class.php index e2d9f661..b3dd8387 100644 --- a/upload/includes/classes/image.class.php +++ b/upload/includes/classes/image.class.php @@ -8,38 +8,50 @@ class ResizeImage $array = getimagesize($file); $width_orig= $array[0]; $height_orig= $array[1]; - - if($width_orig > $height_orig) - $ratio= $width_orig/$dim; - else $ratio=$height_orig/$dim; - - $width=$width_orig/$ratio; - $height=$height_orig/$ratio; - - if($aspect_ratio == false && $dim_h !=''){ - $width = $dim; - $height = $dim_h; - } - - $image_p = imagecreatetruecolor($width, $height); - - if($ext=='jpg' || $ext=='JPG' || $ext=='JPEG'){ - $image = imagecreatefromjpeg($file); - imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig); - imagejpeg($image_p,$des, 90); - } - if($ext=='png' || $ext=='PNG'){ - $image = imagecreatefrompng($file); - imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig); - imagepng($image_p,$des); - } - - if($ext=='gif' || $ext=='GIF'){ - $image = imagecreatefromgif($file); - imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig); - imagegif($image_p,$des, 90); - } + if($width_orig > $dim || $height_orig>$dim ) + { + if($width_orig > $height_orig) + { + $ratio= $width_orig/$dim; + }else{ + if($dim_h==NULL) + $ratio=$height_orig/$dim; + else + $ratio=$height_orig/$dim_h; + } + + $width=$width_orig/$ratio; + $height=$height_orig/$ratio; + + if($aspect_ratio == false && $dim_h !=''){ + $width = $dim; + $height = $dim_h; + } + + $image_p = imagecreatetruecolor($width, $height); + + if($ext=='jpg' || $ext=='JPG' || $ext=='JPEG'){ + $image = imagecreatefromjpeg($file); + imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig); + imagejpeg($image_p,$des, 90); + } + if($ext=='png' || $ext=='PNG'){ + $image = imagecreatefrompng($file); + imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig); + imagepng($image_p,$des); + } + + if($ext=='gif' || $ext=='GIF'){ + $image = imagecreatefromgif($file); + imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig); + imagegif($image_p,$des, 90); + } + }else + { + if(!file_exists($des)) + copy($file,$des); + } } //Validating an Image diff --git a/upload/includes/classes/my_queries.class.php b/upload/includes/classes/my_queries.class.php index 7e2ac8a1..73aa9aa2 100644 --- a/upload/includes/classes/my_queries.class.php +++ b/upload/includes/classes/my_queries.class.php @@ -127,6 +127,21 @@ class myquery { //Function Used To Update Videos Views function UpdateVideoViews($vkey){increment_views($vkey,'video');} + /** + * Function used to check weather username exists not + */ + function check_user($username){ + global $userquery; + return $userquery->username_exists($username); + } + + /** + * Function used to check weather email exists not + */ + function check_email($email){ + global $userquery; + return $userquery->email_exists($email); + } /** * Function used to delete comments @@ -317,21 +332,7 @@ class myquery { return $msg; } - //Function Used to Get Subscriber List - function GetSubscribers($user){ - global $LANG; - $query = mysql_query("SELECT * FROM subscriptions WHERE subscribed_to ='".$user."'"); - $data = mysql_num_rows($query); - return $data; - } - - function GetSubscriptions($user){ - global $LANG; - $query = mysql_query("SELECT * FROM subscriptions WHERE subscribed_user ='".$user."'"); - $data = mysql_num_rows($query); - return $data; - } //Function Used To Get Number Of Favourite Videos of user @@ -886,16 +887,8 @@ class myquery { */ function set_default_thumb($vid,$thumb) { - global $db,$LANG; - $num = get_thumb_num($thumb); - $file = THUMBS_DIR.'/'.$thumb; - if(file_exists($file)) - { - $db->update("video",array("default_thumb"),array($num)," videoid='$vid'"); - e($LANG['vid_thumb_changed'],m); - }else{ - e($LANG['vid_thumb_change_err']); - } + global $cbvid; + return $cbvid->set_default_thumb($vid,$thumb); } diff --git a/upload/includes/classes/pages.class.php b/upload/includes/classes/pages.class.php index dd266fff..408da7ae 100644 --- a/upload/includes/classes/pages.class.php +++ b/upload/includes/classes/pages.class.php @@ -98,48 +98,28 @@ class pages{ redirect_to($newPage); } - function createUrl($url,$params_array,$remove_param=false,$urlencode=false) + function create_url($params_array,$url=NULL,$remove_param=false,$urlencode=false) { - //Cleaning Url and Create Existing Params as Array - $list1 = explode('&',$url); - $semi_clean_url = preg_replace('/&(.*)/','',$url); - $list2= explode('?',$semi_clean_url); - $clean_url = preg_replace('/\?(.*)/','',$semi_clean_url); - $lists=array_merge($list1,$list2); - foreach($lists as $list) + if($url==NULL or $url == 'auto') { - preg_match('/http:\/\//',$list,$matches); - if(empty($matches[0])) - { - if($remove_param!=true) - { - list($param,$value) = explode('=',$list); - if(empty($params_array[$param])) - $params_array[$param] = $value; - else - $params_array[$param] = $params_array[$param]; - } - } + if($_SERVER['QUERY_STRING']) + $url = '?'.$_SERVER['QUERY_STRING']; } - $count = 0; - $total = count($params_array); - if($total>0 && !empty($params_array)) + + $new_link = ''; + $new_link .= $url; + if(is_array($params_array)) { - foreach($params_array as $param => $value) + foreach($params_array as $name => $value) { - $count++; - if($count==1) - $url_param .= '?'; - $url_param .=$param.'='.$value; - if($count != $total) - $url_param .='&'; + if($url) + $new_link .='&'.$name.'='.$value; + else + $new_link .='?'.$name.'='.$value; } } - $finalUrl = $clean_url.$url_param ; - if($urlencode ==true) - $finalUrl = urlencode($finalUrl); - return $finalUrl; + return $new_link; } //This Fucntion is used to Redirect to respective URL @@ -153,7 +133,7 @@ class pages{ /** * Function used to create link */ - function create_link($page,$link=NULL,$extra_params=NULL,$tag,$return_param=false) + function create_link($page,$link=NULL,$extra_params=NULL,$tag='#page#',$return_param=false) { if($link==NULL or $link == 'auto') { diff --git a/upload/includes/classes/search.class.php b/upload/includes/classes/search.class.php index 3b475e42..6f530177 100644 --- a/upload/includes/classes/search.class.php +++ b/upload/includes/classes/search.class.php @@ -165,11 +165,14 @@ class cbsearch * it is used to get results within defined time span * ie today, this week , this month or this year */ - function date_margin($date_column='date_added') + function date_margin($date_column='date_added',$date_margin=NULL) { - if(!empty($this->date_margin)) + if(!$date_margin) + $date_margin = $this->date_margin; + + if(!empty($date_margin)) { - switch($this->date_margin) + switch($date_margin) { case "today": { diff --git a/upload/includes/classes/signup.class.php b/upload/includes/classes/signup.class.php index 5e024aa2..5816aa28 100644 --- a/upload/includes/classes/signup.class.php +++ b/upload/includes/classes/signup.class.php @@ -36,7 +36,7 @@ class signup { * extra_params * hint_1 [hint before field] * hint_2 [hint after field] - * anchor_before [before after field] + * anchor_before [anchor before field] * anchor_after [anchor after field] * ) */ @@ -47,7 +47,7 @@ class signup { $username = $default['username']; $email = $default['email']; - $dcountry = $default['country']; + $dcountry = $default['country'] ? $default['country'] : $Cbucket->configs['default_country_iso2']; $dob = $default['dob']; $dob = $dob ? date("d-m-Y",strtotime($dob)) : '14-14-1989'; @@ -148,6 +148,7 @@ class signup { */ function validate_form_fields($array=NULL) { + global $userquery; $fields = $this->load_signup_fields($array); if($array==NULL) @@ -159,7 +160,7 @@ class signup { //Mergin Array $signup_fields = array_merge($fields,$this->custom_signup_fields); - //Now Validating Each Field 1 by 1 + /*//Now Validating Each Field 1 by 1 foreach($signup_fields as $field) { $field['name'] = formObj::rmBrackets($field['name']); @@ -238,7 +239,8 @@ class signup { } } } - } + }*/ + validate_cb_form($signup_fields,$array); } @@ -248,7 +250,7 @@ class signup { */ function signup_user($array=NULL) { - global $LANG,$db; + global $LANG,$db,$userquery; if($array==NULL) $array = $_POST; @@ -259,6 +261,8 @@ class signup { //checking terms and policy agreement if($_POST['agree']!='yes') e($LANG['usr_ament_err']); + + if(!error()) { $signup_fields = $this->load_signup_fields($array); @@ -352,6 +356,26 @@ class signup { $db->Execute($query); $insert_id = $db->insert_id(); + $db->insert($userquery->dbtbl['user_profile'],array("userid"),array($insert_id)); + + if(!$userquery->perm_check('admin_add_user',true)) + { + global $cbemail; + $tpl = $cbemail->get_template('email_verify_template'); + $more_var = array + ('{username}' => post('username'), + '{password}' => post('password'), + '{email}' => post('email'), + '{avcode}' => $avcode, + ); + $var = array_merge($more_var,$var); + $subj = $cbemail->replace($tpl['email_template_subject'],$var); + $msg = $cbemail->replace($tpl['email_template'],$var); + + //Now Finally Sending Email + cbmail(array('to'=>post('email'),'from'=>'webmaster@localhost','subject'=>$subj,'content'=>$msg)); + } + return $insert_id; } diff --git a/upload/includes/classes/upload.class.php b/upload/includes/classes/upload.class.php index 8d16e32f..8ba9c183 100644 --- a/upload/includes/classes/upload.class.php +++ b/upload/includes/classes/upload.class.php @@ -56,7 +56,7 @@ $upload_fields = array_merge($upload_fields,$this->custom_form_fields); //Now Validating Each Field 1 by 1 - foreach($upload_fields as $field) + /*foreach($upload_fields as $field) { $field['name'] = formObj::rmBrackets($field['name']); @@ -137,7 +137,8 @@ } } } - } + }*/ + validate_cb_form($upload_fields,$array); } function ValidateUploadForm() @@ -889,6 +890,75 @@ return $new_array; } + + + /** + * function used to upload user avatar and or background + */ + function upload_user_file($type='a',$file,$uid) + { + global $db,$userquery,$imgObj; + $avatar_dir = BASEDIR.'/images/avatars/'; + $bg_dir = BASEDIR.'/images/backgrounds/'; + + if($userquery->user_exists($uid)) + { + switch($type) + { + case 'a': + case 'avatar': + { + if(file_exists($file['tmp_name'])) + { + $ext = getext($file['name']); + $file_name = $uid.'.'.$ext; + $file_path = $avatar_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{ + $small_size = $avatar_dir.$uid.'-small.'.$ext; + $imgObj->CreateThumb($file_path,$file_path,AVATAR_SIZE,$ext); + $imgObj->CreateThumb($file_path,$small_size,AVATAR_SMALL_SIZE,$ext); + } + }else{ + e(lang("An error occured ")); + } + } + } + break; + case 'b': + case 'bg': + case 'background': + { + if(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 + e(lang('user_doesnt_exist')); + } } ?> \ No newline at end of file diff --git a/upload/includes/classes/user.class.php b/upload/includes/classes/user.class.php index d8a38a4a..075625ee 100644 --- a/upload/includes/classes/user.class.php +++ b/upload/includes/classes/user.class.php @@ -12,6 +12,10 @@ Notice : Maintain this section */ +define('NO_AVATAR','no_avatar.jpg'); //if there is no avatar or profile pic, this file will be used +define('AVATAR_SIZE',250); +define('AVATAR_SMALL_SIZE',30); +define('BG_SIZE',1200); class userquery { @@ -20,11 +24,16 @@ class userquery { var $level = ''; var $permissions = ''; var $access_type_list = array(); //Access list + var $usr_levels = array(); var $dbtbl = array( 'user_permission_type' => 'user_permission_types', 'user_permissions' => 'user_permissions', 'user_level_permission' => 'user_levels_permissions', + 'user_profile' => 'user_profile', + 'users' => 'users', + 'action_log' => 'action_log', + 'subtbl' => 'subscriptions', ); function init() @@ -47,7 +56,21 @@ class userquery { $this->add_access_type('upload_access','Upload Access'); $this->add_access_type('channel_access','Channel Access'); $this->add_access_type('mod_access','Moderator Access');*/ - + + //Fetching List Of User Levels + $levels = $this->get_levels(); + foreach($levels as $level) + { + $this->usr_levels[$level['user_level_id']]=$level["user_level_name"]; + } + + if(user_id()) + { + $this->permission = $this->get_user_level(userid()); + $this->UpdateLastActive(userid()); + }else + $this->permission = $this->get_user_level(4,TRUE); + } /** @@ -122,13 +145,13 @@ class userquery { $this->username = $sess->get('username'); $this->level = $sess->get('level'); - //Updating User last login and num of visist + //Updating User last login , num of visist and ip $db->update('users', array( - 'num_visits','last_logged' + 'num_visits','last_logged','ip' ), array( - '|f|num_visits+1',NOW() + '|f|num_visits+1',NOW(),$_SERVER['HTTP_HOST'] ), "userid='".$userid."'" ); @@ -266,7 +289,7 @@ class userquery { global $db; $results = $db->select("users", "userid,email,level,usr_status,user_session_key,user_session_code", - "username='$username' AND password='$pass'"); + "username='$username' OR userid='$username' AND password='$pass'"); if($db->num_rows > 0) { return $results[0]; @@ -323,23 +346,8 @@ class userquery { } */ function admin_check(){ - $admin = 'Admin'; - if(isset($_SESSION['userid']) && isset($_SESSION['username']) && isset($_SESSION['session'])) - { - $userid = @$_SESSION['userid']; - $username = @$_SESSION['username']; - $session = @$_SESSION['session']; - - $query = mysql_query("SELECT * FROM users WHERE level='".$admin."' AND username ='".$username."' AND userid = '".$userid."' AND session='".$session."'"); - if(mysql_num_rows($query)>0){ - $answer = 1; - return $answer; - }else{ - $answer = 0; - return $answer; - } - } - } + return $this->login_check('admin_access'); + } /** * Function used to check user is admin or not @@ -357,35 +365,6 @@ class userquery { } } - /*//This Fucntion Is Used To Check Weather User as Admin has Been Lggen in or Not FOR LOGIN PAGE - function admin_login_check_2(){ - $admin = 'Admin'; - $userid = @$_SESSION['userid']; - $username = @$_SESSION['username']; - $session = @$_COOKIE['PHPSESSID']; - $query = mysql_query("SELECT * FROM users WHERE level='".$admin."' AND username ='".$username."' AND userid = '".$userid."' AND session='".$session."'"); - if(mysql_num_rows($query)>0){ - $login = true; - }else{ - - } - - return @$login; - - }*/ - - /*//Function Used To Check if SuperAdmin is loggged in or no - function SuperAdminCheck(){ - $username = $_SESSION['username']; - $session = $_COOKIE['PHPSESSID']; - $query = mysql_query("SELECT * FROM admin WHERE username = '".$username."' AND session = '".$session."'"); - if(mysql_num_rows($query)>0){ - $login = true; - }else{ - redirect_to('main.php?msg=Please%20Loggin%20As%20SuperAdmin'); - } - }*/ - //This Function Is Used to Logout function logout($page='login.php'){ global $sess; @@ -398,48 +377,6 @@ class userquery { //$sess->remove_session(userid()); } - //List All Users - - function Get_All_Users($orderby,$order){ - $myquery = new myquery(); - $query = mysql_query("SELECT * FROM users ORDER BY '".$orderby."' '".$order."'"); - while($data=$myquery->fetch($query)){ - } - return $data; - } - - //Updating Super Admin - function UpdateSuperAdmin(){ - global $LANG; - $query = mysql_query("SELECT * FROM admin WHERE admin_id = '1' "); - $data = mysql_fetch_array($query); - - $pass = $data['password']; - - $uname = clean($_POST['uname']); - if(empty($uname)){ - $msg = e($LANG['usr_sadmin_err']); - } - $op = pass_code($_POST['opass']); - $np = pass_code($_POST['npass']); - $cp = pass_code($_POST['cnpass']); - - if(!empty($_POST['npass'])){ - if($np != $cp){ - $msg = e($LANG['usr_cpass_err']); - }elseif($op != $pass){ - $msg = e($LANG['usr_pass_err']); - }else{ - $pass_query = " , password = '".$np."'"; - } - } - if(empty($msg)){ - mysql_query("UPDATE admin SET username = '".$uname."' $pass_query WHERE username = '".$data['username']."'"); - $msg = e($LANG['usr_sadmin_msg'],m); - } - return $msg; - } - //--------ADMIN ACTIONS START ---------// //Delete User @@ -462,8 +399,10 @@ class userquery { //Check User Exists or Not function Check_User_Exists($id){ - $query = mysql_query("SELECT * FROM users WHERE userid='".$id."' OR username='".$id."'"); - if(mysql_num_rows($query)>0){ + global $db; + $result = $db->count($this->dbtbl['users'],"userid"," userid='".$id."' OR username='".$id."'"); + if($result>0) + { return true; }else{ return false; @@ -481,10 +420,10 @@ class userquery { function get_user_details($id=NULL) { global $db; - if(!$id) - $id = userid(); + /*if(!$id) + $id = userid();*/ - $results = $db->select('users','*'," userid='$id' "); + $results = $db->select('users','*'," userid='$id' OR username='".$id."'"); return $results[0]; }function GetUserData($id=NULL){ return $this->get_user_details($id); } @@ -511,118 +450,7 @@ class userquery { return $response; } - //Activate User - function Activate($user){ - $avcode = RandomString(10); - mysql_query("UPDATE users SET usr_status ='Ok',avcode='".$avcode."' WHERE userid='".$user."'"); - return true; - } - //DeActivate User - function DeActivate($user){ - $avcode = RandomString(10); - mysql_query("UPDATE users SET usr_status ='ToActivate',avcode='".$avcode."' WHERE userid='".$user."'"); - return true; - } - - //Featured User - function MakeFeatured($user){ - mysql_query("UPDATE users SET featured ='Yes' WHERE userid='".$user."'"); - return true; - } - - //UnFeatured User - function MakeUnFeatured($user){ - mysql_query("UPDATE users SET featured ='No' WHERE userid='".$user."'"); - return true; - } - - //Ban User - function ban($user){ - mysql_query("UPDATE users SET ban_status ='yes' WHERE userid='".$user."'"); - return true; - } - - //UnBan User - function unban($user){ - mysql_query("UPDATE users SET ban_status ='no' WHERE userid='".$user."'"); - return true; - } - - - //--------ADMIN ACTIONS END ---------// - - //User Login - - function userlogin($username,$password){ - //FUNCTION PENDING DUE TO FAILED IMPLEMENTATION -- ARSLAN -/* if(LOGIN_BRIDGE==1){ - require('login_bridge.php'); - $bridgeid = LOGIN_BRIDGE_ID; - $param = $this->GetBridgeParams($bridgeid); - $param['username'] = $username; - $param['password'] = $password; - $brige_results = BridgePHPBB($param); - }else{*/ - - $query = mysql_query("Select * FROM users WHERE username = '".$username."' and password = '".$password."'"); - $user_query = mysql_query("Select num_visits FROM users WHERE username = '".$username."'"); - $user_data = mysql_fetch_array($user_query); - $videos_query = mysql_query("SELECT * FROM video WHERE username='".$username."'"); - $videoscount = mysql_num_rows($videos_query); - $comments_query = mysql_query("SELECT * FROM channel_comments WHERE channel_user='".$username."'"); - $commentscount = mysql_num_rows($comments_query); - $num_visits = $user_data['num_visits']+1; - $updatequery = "UPDATE users SET session='".$_COOKIE['PHPSESSID']."' , last_logged =now(), num_visits='".$num_visits."',total_videos='".$videoscount."',total_comments='".$commentscount."',ip='".$_SERVER['REMOTE_ADDR']."' WHERE username = '".$username."'"; - //} - //if(mysql_num_rows($query) >0 || $brige_results==true){ -- In case we turn LoginBrigge on - if(mysql_num_rows($query) >0){ - $data = mysql_fetch_array($query); - if($data['ban_status'] != 'yes'){ - setcookie('username',$data['username'],time()+7200,'/'); - setcookie('userid',$data['userid'],time()+7200,'/'); - setcookie('session',$_COOKIE['PHPSESSID'],time()+7200,'/'); - session_register('username'); - session_register('userid'); - session_register('session'); - session_register('admin'); - $_SESSION['username'] = $data['username']; - $_SESSION['userid'] = $data['userid']; - $_SESSION['session'] = $_COOKIE['PHPSESSID']; - if(!empty($admin) || $data['level'] == 'Admin'){ - $_SESSION['admin'] = $data['username']; - } - if($data['userid'==1]){ - $_SESSION['superadmin'] = $data['username']; - } - mysql_query($updatequery); - $login = 'loggedin'; - }else{ - $login = 'banned'; - } - }else{ - $login = 'failed'; - } - return $login; - } - - - - - function logincheck2(){ - @$userid = $_SESSION['userid']; - @$username = $_SESSION['username']; - @$session = $_COOKIE['PHPSESSID']; - $query = mysql_query("SELECT * FROM users WHERE username ='".$username."' AND userid = '".$userid."' AND session='".$session."'"); - if(mysql_num_rows($query)>0){ - $login = true; - }else{ - $login = false; - } - return $login; - } - - //Function Used to Count Number of Videos Uploaded By User function TotalVideos($username){ @@ -811,27 +639,36 @@ class userquery { return $msg; } - //Function Used To Change Password + /** + * Function used to change user password + */ + function ChangeUserPassword($array){ + global $db; + + $old_pass = $array['old_pass']; + $new_pass = $array['new_pass']; + $c_new_pass = $array['c_new_pass']; + + $uid = $array['userid']; + + if(!$this->get_user_with_pass($uid,pass_code($old_pass))) + e(lang('usr_pass_err')); + elseif(empty($new_pass)) + e(lang('usr_pass_err2')); + elseif($new_pass != $c_new_pass) + e(lang('usr_cpass_err1')); + else + { + $db->update($this->dbtbl['users'],array('password'),array(pass_code($array['new_pass']))," userid='".$uid."'"); + e(lang("usr_pass_email_msg"),"m"); + + } + + return $msg; + } + function change_user_pass($array){ return $this->ChangeUserPassword($array); } + function change_password($array){ return $this->ChangeUserPassword($array); } - function ChangeUserPassword($userid){ - global $LANG; - $old_pass = pass_code($_POST['old_pass']); - $new_pass = pass_code($_POST['new_pass']); - $c_new_pass = pass_code($_POST['c_new_pass']); - $query = mysql_query("SELECT * FROM users WHERE userid = '".$userid."' AND password = '".$old_pass."'"); - if(mysql_num_rows($query)>0){ - if($new_pass == $c_new_pass){ - mysql_query("UPDATE users Set password='".$new_pass."' WHERE userid='".$userid."'"); - $msg = e($LANG['usr_pass_msg'],m); - }else{ - $msg = e($LANG['usr_cpass_err1']); - } - }else{ - $msg = e($LANG['usr_pass_err1']); - } - return $msg; - } - //Function Used to update number of channel / profile views of user function UpdateChannelViews($user){ @@ -966,21 +803,90 @@ class userquery { mysql_query("UPDATE users SET subscribers = '".$subs."' WHERE username='".$user."'"); } - //Function Used To Subscribe to User - function SubscribeUser($sub_user,$sub_to){ - global $LANG; - if(!empty($sub_user) || !empty($sub_to)){ - $query=mysql_query("SELECT * FROM subscriptions WHERE subscribed_user='".$sub_user."' AND subscribed_to='".$sub_to."'"); - if(mysql_num_rows($query)==0){ - mysql_query("INSERT INTO subscriptions(subscribed_user,subscribed_to)VALUES('".$sub_user."','".$sub_to."')"); - $this->UpdateSubscribers($sub_to); - $msg = e($LANG['usr_sub_msg'].$sub_to,m); - }else{ - $msg = e($LANG['usr_sub_err'].$sub_to); - } - } - return $msg; - } + + + /** + * Function used to subscribe user + */ + function subscribe_user($to,$user=NULL) + { + if(!$user) + $user = userid(); + global $db; + + $to_user = $this->get_user_details($to); + + if(!$this->user_exists($to)) + e(lang('usr_exist_err')); + elseif(!$user) + e(sprintf(lang('please_login_subscribe'),$to_user['username'])); + elseif($this->is_subscribed($to,$user)) + e(sprintf(lang("usr_sub_err"),$to_user['username'])); + else + { + $db->insert($this->dbtbl['subtbl'],array('userid','subscribed_to','date_added'), + array($user,$to,NOW())); + e(sprintf(lang('usr_sub_msg'),$to_user['username']),'m'); + } + } + function SubscribeUser($sub_user,$sub_to){return $this->subscribe_user($sub_to,$sub_user);} + + /** + * Function used to check weather user is already subscribed or not + */ + function is_subscribed($to,$user=NULL) + { + if(!$user) + $user = userid(); + global $db; + $result = $db->select($this->dbtbl['subtbl'],"*"," subscribed_to='$to' AND userid='$user'"); + if($db->num_rows>0) + return $result; + else + return false; + } + + + /** + * Function used to get user subscibers + * @param userid + */ + function get_user_subscribers($id) + { + global $id; + $result = $db->select($this->dbtbl['subtbl'],"*"," subscribed_to='$to' "); + if($db->num_rows>0) + return $result; + else + return false; + } + + /** + * function used to get user subscribers with details + */ + function get_user_subscribers_detail($id) + { + global $db; + $result = $db->select("users,".$this->dbtbl['subtbl'],"*"," subscriptions.subscribed_to = '$id' AND subscriptions.userid=users.userid"); + if($db->num_rows>0) + return $result; + else + return false; + } + + /** + * Function used to get user subscriptions + */ + function get_user_subscriptions($id) + { + global $db; + $result = $db->select("users,".$this->dbtbl['subtbl'],"*"," subscriptions.userid = '$id' AND subscriptions.subscribed_to=users.userid"); + if($db->num_rows>0) + return $result; + else + return false; + } + //Function Used To Reset Passoword function ResetPassword($step){ @@ -1097,7 +1003,7 @@ class userquery { function UpdateLastActive($username) { global $db; - $sql = "UPDATE users SET last_active = now() WHERE username='".$username."'"; + $sql = "UPDATE users SET last_active = '".NOW()."' WHERE username='".$username."' OR userid='".$username."' "; $db->Execute($sql); } @@ -1124,22 +1030,38 @@ class userquery { * @param : thumb file * @param : size (NULL,small) */ - function getUserThumb($udetails,$size='',$uid=NULL) + function getUserThumb($udetails,$size='',$uid=NULL,$just_file=false) { + + $remote = false; if(empty($udetails['userid'])) $udetails = $this->get_user_details($uid); - $thumbnail = $udetails['avatar'] ? $udetails['avatar'] : 'noavatar.png'; + //$thumbnail = $udetails['avatar'] ? $udetails['avatar'] : NO_AVATAR; + $thumbnail = $udetails['avatar']; $thumb_file = BASEDIR.'/images/avatars/'.$thumbnail; - if(file_exists($thumb_file)) + if(file_exists($thumb_file) && $thumbnail!='') $thumb_file = BASEURL.'/images/avatars/'.$thumbnail; - else - $thumb_file = BASEURL.'/images/avatars/no_avatar.jpg'; + elseif(!empty($udetails['avatar_url'])) + { + $thumb_file = $udetails['avatar_url']; + $remote = true; + }else + $thumb_file = BASEURL.'/images/avatars/'.NO_AVATAR; $ext = GetExt($thumb_file); $file = getName($thumb_file); - if(!empty($size)) - $thumb = BASEURL.'/images/avatars/'.$file.'-'.$size.'.'.$ext; - else - $thumb = BASEURL.'/images/avatars/'.$file.'.'.$ext; + + if(!$remote) + { + if(!empty($size)) + $thumb = BASEURL.'/images/avatars/'.$file.'-'.$size.'.'.$ext; + else + $thumb = BASEURL.'/images/avatars/'.$file.'.'.$ext; + }else + $thumb = $thumb_file; + + if($just_file) + return $file.'.'.$ext; + return $thumb; } function avatar($udetails,$size='',$uid=NULL) @@ -1147,6 +1069,29 @@ class userquery { return $this->getUserThumb($udetails,$size,$uid); } + /** + * Function used to get user Background + * @param : bg file + */ + function getUserBg($udetails) + { + $remote = false; + if(empty($udetails['userid'])) + $udetails = $this->get_user_details($uid); + //$thumbnail = $udetails['avatar'] ? $udetails['avatar'] : 'no_avatar.jpg'; + $file = $udetails['background']; + $bgfile = BASEDIR.'/images/backgrounds/'.$file; + if(file_exists($bgfile) && $file) + $thumb_file = BASEURL.'/images/backgrounds/'.$file; + elseif(!empty($udetails['background_url'])) + { + $thumb_file = $udetails['background_url']; + $remote = true; + }else + return false; + + return $thumb_file; + } @@ -1471,7 +1416,11 @@ class userquery { { if(!is_array($udetails) && is_numeric($udetails)) $udetails = $this->get_user_details($udetails); - return BASEURL.'/view_profile.php?uid='.$udetails['userid']; + return BASEURL.'/view_channel.php?user='.$udetails['username']; + } + function get_user_link($u) + { + return $this->profile_link($u); } @@ -1584,7 +1533,7 @@ class userquery { * it will also check weather current page requires login * if login is required, user will be redirected to signup page */ - function perm_check($access='',$check_login=FALSE) + function perm_check($access='',$check_login=FALSE,$control_page=true) { global $Cbucket; /*if($check_login) @@ -1601,6 +1550,8 @@ class userquery { }else{ if(!$check_only) e($LANG['insufficient_privileges']); + + if($control_page) $Cbucket->show_page(false); return false; } @@ -1620,11 +1571,812 @@ class userquery { else e(sprintf(lang('insufficient_privileges_loggin'),cblink(array('name'=>'signup')),cblink(array('name'=>'signup')))); } + + if($control_page) $Cbucket->show_page(false); return false; } } //} } + + + /** + * Function used to get user profile details + */ + function get_user_profile($uid) + { + global $db; + $result = $db->select($this->dbtbl['user_profile'],"*"," userid='$uid'"); + if($db->num_rows>0) + { + return $result[0]; + }else + return false; + } + + + + /** + * FUnction loading personal details + */ + function load_personal_details($default) + { + + $user_vids = get_videos(array('user'=>$default['userid'])); + if(is_array($user_vids)) + foreach($user_vids as $user_vid) + { + $usr_vids[$user_vid['videoid']] = $user_vid['title']; + + } + + if(!$default) + $default = $_POST; + $profile_fields = array + ( + 'first_name' => array( + 'title'=> lang("user_fname"), + 'type'=> "textfield", + 'name'=> "first_name", + 'id'=> "first_name", + 'value'=> $default['first_name'], + 'db_field'=>'first_name', + 'required'=>'yes', + 'syntax_type'=> 'name', + 'auto_view'=>'yes' + ), + 'last_name' => array( + 'title'=> lang("user_lname"), + 'type'=> "textfield", + 'name'=> "last_name", + 'id'=> "last_name", + 'value'=> $default['last_name'], + 'db_field'=>'last_name', + 'syntax_type'=> 'name', + 'auto_view'=>'yes' + ), + 'profile_title' => array( + 'title'=> lang("profile_title"), + 'type'=> "textfield", + 'name'=> "profile_title", + 'id'=> "last_name", + 'value'=> $default['profile_title'], + 'db_field'=>'profile_title', + 'auto_view'=>'no' + + ), + 'profile_desc' => array( + 'title'=> lang("profile_desc"), + 'type'=> "textarea", + 'name'=> "profile_desc", + 'id'=> "last_name", + 'value'=> $default['profile_desc'], + 'db_field'=>'profile_desc', + 'auto_view'=>'no' + + ), + 'relation_status' => array( + 'title'=> lang("user_relat_status"), + 'type'=> "dropdown", + 'name'=> "relation_status", + 'id'=> "last_name", + 'value'=> array(lang('usr_arr_single')=>lang('usr_arr_single'), + lang('usr_arr_married')=>lang('usr_arr_married'), + lang('usr_arr_comitted')=>lang('usr_arr_comitted'), + lang('usr_arr_open_relate')=>lang('usr_arr_open_relate')), + 'checked'=> $default['relation_status'], + 'db_field'=>'relation_status', + 'auto_view'=>'yes', + 'return_checked' => true, + + ), + 'show_dob' => array( + 'title'=> lang("show_dob"), + 'type'=> "radiobutton", + 'name'=> "show_dob", + 'id'=> "show_dob", + 'value' => array('yes'=>lang('yes'),'no'=>lang('no')), + 'checked' => $default['show_dob'], + 'db_field'=>'show_dob', + 'syntax_type'=> 'name', + 'auto_view'=>'no' + ), + 'about_me' => array( + 'title'=> lang("user_about_me"), + 'type'=> "textarea", + 'name'=> "about_me", + 'id'=> "about_me", + 'value'=> $default['about_me'], + 'db_field'=>'about_me', + 'auto_view'=>'yes', + ), + 'profile_tags' => array( + 'title'=> lang("profile_tags"), + 'type'=> "textfield", + 'name'=> "profile_tags", + 'id'=> "profile_tags", + 'value'=> $default['profile_tags'], + 'db_field'=>'profile_tags', + 'auto_view'=>'no' + ), + 'web_url' => array( + 'title'=> lang("website"), + 'type'=> "textfield", + 'name'=> "web_url", + 'id'=> "web_url", + 'value'=> $default['web_url'], + 'db_field'=>'web_url', + 'auto_view'=>'yes', + 'display_function'=>'outgoing_link' + ), + 'profile_video' => array( + 'title' => lang('Profile Video'), + 'type' => 'dropdown', + 'name' => 'profile_video', + 'id' => 'profile_video', + 'value' => $usr_vids, + 'checked' => $default['profile_video'], + 'db_field' => 'profile_video', + 'auto_view' => 'no', + + ) + + ); + + return $profile_fields; + } + + + /** + * function used to load location fields + */ + function load_location_fields($default) + { + if(!$default) + $default = $_POST; + $other_details = array + ( + 'postal_code' => array( + 'title'=> lang("postal_code"), + 'type'=> "textfield", + 'name'=> "postal_code", + 'id'=> "postal_code", + 'value'=> $default['postal_code'], + 'db_field'=>'postal_code', + ), + 'hometown' => array( + 'title'=> lang("hometown"), + 'type'=> "textfield", + 'name'=> "hometown", + 'id'=> "hometown", + 'value'=> $default['hometown'], + 'db_field'=>'hometown', + ), + 'city' => array( + 'title'=> lang("city"), + 'type'=> "textfield", + 'name'=> "city", + 'id'=> "city", + 'value'=> $default['city'], + 'db_field'=>'city', + ), + ); + return $other_details; + } + + + /** + * Function used to load experice fields + */ + function load_other_fields($default) + { + if(!$default) + $default = $_POST; + $more_details = array + ( + 'education' => array( + 'title'=> lang("education"), + 'type'=> "dropdown", + 'name'=> "education", + 'id'=> "education", + 'value'=> array(lang('usr_arr_no_ans')=>lang('usr_arr_no_ans'), + lang('usr_arr_elementary')=>lang('usr_arr_elementary'), + lang('usr_arr_hi_school')=>lang('usr_arr_hi_school'), + lang('usr_arr_some_colg')=>lang('usr_arr_some_colg'), + lang('usr_arr_assoc_deg')=>lang('usr_arr_assoc_deg'), + lang('usr_arr_bach_deg')=>lang('usr_arr_bach_deg'), + lang('usr_arr_mast_deg')=>lang('usr_arr_mast_deg'), + lang('usr_arr_phd')=>lang('usr_arr_phd'), + lang('usr_arr_post_doc')=>lang('usr_arr_post_doc'), + ), + 'checked'=>$default['education'], + 'db_field'=>'education', + ), + 'schools' => array( + 'title'=> lang("schools"), + 'type'=> "textarea", + 'name'=> "schools", + 'id'=> "schools", + 'value'=> $default['schools'], + 'db_field'=>'schools', + ), + 'occupation' => array( + 'title'=> lang("occupation"), + 'type'=> "textarea", + 'name'=> "occupation", + 'id'=> "occupation", + 'value'=> $default['occupation'], + 'db_field'=>'occupation', + ), + 'companies' => array( + 'title'=> lang("companies"), + 'type'=> "textarea", + 'name'=> "companies", + 'id'=> "companies", + 'value'=> $default['companies'], + 'db_field'=>'companies', + ), + 'hobbies' => array( + 'title'=> lang("hobbies"), + 'type'=> "textarea", + 'name'=> "hobbies", + 'id'=> "hobbies", + 'value'=> $default['hobbies'], + 'db_field'=>'hobbies', + ), + 'fav_movies' => array( + 'title'=> lang("user_fav_movs_shows"), + 'type'=> "textarea", + 'name'=> "fav_movies", + 'id'=> "fav_movies", + 'value'=> $default['fav_movies'], + 'db_field'=>'fav_movies', + ), + 'fav_music' => array( + 'title'=> lang("user_fav_music"), + 'type'=> "textarea", + 'name'=> "fav_music", + 'id'=> "fav_music", + 'value'=> $default['fav_music'], + 'db_field'=>'fav_music', + ), + 'fav_books' => array( + 'title'=> lang("user_fav_books"), + 'type'=> "textarea", + 'name'=> "fav_books", + 'id'=> "fav_books", + 'value'=> $default['fav_books'], + 'db_field'=>'fav_books', + ), + + ); + return $more_details; + } + + + /** + * Function used to load privacy fields + */ + function load_privacy_field($default) + { + if(!$default) + $default = $_POST; + + $privacy = array + ( + 'online_status' => array( + 'title'=> lang("online_status"), + 'type'=> "dropdown", + 'name'=> "privacy", + 'id'=> "privacy", + 'value'=> array('online'=>lang('online'),'offline'=>lang('offline'),'custom'=>lang('custom')), + 'checked'=>$default['online_status'], + 'db_field'=>'online_status', + ), + 'show_profile' => array( + 'title'=> lang("show_profile"), + 'type'=> "dropdown", + 'name'=> "show_profile", + 'id'=> "show_profile", + 'value'=> array('all'=>lang('all'),'members'=>lang('members'),'friends'=>lang('friends')), + 'checked'=>$default['show_profile'], + 'db_field'=>'show_profile', + ), + 'allow_comments'=>array( + 'title'=> lang("vdo_allow_comm"), + 'type'=> "radiobutton", + 'name'=> "allow_comments", + 'id'=> "allow_comments", + 'value' => array('yes'=>lang('yes'),'no'=>lang('no')), + 'checked' => strtolower($default['allow_comments']), + 'db_field'=>'allow_comments', + ), + 'allow_ratings'=>array( + 'title'=> lang("allow_ratings"), + 'type'=> "radiobutton", + 'name'=> "allow_ratings", + 'id'=> "allow_ratings", + 'value' => array('yes'=>lang('yes'),'no'=>lang('no')), + 'checked' => strtolower($default['allow_ratings']), + 'db_field'=>'allow_ratings', + ), + ); + + return $privacy; + } + + /** + * User Profile Fields + */ + function load_profile_fields($default) + { + if(!$default) + $default = $_POST; + + $profile_fields = $this->load_personal_details($default); + $other_details = $this->load_location_fields($default); + $more_details = $this->load_other_fields($default); + $privacy = $this->load_privacy_field($default); + return array_merge($profile_fields,$other_details,$more_details,$privacy); + } + + + + + + /** + * Function used to update use details + */ + function update_user($array) + { + global $LANG,$db,$signup,$Upload; + if($array==NULL) + $array = $_POST; + + if(is_array($_FILES)) + $array = array_merge($array,$_FILES); + + $userfields = $this->load_profile_fields($array); + + validate_cb_form($userfields,$array); + + foreach($userfields as $field) + { + $name = formObj::rmBrackets($field['name']); + $val = $array[$name]; + + if($field['use_func_val']) + $val = $field['validate_function']($val); + + + if(!empty($field['db_field'])) + $query_field[] = $field['db_field']; + + if(is_array($val)) + { + $new_val = ''; + foreach($val as $v) + { + $new_val .= "#".$v."# "; + } + $val = $new_val; + } + if(!$field['clean_func'] || (!function_exists($field['clean_func']) && !is_array($field['clean_func']))) + $val = mysql_clean($val); + else + $val = apply_func($field['clean_func'],$val); + + if(!empty($field['db_field'])) + $query_val[] = $val; + } + + //updating user detail + if(has_access('admin_access',TRUE) && isset($array['admin_manager'])) + { + //Checking Username + if(empty($array['username'])) + e(lang('usr_uname_err')); + elseif($array['dusername'] != $array['username'] && $this->username_exists($array['username'])) + e(lang('usr_uname_err2')); + elseif(!username_check($array['username'])) + e(lang('usr_uname_err3')); + else + $username = $array['username']; + + //Checking Email + if(empty($array['email'])) + e(lang('usr_email_err1')); + elseif(!is_valid_syntax('email',$array['email'])) + e(lang('usr_email_err2')); + elseif(email_exists($array['email']) && $array['email'] != $array['demail']) + e(lang('usr_email_err3')); + else + $email = $array['email']; + + $uquery_field[] = 'username'; + $uquery_val[] = $username; + + $uquery_field[] = 'email'; + $uquery_val[] = $email; + + //Changing User Level + $uquery_field[] = 'level'; + $uquery_val[] = $array['level']; + + //Checking for user stats + $uquery_field[] = 'profile_hits'; + $uquery_val[] = $array['profile_hits']; + $uquery_field[] = 'total_watched'; + $uquery_val[] = $array['total_watched']; + $uquery_field[] = 'total_videos'; + $uquery_val[] = $array['total_videos']; + $uquery_field[] = 'total_comments'; + $uquery_val[] = $array['total_comments']; + $uquery_field[] = 'subscribers'; + $uquery_val[] = $array['subscribers']; + $uquery_field[] = 'rating'; + + $rating = $array['rating']; + if($rating<1 || $rating>10) + $rating = 1; + $uquery_val[] = $rating ; + $uquery_field[] = 'rated_by'; + $uquery_val[] = $array['rated_by']; + + } + + //Changing Gender + if($array['sex']) + { + $uquery_field[] = 'sex'; + $uquery_val[] = mysql_clean($array['sex']); + } + + //Changing Country + if($array['country']) + { + $uquery_field[] = 'country'; + $uquery_val[] = mysql_clean($array['country']); + } + + //Updating User Avatar + if($array['avatar_url']) + { + $uquery_field[] = 'avatar_url'; + $uquery_val[] = $array['avatar_url']; + } + + //Deleting User Avatar + if($array['delete_avatar']=='yes') + { + $file = BASEDIR.'/images/avatars/'.$array['avatar_file_name']; + if(file_exists($file) && $array['avatar_file_name'] !='') + unlink($file); + } + + //Deleting User Bg + if($array['delete_bg']=='yes') + { + $file = BASEDIR.'/images/backgrounds/'.$array['bg_file_name']; + if(file_exists($file) && $array['bg_file_name'] !='') + unlink($file); + } + + + if(isset($_FILES['avatar_file']['name'])) + { + $file = $Upload->upload_user_file('a',$_FILES['avatar_file'],$array['userid']); + if($file) + { + $uquery_field[] = 'avatar'; + $uquery_val[] = $file; + } + } + + + //Updating User Background + if($array['background_url']) + { + $uquery_field[] = 'background_url'; + $uquery_val[] = $array['background_url']; + } + + if($array['background_color']) + { + $uquery_field[] = 'background_color'; + $uquery_val[] = $array['background_color']; + } + + if($array['background_repeat']) + { + $uquery_field[] = 'background_repeat'; + $uquery_val[] = $array['background_repeat']; + } + + + if(isset($_FILES['background_file']['name'])) + { + $file = $Upload->upload_user_file('b',$_FILES['background_file'],$array['userid']); + if($file) + { + $uquery_field[] = 'background'; + $uquery_val[] = $file; + } + } + + if(!error() && is_array($uquery_field)) + { + $db->update($this->dbtbl['users'],$uquery_field,$uquery_val," userid='".mysql_clean($array['userid'])."'"); + e(lang("usr_upd_succ_msg"),'m'); + } + + + + //updating user profile + if(!error()) + { + $db->update($this->dbtbl['user_profile'],$query_field,$query_val," userid='".mysql_clean($array['userid'])."'"); + e(lang("usr_pof_upd_msg"),'m'); + } + } + + + /** + * Function used to update user avatar and background only + */ + function update_user_avatar_bg($array) + { + global $db,$signup,$Upload; + //Updating User Avatar + if($array['avatar_url']) + { + $uquery_field[] = 'avatar_url'; + $uquery_val[] = mysql_clean($array['avatar_url']); + } + + //Deleting User Avatar + if($array['delete_avatar']=='yes') + { + $file = BASEDIR.'/images/avatars/'.$array['avatar_file_name']; + if(file_exists($file) && $array['avatar_file_name'] !='') + unlink($file); + } + + //Deleting User Bg + if($array['delete_bg']=='yes') + { + $file = BASEDIR.'/images/backgrounds/'.$array['bg_file_name']; + if(file_exists($file) && $array['bg_file_name'] !='') + unlink($file); + } + + + if(isset($_FILES['avatar_file']['name'])) + { + $file = $Upload->upload_user_file('a',$_FILES['avatar_file'],$array['userid']); + if($file) + { + $uquery_field[] = 'avatar'; + $uquery_val[] = $file; + } + } + + + //Updating User Background + if($array['background_url']) + { + $uquery_field[] = 'background_url'; + $uquery_val[] = mysql_clean($array['background_url']); + } + + if($array['background_color']) + { + $uquery_field[] = 'background_color'; + $uquery_val[] = mysql_clean($array['background_color']); + } + + if($array['background_repeat']) + { + $uquery_field[] = 'background_repeat'; + $uquery_val[] = mysql_clean($array['background_repeat']); + } + + + if(isset($_FILES['background_file']['name'])) + { + + $file = $Upload->upload_user_file('b',$_FILES['background_file'],$array['userid']); + if($file) + { + $uquery_field[] = 'background'; + $uquery_val[] = mysql_clean($file); + } + } + + $db->update($this->dbtbl['users'],$uquery_field,$uquery_val," userid='".mysql_clean($array['userid'])."'"); + e(lang("usr_avatar_bg_update"),'m'); + + } + + + /** + * Function used to check weather username exists or not + */ + function username_exists($i) + { + global $db; + $db->select($this->dbtbl['users'],"username"," username='$i'"); + if($db->num_rows>0) + return true; + else + return false; + } + + /** + * function used to check weather email exists or not + */ + function email_exists($i) + { + global $db; + $db->select($this->dbtbl['users'],"email"," email='$i'"); + if($db->num_rows>0) + return true; + else + return false; + } + + + /** + * Function used to get user access log + */ + function get_user_action_log($uid,$limit=NULL) + { + global $db; + $result = $db->select($this->dbtbl['action_log'],"*"," action_userid='$uid'",$limit," date_added DESC"); + if($db->num_rows>0) + return $result; + else + return false; + } + + /** + * Load Custom Profile Field + */ + function load_custom_profile_fields($array) + { + return false; + } + + /** + * Load Custom Signup Field + */ + function load_custom_signup_fields($array) + { + return false; + } + + + /** + * Function used to get channel links + * ie Playlist, favorites etc etc + */ + function get_inner_channel_top_links($u) + { + return array(lang('uploads')=>'uploads',lang('favorites')=>'favorites',lang('contacts')=>'contacts'); + } + + /** + * Function used to get user channel action links + * ie Add to friends, send message etc etc + */ + function get_channel_action_links($u) + { + return array(lang('Send Message')=>'sm',lang('Add as friend')=>'aaf',lang('Block user')=>'bu'); + } + + + + /** + * Function used to get user channel video + */ + function get_user_profile_video($u) + { + global $db,$cbvid; + if(empty($u['profile_video'])&&!$cbvid->video_exists($u)) + { + $u = $this->get_user_profile($u); + } + + if($cbvid->video_exists($u['profile_video'])) + return $cbvid->get_video_details($u['profile_video']); + else + return false; + } + + + /** + * My Account links + */ + function my_account_links() + { + $array = array + ( + 'Account' =>array + ('My Account' => 'myaccount.php', + 'Ban users' => 'edit_account.php?mode=ban_users', + 'Change Password' =>'edit_account.php?mode=change_password', + 'Change Email' =>'edit_account.php?mode=change_email', + ), + 'Profile' =>array + ('Profile Settings' =>'edit_account.php', + 'Change Avatar' => 'edit_account.php?mode=avatar_bg', + 'Change Background' => 'edit_account.php?mode=avatar_bg', + ), + 'Videos' =>array + ( + 'Uploaded Videos'=>'manage_videos.php', + 'Favorite Videos'=>'manage_videos.php?mode=favorites', + ), + 'Messages' => array + ( + 'Inbox' => 'private_message.php?mode=inbox', + 'Notifications' => 'private_message.php?mode=notification', + 'Sent' => 'private_message.php?mode=sent', + 'Compose New'=> 'private_message.php?mode=new_msg', + ) + ); + + return $array; + } + + + /** + * Function used to change email + */ + function change_email($array) + { + global $db; + //function used to change user email + if(!isValidEmail($array['new_email']) || $array['new_email']=='') + e(lang("usr_email_err2")); + elseif($array['new_email']!=$array['cnew_email']) + e(lang('user_email_confirm_email_err')); + elseif(!$this->user_exists($array['userid'])) + e(lang('usr_exist_err')); + else + { + $db->update($this->dbtbl['users'],array('email'),array($array['new_email'])," userid='".$array['userid']."'"); + e(lang("email_change_msg"),"m"); + } + } + + /** + * Function used to ban users + */ + function ban_users($users,$uid=NULL) + { + global $db; + if(!$uid) + $uid = userid(); + $users_array = explode(',',$users); + $new_users = array(); + foreach($users_array as $user) + { + if($user!=username() && !is_numeric($user) && $this->user_exists($user)) + { + $new_users[] = $user; + } + } + if(count($new_users)>0) + { + $new_users = array_unique($new_users); + $banned_users = implode(',',$new_users); + $db->update($this->dbtbl['users'],array('banned_users'),array($banned_users)," userid='$uid'"); + e(lang("user_ban_msg"),"m"); + }else{ + e(lang("no_user_ban_msg"),"m"); + } + } } ?> \ No newline at end of file diff --git a/upload/includes/classes/video.class.php b/upload/includes/classes/video.class.php index dc033ad1..b03f1bae 100644 --- a/upload/includes/classes/video.class.php +++ b/upload/includes/classes/video.class.php @@ -22,6 +22,7 @@ class CBvideo extends CBCategory var $action = ''; // variable used to call action class var $email_template_vars = array(); + var $dbtbl = array('video'=>'video'); /** * __Constructor of CBVideo */ @@ -125,10 +126,12 @@ class CBvideo extends CBCategory /** * Function used to update video */ - function update_video() + function update_video($array=NULL) { global $eh,$Cbucket,$db,$Upload; + + $Upload->validate_video_upload_form(NULL,TRUE); if(empty($eh->error_list)) @@ -146,7 +149,9 @@ class CBvideo extends CBCategory if(count($Upload->custom_form_fields)>0) $upload_fields = array_merge($upload_fields,$Upload->custom_form_fields); - $array = $_POST; + if(!$array) + $array = $_POST; + $vid = $array['videoid']; if(is_array($_FILES)) @@ -196,11 +201,14 @@ class CBvideo extends CBCategory $query .= ','; }*/ - if(has_access('admin_access')) + if(has_access('admin_access') && !empty($array['status'])) { $query_field[] = 'status'; - $query_field[] = 'duration'; $query_val[] = $array['status']; + } + if(has_access('admin_access') && !empty($array['duration'])) + { + $query_field[] = 'duration'; $query_val[] = $array['duration']; } @@ -209,6 +217,9 @@ class CBvideo extends CBCategory e("You are not logged in"); }elseif(!$this->video_exists($vid)){ e("Video deos not exist"); + }elseif(!$this->is_video_owner($vid,userid()) && !has_access('admin_access')) + { + e("You cannot edit this video"); }else{ $db->update('video',$query_field,$query_val," videoid='$vid'"); e("Video details have been updated",m); @@ -227,22 +238,29 @@ class CBvideo extends CBCategory if($this->video_exists($vid)) { + $vdetails = $this->get_video($vid); - //list of functions to perform while deleting a video - $del_vid_funcs = $this->video_delete_functions; - if(is_array($del_vid_funcs)) + + if($this->is_video_owner($vid,userid()) || has_access('admin_access')) { - foreach($del_vid_funcs as $func) + //list of functions to perform while deleting a video + $del_vid_funcs = $this->video_delete_functions; + if(is_array($del_vid_funcs)) { - if(function_exists($func)) + foreach($del_vid_funcs as $func) { - $func($vdetails); + if(function_exists($func)) + { + $func($vdetails); + } } } + //Finally Removing Database entry of video + $db->execute("DELETE FROM video WHERE videoid='$vid'"); + e(lang("class_vdo_del_msg"),m); + }else{ + e(lang("You cannot delete this video")); } - //Finally Removing Database entry of video - $db->execute("DELETE FROM video WHERE videoid='$vid'"); - e(lang("class_vdo_del_msg"),m); }else{ e(lang("class_vdo_del_err")); } @@ -319,31 +337,85 @@ class CBvideo extends CBCategory */ function get_videos($params) { - $cond_array = array(); + global $db; + $limit = $params['limit']; + $order = $params['order']; + + $cond = ""; //Setting Category Condition if($params['category']) { - if(is_array($params['category'])) + if($cond!='') + $cond .= ' AND '; + + $cond .= " ("; + if(!is_array($params['category'])) { - foreach($params['category'] as $cat_params) - { - $cond_array[] = " category ='$cat_params' "; - } - }else{ - $cond_array[] = " category ='".$params['category']."' "; + $cats = explode(',',$params['categgory']); + }else + $cats = $params['category']; + + $count = 0; + foreach($cats as $cat_params) + { + $count ++; + if($count>1) + $cond .=" OR "; + $cond .= " category LIKE '%#$cat_params#%' "; } + + $cond .= ")"; } //date span - switch($param['date_span']) + if($params['date_span']) { - case 'today'; - { - - } + if($cond!='') + $cond .= ' AND '; + $cond .= " ".cbsearch::date_margin("date_added",$params['date_span']); } + //uid + if($params['user']) + { + if($cond!='') + $cond .= ' AND '; + $cond .= " userid='".$params['user']."'"; + } + + $tag_n_title=''; + //Tags + if($params['tags']) + { + if($tag_n_title!='') + $tag_n_title .= ' OR '; + $tag_n_title .= " tags LIKE '%".$params['tags']."%'"; + } + //TITLE + if($params['title']) + { + if($tag_n_title!='') + $tag_n_title .= ' OR '; + $tag_n_title .= " title LIKE '%".$params['tags']."%'"; + } + + if($tag_n_title) + { + if($cond!='') + $cond .= ' AND '; + $cond .= " ($tag_n_title) "; + } + + $result = $db->select('video','*',$cond,$limit,$order); + + + if($params['count_only']) + return $result = $db->count('video','*',$cond); + if($params['assign']) + assign($params['assign'],$result); + else + return $result; } @@ -406,6 +478,8 @@ class CBvideo extends CBCategory $this->action->name = 'video'; $this->action->obj_class = 'cbvideo'; $this->action->check_func = 'video_exists'; + $this->action->type_tbl = $this->dbtbl['video']; + $this->action->type_id_field = 'videoid'; } @@ -509,5 +583,41 @@ class CBvideo extends CBCategory $this->search->search_type['video']['fields'] = $fields; } + + /** + * Function used to update video and set a thumb as default + * @param VID + * @param THUMB NUM + */ + function set_default_thumb($vid,$thumb) + { + global $db,$LANG; + $num = get_thumb_num($thumb); + $file = THUMBS_DIR.'/'.$thumb; + if(file_exists($file)) + { + $db->update("video",array("default_thumb"),array($num)," videoid='$vid'"); + e($LANG['vid_thumb_changed'],m); + }else{ + e($LANG['vid_thumb_change_err']); + } + } + + + /** + * Function used to check weather current user is video owner or not + */ + function is_video_owner($vid,$uid) + { + global $db; + + $result = $db->count($this->dbtbl['video'],'videoid',"videoid='$vid' AND userid='$uid' "); + if($result>0) + return true; + else + return false; + } + + } ?> \ No newline at end of file diff --git a/upload/includes/common.php b/upload/includes/common.php index 440d2bc5..4e18fee2 100644 --- a/upload/includes/common.php +++ b/upload/includes/common.php @@ -66,7 +66,7 @@ if(file_exists(dirname(__FILE__).'/../install/isinstall.php')){ require_once('classes/video.class.php'); require_once('classes/player.class.php'); require_once('classes/cbemail.class.php'); - + require_once('classes/pm.class.php'); require_once 'languages.php'; @@ -93,7 +93,7 @@ if(file_exists(dirname(__FILE__).'/../install/isinstall.php')){ $cbplayer = new CBPlayer(); $cbemail = new CBEmail(); $cbsearch = new CBSearch(); - + $cbpm = new cb_pm(); require 'defined_links.php'; @@ -278,13 +278,7 @@ error_reporting(E_ALL ^E_NOTICE ^E_DEPRECATED); $swfobj = new SWFObject(); //Initializng Userquery class $userquery->init(); - - $is_admin = $userquery->admin_check(); - if ($is_admin == 1) - { - Assign('is_admin',$is_admin); - } - + $cbpm->init(); $thisurl = curPageURL(); Assign('THIS_URL', $thisurl); @@ -347,13 +341,6 @@ error_reporting(E_ALL ^E_NOTICE ^E_DEPRECATED); require('modules.php'); -//Checking what permissions do logged in user have -if(user_id()) -{ - $userquery->permission = $userquery->get_user_level(userid()); -}else - $userquery->permission = $userquery->get_user_level(4,TRUE); - //Checking Website Template $Cbucket->set_the_template(); @@ -379,6 +366,7 @@ $Smarty->assign_by_ref('cbtpl',$cbtpl); $Smarty->assign_by_ref('cbobjects',$cbobjects); $Smarty->assign_by_ref('cbplayer',$cbplayer); $Smarty->assign_by_ref('cbsearch',$cbsearch); +$Smarty->assign_by_ref('cbpm',$cbpm); /* REGISERTING FUNCTION FOR SMARTY TEMPLATES @@ -401,6 +389,9 @@ $Smarty->register_function('FlashPlayer','flashPlayer'); $Smarty->register_function('HQFlashPlayer','HQflashPlayer'); $Smarty->register_function('link','cblink'); $Smarty->register_function('show_share_form','show_share_form'); +$Smarty->register_function('lang','smarty_lang'); +$Smarty->register_function('get_videos','get_videos'); +$Smarty->register_function('private_message','private_message'); $Smarty->register_modifier('SetTime','SetTime'); $Smarty->register_modifier('getname','getname'); @@ -411,6 +402,13 @@ $Smarty->register_modifier('post_form_val','post_form_val'); $Smarty->register_modifier('request_form_val','request_form_val'); $Smarty->register_modifier('get_thumb_num','get_thumb_num'); $Smarty->register_modifier('ad','ad'); +$Smarty->register_modifier('get_user_level','get_user_level'); +$Smarty->register_modifier('is_online','is_online'); +$Smarty->register_modifier('get_age','get_age'); +$Smarty->register_modifier('outgoing_link','outgoing_link'); +$Smarty->register_modifier('nicetime','nicetime'); +$Smarty->register_modifier('country','get_country'); + /** @@ -418,6 +416,7 @@ $Smarty->register_modifier('ad','ad'); */ $cbvideo->init_search(); + /* * 123465798 */ diff --git a/upload/includes/config.inc.php b/upload/includes/config.inc.php index 2387b83d..d497b739 100644 --- a/upload/includes/config.inc.php +++ b/upload/includes/config.inc.php @@ -21,10 +21,6 @@ Assign('admtheme',BASEURL.'/'.ADMINDIR.'/'.TEMPLATEFOLDER.'/'.TEMPLATE.'/theme') Assign('template_dir',TEMPLATEDIR); Assign('style_dir',LAYOUT); -if($userquery->logincheck2()){ -Assign('logged_user',$_SESSION['username']); -Assign('new_msgs',$userquery->GetNewMsgs($_SESSION['username'])); -} //Checking Website is closed or not if($row['closed'] == 1){ diff --git a/upload/includes/dbconnect.php b/upload/includes/dbconnect.php index 3f4bca82..2af30246 100644 --- a/upload/includes/dbconnect.php +++ b/upload/includes/dbconnect.php @@ -31,8 +31,6 @@ $db->debug = false; $db->charpage = 'cp_utf8'; $db->charset = 'utf8'; - $db->Execute("set names 'utf8'"); - $db->Execute("set COLLATION_CONNECTION = 'utf8_general_ci'"); if(!$db->Connect($DBHOST, $DBUSER, $DBPASS, $DBNAME)) { exit($db->ErrorMsg()); diff --git a/upload/includes/functions.php b/upload/includes/functions.php index 4bbf6261..7f15f101 100644 --- a/upload/includes/functions.php +++ b/upload/includes/functions.php @@ -14,6 +14,7 @@ #################################################################### */ + define("SHOW_COUNTRY_FLAG",TRUE); require 'define_php_links.php'; include_once 'upload_forms.php'; @@ -126,7 +127,7 @@ } function Assign($name,$value){ - CBTemplate::assign($name,$value); + CBTemplate::assign($name,$value); } //Funtion of Random String @@ -206,6 +207,9 @@ $to = $array['to']; $from = $array['from']; + if($array['nl2br']) + $content = nl2br($content); + //Setting Boundary $mime_boundary = "----ClipBucket Emailer----".md5(time()); @@ -223,22 +227,29 @@ $headers .= "X-Mailer: ClipBucket v2 \r\n"; //Starting Message - $message = "--$mime_boundary--\n"; - $message .= "Content-Type: text/html; charset=UTF-8\n"; - $message .= "Content-Transfer-Encoding: 8bit\n\n"; + if($array['user_boundary']) + { + $message = "--$mime_boundary--\n"; + $message .= "Content-Type: text/html; charset=UTF-8\n"; + $message .= "Content-Transfer-Encoding: 8bit\n\n"; + } + # CHecking Content if(preg_match('//',$content,$matches)) { - if(empty($matches[0])) + if(empty($matches[1])) { $content = wrap_email_content($content); } } $message .= $content; - //Ending Message - $message .= "--$mime_boundary--\n\n"; - + if($array['user_boundary']) + { + //Ending Message + $message .= "--$mime_boundary--\n"; + } + $email = mail ($to,$subject,$message,$headers); if( $email == true ){ return true; @@ -362,12 +373,13 @@ //Function Used To Validate Email function isValidEmail($email){ - $pattern = "^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$"; - if (eregi($pattern, $email)){ + $pattern = "/[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$/"; + preg_match($pattern, $email,$matches); + if ($matches[0]!=''){ return true; } else { - return true; + return false; } } @@ -430,7 +442,7 @@ * @param ARRAY video_details, or videoid will also work */ - function get_thumb($vdetails,$num='default',$multi=false,$count=false,$return_full_path=true){ + function get_thumb($vdetails,$num='default',$multi=false,$count=false,$return_full_path=true,$return_big=true){ global $db,$Cbucket,$myquery; $num = $num ? $num : 'default'; #checking what kind of input we have @@ -498,10 +510,13 @@ $thumb_parts = explode('/',$thumb); $thumb_file = $thumb_parts[count($thumb_parts)-1]; - if($return_full_path) - $thumbs[] = THUMBS_URL.'/'.$thumb_file; - else - $thumbs[] = $thumb_file; + if(!is_big($thumb_file) || $return_big) + { + if($return_full_path) + $thumbs[] = THUMBS_URL.'/'.$thumb_file; + else + $thumbs[] = $thumb_file; + } } if(count($thumbs)==0) @@ -533,6 +548,19 @@ } } + + /** + * Function used to check weaether given thumb is big or not + */ + function is_big($thumb_file) + { + $total = strlen($thumb_file); + $name = substr($thumb_file,$strlen-7,3); + if($name=='big') + return true; + else + return false; + } function GetThumb($vdetails,$num='default',$multi=false,$count=false) { @@ -861,7 +889,7 @@ $fields_query .= $flds[$i]."=".$val.""; } if($total_fields!=$count) - $fields_query .= ','; + $fields_query .= ' AND '; } //Complete Query $query = "DELETE FROM $tbl WHERE $fields_query $ep"; @@ -958,6 +986,7 @@ function e($msg=NULL,$type='e',$id=NULL) { global $eh; + if(!empty($msg)) return $eh->e($msg,$type,$id); } @@ -1330,8 +1359,8 @@ $flv_url = $file; $embed = $param['embed']; $code = $param['code']; - $height = $param['height'] = $param['height'] ? $param['height'] : 360; - $width = $param['width'] = $param['width'] ? $param['width'] : 450; + $height = $param['height'] = $param['height'] ? $param['height'] : config('player_height'); + $width = $param['width'] = $param['width'] ? $param['width'] : config('player_width'); if(count($Cbucket->actions_play_video)>0) { @@ -1545,9 +1574,13 @@ function input_value($params,&$Smarty) { $input = $params['input']; - + $value = $input['value']; + if($input['value_field']=='checked') + $value = $input['checked']; + if($input['return_checked']) + return $input['checked']; if(function_exists($input['display_function'])) - return $input['display_function']($input['value']); + return $input['display_function']($value); else return $input['value']; } @@ -1662,6 +1695,7 @@ $ClipBucket->template_files[] = $file; } + /** * Function used to call display */ @@ -1811,8 +1845,8 @@ if($filter) return form_val($_GET[$val]); else - $_GET[$val]; - } + return $_GET[$val]; + }function get($val){ return get_form_val($val); } /** * Function used to get value form $_POST @@ -1825,6 +1859,7 @@ $_POST[$val]; } + /** * Function used to get value from $_REQUEST */ @@ -1843,7 +1878,17 @@ function lang($var) { global $LANG; + if($LANG[$var]) return $LANG[$var]; + else + return $var; + } + function smarty_lang($param) + { + if($param['assign']=='') + return lang($param['code']); + else + assign($param['assign'],lang($param['code'])); } @@ -2201,6 +2246,252 @@ $records = $total/$count; return $total_pages = round($records+0.49,0); } + + /** + * Function used to return level name + * @param levelid + */ + function get_user_level($id) + { + global $userquery; + return $userquery->usr_levels[$id]; + } + + + + /** + * This function used to check + * weather user is online or not + * @param : last_active time + * @param : time margin + */ + function is_online($time,$margin='5') + { + $margin = $margin*60; + $active = strtotime($time); + $curr = time(); + $diff = $curr - $active; + if($diff > $margin) + return 'offline'; + else + return 'online'; + } + + + /** + * ClipBucket Form Validator + * this function controls the whole logic of how to operate input + * validate it, generate proper error + */ + function validate_cb_form($input,$array) + { + + if(is_array($input)) + foreach($input as $field) + { + $field['name'] = formObj::rmBrackets($field['name']); + + //pr($field); + $title = $field['title']; + $val = $array[$field['name']]; + $req = $field['required']; + $invalid_err = $field['invalid_err']; + $function_error_msg = $field['function_error_msg']; + if(is_string($val)) + $length = strlen($val); + $min_len = $field['min_length']; + $min_len = $min_len ? $min_len : 0; + $max_len = $field['max_length'] ; + $rel_val = $array[$field['relative_to']]; + + if(empty($invalid_err)) + $invalid_err = sprintf("Invalid '%s'",$title); + if(is_array($array[$field['name']])) + $invalid_err = ''; + + //Checking if its required or not + if($req == 'yes') + { + if(empty($val) && !is_array($array[$field['name']])) + { + e($invalid_err); + $block = true; + }else{ + $block = false; + } + } + $funct_err = is_valid_value($field['validate_function'],$val); + if($block!=true) + { + //Checking Syntax + if(!$funct_err) + { + if(!empty($function_error_msg)) + e($function_error_msg); + elseif(!empty($invalid_err)) + e($invalid_err); + }elseif(!is_valid_syntax($field['syntax_type'],$val)) + { + if(!empty($invalid_err)) + e($invalid_err); + } + elseif(isset($max_len)) + { + if($length > $max_len || $length < $min_len) + e(sprintf(" please enter '%s' value between '%s' and '%s'", + $title,$field['min_length'],$field['max_length'])); + }elseif(function_exists($field['db_value_check_func'])) + { + $db_val_result = $field['db_value_check_func']($val); + if($db_val_result != $field['db_value_exists']) + if(!empty($field['db_value_err'])) + e($field['db_value_err']); + elseif(!empty($invalid_err)) + e($invalid_err); + }elseif($field['relative_type']!='') + { + switch($field['relative_type']) + { + case 'exact': + { + if($rel_val != $val) + { + if(!empty($field['relative_err'])) + e($field['relative_err']); + elseif(!empty($invalid_err)) + e($invalid_err); + } + } + break; + } + } + } + } + } + /** + * Function used to check weather tempalte file exists or not + * input path to file + */ + function template_file_exists($file,$dir) + { + if(!file_exists($dir.'/'.$file) && !empty($file)) + { + echo sprintf(lang("temp_file_load_err"),$file,$dir); + return false; + }else + return true; + } + + /** + * Function used to count age from date + */ + function get_age($input) + { + $time = strtotime($input); + $iMonth = date("m",$time); + $iDay = date("d",$time); + $iYear = date("Y",$time); + + $iTimeStamp = (mktime() - 86400) - mktime(0, 0, 0, $iMonth, $iDay, $iYear); + $iDays = $iTimeStamp / 86400; + $iYears = floor($iDays / 365 ); + return $iYears; + } + + + + + /** + * Function used to check time span + * A time difference function that outputs the + * time passed in facebook's style: 1 day ago, + * or 4 months ago. I took andrew dot + * macrobert at gmail dot com function + * and tweaked it a bit. On a strict enviroment + * it was throwing errors, plus I needed it to + * calculate the difference in time between + * a past date and a future date. + * thanks to yasmary at gmail dot com + */ + function nicetime($date) + { + if(empty($date)) { + return lang('no_date_provided'); + } + + $periods = array(lang("second"), lang("minute"), lang("hour"), lang("day"), lang("week"), lang("month"), lang("year"), lang("decade")); + $lengths = array(lang("60"),lang("60"),lang("24"),lang("7"),lang("4.35"),lang("12"),lang("10")); + + $now = time(); + $unix_date = strtotime($date); + + // check validity of date + if(empty($unix_date)) { + return lang("bad_date"); + } + + // is it future date or past date + if($now > $unix_date) { + $difference = $now - $unix_date; + $tense = "ago"; + + } else { + $difference = $unix_date - $now; + $tense = "from now"; + } + + for($j = 0; $difference >= $lengths[$j] && $j < count($lengths)-1; $j++) { + $difference /= $lengths[$j]; + } + + $difference = round($difference); + + if($difference != 1) { + $periods[$j].= "s"; + } + + return "$difference $periods[$j] {$tense}"; + } + + + /** + * Function used to format outgoing link + */ + function outgoing_link($out) + { + preg_match("/http/",$out,$matches); + if(empty($matches[0])) + $out = "http://".$out; + return ''.$out.''; + } + + /** + * Function used to get country via country code + */ + function get_country($code) + { + global $db; + $result = $db->select("countries","name_en,iso2"," iso2='$code' OR iso3='$code'"); + if($db->num_rows>0) + { + $flag = ''; + $result = $result[0]; + if(SHOW_COUNTRY_FLAG) + $flag = ' '; + return $flag.$result['name_en']; + }else + return false; + } + + + /** + * function used to get vidos + */ + function get_videos($param) + { + global $cbvideo; + return $cbvideo->get_videos($param); + } ?> \ No newline at end of file diff --git a/upload/includes/plugin.functions.php b/upload/includes/plugin.functions.php index 5302faaa..62dfa17d 100644 --- a/upload/includes/plugin.functions.php +++ b/upload/includes/plugin.functions.php @@ -165,7 +165,7 @@ - /** + /** * Function used to add custom upload fields * In this you will provide an array that has a complete * details of the field such as 'name',validate_func etc diff --git a/upload/includes/plugins_functions.php b/upload/includes/plugins_functions.php index 6ff6b83f..ac28aeb0 100644 --- a/upload/includes/plugins_functions.php +++ b/upload/includes/plugins_functions.php @@ -72,6 +72,17 @@ return $title; } + + /** + * Function used to display Private Message + */ + function private_message($array) + { + global $cbpm; + $array = $array['pm']; + echo $array['message_content']; + $cbpm->parse_attachments($array['message_attachments']); + } ?> \ No newline at end of file diff --git a/upload/includes/whois/whois.php b/upload/includes/whois/whois.php new file mode 100644 index 00000000..fe3422ca --- /dev/null +++ b/upload/includes/whois/whois.php @@ -0,0 +1,120 @@ +.*?#', + '#.*?#', + '#.*?#', + '#page_redir(); +pr($userquery); + if(isset($_GET['cb_ver']) && $is_admin) { $msg = "ClipBucket ".CB_VERSION.""; diff --git a/upload/js/functions.js b/upload/js/functions.js index c38d2174..c7998367 100644 --- a/upload/js/functions.js +++ b/upload/js/functions.js @@ -275,3 +275,16 @@ "swfobject/expressInstall.swf", flashvars , params); } + + + /** + * Function used to delete video + */ + function delete_video(obj,vid,msg,url) + { + $("#"+obj+'-'+vid).click(function () { + if (confirm(msg)) { + document.location = url; + } + }); + } diff --git a/upload/js/jquery_plugs/compressed/jquery.scrollTo-min.js b/upload/js/jquery_plugs/compressed/jquery.scrollTo-min.js new file mode 100644 index 00000000..73a33418 --- /dev/null +++ b/upload/js/jquery_plugs/compressed/jquery.scrollTo-min.js @@ -0,0 +1,11 @@ +/** + * jQuery.ScrollTo - Easy element scrolling using jQuery. + * Copyright (c) 2007-2009 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com + * Dual licensed under MIT and GPL. + * Date: 5/25/2009 + * @author Ariel Flesler + * @version 1.4.2 + * + * http://flesler.blogspot.com/2007/10/jqueryscrollto.html + */ +;(function(d){var k=d.scrollTo=function(a,i,e){d(window).scrollTo(a,i,e)};k.defaults={axis:'xy',duration:parseFloat(d.fn.jquery)>=1.3?0:1};k.window=function(a){return d(window)._scrollable()};d.fn._scrollable=function(){return this.map(function(){var a=this,i=!a.nodeName||d.inArray(a.nodeName.toLowerCase(),['iframe','#document','html','body'])!=-1;if(!i)return a;var e=(a.contentWindow||a).document||a.ownerDocument||a;return d.browser.safari||e.compatMode=='BackCompat'?e.body:e.documentElement})};d.fn.scrollTo=function(n,j,b){if(typeof j=='object'){b=j;j=0}if(typeof b=='function')b={onAfter:b};if(n=='max')n=9e9;b=d.extend({},k.defaults,b);j=j||b.speed||b.duration;b.queue=b.queue&&b.axis.length>1;if(b.queue)j/=2;b.offset=p(b.offset);b.over=p(b.over);return this._scrollable().each(function(){var q=this,r=d(q),f=n,s,g={},u=r.is('html,body');switch(typeof f){case'number':case'string':if(/^([+-]=)?\d+(\.\d+)?(px|%)?$/.test(f)){f=p(f);break}f=d(f,this);case'object':if(f.is||f.style)s=(f=d(f)).offset()}d.each(b.axis.split(''),function(a,i){var e=i=='x'?'Left':'Top',h=e.toLowerCase(),c='scroll'+e,l=q[c],m=k.max(q,i);if(s){g[c]=s[h]+(u?0:l-r.offset()[h]);if(b.margin){g[c]-=parseInt(f.css('margin'+e))||0;g[c]-=parseInt(f.css('border'+e+'Width'))||0}g[c]+=b.offset[h]||0;if(b.over[h])g[c]+=f[i=='x'?'width':'height']()*b.over[h]}else{var o=f[h];g[c]=o.slice&&o.slice(-1)=='%'?parseFloat(o)/100*m:o}if(/^\d+$/.test(g[c]))g[c]=g[c]<=0?0:Math.min(g[c],m);if(!a&&b.queue){if(l!=g[c])t(b.onAfterFirst);delete g[c]}});t(b.onAfter);function t(a){r.animate(g,j,b.easing,a&&function(){a.call(this,n,b)})}}).end()};k.max=function(a,i){var e=i=='x'?'Width':'Height',h='scroll'+e;if(!d(a).is('html,body'))return a[h]-d(a)[e.toLowerCase()]();var c='client'+e,l=a.ownerDocument.documentElement,m=a.ownerDocument.body;return Math.max(l[h],m[h])-Math.min(l[c],m[c])};function p(a){return typeof a=='object'?a:{top:a,left:a}}})(jQuery); \ No newline at end of file diff --git a/upload/manage_videos.php b/upload/manage_videos.php index 1c76d1c0..22a2350f 100644 --- a/upload/manage_videos.php +++ b/upload/manage_videos.php @@ -1,107 +1,104 @@ logincheck(); -$pages->page_redir(); -$user = $_SESSION['username']; +$udetails = $userquery->get_user_details(userid()); +assign('user',$udetails); +assign('p',$userquery->get_user_profile($udetails['userid'])); -//Removing A Video -if(!empty($_POST['delete_videoid']) && !isset($_POST['delete_videos'])){ -$videoid = $_POST['delete_videoid']; -$msg = $myquery->DeleteUserVideo($videoid ,$_SESSION['username']); + +$mode = $_GET['mode']; + +$page = mysql_clean($_GET['page']); +$get_limit = create_query_limit($page,VLISTPP); + +switch($mode) +{ + case 'uploaded': + default: + { + assign('mode','uploaded'); + + //Deleting Video + if(!empty($_GET['vid_delete'])) + { + $video = mysql_clean($_GET['vid_delete']); + $cbvideo->delete_video($video); + } + + //Deleting Videos + if(isset($_POST['delete_videos'])) + { + for($id=0;$id<=VLISTPP;$id++) + { + $cbvideo->delete_video($_POST['check_vid'][$id]); + } + $eh->flush(); + e(lang("vdo_multi_del_erro"),m); + } + + //Getting Video List + $vid_array = array('user'=>$udetails['userid'],'limit'=>$get_limit); + if(get('query')!='') + { + $vid_array['title'] = mysql_clean(get('query')); + $vid_array['tags'] = mysql_clean(get('query')); + } + + $videos = get_videos($vid_array); + Assign('uservids', $videos); + + //Collecting Data for Pagination + $vid_array['count_only'] = true; + $total_rows = get_videos($vid_array); + $total_pages = count_pages($total_rows,VLISTPP); + + //Pagination + $pages->paginate($total_pages,$page); + + } + break; + + + case 'favorites': + { + assign('mode','favorites'); + //Removing video from favorites + if(!empty($_GET['vid_delete'])) + { + $video = mysql_clean($_GET['vid_delete']); + $cbvideo->action->remove_favorite($video); + } + //Removing Multiple Videos + if(isset($_POST['delete_fav_videos'])) + { + for($id=0;$id<=VLISTPP;$id++) + { + $cbvideo->delete_video($_POST['check_vid'][$id]); + } + $eh->flush(); + e(lang("vdo_multi_del_fav_msg"),m); + } + if(get('query')!='') + { + $condi = " (video.title LIKE '%".mysql_clean(get('query'))."%' OR video.tags LIKE '%".mysql_clean(get('query'))."%' )"; + } + $videos = $cbvid->action->get_favorites(userid(),$get_limit,$condi); + Assign('uservids', $videos); + } + break; } -//Removing Multiple Videos -if(isset($_POST['delete_videos'])){ -$query = mysql_query("SELECT * FROM video WHERE username = '".$_SESSION['username']."' "); -while($data = mysql_fetch_array($query)){ - if(@$_POST[$data['videokey']] == 'yes'){ - $myquery->DeleteUserVideo($data['videoid'] ,$_SESSION['username']); - } -} -$msg = $LANG['vdo_del_selected']; -} - -//Getting Videos List - $limit = VLISTPP; - Assign('limit',$limit); - @$page = clean($_GET['page']); - if(empty($page) || $page == 0 || !is_numeric($page)){ - $page = 1; - } - $from = $page-1; - $from = $from*$limit; - $query_limit = "limit $from,$limit"; - - //Getting Order - $orders = array( - 'mr' => 'ORDER by date_added DESC', - 'fr' => "AND featured = 'yes'", - 'mv' => "ORDER by views DESC" - ); - @$order = mysql_clean($_GET['order']); - @$orderby = $orders[$order]; - if(empty($orderby)){ - $orderby = "ORDER BY date_added DESC"; - } - $sql = "SELECT * FROM video WHERE username='".$user."' $orderby $query_limit "; - $sql_p = "SELECT * FROM video WHERE username='".$user."' "; - if($order=='fr'){ - $sql_p = "SELECT * FROM video WHERE username='".$user."' AND featured = 'yes'"; - } - $data = $db->Execute($sql); - $videos = $data->getrows(); - $total_videos = $data->recordcount()+0; - - for($id=0;$id<$total_videos;$id++){ - $query=mysql_query("SELECT * FROM video_detail WHERE flv='".$videos[$id]['flv']."'"); - $data = mysql_fetch_array($query); - $videos[$id]['thumb'] = GetThumb($videos[$id]['flv']); - $videos[$id]['duration'] = SetTime($videos[$id]['duration']); - $videos[$id]['raw_file'] = $data['original'] ? $data['original'] : 'No Raw File'; - $videos[$id]['show_rating'] = pullRating($videos[$id]['videoid'],false,false,false); - $videos[$id]['url'] = VideoLink($videos[$id]['videokey'],$videos[$id]['title']); - } - - Assign('videos',$videos); - Assign('total_videos',$total_videos); -//Pagination - $query = mysql_query($sql_p); - Assign('grand_total',mysql_num_rows($query)); - $total_rows = mysql_num_rows($query); - $page_id=1; - $id = 1; - $records = $total_rows/$limit; - $pages = round($records+0.49,0); - -$show_pages = ShowPagination($pages,$page,'?order='.$order); -Assign('show_pages',$show_pages); - -Assign('link','?order='.$order); -Assign('pages',$pages); -Assign('cur_page',$page); -Assign('nextpage',$page+1); -Assign('prepage',$page-1); -Assign('total_pages',$page_id); - - -subtitle('manage_video'); -@Assign('msg',$msg); -if(@$_GET['show']!='videos'){ -Template('header.html'); -Template('message.html'); -Template('manage_videos.html'); -Template('footer.html'); -}else{ -Assign('full_view','no'); -Template('manage_videos.html'); -} +template_files('manage_videos.html'); +display_it(); ?> \ No newline at end of file diff --git a/upload/myaccount.php b/upload/myaccount.php index 6b02568e..61873980 100644 --- a/upload/myaccount.php +++ b/upload/myaccount.php @@ -1,35 +1,17 @@ logincheck(); -$pages->page_redir(); - -//Get User Details - $user = $_SESSION['userid']; - $username = $_SESSION['username']; - $data = $userquery->GetUserData($user); - -//Get Number Of Objects Of User - $data['uploaded_watched'] = $myquery->GetUploadedWatched($username); - $data['subscribed_user'] = $myquery->GetSubscribers($username); - $data['user_subscriptions'] = $myquery->GetSubscriptions($username); - $data['total_channel_comments'] = $myquery->GetTotalChannelComments($username); - $data['total_favourites'] = $myquery->GetTotalFavourites($user); - $data['create_groups'] = $myquery->GetUserCreateGroups($username); - $data['joined_groups'] = $myquery->GetUserJoinGroups($username); - Assign('data',$data); - -subtitle('my_account'); -@Assign('msg',$msg); -Template('header.html'); -Template('message.html'); -Template('myaccount.html'); -Template('footer.html'); +assign('user',$userquery->get_user_details(userid())); +template_files('myaccount.html'); +display_it(); ?> \ No newline at end of file diff --git a/upload/player/cbplayer/cbplayer.plug.php b/upload/player/cbplayer/cbplayer.plug.php index fdb94430..b81e217c 100644 --- a/upload/player/cbplayer/cbplayer.plug.php +++ b/upload/player/cbplayer/cbplayer.plug.php @@ -46,7 +46,7 @@ if(!function_exists('cbplayer')) $code .= " allowFullScreen: \"true\"\n"; $code .= "};\n"; $code .= "swfobject.embedSWF(\"".PLAYER_URL."/cbplayer/videoPlayer.swf\", - \"".$data['player_div']."\", \"".config('player_width')."\", \"".config('player_height')."\", \"9.0.115\", + \"".$data['player_div']."\", \"".$data['width']."\", \"".$data['height']."\", \"9.0.115\", \"swfobject/expressInstall.swf\", flashvars , params)"; return $code; diff --git a/upload/player/flow_player/flow_player.php b/upload/player/flow_player/flow_player.php index 9c756735..295cdbe3 100644 --- a/upload/player/flow_player/flow_player.php +++ b/upload/player/flow_player/flow_player.php @@ -37,7 +37,7 @@ if(!function_exists('flowplayer')) $code = ''; if($vid_file) { - $code .= "swfobject.embedSWF(\"".PLAYER_URL.'/flow_player/flowplayer.swf'."\", \"videoPlayer\", \"500\", \"320\", \"9.0.0\", null, { \n"; + $code .= "swfobject.embedSWF(\"".PLAYER_URL.'/flow_player/flowplayer.swf'."\", \"videoPlayer\", \"".$vdata['width']."\", \"".$vdata['height']."\", \"9.0.0\", null, { \n"; $code .= "config: \"{'clip': '".BASEURL.'/files/videos/'.$vid_file."' }}\"\n" ; $code .= "} \n"; $code .= "); \n"; diff --git a/upload/plugins/cb_bbcodes/cb_bbcode.php b/upload/plugins/cb_bbcodes/cb_bbcode.php index a30e3a91..6cbf37fd 100644 --- a/upload/plugins/cb_bbcodes/cb_bbcode.php +++ b/upload/plugins/cb_bbcodes/cb_bbcode.php @@ -39,11 +39,13 @@ if(!function_exists('bb_to_html')) } //Registering Action that will be applied while displaying comment and or description -register_action(array('bb_to_html'=>array('comment','description'))); +register_action(array('bb_to_html'=>array('comment','description','pm_compose_box'))); //Registerin Anchors , that will be displayed before compose boxes register_anchor("",'before_compose_box'); register_anchor("",'before_reply_compose_box'); register_anchor("",'before_desc_compose_box'); +register_anchor("",'before_pm_compose_box'); + //Adding JS Code $Cbucket->addJS(array('bbcode_js/ed.js'=>'global')); //Creating Menu In Admin Panel diff --git a/upload/private_message.php b/upload/private_message.php new file mode 100644 index 00000000..a7be3ac6 --- /dev/null +++ b/upload/private_message.php @@ -0,0 +1,162 @@ +logincheck(); +$udetails = $userquery->get_user_details(userid()); +assign('user',$udetails); +assign('p',$userquery->get_user_profile($udetails['userid'])); + + +$mode = $_GET['mode']; + +//Deleting Multple Message +if(isset($_POST['delete_pm'])) +{ + if($mode=='inbox' || $mode =='notification') + $box = 'in'; + else + $box = 'out'; + + $total = count($_POST['msg_id']); + for($pms=0;$pms<$total;$pms++) + { + if(!empty($_POST['msg_id'][$pms])) + { + $cbpm->delete_msg($_POST['msg_id'][$pms],userid(),$box); + } + + $eh->flush(); + e(lang('private_messags_deleted'),'m'); + } +} + + + +switch($mode) +{ + case 'inbox': + default: + { + + assign('mode','inbox'); + + //Deleting Message + if($_GET['delete_mid']) + { + $mid = mysql_clean($_GET['delete_mid']); + $cbpm->delete_msg($mid,userid()); + } + + //Getting Message + if($_GET['mid']) + { + $mid = mysql_clean($_GET['mid']); + $pr_msg = $cbpm->get_inbox_message($mid,userid()); + if($pr_msg['message_status'] =='unread') + $cbpm->set_message_status($mid,'read'); + assign('pr_msg',$pr_msg); + } + + //Get User Messages + assign('user_msgs',$cbpm->get_user_inbox_messages(userid())); + } + break; + + case 'sent': + { + assign('mode','sent'); + + + //Deleting Message + if($_GET['delete_mid']) + { + $mid = mysql_clean($_GET['delete_mid']); + $cbpm->delete_msg($mid,userid(),'out'); + } + + //Getting Message + if($_GET['mid']) + { + $mid = mysql_clean($_GET['mid']); + assign('pr_msg',$cbpm->get_outbox_message($mid,userid())); + } + + //Get User Messages + assign('user_msgs',$cbpm->get_user_outbox_messages(userid())); + } + + break; + + case 'notification': + { + + assign('mode','notification'); + + //Deleting Message + if($_GET['delete_mid']) + { + $mid = mysql_clean($_GET['delete_mid']); + $cbpm->delete_msg($mid,userid()); + } + + //Getting Message + if($_GET['mid']) + { + $mid = mysql_clean($_GET['mid']); + assign('pr_msg',$cbpm->get_inbox_message($mid,userid())); + } + + //Get User Messages + assign('user_msgs',$cbpm->get_user_notification_messages(userid())); + } + break; + + case 'new_msg': + case 'compose': + { + assign('mode','new_msg'); + + //Checkking If reply + if($_GET['reply']!='') + { + $mid = mysql_clean($_GET['reply']); + if(!isset($_POST['send_message']) && $cbpm->is_reply($mid,userid())) + { + $reply_msg = $cbpm->get_inbox_message($mid,userid()); + $_POST['to'] = $userquery->get_user_field_only($reply_msg['message_from'],'username'); + $_POST['subj'] = "Re:".$reply_msg['message_subject']; + } + } + + //sending message + if(isset($_POST['send_message'])) + { + $array = $_POST; + $array['reply_to'] = mysql_clean($_GET['reply']); + $array['is_pm'] = true; + $array['from'] = userid(); + $cbpm->send_pm($array); + + if(!error()) + $_POST = ''; + } + } + +} + +template_files('private_message.html'); +display_it(); +?> \ No newline at end of file diff --git a/upload/styles/cbv2/images/blocks.png b/upload/styles/cbv2/images/blocks.png new file mode 100644 index 0000000000000000000000000000000000000000..cd7490cccfc09eb47fb4ecc055d372c8c66b57be GIT binary patch literal 2196 zcmeHJc~BBq7$>Kel2Xe}Oj8>zZ4x!p)I2&&E05JQ4+0WtHBAH5B@aB-*8!F9`jw#l7sr$6`2y!XEO&flBw_szVt^B!k+ zC~GML0Dv7X=bXF&fK9jm+FO;@G^*TtmMxegK`z2F!!6fu9tnY^Lg@Iy`Q#CMk7>X1{J?WY9)hF#OSw z#n~GVO-xcL{O0mrwzRK4VWn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nLcF)=AADL6PdHa0dUCMF{zBQP*9EiElNIyx#UDkmo=G&D3M zBqSgpAU8KRJ3BifA|g3CIWsdetqi-o0001YNklPTxg`S9F?goW73^V|2JjhhKD9M2AguI7NqPbQq$;IXXG=4 diff --git a/upload/styles/cbv2/images/icons.png b/upload/styles/cbv2/images/icons.png index 3c1d126f8a2b1849aaa450a09f90c7d941afc941..36c8815d33f24b4d6b25135d13773e3e8f677e07 100644 GIT binary patch literal 6706 zcmeHMXH?V6w*MgRR3P(Z>7^Fyx z^hk?GAxIYjgdRx<1Oka9p(T(!URm$G5AVx;>wdgz&8(Td=QlHZ?=^eR+B2{2SeYF< zpl|>HfJ5dtuipiLUA&$8df(n1j$KVEai@_FHnj`B7vL2f<`xJ8OgsbJVJFR>xOv0w z!rVL~5S=i?9n6sVb(8zy<4aTf!|$)QY|Ma9{c_rJ6ei`EZzp^G2)Z%W=YxcAA@6S4 zns1^1x_!mNCb#VgGm*VRUFZ>$4;A;-G*+?rgx%O@7A7X@&+hyxeGuX%@rb4W)qUSD zzaBl>%oZ3Dl>2fr^`RbHJ?x%L?K=0L4sU$26Qj})f%j7iJMr~Atp7D#$2;(E*O~YK zHaO>TGqc-wGIX~qxlB5YkeR&|ts;K{{+WMJwPoYyySlvuSZ;llRi|85qC!LNmieyx z4&Nzw{mo61LbcJJPR3t}YUL!>C#yo)u)O*H1Fq!m>-^-DCyazxN$Z{ut6_{%6Q|40(U-;{M226#(G!Oun(=&U5?Okym-4 zaM|JzpQE|iv&6*0G8*mK<(0w7LQS8==5H=_BR6)t%I<|aRk|Xy(yt$@OfI>nce=sk z`d8)7mcJ%Qjgh8p9M7>j`048E(}96$^ep9uu}x^TlfzKTnKeJV1;x{cm{QuZrigPb zpFcR2J#>tGT83X?NWMX*wXATGBUZHv%qE)gb06yw^wCUBUd!h28u)63wB;G^xrqU4 z&0%-*v=;1-j{$ys@HZ80cM7WI`0CC~am>?IMrN~tx+tYRhH>kGb{C5q4gGhlzGa zdskt?83-hT)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v|t7+hvtNxBs=Bw!u|ayZe=(B?+5t^=~aH@qdQ^0000get_comments($id,$type)} -{foreach from=$comments item=comment} +{section loop=$comments name=comment}
- {if $comment.userid !='' && $comment.userid!=0} - {assign var=name value=$userquery->get_user_field($comment.userid,username)}{$name.username} + {if $comments[comment].userid !='' && $comments[comment].userid!=0} + {assign var=name value=$userquery->get_user_field($comments[comment].userid,username)}{$name.username} {else} - {$comment.anonym_name} + {$comments[comment].anonym_name} {/if} - wrote on {$comment.date_added|date_format}
- {$comment.comment|comment} + wrote on {$comments[comment].date_added|date_format}
+ {$comments[comment].comment|comment}
-{/foreach} \ No newline at end of file +{sectionelse} +
+ No Comments +
+{/section} \ No newline at end of file diff --git a/upload/styles/cbv2/layout/blocks/manage/account_head.html b/upload/styles/cbv2/layout/blocks/manage/account_head.html new file mode 100644 index 00000000..c4a151b8 --- /dev/null +++ b/upload/styles/cbv2/layout/blocks/manage/account_head.html @@ -0,0 +1,24 @@ + \ No newline at end of file diff --git a/upload/styles/cbv2/layout/blocks/manage/account_left.html b/upload/styles/cbv2/layout/blocks/manage/account_left.html new file mode 100644 index 00000000..384b3222 --- /dev/null +++ b/upload/styles/cbv2/layout/blocks/manage/account_left.html @@ -0,0 +1,11 @@ + \ No newline at end of file diff --git a/upload/styles/cbv2/layout/blocks/manage/account_video.html b/upload/styles/cbv2/layout/blocks/manage/account_video.html new file mode 100644 index 00000000..653e1762 --- /dev/null +++ b/upload/styles/cbv2/layout/blocks/manage/account_video.html @@ -0,0 +1,44 @@ +{if $control=='' || $control =='view'} + +{/if} + +{if $control =='full'} + + +{/if} \ No newline at end of file diff --git a/upload/styles/cbv2/layout/blocks/manage/user_account_pagination.html b/upload/styles/cbv2/layout/blocks/manage/user_account_pagination.html new file mode 100644 index 00000000..1dc638d2 --- /dev/null +++ b/upload/styles/cbv2/layout/blocks/manage/user_account_pagination.html @@ -0,0 +1,8 @@ + \ No newline at end of file diff --git a/upload/styles/cbv2/layout/blocks/pm/messages.html b/upload/styles/cbv2/layout/blocks/pm/messages.html new file mode 100644 index 00000000..b3463e53 --- /dev/null +++ b/upload/styles/cbv2/layout/blocks/pm/messages.html @@ -0,0 +1,84 @@ + + +
+
+ +
+ + +
+
+ + +
+ +
+ + + {assign var='bg' value='fff'} + {section name=msg loop=$user_msgs} + {if $user_msgs[msg].message_id == $smarty.get.mid} + {assign var='bg' value='c6d7e0'} + {/if} + + {if $bg=='fff'} + {assign var='bg' value='EFF5F8'} + {else} + {assign var='bg' value='fff'} + {/if} + + {sectionelse} +
You do not have any private message
+ {/section} +
+ +
+ +
+ + + + +{if $pr_msg !=''} + +
+
+ + +
+
+
From : {$pr_msg.username} - {$pr_msg.date_added|date_format:"%A, %B %e, %Y %I:%M %p"}
+
Subject : {$pr_msg.message_subject}
+
+
+
+ {private_message pm=$pr_msg} +
+
+ +{/if} \ No newline at end of file diff --git a/upload/styles/cbv2/layout/blocks/user.html b/upload/styles/cbv2/layout/blocks/user.html new file mode 100644 index 00000000..236274c6 --- /dev/null +++ b/upload/styles/cbv2/layout/blocks/user.html @@ -0,0 +1,19 @@ +{if $block_type == '' || $block_type=='normal'} +
+ +
+
+258213
+videos
+
+21245658
+views +
+{/if} + +{if $block_type =='small'} + +{/if} \ No newline at end of file diff --git a/upload/styles/cbv2/layout/blocks/video.html b/upload/styles/cbv2/layout/blocks/video.html index 99b3f8d1..b1427b20 100644 --- a/upload/styles/cbv2/layout/blocks/video.html +++ b/upload/styles/cbv2/layout/blocks/video.html @@ -1,8 +1,12 @@ -
+
{ANCHOR place="video_thumb_div" data=$video} {$video.duration|SetTime:false}
{$video.title|truncate:20}
- by {$userquery->get_user_field_only($video.userid,'username')} {show_rating class='small_stars' rating='$videos.rating' ratings='$videos.rated_by' total='10'}
\ No newline at end of file + by {$userquery->get_user_field_only($video.userid,'username')} {show_rating class='small_stars' rating='$videos.rating' ratings='$videos.rated_by' total='10'}
+ +{if $only_once} +
+{/if} \ No newline at end of file diff --git a/upload/styles/cbv2/layout/body.html b/upload/styles/cbv2/layout/body.html index c5ae3c84..3d755d34 100644 --- a/upload/styles/cbv2/layout/body.html +++ b/upload/styles/cbv2/layout/body.html @@ -1,19 +1,23 @@ {* Including Global Header *} {include file="$style_dir/global_header.html"} -
+ {include file="$style_dir/header.html" } {include file="$style_dir/message.html"}
{foreach from=$template_files item=file} - {include file="$style_dir/$file" } + {if template_file_exists($file,$style_dir)} + {include file="$style_dir/$file" } + {else} +
Unable to load template file "{$file}"
+ {/if} {/foreach}
- +
diff --git a/upload/styles/cbv2/layout/manage_videos.html b/upload/styles/cbv2/layout/manage_videos.html new file mode 100644 index 00000000..6f8b0336 --- /dev/null +++ b/upload/styles/cbv2/layout/manage_videos.html @@ -0,0 +1,121 @@ +
+ {include file="$style_dir/blocks/manage/account_left.html"} + + + +
\ No newline at end of file diff --git a/upload/styles/cbv2/layout/message.html b/upload/styles/cbv2/layout/message.html index 94b9a2a5..8f6fb13c 100644 --- a/upload/styles/cbv2/layout/message.html +++ b/upload/styles/cbv2/layout/message.html @@ -1,8 +1,7 @@ -
- {assign var=msg value=$eh->message_list} {assign var=err value=$eh->error_list} -{if $err.0 neq ''} +{if $err.0 neq '' || $err.1 != ''}
+ diff --git a/upload/styles/cbv2/layout/myaccount.html b/upload/styles/cbv2/layout/myaccount.html new file mode 100644 index 00000000..290ed14d --- /dev/null +++ b/upload/styles/cbv2/layout/myaccount.html @@ -0,0 +1,23 @@ +
+ {include file="$style_dir/blocks/manage/account_left.html"} + + +
+
\ No newline at end of file diff --git a/upload/styles/cbv2/layout/private_message.html b/upload/styles/cbv2/layout/private_message.html new file mode 100644 index 00000000..0233483b --- /dev/null +++ b/upload/styles/cbv2/layout/private_message.html @@ -0,0 +1,51 @@ +
+ {include file="$style_dir/blocks/manage/account_left.html"} + + + +
\ No newline at end of file diff --git a/upload/styles/cbv2/layout/upload.html b/upload/styles/cbv2/layout/upload.html index d17f3817..4f16c837 100644 --- a/upload/styles/cbv2/layout/upload.html +++ b/upload/styles/cbv2/layout/upload.html @@ -1,92 +1,181 @@ - + +{if $show_upload != 'no'} +{if $data.usr_status !=''} + +
+ + + +
+ + + + +
{$LANG.vdo_inactive_msg} {$LANG.vdo_click_here}
+{else} + + +{$java} + + + + + {assign var='requiredFields' value=$Upload->loadRequiredFields()} {assign var='optionFields' value=$Upload->loadOptionFields()} {assign var='locationFields' value=$Upload->loadLocationFields()} {assign var='cust_fields' value=$Upload->custom_form_fields} -
-
- - - - - {foreach from=$requiredFields item=field} - - - - - {/foreach} - - + + + + + + + + + +
{$LANG.vdo_video_details}
createField($field)} -
- {$field.hint_2}
+
+ + + + + + - -
+ + 
{if $step =='1'} + + - + - {foreach from=$locationFields item=field} - - - - - {/foreach} -
{$LANG.vdo_date_loc}{$LANG.vdo_upload_step1} {$LANG.vdo_upload_step2}
{$field.title}* :{$field.hint_1}{ANCHOR place=$field.anchor_before}{$formObj->createField($field)} -
- {$field.hint_2}
- + - {foreach from=$optionFields item=field} - - - - - {/foreach} - {foreach from=$cust_fields item=field} - - - - - {/foreach} -
{$LANG.vdo_share_opt}
{$field.title}* :{$field.hint_1}{ANCHOR place=$field.anchor_before}{$formObj->createField($field)} -
- {$field.hint_2}
{$field.title}* :{$field.hint_1}{ANCHOR place=$field.anchor_before}{$formObj->createField($field)} -
- {$field.hint_2}
- - - - -{if $step==3} - - - - - - - - - - - - - - - - - - - + + + + + + + + + +
{$LANG.vdo_video_upload_complete}
{$LANG.vdo_thanks_you_upload_complete_1}.
-{$LANG.vdo_thanks_you_upload_complete_2} {$LANG.com_my_videos} {$LANG.vdo_after_it_has_process}
-
 
-
+ + + + {foreach from=$requiredFields item=field} + + + + + {/foreach} + + + + + + + + + + +
{$LANG.vdo_video_details}
{$field.title}* :{$field.hint_1}{ANCHOR place=$field.anchor_before}{$formObj->createField($field)} +
+ {$field.hint_2}
+ + + + {foreach from=$locationFields item=field} + + + + + {/foreach} +
{$LANG.vdo_date_loc}
{$field.title}* :{$field.hint_1}{ANCHOR place=$field.anchor_before}{$formObj->createField($field)} +
+ {$field.hint_2}
+ + + + {foreach from=$optionFields item=field} + + + + + {/foreach} + {foreach from=$cust_fields item=field} + + + + + {/foreach} +
{$LANG.vdo_share_opt}
{$field.title}* :{$field.hint_1}{ANCHOR place=$field.anchor_before}{$formObj->createField($field)} +
+ {$field.hint_2}
{$field.title}* :{$field.hint_1}{ANCHOR place=$field.anchor_before}{$formObj->createField($field)} +
+ {$field.hint_2}
  
+
+ + {/if}
 
  
+ {if $step =="2"} +
+ {$Upload->load_post_fields()} + + {assign var=opt_list value=$Upload->load_upload_options()} + + {foreach from=$opt_list item=opt key=divid} +
+ {$opt.title} + {load_form name=$opt.load_func} +
+ {/foreach} +
+ {/if} + + + {if $step==3} + + + + + + + + + + + + + + + + + + + + +
{$LANG.vdo_video_upload_complete}
{$LANG.vdo_thanks_you_upload_complete_1}.
+ {$LANG.vdo_thanks_you_upload_complete_2} {$LANG.com_my_videos} {$LANG.vdo_after_it_has_process}
+
 
+
+ {/if} +
 
- {/if} -
\ No newline at end of file +{/if} \ No newline at end of file diff --git a/upload/styles/cbv2/layout/user_videos.html b/upload/styles/cbv2/layout/user_videos.html new file mode 100644 index 00000000..f90870f7 --- /dev/null +++ b/upload/styles/cbv2/layout/user_videos.html @@ -0,0 +1,29 @@ + +
+
+
{$u.username}
+
{lang code='user_s_channel' assign='usr_s'}{$usr_s|sprintf:$u.username} {lang code='subscribe'}
+ + {assign var='channel_links' value=$userquery->get_inner_channel_top_links($u)} + +
+
+
+ + +
+
Videos
+ {section name=v_list loop=$videos} + {include file="$style_dir/blocks/video.html" video=$videos[v_list]} + {/section} +
+
+ +
{AD place='ad_160x600'}
+
+ +{include file="$style_dir/blocks/pagination.html"} \ No newline at end of file diff --git a/upload/styles/cbv2/layout/view_channel.html b/upload/styles/cbv2/layout/view_channel.html new file mode 100644 index 00000000..8eda5d37 --- /dev/null +++ b/upload/styles/cbv2/layout/view_channel.html @@ -0,0 +1,225 @@ +{* Including Global Header *} +{include file="$style_dir/global_header.html"} + +
+ + + {include file="$style_dir/header.html" } + {include file="$style_dir/message.html"} +
getUserBg($u) || $u.background_color!=''}style="background-position:center;background:{if $userquery->getUserBg($u)}url('{$userquery->getUserBg($u)}');background-repeat: {$u.background_repeat};{elseif $u.background_color!=''}{$u.background_color}{/if}"{/if}> +
+ +
+
+
{$u.username}
+
{lang code='user_s_channel' assign='usr_s'}{$usr_s|sprintf:$u.username} {lang code='subscribe'}
+ + {assign var='channel_links' value=$userquery->get_inner_channel_top_links($u)} + +
+
+
+ + + + + + {assign var=user_vdo value= $userquery->get_user_profile_video($p)} + {if $user_vdo} + +
+
+
+
+ This content requires JavaScript and Macromedia Flash Player 7 or higher. Get Flash

+
+ +
+
{AD place=336x280}
+
+
+ +
+ + {/if} + + + + +
+
+ +
+
+ {$u.username} +
+ {lang code='subscribe'}
+ {assign var='channel_action_links' value=$userquery->get_channel_action_links($u)} + +
+ +
+ +
+ {lang code='profile'|capitalize:true} + +
+
{lang code='user_channel_views'}
+
{$u.profile_hits|number_format}
+
+ + {if $p.show_dob=='yes'} +
+
{lang code='age'}
+
{$u.dob|get_age} - {$u.dob|date_format}
+
+ {/if} + +
+
{lang code='joined'}
+
{$u.doj|date_format}
+
+ +
+
{lang code='user_last_login'}
+
{$u.last_logged|nicetime}
+
+ +
+
{lang code='subscribers'}
+
{$u.subscribers|number_format}
+
+ +
+
{lang code=country}
+
{$u.country|country}
+
+ + + + {lang code='Personal Details'|capitalize:true} + {assign var="personal_details" value=$userquery->load_personal_details($p)} + {foreach from=$personal_details item=field} + {assign var=db_field value=$field.db_field} + {if $p.$db_field && $field.auto_view=='yes'} +
+ {if $field.type !='textarea'} +
{$field.title}
+
{input_value input=$field}
+ {else} + {$field.value} + {/if} +
+ {/if} + {/foreach} + + + {if $p.about_me} +
+ {$p.about_me|nl2br} +
+ {/if} + +
+
+ + + +
+ {lang code='user_subscriptions' assign='users_videos'}{$users_videos|sprintf:$u.username} +
+ {assign var='usr_subs' value=$userquery->get_user_subscriptions($u.userid)} + {section name=u_list loop=$usr_subs} + {include file="$style_dir/blocks/user.html" user=$usr_subs[u_list] block_type='small'} + {sectionelse} +
{lang code='user_no_subscriptions' assign='user_subs'}{$user_subs|sprintf:$u.username}
+ {/section} +
+
+ +
+ + +
+ + + +
+
+ {lang code='users_videos' assign='users_videos'}{$users_videos|sprintf:$u.username} +
+ {get_videos assign='usr_vids' limit='4' order='date_added DESC' user=$u.userid} + {section name=v_list loop=$usr_vids} + {include file="$style_dir/blocks/video.html" video=$usr_vids[v_list]} + {sectionelse} +
{lang code='user_have_no_vide'}
+ {/section} +
+
+ +
+ + +
+ {lang code='users_subscribers' assign='users_videos'}{$users_videos|sprintf:$u.username} +
+ {assign var='usr_subs' value=$userquery->get_user_subscribers_detail($u.userid)} + {section name=u_list loop=$usr_subs} + {include file="$style_dir/blocks/user.html" user=$usr_subs[u_list] block_type='small'} + {sectionelse} +
{lang code='user_no_subscribers' assign='users_videos'}{$users_videos|sprintf:$u.username}
+ {/section} +
+
+ +
+ + + {ANCHOR place='channel_box'} + + +
+ {lang code='comments'|capitalize:true} +
+ {include file="$style_dir/blocks/comments.html" id=$u.userid type=c}
+ {lang code='user_add_comment'} +
+ + +
+ + +
+
+ + +
+
+ +
+ + + +
+ + +
+ + +
+ + \ No newline at end of file diff --git a/upload/styles/cbv2/layout/watch_video.html b/upload/styles/cbv2/layout/watch_video.html index c370f7aa..ea68f4a9 100644 --- a/upload/styles/cbv2/layout/watch_video.html +++ b/upload/styles/cbv2/layout/watch_video.html @@ -1,5 +1,5 @@
{$vdo.title}
-{if has_access('admin_access')}
{ANCHOR place=watch_admin_options data=$vdo}
{/if} +{if $userquery->perm_check('admin_access')=='yes'}
{ANCHOR place=watch_admin_options data=$vdo}
{/if}
diff --git a/upload/styles/cbv2/theme/blocks.css b/upload/styles/cbv2/theme/blocks.css index f31f76d2..bdd7cb87 100644 --- a/upload/styles/cbv2/theme/blocks.css +++ b/upload/styles/cbv2/theme/blocks.css @@ -7,3 +7,62 @@ .category_list ul, .category_list ul li{margin:0px; padding:0px; list-style:none} .category_list a{display:block; border-bottom:dashed 1px #EEE; font-size:13px; font-weight:bold; color:#09c; padding:3px; margin-bottom:3px;} .category_list a:hover{background-color:#F9F9F9} + +/* User */ +.user_block{width:130px; margin:5px; float:left; border:1px solid #CCC; margin:5px; padding:5px; font-size:10px} +.user_mid_thumb_container{display:inline; float:left; margin-right:5px} +.user_mid_thumb{max-width:60px; max-height:60px;display:inline; border:1px solid #999; padding:2px;} +.user_block a{font-size:12px; font-weight:bold} + +.user_block_small{width:70px; height:80px; margin:3px; float:left; padding:5px; font-size:10px; border:1px solid #CCC} +.user_block_small a{font-size:11px; font-weight:bold} + + + +/* My ACcount */ +.my_account_left{width:150px; float:left; } +.my_account_left ul{margin:0px; padding:0px;} +.my_account_left li{margin:0px; padding:0px; list-style:none; } +.my_account_left .li{font-size:12px; font-weight:bold; display:block; margin-bottom:10px} +.my_account_left .li li{font-weight:normal; border-bottom:1px dotted #333; padding-left:5px} + +.account_box{float:right; width:800px;border-left:5px #999 solid; padding-left:10px} + +.account_option_box{display:block; width:225px; margin:10px; padding:10px;float:left; background-color:#EFF5F8; border-radius:5px; -moz-border-radius:5px;-webkit-border-radius:5px;} +.account_option_box .its_title{font-size:13px; font-weight:bold;} +.account_option_box li{list-style:none; border-bottom:1px dotted #999; padding-bottom:2px; margin-bottom:2px} +.account_option_box ul{margin:0px; padding:0px; display:block; padding-left:15px} +.account_option_box a:hover{color:#009} + +.account_head_container{border-bottom:1px dotted #CCC; padding-bottom:10px} +.account_thumb{max-height:150px; max-width:150px;border:1px solid #999; padding:3px; display:inline-block;} +.account_thumb_container{margin-left:5px;display:inline-block; float:left; margin-right:10px} +.stats .account_stat{font-size:11px; font-family:tahoma; display:block;} +.stats{ width:300px; float:left} + +.account_head_right{float:right} +.pm_box{width:90px; height:70px; background-color:#EFF5F8; border-radius:5px; -moz-border-radius:5px;-webkit-border-radius:5px; display:block} +.pm_box .messages{font-size:10px; font-family:tahoma; font-weight:bold; text-transform:uppercase; color:#333; text-align:center; display:block; padding:6px} +.pm_box {text-align:center; font-size:25px; font-weight:bold} + + +.account_form fieldset{border:1px solid #ccc; border-radius:5px; -moz-border-radius:5px;-webkit-border-radius:5px; margin:10px} +.account_form legend{ text-transform:uppercase; font-family:Tahoma; font-weight:bold} +.account_form input, .account_form textarea, .account_form select{border:1px solid #ccc; width:300px; padding:3px;} +.account_form input[type="radio"],.account_form input[type="checkbox"] { display:inline; width:auto} +.account_form select{margin-bottom:10px} + +.account_field_block{ border-bottom:1px solid #CCC; margin:5px 0px 5px 0px; padding-bottom:0px; padding-top:5px} +.account_field_block:hover{background-color:#F5F5F5} +.account_field_block .account_field_label{width:200px; float:left} +.account_field_block .account_field{ float:left; width:400px; padding-left:10px; padding-bottom:10px} + +.avatar_bg label{margin-top:10px; display:block} + +.messages_container{max-height:200px; overflow:auto; padding-bottom:10px; border-bottom:1px dashed #999} + +.private_message_container{padding:10px; border-radius:5px; -webkit-border-radius:5px; -moz-border-radius:5px; border:1px solid #CCC; margin-top:15px; } + +.unread_msg, .unread_msg a{font-weight:bold; font-family:tahoma;} +.read_msg, .read_msg a{font-weight:normal; font-family:tahoma;} + diff --git a/upload/styles/cbv2/theme/body.css b/upload/styles/cbv2/theme/body.css index c3e95f7a..801078c5 100644 --- a/upload/styles/cbv2/theme/body.css +++ b/upload/styles/cbv2/theme/body.css @@ -30,7 +30,7 @@ a{text-decoration:none; font-family:Arial, Helvetica, sans-serif;color:#333; } .verticle_ad{width:160px; float:left} -#footer{ background-image:url(../images/gradients.png); height:29px;} +#footer{ background-image:url(../images/gradients.png); height:29px; margin-top:15px} .footer{width:980px; margin:auto; color:#fff; line-height:29px} .video_title{font-size:18px; font-weight:bold; color:#09c; text-transform:uppercase; padding:5px 0px 10px 0px} @@ -72,6 +72,36 @@ a{text-decoration:none; font-family:Arial, Helvetica, sans-serif;color:#333; } .blank_screen{width:580px; padding:10px; height:50px; color:#fff; font-size:16px; font-weight:bold; margin:10px 0px 10px 0px; background-color:#333; text-align:center;} .video_right{width:300px; float:left} +.user_small_thumb{max-height:30px; max-width:30px} + /* FORM */ .input{border:1px solid #666; background-image:url(../images/field_bg.png); background-repeat:no-repeat; width:500px; min-height:20px; font-size:11px; color:#666; padding:5px} -.label{font-size:13px; font-weight:bold} \ No newline at end of file +.label{font-size:13px; font-weight:bold} + + + +/** + my account + */ +.account_table{border:1px solid #c2c2c2; border-radius:5px;-moz-border-radius:5px;-webkit-border-radius:5px; background-image:url(../images/gradients.png); background-position:0px -36px; height:19px} +.account_table tr td{border-right:1px solid #c2c2c2; text-indent:10px; font-family:Tahoma; font-size:11px; text-transform:uppercase; font-weight:bold} +.account_table .last_td{border-right:0px} + +.account_vid_list{ margin:5px 0px 5px 0px;border-radius:5px;-moz-border-radius:5px;-webkit-border-radius:5px; } +.account_vid_list tr td{text-indent:10px; font-family:Tahoma; font-size:11px; text-transform:uppercase; font-weight:bold} +.account_vid_list .last_td{border-right:0px} +.acc_usr_video_thumb{border:1px solid #999; margin:1px; padding:1px; display:block; float:left; width:50px;} + +.search_field{background-image:url(../images/blocks.png); width:150px; height:22px; border:none; padding-left:8px; padding-top:6px; font-size:11px; font:tahoma; margin:0px; float:left;} +.search_field_button{background-image:url(../images/blocks.png); width:25px; height:22px; border:0px; background-position:-160px -0px; padding:0px; margin:0px; text-indent:-50000000px; float:left; cursor:pointer; outline:none} + +/** + * icons */ +.arrow_pointing,.edit_icon,.delete_icon,.reply_icon{background-image:url(../images/icons.png); background-repeat:no-repeat; } +.reply_icon,.edit_icon,.delete_icon{height:15px; width:15px; } +.delete_icon{background-position:-0px -63px } +.edit_icon{background-position:-15px -63px } +.reply_icon{background-position:-30px -63px } + +.video_control{font-weight:normal; margin-left:10px; font-size:10px} +.arrow_pointing{background-position:-0px -78px; width:24px; height:14px;} \ No newline at end of file diff --git a/upload/styles/cbv2/theme/buttons.css b/upload/styles/cbv2/theme/buttons.css new file mode 100644 index 00000000..9e769f4e --- /dev/null +++ b/upload/styles/cbv2/theme/buttons.css @@ -0,0 +1,10 @@ +@charset "utf-8"; +/* CSS Document */ +.cb_button_2,.cb_button,.small_button{background-image:url(../images/buttons.png)} + +.cb_button_2,.cb_button{display:inline-block;height:31px; width:135px; color:#fff; line-height:31px; text-align:center; font-size:14px; font-weight:bold; border:none; font-family:Arial, Helvetica, sans-serif; cursor:pointer} +.cb_button_2:hover,.cb_button:hover{background-position:-0px -31px} +.cb_button_2{font-size:12px} + +.small_button{display:inline-block;height:21px; width:94px; color:#fff; text-align:center; font-size:11px; font-weight:bold; border:none; font-family:Arial, Helvetica, sans-serif; cursor:pointer; background-position:-0px -62px} +.small_button:hover{background-position:-0px -83px} \ No newline at end of file diff --git a/upload/styles/cbv2/theme/main.css b/upload/styles/cbv2/theme/main.css index 1822dca9..82a8c6a9 100644 --- a/upload/styles/cbv2/theme/main.css +++ b/upload/styles/cbv2/theme/main.css @@ -9,3 +9,5 @@ Style name: ClipBucket v2 @import url("navbar.css"); @import url("blocks.css"); @import url("rating.css"); +@import url("view_channel.css"); +@import url("buttons.css"); \ No newline at end of file diff --git a/upload/styles/cbv2/theme/view_channel.css b/upload/styles/cbv2/theme/view_channel.css new file mode 100644 index 00000000..da23fd2f --- /dev/null +++ b/upload/styles/cbv2/theme/view_channel.css @@ -0,0 +1,58 @@ +@charset "utf-8"; +/* CSS Document */ + +.channel_inner_box, .channel_inner_box a{color:#fff; } +.channel_box{background-color:#CCC;} +.channel_inner_box{background-color:#666;} + +.channel_inner_box a{font-weight:bold} +.channel_box +{ + + border-radius:5px; + -moz-border-radius:5px; + -webkit-border-radius:5px; + padding:5px; margin:auto; + margin-bottom:10px; + +} + +.channel_inner_box +{ + border-radius:3px; + -moz-border-radius:3px; + -webkit-border-radius:3px; + width:99%; margin:auto; + padding:5px; + font-size:12px; +} +.channel_heading, .channel_top{font-size:16px; font-weight:bold} +.channel_heading_mid{font-size:12px; font-weight:bold} +.channel_inner_box .usr_small_thumb +{ + width:40px; + height:30px; + float:left; +} + +.usr_channel{ display:inline-block; float:left; margin-right:15px } + +.top_channel_links{display:block; margin:0px; padding:0px; float:left; line-height:33px} +.top_channel_links li{list-style:none; padding:0px; margin:0px; display:block; float:left; width:100px} + +.usr_thumb_container{margin-bottom:10px} +.user_thumb{max-width:260px} + +.channel_action_links{display:block; text-align:center; margin:0px; padding:0px;line-height:normal} +.channel_action_links a{font-size:12px; line-height:normal} +.channel_action_links li{list-style:none;line-height:normal} + + +.show_info{clear:both} +.show_info .item_list{width:50%; display:block} +.float_right{float:right} +.float_left{float:left} + + +.right_column{float:right; width:675px; margin-right:3px} +.right_column .channel_inner_box{margin-bottom:5px} \ No newline at end of file diff --git a/upload/styles/clipbucketblue/layout/user_account.html b/upload/styles/clipbucketblue/layout/user_account.html index 52ce186d..946dead9 100644 --- a/upload/styles/clipbucketblue/layout/user_account.html +++ b/upload/styles/clipbucketblue/layout/user_account.html @@ -406,7 +406,7 @@
  {$LANG.user_old_pass}: