15.patch
| b/.htaccess | ||
|---|---|---|
| 22 | 22 |
RewriteRule ^friends/recommend/(.*)/ recommend_friends.php?video_id=$1 [QSA,L] |
| 23 | 23 |
RewriteRule ^friends/invite/ invite_friends.php?user_name=$1&page=$2 [L,QSA] |
| 24 | 24 |
RewriteRule ^friends/(.*) friends.php?page=$1 [L,QSA] |
| 25 |
RewriteRule ^members/(.*)/(.*) members.php?sort=$1&page=$2 [L,QSA] |
|
| 26 |
RewriteRule ^members/(.*) members.php?page=$1 [L,QSA] |
|
| 25 | 27 |
RewriteRule ^detailed/recent/(.*) video.php?category=recent&page=$1&view_type=detailed |
| 26 | 28 |
RewriteRule ^detailed/viewed/(.*) video.php?category=viewed&page=$1&view_type=detailed |
| 27 | 29 |
RewriteRule ^detailed/discussed/(.*) video.php?category=discussed&page=$1&view_type=detailed |
| 28 |
- |
|
| b/members.php | ||
|---|---|---|
| 1 |
<?php |
|
| 2 |
/****************************************************************************** |
|
| 3 |
* |
|
| 4 |
* COMPANY: BuyScripts.in |
|
| 5 |
* PROJECT: vShare Youtube Clone |
|
| 6 |
* VERSION: 2.8 |
|
| 7 |
* LISENSE: http://buyscripts.in/vshare-license.html |
|
| 8 |
* WEBSITE: http://buyscripts.in/youtube_clone.html |
|
| 9 |
* |
|
| 10 |
* This program is a commercial software and any kind of using it must agree |
|
| 11 |
* to vShare license. |
|
| 12 |
* |
|
| 13 |
******************************************************************************/ |
|
| 14 | ||
| 15 |
require 'include/config.php'; |
|
| 16 | ||
| 17 |
$page = (isset($_GET['page'])) ? (int) $_GET['page'] : 1; |
|
| 18 |
$sort = (isset($_GET['sort'])) ? $_GET['sort'] : 'recent'; |
|
| 19 | ||
| 20 |
if ($page < 1) |
|
| 21 |
{
|
|
| 22 |
$page = 1; |
|
| 23 |
} |
|
| 24 | ||
| 25 |
$sort_array = array( |
|
| 26 |
'recent', |
|
| 27 |
'video_uploaded', |
|
| 28 |
'profile_viewed', |
|
| 29 |
'video_viewed', |
|
| 30 |
'subscribed' |
|
| 31 |
); |
|
| 32 | ||
| 33 |
if (! in_array($sort, $sort_array)) |
|
| 34 |
{
|
|
| 35 |
$sort = 'recent'; |
|
| 36 |
} |
|
| 37 | ||
| 38 |
if ($sort == 'video_uploaded') |
|
| 39 |
{
|
|
| 40 |
$sql = "SELECT u . * , count( v.video_id ) AS `total` FROM |
|
| 41 |
`videos` AS `v`, `users` AS `u` |
|
| 42 |
WHERE v.video_user_id=u.user_id AND |
|
| 43 |
v.video_active='1' AND |
|
| 44 |
v.video_approve='1' |
|
| 45 |
GROUP BY v.video_user_id"; |
|
| 46 |
$result = mysql_query($sql) or mysql_die($sql); |
|
| 47 |
$total = mysql_num_rows($result); |
|
| 48 |
} |
|
| 49 |
else if ($sort == 'subscribed') |
|
| 50 |
{
|
|
| 51 |
$sql = "SELECT u . * , count( s.subscription_to_user_id ) AS `total` FROM |
|
| 52 |
`users` AS `u` , `subscriptions` AS `s` WHERE |
|
| 53 |
u.user_id=s.subscription_to_user_id AND |
|
| 54 |
u.user_account_status='Active' |
|
| 55 |
GROUP BY u.user_id"; |
|
| 56 |
$result = mysql_query($sql) or mysql_die($sql); |
|
| 57 |
$total = mysql_num_rows($result); |
|
| 58 |
} |
|
| 59 |
else |
|
| 60 |
{
|
|
| 61 |
$sql = "SELECT count(*) AS `total` FROM `users` WHERE |
|
| 62 |
`user_account_status`='Active'"; |
|
| 63 |
$result = mysql_query($sql) or mysql_die($sql); |
|
| 64 |
$tmp = mysql_fetch_assoc($result); |
|
| 65 |
$total = $tmp['total']; |
|
| 66 |
} |
|
| 67 | ||
| 68 |
$start_from = ($page - 1) * $config['items_per_page']; |
|
| 69 | ||
| 70 |
$title = ''; |
|
| 71 | ||
| 72 |
if ($sort == 'recent') |
|
| 73 |
{
|
|
| 74 |
$title = 'Most Recent'; |
|
| 75 |
$sql = "SELECT * FROM `users` WHERE |
|
| 76 |
`user_account_status`='Active' |
|
| 77 |
ORDER BY `user_id` DESC |
|
| 78 |
LIMIT $start_from, $config[items_per_page]"; |
|
| 79 |
} |
|
| 80 |
else if ($sort == 'video_uploaded') |
|
| 81 |
{
|
|
| 82 |
$title = 'Most Video Uploaded'; |
|
| 83 |
$sql = "SELECT u . * , count( v.video_id ) AS tmp |
|
| 84 |
FROM `videos` AS v, users AS u |
|
| 85 |
WHERE v.video_user_id = u.user_id AND |
|
| 86 |
v.video_active='1' AND |
|
| 87 |
v.video_approve='1' |
|
| 88 |
GROUP BY v.video_user_id |
|
| 89 |
ORDER BY tmp DESC |
|
| 90 |
LIMIT $start_from, $config[items_per_page]"; |
|
| 91 |
} |
|
| 92 |
else if ($sort == 'profile_viewed') |
|
| 93 |
{
|
|
| 94 |
$title = 'Most Profile Viewed'; |
|
| 95 |
$sql = "SELECT * FROM `users` WHERE |
|
| 96 |
`user_account_status`='Active' |
|
| 97 |
ORDER BY `user_profile_viewed` DESC |
|
| 98 |
LIMIT $start_from, $config[items_per_page]"; |
|
| 99 |
} |
|
| 100 |
else if ($sort == 'video_viewed') |
|
| 101 |
{
|
|
| 102 |
$title = 'Most Video Viewed'; |
|
| 103 |
$sql = "SELECT * FROM `users` WHERE |
|
| 104 |
`user_account_status`='Active' |
|
| 105 |
ORDER BY `user_watched_video` DESC |
|
| 106 |
LIMIT $start_from, $config[items_per_page]"; |
|
| 107 |
} |
|
| 108 |
else if ($sort == 'subscribed') |
|
| 109 |
{
|
|
| 110 |
$title = 'Most Subscribed'; |
|
| 111 |
$sql = "SELECT u . * , count( s.subscription_to_user_id ) AS `total` FROM |
|
| 112 |
`users` AS `u` , `subscriptions` AS `s` WHERE |
|
| 113 |
u.user_id = s.subscription_to_user_id AND |
|
| 114 |
u.user_account_status = 'Active' |
|
| 115 |
GROUP BY u.user_id |
|
| 116 |
ORDER BY `total` DESC |
|
| 117 |
LIMIT $start_from, $config[items_per_page]"; |
|
| 118 |
} |
|
| 119 | ||
| 120 |
$result = mysql_query($sql) or mysql_die($sql); |
|
| 121 |
$results_on_this_page = mysql_num_rows($result); |
|
| 122 | ||
| 123 |
$members = array(); |
|
| 124 |
$i = 0; |
|
| 125 | ||
| 126 |
while ($user_info = mysql_fetch_assoc($result)) |
|
| 127 |
{
|
|
| 128 |
$members[$i] = $user_info; |
|
| 129 |
$members[$i]['photo_url'] = User::get_photo($user_info['user_photo'], $user_info['user_id']); |
|
| 130 |
$i ++; |
|
| 131 |
} |
|
| 132 | ||
| 133 |
$start_num = $start_from + 1; |
|
| 134 |
$end_num = $start_from + $results_on_this_page; |
|
| 135 |
$page_links = paginate($total, $config['items_per_page'], '.', '', $page); |
|
| 136 | ||
| 137 |
$smarty->assign('sort', $sort);
|
|
| 138 |
$smarty->assign('title', $title);
|
|
| 139 |
$smarty->assign('start_num', $start_num);
|
|
| 140 |
$smarty->assign('end_num', $end_num);
|
|
| 141 |
$smarty->assign('page_links', $page_links);
|
|
| 142 |
$smarty->assign('total', $total);
|
|
| 143 |
$smarty->assign('members', $members);
|
|
| 144 |
$smarty->display('header.tpl');
|
|
| 145 |
$smarty->display('members.tpl');
|
|
| 146 |
$smarty->display('footer.tpl');
|
|
| b/templates/members.tpl | ||
|---|---|---|
| 1 |
<div id="content"> |
|
| 2 |
|
|
| 3 |
Sort by: |
|
| 4 |
<select name="sort" onchange="javascript:window.location.href='{$base_url}/members/' + this.value + '/';">
|
|
| 5 |
<option value="recent" {if $sort eq 'recent'}selected{/if}>Most Recent</option>
|
|
| 6 |
<option value="video_uploaded" {if $sort eq 'video_uploaded'}selected{/if}>Most Video Uploaded</option>
|
|
| 7 |
<option value="profile_viewed" {if $sort eq 'profile_viewed'}selected{/if}>Most Profile Viewed</option>
|
|
| 8 |
<option value="video_viewed" {if $sort eq 'video_viewed'}selected{/if}>Most Video Viewed</option>
|
|
| 9 |
<option value="subscribed" {if $sort eq 'subscribed'}selected{/if}>Most Subscribed</option>
|
|
| 10 |
</select> |
|
| 11 |
|
|
| 12 |
<br /><br /> |
|
| 13 |
|
|
| 14 |
<div class="section"> |
|
| 15 |
|
|
| 16 |
<div class="hd"> |
|
| 17 |
<div class="hd-l">{$title} Members</div>
|
|
| 18 |
<div class="hd-r">Members {$start_num}-{$end_num} of {$total}</div>
|
|
| 19 |
</div> |
|
| 20 |
|
|
| 21 |
<div class="video_block clearfix"> |
|
| 22 |
|
|
| 23 |
{section name=i loop=$members}
|
|
| 24 |
|
|
| 25 |
<div class="watch-video-box"> |
|
| 26 |
|
|
| 27 |
<p class="video_title"> |
|
| 28 |
<a href="{$base_url}/{$members[i].user_name}/">
|
|
| 29 |
<img class="preview" src="{$members[i].photo_url}" alt="{$members[i].user_name}" />
|
|
| 30 |
</a> |
|
| 31 |
</p> |
|
| 32 |
|
|
| 33 |
<p class="video_title"> |
|
| 34 |
<a href="{$base_url}/{$members[i].user_name}/">{$members[i].user_name}</a>
|
|
| 35 |
</p> |
|
| 36 |
|
|
| 37 |
<p class="video_details"> |
|
| 38 |
Joined :{insert name=time_range assign=stime field=user_join_time IDFR=user_id id=$members[i].user_id tbl=users} {$stime}
|
|
| 39 |
</p> |
|
| 40 |
|
|
| 41 |
<p class="video_details"> |
|
| 42 |
Last Login: {insert name=time_range assign=rtime field=user_last_login_time IDFR=user_id id=$members[i].user_id tbl=users}{$rtime}
|
|
| 43 |
</p> |
|
| 44 |
|
|
| 45 |
<p class="video_details"> |
|
| 46 |
Videos Uploaded: {insert name=video_count uid=$members[i].user_id assign=video_num}<a href="{$base_url}/{$members[i].user_name}/public/1">{$video_num}</a>
|
|
| 47 |
</p> |
|
| 48 |
|
|
| 49 |
<p class="video_details"> |
|
| 50 |
Favorite Videos: {insert name=favour_count assign=favour_num uid=$members[i].user_id}<a href="{$base_url}/{$members[i].user_name}/favorites/1">{$favour_num}</a>
|
|
| 51 |
</p> |
|
| 52 |
|
|
| 53 |
{if $sort eq "profile_viewed"}
|
|
| 54 |
<p class="video_details"> |
|
| 55 |
Profile Viewed: {$members[i].user_profile_viewed}
|
|
| 56 |
</p> |
|
| 57 |
{elseif $sort eq "video_viewed"}
|
|
| 58 |
<p class="video_details"> |
|
| 59 |
Video Viewed: {$members[i].user_watched_video}
|
|
| 60 |
</p> |
|
| 61 |
{elseif $sort eq "subscribed"}
|
|
| 62 |
<p class="video_details"> |
|
| 63 |
Subscribers: {$members[i].total}
|
|
| 64 |
</p> |
|
| 65 |
{else}
|
|
| 66 |
<p class="video_details"> |
|
| 67 |
My Friends: {insert name=friends_count assign=friends_num uid=$members[i].user_id}<a href="{$base_url}/{$members[i].user_name}/friends/1">{$friends_num}</a>
|
|
| 68 |
</p> |
|
| 69 |
{/if}
|
|
| 70 |
</div> |
|
| 71 |
|
|
| 72 |
{/section}
|
|
| 73 |
|
|
| 74 |
</div> |
|
| 75 |
|
|
| 76 |
<div class="page_links"> |
|
| 77 |
Pages: {$page_links}
|
|
| 78 |
</div> |
|
| 79 |
|
|
| 80 |
</div> |
|
| 81 |
|
|
| 82 |
</div> |
|
| 83 | ||
| 84 |
<div id="sidebar"> |
|
| 85 |
{insert name=advertise adv_name='wide_skyscraper'}
|
|
| 86 |
</div> |
|
| 0 |
- |
|
| b/templates/header.tpl | ||
|---|---|---|
| 67 | 67 |
<li><a href="{$base_url}/channels/">CHANNELS</a></li>
|
| 68 | 68 |
<li><a href="{$base_url}/groups/featured/1">GROUPS</a></li>
|
| 69 | 69 |
<li><a href="{$base_url}/friends/">FRIENDS</a></li>
|
| 70 |
<li><a href="{$base_url}/members/">PEOPLE</a></li>
|
|
| 70 | 71 |
</ul> |
| 71 | 72 |
</div> |
| 72 | 73 | |
| 73 |
- |
|