From 1a42580ad44f768ba8d4eb0669f3b8be03670e04 Mon Sep 17 00:00:00 2001 From: friendica Date: Sun, 22 Dec 2013 18:37:39 -0800 Subject: remove a couple of mysql reserved words from being used as table or row names. For this round we're getting 'group' and 'desc'. Warning: potentially destabilising as this touches a lot of code. --- mod/photos.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'mod/photos.php') diff --git a/mod/photos.php b/mod/photos.php index ff58e18d9..3c724ddc2 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -281,7 +281,7 @@ function photos_post(&$a) { ); if(count($p)) { $ext = $phototypes[$p[0]['type']]; - $r = q("UPDATE `photo` SET `desc` = '%s', `album` = '%s', `allow_cid` = '%s', `allow_gid` = '%s', `deny_cid` = '%s', `deny_gid` = '%s' WHERE `resource_id` = '%s' AND `uid` = %d", + $r = q("UPDATE `photo` SET `description` = '%s', `album` = '%s', `allow_cid` = '%s', `allow_gid` = '%s', `deny_cid` = '%s', `deny_gid` = '%s' WHERE `resource_id` = '%s' AND `uid` = %d", dbesc($desc), dbesc($albname), dbesc($str_contact_allow), @@ -299,7 +299,7 @@ function photos_post(&$a) { /* Don't make the item visible if the only change was the album name */ $visibility = 0; - if($p[0]['desc'] !== $desc || strlen($rawtags)) + if($p[0]['description'] !== $desc || strlen($rawtags)) $visibility = 1; if(! $item_id) { @@ -507,7 +507,7 @@ function photos_post(&$a) { $arr['object'] .= xmlify('' . "\n"); $arr['object'] .= '' . "\n"; - $arr['target'] = '' . ACTIVITY_OBJ_PHOTO . '' . $p[0]['desc'] . '' + $arr['target'] = '' . ACTIVITY_OBJ_PHOTO . '' . $p[0]['description'] . '' . $a->get_baseurl() . '/photos/' . $owner_record['nickname'] . '/image/' . $p[0]['resource_id'] . ''; $arr['target'] .= '' . xmlify('' . "\n" . '') . ''; @@ -751,7 +751,7 @@ function photos_content(&$a) { else $order = 'DESC'; - $r = q("SELECT `resource_id`, `id`, `filename`, type, max(`scale`) AS `scale`, `desc` FROM `photo` WHERE `uid` = %d AND `album` = '%s' + $r = q("SELECT `resource_id`, `id`, `filename`, type, max(`scale`) AS `scale`, `description` FROM `photo` WHERE `uid` = %d AND `album` = '%s' AND `scale` <= 4 and (photo_flags = %d or photo_flags = %d ) $sql_extra GROUP BY `resource_id` ORDER BY `created` $order LIMIT %d , %d", intval($owner_uid), dbesc($album), @@ -819,11 +819,11 @@ function photos_content(&$a) { if($a->get_template_engine() === 'internal') { $imgalt_e = template_escape($rr['filename']); - $desc_e = template_escape($rr['desc']); + $desc_e = template_escape($rr['description']); } else { $imgalt_e = $rr['filename']; - $desc_e = $rr['desc']; + $desc_e = $rr['description']; } @@ -864,7 +864,7 @@ function photos_content(&$a) { // fetch image, item containing image, then comments - $ph = q("SELECT aid,uid,xchan,resource_id,created,edited,title,`desc`,album,filename,`type`,height,width,`size`,scale,profile,photo_flags,allow_cid,allow_gid,deny_cid,deny_gid FROM `photo` WHERE `uid` = %d AND `resource_id` = '%s' + $ph = q("SELECT aid,uid,xchan,resource_id,created,edited,title,`description`,album,filename,`type`,height,width,`size`,scale,profile,photo_flags,allow_cid,allow_gid,deny_cid,deny_gid FROM `photo` WHERE `uid` = %d AND `resource_id` = '%s' and (photo_flags = %d or photo_flags = %d ) $sql_extra ORDER BY `scale` ASC ", intval($owner_uid), dbesc($datum), @@ -1020,7 +1020,7 @@ function photos_content(&$a) { if($can_post) { $album_e = $ph[0]['album']; - $caption_e = $ph[0]['desc']; + $caption_e = $ph[0]['description']; $aclselect_e = populate_acl($ph[0]); $edit = array( @@ -1190,7 +1190,7 @@ function photos_content(&$a) { '$photo' => $photo, '$prevlink' => $prevlink, '$nextlink' => $nextlink, - '$desc' => $ph[0]['desc'], + '$desc' => $ph[0]['description'], '$tags' => $tags_e, '$edit' => $edit, '$likebuttons' => $likebuttons, -- cgit v1.2.3