clipbucket/upload/view_channel.php

141 lines
3.7 KiB
PHP
Raw Permalink Normal View History

2013-10-07 12:17:06 +00:00
<?php
/*
******************************************************************
| Copyright (c) 2007-2008 Clip-Bucket.com. All rights reserved.
| @ Author : ArslanHassan
| @ Software : ClipBucket , © PHPBucket.com
******************************************************************
*/
define("THIS_PAGE",'view_channel');
define("PARENT_PAGE",'channels');
require 'includes/config.inc.php';
$pages->page_redir();
$userquery->perm_check('view_channel',true);
$u = $_GET['user'];
$u = $u ? $u : $_GET['userid'];
$u = $u ? $u : $_GET['username'];
$u = $u ? $u : $_GET['uid'];
$u = $u ? $u : $_GET['u'];
$u = mysql_clean($u);
$udetails = $userquery->get_user_details($u);
2014-03-27 08:58:32 +00:00
2013-10-07 12:17:06 +00:00
if($udetails)
{
2014-03-27 08:58:32 +00:00
Assign('user', $udetails);
2014-03-27 06:19:16 +00:00
//Subscribing User
if($_GET['subscribe'])
{
$userquery->subscribe_user($udetails['userid']);
}
//Adding Comment
if(isset($_POST['add_comment']))
{
$userquery->add_comment($_POST['comment'],$udetails['userid']);
}
//Calling view channel functions
call_view_channel_functions($udetails);
assign("u",$udetails);
//Getting profile details
$p = $userquery->get_user_profile($udetails['userid']);
assign('p',$p);
2014-03-27 08:58:32 +00:00
assign('coverPhoto', $userquery->getCover($udetails["userid"]));
2014-03-27 06:45:43 +00:00
Assign('extensions', $Cbucket->get_extensions());
2014-03-27 07:09:19 +00:00
//Getting users channel List
$result_array['limit'] = $get_limit;
if(!$array['order'])
2014-03-27 11:42:05 +00:00
$result_array['order'] = " profile_hits DESC limit 6 ";
2014-03-27 07:09:19 +00:00
$users = get_users($result_array);
Assign('users', $users);
2014-07-16 07:26:16 +00:00
global $db;
$results = $db->select(tbl('users'),'*');
Assign('user_s',$results);
2014-03-27 07:09:19 +00:00
2015-06-03 14:27:44 +00:00
// pulls user profile
$profile = $userquery->get_user_profile($udetails['userid']);
Assign('u_control', $profile);
2014-06-02 07:07:29 +00:00
2014-03-27 07:09:19 +00:00
//Checking Profile permissions
2014-03-27 06:19:16 +00:00
$perms = $p['show_profile'];
if(userid()!=$udetails['userid'])
{
if(($perms == 'friends' || $perms == 'members') && !userid())
{
global $Cbucket;
2014-03-27 06:19:16 +00:00
e(lang('you_cant_view_profile'));
$Cbucket->show_page = false;
2014-03-27 06:19:16 +00:00
}elseif($perms == 'friends' && !$userquery->is_confirmed_friend($udetails['userid'],userid()))
{
e(sprintf(lang('only_friends_view_channel'),$udetails['username']));
if(!has_access('admin_access',true))
$Cbucket->show_page = false;
}
//Checking if user is not banned by admin
if(userid())
{
if($userquery->is_user_banned(username(),$udetails['userid'],$udetails['banned_users']))
{
e(sprintf(lang('you_are_not_allowed_to_view_user_channel'),$udetails['username']));
assign('isBlocked','yes');
if(!has_access('admin_access',true))
$Cbucket->show_page = false;
}
}
}
subtitle(sprintf(lang('user_s_channel'),$udetails['username']));
//Setting profilte item
$profileItem = $userquery->getProfileItem($udetails['userid'],true);
assign('profile_item',$profileItem);
2013-10-07 12:17:06 +00:00
}else{
2014-03-25 14:05:14 +00:00
if($_GET['seo_diret']!='yes')
{
e(lang("usr_exist_err"));
$Cbucket->show_page = false;
}else{
header("HTTP/1.0 404 Not Found");
if(file_exists(LAYOUT."/404.html")) {
template_files('404.html');
} else {
$data = "404_error";
if(has_access('admin_access'))
e(sprintf(lang("err_warning"),"404","http://docs.clip-bucket.com/?p=154"),"w");
e(lang($data));
}
display_it();
exit();
}
2013-10-07 12:17:06 +00:00
}
add_js(array('jquery_plugs/compressed/jquery.jCarousel.js'=>'view_channel'));
2014-03-25 14:05:14 +00:00
2014-09-19 13:29:51 +00:00
if($Cbucket->show_page){
template_files('view_channel.html');
display_it();
}
2013-10-07 12:17:06 +00:00
else
{
2014-03-25 14:05:14 +00:00
if($udetails)
2014-09-19 13:29:51 +00:00
template_files('view_channel.html');
2014-03-25 14:05:14 +00:00
display_it();
2013-10-07 12:17:06 +00:00
}
?>