本文整理汇总了PHP中Conversation::find_by_id方法的典型用法代码示例。如果您正苦于以下问题:PHP Conversation::find_by_id方法的具体用法?PHP Conversation::find_by_id怎么用?PHP Conversation::find_by_id使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Conversation
的用法示例。
在下文中一共展示了Conversation::find_by_id方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Message
if (is_object($object) && array_key_exists($session->user_id, $object->users)) {
$group_id = $database->escape_value($_GET['group_id']);
$c_id = Group::find_c_id_for_group($group_id);
} else {
$group_id = 0;
$c_id = 0;
}
} else {
$group_id = 0;
$c_id = 0;
}
/*if(isset($_GET['c_id']) && ($c_id == 0 || $group_id == 0)){$c_id = $_GET['c_id'];$object = Group::find_group_for_c_id($c_id);if(is_object($object) && array_key_exists($session->user_id,$object->users)){$c_id = $database->escape_value($_GET['c_id']);$group_id = Group::find_group_for_c_id($c_id);}else{$c_id = 0;$group_id = 0;}}else{$c_id = 0;$group_id = 0;}*/
if (isset($_POST['send_message'])) {
$c_id = $database->escape_value($_POST['c_id']);
if ($c_id != 0) {
$object = Conversation::find_by_id($c_id);
$group_id = Group::find_group_id_for_c_id($c_id);
if ($object->from_id === $group_id) {
$message_to_send = new Message();
$message_to_send->c_id = $c_id;
$message_to_send->message = $database->escape_value($_POST['message']);
$message_to_send->from_id = $session->user_id;
$message_to_send->to_id = NULL;
$message_to_send->timestamp = strftime("%Y-%m-%d %H:%M:%S", time());
$message_to_send->image = $database->escape_value(NULL);
if ($message_to_send->create()) {
Group::change_timestamp($group_id);
redirect_to("index.php?msg=group&group_id={$group_id}&c_id=" . $c_id);
} else {
echo "Message creation failed";
}