本文整理汇总了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)