3 * function plugins_update to get
4 * plugins updates from the Database using pagination object.
6 * @author shubham meena mentored by Matthew Lagoe
9 function plugins_update()
11 if ( Ticket_User
:: isMod( unserialize( $_SESSION['ticket_user'] ) ) ) {
12 $pagination = new Pagination( "SELECT * FROM plugins INNER JOIN updates ON plugins.Id=updates.PluginId", "lib", 5, "Plugincache" );
13 $pageResult['plug'] = Gui_Elements
:: make_table( $pagination -> getElements(), Array( "getId", "getPluginName", "getPluginInfo", "getUpdateInfo" ), Array( "id", "plugin_name", "plugin_info", "update_info" ) );
14 $pageResult['links'] = $pagination -> getLinks( 5 );
15 $pageResult['lastPage'] = $pagination -> getLast();
16 $pageResult['currentPage'] = $pagination -> getCurrent();
18 global $INGAME_WEBPATH;
19 $pageResult['ingame_webpath'] = $INGAME_WEBPATH;
21 // check if shard is online
23 $dbs = new DBLayer( "shard" );
24 $pageResult['shard'] = "online";
26 catch( PDOException
$e ) {
27 $pageResult['shard'] = "offline";
29 return( $pageResult );
32 $_SESSION['error_code'] = "403";
33 header("Cache-Control: max-age=1");
34 header( "Location: index.php?page=error" );
35 throw new SystemExit();