Пример #1
0
 public function getContent()
 {
     // User is logged in
     if (LOGGED) {
         $this->subcodename = 'logged';
         $tpl = new PHPTAL('blocks/user_panel/logged.html');
         $tpl->user = User::format(User::$id, User::$nickname, User::$groupId);
         $pm_item = User::$pmNew ? array(t('Messages <strong>(New: %new)</strong>', array('%new' => $user->pm_new)), 'pm/inbox') : array(t('Messages'), 'pm');
         $tpl->items = items(array($pm_item[0] => HREF . $pm_item[1], t('Administration') => HREF . 'admin', t('Edit profile') => HREF . 'edit_profile', t('Log out') => HREF . 'logout'));
         return $tpl->execute();
     } else {
         $err = new Error();
         $note = new Notifier('note-user_panel');
         $this->subcodename = 'not_logged';
         $form = array('logname' => null, 'password' => null);
         if ($_POST['login'] && $_POST['user_panel']) {
             $form['logname'] = $_POST['logname-session'] ? filter($_POST['logname-session'], 100) : '';
             $form['password'] = $_POST['password-session'] ? $_POST['password-session'] : '';
             $err->setError('logname_empty', t('Logname field is required.'))->condition(!$form['logname']);
             $err->setError('logname_not_exists', t('Entered logname is not registered.'))->condition(!User::loginNameRegistered($form['logname']));
             $err->setError('password_empty', t('Password field is required.'))->condition(!$form['password']);
             $err->setError('password_incorrect', t('ERROR_PASS_INCORRECT'))->condition($form['password'] && !User::loginPasswordCorrect($form['password']));
             if ($err->noErrors()) {
                 redirect('./');
             } else {
                 $note->error($err->toArray());
             }
         }
         $tpl = new PHPTAL('blocks/user_panel/not_logged.html');
         $tpl->note = $note;
         $tpl->form = $form;
         $tpl->err = $err->toArray();
         return $tpl->execute();
     }
 }
Пример #2
0
function users($url, $key, $count = 20)
{
    global $users;
    $url = sprintf('http://feeds.delicious.com/v2/rss/url/%s?count=%d', md5($url), $count);
    foreach (items($url) as $item) {
        $user = (string) current($item->xpath('dc:creator'));
        $users[$user]++;
    }
}
Пример #3
0
    public function getContent()
    {
        global $sql;
        $stmt = $sql->setCache('new_users')->query('
			SELECT id, nickname, registered
			FROM ' . DB_PREFIX . 'users
			ORDER BY id DESC
			LIMIT 10');
        if ($stmt) {
            $items = array();
            while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
                $items[$row['nickname']] = array(HREF . 'profile/' . $row['id'] . '/' . clean_url($row['nickname']), clock($row['registered']));
            }
            return items($items);
        } else {
            return t('There is no content to display.');
        }
    }
Пример #4
0
    public function getContent()
    {
        global $sql;
        $stmt = $sql->setCache('news_categories')->query('
			SELECT *
			FROM ' . DB_PREFIX . 'news_categories
			ORDER BY name
			LIMIT 10');
        if ($stmt) {
            $items = array();
            while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
                $items[$row['name'] . ' (' . $row['entries'] . ')'] = array(HREF . 'news/category/' . $row['id'] . '/' . clean_url($row['name']), $row['description'] ? $row['description'] : t('Entries marked as %category', array('%category' => $row['name'])));
            }
            return $this->content = items($items);
        } else {
            return $this->content = t('There is no content to display.');
        }
    }
Пример #5
0
    ini_set('error_prepend_string', null);
    ini_set('error_append_string', null);
}
$users = new usersMenus();
if (!$users->AsMailBoxAdministrator) {
    $tpl = new templates();
    $error = $tpl->javascript_parse_text("{ERROR_NO_PRIVS}");
    echo "alert('{$error}')";
    die;
}
if (isset($_GET["list-domains"])) {
    list_domains();
    exit;
}
if (isset($_GET["items-list"])) {
    items();
    exit;
}
if (isset($_POST["DeleteRealMailBox"])) {
    DeleteRealMailBox();
    exit;
}
page();
function page()
{
    $tpl = new templates();
    $sock = new sockets();
    $ID = $_GET["ID"];
    if (!is_numeric($ID)) {
        $ID = 0;
    }
Пример #6
0
	include_once('ressources/class.dansguardian.inc');
	include_once('ressources/class.squid.inc');
	include_once('ressources/class.ActiveDirectory.inc');
	
	
	
$usersmenus=new usersMenus();
if(!$usersmenus->AsDansGuardianAdministrator){
	$tpl=new templates();
	$alert=$tpl->_ENGINE_parse_body('{ERROR_NO_PRIVS}');
	echo "<H2>$alert</H2>";
	die();	
}

if(isset($_GET["popup"])){popup();exit;}
if(isset($_GET["list"])){items();exit;}
js();

function js(){
	$tpl=new templates();
	$page=CurrentPageName();
	$title=$tpl->_ENGINE_parse_body("{browsers}");
	$html="YahooWinBrowse('650','$page?popup=yes&ShowOnly={$_GET["ShowOnly"]}','$title')";
	echo $html;
	
}

function popup(){
	
	$page=CurrentPageName();
	$tpl=new templates();
Пример #7
0
<div class="left">

<?php 
echo '<ul class="letters">';
foreach (array_merge(range('A', 'Z'), array('0-9')) as $l) {
    echo '<li' . (isset($_GET['firstchar']) && $_GET['firstchar'] == $l ? ' class="active"' : '') . '><a href="' . tlink('stores', 'firstchar=' . $l) . '">' . $l . '</a></li>';
}
echo '<li><a href="' . tlink('stores') . '">ALL</a></li>';
echo '</ul>';
echo '<div class="title">
  <span style="color: #efefef;">' . ($items = (int) have_items(array('firstchar' => isset($_GET['firstchar']) ? $_GET['firstchar'] : ''))) . '</span> Stores/Brands
</div>';
if ($items) {
    foreach (items(array('firstchar' => isset($_GET['firstchar']) ? $_GET['firstchar'] : '')) as $item) {
        echo '<article class="array_item">

<div class="table">

<div class="left">
<img src="' . store_avatar($item->image) . '" alt="">
<span class="rating"><span style="width:' . $item->stars * 16 . 'px;"></span></span>
<a href="' . $item->reviews_link . '">' . $item->reviews . ' reviews</a>
</div>

<div class="right">
<a href="' . $item->link . '" class="title">' . $item->name . '</a>
<div class="description">' . (!empty($item->description) ? nl2br($item->description) : 'no description') . '</div>

<ul class="details">
<li>Coupons/Deals: <b>' . $item->coupons . '</b></li>';
        if (theme_has_products()) {
Пример #8
0
<?php
$GLOBALS["ICON_FAMILY"]="SYSTEM";
//ini_set('display_errors', 1);ini_set('error_reporting', E_ALL);ini_set('error_prepend_string',null);ini_set('error_append_string',null);
if(isset($_GET["verbose"])){$GLOBALS["VERBOSE"]=true;ini_set('display_errors', 1);ini_set('error_reporting', E_ALL);ini_set('error_prepend_string',null);ini_set('error_append_string',null);}
include_once('ressources/class.templates.inc');
include_once('ressources/class.ldap.inc');
include_once('ressources/class.users.menus.inc');
include_once('ressources/class.mysql.shorewall.inc');
include_once('ressources/class.system.nics.inc');
$usersmenus=new usersMenus();
if(!$usersmenus->AsArticaAdministrator){die();}	
if(isset($_GET["item-js"])){item_js();exit;}
if(isset($_GET["item-popup"])){item_popup();exit;}
if(isset($_GET["items"])){items();exit;}
if(isset($_GET["delete-js"])){items_delete_js();exit;}
if(isset($_POST["delete"])){items_delete();exit;}
if(isset($_GET["move-item-js"])){move_items_js();exit;}
if(isset($_POST["move-item"])){move_items();exit;}
if(isset($_POST["ID"])){save();exit;}
table();

function move_items_js(){
	$page=CurrentPageName();
	$tpl=new templates();
	header("content-type: application/x-javascript");
	$t=time();

$html="
var xSave$t= function (obj) {
	var results=obj.responseText;
	if(results.length>3){ alert(results); return; }
Пример #9
0
</ul>

<input type="text" value="' . $item->link . '" onclick="$(this).select();" />

</div>

</div>

</article>';
    if (me()) {
        echo '<a href="#" class="btn write_review"' . ($_SERVER['REQUEST_METHOD'] == 'POST' ? ' style="display: none;"' : '') . '>Write Review</a>';
        echo '<div' . ($_SERVER['REQUEST_METHOD'] != 'POST' ? ' style="display: none;"' : '') . '>' . write_review_form() . '</div>';
    }
    echo '<div class="text-tit" style="margin-top: 15px;">Reviews for ' . $item->name . ':</div>';
    if (have_items()) {
        foreach (items(array('orderby' => 'date desc')) as $review) {
            echo '<article class="array_item">

<div class="table">

<div class="left">
<img src="' . user_avatar($review->user_avatar) . '" alt="" style="width: 60px; height: 60px;" />
<span class="rating"><span style="width:' . $review->stars * 16 . 'px;"></span></span>
</div>

<div class="right">
<div class="title">' . $review->user_name . '</div>
<div class="time">Added ' . date('m/d/Y', $wdate = strtotime($review->date)) . ', ' . timeago($wdate, 'seconds') . ' ago</div>
<div class="description">' . $review->text . '</div>
</div>
Пример #10
0
/**
 * main function. checks for authorization and renders the
 * required admin section.
 */
function admin_main($authorised)
{
    echo "\n<div id=\"channel_admin\" class=\"frame\">";
    if ($authorised) {
        admin_menu();
        if (array_key_exists(CST_ADMIN_DOMAIN, $_REQUEST)) {
            switch ($_REQUEST[CST_ADMIN_DOMAIN]) {
                case CST_ADMIN_DOMAIN_FOLDER:
                    $show = folder_admin();
                    break;
                case CST_ADMIN_DOMAIN_CHANNEL:
                    $show = channel_admin();
                    break;
                case CST_ADMIN_DOMAIN_CONFIG:
                    $show = config_admin();
                    break;
                case CST_ADMIN_DOMAIN_ITEM:
                    $show = item_admin();
                    break;
                case CST_ADMIN_DOMAIN_PLUGINS:
                    $show = plugins_admin();
                    break;
                case CST_ADMIN_DOMAIN_THEMES:
                    $show = themes_admin();
                    break;
                case CST_ADMIN_DOMAIN_TAGS:
                    $show = tags_admin();
                    break;
                case CST_ADMIN_DOMAIN_PLUGIN_OPTIONS:
                    $show = plugin_options_admin();
                    break;
                case CST_ADMIN_DOMAIN_THEME_OPTIONS:
                    $show = theme_options_admin();
                    break;
                default:
                    break;
            }
        }
        if (array_key_exists(CST_ADMIN_VIEW, $_REQUEST) || isset($show)) {
            if (!isset($show)) {
                $show = $_REQUEST[CST_ADMIN_VIEW];
            }
            switch ($show) {
                case CST_ADMIN_DOMAIN_CONFIG:
                    config();
                    break;
                case CST_ADMIN_DOMAIN_CHANNEL:
                    channels();
                    break;
                case CST_ADMIN_DOMAIN_FOLDER:
                    folders();
                    break;
                case CST_ADMIN_DOMAIN_OPML:
                    opml();
                    break;
                case CST_ADMIN_DOMAIN_NONE:
                    break;
                case CST_ADMIN_DOMAIN_ITEM:
                    items();
                    break;
                case CST_ADMIN_DOMAIN_SYSINFO:
                    sysinfo();
                    break;
                case CST_ADMIN_DOMAIN_DASHBOARD:
                    dashboard();
                    break;
                case CST_ADMIN_DOMAIN_PLUGINS:
                    plugins();
                    break;
                case CST_ADMIN_DOMAIN_THEMES:
                    themes();
                    break;
                case CST_ADMIN_DOMAIN_TAGS:
                    tags();
                    break;
                case CST_ADMIN_DOMAIN_PLUGIN_OPTIONS:
                    plugin_options();
                    break;
                case CST_ADMIN_DOMAIN_THEME_OPTIONS:
                    theme_options();
                    break;
                default:
            }
        } else {
            if (true == getConfig('rss.config.defaultdashboard')) {
                dashboard();
            } else {
                channels();
            }
        }
        echo "\n<div class=\"clearer\"></div>\n";
    } else {
        rss_error(sprintf(__('<h1>Not Authorized!</h1>You are not authorized to access the administration interface. Please follow <a href="%s">this link</a> back to the main page. Have  a nice day!'), getPath()), RSS_ERROR_ERROR, true);
    }
    echo "</div>\n";
}
Пример #11
0
<?php

require_once "../config/mobi_web_constants.php";
require_once PAGE_HEADER;
$sms_instructions = new SMSInstructions(module("People Directory", "Search all or part of a name, email address, or phone number.", "dir", array("Keywords" => items("dir, ppl"), "For help" => items("dir [help]"), "Examples" => items("dir hockfield", "dir 6172531000&shy;", "ppl charles vest"))), module("Shuttle Schedule", "Get an up-to-the-minute schedule by shuttle name or two-letter abbreviation.", "bus", array("Keywords" => items("bus, shuttle"), "For help" => items("bus [help]"), "Examples" => items("bus ce", "bus cambridge east", "bus nw", "bus northwest", "bus bd", "bus boston daytime"), "Route codes" => items("Boston Daytime: BD", "Boston East: BE", "Boston West: BW", "Cambridge East: CE", "Cambridge West: CW", "Northwest Shuttle: NW", "Tech Shuttle: TS"))), module("Stellar", "Get course information and latest announcements by class number.", "cls", array("Keywords" => items("cls, class, stellar"), "For help" => items("cls [help]"), "Examples" => items("cls 6.002", "class 8.03", "stellar 18.06"))), module("Events Calendar", "Get the upcoming events on the MIT calendar.", "events", array("Keywords" => items("events", "cal", "calendar"), "Examples" => items("events", "cal 11pm"))), module("Emergency Info", "Get the latest status on campus emergencies.", "sos", array("Keywords" => items("sos", "emergency"), "Example" => items("sos"))), module("3Down", "Get the latest status on various campus services.", "3dwn", array("Keywords" => items("3dwn", "3down"), "Example" => items("3dwn"))));
if ($page->branch == "Basic" && isset($_REQUEST['module'])) {
    $module = $sms_instructions->getModule($_REQUEST['module']);
    require "{$page->branch}/module.html";
} else {
    require "{$page->branch}/index.html";
}
$page->output();
class SMSInstructions
{
    public $modules;
    public function __construct()
    {
        $this->modules = func_get_args();
    }
    public function getModule($encodedName)
    {
        foreach ($this->modules as $module) {
            if ($module->getEncodedName() == $encodedName) {
                return $module;
            }
        }
    }
}
class Module
{
    public $name;
Пример #12
0
    ?>
				</td>
			</tr>
			<tr bgcolor=#f0f0f0>
				<td style="height:10px;">
					<input type=submit name="Submit" value="Submit">
					<label><input type="checkbox" title="New Window" onclick="document.getElementById('form').target = this.checked ? '_blank' : 'output';"> New Window</label>
				</td>
			</tr>
			<tr>
				<td>
					<iframe src="" name="output" width="100%" height="100%" frameborder=0></iframe>
				</td>
			</tr>
		</table>
	</form>
	<?php 
} else {
    $db->debug = 1;
    $sys->stop(false);
    $_POST['sql'] = stripslashes($_POST['sql']);
    $r = @$db->getAll($_POST['sql']);
    if ($db->resid) {
        echo msg('eksekusi SQL telah berhasil dijalankan dengan affect: ' . items($db->Affected_rows(), 'row'), 'info');
    } else {
        echo msg('eksekusi SQL telah GAGAL dijalankan', 'danger');
    }
    if (count($r) > 0) {
        echo table($r, array_keys($r[0]));
    }
}
Пример #13
0
</div>

<div style="margin-bottom: 20px;">

<ul class="category">
<li class="active">Coupons</li>';
        if (theme_has_products()) {
            echo '<li><a href="' . get_update(array('page' => 1, 'type' => 'products')) . '">Products</a></li>';
        }
        echo '</ul>';
        if (!empty($category->description)) {
            echo '<article class="array_item category_box" style="border-top: 0;">' . $category->description . '</article>';
        }
        echo '</div>';
        if (results()) {
            foreach (items(array('orderby' => 'active desc')) as $item) {
                echo '<article class="array_item">

<div class="table">

<div class="left">
<img src="' . store_avatar($item->store_img) . '" alt="">
<span class="rating"><span style="width:' . $item->stars * 16 . 'px;"></span></span>
<a href="' . $item->store_reviews_link . '">' . $item->reviews . ' reviews</a>';
                echo !empty($item->cashback) ? '<span class="cashback-points" data-ttip="Great! Use it and you\'ll receive ' . $item->cashback . ' points.">' . $item->cashback . '</span> ' : '';
                echo '</div>

<div class="right">
<a href="' . $item->link . '" class="title">' . $item->title . '</a>
More coupons for <a href="' . $item->store_link . '">' . $item->store_name . '</a>
<div class="description">' . (!empty($item->description) ? nl2br($item->description) : 'no description') . '</div>
Пример #14
0
function tAdventure($start = 0, $pts = 0, $items = array(), $said = false, $name)
{
    if ($start == 0) {
        $rdat["locname"] = "Grand Hallway";
        $rdat["locdesc"] = "The grandest hallway of the entire mansion.";
        $rdat["isItems"] = false;
        $rdat["connectsLeft"] = true;
        $rdat["connectsLeftId"] = 1;
        $rdat["connectsRight"] = true;
        $rdat["connectsRightId"] = 5;
        $rdat["connectsStraight"] = false;
        $rdat["connectsBack"] = false;
    } elseif ($start == 1) {
        $rdat["locname"] = "Bedroom Hallway";
        $rdat["locdesc"] = "The hall with all of the bedrooms.";
        $rdat["isItems"] = true;
        $rdat["items"] = 1;
        $rdat["connectsLeft"] = true;
        $rdat["connectsLeftId"] = 2;
        $rdat["connectsRight"] = false;
        $rdat["connectsStraight"] = true;
        $rdat["connectsStraightId"] = 3;
        $rdat["connectsBack"] = true;
        $rdat["connectsBackId"] = 0;
    } elseif ($start == 2) {
        $rdat["locname"] = "TDLive's Room";
        $rdat["locdesc"] = "TDLive's bedroom.";
        $rdat["isItems"] = true;
        $rdat["items"] = 2;
        $rdat["connectsLeft"] = false;
        $rdat["connectsRight"] = false;
        $rdat["connectsStraight"] = false;
        $rdat["connectsBack"] = true;
        $rdat["connectsBackId"] = 1;
    } elseif ($start == 3) {
        $rdat["locname"] = "{$name}'s Room";
        $rdat["locdesc"] = "Your room!";
        $rdat["isItems"] = false;
        $rdat["connectsLeft"] = true;
        $rdat["connectsLeftId"] = 4;
        $rdat["connectsRight"] = false;
        $rdat["connectsStraight"] = false;
        $rdat["connectsBack"] = true;
        $rdat["connectsBackId"] = 1;
    } elseif ($start == 4) {
        $rdat["locname"] = "{$name}'s Bathroom";
        $rdat["locdesc"] = "Your bathroom!";
        $rdat["isItems"] = true;
        $rdat["items"] = 3;
        $rdat["connectsLeft"] = true;
        $rdat["connectsLeftId"] = 2;
        $rdat["connectsRight"] = false;
        $rdat["connectsStraight"] = false;
        $rdat["connectsBack"] = true;
        $rdat["connectsBackId"] = 3;
    } elseif ($start == 5) {
        $rdat["locname"] = "The Main Hallway";
        $rdat["locdesc"] = "Turn 'left' to start the real game.";
        $rdat["isItems"] = false;
        $rdat["items"] = null;
        $rdat["connectsLeft"] = true;
        $rdat["connectsLeftId"] = 6;
        $rdat["connectsRight"] = false;
        $rdat["connectsStraight"] = false;
        $rdat["connectsBack"] = true;
        $rdat["connectsBackId"] = 0;
    } elseif ($start == 6) {
        if (!$said) {
            echo "\n\nAs you close the door, you realize that \nyou are at the point of no return.\n\n";
        }
        $rdat["locname"] = "The Dungeon";
        $rdat["locdesc"] = "A very dark and dank room. You swear\nthat you can hear breathing in the distance.";
        $rdat["isItems"] = true;
        $rdat["items"] = 4;
        $rdat["connectsLeft"] = false;
        $rdat["connectsRight"] = false;
        $rdat["connectsStraight"] = true;
        $rdat["connectsStraightId"] = 7;
        $rdat["connectsBack"] = false;
    } elseif ($start == 7) {
        $rdat["locname"] = "Cell 1";
        $rdat["locdesc"] = "The first cell in the dungeon. You hear\nmany barks.";
        $rdat["isItems"] = true;
        $rdat["items"] = 5;
        $rdat["connectsLeft"] = false;
        $rdat["connectsRight"] = false;
        $rdat["connectsStraight"] = true;
        $rdat["connectsStraightId"] = 8;
        $rdat["connectsBack"] = true;
        $rdat["connectsBackId"] = 6;
    } elseif ($start == 8) {
        $rdat["locname"] = "Cell 2";
        $rdat["locdesc"] = "The second cell in the dungeon. You hear\nmany barks.";
        $rdat["isItems"] = false;
        $rdat["connectsLeft"] = false;
        $rdat["connectsRight"] = false;
        $rdat["connectsStraight"] = false;
        $rdat["connectsBack"] = true;
        $rdat["connectsBackId"] = 7;
    } else {
        die("Error in your save file; the location in it\nwas not found. If you are using a greater version\nof tAdventure than before (or, ahem, cheaters), you\nmay need to delete your save file (sorry) and start\nagain.");
    }
    $darkrooms = array(8);
    if (!$said) {
        echo $rdat["locname"] . "\n\n";
        echo $rdat["locdesc"] . "\n\n";
        if (!$rdat["isItems"]) {
            echo "There are no items in this room.\n";
        } else {
            if ($rdat['isItems']) {
                $itemdata = items($rdat["items"]);
                $taken = false;
                foreach ($itemus as $value) {
                    if ($value == $rdat["items"]) {
                        $taken = true;
                    }
                }
                if (!$taken) {
                    $name2 = $itemdata["name"];
                    $desc = $itemdata["desc"];
                    echo "There is a {$name2} in here!\n{$desc}\n";
                } else {
                    echo "There are no items in this room.";
                }
            }
        }
    }
    $cmd = cmd();
    if (!@isset($cmd) || $cmd == "") {
        tadventure($start, $pts, $items, true, $name);
    } elseif ($cmd == 'quit') {
        if (file_exists(".shocked.tmp")) {
            unlink(".shocked.tmp");
        }
        if (file_exists(".torch.tmp")) {
            unlink(".torch.tmp");
        }
        echo "Thanks for playing!\n";
        exit;
    } elseif ($cmd == 'save') {
        echo "Saving...\n";
        $fh = fopen("tadventure_save.txt", 'w') or tAdventure($start, $pts, $items, true, $name);
        fwrite($fh, "{$start}/{$pts}");
        foreach ($items as $value) {
            fwrite($fh, "/{$value}");
        }
        echo "Game saved!\n";
        tAdventure($start, $pts, $items, true, $name);
    } elseif ($cmd == "update") {
        system("wget --version > /dev/null", $wgetv);
        if (!$wgetv == 0) {
            echo "Error! wget is not installed!\n";
            tAdventure($start, $pts, $items, true);
        }
        echo "Checking the version...\n";
        system("wget -q https://raw.github.com/TDLive/tAdventure/master/version.txt -O version.txt");
        $fh = fopen("version.txt", "r");
        $version = fread($fh, fileSize("version.txt"));
        fclose($fh);
        if ($version == VERSION || $version < VERSION) {
            echo "Your version is too new/the latest!\n";
            tAdventure($start, $pts, $items, true, $name);
        } else {
            echo "Getting tAdventure...\n";
            system("wget -q https://raw.github.com/TDLive/tAdventure/master/adventure.php -O adventure.php");
            echo "Starting tAdventure...\n\n";
            system("php adventure.php", $exitcode);
            exit($exitcode);
        }
    } elseif ($cmd == "room") {
        echo "\n";
        tAdventure($start, $pts, $items);
    } elseif ($cmd == "left") {
        if ($rdat["connectsLeft"]) {
            foreach ($darkrooms as $value) {
                if ($rdat["connectsLeftId"] == $value) {
                    if (!file_exists(".torch.tmp")) {
                        echo "It's too dark to go down this way!\n";
                        tAdventure($start, $pts, $items, true, $name);
                    }
                }
            }
            tAdventure($rdat["connectsLeftId"], $pts, $items, false, $name);
        } else {
            echo "You can't go left.\n";
            tAdventure($start, $pts, $items, true, $name);
        }
    } elseif ($cmd == "right") {
        if ($rdat["connectsRight"]) {
            foreach ($darkrooms as $value) {
                if ($rdat["connectsRightId"] == $value) {
                    if (!file_exists(".torch.tmp")) {
                        echo "It's too dark to go down this way!\n";
                        tAdventure($start, $pts, $items, true, $name);
                    }
                }
            }
            tAdventure($rdat["connectsRightId"], $pts, $items, false, $name);
        } else {
            echo "You can't go right.\n";
            tAdventure($start, $pts, $items, true, $name);
        }
    } elseif ($cmd == "back") {
        if ($rdat["connectsBack"]) {
            foreach ($darkrooms as $value) {
                if ($rdat["connectsBackId"] == $value) {
                    if (!file_exists(".torch.tmp")) {
                        echo "It's too dark to go down this way!\n";
                        tAdventure($start, $pts, $items, true, $name);
                    }
                }
            }
            tAdventure($rdat["connectsBackId"], $pts, $items, false, $name);
        } else {
            echo "You can't go back.\n";
            tAdventure($start, $pts, $items, true, $name);
        }
    } elseif ($cmd == "straight") {
        if ($rdat["connectsStraight"]) {
            foreach ($darkrooms as $value) {
                if ($rdat["connectsStraightId"] == $value) {
                    if (!file_exists(".torch.tmp")) {
                        echo "It's too dark to go down this way!\n";
                        tAdventure($start, $pts, $items, true, $name);
                    }
                }
            }
            tAdventure($rdat["connectsStraightId"], $pts, $items, false, $name);
        } else {
            echo "You can't go straight.\n";
            tAdventure($start, $pts, $items, true, $name);
        }
    } elseif ($cmd == "pickup") {
        if (!$rdat['isItems']) {
            echo "There isn't anything I can pick up here.\n";
            tAdventure($start, $pts, $items, true, $name);
        } else {
            if ($rdat["items"] == 2) {
                if (!file_exists(".shocked.tmp")) {
                    echo "The moment you pick the computer up,\nit shocks you, and TDLive runs in to put it\nback on his desk.\n";
                    $fh = fopen(".shocked.tmp", 'w');
                    fclose($fh);
                } else {
                    echo "TDLive: SO YOU DIDN'T LEARN, HUH?!?\n";
                    echo "You: AAAAHHHHHHHHHHHHHHH\n";
                    echo "YOU ARE DEAD!\n";
                    unlink(".shocked.tmp");
                    sleep(5);
                    tAdventure(null, null, null, null, $name);
                }
                tAdventure($start, $pts, $items, true, $name);
            }
            foreach ($items as $value) {
                if ($value == $rdat["items"]) {
                    echo "You can't have two {$value}.\n";
                    tAdventure($start, $pts, $items, true, $name);
                }
            }
            $itemdata = items($rdat["items"]);
            $name1 = $itemdata["name"];
            $desc = $itemdata["desc"];
            echo "You picked up a {$name1}!\n";
            $items[] = $rdat["items"];
            tAdventure($start, $pts, $items, true, $name);
        }
    } elseif ($cmd == "version") {
        echo "This is TDLive tAdventure.\n";
        tAdventure($start, $pts, $items, true, $name);
    } elseif ($cmd == "inventory") {
        foreach ($items as $value) {
            $itemdat = items($value);
            $name2 = $itemdat["name"];
            $desc = $itemdat["desc"];
            echo "{$name2} - {$desc}\n";
        }
        tAdventure($start, $pts, $items, true, $name);
    } elseif ($cmd == "brush") {
        foreach ($items as $value) {
            if ($value == 3) {
                $can = true;
            }
        }
        if ($can && $start == 4) {
            echo "You brush your teeth. Your teeth feel minty.\n";
            tAdventure($start, $pts, $items, true, $name);
        } else {
            echo "You must posess the toothbrush and toothpaste\nand be in a bathroom to do this.\n";
            tAdventure($start, $pts, $items, true, $name);
        }
    } elseif ($cmd == "torch") {
        foreach ($items as $value) {
            if ($value == 4) {
                $can1 = true;
            } elseif ($value == 5) {
                $can2 = true;
            }
        }
        if (@$can1 && @$can2 && !file_exists(".torch.tmp")) {
            echo "You light up the torch and savor its\nlight.\n";
            $fh = fopen(".torch.tmp", "w");
            fclose($fh);
            tAdventure($start, $pts, $items, true, $name);
        } elseif (!@$can1 || !@$can2) {
            echo "You need the Torch and Matches to do this.\n";
            tAdventure($start, $pts, $items, true, $name);
        } elseif (file_exists('.torch.tmp')) {
            echo "Your torch is already lit.\n";
            tAdventure($start, $pts, $items, true, $name);
        }
    } elseif ($cmd == "laugh") {
        if (!$start == 2) {
            echo "There isn't anything to laugh at.\n";
        } else {
            echo "Haha. Octocats.\n";
        }
        tAdventure($start, $pts, $items, true, $name);
    } else {
        echo "I don't know what '{$cmd}' is!\n";
        tAdventure($start, $pts, $items, true, $name);
    }
}
Пример #15
0
   "events",
   array(
     "Keywords" => items("events", "cal", "calendar"),
     "Examples" => items("events", "cal 11pm"))),
  module("Emergency Info",
   "Get the latest status on campus emergencies.",
   "sos",
   array(
     "Keywords" => items("sos", "emergency"),
     "Example" => items("sos"))),
  module("3Down",
   "Get the latest status on various campus services.",
   "3dwn",
   array(
     "Keywords" => items("3dwn", "3down"),
     "Example" => items("3dwn")))
);

if($page->branch == "Basic" && isset($_REQUEST['module'])) {
  $module = $sms_instructions->getModule($_REQUEST['module']);
  require "$page->branch/module.html";
} else {
  require "$page->branch/index.html";
}

$page->output();


class SMSInstructions {
  
  public $modules;