本文整理匯總了PHP中MakeCrumbs函數的典型用法代碼示例。如果您正苦於以下問題:PHP MakeCrumbs函數的具體用法?PHP MakeCrumbs怎麽用?PHP MakeCrumbs使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了MakeCrumbs函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: htmlspecialchars
$urltitle = $page['id'];
//urlencode($page['id']);
$nicetitle = htmlspecialchars(url2title($page['id']));
$title = 'Wiki » ' . $nicetitle;
if ($page['istalk']) {
$links .= actionLinkTagItem('Page', 'wiki', substr($urltitle, 5)) . '<li>Discuss</li>';
} else {
$links .= '<li>Page</li>' . actionLinkTagItem('Discuss', 'wiki', 'Talk:' . $urltitle);
}
if ($page['canedit']) {
$links .= actionLinkTagItem('Edit', 'wikiedit', $urltitle);
}
if ($page['ismain']) {
MakeCrumbs(array(actionLink('wiki') => 'Wiki'), $links);
} else {
MakeCrumbs(array(actionLink('wiki') => 'Wiki', actionLink('wiki', $urltitle) => $nicetitle), $links);
}
echo '
<table class="outline margin">
<tr class="cell1">
<td style="padding:0px 1em 1em;">';
if ($page['flags'] & WIKI_PFLAG_DELETED) {
echo '<h1>' . $nicetitle . '</h1>This page has been deleted.';
} else {
if ($page['new']) {
echo '<h1>' . $nicetitle . '</h1>This page does not exist.';
if ($page['canedit']) {
echo '<br><br>' . actionLinkTag('Create it now', 'wikiedit', $urltitle);
}
} else {
$revInfo = '';
示例2: Query
$rFora = Query("select * from {forums} where id={0}", $fid);
if (NumRows($rFora)) {
$forum = Fetch($rFora);
} else {
Kill(__("Unknown forum ID."));
}
if ($forum['locked']) {
Kill(__("This forum is locked."));
}
if (!isset($_POST['poll']) || isset($_GET['poll'])) {
$_POST['poll'] = $_GET['poll'];
}
$isHidden = !HasPermission('forum.viewforum', $fid, true);
$urlname = $isHidden ? '' : $forum['title'];
$OnlineUsersFid = $fid;
MakeCrumbs(forumCrumbs($forum) + array('' => __("New thread")));
$attachs = array();
if (isset($_POST['saveuploads'])) {
$attachs = HandlePostAttachments(0, false);
} else {
if (isset($_POST['actionpreview'])) {
$attachs = HandlePostAttachments(0, false);
if ($_POST['poll']) {
$options = array();
$pdata = array();
$pdata['question'] = htmlspecialchars($_POST['pollQuestion']);
$pdata['options'] = array();
$noColors = 0;
$defaultColors = array("#0000B6", "#00B600", "#00B6B6", "#B60000", "#B600B6", "#B66700", "#B6B6B6", "#676767", "#6767FF", "#67FF67", "#67FFFF", "#FF6767", "#FF67FF", "#FFFF67", "#FFFFFF");
$totalVotes = 0;
foreach ($_POST['pollOption'] as $i => $opt) {
示例3: Query
$rFora = Query("select * from {forums} where id={0}", $fid);
if (NumRows($rFora)) {
$forum = Fetch($rFora);
} else {
Kill("Unknown forum ID.");
}
$fid = $forum['id'];
$isHidden = !HasPermission('forum.viewforum', $fid, true);
if ($thread['closed'] && !HasPermission('mod.closethreads', $fid)) {
Kill(__("This thread is locked."));
}
$OnlineUsersFid = $fid;
LoadPostToolbar();
$tags = ParseThreadTags($thread['title']);
$urlname = $isHidden ? '' : $tags[0];
MakeCrumbs(forumCrumbs($forum) + array(actionLink("thread", $tid, '', $urlname) => $tags[0], '' => __("New reply")));
if (!$thread['sticky'] && Settings::get("oldThreadThreshold") > 0 && $thread['lastpostdate'] < time() - 2592000 * Settings::get("oldThreadThreshold")) {
Alert(__("You are about to bump an old thread. This is usually a very bad idea. Please think about what you are about to do before you press the Post button."));
}
$attachs = array();
if (isset($_POST['saveuploads'])) {
$attachs = HandlePostAttachments(0, false);
} else {
if (isset($_POST['actionpreview'])) {
$attachs = HandlePostAttachments(0, false);
$previewPost['text'] = $_POST["text"];
$previewPost['num'] = $loguser['posts'] + 1;
$previewPost['posts'] = $loguser['posts'] + 1;
$previewPost['id'] = 0;
$previewPost['options'] = 0;
if ($_POST['nopl']) {
示例4: Query
}
}
$search = Query("\n\t\t\tSELECT pt.pid pid\n\t\t\tFROM {posts_text} pt\n\t\t\t\tLEFT JOIN {posts} p ON pt.pid = p.id\n\t\t\tWHERE pt.revision = p.currentrevision AND MATCH(pt.text) AGAINST({0} IN BOOLEAN MODE)\n\t\t\tORDER BY p.date DESC", $bool);
$presults = array();
if (NumRows($search)) {
while ($result = Fetch($search)) {
$presults[] = $result['pid'];
}
}
Query("\n\t\t\tINSERT INTO {searchcache} (queryhash,query,date,threadresults,postresults) \n\t\t\tVALUES ({0},{1},{2},{3},{4})\n\t\t\tON DUPLICATE KEY UPDATE date={2}, threadresults={3}, postresults={4}", $sqhash, $searchQuery, time(), implode(',', $tresults), implode(',', $presults));
}
if (isset($_POST['q'])) {
die(header('Location: ' . actionLink('search', '', 'q=' . urlencode($searchQuery) . '&inposts=' . $_POST['inposts'])));
}
}
MakeCrumbs(array(actionLink("search") => __("Search")));
echo "\n\t<form action=\"" . htmlentities(actionLink("search")) . "\" method=\"post\">";
$fields = array('terms' => "<input type=\"text\" maxlength=\"1024\" name=\"q\" style=\"width:100%;border-sizing:border-box;-moz-border-sizing:border-box;\" value=\"" . htmlspecialchars($_REQUEST['q']) . "\">", 'searchin' => '
<label><input type="radio" name="inposts" value="0"' . ($_REQUEST['inposts'] == 0 ? ' checked="checked"' : '') . '>' . __('Thread titles') . '</label>
<label><input type="radio" name="inposts" value="1"' . ($_REQUEST['inposts'] == 1 ? ' checked="checked"' : '') . '>' . __('Posts') . '</label>', 'btnSubmit' => "<input type=\"submit\" value=\"" . __("Search") . "\">");
RenderTemplate('form_search', array('fields' => $fields));
echo "\n\t</form>";
if (isset($_GET['q'])) {
$viewableforums = ForumsWithPermission('forum.viewforum');
$searchQuery = $_GET['q'];
$searchQuery = strtolower(preg_replace('@\\s+@', ' ', $searchQuery));
$bool = htmlspecialchars($searchQuery);
$t = explode(" ", $bool);
$terms = array();
foreach ($t as $term) {
if ($term[0] == "-") {
示例5: MakeCrumbs
<?php
if (!defined('BLARG')) {
die;
}
$title = 'Post quality stats';
MakeCrumbs(array(actionLink('postquality') => 'Post quality stats'));
$stuff = Query("\tSELECT\n\t\t\t\t\t\tu.(_userfields),\n\t\t\t\t\t\tu.posts totalposts,\n\t\t\t\t\t\t(SELECT COUNT(*) FROM {posts} p WHERE p.user=u.id AND p.deleted!=0 AND p.deletedby!=u.id) deletedposts\n\t\t\t\t\tFROM\n\t\t\t\t\t\t{users} u\n\t\t\t\t\tWHERE " . ($_GET['showbanned'] ? '' : 'u.primarygroup!={0} AND ') . "u.posts>0\n\t\t\t\t\tHAVING (deletedposts / totalposts)>0.015\n\t\t\t\t\tORDER BY (deletedposts / totalposts) DESC", Settings::get('bannedGroup'));
echo '
<table class="outline margin">
<tr class="cell0">
<td colspan="5" class="center">
<br>
This page shows, for each user, how many of their posts were deleted by the staff.<br>
(users with less than 2% of deleted posts aren\'t shown)<br>
<br>
If you are in the green part, you are fine, but try to be a little careful.<br>
If you are in the orange part, you should really improve the quality of your posts.<br>
If you are in the red part, you are walking on thin ice, and should think twice before posting again.<br>
<br>
</td>
</tr>
<tr class="header1">
<th>User</th>
<th>Posts</th>
<th>Deleted</th>
<th>Ratio</th>
<th style="width:120px;"> </th>
</tr>';
$c = 1;
while ($user = Fetch($stuff)) {
示例6: 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>';
示例7: Kill
} else {
Kill(__("Unknown user ID."));
}
$title = __("Post list");
$total = FetchResult("\n\t\t\tSELECT\n\t\t\t\tcount(p.id)\n\t\t\tFROM\n\t\t\t\t{posts} p\n\t\t\t\tLEFT JOIN {threads} t ON t.id=p.thread{$extrashit}\n\t\t\tWHERE p.user={0} AND t.forum IN ({1c})", $id, ForumsWithPermission('forum.viewforum'));
$ppp = $loguser['postsperpage'];
if (isset($_GET['from'])) {
$from = (int) $_GET['from'];
} else {
$from = 0;
}
if (!$ppp) {
$ppp = 25;
}
$rPosts = Query("\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,fulllayout),\n\t\t\t\tru.(_userfields),\n\t\t\t\tdu.(_userfields),\n\t\t\t\tt.id thread, t.title threadname,\n\t\t\t\tf.id 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\t\tLEFT JOIN {forums} f ON f.id=t.forum\n\t\t\t\tLEFT JOIN {categories} c ON c.id=f.catid\n\t\t\tWHERE u.id={1} AND f.id IN ({4c}){$extrashit}\n\t\t\tORDER BY date ASC LIMIT {2u}, {3u}", $loguserid, $id, $from, $ppp, ForumsWithPermission('forum.viewforum'));
$numonpage = NumRows($rPosts);
$uname = $user["name"];
if ($user["displayname"]) {
$uname = $user["displayname"];
}
MakeCrumbs(array(actionLink("profile", $id, "", $user["name"]) => htmlspecialchars($uname), '' => __("List of posts")));
$pagelinks = PageLinks(actionLink("listposts", $id, "from=", $user['name']), $ppp, $from, $total);
RenderTemplate('pagelinks', array('pagelinks' => $pagelinks, 'position' => 'top'));
if (NumRows($rPosts)) {
while ($post = Fetch($rPosts)) {
MakePost($post, POST_NORMAL, array('threadlink' => 1, 'tid' => $post['thread'], 'fid' => $post['fid'], 'noreplylinks' => 1));
}
} else {
Alert('This user has no posts.', 'Notice');
}
RenderTemplate('pagelinks', array('pagelinks' => $pagelinks, 'position' => 'bottom'));
示例8: __
<?php
// AcmlmBoard XD - Private message sending/previewing page
// Access: user
if (!defined('BLARG')) {
die;
}
$title = __("Private messages");
MakeCrumbs(array(actionLink("private") => __("Private messages"), '' => __("Send PM")));
if (!$loguserid) {
//Not logged in?
Kill(__("You must be logged in to send private messages."));
}
CheckPermission('user.sendpms');
$draftID = 0;
$replyTo = 0;
$convStart = 0;
$urlargs = array();
$pid = (int) $_GET['pid'];
if ($pid) {
$urlargs[] = 'pid=' . $pid;
// this shouldn't select drafts someone else is preparing for us
// those drafts will have recipients stored in draft_to, with userto set to 0
$rPM = Query("select * from {pmsgs} left join {pmsgs_text} on pid = {pmsgs}.id where (userfrom={0} OR userto={0}) and {pmsgs}.id = {1}", $loguserid, $pid);
if (NumRows($rPM)) {
$pm = Fetch($rPM);
$rUser = Query("select name from {users} where id = {0}", $pm['userfrom']);
if (NumRows($rUser)) {
$user = Fetch($rUser);
} else {
Kill(__("Unknown user."));
示例9: __
<?php
// AcmlmBoard XD - Frequently Asked Questions page
// Access: all
if (!defined('BLARG')) {
die;
}
$title = __("FAQ");
$links = array();
if (HasPermission('admin.editsettings')) {
$links[] = actionLinkTag(__("Edit the FAQ"), "editsettings", '', 'field=faqText');
}
MakeCrumbs(array(actionLink("faq") => __("FAQ")), $links);
makeThemeArrays();
$admin = Fetch(Query("select u.(_userfields) from {users} u where u.primarygroup={0}", Settings::get('rootGroup')));
$admin = userLink(getDataPrefix($admin, 'u_'));
$sexes = array(0 => __("Male"), 1 => __("Female"), 2 => __("N/A"));
$scolors = array(0 => 'color_male', 1 => 'color_female', 2 => 'color_unspec');
$gcolors = array();
$g = Query("SELECT title, color_male, color_female, color_unspec FROM {usergroups} WHERE type=0 ORDER BY rank");
while ($group = Fetch($g)) {
$gcolors[] = $group;
}
$headers = "";
$colors = "";
foreach ($sexes as $ss) {
$headers .= format("\n\t<th>\n\t\t{0}\n\t</th>\n", $ss);
}
foreach ($gcolors as $g) {
$cellClass = ($cellClass + 1) % 2;
$items = "";
示例10: __
<?php
$title = __("Ranks");
MakeCrumbs(array(actionLink("ranks") => __("Ranks")));
loadRanksets();
if (count($ranksetData) == 0) {
Kill(__("No ranksets have been defined."));
}
if (!isset($_GET['id'])) {
$rankset = $loguser['rankset'];
if (!$rankset || !isset($ranksetData[$rankset])) {
$rankset = array_keys($ranksetData);
$rankset = $rankset[0];
}
die(header("Location: " . actionLink("ranks", $rankset)));
}
$rankset = $_GET['id'];
if (!isset($ranksetData[$rankset])) {
Kill(__("Rankset not found."));
}
$ranksets = array();
foreach ($ranksetNames as $name => $title) {
if ($name == $rankset) {
$ranksets[] = $title;
} else {
$ranksets[] = actionLinkTag($title, 'ranks', $name);
}
}
$users = array();
$rUsers = Query("select u.(_userfields), u.(posts,lastposttime) from {users} u order by id asc");
while ($user = Fetch($rUsers)) {
示例11: Alert
} else {
Alert(__("No such file or not yours to mess with."));
}
} else {
if ($_GET['action'] == 'restore' && HasPermission('uploader.deletefiles')) {
$fid = $_GET['fid'];
$check = FetchResult("select count(*) from {uploader} where id = {0}", $fid);
if ($check) {
Query("UPDATE {uploader} SET deldate=0 WHERE id={0}", $fid);
Report("[b]" . $loguser['name'] . "[/] restored \"[b]" . $entry['filename'] . "[/]\" ({$fid}).", 1);
die(header("Location: " . actionLink("uploaderlist", "", "cat=" . $_GET["cat"])));
} else {
Alert(__("No such file."));
}
} else {
MakeCrumbs(array(actionLink("uploader") => "Uploader"), $links);
$errormsg = __("No categories found.");
$entries = Query("select * from {uploader_categories} order by ord");
if (NumRows($entries) == 0) {
print "\n\t\t<table class=\"outline margin\">\n\t\t\t<tr class=\"header0\">\n\n\n\n\t\t\t\t<th colspan=\"7\">" . __("Files") . "</th>\n\t\t\t</tr>\n\t\t\t<tr class=\"cell1\">\n\t\t\t\t<td colspan=\"4\">\n\t\t\t\t\t" . $errormsg . "\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t</table>\n\t\t";
} else {
print "\n\t\t<table class=\"outline margin width100\">\n\t\t\t<tr class=\"header0\">\n\t\t\t\t<th colspan=\"7\">" . __("Categories") . "</th>\n\t\t\t</tr>\n\t\t";
$cellClass = 0;
while ($entry = Fetch($entries)) {
$filecount = FetchResult("select count(*) from {uploader} where category = {0} AND deldate=0", $entry['id']);
print "<tr class=\"cell{$cellClass}\"><td>";
print actionLinkTag($entry['name'], "uploaderlist", "", "cat=" . $entry['id']);
print "<br />";
print $entry['description'];
print "<br />";
print Plural($filecount, 'file');
示例12: Kill
Kill(__('No.'));
}
if ($settings[$htmlfield]['type'] != 'texthtml') {
Kill(__('No.'));
}
$htmlname = $settings[$htmlfield]['name'];
} else {
$htmlfield = null;
}
if (!ctype_alnum($plugin)) {
Kill(__("No."));
}
if ($plugin == "main") {
MakeCrumbs(array(actionLink("admin") => __("Admin"), '' => __("Edit settings")));
} else {
MakeCrumbs(array(actionLink("admin") => __("Admin"), actionLink("pluginmanager") => __("Plugin manager"), '' => $plugins[$plugin]['name']));
}
$settings = Settings::getSettingsFile($plugin);
$oursettings = Settings::$settingsArray[$plugin];
$invalidsettings = array();
if (isset($_POST["_plugin"])) {
if ($_POST['key'] !== $loguser['token']) {
Kill(__('No.'));
}
//Save the settings.
$valid = true;
foreach ($_POST as $key => $value) {
if ($key == "_plugin") {
continue;
}
//Don't accept unexisting settings.
示例13: MakeCrumbs
<?php
require 'wikilib.php';
$title = 'Wiki » Recent changes';
MakeCrumbs(array(actionLink('wiki') => 'Wiki', actionLink('wikichanges') => 'Recent changes'), $links);
$mydatefmt = 'm-d-Y';
if ($loguserid) {
$mydatefmt = $loguser['dateformat'];
}
$time = (int) $_GET['time'];
if (!$time) {
$time = 86400;
}
$spans = array(86400 => 'Today', 604800 => 'This week', 2592000 => 'This month');
$spanList = "";
foreach ($spans as $span => $text) {
if ($span == $time) {
$spanList .= '<li>' . $text . '</li>';
} else {
$spanList .= actionLinkTagItem($text, 'wikichanges', '', 'time=' . $span);
}
}
echo '
<div class="smallFonts margin">
View changes for:
<ul class="pipemenu">
' . $spanList . '
</ul>
</div>
';
echo '
示例14: __
<?php
// AcmlmBoard XD - IP ban management tool
// Access: administrators only
$title = __("IP bans");
CheckPermission('admin.manageipbans');
MakeCrumbs(array(actionLink("admin") => __("Admin"), actionLink("ipbans") => __("IP ban manager")));
if (isset($_POST['actionadd'])) {
//This doesn't allow you to ban IP ranges...
//if(!filter_var($_POST['ip'], FILTER_VALIDATE_IP))
// Alert("Invalid IP");
//else
if (isIPBanned($_POST['ip'])) {
Alert("Already banned IP!");
} else {
$rIPBan = Query("insert into {ipbans} (ip, reason, date) values ({0}, {1}, {2})", $_POST['ip'], $_POST['reason'], (int) $_POST['days'] > 0 ? time() + (int) $_POST['days'] * 86400 : 0);
Alert(__("Added."), __("Notice"));
}
} elseif ($_GET['action'] == "delete") {
$rIPBan = Query("delete from {ipbans} where ip={0} limit 1", $_GET['ip']);
Alert(__("Removed."), __("Notice"));
}
$rIPBan = Query("select * from {ipbans} order by date desc, ip asc");
$banList = "";
while ($ipban = Fetch($rIPBan)) {
$cellClass = ($cellClass + 1) % 2;
if ($ipban['date']) {
$date = formatdate($ipban['date']) . " (" . TimeUnits($ipban['date'] - time()) . " left)";
} else {
$date = __("Permanent");
}
示例15: __
<?php
$title = __("Mood avatars");
if (!$loguserid) {
Kill(__("You must be logged in to edit your avatars."));
}
CheckPermission('user.editprofile');
CheckPermission('user.editavatars');
MakeCrumbs(array(actionLink('profile', $loguserid, '', $loguser['name']) => htmlspecialchars($loguser['displayname'] ? $loguser['displayname'] : $loguser['name']), actionLink("editavatars") => __("Mood avatars")));
if (isset($_POST['actionrename']) || isset($_POST['actiondelete']) || isset($_POST['actionadd'])) {
$mid = (int) $_POST['mid'];
if ($_POST['actionrename']) {
Query("update {moodavatars} set name={0} where mid={1} and uid={2}", $_POST['name'], $mid, $loguserid);
die(header('Location: ' . actionLink('editavatars')));
} else {
if ($_POST['actiondelete']) {
Query("delete from {moodavatars} where uid={0} and mid={1}", $loguserid, $mid);
Query("update {posts} set mood=0 where user={0} and mood={1}", $loguserid, $mid);
if (file_exists(DATA_DIR . "avatars/" . $loguserid . "_" . $mid)) {
unlink(DATA_DIR . "avatars/" . $loguserid . "_" . $mid);
}
die(header('Location: ' . actionLink('editavatars')));
} else {
if ($_POST['actionadd']) {
$highest = FetchResult("select mid from {moodavatars} where uid={0} order by mid desc limit 1", $loguserid);
if ($highest < 1) {
$highest = 1;
}
$mid = $highest + 1;
//Begin copypasta from edituser/editprofile_avatar...
if ($fname = $_FILES['picture']['name']) {