Skocz do zawartości
"Idzie nowe..." - o zmianach i nie tylko ×
Przeniesienie zakupów z IPS Marketplace / Moving bought items from IPS Marketplace ×

X3nO

Użytkownik
  • Postów

    295
  • Dołączył

  • Ostatnia wizyta

Treść opublikowana przez X3nO

  1. Kod dodaję do funkcji getOutput w hooku. Request nic nie pojawia, próbowałem print oraz print_r
  2. Witam, mam bardzo podobny problem co Pan @mrdrifter. http://forum.invisionize.pl/topic/41332-pobieranie-informacji-o-użytkowniku-w-hooku/ Tylko, że ja potrzebuję pobrać informacje o użytkowniku z profilu. Stworzyłem hook, który ma wyświetlać ilość respektu w grze w profilu. Dodałem: $member = IPSMember::load($this->request['id']); Lecz tablica $member['member_id'] jest pusta.. Proszę o pomoc.
  3. Już problem rozwiązany, nie dodałem secure hash do JS
  4. kontroler: $bans = []; foreach (\IPS\Db::i( 'amx_db' )->select('*', 'amx_bans', NULL, 'ban_created DESC') as $ban) { if ($ban['ban_length'] == 0) { $ban['time'] = 'Permanent'; } elseif ($ban['ban_length'] == -1) { $ban['time'] = 'Permanent'; } elseif ($ban['ban_length'] > 59) { $ban['__ban_length'] = floor($ban['ban_length'] / 60); $ban['time'] = ''.$ban['__ban_length'].' godzin'; if ($ban['__ban_length'] == 168) { $ban['time'] = 'tydzień'; } } else { $ban['time'] = $ban['ban_length'].' minut'; } if ($ban['expired'] == 0 && ($ban['ban_length'] + $ban['ban_created']) > time()) { $ban['expired'] == 1; } $ban['ban_created'] = gmdate("d.m.Y, H:i:s", $ban['ban_created']); if (empty($ban['ban_reason'])) { $ban['ban_reason'] = 'Brak informacji'; } $bans[] = $ban; } return \IPS\Theme::i()->getTemplate( 'main' )->bansArea( $bans ); szablon: <ips:template parameters="$bans" /> <h2 class="ipsType_sectionTitle ipsType_medium ipsType_reset ipsClear">{lang="amxpanel_przeglad"}</h2> <table class="ipsTable ipsTable_responsive ipsTable_zebra" style="text-align: center;"> <thead> <tr class="ipsAreaBackground"> <th style="text-align: center;">{lang="amxpanel_player"}</th> <th style="text-align: center;">{lang="amxpanel_powod"}</th> <th style="text-align: center;">{lang="amxpanel_nadany"}</th> <th style="text-align: center;">{lang="amxpanel_admin"}</th> <th style="text-align: center;">{lang="amxpanel_timeban"}</th> <th style="text-align: center;">{lang="amxpanel_status"}</th> <th style="text-align: center;">{lang="amxpanel_cinfo"}</th> </tr> </thead> <tbody data-role="tableRows"> {{foreach $bans as $a}} <tr class="ipsDataItem ipsClearfix"> <td>{$a['player_nick']}</td> <td>{$a['ban_reason']}</td> <td>{$a['ban_created']}</td> <td>{$a['admin_nick']}</td> <td>{$a['time']}</td> <td>{{if ($a['expired'] == 0)}}<font color="red"><i class="fa fa-minus-circle"></i> {lang="amxpanel_active"}</font>{{else}}<font color="green"><i class="fa fa-plus-circle"></i> {lang="amxpanel_nonadctive"}</font>{{endif}}</td> <td><a class="ipsButton ipsButton_medium ipsButton_important ipsButton_fullWidth" data-ipsdialog data-ipsdialog-url='{url="app=amxpanel&module=main&controller=index&area=ajaxshowban&id={$a['bid']}" seoTemplate="amxpanel"}' data-ipsdialog-title="{$a['player_nick']}">{lang="amxpanel_look"}</a></td> </tr> {{endforeach}} </tbody> </table>
  5. Dodam, że po wejściu w link jest nopermission
  6. Mam listę ostatnich banicji z gry CS 1.6 i chcę do tego dodać paginację
  7. Zmieniłem na GameQ 3. Można zamknąć
  8. Witam, szukam jakiegoś tutoriala, jak dodać stronicowanie w IPS 4. Szukałem w Google i nic nie znalazłem. W kodzie IPS też jakoś nie mogę się "połapać". Z góry dzięki za wyjaśnienie.
  9. Witam, mam problem z modułem ajaxu, mianowicie identyczny problem: Stworzyłem moduł ajax, kontroler "changes" i dodałem defaultSection, kod popua: <li><a id="changesModal2" href="index.php?app=goldPanel&module=ajax&section=changes">Ostatnie zmiany</a></li> <script type='text/javascript'> $('changesModal2').observe( 'click', function(e) { _var = new ipb.Popup( 'changesModalWindow', { type: 'pane', hideAtStart: false, modal: true, ajaxURL: $(this).readAttribute('href'), w: '750px', h: 600}); Event.stop(e); return false; }); </script> Plik changes.php: <?php if ( ! defined( 'IN_IPB' ) ) { print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'."; exit(); } class public_goldPanel_ajax_changes extends ipsAjaxCommand { public function doExecute( ipsRegistry $registry ) { $this->lang->loadLanguageFile( array( 'public_lang' ), 'goldpanel' ); return $this->returnHtml( $this->registry->output->getTemplate('goldPanel')->changes() ); } } ss:
  10. Log z ACP: Whoops\Exception\ErrorException: You have used a file management function directly (/applications/serverviewer/sources/SampQueryAPI.php::62). Please use the proper APIs instead. (256)
  11. protected $rSocket = false; i protected $aServer = array();
  12. Funkcje z protected działają, jak to zmienię na protected: private $rSocket = false; private $aServer = array(); To wyświetla blank page
  13. Dzięki wielkie bo IPS już się pokazuje, tylko
  14. applications/serverviewer/sources/SampQueryAPI.php
  15. No to ma namespace IPS\serverviewer\widgets;
  16. Chodzi Ci o unikalną nazwę? Nie powtarza się w pliku
  17. Trochę przerobiłem kod, teraz wygląda to tak: public function render() { $server = []; include "applications/serverviewer/sources/SampQueryAPI.php"; $row['num'] = 0; foreach ( \IPS\Db::i()->select( '*', 'serverviewer_servers') as $row ) { $row['num']++; switch ($row['type']) { case 'samp': $SampQueryAPI = new \SampQueryAPI($row['ip'], $row['q_port']); $row['SampInformation'] = $SampQueryAPI->getInfo(); if ($row['SampInformation']['players'] > 0 ) { $row['clientsvalue'] = ($row['SampInformation']['players']) / ($row['SampInformation']['maxplayers']) *100; $row['clients'] = number_format($row['clientsvalue'], 0); } else { $row['clients'] = number_format(0, 0); } $row['status'] = $SampQueryAPI->isOnline(); break; default: # code... break; } $server[] = $row; } return $this->output( $server ); } Oraz szablon: <ips:template parameters="$server" /> <h2 class="ipsType_sectionTitle ipsType_reset ipsType_blendLinks cForumTitle">Lista serwerów</h2> <table class="ipsTable ipsTable_responsive ipsTable_zebra ipsBox"> <thead> <tr> <td style="text-align: center;">#</td> <td style="text-align: center;">Status</td> <td style="text-align: center;">Gra</td> <td style="text-align: center;">Adres IP</td> <td style="text-align: center;">Nazwa serwera</td> <td style="text-align: center;">Mapa</td> <td style="text-align: center;">Graczy</td> <td style="text-align: center;">Dodatki</td> </tr> </thead> <tbody> {{foreach $server as $server}} <tr> <td style="text-align: center;"> {$server['num']} </td> <td style="text-align: center;"> {$server['status']} </td> <td style="text-align: center;"> {$server['type']} </td> <td style="text-align: center;"> {$server['ip']}:{$server['c_port']} </td> <td style="text-align: center;"> {$server['SampInformation']['hostname']|raw} </td> <td style="text-align: center;"> {$server['SampInformation']['mapname']|raw} </td> <td style="text-align: center;"> ({$server['SampInformation']['players']} / {$server['SampInformation']['maxplayers']}) {$server['clients']}% </td> <td style="text-align: center;"> <a data-ipstooltip _title="Kilknij, aby zobaczyć informacje o serwerze" href="#" data-ipsdialog data-ipsdialog-url="#" data-ipsdialog-title="Informacje o serwerze" class="ipsButton ipsButton_primary ipsButton_verySmall"><i class="fa fa-bar-chart"></i></a> <a data-ipstooltip _title="Kilknij, aby połączyć się z serwerem" href="#" data-ipsdialog-title="Połącz z serwerem" class="ipsButton ipsButton_primary ipsButton_verySmall"><i class="fa fa-play-circle-o"></i></a> </td> </tr> </tbody> </table><br /> Mimo tego, że include sampqueryapi nie mam w pętli to wyświetla się error
×
×
  • Dodaj nową pozycję...

Powiadomienie o plikach cookie

Umieściliśmy na Twoim urządzeniu pliki cookie, aby pomóc Ci usprawnić przeglądanie strony. Możesz dostosować ustawienia plików cookie, w przeciwnym wypadku zakładamy, że wyrażasz na to zgodę.