jflory7
Active member
The developer has been MIA for a while. :/@shadrxninga this is not working as a widget with XenPorta 2
The PHP file has been placed in the new EWRPorta2 widget folder, and the xml in the xml folder.
Upon trying to add this widget I get
Edit: After a bit of work, I'm finally able to install it as a widget, but still not able to get it to display.
Here are my edits that install perfectly fine and add the widget perfectly fine, just not able to get the widget showing after adding to the article layout:
MinecraftServerStatus.xmlCode:<?xml version="1.0" encoding="utf-8"?> <widget widget_id="MinecraftServerStatus" widget_title="Minecraft Server Status" widget_desc="Displays Minecraft server status" widget_string="2.2.0-b2" widget_version="1" widget_url="http://shadrx.com" widget_install_class="" widget_install_method="" widget_uninstall_class="" widget_uninstall_method="" cache="now"> <listeners/> <options/> <phrases/> <templates> <template title="EWRwidget_MinecraftServerStatus"><![CDATA[<xen:require css="wf_default.css" /> <xen:require css="herodev_minecraftstatus_widget_status.css" /> <xen:if hascontent="true"> <div class="section minecraftServerStatus"> <div class="secondaryContent"> <h3>Minecraft Server Status</h3> <xen:contentcheck> <xen:foreach loop="$MinecraftServerStatus" value="$minecraftServer"> <xen:if is="{$minecraftServer.online}"> <div class="minecraftServer online"> <h4 class="minorHeading">{$minecraftServer.name}</h4> <div class="info"> <span class="prefix prefixLightGreen">{$minecraftServer.numplayers}/{$minecraftServer.maxplayers}</span> </div> <xen:if is="{$minecraftServer.playerList}"> <div class="playerList"> <xen:foreach loop="$minecraftServer.playerList" key="$key" value="$player" i="$i"> <a {$player.profileLink} class="MinecraftAvatar avatar"><img width="18" height="18" data-offsetx="-8px" class="Tooltip" title="{$player.username}" src="https://minotar.net/avatar/{$player.username}/30.png"/></a> </xen:foreach> </div> </xen:if> <p class="lastUpdated">Last Updated: <xen:datetime time="{$minecraftServer.last_query_date}" class="faint"/></p> </div> <xen:else /> <div class="minecraftServer offline"> <h4 class="minorHeading"> {$minecraftServer.name}</h4> <div class="info"> <span class="prefix prefixRed">Offline</span> </div> <p class="lastUpdated">Last Updated: <xen:datetime time="{$minecraftServer.last_query_date}" class="faint"/></p> </div> </xen:if> </xen:foreach> </xen:contentcheck> </div> </xen:if>]]></template> </templates> </widget>
MinecraftServerStatus.phpCode:<?php class EWRporta2_Widget_MinecraftServerStatus extends XenForo_Model { public function getBypass() { $minecraftServerModel = $this->_getMinecraftServerModel(); //Get all active minecraft servers from the database $minecraftServers = $minecraftServerModel->prepareMinecraftServers($minecraftServerModel->getAllActiveMinecraftServers()); return $minecraftServers; } /** * Creates and returns the minecraft server model * @return HeroDev_MinecraftStatus_Model_MinecraftServer */ protected function _getMinecraftServerModel(){ return $this->getModelFromCache('HeroDev_MinecraftStatus_Model_MinecraftServer'); } }