當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Conversation::get_members方法代碼示例

本文整理匯總了PHP中Conversation::get_members方法的典型用法代碼示例。如果您正苦於以下問題:PHP Conversation::get_members方法的具體用法?PHP Conversation::get_members怎麽用?PHP Conversation::get_members使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Conversation的用法示例。


在下文中一共展示了Conversation::get_members方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: die

	if ($user instanceof CurrentUser) {
		//User is logged in, fetch his/her inbox
		$mysqli = Database::connection();
		$sql = "SELECT t1.conversation_id, t2.conversation_name, DATE_FORMAT(t2.date_started, '%b %e, %Y - %r') as `date_started`, DATE_FORMAT(t2.date_recent_activity, '%b %e, %Y - %r') as `date_recent_activity`, t2.header
		FROM `conversation_members` as t1
		INNER JOIN `conversations` as t2
		ON t2.conversation_id = t1.conversation_id
		WHERE t1.user_id = '$user->user_id'
		ORDER BY t2.date_recent_activity DESC
		";
		$result = $mysqli->query($sql)
		or die ($mysqli->error);
		$conversations = array();
		while($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) {
			$conversation = new Conversation($row);
			$conversation->get_members();
			$sql_last = "SELECT t1.message_id, t1.message_text, t2.username, t2.email, t3.number_of_messages
			FROM `conversation_messages` as t1
			LEFT JOIN `users` as t2 
			ON t2.user_id = t1.author_id
			INNER JOIN (
				SELECT conversation_id, COUNT(message_id) as `number_of_messages`
				FROM `conversation_messages`
				WHERE conversation_id = '" . $row['conversation_id'] . "'
				AND type != '" . Message::NOTIFICATION_TYPE ."'
			) as t3
			WHERE t1.conversation_id = '" . $row['conversation_id'] . "'
			AND t1.type != '" . Message::NOTIFICATION_TYPE ."'
			ORDER BY t1.date_posted DESC 
			LIMIT 1";
			$result_get_last = $mysqli->query($sql_last)
開發者ID:kuroware,項目名稱:UoftBaddy,代碼行數:31,代碼來源:getUserConversations.php


注:本文中的Conversation::get_members方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。