本文整理匯總了PHP中MakePost函數的典型用法代碼示例。如果您正苦於以下問題:PHP MakePost函數的具體用法?PHP MakePost怎麽用?PHP MakePost使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了MakePost函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: pmsgs
continue;
}
$qPM = "insert into pmsgs (userto, userfrom, date, ip, msgread) values (" . $recipient . ", " . $loguserid . ", " . time() . ", '" . $_SERVER['REMOTE_ADDR'] . "', 0)";
$rPM = Query($qPM);
$pid = mysql_insert_id();
$qPMT = "insert into pmsgs_text (pid,title,text) values (" . $pid . ", '" . justEscape($_POST['title']) . "', '" . $post . "')";
$rPMT = Query($qPMT);
}
Redirect(__("PM sent!"), "private.php?show=1", __("your PM outbox"));
exit;
}
} else {
Alert(__("Enter a message and try again."), __("Your PM is empty."));
}
} else {
Alert(__("Enter a title and try again."), __("Your PM is untitled."));
}
}
//if($_POST['text']) $prefill = htmlval($_POST['text']);
//if($_POST['title']) $trefill = htmlval($_POST['title']);
$prefill = $pm['text'];
$trefill = $pmtitle;
MakePost($pm, 0, 0, 1);
Write("\n\t<table style=\"width: 100%;\">\n\t\t<tr>\n\t\t\t<td style=\"vertical-align: top; border: none;\">\n\t\t\t\t<form action=\"showprivate.php\" method=\"post\">\n\t\t\t\t\t<table class=\"outline margin width100\">\n\t\t\t\t\t\t<tr class=\"header1\">\n\t\t\t\t\t\t\t<th colspan=\"2\">\n\t\t\t\t\t\t\t\t" . __("Edit Draft") . "\n\t\t\t\t\t\t\t</th>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr class=\"cell0\">\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t" . __("To") . "\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t<input type=\"text\" name=\"to\" style=\"width: 98%;\" maxlength=\"1024\" value=\"{2}\" />\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr class=\"cell1\">\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t" . __("Title") . "\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t<input type=\"text\" name=\"title\" style=\"width: 98%;\" maxlength=\"60\" value=\"{1}\" />\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t<tr class=\"cell0\">\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t" . __("Message") . "\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t<textarea id=\"text\" name=\"text\" rows=\"16\" style=\"width: 98%;\">{0}</textarea>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr class=\"cell2\">\n\t\t\t\t\t\t\t<td></td>\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t<input type=\"submit\" name=\"action\" value=\"" . __("Send") . "\" /> \n\t\t\t\t\t\t\t\t<input type=\"submit\" name=\"action\" value=\"" . __("Preview") . "\" />\n\t\t\t\t\t\t\t\t<input type=\"submit\" name=\"action\" value=\"" . __("Update Draft") . "\" /> \n\t\t\t\t\t\t\t\t<input type=\"submit\" name=\"action\" value=\"" . __("Discard Draft") . "\" /> \n\t\t\t\t\t\t\t\t<input type=\"hidden\" name=\"id\" value=\"{3}\" />\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</table>\n\t\t\t\t</form>\n\t\t\t</td>\n\t\t\t<td style=\"width: 200px; vertical-align: top; border: none;\">\n", $prefill, $trefill, $to, $pmid);
DoSmileyBar();
DoPostHelp();
Write("\n\t\t\t</td>\n\t\t</tr>\n\t</table>\n");
} else {
MakePost($pm, 0, 0, 1);
}
MakeCrumbs(array("Main" => "./", "Private messages" => "private.php", $pmtitle => ""), $links);
示例2: Alert
} else {
Alert(__("Enter a title and try again."), __("Your PM is untitled."));
}
}
write("\n <script type=\"text/javascript\">\n window.addEventListener(\"load\", hookUpControls, false);\n </script>\n");
$_POST['title'] = $_POST['title'];
$_POST['text'] = $_POST['text'];
if ($_POST['action'] == __("Preview")) {
if ($_POST['text']) {
$previewPost['text'] = $_POST["text"];
$previewPost['num'] = "---";
$previewPost['posts'] = "---";
$previewPost['id'] = "_";
$previewPost['options'] = 0;
foreach ($loguser as $key => $value) {
$previewPost["u_" . $key] = $value;
}
MakePost($previewPost, POST_SAMPLE, array('metatext' => __("Preview")));
}
}
if ($_POST['text']) {
$prefill = htmlspecialchars($_POST['text']);
}
if ($_POST['title']) {
$trefill = htmlspecialchars($_POST['title']);
}
if (!isset($_POST['iconid'])) {
$_POST['iconid'] = 0;
}
$form = "\n\t<form name=\"postform\" action=\"" . actionLink("sendprivate") . "\" method=\"post\">\n\t\t<table class=\"outline margin width100\">\n\t\t\t<tr class=\"header1\">\n\t\t\t\t<th colspan=\"2\">\n\t\t\t\t\t" . __("Send PM") . "\n\t\t\t\t</th>\n\t\t\t</tr>\n\t\t\t<tr class=\"cell0\">\n\t\t\t\t<td>\n\t\t\t\t\t" . __("To") . "\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<input type=\"text\" name=\"to\" style=\"width: 98%;\" maxlength=\"1024\" value=\"" . htmlspecialchars($_POST['to']) . "\" />\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr class=\"cell1\">\n\t\t\t\t<td>\n\t\t\t\t\t" . __("Title") . "\n\t\t\t\t</td>\n\t\t\t\t<td>\n\t\t\t\t\t<input type=\"text\" name=\"title\" style=\"width: 98%;\" maxlength=\"60\" value=\"{$trefill}\" />\n\t\t\t\t</td>\n\t\t\t<tr class=\"cell0\">\n\t\t\t\t<td colspan=\"2\">\n\t\t\t\t\t<textarea id=\"text\" name=\"text\" rows=\"16\" style=\"width: 98%;\">{$prefill}</textarea>\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr class=\"cell2\">\n\t\t\t\t<td></td>\n\t\t\t\t<td>\n\t\t\t\t\t<input type=\"submit\" name=\"action\" value=\"" . __("Send") . "\" />\n\t\t\t\t\t<input type=\"submit\" name=\"action\" value=\"" . __("Preview") . "\" />\n\t\t\t\t\t<input type=\"submit\" name=\"action\" value=\"" . __("Save as Draft") . "\" />\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t</table>\n\t</form>";
doPostForm($form);
示例3: foreach
$previewPost['id'] = 0;
$previewPost['options'] = 0;
if ($_POST['nopl']) {
$previewPost['options'] |= 1;
}
if ($_POST['nosm']) {
$previewPost['options'] |= 2;
}
$previewPost['mood'] = (int) $_POST['mood'];
$previewPost['has_attachments'] = !empty($attachs);
$previewPost['preview_attachs'] = $attachs;
foreach ($loguser as $key => $value) {
$previewPost['u_' . $key] = $value;
}
$previewPost['u_posts']++;
MakePost($previewPost, POST_SAMPLE);
} else {
if (isset($_POST['actionpost'])) {
//Now check if the post is acceptable.
$rejected = false;
if (!trim($_POST['text'])) {
Alert(__("Enter a message and try again."), __("Your post is empty."));
$rejected = true;
} else {
if ($thread['lastposter'] == $loguserid && $thread['lastpostdate'] >= time() - 86400 && !HasPermission('user.doublepost')) {
Alert(__("You can't double post until it's been at least one day."), __("Sorry"));
$rejected = true;
} else {
$lastPost = time() - $loguser['lastposttime'];
if ($lastPost < Settings::get("floodProtectionInterval")) {
//Check for last post the user posted.
示例4: Query
}
if (isset($_GET['from'])) {
$from = $_GET['from'];
} else {
$from = 0;
}
$rPosts = Query("\n\t\t\tSELECT\n\t\t\t\tp.*,\n\t\t\t\tpt.text, pt.revision, pt.user AS revuser, pt.date AS revdate,\n\t\t\t\tu.(_userfields), u.(rankset,title,picture,posts,postheader,signature,signsep,lastposttime,lastactivity,regdate,globalblock),\n\t\t\t\tru.(_userfields),\n\t\t\t\tdu.(_userfields)\n\t\t\tFROM\n\t\t\t\t{posts} p\n\t\t\t\tLEFT JOIN {posts_text} pt ON pt.pid = p.id AND pt.revision = p.currentrevision\n\t\t\t\tLEFT JOIN {users} u ON u.id = p.user\n\t\t\t\tLEFT JOIN {users} ru ON ru.id=pt.user\n\t\t\t\tLEFT JOIN {users} du ON du.id=p.deletedby\n\t\t\tWHERE thread={1}\n\t\t\tORDER BY date ASC LIMIT {2u}, {3u}", $loguserid, $tid, $from, $ppp);
$numonpage = NumRows($rPosts);
$pagelinks = PageLinks(actionLink("thread", $tid, "from="), $ppp, $from, $total);
if ($pagelinks) {
write("<div class=\"smallFonts pages\">" . __("Pages:") . " {0}</div>", $pagelinks);
}
if (NumRows($rPosts)) {
while ($post = Fetch($rPosts)) {
$post['closed'] = $thread['closed'];
MakePost($post, POST_NORMAL, array('tid' => $tid, 'fid' => $fid));
}
}
if ($pagelinks) {
write("<div class=\"smallFonts pages\">" . __("Pages:") . " {0}</div>", $pagelinks);
}
if ($loguserid && $loguser['powerlevel'] >= $forum['minpowerreply'] && (!$thread['closed'] || $loguser['powerlevel'] > 0) && !isset($replyWarning)) {
$ninja = FetchResult("select id from {posts} where thread={0} order by date desc limit 0, 1", $tid);
//Quick reply goes here
if (CanMod($loguserid, $fid)) {
//print $thread['closed'];
if (!$thread['closed']) {
$mod .= "<label><input type=\"checkbox\" name=\"lock\"> " . __("Close thread", 1) . "</label>\n";
} else {
$mod .= "<label><input type=\"checkbox\" name=\"unlock\"> " . __("Open thread", 1) . "</label>\n";
}
示例5: Query
<?php
$ajaxPage = true;
$id = (int) $_GET["id"];
$rPost = Query("\n\t\tSELECT\n\t\t\tp.id, p.date, p.num, p.deleted, p.deletedby, p.reason, p.options, p.mood, p.ip,\n\t\t\tpt.text, pt.revision, pt.user AS revuser, pt.date AS revdate,\n\t\t\tu.(_userfields), u.(rankset,title,picture,posts,postheader,signature,signsep,lastposttime,lastactivity,regdate,globalblock),\n\t\t\tru.(_userfields),\n\t\t\tdu.(_userfields),\n\t\t\tf.id fid\n\t\tFROM\n\t\t\t{posts} p\n\t\t\tLEFT JOIN {posts_text} pt ON pt.pid = p.id AND pt.revision = p.currentrevision\n\t\t\tLEFT JOIN {users} u ON u.id = p.user\n\t\t\tLEFT JOIN {users} ru ON ru.id=pt.user\n\t\t\tLEFT JOIN {users} du ON du.id=p.deletedby\n\t\t\tLEFT JOIN {threads} t ON t.id=p.thread\n\t\t\tLEFT JOIN {forums} f ON f.id=t.forum\n\t\tWHERE p.id={0}", $id);
if (!NumRows($rPost)) {
die(__("Unknown post ID."));
}
$post = Fetch($rPost);
if (!CanMod($loguserid, $post['fid']) && $loguserid != $post["u_id"]) {
die(__("No."));
}
echo MakePost($post, $_GET['o'] ? POST_DELETED_SNOOP : POST_NORMAL, array('tid' => $post['thread'], 'fid' => $post['fid']));
示例6: Query
$from = 0;
}
if (!$ppp) {
$ppp = 25;
}
$rPosts = Query("\n\tSELECT\n\t\tp.*,\n\t\tpt.text, pt.revision, pt.user AS revuser, pt.date AS revdate,\n\t\tu.(_userfields), u.(rankset,title,picture,posts,postheader,signature,signsep,lastposttime,lastactivity,regdate,globalblock),\n\t\tru.(_userfields),\n\t\tdu.(_userfields),\n\t\tt.id thread, t.title threadname,\n\t\tf.id fid\n\tFROM\n\t\t{posts} p\n\t\tLEFT JOIN {posts_text} pt ON pt.pid = p.id AND pt.revision = p.currentrevision\n\t\tLEFT JOIN {users} u ON u.id = p.user\n\t\tLEFT JOIN {users} ru ON ru.id=pt.user\n\t\tLEFT JOIN {users} du ON du.id=p.deletedby\n\t\tLEFT JOIN {threads} t ON t.id=p.thread\n\t\tLEFT JOIN {forums} f ON f.id=t.forum\n\tWHERE u.id={1} AND " . forumAccessControlSql() . "\n\tORDER BY date ASC LIMIT {2u}, {3u}", $loguserid, $id, $from, $ppp);
$numonpage = NumRows($rPosts);
$uname = $user["name"];
if ($user["displayname"]) {
$uname = $user["displayname"];
}
$crumbs = new PipeMenu();
$crumbs->add(new PipeMenuLinkEntry(__("Member list"), "memberlist"));
$crumbs->add(new PipeMenuHtmlEntry(userLink($user)));
$crumbs->add(new PipeMenuTextEntry(__("Posts")));
makeBreadcrumbs($crumbs);
if ($total == 0) {
Kill(__("This user hasn't made any posts yet."));
}
$pagelinks = PageLinks(actionLink("listposts", $id, "from="), $ppp, $from, $total);
if ($pagelinks) {
write("<div class=\"smallFonts pages\">" . __("Pages:") . " {0}</div>", $pagelinks);
}
if (NumRows($rPosts)) {
while ($post = Fetch($rPosts)) {
MakePost($post, POST_NORMAL, array('threadlink' => 1, 'tid' => $post['thread'], 'fid' => $post['fid'], 'noreplylinks' => 1));
}
}
if ($pagelinks) {
write("<div class=\"smallFonts pages\">" . __("Pages:") . " {0}</div>", $pagelinks);
}
示例7: foreach
$previewPost['text'] = $_POST["text"];
$previewPost['num'] = $loguser['posts'] + 1;
$previewPost['posts'] = $loguser['posts'] + 1;
$previewPost['id'] = "_";
$previewPost['options'] = 0;
if ($_POST['nopl']) {
$previewPost['options'] |= 1;
}
if ($_POST['nosm']) {
$previewPost['options'] |= 2;
}
$previewPost['mood'] = (int) $_POST['mood'];
foreach ($loguser as $key => $value) {
$previewPost["u_" . $key] = $value;
}
MakePost($previewPost, POST_SAMPLE, array('forcepostnum' => 1, 'metatext' => __("Preview")));
} else {
if (isset($_POST['actionpost'])) {
//Now check if the post is acceptable.
$rejected = false;
if (!$_POST['text']) {
Alert(__("Enter a message and try again."), __("Your post is empty."));
$rejected = true;
} else {
if ($thread['lastposter'] == $loguserid && $thread['lastpostdate'] >= time() - 86400 && $loguser['powerlevel'] < 3) {
Alert(__("You can't double post until it's been at least one day."), __("Sorry"));
$rejected = true;
} else {
$lastPost = time() - $loguser['lastposttime'];
if ($lastPost < Settings::get("floodProtectionInterval")) {
//Check for last post the user posted.
示例8: Kill
if (!HasPermission('forum.viewforum', $fid)) {
Kill(__('You may not access this forum.'));
}
$tags = ParseThreadTags($thread['title']);
$isHidden = !HasPermission('forum.viewforum', $fid, true);
if ($_POST['report']) {
if ($_POST['key'] !== $loguser['token']) {
Kill(__('No.'));
}
// TODO make this use actual notifications or anything better
Query("INSERT INTO {pmsgs_text} (title,text) VALUES ({0},{1})", "Post report (post #{$pid})", '');
$pmid = InsertId();
Query("INSERT INTO {pmsgs} (id,userto,userfrom,date,ip,msgread,deleted,drafting)\n\t\tVALUES ({0},{1},{2},{3},{4},0,0,0)", $pmid, -1, $loguserid, time(), $_SERVER['REMOTE_ADDR']);
$report = "<strong>Post report</strong>\n\n<strong>Post:</strong> " . actionLinkTag($tags[0], 'post', $pid) . " (post #{$pid})\n\n<strong>Message:</strong>\n{$_POST['message']}\n\n" . actionLinkTag('Mark issue as resolved', 'showprivate', $pmid, 'markread=1');
Query("UPDATE {pmsgs_text} SET text={0} WHERE pid={1}", $report, $pmid);
SendNotification('pm', $pmid, -1);
die(header('Location: ' . actionLink('post', $pid)));
}
MakeCrumbs(forumCrumbs($forum) + array(actionLink("thread", $tid, '', $isHidden ? '' : $tags[0]) => $tags[0], '' => __("Report post")));
$user = Fetch(Query("SELECT * FROM {users} WHERE id={0}", $post['user']));
foreach ($user as $key => $value) {
$post['u_' . $key] = $value;
}
MakePost($post, POST_SAMPLE);
$fields = array('message' => '<textarea id="text" name="message" rows=10></textarea>', 'btnSubmit' => '<input type="submit" name="report" value="' . __('Submit report') . '">');
echo '
<form action="" method="POST">';
RenderTemplate('form_reportpost', array('fields' => $fields));
echo '
<input type="hidden" name="key" value="' . $loguser['token'] . '">
</form>';
示例9: explode
);
$previewPost['text'] = $previews[array_rand($previews)];
//</randompreviews>
*/
//Fixed preview
$previewPost['text'] = $profilePreviewText;
//</fixedpreview>
$previewPost['num'] = "preview";
$previewPost['id'] = "preview";
$previewPost['uid'] = $id;
$copies = explode(",", "title,name,displayname,picture,sex,powerlevel,avatar,postheader,rankset,signature,signsep,posts,regdate,lastactivity,lastposttime");
foreach ($copies as $toCopy) {
$previewPost[$toCopy] = $user[$toCopy];
}
$previewPost['activity'] = FetchResult("select count(*) from posts where user = " . $id . " and date > " . (time() - 86400), 0, 0);
MakePost($previewPost, 0, 0);
if ($loguser['powerlevel'] > 2) {
if (IsAllowed("editUser")) {
$links .= "<li><a href=\"editprofile.php?id=" . $id . "\">" . __("Edit user") . "</a></li>";
}
if (IsAllowed("snoopPM")) {
$links .= "<li><a href=\"private.php?user=" . $id . "\">" . __("Show PMs") . "</a></li>";
}
}
if ($loguserid && IsAllowed("sendPM")) {
$links .= "<li><a href=\"sendprivate.php?uid=" . $id . "\">" . __("Send PM") . "</a></li>";
}
if (IsAllowed("listPosts")) {
$links .= "<li><a href=\"listposts.php?id=" . $id . "\">" . __("Show posts") . "</a></li>";
}
$links .= $blockLayoutLink;
示例10: Kill
Kill(__("Unknown PM"));
}
//could say "PM is addresssed to you, but is being drafted", but what they hey?
$rUser = Query("select * from {users} where id = {0}", $pm['userfrom']);
if (NumRows($rUser)) {
$user = Fetch($rUser);
} else {
Kill(__("Unknown user."));
}
$links = array();
if (!$snoop && $pm['userto'] == $loguserid) {
Query("update {pmsgs} set msgread=1 where id={0}", $pm['id']);
DismissNotification('pm', $pm['id'], $loguserid);
$links[] = actionLinkTag(__("Send reply"), "sendprivate", "", "pid=" . $pm['id']);
} else {
if ($_GET['markread']) {
Query("update {pmsgs} set msgread=1 where id={0}", $pm['id']);
DismissNotification('pm', $pm['id'], -1);
die(header('Location: ' . actionLink('private')));
}
}
$pmtitle = htmlspecialchars($pm['title']);
MakeCrumbs(array(actionLink("private") => __("Private messages"), '' => $pmtitle), $links);
$pm['num'] = 0;
$pm['posts'] = $user['posts'];
$pm['id'] = 0;
foreach ($user as $key => $value) {
$pm['u_' . $key] = $value;
}
MakePost($pm, POST_PM);
示例11: explode
$copies = explode(",", "title,name,displayname,picture,sex,powerlevel,avatar,postheader,signature,signsep,regdate,lastactivity,lastposttime,rankset");
foreach ($copies as $toCopy) {
$previewPost[$toCopy] = $postingAsUser[$toCopy];
}
$previewPost['mood'] = (int) $_POST['mood'];
$previewPost['options'] = 0;
if ($_POST['nopl']) {
$previewPost['options'] |= 1;
}
if ($_POST['nosm']) {
$previewPost['options'] |= 2;
}
if ($_POST['nobr']) {
$previewPost['options'] |= 4;
}
MakePost($previewPost, 0, $fid);
} else {
Alert(__("Enter a message and try again."), __("Your post is empty."));
}
}
if (!$_POST['text']) {
$_POST['text'] = $post['text'];
}
if ($_POST['text']) {
$prefill = htmlval(deSlashMagic($_POST['text']));
}
if ($_GET['link']) {
$prefill = ">>" . (int) $_GET['link'] . "\r\n\r\n";
} else {
if ($_GET['quote']) {
$qQuote = "\tselect \n\t\t\t\t\tp.id, p.deleted, pt.text,\n\t\t\t\t\tf.minpower,\n\t\t\t\t\tu.name poster\n\t\t\t\tfrom posts p\n\t\t\t\t\tleft join posts_text pt on pt.pid = p.id and pt.revision = p.currentrevision \n\t\t\t\t\tleft join threads t on t.id=p.thread\n\t\t\t\t\tleft join forums f on f.id=t.forum\n\t\t\t\t\tleft join users u on u.id=p.user\n\t\t\t\twhere p.id=" . (int) $_GET['quote'];
示例12: Query
} else {
if ($action == 'rp') {
$qPost = "\tselect \n\t\t\t\t\tposts.id, posts.date, posts.num, posts.deleted, posts.options, posts.mood, posts.ip, posts.thread, \n\t\t\t\t\tposts_text.text, posts_text.text, posts_text.revision, users.id as uid, \n\t\t\t\t\tforums.id fid, \n\t\t\t\t\tusers.name, users.displayname, users.rankset, users.powerlevel, users.title, users.sex, users.picture, users.posts, users.postheader, users.signature, users.signsep, users.globalblock, users.lastposttime, users.lastactivity, users.regdate\n\t\t\t\tfrom \n\t\t\t\t\tposts \n\t\t\t\t\tleft join posts_text on posts_text.pid = posts.id and posts_text.revision = posts.currentrevision \n\t\t\t\t\tleft join users on users.id = posts.user\n\t\t\t\t\tleft join threads on threads.id=posts.thread\n\t\t\t\t\tleft join forums on forums.id=threads.forum\n\t\t\t\twhere posts.id=" . $id;
$rPost = Query($qPost);
if (!NumRows($rPost)) {
die(__("Unknown post ID."));
}
$post = Fetch($rPost);
if (!CanMod($loguserid, $post['fid'])) {
die(__("No."));
}
if (isset($_GET['o'])) {
$post['deleted'] = 0;
$post['unfoldhax'] = 1;
}
die(MakePost($post, $post['thread'], $post['fid']));
} else {
if ($action == "ou") {
die(OnlineUsers((int) $_GET['f'], false));
} else {
if ($action == "tf") {
include "css/themelist.php";
$theme = $_GET['t'];
if (!$themes[$theme]) {
die("css/default.css|img/themes/default/logo.png");
}
$themeFile = "css/" . $theme . ".css";
if (!file_exists($themeFile)) {
$themeFile = "css/" . $theme . ".php";
if (!file_exists($themeFile)) {
$themeFile = "css/default.css";
示例13: __
$quote['text'] = __("Post is deleted");
}
$reply = "[quote=\"" . $quote['poster'] . "\" id=\"" . $quote['id'] . "\"]" . $quote['text'] . "[/quote]";
$reply = str_replace("/me", "[b]* " . htmlspecialchars($quote['poster']) . "[/b]", $reply);
die($reply);
} else {
if ($action == 'rp') {
$rPost = Query("\n\t\t\tSELECT\n\t\t\t\tp.id, p.date, p.num, p.deleted, p.deletedby, p.reason, p.options, p.mood, p.ip,\n\t\t\t\tpt.text, pt.revision, pt.user AS revuser, pt.date AS revdate,\n\t\t\t\tu.(_userfields), u.(rankset,title,picture,posts,postheader,signature,signsep,lastposttime,lastactivity,regdate,globalblock,fulllayout),\n\t\t\t\tru.(_userfields),\n\t\t\t\tdu.(_userfields),\n\t\t\t\tt.forum fid\n\t\t\tFROM\n\t\t\t\t{posts} p\n\t\t\t\tLEFT JOIN {posts_text} pt ON pt.pid = p.id AND pt.revision = p.currentrevision\n\t\t\t\tLEFT JOIN {users} u ON u.id = p.user\n\t\t\t\tLEFT JOIN {users} ru ON ru.id=pt.user\n\t\t\t\tLEFT JOIN {users} du ON du.id=p.deletedby\n\t\t\t\tLEFT JOIN {threads} t ON t.id=p.thread\n\t\t\tWHERE p.id={0} AND t.forum IN ({1c})", $id, ForumsWithPermission('forum.viewforum'));
if (!NumRows($rPost)) {
die(__("Unknown post ID."));
}
$post = Fetch($rPost);
if (!HasPermission('mod.deleteposts', $post['fid'])) {
die(__("No."));
}
die(MakePost($post, isset($_GET['o']) ? POST_DELETED_SNOOP : POST_NORMAL, array('tid' => $post['thread'], 'fid' => $post['fid'])));
} else {
if ($action == "ou") {
die(OnlineUsers((int) $_GET['f'], false));
} else {
if ($action == "tf") {
$theme = $_GET['t'];
$themeFile = "themes/{$theme}/style.css";
if (!file_exists($themeFile)) {
$themeFile = "themes/{$theme}/style.php";
}
function checkForImage(&$image, $external, $file)
{
if ($image) {
return;
}
示例14: explode
if ($_POST['action'] == "Preview") {
if ($_POST['text']) {
$_POST['realtitle'] = $_POST['title'];
//store the real PM title in another field...
$_POST['num'] = "---";
$_POST['posts'] = "---";
$_POST['id'] = "???";
$_POST['uid'] = $loguserid;
$copies = explode(",", "title,name,displayname,picture,sex,powerlevel,avatar,postheader,signature,signsep,regdate,lastactivity,lastposttime");
foreach ($copies as $toCopy) {
$_POST[$toCopy] = $loguser[$toCopy];
}
$realtext = $_POST['text'];
$_POST['text'] = preg_replace("'/me '", "[b]* " . $loguser['name'] . "[/b] ", $_POST['text']);
//to prevent identity confusion
MakePost($_POST, 0, 0);
$_POST['title'] = $_POST['realtitle'];
//and put it back for the form.
$_POST['text'] = $realtext;
}
}
//if($_POST['text']) $prefill = htmlval(deSlashMagic($_POST['text']));
//if($_POST['title']) $trefill = htmlval(deSlashMagic($_POST['title']));
if ($_POST['text']) {
$prefill = htmlval($_POST['text']);
}
if ($_POST['title']) {
$trefill = htmlval($_POST['title']);
}
if (!isset($_POST['iconid'])) {
$_POST['iconid'] = 0;
示例15: join
$pageLinks[] = "<a href=\"thread.php?id=" . $tid . "&from=" . ($p - 1) * $ppp . "\">" . $p . "</a>";
}
}
$pagelinks = $first . $prev . join(array_slice($pageLinks, 0, 11), " ") . $next . $last;
write("<div class=\"smallFonts pages\">" . __("Pages:") . " {0}</div>", $pagelinks);
if (NumRows($rPosts)) {
while ($post = Fetch($rPosts)) {
$user = $post;
$bucket = "userMangler";
include "./lib/pluginloader.php";
$post = $user;
//$poster = $post;
//$poster['id'] = $post['uid'];
$post['activity'] = $activity[$post['uid']];
$post['closed'] = $thread['closed'];
MakePost($post, $tid, $fid);
}
}
if ($loguserid && $loguser['powerlevel'] >= $forum['minpowerreply'] && $loguser['powerlevel'] >= $category['minpower'] && (!$thread['closed'] || $loguser['powerlevel'] > 0) && !isset($replyWarning)) {
$ninja = FetchResult("select id from posts where thread=" . $tid . " order by date desc limit 0, 1", 0, 0);
//Quick reply goes here
if (CanMod($loguserid, $fid)) {
//print $thread['closed'];
if (!$thread['closed']) {
$mod .= "<label><input type=\"checkbox\" name=\"lock\"> " . __("Close thread", 1) . "</label>\n";
} else {
$mod .= "<label><input type=\"checkbox\" name=\"unlock\"> " . __("Open thread", 1) . "</label>\n";
}
if (!$thread['sticky']) {
$mod .= "<label><input type=\"checkbox\" name=\"stick\"> " . __("Sticky", 1) . "</label>\n";
} else {