// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | // | GNU General Public License for more details. | // | | // | You should have received a copy of the GNU General Public License | // | along with this program; if not, write to the Free Software Foundation, | // | Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | // | | // +--------------------------------------------------------------------------+ // require_once '../../../../../lib-common.php'; require_once '../../../../auth.inc.php'; require_once $_CONF['path'] . 'plugins/mediagallery/include/init.php'; require_once $_CONF['path'] . 'plugins/mediagallery/include/lib-upload.php'; require_once $_CONF['path'] . 'plugins/mediagallery/include/lib-batch.php'; USES_lib_story(); USES_class_story(); class mgAlbumg { var $id; var $mgid; var $sid; var $counter; var $title; var $description; var $parent; var $mgparent; var $order; var $hidden; var $cover; var $cover_filename; var $media_count;
/** * article: display comment(s) * * @param string $id Unique idenifier for item comment belongs to * @param int $cid Comment id to display (possibly including sub-comments) * @param string $title Page/comment title * @param string $order 'ASC' or 'DESC' or blank * @param string $format 'threaded', 'nested', or 'flat' * @param int $page Page number of comments to display * @param boolean $view True to view comment (by cid), false to display (by $pid) * @return mixed results of calling the plugin_displaycomment_ function */ function plugin_displaycomment_article($id, $cid, $title, $order, $format, $page, $view) { global $_CONF, $_TABLES, $LANG_ACCESS; USES_lib_story(); USES_class_story(); $retval = ''; // display story $sql = "SELECT s.*, UNIX_TIMESTAMP(s.date) AS unixdate, " . 'UNIX_TIMESTAMP(s.expire) as expireunix, ' . "u.uid, u.username, u.fullname, t.topic, t.imageurl " . "FROM {$_TABLES['stories']} AS s LEFT JOIN {$_TABLES['users']} AS u ON s.uid=u.uid " . "LEFT JOIN {$_TABLES['topics']} AS t on s.tid=t.tid " . "WHERE (sid = '" . DB_escapeString($id) . "') " . 'AND (draft_flag = 0) AND (commentcode >= 0) AND (date <= NOW())' . COM_getPermSQL('AND', 0, 2, 's') . COM_getTopicSQL('AND', 0, 't') . ' GROUP BY sid,owner_id, group_id, perm_owner, s.perm_group,s.perm_members, s.perm_anon '; $result = DB_query($sql); $nrows = DB_numRows($result); if ($A = DB_fetchArray($result)) { $story = new Story(); $story->loadFromArray($A); $retval .= STORY_renderArticle($story, 'n'); } // end $sql = 'SELECT COUNT(*) AS count, commentcode, uid, owner_id, group_id, perm_owner, perm_group, ' . "perm_members, perm_anon FROM {$_TABLES['stories']} " . "WHERE (sid = '" . DB_escapeString($id) . "') " . 'AND (draft_flag = 0) AND (commentcode >= 0) AND (date <= NOW())' . COM_getPermSQL('AND') . COM_getTopicSQL('AND') . ' GROUP BY sid,owner_id, group_id, perm_owner, perm_group,perm_members, perm_anon '; $result = DB_query($sql); $B = DB_fetchArray($result); $allowed = $B['count']; if ($allowed == 1) { $delete_option = SEC_hasRights('story.edit') && SEC_hasAccess($B['owner_id'], $B['group_id'], $B['perm_owner'], $B['perm_group'], $B['perm_members'], $B['perm_anon']) == 3; $retval .= CMT_userComments($id, $title, 'article', $order, $format, $cid, $page, $view, $delete_option, $B['commentcode'], $B['uid']); } else { $retval .= COM_showMessageText($LANG_ACCESS['storydenialmsg'], $LANG_ACCESS['accessdenied'], true); } return $retval; }