Fixed : mySQL Query of total_collections in 2.0.91~2.1

Fixed : if Sub-categories are OFF, then Parent dropdown menu should not display
Updated : channelObjects JS function
Added : Now in channelObjects function you can define smarty variables
Added : Order for sub-categories
Fixed : Joined groups now does not include owned groups
Fixed : Functions that create buttons
Fixed : Removed HTML Tags from Video Description for Facebook Submission
Fixed : user_collections.php PARENT_PAGE and THIS_PAGE
Fixed : user_photos.php favorite case
Fixed : Removed wmode from Pak Player
This commit is contained in:
Fawaz 2011-03-26 13:57:39 +00:00
parent cacfa0b886
commit 06e7211387
13 changed files with 104 additions and 37 deletions

View file

@ -58,7 +58,7 @@ INSERT into cb_config (name,value) VALUES
('collection_items_page','20');
ALTER TABLE `cb_users` ADD `total_photos` BIGINT( 255 ) NOT NULL AFTER `total_comments` ,
ADD `total_collections` BIGINT( 255 ) NOT NULL AFTER `total_photos`;
ALTER TABLE `cb_users` ADD `total_collections` BIGINT( 255 ) NOT NULL AFTER `total_photos`;
ALTER TABLE `cb_collections` ADD `rating` BIGINT( 20 ) NOT NULL;
ALTER TABLE `cb_collections` ADD `rated_by` BIGINT( 20 ) NOT NULL AFTER `rating` ;

View file

@ -28,12 +28,15 @@
<td valign="top" class="td_body">Category Description*</td>
<td class="td_body"><textarea name="desc" id="desc" cols="33" rows="5">{'desc'|post_form_val}</textarea></td>
</tr>
{assign var=useSubs value=func->config(use_subs)}
{if $useSubs == 1}
<tr>
<td valign="top" class="td_body">Parent Category</td>
<td class="td_body">
{cbCategories output="dropdown" name="parent_cat" id="parent_cat" blank_option=TRUE echo=TRUE}
</td>
</tr>
</tr>
{/if}
<tr>
<td valign="top" class="td_body">Make Default Category</td>
<td class="td_body"><p>

View file

@ -270,7 +270,37 @@ if(!empty($mode))
default:
{
$id = $_POST['id'];
$cbvideo->action->report_it($id);
$reported = $cbvideo->action->report_it($id);
/*if(!error()){
/* SENDING EMAIL TO ADMIN
$template = $cbemail->get_template('flag_template');
$video = $cbvideo->get_video_details($id);
$emailVars = array(
"{video_link}" => videoLink($video),
"{video_title}" => $video['title'],
"{flag_reason}" => flag_type(post('flag_type')),
"{type}" => "video"
);
$admins = $userquery->get_level_users(1,false,'userid,email');
$libs = $userquery->get_level_users(17,false,'userid,email');
if($libs)
$users = array_merge($admins,$libs);
else
$users = $admins;
foreach ($users as $user)
{
if(isValidEmail($user['email']))
$emailsArray[] = $user['email'];
}
if(!is_array($var))
$var = array();
$vars = array_merge($emailVars,$var);
$subj = $cbemail->replace($template['email_template_subject'],$vars);
$msg = nl2br($cbemail->replace($template['email_template'],$vars));
cbmail(array('to'=>$emailsArray,'from'=>WEBSITE_EMAIL,'subject'=>$subj,'content'=>$msg));
}*/
}
break;
@ -1029,6 +1059,12 @@ if(!empty($mode))
{
$contentType = strtolower(mysql_clean($_POST['content']));
$u = $userquery->get_user_details($_POST['user']);
$assign = $_POST['assign'];
if(is_array($assign))
{
foreach($assign as $var=>$value)
assign($var,$value);
}
switch($contentType)
{
case "videos" :

View file

@ -173,6 +173,7 @@ abstract class CBCategory
return false;
{
$orderby = $params['orderby']; $order = $params['order'];
$finalOrder = $orderby.' '.$order;
if($params['limit_sub'])
{
if(is_numeric($params['limit_sub']))
@ -182,8 +183,9 @@ abstract class CBCategory
else
$limit = NULL;
}
$subCats = $db->select(tbl($this->cat_tbl),"*"," parent_id = '$category_id'",$limit," $orderby $order");
if($params['sub_order'])
$finalOrder = $params['sub_order'];
$subCats = $db->select(tbl($this->cat_tbl),"*"," parent_id = '$category_id'",$limit," $finalOrder");
if($subCats)
{

View file

@ -2039,9 +2039,9 @@ class CBGroups extends CBCategory
function user_joined_groups($uid,$limit=NULL)
{
global $db;
# REF QUERY : SELECT * FROM group_members,groups WHERE group_members.userid = '1' AND group_members.group_id = groups.group_id
# REF QUERY : SELECT * FROM group_members,groups WHERE group_members.userid = '1' AND group_members.group_id = groups.group_id AND groups_members.userid != groups.userid
$result = $db->select(tbl($this->gp_tbl).','.tbl($this->gp_mem_tbl),"*",tbl($this->gp_mem_tbl).".userid='$uid' AND
".tbl($this->gp_mem_tbl).".group_id = ".tbl($this->gp_tbl).".group_id",$limit,tbl($this->gp_tbl).".group_name");
".tbl($this->gp_mem_tbl).".group_id = ".tbl($this->gp_tbl).".group_id AND ".tbl($this->gp_mem_tbl).".userid != ".tbl($this->gp_tbl).".userid",$limit,tbl($this->gp_tbl).".group_name");
if($db->num_rows>0)
return $result;
else

View file

@ -1207,7 +1207,7 @@ class CBPhotos
$query_field[] = "filename";
$query_val[] = $array['filename'];
if($array['server_url'])
if($array['server_url'] && $array['server_url'] != "undefined")
{
$query_field[] = "server_url";
$query_val[] = $array['server_url'];
@ -1838,7 +1838,19 @@ class CBPhotos
$text = lang('download_photo');
if(config('photo_download') == 1 && !empty($p))
{
if($params['output'] == "" || $params['output'] == 'link')
if($params['return_url'])
{
$output = $this->photo_links($p,'download_photo');
if($params['assign'])
{
assign($params['assign'],$output);
return;
}
else
return $output;
}
if($params['output'] == '' || $params['output'] == 'link')
{
$output .= "<a href='".$this->photo_links($p,'download_photo')."'";
if($params['id'])
@ -1872,7 +1884,10 @@ class CBPhotos
$output .= '>'.$text.'</div>';
}
echo $output;
if($params['assign'])
assign($params['assign'],$output);
else
return $output;
}
}
@ -1895,6 +1910,18 @@ class CBPhotos
if($details['type'] == 'photos' && $details['userid'] == user_id())
{
$output = $arr['output'];
if($arr['return_url'])
{
$result = $this->photo_links($details,'upload_more');
if($arr['assign'])
{
assign($arr['assign'],$result);
return;
}
else
return $result;
}
if(empty($output) || $output == "button")
{
$result .= '<button type="button"';
@ -1970,7 +1997,10 @@ class CBPhotos
$result .= ">".$text."</a>";
}
echo $result;
if($arr['assign'])
assign($arr['assign'],$result);
else
return $result;
} else {
return FALSE;
}

View file

@ -444,21 +444,21 @@
function upload_photo_button($params)
{
global $cbphoto;
$cbphoto->upload_photo_button($params);
return $cbphoto->upload_photo_button($params);
}
//Photo Embed Cides
function photo_embed_codes($params)
{
global $cbphoto;
$cbphoto->photo_embed_codes($params);
return $cbphoto->photo_embed_codes($params);
}
//Create download button
function photo_download_button($params)
{
global $cbphoto;
$cbphoto->download_button($params);
return $cbphoto->download_button($params);
}
//Function Used To Validate Email

View file

@ -1309,11 +1309,11 @@ function loadObject(currentDOM,type,objID,container)
}
}
function channelObjects(object,div,type,user)
function channelObjects(object,div,type,user,assign)
{
var obj = $(object), curRel = obj.attr('rel'),
DIV = $(div), oldRel = obj.parents('ul').find('a.selected').attr('rel');
if(curRel)
{
if($("#"+curRel).css('display') == 'block')
@ -1333,7 +1333,7 @@ function channelObjects(object,div,type,user)
url : page,
type : "POST",
dataType : "json",
data : ({ mode : "channelObjects", content : type, user : user}),
data : ({ mode : "channelObjects", content : type, user : user, assign : assign}),
beforeSend : function() { obj.append(loading_img) },
success : function(data)
{

View file

@ -1,8 +1,4 @@
<a
href="{if !$ytcode}{$normal_vid_file}{else}api:{$ytcode}{/if}"
style="display:block;width:{$player_data.width}; height:{$player_data.height}"
id="the_Video_Player">
</a>
<a href="{if !$ytcode}{$normal_vid_file}{else}api:{$ytcode}{/if}" style="display:block;width:{$player_data.width}; height:{$player_data.height}" id="the_Video_Player"></a>
<script language="JavaScript">
@ -47,7 +43,7 @@ hq_function = pakplayer_hq;
{/literal}
var bufferingStopped = false;
var menu = new Array("menu","embed/share","settings/playlist","comments","donate");
flowplayer("the_Video_Player", {ldelim}"src":"{$pak_player_url}/pakplayer{if $Cbucket->configs.pak_license}.unlimited{/if}.swf","wmode":"transparent"{rdelim},
flowplayer("the_Video_Player", {ldelim}"src":"{$pak_player_url}/pakplayer{if $Cbucket->configs.pak_license}.unlimited{/if}.swf"{rdelim},
{literal}{{/literal}
{if $Cbucket->configs.pak_license}
key : '{$Cbucket->configs.pak_license}',
@ -63,7 +59,7 @@ flowplayer("the_Video_Player", {ldelim}"src":"{$pak_player_url}/pakplayer{if $Cb
{/foreach}
{else}
background: "url("+pakplayer_path+"/bg.png) repeat",
url: "pakplayer.controls.swf"
url: "pak_player.controls.swf"
{/if}
{if $youtube}
@ -82,11 +78,10 @@ flowplayer("the_Video_Player", {ldelim}"src":"{$pak_player_url}/pakplayer{if $Cb
},
canvas: {
backgroundColor: '#000000', // For some reason we have define this :|
backgroundColor: '#000000', // For some reason we have to define this :|
backgroundGradient : 'none',
background : '#000000 url('+splash_img+') no-repeat 50pct 50pct'
}
,
},
clip:
{

View file

@ -38,7 +38,7 @@
<div class="upload_info">
<div class="account_form">
<div class="field clearfix">
<label for="colleciton_thumb" class="label">{lang code=collection_thumb"}</label>
<label for="collection_thumb" class="label">{lang code=collection_thumb"}</label>
<div style="width:140px; float:left" align="center">
<img src="{$cbcollection->get_thumb($c,NULL)}" />
</div>
@ -118,9 +118,9 @@
<td width="25"><input type="checkbox" name="checkall" onclick="checkUncheckAll(this);"/>
</td>
<td>{lang code='title'}</td>
<td width="100">{lang code='date_added'}</td>
<td width="100">{lang code='views'}</td>
<td width="100" class="last_td">{lang code='remove'}</td>
<td width="100" align="center">{lang code='date_added'}</td>
<td width="100" align="center">{lang code='views'}</td>
<td width="100" class="last_td" align="center">{lang code='remove'}</td>
</tr>
</table>
</div>

View file

@ -449,7 +449,7 @@ $(document).ready(function() {
{if $smarty.const.THIS_PAGE=='watch_video' || $object.videoid}
{if $object.videoid}{assign var=vdo value=$object} {/if}
<meta property="og:title" content="{$vdo.title}" />
<meta property="og:description" content="{$vdo.description|description}" />
<meta property="og:description" content="{$vdo.description|description|strip_tags}" />
<meta property="og:image" content="{getThumb vdetails=$vdo}" />
<meta name="medium" content="video" />
{/if}
@ -457,7 +457,7 @@ $(document).ready(function() {
{if $object.photo_id}
<meta property="og:title" content="{$object.photo_title}" />
<meta property="og:description" content="{$object.photo_description|description}" />
<meta property="og:image" content="{get_photo details=$object size='t' output='non_html' alt=$object.photo_title}" />
<meta property="og:image" content="{get_photo details=$object size='m' output='non_html' alt=$object.photo_title}" />
<meta name="medium" content="image" />
{/if}

View file

@ -7,8 +7,8 @@
****************************************************************
*/
define("THIS_PAGE",'user_photos');
define("PARENT_PAGE",'photos');
define("THIS_PAGE",'user_collections');
define("PARENT_PAGE",'collections');
require 'includes/config.inc.php';
$pages->page_redir();

View file

@ -45,14 +45,15 @@ if($user)
break;
case "favorites":
case "fav_photots":
case "fav_photos":
case "favorite":
{
$limit = create_query_limit($page,config('photo_user_favorites'));
assign("the_title",$user['username']." ".lang('Favorite')." ".lang('photos'));
$favP = array("user"=>$user['userid'],"limit",$limit);
$photos = $cbphoto->action->get_favorites($favP);
$favP['count_only'] = true;
$total_rows = $cbphoto->action->get_favorites($params);
$total_rows = $cbphoto->action->get_favorites($favP);
$total_pages = count_pages($total_rows,config('photo_user_favorites'));
}
break;