function change_scope_form($id_photo, $error = '') { $header = "<span class=header1>Изменение области видимости</span>"; $query = "SELECT `id_photo`, `photo`.`name` 'pname', `medium`, `original`, alb.`name` 'albname', `scope`, `descr`,\n\t\t\t\t DATE_FORMAT(`pubdate`, '%e.%m.%Y %k:%i:%s') 'pubdate', alb.`id_album` 'idalbum' \n\t\t\tFROM `photo` LEFT JOIN `album` alb ON `photo`.`id_album`=alb.`id_album`\n\t\t\tWHERE `photo`.`id_user`=" . $_SESSION['id_user'] . " AND `medium`!='' AND `photo`.`id_photo`=" . $id_photo; $row_photos = mysql_fetch_assoc($this->q($query)); $comments = $this->q("SELECT `comment`.`comment_txt` 'commenttxt', `comment`.`date` 'date', u.`name` 'user', `anonymous`\n\t\t\t\t\t\t\t FROM `comment` \n\t\t\t\t\t\t\t LEFT JOIN `user` u ON `comment`.`id_user` = u.`id_user`\n\t\t\t\t\t\t\t WHERE `comment`.`id_photo`=" . $id_photo); $num_com = mysql_num_rows($comments); if (isset($_SESSION['id_user']) and $_SESSION['id_user'] == $row_photos['author']) { $scope_vis = $row_photos['scope']; } else { $scope_vis = ""; } $albpht[1] = new medium_photo($row_photos['id_photo'], $row_photos['pname'], $row_photos['medium'], $row_photos['original'], $row_photos['pubdate'], $num_com, $scope_vis, $row_photos['descr'], $row_photos['tag'], $row_photos['idalbum'], $_SESSION['user'], $_SESSION['id_user'], 0, 'forbid'); $album_name = '<td colspan="11" valign="middle" align="right" height="40"> <span class="help">Альбом: </span> <span class="cur">' . $row_photos['albname'] . '</span></td> <td width=51 colspan=2></td> </tr> <tr> <td width=24><p></p></td>'; $photoalb = new section($header, 11, 3); $photoalb->add_phts_in_alb($albpht, $album_name, true); $scope_box[1] = $row_photos['scope']; if ($error != '') { $scope_box = $_SESSION['scopebox']; } $scope_form = sh_change_scope_form($id_photo, $error, $scope_box); $scope_con = new content($photoalb, $scope_form . sh_my_album_photos_spacers()); $this->set_content($scope_con); }