You are here

function photos_comment in Album Photos 6.2

7 string references to 'photos_comment'
photos_admin_settings in inc/photos.admin.inc
photos_album_page in inc/photos.album.inc
photos_file_del in ./photos.module
photos_form_alter in ./photos.module
photos_image_page in inc/photos.image.inc

... See full list

File

./photos.module, line 524

Code

function photos_comment(&$comment, $op) {
  switch ($op) {
    case 'insert':
      if ($comment['photos_fid']) {
        db_query("INSERT INTO {x_vote} (fid, cid) VALUES (%d, %d)", $comment['photos_fid'], $comment['cid']);
        db_query('UPDATE {x_image} SET comcount = (SELECT COUNT(fid) FROM {x_vote} WHERE fid = %d) WHERE fid = %d', $comment['photos_fid'], $comment['photos_fid']);
      }
      break;
    case 'delete':
      db_query('DELETE FROM {x_vote} WHERE cid = %d', $comment->cid);
      break;
  }
}