Ejemplo n.º 1
0
 public function renderSidebar()
 {
     if (!$this->shouldRender()) {
         return;
     }
     startbox();
     echo getContent('sbWiki.' . $this->getCurrentPage());
     stopbox();
 }
Ejemplo n.º 2
0
 public function renderSidebar()
 {
     if ($this->shouldNotDisplay()) {
         return;
     }
     startbox();
     echo '<div class = "mumbleServerView"></div>';
     echo '<script src = "http://tydus.net/MumPI/viewer/resources/javascript/viewer.js"></script>';
     echo '<script type = "text/javascript">$.get("http://tydus.net/MumPI/viewer/ajax.getServerTree.php", {serverId: 1}, drawTree);</script>';
     echo '<div class = "server">';
     echo '<br /><p>Mumble is an open source, low-latency, high quality voice chat software primarily intended for use while gaming. <a href = "http://mumble.sourceforge.net/">Download Mumble.</a>';
     echo '<p><small><strong>Server address/label</strong>: mumble.westlan.co.uk<br /><strong>Port:</strong> 64738</small></p>';
     echo '</div>';
     stopbox('Mumble');
 }
 public function renderSidebar()
 {
     if ($this->shouldNotDisplay()) {
         return;
     }
     startbox();
     $event = Events::nextEvent();
     if ($event['seatingPlan']) {
         echo '<p>The seating plan is now live! Pay, then choose your seat!</p><div style = "text-align: center">';
         echo '<a href = "seatingplan.php?event=' . $event['id'] . '"><img src = "resources/images/seatingPlan.png" alt = "seating plan" /></a></div>';
     }
     if (empty($event)) {
         echo '<p>No events planned!</p>';
     } else {
         $diff = strtotime($event['dateIso']) - time();
         $days = $diff /= 86400;
         $days = floor($days);
         echo '<p><a href = "viewEvent.php?id=' . $event['id'] . '">' . $event['name'] . '</a> starts in <strong>' . $days . '</strong> ' . Inflector::quantify('day', $days) . '.  </p>';
     }
     stopbox('Countdown!');
 }
Ejemplo n.º 4
0
    public function renderSidebar()
    {
        startbox();
        echo <<<MARKUP
<img src = "http://www.westlan.co.uk/resources/images/wiki/tf2large.png" alt = "TF2" style = "float: right" />
<p>players: <span id = "playersInServer">#</span>/<span id = "playersMax">#</span></p>
<p>map: <span id = "mapName">{map name}</span></p>
<p>
<a href = "steam://connect/tf2.westlan.co.uk:27015">tf2.westlan.co.uk</a>
<br />
<span class = "unpublished"> (click to connect)</span>
</p>
MARKUP;
        echo <<<JS
<script type = "text/javascript">
\$.getJSON('api/json/game2.redphase.info.php', function(gameServer) {
\t\$('#playersInServer').text(gameServer.playersInServer);
\t\$('#playersMax').text(gameServer.playerSlots);
\t\$('#mapName').text(gameServer.mapName);
});
</script>
JS;
        stopbox('WestLAN TF2 Server');
    }
Ejemplo n.º 5
0
 public function renderSidebar()
 {
     global $db, $tpl;
     if (Session::isLoggedIn()) {
         $f = new FormShoutbox();
         if ($f->validate()) {
             $f->process();
         }
     }
     startbox();
     $sql = 'SELECT ps.id, u.username, u.id userId, ps.content FROM plugin_shoutbox ps, users u WHERE ps.user = u.id ORDER BY ps.id DESC LIMIT 3';
     $result = $db->query($sql);
     foreach ($result->fetchAll() as $shout) {
         echo '<p><a href = "profile.php?id=' . $shout['userId'] . '">' . $shout['username'] . '</a>: ' . $shout['content'] . '</p>';
     }
     if (Session::isLoggedIn()) {
         echo '<hr />';
         $tpl->assignForm($f);
         $tpl->assign('excludeBox', true);
         $tpl->display('form.tpl');
         $tpl->clear_assign('form');
     }
     stopbox('Shout Box');
 }
Ejemplo n.º 6
0
    public function renderSidebar()
    {
        if ($this->shouldNotDisplay()) {
            return;
        }
        startbox();
        echo '<div class="teamspeak3ServerView"></div>';
        echo '<script type="text/javascript">
				function drawTree(data) {
					data = JSON.parse(data);
					if (data !== undefined && data !== "") {
						if (data.result !== undefined && data.result.data !== undefined) {
							console.log(data.result.data);
							$.each(data.result.data, function( i, row ) { addRow(i, row, data.result.data); });
						}
					}
					console.log($(".teamspeak3ServerView"));
				}
				
				function addRow(i, row, allRows) {
					var parent = $("." + row.parent);
					var spacer = "&nbsp;&nbsp;";
					
					console.log(row.parent);
					
					if (row.class !== "server") {
						// allRows[0] should always be the top level server object
						if (row.parent === allRows[0].ident) {
							console.log("top-level channel");
							parent = $(".teamspeak3ServerView");
						}
						
						var html = $("<div class=\\"" + row.ident + "\\" />");
						
						if (row.class === "channel") {
							html.addClass("channel");
							html.append($("<img src=\\"http://tydus.net/MumPI/viewer/resources/images/channel_12.png\\" alt=\\"channel icon\\" />"));
						}
						else if (row.class === "client") {
							html.addClass("user");
							html.append($("<img src=\\"http://tydus.net/MumPI/viewer/resources/images/talking_off_12.png\\" alt=\\"channel icon\\" />"));
						}
						
						for (var i = 2; i < row.level; i++) {
							html.prepend(spacer);
						}
						
						html.append("&nbsp;");
						html.append($("<span/>").text(row.name));
						
						parent.append(html);
					}
				}
				
				$(document).ready(function(){
					$.ajax({
						dataType: "json",
						type: "POST",
						url: "/api/misc/updateTeamspeak3.php",
						data: {
							host: "' . getSiteSetting('plugin.teamspeak3.host') . '",
							port: "' . getSiteSetting('plugin.teamspeak3.port') . '",
						},
						success: drawTree
					});
					/*$.get("https://api.planetteamspeak.com/servernodes/' . getSiteSetting('plugin.teamspeak3.host') . ':' . getSiteSetting('plugin.teamspeak3.port') . '/", null, drawTree);*/
				});
			</script>';
        #echo '<script type = "text/javascript"></script>';
        echo '<div class = "server">';
        echo '<br /><p>Teamspeak is a low-latency, high quality VOIP application created primarily for gamers. <a href="https://www.teamspeak.com/downloads">Download Teamspeak3</a>.';
        echo '<p><small><strong>Server address/label</strong>: ' . getSiteSetting('plugin.teamspeak3.host') . '<br /><strong>Port:</strong> ' . getSiteSetting('plugin.teamspeak3.port') . '</small></p>';
        echo '</div>';
        stopbox('Teamspeak 3');
    }
        $el = new ElementSelect('object', 'Object');
        $el->addOption('chair');
        $el->addOption('desk');
        $this->addElement($el);
        $this->addElement(new ElementInput('bgcolor', 'Background color'));
        $this->addElement(new ElementInput('width', 'Width'));
        $this->addElement(new ElementInput('height', 'Height'));
        $el1 = new ElementButton('add', 'Add');
        $el2 = new ElementButton('edit', 'Edit');
        $this->addElementGroup(array($el1, $el2));
    }
}
class FormPlanOptions extends Form
{
    public function __construct()
    {
        parent::__construct('formPlanOptions');
        $this->addElement(new ElementInput('xgrid', 'xgrid', 20));
        $this->addElement(new ElementInput('ygrid', 'ygrid', 20));
        $this->addButtons(Form::BTN_SUBMIT);
    }
}
startbox();
$f = new FormPlanObjects();
$f->display();
stopbox('Objects');
startbox();
$f = new FormPlanOptions();
$f->display();
stopbox('Plan options');