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


PHP dsq_identifier_for_post函数代码示例

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


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

示例1: dsq_export_wp

function dsq_export_wp($post, $comments = null)
{
    global $wpdb;
    if (!$comments) {
        $comments = $wpdb->get_results($wpdb->prepare("SELECT * FROM {$wpdb->comments} WHERE comment_post_ID = %d AND comment_agent NOT LIKE 'Disqus/%%'", $post->ID));
    }
    // start catching output
    ob_start();
    echo '<?xml version="1.0" encoding="' . get_bloginfo('charset') . '"?' . ">\n";
    the_generator('export');
    ?>
<rss version="2.0"
    xmlns:excerpt="http://wordpress.org/export/<?php 
    echo WXR_VERSION;
    ?>
/excerpt/"
    xmlns:content="http://purl.org/rss/1.0/modules/content/"
    xmlns:dsq="https://disqus.com/"
    xmlns:wfw="http://wellformedweb.org/CommentAPI/"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
    xmlns:wp="http://wordpress.org/export/<?php 
    echo WXR_VERSION;
    ?>
/"
>

<channel>
    <title><?php 
    bloginfo_rss('name');
    ?>
</title>
    <link><?php 
    bloginfo_rss('url');
    ?>
</link>
    <pubDate><?php 
    echo mysql2date('D, d M Y H:i:s +0000', get_lastpostmodified('GMT'), false);
    ?>
</pubDate>
    <generator>WordPress <?php 
    bloginfo_rss('version');
    ?>
; Disqus <?php 
    echo DISQUS_VERSION;
    ?>
</generator>
<?php 
    global $wp_query, $post;
    $wp_query->in_the_loop = true;
    // Fake being in the loop.
    setup_postdata($post);
    ?>
<item>
<title><?php 
    echo apply_filters('the_title_rss', $post->post_title);
    ?>
</title>
<link><?php 
    the_permalink_rss();
    ?>
</link>
<pubDate><?php 
    echo mysql2date('D, d M Y H:i:s +0000', get_post_time('Y-m-d H:i:s', true), false);
    ?>
</pubDate>
<dc:creator><?php 
    echo dsq_export_wxr_cdata(get_the_author());
    ?>
</dc:creator>
<guid isPermaLink="false"><?php 
    the_guid();
    ?>
</guid>
<content:encoded><?php 
    echo dsq_export_wxr_cdata(apply_filters('the_content_export', $post->post_content));
    ?>
</content:encoded>
<dsq:thread_identifier><?php 
    echo dsq_identifier_for_post($post);
    ?>
</dsq:thread_identifier>
<wp:post_id><?php 
    echo $post->ID;
    ?>
</wp:post_id>
<wp:post_date_gmt><?php 
    echo $post->post_date_gmt;
    ?>
</wp:post_date_gmt>
<wp:comment_status><?php 
    echo $post->comment_status;
    ?>
</wp:comment_status>
<?php 
    if ($comments) {
        foreach ($comments as $c) {
            ?>
<wp:comment>
<wp:comment_id><?php 
            echo $c->comment_ID;
//.........这里部分代码省略.........
开发者ID:coreymargulis,项目名称:karenmargulis,代码行数:101,代码来源:export.php

示例2: dsq_comments_text

function dsq_comments_text($comment_text)
{
    global $post;
    if (dsq_can_replace()) {
        return '<span class="dsq-postid" data-dsqidentifier="' . esc_attr(dsq_identifier_for_post($post)) . '">' . $comment_text . '</span>';
    } else {
        return $comment_text;
    }
}
开发者ID:VizualAbstract,项目名称:Marilyn,代码行数:9,代码来源:disqus.php

示例3: get_permalink

    ?>
            </ul>
        </div>
    <?php 
}
?>
</div>

<script type="text/javascript">
/* <![CDATA[ */
    var disqus_url = '<?php 
echo get_permalink();
?>
';
    var disqus_identifier = '<?php 
echo dsq_identifier_for_post($post);
?>
';
    var disqus_container_id = 'disqus_thread';
    var disqus_domain = '<?php 
echo DISQUS_DOMAIN;
?>
';
    var disqus_shortname = '<?php 
echo strtolower(get_option('disqus_forum_url'));
?>
';
    var disqus_title = <?php 
echo cf_json_encode(dsq_title_for_post($post));
?>
;
开发者ID:jonathansewell,项目名称:Learning-Journal,代码行数:31,代码来源:comments.php

示例4: dsq_export_wp


//.........这里部分代码省略.........
            echo apply_filters('the_title_rss', $post->post_title);
            ?>
</title>
<link><?php 
            the_permalink_rss();
            ?>
</link>
<pubDate><?php 
            echo mysql2date('D, d M Y H:i:s +0000', get_post_time('Y-m-d H:i:s', true), false);
            ?>
</pubDate>
<dc:creator><?php 
            echo wxr_cdata(get_the_author());
            ?>
</dc:creator>
<?php 
            wxr_post_taxonomy();
            ?>

<guid isPermaLink="false"><?php 
            the_guid();
            ?>
</guid>
<description></description>
<content:encoded><?php 
            echo wxr_cdata(apply_filters('the_content_export', $post->post_content));
            ?>
</content:encoded>
<excerpt:encoded><?php 
            echo wxr_cdata(apply_filters('the_excerpt_export', $post->post_excerpt));
            ?>
</excerpt:encoded>
<dsq:thread_identifier><?php 
            echo dsq_identifier_for_post($post);
            ?>
</dsq:thread_identifier>
<wp:post_id><?php 
            echo $post->ID;
            ?>
</wp:post_id>
<wp:post_date><?php 
            echo $post->post_date;
            ?>
</wp:post_date>
<wp:post_date_gmt><?php 
            echo $post->post_date_gmt;
            ?>
</wp:post_date_gmt>
<wp:comment_status><?php 
            echo $post->comment_status;
            ?>
</wp:comment_status>
<wp:ping_status><?php 
            echo $post->ping_status;
            ?>
</wp:ping_status>
<wp:post_name><?php 
            echo $post->post_name;
            ?>
</wp:post_name>
<wp:status><?php 
            echo $post->post_status;
            ?>
</wp:status>
<wp:post_parent><?php 
            echo $post->post_parent;
开发者ID:Three20,项目名称:Backend,代码行数:67,代码来源:export.php

示例5: dsq_comments_number

function dsq_comments_number($comment_text)
{
    global $post;
    if (dsq_can_replace()) {
        return '<span class="dsq-postid" rel="' . htmlspecialchars(dsq_identifier_for_post($post)) . '">View Comments</span>';
    } else {
        return $comment_text;
    }
}
开发者ID:humanmade,项目名称:vip-mu-plugins-public,代码行数:9,代码来源:disqus.php

示例6: wp_register_script

        'width' => '800',
        'height' => '700',
    );
}

if ( get_option('dsq_external_js') == '1' ) {
    wp_register_script( 'dsq_embed_script', plugins_url( '/media/js/disqus.js', __FILE__ ) );
    wp_localize_script( 'dsq_embed_script', 'embedVars', $embed_vars );
    wp_enqueue_script( 'dsq_embed_script', plugins_url( '/media/js/disqus.js', __FILE__ ) );
}
else {

?>
<script type="text/javascript">
var disqus_url = '<?php echo get_permalink(); ?>';
var disqus_identifier = '<?php echo dsq_identifier_for_post($post); ?>';
var disqus_container_id = 'disqus_thread';
var disqus_shortname = '<?php echo strtolower(get_option('disqus_forum_url')); ?>';
var disqus_title = <?php echo cf_json_encode( dsq_title_for_post($post) ); ?>;
var disqus_config_custom = window.disqus_config;
var disqus_config = function () {
    /*
    All currently supported events:
    onReady: fires when everything is ready,
    onNewComment: fires when a new comment is posted,
    onIdentify: fires when user is authenticated
    */
    
    <?php
    $sso = dsq_sso();
    if ($sso) {
开发者ID:pombredanne,项目名称:ArcherSys,代码行数:31,代码来源:comments.php

示例7: paginate_comments_links

		</ul>
		<?php 
paginate_comments_links();
?>
	</div>
</div>
		
<a href="http://disqus.com" class="dsq-brlink">blog comments powered by <span class="logo-disqus">Disqus</span></a>

<script type="text/javascript" charset="utf-8">
	var disqus_url = <?php 
echo wp_json_encode(get_permalink());
?>
;
	var disqus_identifier = <?php 
echo wp_json_encode(dsq_identifier_for_post($post));
?>
;
	var disqus_container_id = 'disqus_thread';
	var disqus_domain = <?php 
echo wp_json_encode(DISQUS_DOMAIN);
?>
;
	var disqus_shortname = <?php 
echo wp_json_encode(strtolower(get_option('disqus_forum_url')));
?>
;
	<?php 
if (false && get_option('disqus_developer')) {
    ?>
		var disqus_developer = 1;
开发者ID:humanmade,项目名称:vip-mu-plugins-public,代码行数:31,代码来源:comments.php

示例8: array

                </div>
            </div><!-- .navigation -->
<?php 
    }
    // check for comment navigation
    ?>

        </div>

    <?php 
}
?>
</div>

<?php 
global $wp_version;
$embed_vars = array('disqusConfig' => array('platform' => 'wordpress@' . $wp_version, 'language' => apply_filters('disqus_language_filter', '')), 'disqusIdentifier' => dsq_identifier_for_post($post), 'disqusShortname' => strtolower(get_option('disqus_forum_url')), 'disqusTitle' => dsq_title_for_post($post), 'disqusUrl' => get_permalink(), 'options' => array('manualSync' => get_option('disqus_manual_sync')), 'postId' => $post->ID);
// Add SSO vars if enabled
$sso = dsq_sso();
if ($sso) {
    global $current_site;
    foreach ($sso as $k => $v) {
        $embed_vars['disqusConfig'][$k] = $v;
    }
    $siteurl = site_url();
    $sitename = get_bloginfo('name');
    $embed_vars['disqusConfig']['sso'] = array('name' => wp_specialchars_decode($sitename, ENT_QUOTES), 'button' => get_option('disqus_sso_button'), 'url' => $siteurl . '/wp-login.php', 'logout' => $siteurl . '/wp-login.php?action=logout', 'width' => '800', 'height' => '700');
}
wp_register_script('dsq_embed_script', plugins_url('/media/js/disqus.js', __FILE__));
wp_localize_script('dsq_embed_script', 'embedVars', $embed_vars);
wp_enqueue_script('dsq_embed_script', plugins_url('/media/js/disqus.js', __FILE__));
开发者ID:RagnarDanneskjold,项目名称:goodbyeloans.com,代码行数:31,代码来源:comments.php

示例9: get_thread

 function get_thread($post)
 {
     $identifier = dsq_identifier_for_post($post);
     $response = $this->api->get_thread_posts(null, array('thread_identifier' => $identifier, 'filter' => 'approved'));
     return $response;
 }
开发者ID:humanmade,项目名称:vip-mu-plugins-public,代码行数:6,代码来源:wpapi.php


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