Beispiel #1
0
 public function __construct()
 {
     parent::__construct();
     // Config Application instance.
     $this->site = array(DOMAIN => 'http://' . $_SERVER['HTTP_HOST'] . '/', ROOT => $_SERVER['DOCUMENT_ROOT'] . '/', STORE => 'file_store', COM => 'facebook/component/', MOD => 'facebook/module/', APP => 'http://apps.facebook.com/hakkomew/', IFRAME => 'http://' . $_SERVER['HTTP_HOST'] . '/facebook/module/iframe/');
     //Set Default Component
     if (!isset($_GET['component'])) {
         $_GET['component'] = 'frontpage';
     }
     //Query ID Position
     foreach (parent::ViewTable('position', 0) as $pos) {
         $this->idPosition[$pos['name']] = $pos['pos_id'];
     }
     //Query ID Component
     $this->idComponent = parent::GetValue('com_id', 'component', 'name', $_GET['component']);
     //Online User
     $user = self::Facebook('/me');
     if ($user['session']) {
         if (!isset($_GET['manga'])) {
             $this->Update('user_online', 'mag_id', 0, 'uid', $user['session']['uid']);
         }
         $delWhere = parent::GetValue('expires', 'user_online', 'uid', $user['session']['uid']) . '<' . $_SERVER['REQUEST_TIME'];
         $this->Delete('user_online', $delWhere);
         if (parent::CountRow('user_online', 'uid', $user['session']['uid']) < 1) {
             $this->Insert('user_online', array('expires', 'uid'), array($user['session']['expires'], $user['session']['uid']));
         }
     } else {
         // Guest User.
         echo '<iframe src="' . $this->site[IFRAME] . 'guest_cookie.php" frameborder="0" style="width:0px; height:0px;"></iframe>';
     }
 }
Beispiel #2
0
 public function __construct()
 {
     parent::__construct();
     $userid = ereg_replace('\\.', '', $_SERVER['REMOTE_ADDR']);
     $expires = time() + 1200;
     $table = 'user_online';
     $column = array('expires', 'uid', 'mag_id', 'guest');
     $values = array($expires, $userid, 0, 1);
     if (parent::CountRow($table, 'uid', $userid) < 1) {
         try {
             $sqlString = parent::InsertString($table, $column);
             $statement = $this->isConnect->prepare($sqlString);
             $statement = parent::bindState($statement, $column, $values);
             $statement->execute();
         } catch (PDOException $e) {
             parent::ErrorException('Insert', $e, $sqlString);
         }
     }
 }
Beispiel #3
0
<?php

$site = array(DOMAIN => 'http://' . $_SERVER['HTTP_HOST'] . '/', ROOT => $_SERVER['DOCUMENT_ROOT'] . '/', MOD => 'facebook/module/');
require_once $site[ROOT] . 'facebook/cgi-bin/connection.class.php';
require_once $site[ROOT] . 'facebook/cgi-bin/language/thai.language.php';
$online = new PDOConnection();
$total_online = $online->CountRow('user_online', 0, 0);
$guest_online = $online->CountRow('user_online', 'guest', 1);
echo $total_online - $guest_online . _MANGA_READ;
?>
 
<?php 
if ($guest_online != 0) {
    ?>
<span class="text-detail">(<?php 
    echo _MANGA_GUEST . $guest_online . _MANGA_READ;
    ?>
)</span>
<?php 
}
Beispiel #4
0
$online = new PDOConnection();
$mangaDetails = new MangaReader(array($site[STORE], $_POST['name']));
$manga['name'] = rawurlencode($_POST['name']) . '/';
foreach ($mangaDetails->getArray() as $mlist) {
    if (is_file($mlist['path'])) {
        list($filename, $fileextended) = explode('.', $mlist['name']);
        if ($filename == 'thumb') {
            $manga['thumb'] = $mangaDetails->getDomain() . $mlist['name'];
        }
    }
}
if (!isset($manga['thumb'])) {
    $manga['thumb'] = 'http://hakko.9friend.net/images/none-thumb.jpg';
}
$manga['view'] = $online->GetValue('view', 'manga', 'mag_id', $_POST['id']);
$manga['online'] = $online->CountRow('user_online', 'mag_id', $_POST['id']);
?>

<a href="<?php 
echo $online->GetValue('link', 'manga', 'mag_id', $_POST['id']);
?>
"><h2><?php 
echo $_POST['name'];
?>
</h2>
<table width="230" border="0" cellpadding="2" cellspacing="0" class="manga-list">
  <tr>
    <td width="50"><div class="thumb-img" style="width:40px;height:40px;">
    <fb:tag name="img">
       <fb:tag-attribute name="src"><?php 
echo $manga['thumb'];