Пример #1
0
 public static function insertPost(ForumPost $p)
 {
     global $db, $user;
     $db->query("\n\t\t\t\tINSERT INTO forums_posts\n\t\t\t\t(topic_id, forum_id, user_id, post_text,\n\t\t\t\t\tenable_markdown, enable_smilies, enable_urls, enable_signatur,\n\t\t\t\t\tis_topic, post_time)\n\t\t\t\tVALUES\n\t\t\t\t(\n\t\t\t\t\t:tid,\n\t\t\t\t\t:fid,\n\t\t\t\t\t:uid,\n\t\t\t\t\t:content,\n\t\t\t\t\t:markdown,\n\t\t\t\t\t:smileys,\n\t\t\t\t\t:urls,\n\t\t\t\t\t:signature,\n\t\t\t\t\t:isTopic,\n\t\t\t\t\t:date\n\t\t\t\t)\n\t\t\t", array($p->getTopicID(), $p->getForumID(), $p->getUserID(), $p->getContent(), $p->isMarkdownEnabled() ? '1' : '0', $p->areSmileysEnabled() ? '1' : '0', $p->areURLsEnabled() ? '1' : '0', 1, 0, $p->getDate()));
     $db->query("\n\t\t\t\tUPDATE forums_topics\n\t\t\t\tSET last_post_time = :date\n\t\t\t\tWHERE id = :tid\n\t\t\t", array($p->getDate(), $p->getTopicID()));
     $user->addPoints(Config::get('points_newpost'));
     return $db->insert_id();
 }
Пример #2
0
 private static function getPostURL(ForumPost $p)
 {
     return './viewtopic.php?id=' . $p->getTopicID() . '&pid=' . $p->getID();
 }