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


PHP Comments::user_can_edit_post方法代码示例

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


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

示例1: tra

		if ($tikilib->register_user_vote($user, 'comment' . $_REQUEST['comments_threadId'], $_REQUEST['comments_vote'], range(1, 5))) {
			$commentslib->vote_comment($_REQUEST['comments_threadId'], $user, $_REQUEST['comments_vote']);
		}
		$_REQUEST['comments_threadId'] = 0;
		$smarty->assign('comments_threadId', 0);
	}
}

if ($user) {
	$userinfo = $userlib->get_user_info($user);
	$smarty->assign_by_ref('userinfo', $userinfo);
}

if (isset($_REQUEST['comments_remove']) && isset($_REQUEST['comments_threadId'])) {
	if ($tiki_p_admin_forum == 'y' 
			|| ($commentslib->user_can_edit_post($user, $_REQUEST['comments_threadId']) && $tiki_p_forum_post_topic == 'y')
	) {
		$access->check_authenticity();
		$comments_show = 'y';
		$commentslib->remove_comment($_REQUEST['comments_threadId']);
		$commentslib->register_remove_post($_REQUEST['forumId'], 0);
	} else { // user can't edit this post
		$smarty->assign('msg', tra('You are not permitted to remove someone else\'s post!'));
		$smarty->assign('errortype', 'no_redirect_login');
		$smarty->display('error.tpl');
		die;
	}
	unset($_REQUEST['comments_threadId']);
}

if ($_REQUEST['comments_threadId'] > 0) {
开发者ID:railfuture,项目名称:tiki-website,代码行数:31,代码来源:tiki-view_forum.php

示例2: isset

         }
         // Handle "Post as Anonymous" feature
         $post_author = $post_as_anonymous ? '' : $user;
         $qId = $commentslib->post_new_comment($comments_objectId, $parent_id, $post_author, $_REQUEST["comments_title"], $_REQUEST["comments_data"], $message_id, $in_reply_to, 'n', '', '', isset($_REQUEST['contributions']) ? $_REQUEST['contributions'] : '', $anonymous_name);
         if ($object[0] != "forum") {
             $smarty->assign("comments_parentId", 0);
             // to display all the comments
             $_REQUEST["comments_parentId"] = 0;
         }
         $_REQUEST["comments_reply_threadId"] = $_REQUEST["comments_parentId"];
         // to have the right re:
         $smarty->assign("comments_reply_threadId", $_REQUEST["comments_parentId"]);
         // without the flag
     } else {
         $qId = $_REQUEST["comments_threadId"];
         if ($tiki_p_edit_comments == 'y' && (!isset($forum_mode) || $forum_mode == 'n') || ($tiki_p_forum_post == 'y' || $tiki_p_admin_forum == 'y') && isset($forum_mode) && $forum_mode == 'y' || $commentslib->user_can_edit_post($user, $_REQUEST["comments_threadId"])) {
             $commentslib->update_comment($_REQUEST["comments_threadId"], $_REQUEST["comments_title"], $_REQUEST["comment_rating"], $_REQUEST["comments_data"], 'n', '', '', $comments_objectId, isset($_REQUEST['contributions']) ? $_REQUEST['contributions'] : '');
         }
     }
 }
 if (isset($_REQUEST['contributions'])) {
     unset($_REQUEST['contributions']);
 }
 $object = explode(':', $comments_objectId);
 if ($object[0] == 'forum') {
     // Deal with attachment
     if (($forum_info['att'] == 'att_all' || $forum_info['att'] == 'att_admin' && $tiki_p_admin_forum == 'y' || $forum_info['att'] == 'att_perm' && $tiki_p_forum_attach == 'y') && isset($_FILES['userfile1']) && is_uploaded_file($_FILES['userfile1']['tmp_name'])) {
         $fp = fopen($_FILES['userfile1']['tmp_name'], "rb");
         $data = '';
         $fhash = '';
         if ($forum_info['att_store'] == 'dir') {
开发者ID:Kraiany,项目名称:kraiany_site_docker,代码行数:31,代码来源:comments.php

示例3: sendForumEmailNotification

                 // The thread *WAS* successfully created.
                 if ($threadId) {
                     // Deal with mail notifications.
                     include_once 'lib/notifications/notificationemaillib.php';
                     sendForumEmailNotification('forum_post_topic', $_REQUEST['forumId'], $forum_info, $_REQUEST["comments_title"], $_REQUEST["comments_data"], $user, $_REQUEST["comments_title"], $message_id, '', $threadId);
                 }
             }
             // PROCESS ATTACHMENT HERE
             if ($threadId && isset($_FILES['userfile1']) && is_uploaded_file($_FILES['userfile1']['tmp_name'])) {
                 check_ticket('view-forum');
                 $fp = fopen($_FILES['userfile1']['tmp_name'], "rb");
                 $commentslib->add_thread_attachment($forum_info, $threadId, $fp, '', $_FILES['userfile1']['name'], $_FILES['userfile1']['type'], $_FILES['userfile1']['size']);
             }
             //END ATTACHMENT PROCESSING
             $commentslib->register_forum_post($_REQUEST["forumId"], 0);
         } elseif ($tiki_p_admin_forum == 'y' || $commentslib->user_can_edit_post($user, $_REQUEST["comments_threadId"])) {
             $commentslib->update_comment($_REQUEST["comments_threadId"], $_REQUEST["comments_title"], '', $_REQUEST["comments_data"], $_REQUEST["comment_topictype"], $_REQUEST['comment_topicsummary'], $_REQUEST['comment_topicsmiley']);
             // PROCESS ATTACHMENT HERE
             if ($threadId && isset($_FILES['userfile1']) && is_uploaded_file($_FILES['userfile1']['tmp_name'])) {
                 check_ticket('view-forum');
                 $fp = fopen($_FILES['userfile1']['tmp_name'], "rb");
                 $commentslib->add_thread_attachment($forum_info, $_REQUEST["comments_threadId"], $fp, '', $_FILES['userfile1']['name'], $_FILES['userfile1']['type'], $_FILES['userfile1']['size']);
             }
             //END ATTACHMENT PROCESSING
         }
     }
 } else {
     $smarty->assign('msg', tra("Please wait 2 minutes between posts"));
     $smarty->display("error.tpl");
     die;
 }
开发者ID:noikiy,项目名称:owaspbwa,代码行数:31,代码来源:tiki-view_forum.php


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