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


PHP section函数代码示例

本文整理汇总了PHP中section函数的典型用法代码示例。如果您正苦于以下问题:PHP section函数的具体用法?PHP section怎么用?PHP section使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了section函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: index

function index()
{
    global $timeformat, $home;
    if (is_logged()) {
        $output = '<p><form method="post" action="' . $home . 'shoutbox/escrevepost">
<textarea rows="8" cols="25" name="message"></textarea><br/>
<input type="submit" value="' . t("Enviar") . '">
</form></p><hr size="1">';
    }
    $qry = mysql_query("SELECT s.id AS d, s.text AS t, s.time AS i, a.login AS l FROM shoutbox s LEFT JOIN accounts a ON s.owner=a.id ORDER BY s.id DESC LIMIT 10");
    if (mysql_numrows($qry) != 0) {
        $response = true;
        while ($row = mysql_fetch_array($qry)) {
            $output .= '<p><h3>' . $row['t'] . '</h3><br/><h6>' . t("postado por") . ' ' . url("user/profile/{$row['l']}", $row['l']) . ' ' . t("em") . ' ' . date($timeformat, $row['i']);
            if (is_admin()) {
                $output .= '<br>' . url("shoutbox/del/{$row['d']}", t("[excluir]"));
            }
            $output .= '</p><hr size="1">';
        }
    } else {
        $output .= infobox(t("Não há mensagens na shoutbox."), false);
    }
    if ($response) {
        section(substr($output, 0, -13), t("Shoutbox"));
    } else {
        section($output, t("Shoutbox"));
    }
}
开发者ID:jesobreira,项目名称:soclwap,代码行数:28,代码来源:shoutbox.php

示例2: main_content

function main_content()
{
    global $graph;
    global $uri;
    $doc = new DOMDocument();
    $header = $doc->createElement("h1");
    $header->nodeValue = "Overview";
    $doc->appendChild($header);
    $p = $doc->createElement("p");
    $p->nodeValue = $graph->resource($uri)->get("dct:description");
    $doc->appendChild($p);
    section($doc, "Projects", "http://eprints.org/ontology/Project");
    section($doc, "People", "foaf:Person");
    section($doc, "Papers", "bibo:AcademicArticle");
    section($doc, "Conferences", "bibo:Conference");
    section($doc, "Presentations", "bibo:Presentation");
    section($doc, "Datasets", "bibo:Dataset");
    section($doc, "Websites", "http://eprints.org/ontology/Website");
    section($doc, "Code", "bibo:Code");
    return $doc->saveHtml();
}
开发者ID:RichardFish,项目名称:d-ROC,代码行数:21,代码来源:functions.php

示例3: admin

function admin()
{
    global $home;
    onlyadmin();
    section('<form method="post" action="' . $home . 'chat/createroompost">
            <p><label for="nome">' . t('Nome da sala') . ':</label><br/>
              <input type="text" name="nome"></p>
            <p><input type="submit" value="' . t("Criar sala") . '">
           </form>', t("Criar uma nova sala"));
    $output = null;
    $qry = mysql_query("SELECT * FROM chat_rooms");
    if (mysql_numrows($qry) == 0) {
        $output .= infobox(t("Você não configurou o chat."), false, false);
    } else {
        while ($row = mysql_fetch_array($qry)) {
            $output .= url("chat/sala/{$row['id']}", $row['nome']) . ' - ' . url("chat/deleteroom/{$row['id']}", t("[remover]")) . '
      <br>';
        }
    }
    section($output, t("Chat"));
}
开发者ID:jesobreira,项目名称:soclwap,代码行数:21,代码来源:chat.php

示例4: post

function post()
{
    global $url;
    requirelogin();
    $me = $_SESSION['id'];
    $query = substr(protect($_POST['query']), 0, 16);
    if (strlen($query) < 3) {
        # isso não é um coração...
        infobox(t("Termos de busca muito pequenos.", true, true));
    }
    if ($_POST['usuarios']) {
        $qry = mysql_query("SELECT `foto`,`login` FROM accounts WHERE `login` LIKE '%{$query}%' OR `nome` LIKE '%{$query}%'");
        if (mysql_numrows($qry) == 0) {
            $usuarios = t("Nenhum resultado!");
        } else {
            $usuarios = null;
            while ($row = mysql_fetch_array($qry)) {
                $usuarios .= "\n" . '<p><div class="row">
                        <img src="' . $url . '/upload/' . thumb($row['foto']) . '"><br>
                        ' . url("user/profile/{$row['login']}", $row['login']) . '
                      </div></p>';
            }
        }
        section($usuarios, t("Buscando usuários."));
    }
    if ($_POST['grupos']) {
        $qry = mysql_query("SELECT `title`,`url` FROM groups WHERE `title` LIKE '%{$query}%' OR `desc` LIKE '%{$query}%'");
        if (mysql_numrows($qry) == 0) {
            $grupos = t("Nenhum resultado!");
        } else {
            $grupos = null;
            while ($row = mysql_fetch_array($qry)) {
                $grupos .= "\n" . '<p><div class="row">
                        ' . url("groups/view/{$row['url']}", $row['title']) . '
                      </div></p>';
            }
        }
        section($grupos, t("Buscando grupos."));
    }
}
开发者ID:jesobreira,项目名称:soclwap,代码行数:40,代码来源:search.php

示例5: lista

function lista($user)
{
    requirelogin();
    include "libs/video.php";
    include "libs/accounts.php";
    $user = protect($user);
    $output = menu($user) . '<br>';
    $id = resolveuser($user);
    $qry = mysql_query("SELECT * FROM videos WHERE id='{$id}'");
    if (mysql_num_rows($qry) == 0) {
        $output .= infobox($user . ' ' . t("ainda não possui vídeos."), true);
    } else {
        while ($row = mysql_fetch_array($qry)) {
            $video = youtube($row['video']);
            $output .= '<div class="row">
              <h3>' . protect($video['title']) . '</h3>
              <p><i>' . protect($video['desc']) . '</i><br/>
              ' . $video['code'] . '</p>
            </div><br>';
        }
    }
    section($output, t("Vídeos de") . ' ' . $user);
}
开发者ID:jesobreira,项目名称:soclwap,代码行数:23,代码来源:videos.php

示例6: mysql_real_escape_string

<?php

if ($page['found']) {
    if (isset($_POST['Submit'])) {
        $page_id = mysql_real_escape_string($page['page_id']);
        $title = mysql_real_escape_string($_POST['title']);
        $content = mysql_real_escape_string($_POST['content']);
        $order = mysql_do_query("SELECT count(*) as `c` FROM `cms_sections` WHERE `page_id` = '{$page_id}'");
        $order = mysql_fetch_assoc($order);
        $order = mysql_real_escape_string($order['c']);
        mysql_do_query("INSERT INTO `cms_sections`\n                            SET `page_id`='{$page_id}', \n                                `order`='{$order}', \n                                `section_title`='{$title}',\n                                `section_text`='{$content}'");
        header("location: " . $page['parent_path'] . $page['page_key']);
        die;
    }
    $c = "<form action=\"{$page['parent_path']}{$page['page_key']}.createsection\" method=\"POST\">";
    $c .= "Section title:<br><input type=\"text\" name=\"title\" size=\"95\"><br><br>";
    $c .= "Content:<br><textarea name=\"content\" cols=\"80\" rows=\"10\"></textarea><br>";
    $c .= "<input type=\"Submit\" name=\"Submit\" value=\"Submit\"></form>";
    $content .= section("Create section...", $c);
}
开发者ID:kaithar,项目名称:livepage,代码行数:20,代码来源:createsection.php

示例7: elseif

<?php

/*
    Main content body PHP script
    Chip Cuccio <http://chip.cuccio.us>
    $Id: body_inc.php 3272 2007-12-20 12:41:17Z chipster $
*/
?>
    <div id="main-body">
<?php 
// default main landing page
if ($op == "index" && !eregi("news", $_SERVER['REQUEST_URI'])) {
    include_once 'content/intro.html';
    print "      <h2 id=\"news\">News and Announcements:</h2>\n";
    include_once 'common/news_inc.php';
    // if in news sections, omit "intro" item
} elseif ($op == "index" && eregi("news", $_SERVER['REQUEST_URI'])) {
    print "      <h2 id=\"news\">News and Announcements:</h2>\n";
    include_once 'common/news_inc.php';
} else {
    // Section selector - BODY - rest of site sections
    section($op, $news, $errno, $errdesc, $SERVER_NAME, $HTTP_REFERER, $SERVER_SIGNATURE, $REQUEST_URI, $REDIRECT_URL, $mode, $gsb_bin_update_ver, $slack_ver, $dir, $path, $ver, $gsb_bin_stable_ver, $gsb_source_ver, $cl_ver, $ports, $stable, $gsb_bin_unstable_ver, $gsb_bin_current_ver, $gsb_bin_stable, $slack_unstable_ver, $gsb_bin_64_ver, $gsb_slax_ver, $slax_ver, $slapt_get_ver, $cl_uri, $slapt_get_ver_noarch);
}
?>
</div>

开发者ID:kleopatra999,项目名称:gsb-web,代码行数:25,代码来源:body_inc.php

示例8: admin

function admin()
{
    global $home;
    onlyadmin();
    $output = '<form method="post" action="' . $home . 'forum/createcatpost">
              <p><label for="title">' . t("Título") . '</label><br/>
                <input type="text" name="title"></p>
              <p><label for="desc">' . t("Descrição") . '</label><br/>
                <textarea rows="4" cols="25" name="desc"></textarea></p>
              <p><input type="submit" value="Criar categoria"></p>
             </form>';
    $output .= '<hr size="1">';
    $qry = mysql_query("SELECT * FROM forum_categorias");
    if (mysql_numrows($qry) == 0) {
        $output .= infobox(t("Você ainda não criou categorias."), false, false);
    } else {
        while ($row = mysql_fetch_array($qry)) {
            $output .= "\n<div class=\"row\"><p>" . url("forum/topics/{$row['id']}", $row['title']) . '<br>
                  <i>' . bbcode($row['desc']) . '</i><hr size="1">
                  ' . url("forum/removecat/{$row['id']}", t("[remover]")) . '
                  </p></div>';
        }
    }
    section($output, t("Administração do fórum"));
}
开发者ID:jesobreira,项目名称:soclwap,代码行数:25,代码来源:forum.php

示例9: mysql_fetch_assoc

    die;
}
$section = mysql_fetch_assoc($section);
if (isset($_POST['Submit']) && $_POST['Submit'] == "Submit" && isset($page['params'][1])) {
    $page_id = mysql_real_escape_string($page['page_id']);
    $title = mysql_real_escape_string($_POST['title']);
    $content = mysql_real_escape_string($_POST['content']);
    mysql_do_query("UPDATE `cms_sections` SET `section_title`='{$title}', `section_text`='{$content}' \n                   WHERE `section_id`='" . mysql_real_escape_string($page['params'][1]) . "'");
    $template_data = template_section_config_post($_POST);
    if (!is_array($template_data)) {
        if ($template_data != $section['template_data']) {
            if ($template_data == "") {
                mysql_do_query("DELETE FROM `cms_template_section_config` \n                              WHERE `template_name` = '" . mysql_real_escape_string($site_config['template']) . "'\n                                AND `template_section_id` = '" . mysql_real_escape_string($section['section_id']) . "'");
            } else {
                mysql_do_query("UPDATE `cms_template_section_config` \n                          SET `template_data`='" . mysql_real_escape_string($template_data) . "'\n                        WHERE `template_name` = '" . mysql_real_escape_string($site_config['template']) . "'\n                          AND `template_section_id` = '" . mysql_real_escape_string($section['section_id']) . "'");
                if (mysql_affected_rows() == 0) {
                    mysql_do_query("INSERT INTO `cms_template_section_config` \n                                  SET `template_data`='" . mysql_real_escape_string($template_data) . "',\n                                      `template_section_id` = '" . mysql_real_escape_string($section['section_id']) . "',\n                                      `template_name` = '" . mysql_real_escape_string($site_config['template']) . "'");
                }
            }
        }
    }
    header("location: " . $page['path']);
    die;
}
$foo = "<form action=\"{$page['path']}.edit.{$page['params'][1]}\" method=\"POST\">";
$foo .= "Section title:<br><input type=\"text\" name=\"title\" size=\"95\" value=\"{$section['section_title']}\"><br><br/>";
$foo .= "Content:<br><textarea name=\"content\" cols=\"80\" rows=\"10\">{$section['section_text']}</textarea><br/><br/>";
$foo .= template_section_config_form($section);
$foo .= "<input type=\"Submit\" name=\"Submit\" value=\"Submit\"></form>";
$content .= section("Edit...", $foo);
开发者ID:kaithar,项目名称:livepage,代码行数:30,代码来源:edit.php

示例10: while

        break;
}
if ($A->count() > 0) {
    while ($A->fetch()) {
        ?>
<tr>
<td><?php 
        echo $A->element("serial");
        ?>
</td>
<td><?php 
        echo str_replace("-", "/", $A->element("date"));
        ?>
</td>
<td><?php 
        echo section($A->element("section"));
        ?>
</td>
<td><?php 
        echo floorname($A->element("floor")) . " - " . $A->element("room") . "室";
        ?>
</td>
<td><?php 
        echo username($A->element("name"));
        ?>
</td>
<td>
<form action="editreserve.php" method="post">
<input type="submit" value="取消">
<input type="hidden" name="delete" value="1">
<input type="hidden" name="id" value="<?php 
开发者ID:awei0905,项目名称:Elimination-Series,代码行数:31,代码来源:index.php

示例11: notes

function notes($user)
{
    global $url;
    $output = null;
    $id_user = resolveuser($user);
    $qry = mysql_query("SELECT content FROM notes WHERE account='{$id_user}'");
    $output = menu($user);
    if (mysql_num_rows($qry) == 0) {
        $output .= 'Nenhuma notificação!';
    } else {
        while ($row = mysql_fetch_array($qry)) {
            $output .= "\n" . '<p class="note">
' . url("user/profile/{$user}", $user) . ' ' . $row['content'] . '
</p>';
        }
    }
    section($output, "Notificações de {$user}");
}
开发者ID:jesobreira,项目名称:soclwap,代码行数:18,代码来源:user.php

示例12: section

<?php

require_once 'config.php';
?>
	
	<div class="section">
		<div class="wrapper narrow">
			<div class="column-100">
				<h1>Footer Page</h1>
				<p>To edit this page, open <code>/page.php</code> in your code editor of choice. To remove this page from the footer menu, open <code>/system/sections/footer.php</code>.</p>
				<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec id felis scelerisque, scelerisque risus sed, pellentesque augue. Ut elit sapien, vulputate vitae lacus in, ullamcorper rutrum libero. Nulla vel tellus leo. Mauris nisl odio, porta vel magna et, malesuada vestibulum erat. Sed nec enim augue. Donec mollis massa magna, auctor lacinia erat bibendum at.</p>
				<p>Maecenas eget augue magna. Duis lorem velit, tempus suscipit finibus ac, aliquet in mi. Etiam semper ac tellus vitae commodo. Phasellus venenatis sem non odio convallis, nec accumsan tortor scelerisque. Nulla et nisl aliquam, ornare enim eu, pellentesque augue.</p>
			</div>
		</div>
	</div>

<?php 
section('footer');
开发者ID:habibmasuro,项目名称:SansCMS,代码行数:18,代码来源:page.php

示例13: viewalbum

function viewalbum($aid)
{
    global $home, $url;
    requirelogin();
    $aid = protect($aid);
    $qry = mysql_query("SELECT * FROM photos WHERE `album`='{$aid}'");
    if (mysql_numrows($qry) == 0) {
        $output .= infobox(t("Este álbum está vazio."), false);
    } else {
        while ($row = mysql_fetch_array($qry)) {
            $output .= '<div class="row">
  <img src="' . $url . '/upload/' . $row['foto'] . '" width="320"><br/>
  </div><br/>';
        }
    }
    section($output, t("Vendo álbum"));
}
开发者ID:jesobreira,项目名称:soclwap,代码行数:17,代码来源:photos.php

示例14: microtime

<?php

include 'router.php';
include 'request.php';
require 'helper.php';
//clear();
$curTime = microtime(true);
$uri = "/data/4";
//$uri = "/users";
section("Original URI: {$uri}");
$request = new Request($uri);
$router = new Router($request);
$router->GET('/', function ($req, $res) {
    $res->send("root");
});
$router->GET('/data/{id}', function ($req, $res) {
    $res->send("fuck data " . $req->params->id);
});
$router->GET('/users', function ($req, $res) {
    echo "users root\r\n";
});
$router->GET('/users/{id}', function ($req, $res) {
    $res->send("fuck user " . $req->params->id);
});
getElapsed($curTime);
开发者ID:andrew-ayers,项目名称:php,代码行数:25,代码来源:token.php

示例15: 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


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