コード例 #1
0
ファイル: theme-functions.php プロジェクト: t0t/avmigjorn
function woo_social()
{
    ?>
<a href="http://twitter.com/home/?status=<?php 
    the_title();
    ?>
 : <?php 
    echo get_tiny_url(get_permalink($post->ID));
    ?>
"><img src="<?php 
    bloginfo('template_directory');
    ?>
/images/ico-social-twitter.png" alt="Twitter" /></a>
<a href="http://www.facebook.com/sharer.php?u=<?php 
    the_permalink();
    ?>
&amp;t=<?php 
    the_title();
    ?>
"><img src="<?php 
    bloginfo('template_directory');
    ?>
/images/ico-social-facebook.png" alt="Facebook" /></a>
<?php 
}
コード例 #2
0
ファイル: index.php プロジェクト: orbitroom/Shib-D-Scan-Tool
		<?php 
$actualurl = "http://{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}";
//gets the data from a URL
function get_tiny_url($url)
{
    $ch = curl_init();
    $timeout = 5;
    curl_setopt($ch, CURLOPT_URL, 'http://tinyurl.com/api-create.php?url=' . $url);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
    $data = curl_exec($ch);
    curl_close($ch);
    return $data;
}
//test it out!
$new_url = get_tiny_url($actualurl);
//returns http://tinyurl.com/65gqpp
echo "   <button type='button' class='list-group-item'><a href='{$new_url}'>Copy the TinyUrl For This Scan</a></button>";
?>
	   </div>
		<div class="span4" color="#333333">
          <h2 align="center">Ships</h2>
            <div class="row">
                <table class="table span4 table-striped well">
                
                <?php 
foreach ($ship_names as $ship_name => $count) {
    echo '<tr><td class="span4"><b>' . $ship_name . '</b></td><td><span class="badge ' . get_badge_class($count, $ship_total) . '">' . $count . '</span></td></tr>';
}
?>
               
コード例 #3
0
ファイル: nppcreator.php プロジェクト: balamalireddi/npp
    $dir = $_SERVER['SERVER_NAME'];
    for ($i = 0; $i < count($parts) - 1; $i++) {
        $dir .= $parts[$i] . "/";
    }
    return $dir;
}
//$localURL = 'http://localhost/dpnc-v0.903/pf/'.$pageName.'.html';
$dynaUrl = getCurrDirectory() . 'pf/' . $pageName . '.html';
//echo $dynaUrl.'<br>';
//gets the data from a URL
function get_tiny_url($url)
{
    $ch = curl_init();
    $timeout = 5;
    curl_setopt($ch, CURLOPT_URL, 'http://tinyurl.com/api-create.php?url=' . $url);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
    $data = curl_exec($ch);
    curl_close($ch);
    return $data;
}
//echo $new_url.'<br>';
//echo $dynaUrl.'<br>';
//session Handling
$_SESSION['tinyURL'] = get_tiny_url($dynaUrl);
$_SESSION['directURL'] = $dynaUrl;
//echo $_SESSION['tinyURL'].'<br>';
//echo $_SESSION['directURL'].'<br>';
header("Location:done.php");
/* Redirect browser */
exit;
コード例 #4
0
ファイル: function.php プロジェクト: jcmwc/fleet
function tweet($consumerKey, $consumerSecret, $accesstoken, $accesstokensecret, $message, $url)
{
    $message = stripslashes(urldecode($message)) . " " . get_tiny_url($url);
    //$consumerKey    = '<insert your consumer key';
    //$consumerSecret = '<insert your consumer secret>';
    //$oAuthToken     = '<insert your access token>';
    //$oAuthSecret    = '<insert your token secret>';
    require_once $_SERVER["DOCUMENT_ROOT"] . __racineadminlib__ . '/twitteroauth/twitteroauth/twitteroauth.php';
    // twitteroauth.php points to OAuth.php
    // all files are in the same dir
    // create a new instance
    $tweet = new TwitterOAuth($consumerKey, $consumerSecret, $accesstoken, $accesstokensecret);
    // post to twitter
    //include 'tweet.php';  // the file where the tweet instance is created
    //$statusMessage = 'Movie added: '.$title. ' -> ' . $message;
    //print $message."<br>";
    $content = $tweet->get('account/verify_credentials');
    //print "icijc";
    //$tweet->post('statuses/update', array('status' => $message));
    $tweet->post('statuses/update', array('status' => $message));
}
コード例 #5
0
ファイル: theme-functions.php プロジェクト: juslee/e27
function woo_social()
{
    ?>
<a href="http://twitter.com/home/?status=<?php 
    the_title();
    ?>
 : <?php 
    echo get_tiny_url(get_permalink($post->ID));
    ?>
"><img src="<?php 
    bloginfo('template_directory');
    ?>
/images/ico-social-twitter.png" alt="Twitter" /></a>
<a href="http://digg.com/submit?phase=2&amp;url=<?php 
    the_permalink();
    ?>
"><img src="<?php 
    bloginfo('template_directory');
    ?>
/images/ico-social-digg.png" alt="Digg" /></a>                            
<a href="http://del.icio.us/post?url=<?php 
    the_permalink();
    ?>
&amp;title=<?php 
    the_title();
    ?>
"><img src="<?php 
    bloginfo('template_directory');
    ?>
/images/ico-social-delicious.png" alt="Delicious" /></a>                            
<a href="http://www.stumbleupon.com/submit?url=<?php 
    the_permalink();
    ?>
&amp;title=<?php 
    echo urlencode(the_title('', '', false));
    ?>
"><img src="<?php 
    bloginfo('template_directory');
    ?>
/images/ico-social-stumbleupon.png" alt="Stumbleupon" /></a>                            
<a href="http://technorati.com/cosmos/search.html?url=<?php 
    the_permalink();
    ?>
"><img src="<?php 
    bloginfo('template_directory');
    ?>
/images/ico-social-technorati.png" alt="Technorati" /></a>                            
<a href="http://www.facebook.com/sharer.php?u=<?php 
    the_permalink();
    ?>
&amp;t=<?php 
    the_title();
    ?>
"><img src="<?php 
    bloginfo('template_directory');
    ?>
/images/ico-social-facebook.png" alt="Facebook" /></a>
<a href="mailto:EMAIL ADDRESS?body=<?php 
    the_permalink();
    ?>
"><img src="<?php 
    bloginfo('template_directory');
    ?>
/images/ico-social-mail.png" alt="Email" /></a>                           
<?php 
}
コード例 #6
0
        </form>
        <?php 
}
?>
        
        <?php 
if (get_option('swift_socialmedia_enable') == "true") {
    ?>
       
        	<div id="socialmedia">
        	
            <a href="http://twitter.com/home/?status=<?php 
    the_title();
    ?>
 : <?php 
    echo get_tiny_url(get_permalink($post->ID));
    ?>
" title="Tweet this!"><img src="<?php 
    bloginfo('template_url');
    ?>
/images/icons/twitter.png" alt="Tweet this!" /></a>
 
 			<a href="http://digg.com/submit?phase=2&amp;amp;url=<?php 
    the_permalink();
    ?>
&amp;amp;title=<?php 
    the_title();
    ?>
" title="Digg this!"><img src="<?php 
    bloginfo('template_url');
    ?>
コード例 #7
0
ファイル: default.php プロジェクト: bizanto/Hooked
     $df2 = OutputField($flexi_fields_css, $flexifield2, $ft2);
 }
 if ($checkf3 !== false) {
     $df3 = OutputField($flexi_fields_css, $flexifield3, $ft3);
 }
 if ($checkf4 !== false) {
     $df4 = OutputField($flexi_fields_css, $flexifield4, $ft4);
 }
 if ($checkf5 !== false) {
     $df5 = OutputField($flexi_fields_css, $flexifield5, $ft5);
 }
 if ($checkf6 !== false) {
     $df6 = OutputField($flexi_fields_css, $flexifield6, $ft6);
 }
 $sharefb = '<a name="fb_share" type="button" href="http://www.facebook.com/sharer.php?u=' . $link . '&t=' . $row->title . '">' . $fbshare . '</a><script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></script>';
 $turl = get_tiny_url($link);
 $tweetthis = '<a target="_blank" href="http://twitter.com/home?status=' . $titolo . ' (' . $turl . ')"><img src="modules/mod_aidanews/twitter.gif"/></a>';
 //No default image
 if ($params->get('hide_default_image') && $image == $image_default) {
     $dimage = "";
 }
 $patterns = array('/\\[title\\]/', '/\\[date\\]/', '/\\[author\\]/', '/\\[category\\]/', '/\\[comments\\]/', '/\\[hits\\]/', '/\\[rating\\]/', '/\\[readmore\\]/', '/\\[image\\]/', '/\\[clear\\]/', '/\\[empty\\]/', '/\\[addcomments\\]/', '/\\[flexif1\\]/', '/\\[flexif2\\]/', '/\\[flexif3\\]/', '/\\[flexif4\\]/', '/\\[flexif5\\]/', '/\\[flexif6\\]/', '/\\[fb\\]/', '/\\[tweet\\]/', '/\\[id\\]/');
 $replace = array($dtitle, $ddate, $dauthor, $dcat, $dcomm, $dhits, $drating, $drm, $dimage, $dclear, $dempty, $daddcomm, $df1, $df2, $df3, $df4, $df5, $df6, $sharefb, $tweetthis, $row->id);
 if ($top1) {
     if ($divcheck == 0) {
         $top1 = '<div> ' . $top1 . ' </div>';
     }
     echo preg_replace($patterns, $replace, $top1);
 }
 if ($top2) {
     if ($divcheck == 0) {
コード例 #8
0
ファイル: articleService.php プロジェクト: wahabali/wordbro
<?php

header("Access-Control-Allow-Origin: *");
header("Content-Type: application/json; charset=UTF-8");
include_once 'commons.php';
include_once 'db.php';
include_once 'log.php';
if ($_SERVER["REQUEST_METHOD"] == "GET") {
    return getArticles();
} elseif ($_SERVER["REQUEST_METHOD"] == "POST") {
    $json = file_get_contents('php://input');
    $data = json_decode($json, true);
    var_dump($data);
    $tinyurl = "";
    if (!empty($data["link"])) {
        get_tiny_url($data["link"]);
    }
    return insertArticle($data["title"], $data["body"], $tinyurl);
} elseif ($_SERVER["REQUEST_METHOD"] == "DELETE") {
    $json = file_get_contents('php://input');
    $data = json_decode($json, true);
    $articleID = $data["articleId"];
    if (empty($articleID)) {
        return;
    }
    deleteArticle($articleID);
    log_info("Delete Article: " . $articleID);
} else {
    error("unknown verb");
}
//Functions