Fixed : Collection items pagination, for some unknown it stopped working

Fixed : Default thumb output
Fixed : pagination function
Fixed : Photo thumb height in channel page
Fixed : view_photo.html, Photo rating was not showing
Fixed : collection in watch_video.html
Fixed : Unwanted queries in view_collection.html
This commit is contained in:
Fawaz 2011-01-29 10:50:02 +00:00
parent 3d3a344d7d
commit 150ff59ad3
7 changed files with 20 additions and 19 deletions

View file

@ -894,7 +894,7 @@ if(!empty($mode))
echo json_encode($itemsArray); echo json_encode($itemsArray);
} else } else
return false; echo json_encode(array("error"=>TRUE));
} }
break; break;

View file

@ -1183,7 +1183,7 @@ class CBPhotos
$query_field[] = "userid"; $query_field[] = "userid";
if(!$array['userid']) if(!$array['userid'])
{ $query_val[] = $userid; $userid = userid(); } { $userid = userid(); $query_val[] = $userid; }
else else
{ $query_val[] = $array['userid']; $userid = $array['userid']; } { $query_val[] = $array['userid']; $userid = $array['userid']; }
@ -1623,9 +1623,10 @@ class CBPhotos
{ {
global $Cbucket; global $Cbucket;
$details = $p['details']; $details = $p['details'];
$output = $p['output'];
if(empty($details)) if(empty($details))
{ {
return $this->default_thumb($size); return $this->default_thumb($size,$output);
} else { } else {
//Calling Custom Functions //Calling Custom Functions
if(count($Cbucket->custom_get_photo_funcs) > 0) if(count($Cbucket->custom_get_photo_funcs) > 0)
@ -1655,7 +1656,7 @@ class CBPhotos
$photo = $details; $photo = $details;
if(empty($photo['photo_id']) || empty($photo['photo_key'])) if(empty($photo['photo_id']) || empty($photo['photo_key']))
return $this->default_thumb($size); return $this->default_thumb($size,$output);
else else
{ {
if(!empty($photo['filename']) && !empty($photo['ext'])) if(!empty($photo['filename']) && !empty($photo['ext']))
@ -1699,7 +1700,7 @@ class CBPhotos
if(empty($return_thumb)) if(empty($return_thumb))
{ {
$this->default_thumb($size); $this->default_thumb($size,$output);
} else { } else {
if($p['assign'] != NULL) if($p['assign'] != NULL)
assign($p['assign'],$return_thumb); assign($p['assign'],$return_thumb);
@ -1784,7 +1785,7 @@ class CBPhotos
return $img; return $img;
} }
} else { } else {
return $this->default_thumb($size); return $this->default_thumb($size,$output);
} }
} }
} }
@ -2014,7 +2015,7 @@ class CBPhotos
/** /**
* Used to return default thumb * Used to return default thumb
*/ */
function default_thumb($size=NULL,$output='html') function default_thumb($size=NULL,$output=NULL)
{ {
if($size != "_t" && $size != "_m") if($size != "_t" && $size != "_m")
$size = "_m"; $size = "_m";

View file

@ -1166,12 +1166,12 @@ function onReload_item()
function pagination(object,cid,type,pageNumber) function pagination(object,cid,type,pageNumber)
{ {
var obj = $(object), objID = obj.id, var obj = $(object), objID = obj.id,
parent = obj.parent(), parentID, innerHTML = obj.html(); paginationParent = obj.parent(), paginationParentID, paginationInnerHTML = obj.html();
if(parent.attr('id')) if(paginationParent.attr('id'))
parentID = parent.attr('id') paginationParentID = parent.attr('id')
else else
{ parent.attr('id','loadMoreParent'); parentID = parent.attr('id'); } { paginationParent.attr('id','loadMoreParent'); paginationParentID = paginationParent.attr('id'); }
newCall = newCall =
$.ajax({ $.ajax({
@ -1181,15 +1181,15 @@ function pagination(object,cid,type,pageNumber)
data: { mode: "moreItems", page:pageNumber, cid: cid, type: type }, data: { mode: "moreItems", page:pageNumber, cid: cid, type: type },
beforeSend: function() { obj.removeAttr('onClick'); obj.html(loading) }, beforeSend: function() { obj.removeAttr('onClick'); obj.html(loading) },
success : function(data) { success : function(data) {
if(!data) if(data['error'])
{ {
if(object.tagName == "BUTTON") if(object.tagName == "BUTTON")
obj.attr('disabled','disabled'); obj.attr('disabled','disabled');
obj.removeAttr('onClick'); obj.html('No more '+type); obj.removeAttr('onClick'); obj.html('No more '+type);
} else { } else {
$('#collectionItemsList').append(data['content']); $('#collectionItemsList').append(data['content']);
$('#NewPagination').html(data['pagination']); $('#NewPagination').html(data['pagination']);
obj.html(innerHTML); obj.html(paginationInnerHTML);
} }
} }
}); });

View file

@ -50,6 +50,6 @@
{if $display_type == "channel_page"} {if $display_type == "channel_page"}
<li class="itemBox" onclick="loadObject(this,'photos','{$photo.photo_id}','viewingArea')"> <li class="itemBox" onclick="loadObject(this,'photos','{$photo.photo_id}','viewingArea')">
{get_photo details=$photo output='html' width='110' size='m' style='display:block;margin:0px auto;'} {get_photo details=$photo output='html' width='110' height='64' size='m' style='display:block;margin:0px auto;'}
</li> <!-- itemBox {$photo.photo_key} end --> </li> <!-- itemBox {$photo.photo_key} end -->
{/if} {/if}

View file

@ -9,7 +9,7 @@
<div style="height:10px;"></div> <div style="height:10px;"></div>
<div class="video_actions_cont clearfix"> <div class="video_actions_cont clearfix">
<div class="rating_container"> <div class="rating_container">
{show_rating rating=$photo.rating ratings=$photo.rated_by total='10' id=$photo.photo_id type=photo} {show_video_rating rating=$photo.rating ratings=$photo.rated_by total='10' id=$photo.photo_id type=photo}
</div> </div>
<div style="float:left; margin-left:5px;" class="actions clearfix"> <div style="float:left; margin-left:5px;" class="actions clearfix">
<ul> <ul>

View file

@ -158,7 +158,7 @@ onclick='$(this).toggleClass("watch_vids_head_closed");$("#vid_collections").sli
This video is found in following collections This video is found in following collections
{foreach from=$collections item=collection name=collect} {foreach from=$collections item=collection name=collect}
<div class="watch_collect_item"> <div class="watch_collect_item">
{$smarty.foreach.collect.iteration}. <a href="{$cbcollection->collection_links($collection,'view')}">{$collection.collection_name}</a> {$smarty.foreach.collect.iteration}. <a href="{$cbcollection->collection_links($collection.collection_id,'view')}">{$collection.collection_name}</a>
</div> </div>
{/foreach} {/foreach}
{/if} {/if}

View file

@ -33,7 +33,7 @@ if($cbcollection->is_viewable($c))
case "v": case "v":
{ {
$items = $cbvideo->collection->get_collection_items_with_details($c,$order,$get_limit); $items = $cbvideo->collection->get_collection_items_with_details($c,$order,$get_limit);
$count = $cbvideo->collection->get_collection_items_with_details($c,NULL,NULL,TRUE); //$count = $cbvideo->collection->get_collection_items_with_details($c,NULL,NULL,TRUE);
} }
break; break;
@ -42,7 +42,7 @@ if($cbcollection->is_viewable($c))
case "p": case "p":
{ {
$items = $cbphoto->collection->get_collection_items_with_details($c,$order,$get_limit); $items = $cbphoto->collection->get_collection_items_with_details($c,$order,$get_limit);
$count = $cbphoto->collection->get_collection_items_with_details($c,NULL,NULL,TRUE); //$count = $cbphoto->collection->get_collection_items_with_details($c,NULL,NULL,TRUE);
} }
break; break;
} }