Skip to content

Commit

Permalink
added update_category_contents_count() to Content API
Browse files Browse the repository at this point in the history
  • Loading branch information
bnvk committed Feb 29, 2012
1 parent ccf13c4 commit 273b613
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion application/libraries/Social_igniter.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function profile_image($user_id, $image, $email_hash=NULL, $size='medium')
elseif (!file_exists($image_file) AND file_exists($image_original))
{
$this->ci->load->model('image_model');
$this->ci->image_model->make_thumbnail(config_item('users_images_folder').$user_id.'/', $image, 'users', $size);
$this->ci->image_model->make_thumbnail(config_item('users_images_folder').$user_id, $image, 'users', $size);
$picture = base_url().$image_file;
}
else
Expand Down Expand Up @@ -904,6 +904,8 @@ function update_content($content_data, $user_id, $activity_data=FALSE)

if ($update)
{
if ($content_data['category_id']) $this->ci->social_tools->update_category_contents_count($content_data['category_id']);

$activity_info = array(
'site_id' => $update->site_id,
'user_id' => $user_id,
Expand Down
6 changes: 3 additions & 3 deletions application/models/image_model.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@ function __construct()

/* Checks if Thumbnail exists, if not generates it
@params string, string, string, string
@return
@return
*/
function get_thumbnail($create_path, $image_name, $module, $thumb)
{
$original = $create_path.'/'.$image_name;
$thumbnail = $create_path.'/'.$thumb.'_'.$image_name;

// If Thumbnail Exists
if (file_exists($thumbnail))
{
return $thumbnail;
return $thumbnail;
}
else
{
Expand Down

0 comments on commit 273b613

Please sign in to comment.