本文整理汇总了PHP中menu函数的典型用法代码示例。如果您正苦于以下问题:PHP menu函数的具体用法?PHP menu怎么用?PHP menu使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了menu函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: lista
function lista($user)
{
global $dateformat;
$user = protect($user);
requirelogin();
$title = "Mensagens de {$user}";
include "libs/accounts.php";
// listar todas as mensagens de $user onde hidden = 'n' (para outro user ver)
$output = menu($user) . url("message/send/{$user}", "[enviar mensagem]") . "<br>\n";
$usr = resolveuser($user);
$qry = mysql_query("SELECT `from`,`content`,`data` FROM messages WHERE `to`='{$usr}' AND `hidden`='n' ORDER BY id DESC LIMIT 30");
if (mysql_numrows($qry) == 0) {
$output .= 'Nenhuma mensagem!';
} else {
while ($row = mysql_fetch_array($qry)) {
$user = mysql_query("SELECT login,foto FROM accounts WHERE id='{$row['from']}'");
$user = mysql_fetch_array($user);
$output .= '<p class="row">' . t("De") . ': ' . url("user/profile/{$user['login']}", $user['login']) . '<br/>';
$output .= '<blockquote>
' . bbcode($row['content']) . '
</blockquote>
<hr size="1"><i>' . date($dateformat, $row['data']) . '</i>
</p>';
}
}
section($output, $title);
}
示例2: menu
function menu($parent, $indent)
{
global $widthTotal, $menu;
if (!isset($menu[$parent]->children)) {
return;
}
foreach ($menu[$parent]->children as $sortorder => $id) {
$items[] = $sortorder;
}
sort($items);
if ($parent) {
echo "\n{$indent} <ul>";
}
foreach ($items as $item) {
$id = $menu[$parent]->children[$item];
$target = $menu[$id]->target;
$title = $menu[$id]->title;
echo "\n{$indent} <li><a href='{$target}'";
if (!$parent) {
echo " class='menu'";
$widthTotal += $menu[$id]->width;
}
echo ">{$title}</a>";
menu($id, $indent . " ");
echo "</li>";
}
if ($parent) {
echo "\n{$indent} </ul>\n{$indent}";
}
}
示例3: navigation
protected function navigation()
{
if ($root = $this->store->getRootCategory()) {
foreach ($root->children as $category) {
menu('top.navigation')->add('cat-' . $category->id, ['href' => $category->url(), 'text' => $category->name(), 'children' => $this->children($category)]);
}
}
}
示例4: backMenu
function backMenu()
{
echo "\n0) Back to menu\n1) Exit\n> ";
if (cin() == '0') {
menu();
} else {
die("Grazie per aver utilizzato PWANEDDLER\n");
}
}
示例5: error_head
function error_head($class)
{
global $ModPath, $ModStart;
include "header.php";
$mainlink = 'ad_l';
menu($mainlink);
SearchForm();
echo '
<div class="alert ' . $class . '" role="alert" align="center">';
}
示例6: display_error
function display_error($msg)
{
echo "<!DOCTYPE html>\n<html>\n";
display_headers($title);
echo "\n<body>";
menu();
echo '<div class="container" style="margin-top:-10px;"><div id="error" style="display:none;"></div></div>';
echo "<script>show_error('" . $msg . "');</script>";
echo "</body></html>";
}
示例7: route
function route()
{
switch (TRUE) {
case isset($_GET['log_file']):
view_log($_GET['log_file']);
break;
default:
menu();
}
}
示例8: admin
function admin($section)
{
//загрузка представления
$data = array();
$data = info($section);
$data['menu'] = menu($section);
$data['bread'] = breadCrumbs($section);
$data['page_name'] = 'Сайт';
require "view/viewSite.php";
}
示例9: showHeader
function showHeader($string)
{
menu();
?>
<div class="wrap">
<h1 class="header-heading"><?php
echo $string;
?>
</h1>
</div>
<?php
}
示例10: markdown_menu
function markdown_menu($text)
{
$parser_class = MARKDOWN_PARSER_CLASS;
$parser = new $parser_class();
# Transform text using parser.
$result = $parser->transform($text);
if (isset($parser->headers)) {
return menu($parser->headers) . $result;
} else {
return $result;
}
}
示例11: criar
/**
* Retorna o html do menu criado com o array passado por parâmetro.
*
* @param array $data
* @return string
*/
public function criar($data = array())
{
if (!empty($data)) {
$data = $this->_remove_unnecessary_fields($data);
} else {
$data = $this->menu_bar;
}
if ($this->restricted_urls != NULL) {
$data = $this->_remove_restrict_urls($data);
}
$this->menu_html = menu($this->menu_bar);
return $this->menu_html;
}
示例12: menu
function menu($menu)
{
$buffer = null;
foreach ($menu as $name => $link) {
if (is_array($link)) {
$buffer .= '<li class="dropdown"><a href="" class="dropdown-toggle js-activated" data-toggle="dropdown"> ' . $name . '</a>';
$buffer .= '<ul class="dropdown-menu">' . menu($link) . '</ul></li>';
} else {
$buffer .= '<li><a href="' . $link . '">' . $name . '</a></li>';
}
}
return $buffer;
}
示例13: contentheader
function contentheader()
{
echo '<div id="header">';
echo '<div class="frame">';
echo '<div id="top_section">';
banner("");
menu("");
echo '</div>';
echo '<div id="upper_section" class="middletext">';
ad();
//user();
echo '</div>';
echo '</div>';
echo '</div>';
}
示例14: makeMenu
function makeMenu()
{
return
menu("","","start/view.inc.php",
array(
menu("about","About","start/view.inc.php"),
menu("news","News","news/view.inc.php"),
menu("screenshots","Screenshots","screenshots/view.inc.php"),
menu("features","Features","features/view.inc.php"),
menu("download","Download","download/view.inc.php"),
menu("contact","Contact/Impressum","contact/view.inc.php"),
menu("http://antargis.berlios.de/docs","Documentation",""),
menu("http://antargis.berlios.de/phpBB2","Forum...",""),
menu("http://antargis.berlios.de/wiki","Wiki...",""),
menu("http://developer.berlios.de/projects/antargis","Project site...","")));
}
示例15: viewdownloadcomments
function viewdownloadcomments($lid, $ttitle)
{
global $prefix, $dbi, $admin, $bgcolor2, $module_name;
include "header.php";
include "modules/{$module_name}/d_config.php";
menu(1);
echo "<br>";
$result = sql_query("SELECT ratinguser, rating, ratingcomments, ratingtimestamp FROM " . $prefix . "_downloads_votedata WHERE ratinglid = {$lid} AND ratingcomments != '' ORDER BY ratingtimestamp DESC", $dbi);
$totalcomments = sql_num_rows($result, $dbi);
$transfertitle = ereg_replace("_", " ", $ttitle);
$transfertitle = stripslashes($transfertitle);
$displaytitle = $transfertitle;
OpenTable();
echo "<center><font class=\"option\"><b>" . _DOWNLOADPROFILE . ": {$displaytitle}</b></font><br><br>";
downloadinfomenu($lid, $ttitle);
echo "<br><br><br>" . _TOTALOF . " {$totalcomments} " . _COMMENTS . "</font></center><br>" . "<table align=\"center\" border=\"0\" cellspacing=\"0\" cellpadding=\"2\" width=\"450\">";
$x = 0;
while (list($ratinguser, $rating, $ratingcomments, $ratingtimestamp) = sql_fetch_row($result, $dbi)) {
$ratingcomments = stripslashes($ratingcomments);
ereg("([0-9]{4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})", $ratingtimestamp, $ratingtime);
$ratingtime = strftime("%F", mktime($ratingtime[4], $ratingtime[5], $ratingtime[6], $ratingtime[2], $ratingtime[3], $ratingtime[1]));
$date_array = explode("-", $ratingtime);
$timestamp = mktime(0, 0, 0, $date_array["1"], $date_array["2"], $date_array["0"]);
$formatted_date = date("F j, Y", $timestamp);
/* Individual user information */
$result2 = sql_query("SELECT rating FROM " . $prefix . "_downloads_votedata WHERE ratinguser = '{$ratinguser}'", $dbi);
$usertotalcomments = sql_num_rows($result2, $dbi);
$useravgrating = 0;
while (list($rating2) = sql_fetch_row($result2, $dbi)) {
$useravgrating = $useravgrating + $rating2;
}
$useravgrating = $useravgrating / $usertotalcomments;
$useravgrating = number_format($useravgrating, 1);
echo "<tr><td bgcolor=\"{$bgcolor2}\">" . "<font class=\"content\"><b> " . _USER . ": </b><a href=\"{$nukeurl}/modules.php?name=Your_Account&op=userinfo&username={$ratinguser}\">{$ratinguser}</a></font>" . "</td>" . "<td bgcolor=\"{$bgcolor2}\">" . "<font class=\"content\"><b>" . _RATING . ": </b>{$rating}</font>" . "</td>" . "<td bgcolor=\"{$bgcolor2}\" align=\"right\">" . "<font class=\"content\">{$formatted_date}</font>" . "</td>" . "</tr>" . "<tr>" . "<td valign=\"top\">" . "<font class=\"tiny\">" . _USERAVGRATING . ": {$useravgrating}</font>" . "</td>" . "<td valign=\"top\" colspan=\"2\">" . "<font class=\"tiny\">" . _NUMRATINGS . ": {$usertotalcomments}</font>" . "</td>" . "</tr>" . "<tr>" . "<td colspan=\"3\">" . "<font class=\"content\">";
if (is_admin($admin)) {
echo "<a href=\"admin.php?op=DownloadsModDownload&lid={$lid}\"><img src=\"modules/{$module_name}/images/editicon.gif\" border=\"0\" alt=\"" . _EDITTHISDOWNLOAD . "\"></a>";
}
echo " {$ratingcomments}</font>" . "<br><br><br></td></tr>";
$x++;
}
echo "</table><br><br><center>";
downloadfooter($lid, $ttitle);
echo "</center>";
CloseTable();
include "footer.php";
}