本文整理汇总了PHP中content函数的典型用法代码示例。如果您正苦于以下问题:PHP content函数的具体用法?PHP content怎么用?PHP content使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了content函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get
/**
* ### İçeriğe ait Custom Fields alan verilerini alma
* Custom fields ile oluşturulan dinamik form bilgilerini görüntüler.
* İçerik id'sine göre, belirtilen custom field değerini alır.
* Index sayfalarında content_id değeri belirtilir, show (detay)
* sayfalarında content_id değeri boş bırakılır.
* İşlemler için yardımcı fonksiyon olan content_value() kullanılır.
*
* @example show page : Content::get('custom_field_name')
* @example index page : Content::get('custom_field_name', $content_id)
*
* @param $key : Form name adı / anahtarı
* @param $content_id : içerik id'si
*
* @return string
*/
public function get($key, $content_id = null)
{
if ($content_id) {
return content_value($key, $content_id);
}
return content_value($key, content('id'));
}
示例2: childs
function childs()
{
$usable_path = $this->path;
// if(starts_with($this->path, '.')){
// $usable_path = $this->file->getRelativePath();
// }
return content()->section_menu($usable_path);
}
示例3: protected_content
public function protected_content()
{
if ($this->admin) {
return content();
} else {
$session->set_message("You must be an admin to view this page: Click <a href='javascript: history.go(-1)'>here</a> to return to the previous page.");
$session->output_message();
}
}
示例4: do_page_content
function do_page_content()
{
global $error_page;
if (isset($error_page)) {
$error_page();
} else {
content();
}
}
示例5: search
public function search($what)
{
$result = DB::query("SELECT `id`, `name`, `picture` " . "FROM `{$this->table_name}` WHERE " . "`name` LIKE '%" . mysql_real_escape_string($what) . "%'\r\n LIMIT 5", false);
if (!$result) {
return false;
}
$univ_list = array();
while ($univ = mysql_fetch_array($result)) {
$univ_list[$univ['id']] = array('name' => $univ['name'], 'img' => $univ['picture'] ? content($univ['picture']) : url('img/udef.png'));
}
return empty($univ_list) ? false : $univ_list;
}
示例6: search
public function search($what)
{
$result = DB::query("SELECT `id`, `name`, `picture` FROM `{$this->group_table}` WHERE\n `name` LIKE '%" . mysql_real_escape_string($what) . "%'\n LIMIT 5", false);
if (!$result) {
return false;
}
$group_list = array();
while ($group = mysql_fetch_array($result)) {
$group_list[$group['id']] = array('name' => $group['name'], 'img' => $group['picture'] ? content($group['picture']) : url('img/gdef.png'));
}
return empty($group_list) ? false : $group_list;
}
示例7: content
function content($var)
{
global $pages, $config;
if (!isset($var)) {
$out = content($config['loadedpages'][0]);
} else {
if (!is_array($pages[$var]['content']) && $pages[$var]['status'] == 'active') {
$out = $pages[$var]['content'];
} elseif (is_array($pages[$var]['content']) && $pages[$var]['status'] == 'active') {
include $config['pagedir'] . '/' . $pages[$var]['content'][0] . '/' . $pages[$var]['content'][1];
$out = output();
} else {
$out = "<h1>Error 404</h1>Page Not Found!";
}
}
return $out;
}
示例8: head
}
head(1);
// Means we're in the feed
?>
</head>
<body>
<?php
title();
newsbar(1);
// Means we're in the feed
navbarleft();
content(1, 0, 1, 0, $filename);
// in feed, for the fn entries, filename for echoContent
if (!$_GET["num"]) {
// Makes $num be the newest news item of any type
$num = end(getposts(0));
} else {
$num = $_GET["num"];
}
bottom($num);
?>
</body>
</html>
示例9: testimonials_output_func
function testimonials_output_func($atts)
{
$testimonialoutput = '<div id="testimonials"><div class="quotes">
<ul>';
wp_reset_query();
query_posts('post_type=testimonials');
if (have_posts()) {
while (have_posts()) {
the_post();
$possition = esc_html(get_post_meta(get_the_ID(), 'possition', true));
$testimonialoutput .= '
<li>
<div class="tm_thumb">
' . get_the_post_thumbnail(get_the_ID(), array(80, 80)) . '
<h6> ' . get_the_title() . '</h6>
<span>' . $possition . '</span>
</div>
<div class="tm_description">
' . content(60) . '
</div>
</li>
';
}
$testimonialoutput .= '</ul></div></div>';
} else {
$testimonialoutput = '<div id="testimonials">
<div class="quotes">
<ul>
<li>
<div class="tm_thumb">
<img src="' . get_template_directory_uri() . "/images/testimonial.jpg" . '" alt="" />
<h6>Eficitur Sodale</h6>
<span>Web Developer</span>
</div>
<div class="tm_description">
<p>Aliquam et varius orci, ut ornare justo. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque augue metus, blandit vel nibh sed, sollicitudin placerat quam. Quisque id scelerisque nibh. Phasellus in orci et felis tristique finibus non quis erat. Quisque nec congue nunc, sagittis aliquet orci. Quisque pulvinar feugiat sodales. Nam fermentum tempus odio sed euismod Quisque pulvinar feugiat sodales. Nam fermentum tempus odio sed euismod.</p>
</div>
</li>
<li>
<div class="tm_thumb">
<img src="' . get_template_directory_uri() . "/images/testimonial.jpg" . '" alt="" />
<h6>Eficitur Sodale</h6>
<span>Web Developer</span>
</div>
<div class="tm_description">
<p>Aliquam et varius orci, ut ornare justo. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque augue metus, blandit vel nibh sed, sollicitudin placerat quam. Quisque id scelerisque nibh. Phasellus in orci et felis tristique finibus non quis erat. Quisque nec congue nunc, sagittis aliquet orci. Quisque pulvinar feugiat sodales. Nam fermentum tempus odio sed euismod Quisque pulvinar feugiat sodales. Nam fermentum tempus odio sed euismod.</p>
</div>
</li>
</ul>
</div>
</div> ';
}
wp_reset_query();
$testimonialoutput .= '</div>';
return $testimonialoutput;
}
示例10: session_start
session_start();
ini_set('display_errors', 1);
ini_set('error_reporting', E_ALL);
ini_set('error_prepend_string', "<p class=text-error>");
ini_set('error_append_string', "</p>");
if (!isset($_SESSION["uid"])) {
header("location:miniadm.logon.php");
}
include_once dirname(__FILE__) . "/ressources/class.templates.inc";
include_once dirname(__FILE__) . "/ressources/class.users.menus.inc";
include_once dirname(__FILE__) . "/ressources/class.miniadm.inc";
include_once dirname(__FILE__) . "/ressources/class.mysql.postfix.builder.inc";
include_once dirname(__FILE__) . "/ressources/class.user.inc";
if (isset($_GET["content"])) {
content();
exit;
}
if (isset($_GET["tabs"])) {
tabs();
exit;
}
if (isset($_GET["master-content"])) {
master_content();
exit;
}
if (isset($_GET["graph1"])) {
graph1();
exit;
}
if (isset($_GET["graph2"])) {
示例11: array
</div>
<h3 class="entity-title">
<a href="<?php
echo @route($topic->getURL());
?>
">
<?php
echo @escape($topic->title);
?>
</a>
</h3>
<div class="entity-description">
<?php
echo @helper('text.truncate', @content($topic->body, array('exclude' => 'gist')), array('length' => 200, 'consider_html' => true));
?>
</div>
<div class="entity-meta">
<ul class="an-meta inline">
<li><?php
echo sprintf(@text('LIB-AN-MEDIUM-NUMBER-OF-COMMENTS'), $topic->numOfComments);
?>
</li>
</ul>
<div class="an-meta vote-count-wrapper" id="vote-count-wrapper-<?php
echo $topic->id;
?>
">
示例12: testimonialoutput_func
function testimonialoutput_func($atts)
{
$testimonialoutput = '';
wp_reset_query();
$n = 0;
query_posts('post_type=testimonial&posts_per_page=3');
if (have_posts()) {
while (have_posts()) {
the_post();
$n++;
if ($n % 3 == 0) {
$nomgn = ' last';
} else {
$nomgn = ' ';
}
$testimonialoutput .= '<div class="testimonial-box' . $nomgn . '">' . get_the_post_thumbnail(get_the_ID(), array(82, 82)) . '
<div class="testimonial-post">
<h4>' . get_the_title() . '</h4>
<p>' . content(50) . '</p>
</div>
</div>';
}
}
wp_reset_query();
$testimonialoutput .= '<div class="clear"></div>';
return $testimonialoutput;
}
示例13: sprintf
<div class="an-meta"><?php
echo @date($topic->creationTime);
?>
</div>
</div>
</div>
<h3 class="entity-title">
<?php
echo @escape($topic->title);
?>
</h3>
<div class="entity-description">
<?php
echo @content($topic->body);
?>
</div>
<div class="entity-meta">
<ul class="an-meta inline">
<?php
if ($topic->numOfComments) {
?>
<li><?php
echo sprintf(@text('LIB-AN-MEDIUM-NUMBER-OF-COMMENTS'), $topic->numOfComments);
?>
</li>
<li><?php
echo sprintf(@text('LIB-AN-MEDIUM-LAST-COMMENT-BY-X'), @name($topic->lastCommenter), @date($topic->lastCommentTime));
示例14: UpdatePanel
."<div>Opacity = <i>$opacity%</i></div>"
."<div align='center' >"
."<input type='button' id='btn$numb' value='View the effect' /></div>";
return $content;
}
// UpdatePannel declare
$StyleUpdate1 = new UpdatePanel( "StyleUpdate1" );
$StyleUpdate2 = new UpdatePanel( "StyleUpdate2" );
$StyleUpdate3 = new UpdatePanel( "StyleUpdate3" );
$StyleUpdate4 = new UpdatePanel( "StyleUpdate4" );
// each panel has its own style to describe in its content .
$StyleUpdate1->content = content( "picture #1" , "white" , 50 , 1 , "green" );
$StyleUpdate2->content = content( "picture #4" , "#f4f4f4" , 70 , 2 , "orange" );
$StyleUpdate3->content = content( "picture #3" , "#f4f599" , 55 , 3 , "blue" );
$StyleUpdate4->content = content( "picture #9" , "(blank)" , 25 , 4 , "brown" );
// Add the event update for the button to 4 updatepanel
$StyleUpdate1->addTrigger( "btn1" , 'onclick' );
$StyleUpdate2->addTrigger( "btn2" , 'onclick' );
$StyleUpdate3->addTrigger( "btn3" , 'onclick' );
$StyleUpdate4->addTrigger( "btn4" , 'onclick' );
// 4 UpdatePanel have the same css style
$StyleUpdate1->cssclass = $StyleUpdate2->cssclass = $StyleUpdate3->cssclass = $StyleUpdate4->cssclass = "cssStyle";
// each loading
$StyleUpdate1->setLoading("$KoolControlsFolder/KoolAjax/loading/1.gif" , "white" , 50 );
$StyleUpdate2->setLoading("$KoolControlsFolder/KoolAjax/loading/4.gif" , "#f4f4f4" , 70 );
$StyleUpdate3->setLoading("$KoolControlsFolder/KoolAjax/loading/3.gif" , "#fff4f5" , 55 );
$StyleUpdate4->setLoading("$KoolControlsFolder/KoolAjax/loading/9.gif" , "" , 75 );
?>
<?php echo $koolajax->Render();?>
<style>
示例15: bloginfo
<!-- 1 -->
<div class="app-shops">
<img src="<?php
bloginfo('template_directory');
?>
/scripts/timthumb.php?src=<?php
echo get_post_meta($post->ID, "icon", $single = true);
?>
&h=60&w=59" alt="">
<h1> <?php
the_title_limit(30, '...');
?>
</h1>
<p> <?php
content('10');
?>
</p>
<a href="<?php
the_permalink();
?>
" class="mini-red" style="margin-right:4px;">more</a>
<?php
if (get_post_meta($post->ID, 'price', true)) {
?>
<a href="<?php
the_permalink();
?>
" class="mini-yellow"><?php