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


PHP post_link函数代码示例

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


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

示例1: make_table

function make_table($rows, $hds, $class = "", $id = "", $ucols = [], $scols = [], $pcols = [])
{
    // isset($hds) || ($hds = array_keys($rows[0]));
    $t = make_tag("table", $class, $id);
    $thead = make_tag("thead");
    $thead["children"][] = make_tag("tr");
    // table headers
    foreach ($hds as $th) {
        $c = make_tag("th");
        $c["data"] = $th;
        $thead["children"][0]["children"][] = $c;
    }
    $tbody = make_tag("tbody");
    foreach ($rows as $row) {
        $r = make_tag("tr");
        for ($i = 0; $i < count($hds); $i++) {
            $col = $hds[$i];
            $c = make_tag("td");
            if (in_array($i, $ucols)) {
                $c["children"][] = user_link($row[$col]);
            } else {
                if (in_array($i, $scols)) {
                    $c["children"][] = soc_link($row[$col]);
                } else {
                    if (in_array($i, $pcols)) {
                        $c["children"][] = post_link($row["post_id"], $row[$col], $row["society"]);
                    } else {
                        $c["children"][] = span($row[$col]);
                    }
                }
            }
            $r["children"][] = $c;
        }
        $tbody["children"][] = $r;
    }
    $t["children"][] = $thead;
    $t["children"][] = $tbody;
    return $t;
}
开发者ID:AdeelH,项目名称:reddit-clone,代码行数:39,代码来源:html_funcs.php

示例2: if

  <? if($seller['custom_fields']['paypal']) : ?>
  <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
    <input type="hidden" name="cmd" value="_xclick">
    <input type="hidden" name="business" value="<? print $seller['custom_fields']['paypal'] ?>">
    <input type="hidden" name="amount" value="<?php 
print $post["custom_fields"]['price'];
?>
">
    <input type="hidden" name="lc" value="US">
    <input type="hidden" name="item_name" value="Buy <?php 
print addslashes($post['content_title']);
?>
 from <?php 
print addslashes(user_name($seller['id']));
?>
 - link <? print post_link($post['id']); ?>">
    <input type="hidden" name="item_number" value="<?php 
print addslashes($post['id']);
?>
">
    <input type="hidden" name="button_subtype" value="services">
    <input type="hidden" name="no_note" value="0">
    <input type="hidden" name="currency_code" value="USD">
    <input type="hidden" name="bn" value="PP-BuyNowBF:btn_buynowCC_LG.gif:NonHostedGuest">
    <input type="image" src="https://www.paypal.com/en_US/i/btn/btn_buynowCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
    <img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
  </form>
  <? else :  ?>
  <a href="javascript:mw.users.UserMessage.compose(<?php 
echo $seller['id'];
?>
开发者ID:Gninety,项目名称:Microweber,代码行数:31,代码来源:post_item_toy_inner.php

示例3: foreach

<?php 
foreach ((array) $posts as $bb_post) {
    ?>
		<item>
			<title><?php 
    post_author();
    ?>
 <?php 
    _e('on');
    ?>
 "<?php 
    topic_title($bb_post->topic_id);
    ?>
"</title>
			<link><?php 
    post_link();
    ?>
</link>
			<pubDate><?php 
    bb_post_time(array('format' => 'D, d M Y H:i:s +0000', 'localize' => false));
    ?>
</pubDate>
			<dc:creator><?php 
    post_author();
    ?>
</dc:creator>
			<guid isPermaLink="false"><?php 
    post_id();
    ?>
@<?php 
    bb_uri();
开发者ID:un1coin,项目名称:ovn-space,代码行数:31,代码来源:rss2.php

示例4: comment

 /**
  * Add new comment to topic
  */
 public function comment()
 {
     $this->load->model('comment');
     $comment['post_id'] = param('post_id');
     if (empty($comment['post_id'])) {
         set_flash_error('Ошибка в параметрах комментария');
         redirect();
     }
     $post = $this->post->find($comment['post_id'], 1);
     if (empty($post)) {
         set_flash_error('Такого топика не существует');
         redirect();
     }
     $comment['parent_id'] = param('parent_id');
     $comment['text'] = prepare_text(param('text', TRUE, FALSE));
     if (empty($comment['text'])) {
         set_flash_error('Вы не написали свой комментарий к топику');
         redirect(post_link($post));
     }
     $comment['user_id'] = $this->current_user['id'];
     $comment['added_at'] = now2mysql();
     $id = $this->comment->save($comment);
     if ($id) {
         set_flash_ok('Спасибо за ваш комментарий');
     } else {
         set_flash_error('Извините, но произошла ошибка и ваш комментарий сохранить не удалось');
     }
     redirect(post_link($post) . '#com' . $id);
 }
开发者ID:ak826843,项目名称:bmf,代码行数:32,代码来源:post.php

示例5: foreach

?>

<div class="row">
    <div class="span12">
        <?php 
foreach ($posts as $post) {
    ?>
            <div id="post-<?php 
    echo $post['id'];
    ?>
" class="post">
                <?php 
    echo $this->template->render('blog/_author', array('post' => $post));
    ?>
                <h2><a href="<?php 
    echo post_link($post);
    ?>
"><?php 
    echo form_prep($post['title']);
    ?>
</a> <?php 
    echo post_control($post);
    ?>
</h2>                
                <?php 
    echo $post['cut'];
    ?>
            </div>
            <hr/>
        <?php 
}
开发者ID:ak826843,项目名称:bmf,代码行数:31,代码来源:index.php

示例6: get_page_for_post

function get_page_for_post($post_id)
{
    $url = post_link($post_id);
    $page = CI::model('content')->getPageByURLAndCache($url);
    //p($url_page);
    return $page;
}
开发者ID:Gninety,项目名称:Microweber,代码行数:7,代码来源:mw_functions.php

示例7: foreach

 $games = $games['posts'];

 
 @shuffle( $games);
 ?>
  <h2>New Toys</h2>
  <ul class="new-toys">
    <? foreach($games as $item):
   $item = get_post($item['id']);
   ?>
    <li> <a class="img" href="<? print post_link($item['id']); ?>"><img src="<? print thumbnail($item['id'], 120) ?>" alt="" /></a>
      <div class="toy_desc">
        <h4><a href="<? print post_link($item['id']); ?>"><? print $item['content_title']; ?></a></h4>
        <span><? print character_limiter(codeClean($item['content_body']), 100); ?></span> <strong class="red">$<? print $item["custom_fields"]['price'];?> </strong>
        <div class="c" style="padding-bottom: 5px;"></div>
        <a href="<? print post_link($item['id']); ?>" class="right">See more</a> </div>
    </li>
    <? endforeach; ?>
  </ul>
</div>
<div id="wall">
  <h1 id="results_holder_title" style="display:none" ></h1>
  <div class="top_games" id="results_holder" style="display:none"></div>
  <?php 
if (count($active_categories) == 1) {
    ?>
  <h1 id="top_games_holder_title" ><? print $page['content_title'] ?></h1>
  <br />
  <div class="top_games" id="top_games_holder">
    <microweber module="posts/most_popular_from_categories" category="1" />
  </div>
开发者ID:Gninety,项目名称:Microweber,代码行数:31,代码来源:games_list.php

示例8: foreach

					<th>操作</th>
				</tr>
				</thead>
				<tbody>
				<?php 
    foreach ($__data as $v) {
        ?>
					<tr id="post_list_<?php 
        echo $v['id'];
        ?>
">
						<td>【<?php 
        echo $v['id'];
        ?>
】<a class="glyphicon glyphicon-eye-open" rel="external" href="<?php 
        echo post_link($v['post_name']);
        ?>
?preview=true"><?php 
        echo $v['post_title'];
        ?>
</a></td>
						<td><?php 
        echo $v['post_time'];
        ?>
</td>
						<td><?php 
        echo $v['post_category'];
        ?>
</td>
						<td><?php 
        echo $v['post_status'] ? "已发布" : "草稿";
开发者ID:ttym7993,项目名称:Linger,代码行数:31,代码来源:management.php

示例9: get_post

<?  $the_post = get_post($the_post['id']); ?>
<div class="video_list_item">
  <a href="<? print post_link($the_post['id']); ?>" class="mw_blue_link">
      <? print $the_post['content_title'];  ?>
  </a>
  <a href="<? print post_link($the_post['id']); ?>" class="img" style="background-image:url(<? print thumbnail($the_post['id'], 150) ?>)"> </a>
  <a class="user_activity_likes left" href="<? print voting_link($the_post['id'], '#post-likes-'.$the_post['id']); ?>">
      <strong><? print votes_count($the_post['id']); ?></strong><span></span>
  </a>
  <? /*
  <a class="user_activity_comments right" href="<? print post_link($the_post['id']); ?>">
      <strong id="post-likes-<? print ($the_post['id']); ?>"><? print comments_count($the_post['id']); ?></strong><span></span>
  </a>
  */ ?>
  <span class="right red"><strong>$ <? print $the_post['custom_fields']['price'];  ?> </strong></span>
</div>
开发者ID:Gninety,项目名称:Microweber,代码行数:16,代码来源:post_item_toy.php

示例10: if

<? endif; ?>
<?  else : ?>

<? if($file): ?>
<? foreach($posts['posts'] as $post): ?>
<?
	$try_file1 = TEMPLATE_DIR . $file.'.php';
$this->template ['the_post'] = $post;
				$this->load->vars ( $this->template );
				
				$content_filename = $this->load->file ( $try_file1, true );
				print $content_filename;
?>

<? endforeach; ?>
<?  else : ?>


<? if(!$display and !$file): ?>

<ul class="posts-list">
  <? foreach($posts['posts'] as $post): ?>
 
  <li> <a href="<? print post_link($post['id']); ?>" class="img" style="background-image: url('<? print thumbnail($post['id'], 150) ?>')"><span></span></a> <strong><a href="<? print post_link($post['id']); ?>"><? print $post['content_title'] ?></a></strong>
    <p><? print $post['content_description'];  ?></p>
  </li>
  <? endforeach; ?>
</ul>
<? endif; ?>
<? endif; ?>
<? endif; ?>
开发者ID:Gninety,项目名称:Microweber,代码行数:31,代码来源:list.php

示例11: html_entity_decode

 <h2><? print $post_data['content_title']; ?></h2>
 <br />
<? print html_entity_decode($post_data['content_body']); ?>


<div class="my__embed">
 <? print html_entity_decode( $post_data['custom_fields']['embed_code']); ?>

</div>





<div><span class="st_sharethis" st_url="<? print post_link($post_data["id"]); ?>" st_title="<? print addslashes($post_data["content_title"]); ?>" displayText="Share this"></span>

 <a href="#" class="user_activity_comments"><strong><? print comments_count($post_data['id'], false); ?></strong><span></span><strong>Comments</strong></a> <a  class="user_activity_likes right"  href="<? print voting_link($post_data['id'], '#post-likes-'.$post_data['id']); ?>"><strong id="post-likes-<? print ($post_data['id']); ?>"><? print votes_count($post_data['id'], false ); ?></strong> Like</a> </div>
  </div>
  <? $update_element = md5(serialize($post_data));
  $this->template ['comments_update_element'] = $update_element;
	$this->load->vars ( $this->template );
  ?>
  <? comment_post_form($post_data['id'],'dashboard/index_item_comments.php')  ?>
  <div id="<? print $update_element ?>">
    <? comments_list($post_data['id'], 'dashboard/index_item_comments_list.php')  ?>
  </div>
  
  
  
开发者ID:Gninety,项目名称:Microweber,代码行数:26,代码来源:my_videos.php

示例12: taxonomyGetUrlForId

 function taxonomyGetUrlForId($id)
 {
     //return false ;
     if (intval($id) == 0) {
         return false;
     }
     $function_cache_id = false;
     $args = func_get_args();
     foreach ($args as $k => $v) {
         $function_cache_id = $function_cache_id . serialize($k) . serialize($v);
     }
     $function_cache_id = __FUNCTION__ . md5($function_cache_id);
     $taxonomy_id = intval($id);
     $cache_group = 'taxonomy/' . $taxonomy_id;
     $cache_content = CI::model('core')->cacheGetContentAndDecode($function_cache_id, $cache_group);
     if ($cache_content != false) {
         return $cache_content;
     } else {
         $data = array();
         $data['id'] = $id;
         $data = CI::model('taxonomy')->getSingleItem($id);
         if (empty($data)) {
             return false;
         }
         //$this->load->model ( 'Content_model', 'content_model' );
         global $cms_db_tables;
         //global $CI;
         $table = $cms_db_tables['table_taxonomy'];
         $table_content = $cms_db_tables['table_content'];
         $content = array();
         $content['content_subtype'] = 'blog_section';
         $content['content_subtype_value'] = $id;
         //$orderby = array ('id', 'desc' );
         //$q = " select * from $table_content where content_subtype ='blog_section' and content_subtype_value={$id} limit 0,1";
         //$q = CI::model('core')->dbQuery ( $q, __FUNCTION__ . md5 ( $q ), $cache_group );
         $content = $this->getContentAndCache($content, $orderby);
         //$content = $q [0];
         $content = $content[0];
         $url = false;
         if (!empty($content)) {
             if ($content['content_type'] == 'page') {
                 $url = page_link($content['id']);
             }
             if ($content['content_type'] == 'post') {
                 $url = post_link($content['id']);
             }
         }
         if ($url != false) {
             return $url;
         }
         $parent_ids = CI::model('taxonomy')->getParentsIds($data['id']);
         foreach ($parent_ids as $item) {
             $content = array();
             $content['content_subtype'] = 'blog_section';
             $content['content_subtype_value'] = $item;
             $orderby = array('id', 'desc');
             $q = " select * from {$table_content} where content_subtype ='blog_section' and content_subtype_value={$item} limit 0,1";
             //$q = CI::model('core')->dbQuery ( $q, __FUNCTION__ . md5 ( $q ), $cache_group );
             $content = $this->getContentAndCache($content, $orderby);
             //$content = CI::model('content')->getContentAndCache ( $content, $orderby );
             //$content = $q [0];
             $content = $content[0];
             $url = false;
             if (!empty($content)) {
                 if ($content['content_type'] == 'page') {
                     $url = page_link($content['id']);
                     //$url = $url . '/category:' . $data ['taxonomy_value'];
                     $url = $url . '/categories:' . $data['id'];
                 }
                 if ($content['content_type'] == 'post') {
                     $url = post_link($content['id']);
                 }
             }
             if ($url != false) {
                 CI::model('core')->cacheWriteAndEncode($url, $function_cache_id, $cache_group);
                 return $url;
             }
         }
         return false;
     }
     //var_dump ( $parent_ids );
 }
开发者ID:Gninety,项目名称:Microweber,代码行数:82,代码来源:content_model.php

示例13: get_dashboard_action

function get_dashboard_action($log_id)
{
    global $CI;
    $log = get_log_item($log_id);
    $data = $log;
    $to_return = array();
    switch ($data['to_table']) {
        case 'table_users_statuses':
            $stat = CI::model('statuses')->statusGetById(intval($data['to_table_id']));
            $stat = html_entity_decode($stat['status']);
            if (stristr($stat, 'http://') == true) {
                $term = 'shared a link';
                $stat = auto_link($stat);
                $embedly = true;
            } else {
                $term = 'said ';
                $embedly = false;
            }
            $to_return['allow_comments'] = true;
            $to_return['allow_likes'] = true;
            if ($embedly == false) {
                $to_return['msg'] = "{$term} " . $stat;
            } else {
                $to_return['msg'] = "<div class='embedly'>{$term} " . $stat . "</div>";
            }
            break;
        case 'table_users':
            $to_return['msg'] = "updated profile";
            $to_return['allow_comments'] = false;
            $to_return['allow_likes'] = false;
            break;
        case 'table_messages':
            $to_return['msg'] = "send a message to " . $data['to_table_id'] . ".. must be implemented";
            $to_return['allow_comments'] = false;
            $to_return['allow_likes'] = false;
            break;
        case 'table_comments':
            $to_return['allow_comments'] = true;
            $to_return['allow_likes'] = true;
            $comm = CI::model('comments')->commentGetById($data['to_table_id']);
            //p($comm);
            if ($comm['to_table'] == 'table_content') {
                $content_data = CI::model('content')->contentGetByIdAndCache($comm['to_table_id']);
                $url = CI::model('content')->getContentURLByIdAndCache($comm['to_table_id']);
                $comm_txt = $comm['comment_body'];
                $comm_txt = html_entity_decode($comm_txt);
                $comm_txt = auto_link($comm_txt);
                $thumb = thumbnail($content_data['id'], 90);
                //p($comm);
                $to_return['msg'] = "commented on <a href='{$url}'>{$content_data['content_title']}</a><br> {$comm_txt}";
                $to_return['msg'] .= "<div class='post_item'><div style='height:10px;'>&nbsp;</div><a href='{$url}'><img class='embed_img' src='{$thumb}' border='0'></a><h3 style='padding-bottom:5px;'><a href='{$url}'>{$content_data['content_title']}</a></h3> {$desc}  {$emded_txt} \t</div>";
            }
            if ($comm['rel_table'] == 'table_content') {
                $content_data = CI::model('content')->contentGetByIdAndCache($comm['rel_table_id']);
                $url = CI::model('content')->getContentURLByIdAndCache($comm['rel_table_id']);
                $comm_txt = $comm['comment_body'];
                $comm_txt = html_entity_decode($comm_txt);
                $comm_txt = auto_link($comm_txt);
                $thumb = thumbnail($content_data['id'], 90);
                //p($comm);
                $to_return['msg'] = "commented on <a href='{$url}'>{$content_data['content_title']}</a><br> {$comm_txt}";
                $to_return['msg'] .= "<div class='post_item'><div style='height:10px;'>&nbsp;</div><a href='{$url}'><img class='embed_img' src='{$thumb}' border='0'></a><h3 style='padding-bottom:5px;'><a href='{$url}'>{$content_data['content_title']}</a></h3> {$desc}  {$emded_txt} \t</div>";
            }
            if ($comm['to_table'] == 'table_users_statuses') {
            }
            break;
        case 'table_votes':
            $to_return['allow_comments'] = false;
            $to_return['allow_likes'] = false;
            $vote = CI::model('votes')->voteGetById($data['to_table_id']);
            if ($vote['to_table'] == 'table_content') {
                $more = CI::model('core')->getCustomFields('table_content', $vote['to_table_id']);
                $content_data = CI::model('content')->contentGetByIdAndCache($vote['to_table_id']);
                $url = CI::model('content')->getContentURLByIdAndCache($vote['to_table_id']);
                $to_return['msg'] = "liked <a href='{$url}'>{$content_data['content_title']}</a>";
                if ($more['embed_code']) {
                    $emded_txt = "<textarea>" . html_entity_decode($more['embed_code']) . "</textarea>";
                } else {
                    $emded_txt = false;
                }
                $thumb = thumbnail($content_data['id'], 90);
                $desc = codeClean($content_data['content_body']);
                $desc = character_limiter($desc, 140, '...');
                $desc = str_ireplace("\n", ' ', $desc);
                $desc = str_ireplace('\\n', ' ', $desc);
                $to_return['msg'] .= "<div class='post_item'><div style='height:10px;'>&nbsp;</div><a href='{$url}'><img class='embed_img' src='{$thumb}' border='0'></a><h3 style='padding-bottom:5px;'><a href='{$url}'>{$content_data['content_title']}</a></h3> {$desc}  {$emded_txt} \t</div>";
                break;
            } else {
            }
        case 'table_content':
            $content_data = CI::model('content')->contentGetById($data['to_table_id']);
            if (empty($content_data)) {
                CI::model('notifications')->logDeleteById($data['id']);
            } else {
                $more = CI::model('core')->getCustomFields('table_content', $content_data['id']);
                $url = post_link($data['to_table_id']);
                $to_return['allow_comments'] = true;
                $to_return['allow_likes'] = true;
                $to_return['msg'] = "published <a href='{$url}'>{$content_data['content_title']}</a>";
                if ($more['embed_code']) {
//.........这里部分代码省略.........
开发者ID:Gninety,项目名称:Microweber,代码行数:101,代码来源:dashboard.php

示例14: post_link

<div class="game_item" onclick="window.location.href='<?php 
print $the_post['content_title'];
?>
'">

  <span class="gametitle"><?php 
print $the_post['content_title'];
?>
</span>

  <a title="<?php 
print $the_post['content_title'];
?>
" href="<?php 
print post_link($the_post['id']);
?>
" class="img" style="background-image: url('<?php 
print thumbnail(array('id' => $the_post['id'], 'size' => 150));
?>
')"> </a>


</div>
开发者ID:Gninety,项目名称:Microweber,代码行数:23,代码来源:games_list_single_item.php

示例15: post_link

<a title="<?php 
print $post['content_title'];
?>
" href="<?php 
print post_link($post['id']);
?>
" class="img" style="background-image: url('<?php 
print thumbnail(array('id' => $post['id'], 'size' => 150));
?>
')"></a>
 
开发者ID:Gninety,项目名称:Microweber,代码行数:10,代码来源:games_list_single_item.php


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