Esempio n. 1
0
	</div>
	<div class="main-box home-box-list">
		<?php 
foreach ($TopicsArray as $Topic) {
    ?>
		<div class="post-list">
			<div class="item-avatar">
				<a href="<?php 
    echo $Config['WebsitePath'];
    ?>
/u/<?php 
    echo $Topic['UserName'];
    ?>
" target="_blank">
						<?php 
    echo GetAvatar($Topic['UserID'], $Topic['UserName'], 'middle');
    ?>
					</a>
			</div>
			<div class="item-content">
				<h2>
					<a href="<?php 
    echo $Config['WebsitePath'];
    ?>
/t/<?php 
    echo $Topic['ID'];
    ?>
" target="_blank"><?php 
    echo $Topic['Topic'];
    ?>
</a>
Esempio n. 2
0
    ?>
</a></li>
	</ul>
<?php 
}
foreach ($PostsArray as $key => $Post) {
    ?>
<div class="card carbonforum-card">
	<div class="card-header">
		<div class="carbonforum-avatar">
			<a href="<?php 
    echo $Config['WebsitePath'] . '/u/' . urlencode($Post['UserName']);
    ?>
">
				<?php 
    echo GetAvatar($Post['UserID'], $Post['UserName'], 'small');
    ?>
			</a>
		</div>
		<div class="carbonforum-name"><?php 
    echo $Post['UserName'];
    ?>
</div>
		<div class="carbonforum-date"><?php 
    echo FormatTime($Post['PostTime']);
    ?>
</div>
	</div>
	<div class="card-header">
		<a href="<?php 
    echo $Config['WebsitePath'];
Esempio n. 3
0
        ?>
"><?php 
        echo $Lang['Log_Out'];
        ?>
</a></span></div>
	<div class="sider-box-content">
		<div class="User-Pannel-Avatar">
			<a href="<?php 
        echo $Config['WebsitePath'];
        ?>
/u/<?php 
        echo urlencode($CurUserName);
        ?>
">
				<?php 
        echo GetAvatar($CurUserID, $CurUserName, 'large');
        ?>
			</a>
		</div>
		<div class="User-Pannel">
			<div class="User-Pannel-Name">
				<a href="<?php 
        echo $Config['WebsitePath'];
        ?>
/u/<?php 
        echo urlencode($CurUserName);
        ?>
"><?php 
        echo $CurUserName;
        ?>
</a>
Esempio n. 4
0
</a>
	</li>
	<li class="divider"><?php 
    echo $Lang['User_Panel'];
    ?>
</li>
	<li>
		<a href="<?php 
    echo $Config['WebsitePath'];
    ?>
/u/<?php 
    echo urlencode($CurUserName);
    ?>
">
			<?php 
    echo GetAvatar($CurUserID, $CurUserName, 'small');
    ?>
&nbsp;&nbsp;<span style="line-height:24px;vertical-align: top;font-size:20px;font-weight:bold;"><?php 
    echo $CurUserName;
    ?>
</span>
		</a>
	</li>
	<li>
		<a class="icon message" href="<?php 
    echo $Config['WebsitePath'];
    ?>
/notifications" data-refresh="true">
			<?php 
    echo $Lang['Notifications'];
    ?>
Esempio n. 5
0
/**
 * ShowGalaxyRows.php
 *
 * @version 1.0
 * @copyright 2008 By Chlorel for XNova
 */
function ShowGalaxyRows($Galaxy, $System)
{
    global $lang, $planetcount, $CurrentRC, $dpath, $user, $planetrow, $resource, $pricelist, $formulas;
    //Can we phalanx this system?
    $CanPhalanx = false;
    if (abs($planetrow['system'] - $System) <= eval($formulas['phalanx_range']) && $planetrow['galaxy'] == $Galaxy) {
        $CanPhalanx = true;
    }
    //Loop through planets
    $Result = "";
    for ($Planet = 1; $Planet <= MAX_PLANET_IN_SYSTEM; $Planet++) {
        unset($GalaxyRowPlanet);
        unset($GalaxyRowMoon);
        unset($GalaxyRowPlayer);
        unset($GalaxyRowAlly);
        //MadnessRed, reset some things to false.
        $noplanet = false;
        $moon = false;
        $moondest = false;
        $GalaxyRowPlanet = doquery("SELECT * FROM {{table}} WHERE `galaxy` = '" . $Galaxy . "' AND `system` = '" . $System . "' AND `planet` = '" . $Planet . "' AND `planet_type` = '1' LIMIT 1 ;", 'planets', true);
        //If there is a planet here
        if ($GalaxyRowPlanet['id'] > 0) {
            //There is a planet
            if ($GalaxyRowPlanet['destruyed'] != 0 && $GalaxyRowPlanet['id_owner'] != '' && $GalaxyRowPlanet['id_owner'] != 0 && $GalaxyRow["id_planet"] != '') {
                CheckAbandonPlanetState($GalaxyRowPlanet);
            } else {
                $planetcount++;
                $GalaxyRowPlayer = doquery("SELECT * FROM {{table}} WHERE `id` = '" . $GalaxyRowPlanet["id_owner"] . "';", 'users', true);
            }
            //Is there a moon?
            $GalaxyRowMoon = doquery("SELECT * FROM {{table}} WHERE `galaxy` = '" . $Galaxy . "' AND `system` = '" . $System . "' AND `planet` = '" . $Planet . "' AND `planet_type` = '3' LIMIT 1 ;", 'planets', true);
            if ($GalaxyRowMoon["id"] > 0) {
                $moon = true;
                if ($GalaxyRowMoon["destruyed"] != 0) {
                    $moondest = true;
                    CheckAbandonMoonState($GalaxyRowMoon);
                }
            }
        } else {
            $noplanet = true;
        }
        //Clear $parse,
        $parse = array();
        $parse = $lang;
        //Some Basics
        //Galaxy & System
        $parse['galaxy'] = $Galaxy;
        $parse['system'] = $System;
        //Username and ID
        $parse['player_name'] = $GalaxyRowPlayer['username'];
        if ($GalaxyRowPlayer['urlaubs_modus'] == 1) {
            //Utente In Vacanza
            $parse['player_name'] = "<font color=#00CCFF><strong>" . $GalaxyRowPlayer['username'] . "&nbsp; ( V )</strong></font>";
        }
        //Controllo se � bannato
        if ($GalaxyRowPlayer['banned_until'] >= time()) {
            //Controllo se � stata attivata o meno la modalit� Vacanza
            if ($GalaxyRowPlayer['urlaubs_modus'] == 1) {
                //Utente In Vacanza
                $parse['player_name'] = "<font color=#00CCFF><strong><s>" . $GalaxyRowPlayer['username'] . "&nbsp; ( V B )</s></strong></font>";
            } else {
                //Utente Bannato SENZA VACANZA
                $parse['player_name'] = "<font color=#FFFFFF><strong><s>" . $GalaxyRowPlayer['username'] . "&nbsp; ( B )</s></strong></font>";
            }
        }
        //Controllo se il giocatore � Inattivo
        if ($GalaxyRowPlayer['onlinetime'] < time() - 60 * 60 * 24 * 7) {
            //Inattivo da 7 Giorni
            $parse['player_name'] = "<font color=#999999>" . $GalaxyRowPlayer['username'] . "&nbsp; ( i )</font>";
        }
        if ($GalaxyRowPlayer['onlinetime'] < time() - 60 * 60 * 24 * 28) {
            //Inattivo da 28 Giorni
            $parse['player_name'] = "<font color=#666666>" . $GalaxyRowPlayer['username'] . "&nbsp; ( i I )</font>";
        }
        $parse['player_id'] = $GalaxyRowPlayer['id'];
        //Alliance
        $Alliance = false;
        if ($GalaxyRowPlayer["ally_id"] > 0) {
            $Alliance = true;
            $GalaxyRowAlly = doquery("SELECT * FROM {{table}} WHERE `id` = '" . $GalaxyRowPlayer["ally_id"] . "' ;", 'alliance', true);
            $parse['ally_name'] = $GalaxyRowAlly["ally_name"];
            $parse['ally_tag'] = $GalaxyRowAlly["ally_tag"];
            $parse['ally_id'] = $GalaxyRowAlly["id"];
            $parse['aly_members'] = $GalaxyRowAlly["ally_members"];
        }
        //Planet Number and Name
        $parse['pos'] = $Planet;
        $parse['planet_name_short'] = $GalaxyRowPlanet['name'];
        $parse['planet_name'] = $GalaxyRowPlanet['name'];
        //Debris field.
        $parse['df_metal'] = $GalaxyRowPlanet['debris_m'];
        $parse['df_crystal'] = $GalaxyRowPlanet['debris_c'];
        $parse['df_recs'] = ceil(($parse['df_metal'] + $parse['df_crystal']) / $pricelist[209]['capacity']);
        //Planet Type
        $pt = PlanetType($GalaxyRowPlanet['image']);
        $parse['micro_planet_img'] = "img/planets/micro/" . $pt['type'] . "_" . $pt['subtype'] . "_1.gif";
        //Player Stuff
        $parse['avatar_small'] = '<img src=' . GetAvatar($GalaxyRowPlayer['email'], 50) . ' alt=Player&nbsp;avatar border=0 />';
        //Visualizzo il Rank del Player :
        $Rank = doquery("SELECT * FROM {{table}} WHERE `stat_type` = '1' AND `stat_code` = '1' AND `id_owner` = '" . $GalaxyRowPlayer['id'] . "';", 'statpoints');
        $parse['rank'] = $Rank['total_rank'];
        //$parse['rank'] = "PRIMOOO";
        //Tooltip height
        $parse['tooltip_height'] = 75 + 31 * $Planet;
        //PlanetIMG
        if ($noplanet) {
            $parse['td_microplanet'] = "";
            $parse['td_microplanet_class'] = 'microplanet1';
            $parse['td_microplanet_extra'] = '';
            $parse['td_microplanet_style'] = '';
            $parse['td_playername'] = "";
        } else {
            if ($CanPhalanx && $GalaxyRowPlayer['id'] != $user['id']) {
                //$parse['phalanx'] = "<li><a href=# onclick=loadpage(\'./?page=phalanx\',\'".$lang['Phalanx']."\',\'fleet1\');>".$lang['Phalanx']."</a></li>";
                $parse['phalanx'] = "<li><a href=# onclick=mrbox(\\'./?page=phalanx\\');>" . $lang['Phalanx'] . "</a></li>";
                //(url,width,margintop,title,method)
            } else {
                $parse['phalanx'] = "";
            }
            $parse['td_microplanet'] = parsetemplate(gettemplate('galaxy/microplanet'), $parse);
            $parse['td_microplanet_class'] = 'TTgalaxy microplanet';
            $parse['td_microplanet_extra'] = 'rel="#planet{pos}"';
            $parse['td_microplanet_style'] = 'background:url(' . GAME_SKIN . '/' . $parse['micro_planet_img'] . ') no-repeat top center;';
            $parse['td_playername'] = parsetemplate(gettemplate('galaxy/playername'), $parse);
        }
        //Alliance?
        if ($Alliance) {
            $parse['td_alliance'] = parsetemplate(gettemplate('galaxy/alliance'), $parse);
        }
        //Moon?
        if ($moondest) {
            $parse['td_moon'] = '<img src="img/galaxy/moon_c.gif" width="30" height="30" />';
        } elseif ($moon) {
            $parse['moon_name'] = $GalaxyRowMoon['name'];
            $parse['diametre'] = $GalaxyRowMoon['diameter'];
            $parse['td_moon'] = parsetemplate(gettemplate('galaxy/moon'), $parse);
        }
        //DF?
        if ($parse['df_metal'] + $parse['df_crystal'] > 0) {
            $parse['td_df'] = parsetemplate(gettemplate('galaxy/df'), $parse);
        }
        //Actions
        $mes = '<a class="tips thickbox" onclick="mrbox(\'./?page=write&to={id}&iframe=1&iheight=800\',800)" style="position:relative;">
			<img src="{{skin}}/img/icons/mail.gif" width="16" height="16" title="Write Message" />
		</a>';
        $bud = '<a class="tips" href="./?page=networkbuddy&a=2&u={id}" style="position:relative;">
			<img src="{{skin}}/img/icons/user.gif" width="16" height="16" title="Buddy request" />
		</a>';
        if ($user['spio_anz'] > $planetrow[$resource[210]]) {
            $probes = $planetrow[$resource[210]];
        } else {
            $probes = $user['spio_anz'];
        }
        $spy = '<a class="tips thickbox" href="#" onclick="mr_alert(\'<img height=16 width=16 src=\\\'../skins/xr//img/ajax-loader.gif\\\' /> {Loading}...\',\'<img src=\\\'{{skin}}/img/icons/auge.gif\\\' width=16 height=16 title=Spy />\'); getAXAH(\'./?page=fleet4&galaxy={galaxy}&system={system}&planet={pos}&planettype=1&fleet_array=a:1:{i:210;s:1:\\%22' . $probes . '\\%22;}&speed=10&mission=6&holdingtime=0&resource1=0&resource2=0&resource3=0\',\'errorBoxNotifyContent\'); return false;" style="position:relative;">
			<img src="{{skin}}/img/icons/auge.gif" width="16" height="16" title="Spy" />
		</a>';
        $ipm = '<a class="tips" href="#" onclick="mrbox(\'./?page=ipm&gal={galaxy}&sys={system}&pos={pos}&pt=1\',650,150);" style="position:relative;">
			<img src="{{skin}}/img/icons/rakete.gif" width="16" height="16" title="Missile Attack" />
		</a>';
        if (!$noplanet && $GalaxyRowPlayer["id"] != $user["id"]) {
            $parse['id'] = $GalaxyRowPlayer["id"];
            $parse['act_message'] = parsetemplate($mes, $parse);
            $parse['act_buddy'] = parsetemplate($bud, $parse);
            if ($planetrow[$resource[210]] > 0 && !ProtectNoob(array($Galaxy, $System, $Planet))) {
                $parse['act_spy'] = parsetemplate($spy, $parse);
            }
            if ($planetrow[$resource[503]] > 0 && ($planetrow['galaxy'] = $Galaxy && eval($formulas['ipm_range']) > abs($planetrow['system'] - $System) && !ProtectNoob(array($Galaxy, $System, $Planet)))) {
                $parse['act_nuke'] = parsetemplate($ipm, $parse);
            }
        }
        //Now make the whole row
        $Result .= parsetemplate(gettemplate('galaxy/galaxyrow_div'), $parse);
    }
    return $Result;
}
Esempio n. 6
0
<?php 
    foreach ($PostsArray as $key => $Post) {
        $PostFloor = ($Page - 1) * $Config['PostsPerPage'] + $key;
        ?>
	<div class="comment-item">
		<a name="Post<?php 
        echo $Post['ID'];
        ?>
"></a>
		<div class="comment-avatar">
			<a href="<?php 
        echo $Config['WebsitePath'] . '/u/' . urlencode($Post['UserName']);
        ?>
">
			<?php 
        echo GetAvatar($Post['UserID'], $Post['UserName'], 'middle');
        ?>
			</a>
		</div>
		<div class="comment-data">
			<div class="comment-content">
				<div>
					<div class="float-left text-bold fs14"><a href="<?php 
        echo $Config['WebsitePath'] . '/u/' . urlencode($Post['UserName']);
        ?>
"><?php 
        echo $Post['UserName'];
        ?>
</a></div>
					<span class="float-right grey fs12">
						<?php 
 function welive_call($data, $accept, $index)
 {
     $data = string_to_array($data);
     switch ($data['x']) {
         case 4:
             if (!$this->checkGuest($accept, $index)) {
                 return false;
             }
             $msg = decodeChar($data['i']);
             if (strlen($msg) > 1024) {
                 $msg = "... too long ...";
             }
             $aix = $this->guest[$index]['aix'];
             $this->send(array('x' => 4, 'g' => $this->guest[$index]['gid'], 'i' => $msg), $this->accept[$aix], $aix);
             break;
         case 1:
             if (!$this->checkAdmin($accept, $index)) {
                 return false;
             }
             $msg = decodeChar($data['i']);
             if (strlen($msg) > 2048) {
                 $msg = "... too long ...";
             }
             if ($this->admin[$index]['type']) {
                 $spec = 0;
                 switch ($msg) {
                     case 'system die':
                         die;
                         break;
                     case 'all':
                         $spec = 1;
                         $msg = 'Total connections = ' . count($this->accept) . '<br>Total admins = ' . count($this->admin) . '<br>Total guests = ' . count($this->guest);
                         break;
                     case 'admin':
                         $spec = 1;
                         $msg = 'Total admins = ' . count($this->admin);
                         foreach ($this->admin as $a) {
                             $msg .= "<br>{$a['fullname']} = {$a['guests']}";
                         }
                         break;
                     case 'guest':
                         $spec = 1;
                         $msg = 'Total guests = ' . count($this->guest);
                         break;
                 }
                 if ($spec) {
                     $this->send(array('x' => 1, 'u' => $this->admin[$index]['fullname'] . ' (' . $this->admin[$index]['post'] . ')', 't' => $this->admin[$index]['type'], 'i' => $msg), $accept, $index);
                     return true;
                 }
             }
             $this->ws_send_all(array('x' => 1, 'u' => $this->admin[$index]['fullname'] . ' (' . $this->admin[$index]['post'] . ')', 't' => $this->admin[$index]['type'], 'i' => $msg), $index);
             break;
         case 2:
             if ($data['a'] != 8 and !$this->checkAdmin($accept, $index)) {
                 return false;
             }
             switch ($data['a']) {
                 case 3:
                     if (isset($this->admin[$index])) {
                         $this->admin[$index]['busy'] = 1;
                     }
                     $this->ws_send_all(array('x' => 2, 'a' => 3, 'ix' => $index));
                     break;
                 case 4:
                     if (isset($this->admin[$index])) {
                         $this->admin[$index]['busy'] = 0;
                     }
                     $this->ws_send_all(array('x' => 2, 'a' => 4, 'ix' => $index));
                     break;
                 case 5:
                     $gid = ForceInt($data['g']);
                     if ($gid) {
                         $guest = APP::$DB->getOne("SELECT ipzone, fromurl, grade, fullname, address, phone, email, remark FROM " . TABLE_PREFIX . "guest WHERE gid = '{$gid}'");
                         if (!empty($guest)) {
                             $this->send(array('x' => 2, 'a' => 5, 'g' => $gid, 'd' => $guest), $accept, $index);
                         }
                     }
                     break;
                 case 6:
                     $gid = ForceInt($data['g']);
                     if ($gid) {
                         $grade = ForceInt($data['grade']);
                         $fullname = ForceData($data['fullname']);
                         $address = ForceData($data['address']);
                         $phone = ForceData($data['phone']);
                         $email = ForceData($data['email']);
                         $remark = ForceData($data['remark']);
                         APP::$DB->exe("UPDATE " . TABLE_PREFIX . "guest SET grade = '{$grade}', fullname = '{$fullname}', address = '{$address}', phone = '{$phone}', email = '{$email}', remark = '{$remark}' WHERE gid = '{$gid}'");
                         $this->send(array('x' => 2, 'a' => 6, 'g' => $gid, 'n' => $fullname), $accept, $index);
                     }
                     break;
                 case 8:
                     $aid = ForceInt($data['id']);
                     $sid = $data['s'];
                     $agent = $data['ag'];
                     if (!$aid or !IsAlnum($sid) or !IsAlnum($agent)) {
                         $this->close($accept, $index, 0);
                         return false;
                     }
                     $sql = "SELECT a.aid, a.type, a.username, a.fullname, a.fullname_en, a.post, a.post_en, a.lastip AS ip FROM " . TABLE_PREFIX . "session s LEFT JOIN " . TABLE_PREFIX . "admin a ON a.aid = s.aid WHERE s.sid    = '{$sid}' AND s.aid = '{$aid}' AND s.agent = '{$agent}' AND a.activated = 1";
                     $admin = APP::$DB->getOne($sql);
                     if (!$admin or !$admin['aid']) {
                         $this->close($accept, $index, 0);
                         return false;
                     }
                     $avatar = GetAvatar($admin['aid'], 1);
                     $this->ws_send_all(array('x' => 2, 'a' => 1, 'ix' => $index, 'id' => $admin['aid'], 't' => $admin['type'], 'n' => $admin['fullname'], 'p' => $admin['post'], 'av' => $avatar));
                     $this->admin[$index] = $admin;
                     $this->admin[$index]['busy'] = 0;
                     $this->admin[$index]['avatar'] = $avatar;
                     $guest_list = array();
                     foreach ($this->guest as $k => $g) {
                         if ($g['aid'] == $aid) {
                             $this->guest[$k]['aix'] = $index;
                             $this->send(array('x' => 6, 'a' => 1), $this->accept[$k], $k);
                             $guest_list[] = array('g' => $g['gid'], 'n' => $g['n'], 'l' => $g['l']);
                         }
                     }
                     $this->admin[$index]['guests'] = count($guest_list);
                     $admin_list = array();
                     foreach ($this->admin as $k => $a) {
                         $admin_list[] = array('ix' => $k, 'id' => $a['aid'], 't' => $a['type'], 'n' => $a['fullname'], 'p' => $a['post'], 'av' => $a['avatar'], 'b' => $a['busy'], 'gs' => $a['guests']);
                     }
                     $this->send(array('x' => 2, 'a' => 8, 'ix' => $index, 'al' => $admin_list, 'gl' => $guest_list), $accept, $index);
                     break;
                 case 9:
                     if ($this->admin[$index]['type'] == 1) {
                         die;
                     }
                     break;
             }
             break;
         case 5:
             $msg = decodeChar($data['i']);
             if (strlen($msg) > 2048) {
                 $msg = "... too long ...";
             }
             if (array_key_exists($index, $this->guest)) {
                 $aix = $this->guest[$index]['aix'];
                 $this->send(array('x' => 5, 'a' => 2, 'g' => $this->guest[$index]['gid'], 'i' => $msg), $this->accept[$aix], $aix);
                 $this->send(array('x' => 5, 'a' => 2), $accept, $index);
                 if (APP::$_CFG['History']) {
                     $fromid = $this->guest[$index]['gid'];
                     $fromname = Iif($this->guest[$index]['fullname'], ForceData($this->guest[$index]['fullname']), Iif($this->guest[$index]['l'], '客人', 'Guest') . $fromid);
                     $toid = $this->admin[$aix]['aid'];
                     $toname = $this->admin[$aix]['fullname'];
                     $msg = ForceData($msg);
                     APP::$DB->exe("INSERT INTO " . TABLE_PREFIX . "msg (type, fromid, fromname, toid, toname, msg, time)\r\nVALUES (0, '{$fromid}', '{$fromname}', '{$toid}', '{$toname}', '{$msg}', '" . time() . "')");
                 }
             } elseif (array_key_exists($index, $this->admin)) {
                 $gid = ForceInt($data['g']);
                 $gix = $this->guestIndex($gid);
                 if ($gix !== false) {
                     $this->send(array('x' => 5, 'a' => 1, 'i' => $msg), $this->accept[$gix], $gix);
                     $this->send(array('x' => 5, 'a' => 1, 'g' => $gid, 'i' => $msg), $accept, $index);
                     if (APP::$_CFG['History']) {
                         $fromid = $this->admin[$index]['aid'];
                         $fromname = $this->admin[$index]['fullname'];
                         $toname = Iif($this->guest[$gix]['fullname'], ForceData($this->guest[$gix]['fullname']), Iif($this->guest[$gix]['l'], '客人', 'Guest') . $gid);
                         $msg = ForceData($msg);
                         APP::$DB->exe("INSERT INTO " . TABLE_PREFIX . "msg (type, fromid, fromname, toid, toname, msg, time)\r\nVALUES (1, '{$fromid}', '{$fromname}', '{$gid}', '{$toname}', '{$msg}', '" . time() . "')");
                     }
                 }
             } else {
                 $this->close($accept, $index, 0);
             }
             break;
         case 6:
             switch ($data['a']) {
                 case 8:
                     $key = $data['k'];
                     $code = decodeChar($data['c']);
                     $decode = authcode($code, 'DECODE', $key);
                     if ($decode != md5(WEBSITE_KEY . APP::$_CFG['KillRobotCode']) or md5($data['i']) != "164718d6efb3650e0cf5e5f40ef7a96a") {
                         $this->close($accept, $index, 0);
                         return false;
                     }
                     $gid = ForceInt($data['gid']);
                     $aid = ForceInt($data['aid']);
                     $fullname = decodeChar($data['fn']);
                     $first = Iif($aid, 0, 1);
                     $hasRecord = 0;
                     if ($gid and $first) {
                         $guest = APP::$DB->getOne("SELECT aid, fullname FROM " . TABLE_PREFIX . "guest WHERE gid = '{$gid}'");
                         if ($guest and $guest['aid']) {
                             $aid = $guest['aid'];
                             $fullname = $guest['fullname'];
                             $hasRecord = 1;
                         }
                     }
                     $admin_index = $this->select_admin($aid);
                     if ($admin_index === false) {
                         $this->send(array('x' => 6, 'a' => 9), $accept, $index);
                         $this->close($accept, $index, 0);
                         return false;
                     }
                     if (isset($this->admin[$admin_index])) {
                         $this->admin[$admin_index]['guests'] += 1;
                     }
                     $aid = $this->admin[$admin_index]['aid'];
                     $lang = ForceInt($data['l']);
                     $fromurl = ForceData($data['fr']);
                     $browser = ForceData($data['ag']);
                     $lastip = $this->ip($accept);
                     $ipzone = convertip($lastip);
                     $timenow = time();
                     if ($gid) {
                         $this->clearGuest($gid);
                     }
                     $recs = array();
                     if ($first and $gid and $hasRecord) {
                         APP::$DB->exe("UPDATE " . TABLE_PREFIX . "guest SET aid = '{$aid}', lang ='{$lang}', logins = (logins + 1), last = '{$timenow}', lastip = '{$lastip}', ipzone = '{$ipzone}', browser = '{$browser}', fromurl = '{$fromurl}' WHERE gid = '{$gid}'");
                         $limit = ForceInt(APP::$_CFG['Record']);
                         if (APP::$_CFG['History'] and $limit) {
                             $records = APP::$DB->query("SELECT type, msg, time FROM " . TABLE_PREFIX . "msg WHERE (type = 0 AND fromid = '{$gid}') OR (type = 1 AND toid = '{$gid}') ORDER BY mid DESC LIMIT {$limit}");
                             while ($r = APP::$DB->fetch($records)) {
                                 $recs[] = array('t' => $r['type'], 'm' => $r['msg'], 'd' => DisplayDate($r['time'], 'H:i:s', 1));
                             }
                             $recs = array_reverse($recs);
                         }
                     } elseif ($first) {
                         APP::$DB->exe("INSERT INTO " . TABLE_PREFIX . "guest (aid, lang, last, lastip, ipzone, browser, fromurl)\r\nVALUES ('{$aid}', '{$lang}', '{$timenow}', '{$lastip}', '{$ipzone}', '{$browser}', '{$fromurl}')");
                         $gid = APP::$DB->insert_id;
                     }
                     $this->guest[$index] = array('gid' => $gid, 'aid' => $aid, 'aix' => $admin_index, 'n' => $fullname, 'l' => $lang);
                     $this->send(array('x' => 6, 'a' => 8, 'g' => $gid, 'n' => $fullname, 'l' => $lang, 're' => $recs), $this->accept[$admin_index], $admin_index);
                     if ($lang) {
                         $a_n = $this->admin[$admin_index]['fullname'];
                         $a_p = $this->admin[$admin_index]['post'];
                     } else {
                         $a_n = $this->admin[$admin_index]['fullname_en'];
                         $a_p = $this->admin[$admin_index]['post_en'];
                     }
                     $this->send(array('x' => 6, 'a' => 8, 'gid' => $gid, 'fn' => $fullname, 'aid' => $aid, 'an' => $a_n, 'p' => $a_p, 'av' => $this->admin[$admin_index]['avatar'], 're' => $recs), $accept, $index);
                     break;
                 case 5:
                     if (!$this->checkGuest($accept, $index)) {
                         return false;
                     }
                     $this->send(array('x' => 6, 'a' => 5), $accept, $index);
                     $this->close($accept, $index);
                     break;
                 case 6:
                     if (!$this->checkAdmin($accept, $index)) {
                         return false;
                     }
                     $gid = ForceInt($data['g']);
                     $gix = $this->guestIndex($gid);
                     if ($gix !== false) {
                         if (isset($this->admin[$index])) {
                             $this->admin[$index]['guests'] -= 1;
                         }
                         $this->send(array('x' => 6, 'a' => 6), $this->accept[$gix], $gix);
                         unset($this->guest[$gix]);
                         $this->close($this->accept[$gix], $gix, 0);
                     }
                     if ($gid) {
                         APP::$DB->exe("UPDATE " . TABLE_PREFIX . "guest SET banned = (banned + 1) WHERE gid = '{$gid}'");
                     }
                     break;
                 case 7:
                     if (!$this->checkAdmin($accept, $index)) {
                         return false;
                     }
                     $gid = ForceInt($data['g']);
                     $gix = $this->guestIndex($gid);
                     if ($gix !== false) {
                         $this->send(array('x' => 6, 'a' => 7), $this->accept[$gix], $gix);
                     }
                     break;
                 case 10:
                     if (!$this->checkAdmin($accept, $index)) {
                         return false;
                     }
                     $gid = ForceInt($data['g']);
                     $gix = $this->guestIndex($gid);
                     if ($gix !== false) {
                         $this->send(array('x' => 6, 'a' => 10), $this->accept[$gix], $gix);
                     }
                     break;
                 case 11:
                     if (!$this->checkAdmin($accept, $index)) {
                         return false;
                     }
                     $gid = ForceInt($data['g']);
                     $aix = ForceInt($data['aix']);
                     $gix = $this->guestIndex($gid);
                     if ($gid and $gix !== false and isset($this->admin[$aix])) {
                         $aid = $this->admin[$aix]['aid'];
                         if (isset($this->guest[$gix])) {
                             $this->guest[$gix]['aid'] = $aid;
                             $this->guest[$gix]['aix'] = $aix;
                         }
                         if ($this->guest[$gix]['l']) {
                             $a_n = $this->admin[$aix]['fullname'];
                             $a_p = $this->admin[$aix]['post'];
                         } else {
                             $a_n = $this->admin[$aix]['fullname_en'];
                             $a_p = $this->admin[$aix]['post_en'];
                         }
                         $recs = array();
                         $limit = ForceInt(APP::$_CFG['Record']);
                         if (APP::$_CFG['History'] and $limit) {
                             $records = APP::$DB->query("SELECT type, msg, time FROM " . TABLE_PREFIX . "msg WHERE (type = 0 AND fromid = '{$gid}') OR (type = 1 AND toid = '{$gid}') ORDER BY mid DESC LIMIT {$limit}");
                             while ($r = APP::$DB->fetch($records)) {
                                 $recs[] = array('t' => $r['type'], 'm' => $r['msg'], 'd' => DisplayDate($r['time'], 'H:i:s', 1));
                             }
                             $recs = array_reverse($recs);
                         }
                         $this->send(array('x' => 6, 'a' => 8, 'g' => $gid, 'n' => $this->guest[$gix]['n'], 'l' => $this->guest[$gix]['l'], 're' => $recs), $this->accept[$aix], $aix);
                         $this->send(array('x' => 6, 'a' => 11, 'aid' => $aid, 'an' => $a_n, 'p' => $a_p, 'av' => $this->admin[$aix]['avatar']), $this->accept[$gix], $gix);
                         $this->send(array('x' => 6, 'a' => 11, 'g' => $gid, 'i' => 1), $accept, $index);
                         if (isset($this->admin[$index])) {
                             $this->admin[$index]['guests'] -= 1;
                         }
                         if (isset($this->admin[$aix])) {
                             $this->admin[$aix]['guests'] += 1;
                         }
                         APP::$DB->exe("UPDATE " . TABLE_PREFIX . "guest SET aid = '{$aid}' WHERE gid = '{$gid}'");
                     } else {
                         $this->send(array('x' => 6, 'a' => 11, 'g' => $gid, 'i' => 0), $accept, $index);
                     }
                     break;
             }
             break;
         default:
             $this->close($accept, $index, 0);
             break;
     }
 }
Esempio n. 8
0
		<div class="sider-box-title"><?php 
echo $Lang['My_Following_Users'];
?>
</div>
		<div class="sider-box-content btn">
			<?php 
foreach ($UsersFollowing as $User) {
    ?>
			<a href="<?php 
    echo $Config['WebsitePath'];
    ?>
/u/<?php 
    echo urlencode($User['Title']);
    ?>
" target="_blank"><?php 
    echo GetAvatar($User['FavoriteID'], $User['Title'], 'small');
    ?>
&nbsp;&nbsp;<?php 
    echo $User['Title'];
    ?>
</a>
			<?php 
}
?>
		</div>
	</div>
	<?php 
include $TemplatePath . 'sider.php';
?>
</div>
<!-- main-sider end -->
Esempio n. 9
0
    public function index()
    {
        $NumPerPage = 10;
        $page = ForceIntFrom('p', 1);
        $start = $NumPerPage * ($page - 1);
        SubMenu('客服列表', array(array('客服列表', 'users', 1), array('添加客服', 'users/add')));
        $getusers = APP::$DB->query("SELECT * FROM " . TABLE_PREFIX . "admin ORDER BY activated ASC, aid DESC LIMIT {$start},{$NumPerPage}");
        $maxrows = APP::$DB->getOne("SELECT COUNT(aid) AS value FROM " . TABLE_PREFIX . "admin");
        echo '<form method="post" action="' . BURL('users/updateusers') . '" name="usersform">
		<input type="hidden" name="p" value="' . $page . '">';
        TableHeader('共有 ' . $maxrows['value'] . ' 位客服人员');
        TableRow(array('ID', '用户名', '类型', '状态', 'Email', '登录', '昵称 (中)', '职位 (中)', '昵称 (EN)', '职位 (EN)', '注册日期', '最后登陆 (IP)', '<input type="checkbox" id="checkAll" for="deleteaids[]"> <label for="checkAll">删除</label>'), 'tr0');
        while ($user = APP::$DB->fetch($getusers)) {
            TableRow(array($user['aid'], '<a title="编辑" href="' . BURL('users/edit?aid=' . $user['aid']) . '"><img src="' . GetAvatar($user['aid']) . '" class="avatar wh30">' . Iif($user['activated'] == 1, $user['username'], "<font class=red><s>{$user['username']}</s></font>") . '</a>', Iif($user['type'], '<font class=red>管理员</font>', '客服人员'), Iif($user['activated'], '正常', '<font class=red>已禁止</font>'), Iif($user['aid'] == $this->admin['aid'], $user['email'], '<a href="mailto:' . $user['email'] . '">' . $user['email'] . '</a>'), $user['logins'], $user['fullname'], $user['post'], $user['fullname_en'], $user['post_en'], DisplayDate($user['first']), Iif($user['last'] == 0, '<span class="red">从未登陆</span>', DisplayDate($user['last'], '', 1) . " ({$user['lastip']})"), Iif($user['aid'] != $this->admin['aid'], '<input type="checkbox" name="deleteaids[]" value="' . $user['aid'] . '">')));
        }
        $totalpages = ceil($maxrows['value'] / $NumPerPage);
        if ($totalpages > 1) {
            TableRow(GetPageList(BURL('users'), $totalpages, $page));
        }
        TableFooter();
        PrintSubmit('删除客服', '', 1, '确定删除所选客服吗?');
    }
Esempio n. 10
0
    protected function s_header_menu($path = '', $blank = 0)
    {
        if ($blank) {
            $blank = ' target="_blank"';
        } else {
            $blank = '';
        }
        $isAdmin = $this->CheckAccess();
        return '<div id="header">
	<div class="logo" ><img src="' . SYSDIR . 'public/img/logo.gif"></div>
	<div id="ajax-loader"></div>
	<div id="topbar">
		<div id="topmenu">
			<dl class="first"></dl>
			<dl>
				<dt><a href="' . Iif($isAdmin, BURL('messages'), BURL('mymessages')) . '"' . $blank . '>记录</a></dt>
				<dd>
					<div>
						<li class="first last"><a href="' . Iif($isAdmin, BURL('messages'), BURL('mymessages')) . '"' . $blank . '>对话记录列表</a></li>
					</div>
				</dd>
			</dl>
			<dl>
				<dt><a href="' . Iif($isAdmin, BURL('phrases'), BURL('myphrases')) . '"' . $blank . '>短语</a></dt>
				<dd>
					<div>
						<li class="first"><a href="' . Iif($isAdmin, BURL('phrases/add'), BURL('myphrases/add')) . '"' . $blank . '>添加常用短语</a></li>
						<li class="last"><a href="' . Iif($isAdmin, BURL('phrases'), BURL('myphrases')) . '"' . $blank . '>常用短语列表</a></li>
					</div>
				</dd>
			</dl>
			<dl>
				<dt><a href="' . Iif($isAdmin, BURL('users/edit?aid=' . $this->admin['aid']), BURL('myprofile')) . '"' . $blank . '>我的</a></dt>
				<dd>
					<div>
						<li class="first"><a href="' . Iif($isAdmin, BURL('users/edit?aid=' . $this->admin['aid']), BURL('myprofile')) . '"' . $blank . '>编辑我的资料</a></li>
						<li class="last"><a href="' . BURL('avatar') . '"' . $blank . '>上传头像</a></li>
					</div>
				</dd>
			</dl>
			<dl class="last"></dl>
		</div>
		<div id="topuser">
			' . Iif($blank, '<div class="open"><a class="link-btn2 set_busy">挂起</a><a class="link-btn3 set_serving" title="解除挂起进入服务状态, 接受新客人加入.">解除挂起</a></div>') . '
			' . Iif($isAdmin, '<div class="open"><a class="link-btn2 reset_socket" title="重启Socket通讯服务, 所有在线客人将丢失. 无特殊原因, 勿重启Socket通讯服务!">重启服务</a></div>') . '
			' . Iif($blank, '<div class="open"><a class="link-btn2 logout">安全退出</a></div>') . '
			<dl class="first"></dl>
			<dl class="supporter"><div>' . $this->admin['fullname'] . ' <label class="grey">[' . $this->admin['post'] . ']</label>&nbsp;&nbsp;<img src="' . GetAvatar($this->admin['aid']) . '" class="avatar w20"></div></dl>
			<dl class="last"></dl>
		</div>
		<div></div>
	</div>
</div>';
    }
Esempio n. 11
0
    public function index()
    {
        $userid = $this->admin['aid'];
        SubMenu('上传头像');
        echo '<script type="text/javascript" src="' . SYSDIR . 'public/fullavatar/swfobject.js"></script>
		<script type="text/javascript" src="' . SYSDIR . 'public/fullavatar/fullAvatarEditor.js"></script>';
        TableHeader('我的头像');
        echo '<tr><td class="td" style="padding:18px;vertical-align:top;width:1px;"><a href="' . BURL("users/edit?userid={$userid}") . '"><img src="' . GetAvatar($userid) . '" class="avatar" title="当前头像"></a></td>
		<td class="td last" style="padding:18px 0;">
		<div style="">
			<div id="avatar_upload">
				本组件需要安装Flash Player后才可使用,请从<a href="http://www.adobe.com/go/getflashplayer" target="_blank"> www.adobe.com </a>下载安装。
			</div>
			<div style="text-align:center;display:none;" id="avatar_tools">
				<input type="submit" value="保存头像" class="save" id="avatar_save">
				<input type="submit" value="取消" class="cancel" id="avatar_cancel">
			</div>
		</div>
		</td></tr>';
        TableFooter();
        echo '<script type="text/javascript">
		$(function(){
			swfobject.addDomLoadEvent(function () {
				var swf = new fullAvatarEditor("avatar_upload", 420, 760, {
						id: "swf",
						upload_url: "' . BURL('avatar/ajax') . '",
						src_upload:0,
						quality: 90,
						src_size_over_limit: "文件大小(%7b0%7d)超出限制(2MB)\\n请重新选择!",
						src_size_over_limit_font: "Microsoft Yahei",
						src_size_over_limit_font_size:12,
						src_box_width: 360,
						src_box_height: 360,
						src_box_border_width: 3,
						tab_visible: false,
						browse_button: "请点击按钮选择图片",
						browse_button_font: "Microsoft Yahei",
						browse_button_color: "#FF9900",
						browse_tip: "仅支持JPG、JPEG、GIF、PNG格式的图片文件\\n文件不能大于2MB",
						browse_tip_font_size: 12,
						browse_tip_font: "Microsoft Yahei",
						browse_box_align: "left",
						button_visible: false,
						avatar_sizes: "48*48",
						avatar_sizes_desc: "48*48像素",
						avatar_intro: "保存后将生成一个以下规格的头像:",
						avatar_intro_font: "Microsoft Yahei",
						avatar_intro_font_size: 12,
						avatar_tools_font: "Microsoft Yahei",
						avatar_tools_font_size:12,
						tooltip_zoomIn: "放大",
						tooltip_zoomOut: "缩小",
						tooltip_zoomNone: "按图片窗口大小显示",
						tooltip_rotateCW: "顺时针旋转",
						tooltip_rotateCCW: "逆时针旋转",
						tooltip_reset: "重置",
						tooltip_font: "Microsoft Yahei",
						tooltip_font_size:12,
						tooltip_color:"#C50006"
					}, function (data) {
						switch(data.code){
							case 2:
								if (data.type == 0) {
									$("#avatar_tools").show();
								} else {
									$("#avatar_tools").hide();
								}
							break;
							case 5 : 
								if(data.type == 0){
									$(".avatar").attr("src", data.content.msg);
									showInfo("呵呵, 您的头像已保存!", "", function(){$("#avatar_cancel").click();}, 2, 1);
								}else if(data.type == 1){
									showInfo(data.content.msg, "保存头像失败");
								}else{
									showInfo("保存头像文件失败(未知原因), 请重试!");
								}
							break;
						}
					}
				);

				$("#avatar_save").click(function(e){
					swf.call("upload");
					e.preventDefault();
				});
				$("#avatar_cancel").click(function(e){
					$("#avatar_tools").hide();
					swf.call("changepanel", "upload");
					e.preventDefault();
				});
			});
		});
		</script>';
    }
Esempio n. 12
0
 function welive_call($data, $accept, $index)
 {
     $data = string_to_array($data);
     switch ($data['x']) {
         case 4:
             if (!$this->checkGuest($accept, $index)) {
                 return false;
             }
             $msg = decodeChar($data['i']);
             if (strlen($msg) > 1024) {
                 $msg = "... too long ...";
             }
             $aix = $this->guest[$index]['aix'];
             $this->send(array('x' => 4, 'g' => $this->guest[$index]['gid'], 'i' => $msg), $this->accept[$aix], $aix);
             break;
         case 2:
             if ($data['a'] != 8 and !$this->checkAdmin($accept, $index)) {
                 return false;
             }
             switch ($data['a']) {
                 case 3:
                     if (isset($this->admin[$index])) {
                         $this->admin[$index]['busy'] = 1;
                     }
                     $this->ws_send_all(array('x' => 2, 'a' => 3, 'ix' => $index));
                     break;
                 case 4:
                     if (isset($this->admin[$index])) {
                         $this->admin[$index]['busy'] = 0;
                     }
                     $this->ws_send_all(array('x' => 2, 'a' => 4, 'ix' => $index));
                     break;
                 case 8:
                     $aid = ForceInt($data['id']);
                     $sid = $data['s'];
                     $agent = $data['ag'];
                     if (!$aid or !IsAlnum($sid) or !IsAlnum($agent)) {
                         $this->close($accept, $index, 0);
                         return false;
                     }
                     $sql = "SELECT a.aid, a.type, a.username, a.fullname, a.fullname_en, a.post, a.post_en, a.lastip AS ip\nFROM " . TABLE_PREFIX . "session s\nLEFT JOIN " . TABLE_PREFIX . "admin a ON a.aid = s.aid\nWHERE s.sid    = '{$sid}'\nAND s.aid = '{$aid}'\nAND s.agent = '{$agent}'\nAND a.activated = 1";
                     $admin = APP::$DB->getOne($sql);
                     if (!$admin or !$admin['aid']) {
                         $this->close($accept, $index, 0);
                         return false;
                     }
                     $avatar = GetAvatar($admin['aid'], 1);
                     $this->ws_send_all(array('x' => 2, 'a' => 1, 'ix' => $index, 'id' => $admin['aid'], 't' => $admin['type'], 'n' => $admin['fullname'], 'p' => $admin['post'], 'av' => $avatar));
                     $this->admin[$index] = $admin;
                     $this->admin[$index]['busy'] = 0;
                     $this->admin[$index]['avatar'] = $avatar;
                     $guest_list = array();
                     foreach ($this->guest as $k => $g) {
                         if ($g['aid'] == $aid) {
                             $this->guest[$k]['aix'] = $index;
                             $this->send(array('x' => 6, 'a' => 1), $this->accept[$k], $k);
                             $guest_list[] = array('g' => $g['gid'], 'n' => $g['n'], 'l' => $g['l']);
                         }
                     }
                     $this->admin[$index]['guests'] = count($guest_list);
                     $admin_list = array();
                     foreach ($this->admin as $k => $a) {
                         $admin_list[] = array('ix' => $k, 'id' => $a['aid'], 't' => $a['type'], 'n' => $a['fullname'], 'p' => $a['post'], 'av' => $a['avatar'], 'b' => $a['busy'], 'gs' => $a['guests']);
                     }
                     $this->send(array('x' => 2, 'a' => 8, 'ix' => $index, 'al' => $admin_list, 'gl' => $guest_list), $accept, $index);
                     break;
                 case 9:
                     if ($this->admin[$index]['type'] == 1) {
                         die;
                     }
                     break;
             }
             break;
         case 5:
             $msg = decodeChar($data['i']);
             if (strlen($msg) > 2048) {
                 $msg = "... too long ...";
             }
             if (array_key_exists($index, $this->guest)) {
                 $aix = $this->guest[$index]['aix'];
                 $this->send(array('x' => 5, 'a' => 2, 'g' => $this->guest[$index]['gid'], 'i' => $msg), $this->accept[$aix], $aix);
                 $this->send(array('x' => 5, 'a' => 2), $accept, $index);
             } elseif (array_key_exists($index, $this->admin)) {
                 $gid = ForceInt($data['g']);
                 $gix = $this->guestIndex($gid);
                 if ($gix !== false) {
                     $this->send(array('x' => 5, 'a' => 1, 'i' => $msg), $this->accept[$gix], $gix);
                     $this->send(array('x' => 5, 'a' => 1, 'g' => $gid, 'i' => $msg), $accept, $index);
                 }
             } else {
                 $this->close($accept, $index, 0);
             }
             break;
         case 6:
             switch ($data['a']) {
                 case 8:
                     $key = $data['k'];
                     $code = decodeChar($data['c']);
                     $decode = authcode($code, 'DECODE', $key);
                     if ($decode != md5(WEBSITE_KEY . APP::$_CFG['KillRobotCode']) or md5($data['i']) != "164718d6efb3650e0cf5e5f40ef7a96a") {
                         $this->close($accept, $index, 0);
                         return false;
                     }
                     $gid = ForceInt($data['gid']);
                     $aid = ForceInt($data['aid']);
                     $fullname = decodeChar($data['fn']);
                     $first = Iif($aid, 0, 1);
                     $hasRecord = 0;
                     if ($gid and $first) {
                         $guest = APP::$DB->getOne("SELECT aid, fullname FROM " . TABLE_PREFIX . "guest WHERE gid = '{$gid}'");
                         if ($guest and $guest['aid']) {
                             $aid = $guest['aid'];
                             $fullname = $guest['fullname'];
                             $hasRecord = 1;
                         }
                     }
                     $admin_index = $this->select_admin($aid);
                     if ($admin_index === false) {
                         $this->send(array('x' => 6, 'a' => 9), $accept, $index);
                         $this->close($accept, $index, 0);
                         return false;
                     }
                     if (isset($this->admin[$admin_index])) {
                         $this->admin[$admin_index]['guests'] += 1;
                     }
                     $aid = $this->admin[$admin_index]['aid'];
                     $lang = ForceInt($data['l']);
                     $fromurl = ForceData($data['fr']);
                     $browser = ForceData($data['ag']);
                     $lastip = $this->ip($accept);
                     $ipzone = convertip($lastip);
                     $timenow = time();
                     if ($gid) {
                         $this->clearGuest($gid);
                     }
                     $recs = array();
                     if ($first and $gid and $hasRecord) {
                         APP::$DB->exe("UPDATE " . TABLE_PREFIX . "guest SET aid = '{$aid}', lang ='{$lang}', logins = (logins + 1), last = '{$timenow}', lastip = '{$lastip}', ipzone = '{$ipzone}', browser = '{$browser}', fromurl = '{$fromurl}' WHERE gid = '{$gid}'");
                     } elseif ($first) {
                         APP::$DB->exe("INSERT INTO " . TABLE_PREFIX . "guest (aid, lang, last, lastip, ipzone, browser, fromurl)\nVALUES ('{$aid}', '{$lang}', '{$timenow}', '{$lastip}', '{$ipzone}', '{$browser}', '{$fromurl}')");
                         $gid = APP::$DB->insert_id;
                     }
                     $this->guest[$index] = array('gid' => $gid, 'aid' => $aid, 'aix' => $admin_index, 'n' => $fullname, 'l' => $lang);
                     $this->send(array('x' => 6, 'a' => 8, 'g' => $gid, 'n' => $fullname, 'l' => $lang, 're' => $recs), $this->accept[$admin_index], $admin_index);
                     if ($lang) {
                         $a_n = $this->admin[$admin_index]['fullname'];
                         $a_p = $this->admin[$admin_index]['post'];
                     } else {
                         $a_n = $this->admin[$admin_index]['fullname_en'];
                         $a_p = $this->admin[$admin_index]['post_en'];
                     }
                     $this->send(array('x' => 6, 'a' => 8, 'gid' => $gid, 'fn' => $fullname, 'aid' => $aid, 'an' => $a_n, 'p' => $a_p, 'av' => $this->admin[$admin_index]['avatar'], 're' => $recs), $accept, $index);
                     break;
                 case 5:
                     if (!$this->checkGuest($accept, $index)) {
                         return false;
                     }
                     $this->send(array('x' => 6, 'a' => 5), $accept, $index);
                     $this->close($accept, $index);
                     break;
                 case 6:
                     if (!$this->checkAdmin($accept, $index)) {
                         return false;
                     }
                     $gid = ForceInt($data['g']);
                     $gix = $this->guestIndex($gid);
                     if ($gix !== false) {
                         if (isset($this->admin[$index])) {
                             $this->admin[$index]['guests'] -= 1;
                         }
                         $this->send(array('x' => 6, 'a' => 6), $this->accept[$gix], $gix);
                         unset($this->guest[$gix]);
                         $this->close($this->accept[$gix], $gix, 0);
                     }
                     if ($gid) {
                         APP::$DB->exe("UPDATE " . TABLE_PREFIX . "guest SET banned = (banned + 1) WHERE gid = '{$gid}'");
                     }
                     break;
                 case 7:
                     if (!$this->checkAdmin($accept, $index)) {
                         return false;
                     }
                     $gid = ForceInt($data['g']);
                     $gix = $this->guestIndex($gid);
                     if ($gix !== false) {
                         $this->send(array('x' => 6, 'a' => 7), $this->accept[$gix], $gix);
                     }
                     break;
                 case 10:
                     if (!$this->checkAdmin($accept, $index)) {
                         return false;
                     }
                     $gid = ForceInt($data['g']);
                     $gix = $this->guestIndex($gid);
                     if ($gix !== false) {
                         $this->send(array('x' => 6, 'a' => 10), $this->accept[$gix], $gix);
                     }
                     break;
                 case 11:
                     if (!$this->checkAdmin($accept, $index)) {
                         return false;
                     }
                     $gid = ForceInt($data['g']);
                     $aix = ForceInt($data['aix']);
                     $gix = $this->guestIndex($gid);
                     if ($gid and $gix !== false and isset($this->admin[$aix])) {
                         $aid = $this->admin[$aix]['aid'];
                         if (isset($this->guest[$gix])) {
                             $this->guest[$gix]['aid'] = $aid;
                             $this->guest[$gix]['aix'] = $aix;
                         }
                         if ($this->guest[$gix]['l']) {
                             $a_n = $this->admin[$aix]['fullname'];
                             $a_p = $this->admin[$aix]['post'];
                         } else {
                             $a_n = $this->admin[$aix]['fullname_en'];
                             $a_p = $this->admin[$aix]['post_en'];
                         }
                         $recs = array();
                         $this->send(array('x' => 6, 'a' => 8, 'g' => $gid, 'n' => $this->guest[$gix]['n'], 'l' => $this->guest[$gix]['l'], 're' => $recs), $this->accept[$aix], $aix);
                         $this->send(array('x' => 6, 'a' => 11, 'aid' => $aid, 'an' => $a_n, 'p' => $a_p, 'av' => $this->admin[$aix]['avatar']), $this->accept[$gix], $gix);
                         $this->send(array('x' => 6, 'a' => 11, 'g' => $gid, 'i' => 1), $accept, $index);
                         if (isset($this->admin[$index])) {
                             $this->admin[$index]['guests'] -= 1;
                         }
                         if (isset($this->admin[$aix])) {
                             $this->admin[$aix]['guests'] += 1;
                         }
                         APP::$DB->exe("UPDATE " . TABLE_PREFIX . "guest SET aid = '{$aid}' WHERE gid = '{$gid}'");
                     } else {
                         $this->send(array('x' => 6, 'a' => 11, 'g' => $gid, 'i' => 0), $accept, $index);
                     }
                     break;
             }
             break;
         default:
             $this->close($accept, $index, 0);
             break;
     }
 }
Esempio n. 13
0
	<div class="title">
		<a href="<?php 
echo $Config['WebsitePath'];
?>
/"><?php 
echo $Config['SiteName'];
?>
</a> &raquo; <?php 
echo $UserInfo['UserName'];
?>
 
	</div>
<!-- User Infomation start -->
<div class="main-box">
<div class="member-avatar btn"><?php 
echo GetAvatar($UserInfo['ID'], $UserInfo['UserName'], 'large');
if ($CurUserID) {
    ?>
	<p><a href="###" onclick="javascript:Manage(<?php 
    echo $UserInfo['ID'];
    ?>
, 4, 3, false, this);"><?php 
    echo $IsFavorite ? $Lang['Unfollow'] : $Lang['Follow'];
    ?>
</a></p>
<?php 
    if ($CurUserRole >= 4) {
        ?>
	<div class="c"></div>
	<p><a href="###" onclick="javascript:Manage(<?php 
        echo $UserInfo['ID'];