Пример #1
0
<?php

// type of help content to fetch (in query string)
$typ = $wp_query->query_vars['typ'];
switch ($typ) {
    case 'thing':
        // it's an assignment/thing
        $help_title = 'How to Submit ' . get_the_article(THINGNAME) . THINGNAME;
        break;
    case 'tut':
        // it's for submitting a tutorial/resource
        $help_title = 'How to Submit ' . get_the_article(ds106bank_option('helpthingname')) . ds106bank_option('helpthingname') . ' for ' . get_the_article(THINGNAME) . THINGNAME;
        break;
    default:
        // default assume it's a response
        $help_title = 'How to Submit a Response to ' . get_the_article(THINGNAME) . THINGNAME;
        $typ = 'response';
}
?>

<?php 
get_header();
?>
			
			<div id="content" class="clearfix row">
			
				<div id="main" class="col-sm-8 clearfix" role="main">

					<?php 
if (have_posts()) {
    while (have_posts()) {
Пример #2
0
function bank106_twitter_button($postid, $mytype)
{
    // display a tweet this button for a challenge or locally published responses
    // doth there be a twitter acct to credit?
    $mention = get_post_meta($postid, 'submitter_twitter', 1);
    // make it proper (or not visible)
    $mention_str = $mention ? ' by ' . $mention : '';
    $urltotweet = get_site_url() . '/?p=' . $postid;
    $tweet_text = get_the_title($postid) . '- ' . get_the_article($mytype) . lcfirst($mytype) . $mention_str;
    echo '<a href="https://twitter.com/share" class="twitter-share-button" data-url="' . $urltotweet . '" data-text="' . $tweet_text . '" data-hashtags="' . ds106bank_option('hashtag') . '" data-dnt="true">Tweet</a>' . "<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>";
}