当前位置: 首页>>代码示例>>PHP>>正文


PHP menu函数代码示例

本文整理汇总了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);
}
开发者ID:jesobreira,项目名称:soclwap,代码行数:27,代码来源:message.php

示例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}";
    }
}
开发者ID:TaylorMonacelli,项目名称:phplib,代码行数:30,代码来源:menus.php

示例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)]);
         }
     }
 }
开发者ID:BryceHappy,项目名称:lavender,代码行数:8,代码来源:FrontendHandler.php

示例4: backMenu

function backMenu()
{
    echo "\n0) Back to menu\n1) Exit\n> ";
    if (cin() == '0') {
        menu();
    } else {
        die("Grazie per aver utilizzato PWANEDDLER\n");
    }
}
开发者ID:AlexWillyOrion,项目名称:pwaneddler,代码行数:9,代码来源:pwaneddler.php

示例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">';
}
开发者ID:Jireck-npds,项目名称:npds_dune,代码行数:10,代码来源:links-1.php

示例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>";
}
开发者ID:0xc0d3r,项目名称:Attendance-Portal,代码行数:10,代码来源:functions.php

示例7: route

function route()
{
    switch (TRUE) {
        case isset($_GET['log_file']):
            view_log($_GET['log_file']);
            break;
        default:
            menu();
    }
}
开发者ID:eaglstun,项目名称:dbug,代码行数:10,代码来源:admin.php

示例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";
}
开发者ID:xarrper,项目名称:cms,代码行数:10,代码来源:index.php

示例9: showHeader

function showHeader($string)
{
    menu();
    ?>
    <div class="wrap">
        <h1 class="header-heading"><?php 
    echo $string;
    ?>
</h1>
    </div>
    <?php 
}
开发者ID:200755008,项目名称:Reingenierie,代码行数:12,代码来源:functions.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;
    }
}
开发者ID:erikfrerejean,项目名称:phpbb,代码行数:12,代码来源:markdown2html.php

示例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;
 }
开发者ID:ThiagoMMoura,项目名称:marciafarioli2,代码行数:19,代码来源:Top_bar.php

示例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;
}
开发者ID:argissa,项目名称:hw16-kochergin,代码行数:13,代码来源:function.php

示例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>';
}
开发者ID:mover5,项目名称:imobackup,代码行数:15,代码来源:layout.php

示例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...","")));
}
开发者ID:BackupTheBerlios,项目名称:antargis-svn,代码行数:16,代码来源:menues.inc.php

示例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&amp;op=userinfo&amp;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&amp;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";
}
开发者ID:BackupTheBerlios,项目名称:domsmod-svn,代码行数:46,代码来源:comments.php


注:本文中的menu函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。