当前位置: 首页>>代码示例>>PHP>>正文


PHP post::output方法代码示例

本文整理汇总了PHP中post::output方法的典型用法代码示例。如果您正苦于以下问题:PHP post::output方法的具体用法?PHP post::output怎么用?PHP post::output使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在post的用法示例。


在下文中一共展示了post::output方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: AND

    function add_dis_comment_form($id_post, $error = "")
    {
        $admin_where = "";
        if ($_SESSION['rights'] == 100) {
            $admin_where = " OR 1";
        }
        $query = "SELECT `posttext`, `photo`.`id_photo` 'id_photo', `photo`.`id_user` 'idauthor', `user`.`name` 'author',`discuss`.`title` 'dsc_title',\n\t\t\t\t\t\t `photo`.`name` 'pname', `medium`, `maxi`, `group`.`title` 'grp_title', `group`.`id_group` 'id_group',\n\t\t\t\t\t\t  DATE_FORMAT(`pubdate`, '%e.%m.%Y  %k:%i:%s') 'pubdate', `discuss`.`id_discuss` 'id_discuss', \n\t\t\t\t\t\t  DATE_FORMAT(`shootdate`, '%e.%m.%Y') 'made', alb.`id_album` 'id_album'\t  \n\t\t\t\t  FROM `post` \n\t\t\t\t  LEFT JOIN `user` ON `user`.`id_user`=`post`.`id_author` \n\t\t\t\t  LEFT JOIN `discuss` ON `discuss`.`id_discuss`=`post`.`id_discuss`\n\t\t\t\t  LEFT JOIN `group` ON `group`.`id_group`=`discuss`.`id_group`\n\t\t\t\t  LEFT JOIN `photo` ON `photo`.`id_photo`=`post`.`id_photo`\n\t\t\t\t  LEFT JOIN `album` alb ON `photo`.`id_album`=alb.`id_album`\n\t\t\t\t  WHERE `id_post`=" . $id_post . " AND \n\t\t\t\t\t( (`type`='private' AND (" . $_SESSION['id_user'] . " IN (\n\t\t\t\t\t\tSELECT `id_user` FROM `group_member` WHERE `group_member`.`id_group`=`group`.`id_group`) OR \n\t\t\t\t\t\t" . $_SESSION['id_user'] . "= `group`.`id_author`) ) OR \n\t\t\t\t\t(`type` = 'public') OR (`type` = 'public_reg') " . $admin_where . ")";
        $row_post = mysql_fetch_assoc($this->q($query));
        if ($_SESSION['rights'] == 100 or $this->membership($row_post['id_group'])) {
            if ($row_post) {
                $comments_query = "SELECT `id_dis_comment`, `dis_comment`.`comment_txt` 'commenttxt', u.`name` 'user',\n\t\t\t\t\t              \t  IF(u.`hideemail`='checked', '', u.`email`) AS email, \n\t\t\t\t\t\t\t\t\t  DATE_FORMAT(`dis_comment`.`date`, '%e.%m.%Y<font size=1> %k:%i:%s</font>') 'date',\n\t\t\t\t\t\t\t\t\t  u.`id_user` 'id_user', `avatar`, INET_NTOA(`dis_comment`.`ip`) 'ip_comment' \n\t\t\t\t\t\t\t\t  FROM `dis_comment` \n\t\t\t\t\t\t\t\t  LEFT JOIN `user` u ON `dis_comment`.`id_user` = u.`id_user`\n\t\t\t\t\t\t\t\t  WHERE `dis_comment`.`id_post`=" . $id_post . " ORDER BY `dis_comment`.`date` ASC";
                $comments = $this->q($comments_query);
                $comment_form = sh_add_comment_form(0, 0, $error, $row_post['id_discuss'], $id_post);
                if (mysql_num_rows($comments)) {
                    $comments = $this->q($comments_query);
                    while ($row_comments = mysql_fetch_assoc($comments)) {
                        if ($row_comments['anonymous'] == 'yes') {
                            $row_comments['user'] = 'аноним';
                            $row_comments['email'] = '';
                            $avatar = "<img src='images/anonym.gif'>";
                            $row_comments['id_user'] = 0;
                        } else {
                            $avatar = empty($row_comments['avatar']) ? "<img src='images/anonym.gif'>" : "<a href='index.php?go=profile&id_user=" . $row_comments['id_user'] . "'>\n\t\t\t\t\t\t\t<img src='images/" . $row_comments['avatar'] . "' border=0></a>";
                        }
                        $body_com .= sh_comments_body($row_comments['id_user'], $row_comments['user'], $avatar, $row_comments['email'], $row_comments['date'], $row_comments['commenttxt'], $row_comments['ip_comment'], $row_post['id_photo'], $row_comments['id_dis_comment'], 0);
                    }
                }
                // ФУНКЦИЯ ПРИНИМАЕТ $id_photo
                $cmnts = sh_comments($body_com, $id_post);
                $header = "<span class=header1>Добавление комментария</span>";
                $photoalb = new section($header, 4, 4);
                $html = '<td colspan="7" height=51 align="left" valign="middle"> <a href="index.php?go=group&id_group=' . $row_post['id_group'] . '" class=link title="группа">' . $row_post['grp_title'] . '</a>
						 <span class=cin>&nbsp;&raquo;&nbsp;</span> <a href="index.php?go=discuss&id_discuss=' . $row_post['id_discuss'] . '" class=link title="дискуссия">' . $row_post['dsc_title'] . '</a> 
						 </td></tr>
						 <tr><td width="24" valign=top><p></p></td>';
                $post = new post($id_post, $row_post['id_photo'], $row_post['posttext'], $row_post['maxi'], $row_post['id_album'], $row_post['idauthor'], $row_post['author'], $row_post['made'], $row_post['id_group'], $cmnts);
                $photoalb->add_html($html . $post->output());
                $photo_con = new content($photoalb, $cmnts . $comment_form);
                $this->set_content($photo_con);
            }
        }
    }
开发者ID:patim,项目名称:flogr,代码行数:42,代码来源:f.inc.php


注:本文中的post::output方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。