/** * Title * * Description * * @access public */ function say($ph, $level=0) { global $commandLine; global $voicemode; /* if ($commandLine) { echo utf2win($ph); } else { echo $ph; } */ $rec=array(); $rec['MESSAGE']=$ph; $rec['ADDED']=date('Y-m-d H:i:s'); $rec['ROOM_ID']=0; $rec['MEMBER_ID']=0; if ($level>0) { $rec['IMPORTANCE']=$level; } SQLInsert('shouts', $rec); if ($level>=(int)getGlobal('minMsgLevel')) { //$voicemode!='off' && $lang='en'; if (defined('SETTINGS_SITE_LANGUAGE')) { $lang=SETTINGS_SITE_LANGUAGE; } if (defined('SETTINGS_VOICE_LANGUAGE')) { $lang=SETTINGS_VOICE_LANGUAGE; } $google_file=GoogleTTS($ph, $lang); if ($google_file) { @touch($google_file); playSound($google_file, 1, $level); } else { //getObject("alice")->raiseEvent("say", array("say"=>$ph)); safe_exec('cscript '.DOC_ROOT.'/rc/sapi.js '.$ph, 1, $level); } } postToTwitter($ph); global $noPatternMode; if (!$noPatternMode) { include_once(DIR_MODULES.'patterns/patterns.class.php'); $pt=new patterns(); $pt->checkAllPatterns(); } }
function handleAddDetails($assassinationId) { require_once "twitter_login.php"; require_once "facebook_login.php"; $sql = "SELECT assassinationId,games.name as gameName,killer.alias as killerName,victim.alias as victimName, details \r\n\t\t\tFROM assassinations INNER JOIN games on assassinations.gameId = games.gameId\r\n\t\t\tINNER JOIN participations as killer ON assassinId = killer.playerId\r\n\t\t\tINNER JOIN participations as victim ON victimId = victim.playerId\r\n\t\t\tWHERE assassinationId='{$assassinationId}' AND killer.gameId = games.gameId AND victim.gameId = games.gameId LIMIT 1;"; $result = mysql_query($sql) or sql_error_report($sql, $_SERVER["SCRIPT_NAME"]); if ($row = mysql_fetch_assoc($result)) { $hash_tag = "#" . str_replace(" ", "", $row['gameName']); $kill_tag = $row['killerName'] . "->" . $row['victimName'] . ":"; $header = $hash_tag . " " . $kill_tag; $header = $hash_tag . " " . $kill_tag; $user_text = $header . " " . $row['details']; postToTwitter($user_text); postToFacebook($user_text); } }
/** * Title * * Description * * @access public */ function say($ph, $level = 0, $member_id = 0) { global $commandLine; global $voicemode; global $noPatternMode; global $ignorePushover; global $ignorePushbullet; global $ignoreGrowl; global $ignoreTwitter; /* if ($commandLine) { echo utf2win($ph); } else { echo $ph; } */ $rec = array(); $rec['MESSAGE'] = $ph; $rec['ADDED'] = date('Y-m-d H:i:s'); $rec['ROOM_ID'] = 0; $rec['MEMBER_ID'] = $member_id; if ($level > 0) { $rec['IMPORTANCE'] = $level; } $rec['ID'] = SQLInsert('shouts', $rec); if ($member_id) { //if (!$noPatternMode) { include_once DIR_MODULES . 'patterns/patterns.class.php'; $pt = new patterns(); $pt->checkAllPatterns($member_id); //} return; } if (defined('SETTINGS_HOOK_BEFORE_SAY') && SETTINGS_HOOK_BEFORE_SAY != '') { eval(SETTINGS_HOOK_BEFORE_SAY); } global $ignoreVoice; if ($level >= (int) getGlobal('minMsgLevel') && !$ignoreVoice && !$member_id) { //$voicemode!='off' && $lang = 'en'; if (defined('SETTINGS_SITE_LANGUAGE')) { $lang = SETTINGS_SITE_LANGUAGE; } if (defined('SETTINGS_VOICE_LANGUAGE')) { $lang = SETTINGS_VOICE_LANGUAGE; } if (!defined('SETTINGS_TTS_GOOGLE') || SETTINGS_TTS_GOOGLE) { $google_file = GoogleTTS($ph, $lang); } else { $google_file = false; } if (!defined('SETTINGS_SPEAK_SIGNAL') || SETTINGS_SPEAK_SIGNAL == '1') { $passed = time() - (int) getGlobal('lastSayTime'); if ($passed > 20) { // play intro-sound only if more than 20 seconds passed from the last one setGlobal('lastSayTime', time()); playSound('dingdong', 1, $level); } } if ($google_file) { @touch($google_file); playSound($google_file, 1, $level); } else { safe_exec('cscript ' . DOC_ROOT . '/rc/sapi.js ' . $ph, 1, $level); } } if (!$noPatternMode) { include_once DIR_MODULES . 'patterns/patterns.class.php'; $pt = new patterns(); $pt->checkAllPatterns($member_id); } if (defined('SETTINGS_PUSHOVER_USER_KEY') && SETTINGS_PUSHOVER_USER_KEY && !$ignorePushover) { include_once ROOT . 'lib/pushover/pushover.inc.php'; if (defined('SETTINGS_PUSHOVER_LEVEL')) { if ($level >= SETTINGS_PUSHOVER_LEVEL) { postToPushover($ph); } } elseif ($level > 0) { postToPushover($ph); } } if (defined('SETTINGS_PUSHBULLET_KEY') && SETTINGS_PUSHBULLET_KEY && !$ignorePushbullet) { include_once ROOT . 'lib/pushbullet/pushbullet.inc.php'; if (defined('SETTINGS_PUSHBULLET_PREFIX') && SETTINGS_PUSHBULLET_PREFIX) { $prefix = SETTINGS_PUSHBULLET_PREFIX . ' '; } else { $prefix = ''; } if (defined('SETTINGS_PUSHBULLET_LEVEL')) { if ($level >= SETTINGS_PUSHBULLET_LEVEL) { postToPushbullet($prefix . $ph); } } elseif ($level > 0) { postToPushbullet($prefix . $ph); } } if (defined('SETTINGS_GROWL_ENABLE') && SETTINGS_GROWL_ENABLE && $level >= SETTINGS_GROWL_LEVEL && !$ignoreGrowl) { include_once ROOT . 'lib/growl/growl.gntp.php'; $growl = new Growl(SETTINGS_GROWL_HOST, SETTINGS_GROWL_PASSWORD); $growl->setApplication('MajorDoMo', 'Notifications'); //$growl->registerApplication('http://localhost/img/logo.png'); $growl->notify($ph); } if (defined('SETTINGS_TWITTER_CKEY') && SETTINGS_TWITTER_CKEY && !$ignoreTwitter) { postToTwitter($ph); } if (defined('SETTINGS_HOOK_AFTER_SAY') && SETTINGS_HOOK_AFTER_SAY != '') { eval(SETTINGS_HOOK_AFTER_SAY); } }
function checkForAchievment($user) { //Only called on a kill $beginOfDay = strtotime("today"); $endOfDay = strtotime("tomorrow") - 1; $killsToday = DB::queryFirstField("SELECT COUNT(kill_id) FROM kills WHERE killer = %d AND eliminated != -1 AND date <= %d AND date > %d", $user['user_id'], $endOfDay, $beginOfDay); if ($killsToday > 1) { $xpEarned = xpForMultiKills($killsToday); $message = $user['name'] . ' earned ' . $xpEarned . ' XP for a #' . multiplierForNumber($killsToday) . 'Kill in the same day!'; $personalMessage = 'You earned ' . $xpEarned . ' XP for a ' . multiplierForNumber($killsToday) . ' Kill in the same day!'; DB::insert('xp', array('user_id' => $user['user_id'], 'value' => $xpEarned, 'date' => time())); log_text('SEND --> ' . $user['name'] . ': ' . $personalMessage); log_text('TWEET --> ' . $message); if (SYSTEM_STARTED) { singleSMS($user['phone'], $personalMessage); postToTwitter($message); } } }
// Get the url if was not passed $url = isset($url) ? $url : $e['url']; if (isset($_SESSION['loggedin']) && $_SESSION['loggedin'] == 1) { $admin = adminLinks($page, $url); } else { $admin = array('edit' => NULL, 'delete' => NULL); } $imagee = FormatImages($e['image'], $e['title']); if ($page == 'blog') { // Load the comment object include_once 'inc/comments.inc.php'; $comments = new Comments(); $comment_disp = $comments->showComments($e['id']); $comments_form = $comments->showCommentForm($e['id']); //Generate a post to twitter link; $twitter = postToTwitter($e['title']); } else { $comments_form = NULL; $twitter = NULL; } ?> <h2> <?php echo $e['title']; ?> </h2> <p> <?php echo $e['entry']; ?> </p> <p> <?php
/** * Title * * Description * * @access public */ function say($ph, $level = 0) { global $commandLine; global $voicemode; /* if ($commandLine) { echo utf2win($ph); } else { echo $ph; } */ $rec = array(); $rec['MESSAGE'] = $ph; $rec['ADDED'] = date('Y-m-d H:i:s'); $rec['ROOM_ID'] = 0; $rec['MEMBER_ID'] = 0; if ($level > 0) { $rec['IMPORTANCE'] = $level; } $rec['ID'] = SQLInsert('shouts', $rec); if (defined('SETTINGS_HOOK_BEFORE_SAY') && SETTINGS_HOOK_BEFORE_SAY != '') { eval(SETTINGS_HOOK_BEFORE_SAY); } if ($level >= (int) getGlobal('minMsgLevel')) { //$voicemode!='off' && $lang = 'en'; if (defined('SETTINGS_SITE_LANGUAGE')) { $lang = SETTINGS_SITE_LANGUAGE; } if (defined('SETTINGS_VOICE_LANGUAGE')) { $lang = SETTINGS_VOICE_LANGUAGE; } if (!defined('SETTINGS_TTS_GOOGLE') || SETTINGS_TTS_GOOGLE) { $google_file = GoogleTTS($ph, $lang); } else { $google_file = false; } if (!defined('SETTINGS_SPEAK_SIGNAL') || SETTINGS_SPEAK_SIGNAL == '1') { $passed = SQLSelectOne("SELECT (UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(ADDED)) as PASSED FROM shouts WHERE ID!='" . $rec['ID'] . "' ORDER BY ID DESC LIMIT 1"); if ($passed['PASSED'] > 20) { // play intro-sound only if more than 30 seconds passed from the last one playSound('dingdong', 1, $level); } } if ($google_file) { @touch($google_file); playSound($google_file, 1, $level); } else { safe_exec('cscript ' . DOC_ROOT . '/rc/sapi.js ' . $ph, 1, $level); } } global $noPatternMode; if (!$noPatternMode) { include_once DIR_MODULES . 'patterns/patterns.class.php'; $pt = new patterns(); $pt->checkAllPatterns(); } if (defined('SETTINGS_HOOK_AFTER_SAY') && SETTINGS_HOOK_AFTER_SAY != '') { eval(SETTINGS_HOOK_AFTER_SAY); } if (defined('SETTINGS_PUSHOVER_USER_KEY') && SETTINGS_PUSHOVER_USER_KEY) { include_once ROOT . 'lib/pushover/pushover.inc.php'; if (defined('SETTINGS_PUSHOVER_LEVEL')) { if ($level >= SETTINGS_PUSHOVER_LEVEL) { postToPushover($ph); } } elseif ($level > 0) { postToPushover($ph); } } if (defined('SETTINGS_GROWL_ENABLE') && SETTINGS_GROWL_ENABLE && $level >= SETTINGS_GROWL_LEVEL) { include_once ROOT . 'lib/growl/growl.gntp.php'; $growl = new Growl(SETTINGS_GROWL_HOST, SETTINGS_GROWL_PASSWORD); $growl->setApplication('MajorDoMo', 'Notifications'); //$growl->registerApplication('http://localhost/img/logo.png'); $growl->notify($ph); } postToTwitter($ph); }
if ($_POST['twitter_update_acc3'] == "yes" && !$HTTP_POST_FILES['media']['tmp_name']) { /* ---------------------------------------- */ // Trozo para postear a Twitter cuenta 3 /* ---------------------------------------- */ $twitter_username3 = $_POST['twitter_username3']; $twitter_psw3 = decode($_POST['twitter_psw3']); /* ---------------------------------------- */ /* Don't change the code belove /* ---------------------------------------- */ //require('./inc/twitterAPI.php'); if (isset($_POST['status'])) { $twitter_message = mysql_escape_string(strip_tags($_POST['status'])); if (strlen($twitter_message) < 1) { $error = 1; } else { $twitter_status = postToTwitter($twitter_username3, $twitter_psw3, $twitter_message); } } /* ---------------------------------------- */ } elseif ($_POST['twitter_update_acc3'] == "yes" && $HTTP_POST_FILES['media']['tmp_name']) { /* ---------------------------------------- */ // Trozo para postear a Twitpic cuenta 3 de twitter /* ---------------------------------------- */ $twitter_username3 = $_POST['twitter_username3']; $twitter_psw3 = decode($_POST['twitter_psw3']); move_uploaded_file($HTTP_POST_FILES['media']['tmp_name'], "./temp/temp3.jpg"); $uploadfile = "./temp/temp3.jpg"; $ch = curl_init("http://twitpic.com/api/uploadAndPost"); curl_setopt($ch, CURLOPT_POSTFIELDS, array('username' => $twitter_username3, 'password' => $twitter_psw3, 'message' => mysql_escape_string(strip_tags($_POST['status'])), 'media' => "@{$uploadfile}")); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $postResult = curl_exec($ch);
//El usuario ya ha votado, solo comentar. if ($username == '') { $username = "******"; } $voto = 3; $puntu = 0; $timee = time(); $titulo = $_POST['titulo']; $comentario = $_POST['comentario']; $comentario = str_replace(chr(13), "<br>", $comentario); mysql_query("INSERT INTO `comments` (`id` ,`local_id` ,`titulo` ,`comentario` ,`username` ,`timestamp` ,`voto`,`puntuacion`,`ip`)VALUES ('', '{$id}', '{$titulo}', '{$comentario}', '{$username}', '{$timee}', '{$voto}' , '{$puntu}' , '{$ip}');"); printf("<script>document.location.href='sitio/" . $titulo_f . "'</script>;"); // } include "twitter.php"; postToTwitter("quecompuntoes", "rebrok2000", $username . " ha comentado el sitio: http://quecom.es/sitio/" . $titulo_f . ""); } // if ($city) { $get_prov = mysql_query("SELECT provincia FROM localidades WHERE localidad = '{$city}' LIMIT 1"); $get_prova = mysql_fetch_array($get_prov); $provincia = $get_prova['provincia']; } ?> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <?php include "new_header.php"; ?> </tr> <tr>