當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Comments::config方法代碼示例

本文整理匯總了PHP中Comments::config方法的典型用法代碼示例。如果您正苦於以下問題:PHP Comments::config方法的具體用法?PHP Comments::config怎麽用?PHP Comments::config使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Comments的用法示例。


在下文中一共展示了Comments::config方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: __construct

 public function __construct()
 {
     if (\Comments::config('db_prefix')) {
         $this->prefix = \Comments::config('db_prefix');
     } else {
         $this->prefix = null;
     }
 }
開發者ID:idfluid,項目名稱:comments,代碼行數:8,代碼來源:Database.php

示例2: json_encode

?>
,
		page       : '<?php 
echo Comments::config('comment_page') ? Comments::config('comment_page') : Comments::currentURL();
?>
',
		page_title : '<?php 
echo Comments::config('page_title');
?>
',
		lang       : <?php 
echo json_encode(Comments::config('js_lang'));
?>
,
		ajaxurl    : '<?php 
echo Comments::config('ajaxurl');
?>
'
	};
</script>
<?php 
echo HTML::script('public/packages/idfluid/comments/js/mustache.min.js');
echo HTML::script('public/packages/idfluid/comments/js/jquery-linkify.min.js');
echo HTML::script('public/packages/idfluid/comments/js/jquery.elastic.source.js');
echo HTML::script('public/packages/idfluid/comments/js/comments.js');
echo HTML::script('public/packages/idfluid/comments/js/jquery.validate.js');
?>

<!-- Comments Template -->
<script id="commentsTemplate" type="text/template">
	<li id="comment-{{id}}" class="item {{hidden}}">
開發者ID:idfluid,項目名稱:comments,代碼行數:31,代碼來源:template.php

示例3: sprintf

                if (!empty($notif_email) and !empty($comment)) {
                    if ($comment['status'] == 1) {
                        $subject = sprintf($templates['new_comment']['subject'], $_POST['page_title']);
                        $message = sprintf($templates['new_comment']['header'], $_POST['page_title']);
                        $message .= sprintf($templates['body'], $comment['author'], $comment['author_ip'], $comment['author_email'], $comment['author_url'], $comment['comment']);
                        $message .= sprintf($templates['new_comment']['footer'], $_POST['page_url'], $_POST['comment_url']);
                    } else {
                        $subject = sprintf($templates['moderate']['subject'], $_POST['page_title']);
                        $message = sprintf($templates['moderate']['header'], $_POST['page_title']);
                        $message .= sprintf($templates['body'], $comment['author'], $comment['author_ip'], $comment['author_email'], $comment['author_url'], $comment['comment']);
                        $url = Comments::config('base_url') . 'admin/?page=comments';
                        $message .= sprintf($templates['moderate']['footer'], $url . '&action=approve&comments%5B%5D=' . $comment['id'], $url . '&action=spam&comments%5B%5D=' . $comment['id'], $url . ($comment['status'] == 2 ? '&status=spam' : '') . '#edit-' . $comment['id']);
                    }
                    Comments::send_email($notif_email, $subject, $message);
                }
                if (!empty($_POST['reply']) and is_numeric($_POST['reply']) and Comments::config('reply_notification') and !empty($comment) and $comment['status'] == 1) {
                    $parent = Comments::get_comments(array('id' => $_POST['reply'], 'rows' => $rows));
                    if ($parent) {
                        $subject = sprintf($templates['reply']['subject'], $_POST['page_title']);
                        $message = sprintf($templates['reply']['body'], $comment['author'], $comment['comment'], $_POST['comment_url']);
                        Comments::send_email($parent['author_email'], $subject, $message);
                    }
                }
            }
            unset($_SESSION['com_email_notif']);
            break;
        case 'refreshcaptcha':
            Comments::captcha();
            break;
    }
}
開發者ID:idfluid,項目名稱:comments,代碼行數:31,代碼來源:ajax.php


注:本文中的Comments::config方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。