function full_twitter_stream($att, $content = null){
  global $apiKey, $apiSec, $apiTok, $apiTokSec,  $username , $userID, $hash , $json, $looping;
  require_once "twitter/index.php";
  try{
  	checkStream($json);
		$tweetcontent = "";
		$hlink = "";
		$striphash = array();
		$findLink = array();
		$content = '<div id="twitterStream">';
  	$content .= '<a href="http://twitter.com/'.$username.'" target="_blank"><h1>@'.$username.'</h1></a>';
		
		//foreach($json as $data){
  	for($i = 0 ; $i < $looping; $i++){

    	$datesplit = explode(" ", $json[$i]->created_at);
			$date = $datesplit[1]."<br>".$datesplit[2];
    	$url = "http://twitter.com/".$username."/status/".$json[$i]->id_str;
    	
    	if($json[$i]->entities->hashtags){
    			$tweetcontent= linkHash($json[$i]->text);
    	}
    	else{
    		$arr = array();
    		$arr = explode(" ", $json[$i]->text);
    		$jh = urlFind($arr);
        $tweetcontent = hashTag($jh);
    	}

    	$content .= 
    		'<div class="tweet">
    			<div class="col one">
    				<div class="date">'
    				.	$date.
    				'</div>
    			</div>
    			<div class="col two">
    				<div class="content">'
        				.$tweetcontent.
      				'</div>
      				<div class="url">
      					<div class="line"></div>
      					<a href="'.$url.'" target="_blank">
      						See Tweet
      					</a>
      				</div>
    			</div>
    		</div>'
    	;
  	}  
  
  	$content .= '</div>';
    
  	$output = "";
  	$output .= $content;
  	return $output;
  }
  catch(Exception $e){
		return "Opps Looks like Twitter is having issues.<br> " .$e->getMessage();
	}

}
示例#2
0
文件: config.php 项目: webhacking/los
    $db = mysql_connect($mysql_hostname, $mysql_user, $mysql_password) or die("db connection error");
    mysql_select_db($mysql_database, $db) or die("db connection error2");
    mysql_query("set names utf8", $db);
}
function login_chk()
{
    SESSION_START();
    $id = $_SESSION['los_id'];
    if (!$id) {
        exit("<script>location.href='./';</script>");
    }
}
$monster_list = array("gate", "gremlin", "cobolt", "goblin", "orc", "wolfman", "darkelf", "orge", "troll", "vampire", "skeleton", "golem", "darkknight", "bugbear", "giant", "assassin", "zombie_assassin", "succubus", "nightmare", "xavis", "dragon", "iron_golem", "dark_eyes", "hell_fire", "evil_wizard", "umaru", "AllClear");
$monster_link = array("gate.php");
for ($monster_i = 1; $monster_i <= count($monster_list); $monster_i++) {
    $monster_link[$monster_i] = $monster_list[$monster_i] . "_" . linkHash($monster_list[$monster_i]) . ".php";
}
function solve($monster_name)
{
    global $monster_list;
    for ($i = 1; $i < count($monster_list) + 1; $i++) {
        if ($monster_list[$i] == $monster_name) {
            $solved = $i;
        }
    }
    $q = "select level from user_db where id='{$_SESSION[los_id]}'";
    $result = @mysql_fetch_array(mysql_query($q));
    $now_level = $result['level'];
    if ($now_level == $solved) {
        $query = "update user_db set lastauth=now(),level=(level+1) where id='{$_SESSION[los_id]}'";
        mysql_query($query);