Example #1
1
function must_be_authorized()
{
    global $base_url;
    if (!online()) {
        header("Location: {$base_url}", true, 302);
        print "Location: {$base_url}";
        return false;
    }
}
function install_tor()
{
    # TODO: probably a better way to update, install, and check installed
    # TODO: force installed to external SD card?
    # Check to see if tor is installed first (don't waste our time otherwise)
    if (is_tor_installed()) {
        echo 'Tor is already installed!';
        return false;
    }
    # Check to see if we are online to update and download tor
    if (online()) {
        exec('opkg update') && exec('opkg install tor');
        exec('cp /etc/tor/torrc /etc/tor/torrc.bak_' . time());
        exec('cp ' . $directory . '/torrc.pineapple /etc/tor/torrc');
        exec('/etc/init.d/tor stop');
        echo 'Tor has been installed';
        return true;
    } else {
        echo "You must be online to install tor";
        return false;
    }
}
Example #3
0
function order_vols($vols)
{
    $online = array();
    $offline = array();
    foreach ($vols as $vol) {
        if (online($vol->status)) {
            $online[] = $vol;
        } else {
            $offline[] = $vol;
        }
    }
    shuffle($online);
    return array_merge($online, $offline);
}
Example #4
0
    } else {
        return true;
    }
}
function online($server, $port)
{
    $socket = fsockopen($server, $port, $errno, $errstr, 1);
    if (!$socket) {
        return false;
    } else {
        return true;
    }
}
if ($_GET['ajaxsync'] == "get-shoutcast-update" && readCache($cacheTime, $cacheOn)) {
    $masterServerData = explode(":", $masterServer);
    if ($masterServer && online($masterServerData[0], trim($masterServerData[1]))) {
        $masterServerData = explode(",", getSCData($masterServerData[0], trim($masterServerData[1])));
        $shoutCast["listeners"] = $masterServerData[0];
        if (trim($masterServerData[1]) == 1) {
            $shoutCast["status"] = $onAirStatus;
        } else {
            $shoutCast["status"] = $offAirStatus;
        }
        $shoutCast["peaklisteners"] = (int) trim($masterServerData[2]);
        $shoutCast["maxlisteners"] = (int) trim($masterServerData[3]);
        $shoutCast["uniquelisteners"] = (int) trim($masterServerData[4]);
        $shoutCast["bitrate"] = (int) trim($masterServerData[5]);
        for ($i = 6; $i < count($masterServerData); $i++) {
            $shoutCast["song"] .= $masterServerData[$i] . '';
        }
        $shoutCast["serverscount"] = 1;
Example #5
0
<?php 
    //Not done yet with class display!
    $things = array('0' => 'Human Fighter', '1' => 'Warrior', '2' => 'Gladiator', '3' => 'Warlord', '4' => 'Human Knight', '5' => 'Paladin', '6' => 'Dark Avenger', '7' => 'Rogue', '8' => 'Treasure Hunter', '9' => 'Hawkeye', '10' => 'Human Mystic', '11' => 'Human Wizard', '12' => 'Sorcerer', '13' => 'Necromancer', '14' => 'Warlock', '15' => 'Cleric', '16' => 'Bishop', '17' => 'Prophet', '18' => 'Elven Fighter', '19' => 'Elven Knight', '20' => 'Temple Knight', '21' => 'Sword Singer', '22' => 'Elven Scout', '23' => 'Plains Walker', '24' => 'Silver Ranger', '25' => 'Elven Mystic', '26' => 'Elven Wizard', '27' => 'Spellsinger', '28' => 'Elemental Summoner', '29' => 'Elven Oracle', '30' => 'Elven Elder', '31' => 'Dark Fighter', '32' => 'Palus Knight', '33' => 'Shillien Knight', '34' => 'Bladedancer', '35' => 'Assassin', '36' => 'Abyss Walker', '37' => 'Phantom Ranger', '38' => 'Dark Mystic', '39' => 'Dark Wizard', '40' => 'Spellhowler', '41' => 'Phantom Summoner', '42' => 'Shillien Oracle', '43' => 'Shillien Elder', '44' => 'Orc Fighter', '45' => 'Orc Raider', '46' => 'Destroyer', '47' => 'Monk', '48' => 'Tyrant', '49' => 'Orc Mystic', '50' => 'Orc Shaman', '51' => 'Overlord', '52' => 'Warcryer', '53' => 'Dwarf Fighter', '54' => 'Scavenger', '55' => 'Bounty Hunter', '56' => 'Artisan', '57' => 'Warsmith', '88' => 'Duelist', '89' => 'Dreadnought', '90' => 'Phoenix Knight', '91' => 'Hell Knight', '92' => 'Sagittarius', '93' => 'Adventurer', '94' => 'Archmage', '95' => 'Soultaker', '96' => 'Arcana Lord', '97' => 'Cardinal', '98' => 'Hierophant', '99' => 'Evas Templar', '100' => 'Sword Muse', '101' => 'Wind Rider', '102' => 'Moonlight Sentinel', '103' => 'Mystic Muse', '104' => 'Elemental Master', '105' => 'Evas Saint', '106' => 'Shillien Templar', '107' => 'Spectral Dancer', '108' => 'Ghost Hunter', '109' => 'Ghost Sentinel', '110' => 'Storm Screamer', '111' => 'Spectral Master', '112' => 'Shillien Saint', '113' => 'Titan', '114' => 'Grand Khavatari', '115' => 'Dominator', '116' => 'Doom Cryer', '117' => 'Fortune Seeker', '118' => 'Maestro', '119' => 'World Trap', '120' => 'Player Trap', '121' => 'Double Ghost', '122' => 'Siege Attacker', '123' => 'Male Kamael Soldier', '124' => 'Female Kamael Soldier', '125' => 'Trooper', '126' => 'Warder', '127' => 'Berserker', '128' => 'Male Soul Breaker', '129' => 'Female Soul Breaker', '130' => 'Arbalester', '131' => 'Doombringer', '132' => 'Male Soul Hound', '133' => 'Female Soul Hound', '134' => 'Trickster', '135' => 'Inspector', '136' => 'Judicator', '139' => 'Sigel Knight', '140' => 'Tyrr Warrior', '141' => 'Othell Rogue', '142' => 'Yul Archer', '143' => 'Feoh Wizard', '144' => 'Iss Enchanter', '145' => 'Wynn Summoner', '146' => 'Aeore Healer', '148' => 'Sigel Phoenix Knight', '149' => 'Sigel Hell Knight', '150' => 'Sigel Evas Templar', '151' => 'Sigel Shillien Templar', '152' => 'Tyrr Duelist', '153' => 'Tyrr Dreadnought', '154' => 'Tyrr Titan', '155' => 'Tyrr Grand Khavatari', '156' => 'Tyrr Maestro', '157' => 'Tyrr Doombringer', '158' => 'Othell Adventurer', '159' => 'Othell Wind Rider', '160' => 'Othell Ghost Hunter', '161' => 'Othell Fortune Seeker', '162' => 'Yul Sagittarius', '163' => 'Yul Moonlight Sentinel', '164' => 'Yul Ghost Sentinel', '165' => 'Yul Trickster', '166' => 'Feoh Archmage', '167' => 'Feoh Soultaker', '168' => 'Feoh Mystic Muse', '169' => 'Feoh Storm Screamer', '170' => 'Feoh Soulhounds', '171' => 'Iss Hierophant', '172' => 'Iss Sword Muse', '173' => 'Iss Spectral Dancer', '174' => 'Iss Dominator', '175' => 'Iss Doomcryer', '176' => 'Wynn Arcana Lord', '177' => 'Wynn Elemental Master', '178' => 'Wynn Spectral Master', '179' => 'Aeore Cardinal', '180' => 'Aeore Evas Saint', '181' => 'Aeore Shillien Saint', '182' => 'Etheria Fighter', '183' => 'Etheria Wizard', '184' => 'Marauder', '185' => 'Cloud Breaker', '186' => 'Ripper', '187' => 'Stratomancer', '188' => 'Eviscerator', '189' => 'Sayhas Seer');
    function online($str)
    {
        $div = time() - (time() - $str);
        $div1 = $div % 86400;
        $div2 = $div % 3600;
        $dias = floor($div / 86400);
        $horas = floor($div1 / 3600);
        $minutos = floor($div2 / 60);
        return $retotno = "{$dias} Day's {$horas} Hour's {$minutos} Minutes";
    }
    $PegaPersonagens = $conexao->prepare("SELECT *,(SELECT clan_name FROM clan_data WHERE characters.clanid = clan_id) AS clan FROM characters WHERE account_name = ?");
    $PegaPersonagens->execute(array($res_user['login']));
    if ($PegaPersonagens->rowCount() <= 0) {
        echo "<div id=\"no\">You don't have characters yet!</div>";
    }
    $a = $PegaPersonagens->fetchAll(PDO::FETCH_ASSOC);
    foreach ($a as $res) {
        $res['clan'] = empty($res['clan']) ? 'No clan' : $res['clan'];
        $res['online'] = $res['online'] == 1 ? 'Yes' : 'No';
        $res['nobless'] = $res['nobless'] == 1 ? 'Yes' : 'No';
        echo "\r\n\t\t\t<span class='admin'><span class='username'>Profile:</span> {$res['account_name']}</span>\r\n\t\t\t<table class='ranking'>\r\n\t\t\t\t<tr>\r\n\t\t\t\t\t<tr><td>Characters in the account:</td><td> {$res['char_name']}</td></tr>\r\n\t\t\t\t\t<tr><td>Level:</td><td> {$res['level']}</td></tr>\r\n\t\t\t\t\t<tr><td>Class:</td><td>" . $things[$res['classid']] . "</td></tr>\r\n\t\t\t\t\t<tr><td>Clan:</td><td> {$res['clan']}</td></tr>\r\n\t\t\t\t\t<tr><td>PvPs:</td><td> {$res['pvpkills']}</td></tr>\r\n\t\t\t\t\t<tr><td>Pks:</td><td> {$res['pkkills']}</td></tr>\r\n\t\t\t\t\t<tr><td>Title:</td><td> {$res['title']}</td></tr>\r\n\t\t\t\t\t<tr><td>Reputation:</td><td> {$res['reputation']}</td></tr>\r\n\t\t\t\t\t<tr><td>Online:</td><td> {$res['online']}</td></tr>\r\n\t\t\t\t\t<tr><td>Online time:</td><td> " . online($res['onlinetime']) . "</td></tr>\r\n\t\t\t\t\t<tr><td>Nobless:</td><td> {$res['nobless']}</td></tr>\r\n\t\t\t\t</tr>\r\n\t\t\t</table>";
    }
    ?>
	

<?php 
}
Example #6
0
}
function avg()
{
    $file_count = fopen('count.txt', 'rb');
    $data = '';
    while (!feof($file_count)) {
        $data .= fread($file_count, 4096);
    }
    fclose($file_count);
    @(list($today, $yesterday, $total, $date, $days) = split("%", $data));
    echo ceil($total / $days);
}
?>
			
						Đang online: <?php 
echo online();
?>
 <br>
						Truy cập hôm nay: <?php 
echo today();
?>
 <br>
						Truy cập hôm qua: <?php 
echo yesterday();
?>
 <br>
						Tổng số truy cập: <?php 
total();
?>
 <br>
						Truy cập trung bình: <?php 
        echo "  <div class='panel panel-default'>\n    <div class='panel-heading'>\n      <h4 class='panel-title'>\n      <a class='accordion-toggle' data-toggle='collapse' data-parent='#accordion' href='#forsale{$parcelUUID}'>\n<B>{$parcelname}</B>\n      </a>\n\t</h4>\n    </div>\n    <div id='forsale{$parcelUUID}' class='accordion-body collapse'>\n      <div class='panel-body'>\n<p>\n<B>Area:</B> {$area}<br>\n<B>Price:</B> V\$ {$saleprice}<br>\n<B>Region:</B> {$regionname}<br>\n<a href=''>Teleport</a>\n</p>\n      </div>\n    </div>\n  </div>\n";
    }
    $forsaleq->free();
}
if ($type == "people" || !$type) {
    $pplq = $mysqli->query("SELECT * FROM {$osmain}.useraccounts WHERE FirstName LIKE '%{$search}%' OR LastName LIKE '%{$search}%' ORDER BY `Created` ASC LIMIT 0,100");
    while ($pplnum = $pplq->fetch_array(MYSQLI_BOTH)) {
        $uuid = $pplnum['PrincipalID'];
        $sFirst = $pplnum['FirstName'];
        $sLast = $pplnum['LastName'];
        if ($sLast == "Resident") {
            $profname = $sFirst;
        } else {
            $profname = $sFirst . "." . $sLast;
        }
        $online = online($uuid);
        if ($online == "False") {
            $onoff = "offlinedot.png";
        } else {
            if ($online == "True") {
                $onoff = "onlinedot.png";
            }
        }
        $profq = $mysqli->query("SELECT * FROM {$osmod}.userprofile WHERE useruuid = '{$uuid}' AND profileMaturePublish < '{$m}'");
        $prow = $profq->fetch_array(MYSQLI_BOTH);
        $show = $prow['profileAllowPublish'];
        if ($show == "0") {
            $MaturePublish = $prow['profileMaturePublish'];
            $abouttext = $prow['profileAboutText'];
            $fakepic = $prow['profileImage'];
            $profq->free();
Example #8
0
echo im_qq($qq);
echo im_ali($ali);
echo im_msn($msn);
echo im_skype($skype);
?>
</td>
<td class="tl">会员名</td>
<td>&nbsp;<a href="<?php 
echo $linkurl;
?>
" target="_blank"><?php 
echo $username;
?>
</a>
[<?php 
$ol = online($userid);
if ($ol == 1) {
    ?>
<span class="f_red">在线</span><?php 
} else {
    if ($ol == -1) {
        ?>
<span class="f_blue">隐身</span><?php 
    } else {
        ?>
<span class="f_gray">离线</span><?php 
    }
}
?>
]
</td>
Example #9
0
            break;
            break;
        case 'online_users':
            $out = online_users(session::USER_REGULAR);
            break;
        default:
            setStatus($out, 'fail', 'invalid type.');
            break;
    }
} else {
    //get request
    if (isset($_GET['query'])) {
        $type = $_GET['query'];
        switch ($type) {
            case 'online':
                $out = online();
                break;
            case 'online_doctors':
                $out = online_users(session::USER_DOCTOR);
                break;
            case 'online_users':
                $out = online_users(session::USER_REGULAR);
                break;
            case 'getHistory':
                $out = getHistory();
                break;
            case 'getUpdates':
                $out = getUpdates();
                break;
            default:
                setStatus($out, 'fail', 'invalid type.');
Example #10
0
 skype_script();
 echo show_info($vol);
 if (false) {
     $status = skype_status($vol->skypeid);
     if ($status != $vol->status) {
         $vol->status = $status;
         $vol->last_check = time();
         if (online($vol->status)) {
             $vol->last_online = time();
         }
         vol_update_status($vol);
     }
     $image = button_image($status);
     echo "\n        <script type=\"text/javascript\" src=\"http://download.skype.com/share/skypebuttons/js/skypeCheck.js\"></script>\n        <img src=images/help/{$image}><p>\n    ";
     echo "<table class=box cellpadding=8 width=100%><tr><td width=40%>";
     if (online($status)) {
         live_contact($vol);
     }
 }
 skype_call_button($vol);
 email_contact($vol);
 echo "</td></tr></table><p>\n";
 echo "<table class=box cellpadding=8 width=100%><tr><td>";
 $rating = rating_vol_auth($vol->id, $uid);
 if (!$rating) {
     $rating = new StdClass();
     $rating->rating = -1;
     $rating->comment = "";
 }
 show_rating($vol, $rating);
 echo "</td></tr></table>\n";
Example #11
0
                 $db->query("UPDATE {$DT_PRE}member SET chat={$chats} WHERE userid={$_userid}");
             }
         }
         //发起的对话
         $result = $db->query("SELECT * FROM {$table} WHERE fromuser='******' ORDER BY fgettime DESC LIMIT 50");
         while ($r = $db->fetch_array($result)) {
             if ($DT_TIME - $r['treadtime'] > $MOD['chat_poll'] * 3) {
                 $r['line'] = '<span class="f_gray"></span>';
                 //等待中
             } else {
                 $r['line'] = '<span class="f_blue">对话中</span>';
             }
             $r['gettime'] = $r['fgettime'] ? timetodate($r['fgettime'], 5) : '';
             $m = userinfo($r['touser']);
             $r['linkurl'] = $m['linkurl'];
             $r['online'] = online($m['userid']);
             $r['from'] = $m['company'];
             $r['truename'] = $m['truename'];
             $F[] = $r;
         }
         $head_title = '在线对话';
         $type = 3;
     }
 }
 if ($type < 3) {
     $faces = array();
     $face = glob('face/*.gif');
     if ($face) {
         foreach ($face as $k => $v) {
             $faces[$k] = basename($v, '.gif');
         }
Example #12
0
    }
    themeheader();
    global $cpgtpl, $ownpagetitle, $home;
    $adminmenuitems = $admincssmenuitems = false;
    if (!$home) {
        if (defined('ADMIN_PAGES') && is_admin() && !(isset($_GET['op']) && $_GET['op'] == 'logout')) {
            require_once 'includes/classes/cpg_adminmenu.php';
            $adminmenuitems = $CLASS['adminmenu']->display('all', 'jsmenu');
            $admincssmenuitems = $MAIN_CFG['global']['admingraphic'] & 4;
        }
    }
    $cpgtpl->assign_vars(array('BASEHREF' => $BASEHREF, 'I18N' => 'enctype="multipart/form-data" accept-charset="utf-8"', 'IMPORTANT_MESSAGE' => $message, 'PAGE_TITLE' => $home || isset($ownpagetitle[$module_name]) ? '' : $pagetitle, 'S_TEXTDIR' => _TEXT_DIR, 'S_LANGCODE' => _BROWSER_LANGCODE, 'S_HEADER_TAGS' => $header, 'S_LEFTBLOCKS' => $Blocks->showblocks & 1, 'S_RIGHTBLOCKS' => $Blocks->showblocks & 2, 'S_SITENAME' => $sitename, 'S_PAGETITLE' => !empty($pagetitle) ? strip_tags($pagetitle) : '', 'S_DELIM' => _BC_DELIM, 'S_FILESERVER' => '', 'S_ADMIN_MENU' => $adminmenuitems, 'S_ADMIN_CSSMENU' => $admincssmenuitems, 'B_PAGETITLE' => 1 < strlen(strip_tags($pagetitle)), 'B_NEWSRSS' => is_active('News')));
    unset($modheader);
}
if (empty($_SESSION['SECURITY']['banned'])) {
    online();
}
global $home, $cpgtpl, $Blocks;
$Blocks->init();
head();
if (!defined('ADMIN_PAGES')) {
    require_once 'includes/counter.php';
    # 2-3 queries
    if ($home) {
        require_once 'includes/functions/messagebox.php';
        message_box();
    }
}
$Blocks->display('c');
$cpgtpl->set_filenames(array('cpgheader' => 'header.html'));
$cpgtpl->display('cpgheader');
Example #13
0
 require_once 'yhteiset/php_yhteiset.php';
 require_once 'yhteiset/Parametrit.php';
 require_once 'yhteiset/Palaute.php';
 $kirjautumistieto = '';
 if (isset($_SESSION['tiedot'])) {
     $kirjautumistieto = "Kirjautunut: " . $_SESSION['tiedot']->etunimi;
 }
 $aika = anna_nyk_viikonp_suomeksi() . " " . date("d.m.Y");
 $aikailmoitus = "T&auml;n&auml;&auml;n on {$aika}";
 // Yhdistetään tietokantaan:
 $tietokantaolio = new Tietokantaolio($dbtyyppi, $dbhost, $dbuser, $dbsalis);
 $tietokantaolio->yhdista_tietokantaan($dbnimi);
 $omaid = $_SESSION['tiedot']->id;
 // Tarkistetaan, ettei käyttäjää ole potkaistu ulos (sessiotiedot
 // voivat olla vanhentuneita tai kopioituja):
 if (!online($omaid, $tietokantaolio)) {
     $kansiotaso = 1;
     toteuta_kirjaudu_ulos($tietokantaolio, $dbnimi, $kansiotaso);
     exit;
 }
 // Verkkosivujen hallitsijan totuusarvo:
 $omat_valtuudet = $_SESSION['tiedot']->valtuudet;
 $kuningas = on_kuningas_pika($omat_valtuudet);
 // Luodaan parametri- ja palautusolio:
 $kokoelmanimi = "";
 // Tämä koskee kuvia. Ei tarvinne täällä, ellei
 // tulevaisuudessa haluta kuvia laittaa.
 $parametriolio = new Parametrit($kokoelmanimi, $omaid, $tietokantaolio);
 $palauteolio = new Palaute();
 // Lisätään ihmisen tiedot:
 $etun = $parametriolio->etun;
Example #14
0
	} else { // only a is online - it comes first
		return -1;
	}
  } else if ( $b['online'] ) { //only b is online - comes first
	return 1;
  } else {// both offline - the one that was most recently on comes first
	return strtotime($b['time']) - strtotime($a['time']);
  }
  
}

function getusers()
{
  $tmp = $GLOBALS['users'];
  uasort($tmp, 'cmp');
  return $tmp;
}

// PARSE THE LOG

foreach ($logs as $l)
{
  if (preg_match("/([0-9-]+ [0-9:]+) \[INFO\] \<([a-zA-Z0-9-_]+)\> (.*)/i", $l, $m))
    online($m[2], $m[1]);
  else if (preg_match("/([0-9-]+ [0-9:]+) \[INFO\] ([a-zA-Z0-9-_]+) \[.*logged in with entity/i", $l, $m))
    online($m[2], $m[1]);
  else if (preg_match("/([0-9-]+ [0-9:]+) \[INFO\] ([a-zA-Z0-9-_]+) lost connection/i", $l, $m))
    offline($m[2], $m[1]);
  else if (preg_match("/Stopping server/i", $l, $m))
    server_quit();
}
Example #15
0
    $q = db_select("select distinct(brugernavn) from online where brugernavn != '" . db_escape_string($brugernavn) . "' and db = '{$db}' and session_id != '{$s_id}'  and logtime > '{$udlob}'", __FILE__ . " linje " . __LINE__);
    while ($r = db_fetch_array($q)) {
        $x++;
        $aktiv[$x] = $r['brugernavn'];
    }
    $y = $x + 1;
    #	if ($y > $bruger_max) {
    #		$headers = 'From: saldi@saldi.dk'."\r\n".'Reply-To: saldi@saldi.dk'."\r\n".'X-Mailer: PHP/' . phpversion();
    #		mail("*****@*****.**", "Brugerantal ($x) overskredet for $regnskab / $db", "$brugernavn logget ind som bruger nr $y.", "$headers");
    #		print "<BODY onLoad=\"javascript:alert('Max antal samtidige brugere ($x) er overskredet.')\">";
    #	}
    $q = db_select("select * from online where brugernavn = '" . db_escape_string($brugernavn) . "' and db = '{$db}' and session_id != '{$s_id}'", __FILE__ . " linje " . __LINE__);
    if ($r = db_fetch_array($q)) {
        $last_time = $r['logtime'];
        if (!$fortsaet && $unixtime - $last_time < 3600) {
            online($regnskab, $brugernavn, $password, $timestamp, $s_id);
            exit;
        } elseif (!$fortsaet) {
            $tmp = date("d-m-y", $last_time) . " kl. " . date("H:i", $last_time);
            print "<BODY onLoad=\"javascript:alert('Velkommen {$brugernavn}. Du har ikke logget korrekt af da du sidst var online d. {$tmp}')\">";
            db_modify("delete from online where brugernavn = '" . db_escape_string($brugernavn) . "' and db = '{$db}' and session_id != '{$s_id}'", __FILE__ . " linje " . __LINE__);
        }
    }
}
db_modify("delete from online where session_id = '{$s_id}'", __FILE__ . " linje " . __LINE__);
if ($db && !file_exists("../temp/.ht_{$db}.log")) {
    $fp = fopen("../temp/.ht_{$db}.log", "a");
    fwrite($fp, "-- " . $brugernavn . " " . date("Y-m-d H:i:s") . ": " . $spor . "\n");
    fwrite($fp, "\\connect {$db};\n");
    fclose($fp);
}
 require_once '../viestit/Viesti.php';
 require_once '../yhteiset/Parametrit.php';
 require_once '../yhteiset/Palaute.php';
 require_once '../pikakommentointi/Pikakommenttitekstit.php';
 require_once '../pikakommentointi/Pikakommentti.php';
 require_once '../bongaus/lajiluokat/Kuvaus.php';
 require_once '../bongaus/lajiluokat/Lajiluokka.php';
 // Yhdistetään tietokantaan:
 $tietokantaolio = new Tietokantaolio($dbtyyppi, $dbhost, $dbuser, $dbsalis);
 //$tietokantaolio->yhdista_tietokantaan($dbnimi);
 $tietokantaolio->yhdista_tietokantaan_uusi_yhteys($dbnimi);
 /********************************************************************/
 // Tarkistetaan, ettei käyttäjää ole potkaistu tai itse kirjautunut ulos:
 // Tämä voisi olla aiemmin, mutta en halunnut rasittaa liian usein
 // tapahtuvaksi.
 if (!online($_SESSION['tiedot']->id, $tietokantaolio)) {
     $kansiotaso = 2;
     toteuta_passiivinen_ulos_toiminto($kansiotaso);
     echo Yleisarvoja::$istunto_vanhentunut;
     exit;
 }
 /******************************************************************/
 // Ikätarkistus:
 if (on_alaikainen_tai_elakkeella($omaid, $tietokantaolio)) {
     $alaikainen = true;
 } else {
     $alaikainen = false;
 }
 // Haetaan parametrit;
 $parametriolio = new Parametrit($kokoelmanimi, $omaid, $tietokantaolio);
 /******************* ESIKATSELUKUVAHAKU *******************************/
Example #17
0
<?php

require '../core/sessions.php';
require '../core/functions.php';
require '../core/db.php';
$email = $_POST['email'];
$password = $_POST['password'];
userExists($email, $password);
if (isset($_POST['login'])) {
    if ($user_exists == false) {
        $_SESSION['noUserFound'] = true;
        header('Location: ../index.php');
        exit;
    } else {
        online($email, $password);
        setcookie('online', $userID, time() + 86400 * 30, "/");
        $_SESSION['noUserFound'] = false;
        header('Location: ../profile.php?id=' . $id);
        exit;
    }
}
Example #18
0
    <td>
    <iframe src="http://tienich.vnpec.com/gold/gold-3.php" frameborder="0" height=100 scrolling="no" width="98%"></iframe>
    </td>
  </tr>
</table>

<table width="200" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td id="trai">&nbsp;</td>
    <td id="giua">Thống kê</td>
    <td id="phai">&nbsp;</td>
  </tr>
</table>
<table width="200" border="0" cellspacing="0" cellpadding="0" class="bangduoi">
  <tr>
    <td>
  <?php 
include "function.php";
?>
    <meta charset="utf-8">
<?php 
include_once "function.php";
echo online(' ', ' ', $langx = 1, 1, 0, 0, 1, 1, 1, 1, 1);
?>

    
    </td>
  </tr>
</table>
</body>
</html>
Example #19
0
<ul id="navi">
  <li><a href="<?php 
echo $base_url;
?>
/">Home</a></li>
<?php 
if (online()) {
    ?>
  <li><a href="<?php 
    echo $base_url;
    ?>
/photos.php">Photos</a></li>
  <li><a href="<?php 
    echo $base_url;
    ?>
/top.php">Popular</a></li>
  <li><a href="<?php 
    echo $base_url;
    ?>
/rate.php">Rate</a></li>
  <li><a href="<?php 
    echo $base_url;
    ?>
/?action=logout">Logout</a></li>
<?php 
} else {
    ?>
  <li><a href="">Login</a></li>
<?php 
}
?>
Example #20
0
            } else {
                $db->query("INSERT INTO {$table} (chatid,fromuser,touser,tgettime,forward) VALUES ('{$chat_id}','{$_username}','{$touser}','0','{$forward}')");
            }
            $type = 1;
        } else {
            if (isset($chatid) && is_md5($chatid)) {
                $chat = $db->get_one("SELECT * FROM {$table} WHERE chatid='{$chatid}'");
                if ($chat && ($chat['touser'] == $_username || $chat['fromuser'] == $_username)) {
                    if ($chat['touser'] == $_username) {
                        $user = userinfo($chat['fromuser']);
                    } else {
                        if ($chat['fromuser'] == $_username) {
                            $user = userinfo($chat['touser']);
                        }
                    }
                    $online = online($user['userid']);
                    $chat_id = $chatid;
                    $head_name = lang($L['chat_with'], array($user['username']));
                    $head_title = $head_name . $DT['seo_delimiter'] . $head_title;
                } else {
                    dheader('?action=index');
                }
                $type = 2;
            } else {
                $head_name = $L['chat_title'];
                $head_title = $head_name . $DT['seo_delimiter'] . $head_title;
                $type = 3;
            }
        }
        break;
}
Example #21
0
    }
    ?>
</td>

<td width="20"><?php 
    if ($v['skype']) {
        echo im_skype($v['skype']);
    } else {
        echo '&nbsp;';
    }
    ?>
</td>


<td><?php 
    $ol = online($v['userid']);
    if ($ol == 1) {
        ?>
<span class="f_red">在线</span><?php 
    } else {
        if ($ol == -1) {
            ?>
<span class="f_blue">隐身</span><?php 
        } else {
            ?>
<span class="f_gray">离线</span><?php 
        }
    }
    ?>
</td>
    $code = str_replace("\n", '', $code);
    $code = str_replace("\r", '', $code);
    return $code;
}
######################################
# Basic PHP scraper
######################################
$html = scraperwiki::scrape('http://www.valleycollege.edu/eSchedule/online/Schedule/V/2012SP/index.html');
$html = online($html);
preg_match_all('|<td><a name=".*?"></a><a href="../../../(.*?)">(.*?)</a></td>|', $html, $arr);
//count = 0;
foreach ($arr[2] as $key => $val) {
    $Subject = $arr[2][$key];
    $url = "http://www.valleycollege.edu/eSchedule/Online/" . $arr[1][$key];
    $premhtml = scraperwiki::scrape($url);
    $premhtml = online($premhtml);
    preg_match_all('|<td><a href="../../../(.*?)">(.*?)</a></td>|', $premhtml, $arr2);
    foreach ($arr2[1] as $key => $val) {
        //$Subject = $arr2[2][$key];
        $course = $arr2[2][$key];
        $url2 = "http://www.valleycollege.edu/eSchedule/Online/" . $arr2[0][$key];
        //$urlCourse = array();
        //$urlCourse[] = $course;
        //if(isset($course))
        //  continue;
        scraperwiki::save(array('Subject', 'Course'), array('Subject' => $Subject, 'Course' => $course));
    }
    //count++;
    //$record = ;
}
function clean($val)