Skocz do zawartości

X3nO

Użytkownik
  • Postów

    295
  • Dołączył

  • Ostatnia wizyta

Treść opublikowana przez X3nO

  1. To tam mam, kod widgetu: <?php namespace IPS\monitor\widgets; if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) ) { header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' ); exit; } class _lgslmon extends \IPS\Widget { public $key = 'lgslmon'; public $app = 'monitor'; public $plugin = ''; public function init() { parent::init(); } public function preConfig( $values ) { return $values; } public function render() { return $this->output( require 'IPS\monitor\sources\table.php'; ); } A tu w ACP: http://imgur.com/a/8CItW
  2. Nie, a gdzie dokładniej jak mogę zapytać?
  3. link do forum?
  4. Link PNG wygasł
  5. edit: <?php namespace IPS\monitor\widgets; if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) ) { header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' ); exit; } class _tabela extends \IPS\Widget\StaticCache { /** * @brief Widget Key */ public $key = 'tabela'; /** * @brief App */ public $app = 'monitor'; /** * @brief Plugin */ public $plugin = ''; /** * Initialise this widget * * @return void */ public function init() { \IPS\Output::i()->cssFiles = array_merge( \IPS\Output::i()->cssFiles, \IPS\Theme::i()->css( 'widget.css', 'monitor', 'widgets' ) ); parent::init(); } public function preConfig( $values ) { return $values; } public function render() { return $this->output( require 'IPS\monitor\sources\table.php'; ); } }
  6. Dodałem plik tabela.php do "Widgets" z zawartością: <?php namespace IPS\monitor\widgets; if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) ) { header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' ); exit; } class _tabela extends \IPS\Widget\PermissionCache { public $key = 'tabela'; public $app = 'monitor'; public $plugin = ''; public function __construct( $uniqueKey, array $configuration, $access=null, $orientation=null ) { try { if ( isset( $configuration['monitor_widget_custom_block'] ) ) { $block = \IPS\monitor\tabela\Block::load( $configuration['monitor_widget_custom_block'], 'block_key' ); if ( $block->type === 'custom' AND ! $block->cache ) { $this->neverCache = TRUE; } } } catch( \Exception $e ) { } parent::__construct( $uniqueKey, $configuration, $access, $orientation ); } public function configuration( &$form=null ) { if ( $form === null ) { $form = new \IPS\Helpers\Form; } $form->add( new \IPS\Helpers\Form\Node( 'monitor_widget_custom_block', ( isset( $this->configuration['monitor_widget_custom_block'] ) ? \IPS\monitor\tabela\Block::load( $this->configuration['monitor_widget_custom_block'], 'block_key' ) : NULL ), FALSE, array( 'class' => '\IPS\monitor\tabela\Container', 'permissionCheck' => function( $node ) { if ( $node instanceof \IPS\monitor\tabela\Container ) { return FALSE; } return TRUE; } ) ) ); return $form; } public function preConfig( $values ) { $newValues = array(); if ( isset( $values['monitor_widget_custom_block'] ) ) { $newValues['monitor_widget_custom_block'] = $values['monitor_widget_custom_block']->key; } return $newValues; } public function render() { if ( isset( $this->configuration['monitor_widget_custom_block'] ) ) { return (string) \IPS\monitor\tabela\Block::display( $this->configuration['monitor_widget_custom_block'], $this->orientation ); } return ''; } } Lecz coś nie działa, tzn nie wyświetla się w blokach
  7. Witam, szukam i szukam i nie mogę znaleźć dokumentacji od bloków w IPS 4.1, a mianowicie chcę, żeby podczas instalacji aplikacji tworzył się blok (widget) na stronę główną. Pomoże ktoś?
  8. Zauważyłem, że IPS dodaje tak: http://psr-serv.pl//css_built_1/341e4a57816af3ba440d891ca87450ff_framework.css.296be041aec981e73dc892c2e0cfbde4.css?v=906bb1581d A powinno być: http://psr-serv.pl/uploads/css_built_1/341e4a57816af3ba440d891ca87450ff_framework.css.296be041aec981e73dc892c2e0cfbde4.css?v=906bb1581d Chodzi mi o "uploads"
  9. Witam, wczoraj zaktualizowałem IPB 3.4.9 do IPS 4.1.9 i mam problem, nie mam CSS i JSów, demo: http://psr-serv.pl/
  10. IPS 4.1 ma funkcję 2 języków
  11. X3nO

    Responsywny styl

    https://invisionpower.com/files/file/6436-ipb-responsive-by-ips-themes/
  12. Pobieranie informacji z wiersza usera z kolumny psrpg_user
  13. Pokaż szablon od group name indicator.
  14. Ja bym to zrobił w jQuery.toggle. http://api.jquery.com/toggle/
  15. Hmm nadal nie działa :/ Tu cały kod: <?php class account { protected $registry; protected $DB; protected $member; protected $memberData; protected $request; protected $settings; public function __construct( ipsRegistry $registry){ $panelClass = IPSLib::loadLibrary( IPSLib::getAppDir( 'panel' ) . '/sources/panel.php', 'panel' ); $this->panel = new $panelClass($registry); $this->registry = $registry; //$this->DB = $this->registry->DB(); $this->member = $this->registry->member(); $this->memberData = $this->registry->member()->fetchMemberData(); $this->request = $this->registry->fetchRequest(); $this->settings = $this->registry->fetchSettings(); } public function integration() { header('Content-Type: application/json'); if (!$this->memberData['member_id']) { $error = 0; //Użytkownik nie jest zalogowany } else { if (!$this->memberData->user['psrpg_user']) { $error = 1; //Panel nie działa prawidłowo (Brak dodanej kolumny w bazie) } else { if (!isset($this->memberData->post_code) || $this->memberData->input['my_post_key'] != $this->memberData->post_code) { $error = 2; //Nie prawidłowy post_key } else { if ($this->memberData->user['psrpg_user'] != -1) { $error = 3; //Użytkownik ma już zintegrowane konto } else { $user_nick = htmlentities($con->real_escape_string($_POST['user_nick'])); $user_pass = zahashuj($con->real_escape_string($_POST['user_pass'])); $query = $con->query("SELECT * FROM Accounts WHERE name = '{$user_nick}' AND pass = '{$user_pass}'"); if ($query->num_rows == 0) { $error = 4; //Nie prawidłowe dane } else { $result = $query->fetch_array(); $query2 = $db->query("SELECT * FROM " . TABLE_PREFIX . "users WHERE psrpg_user = '{$result['uid']}'"); if ($query2->num_rows > 0) { $error = 5; //Konto jest zintegrowane z innym uzytkownikiem } else { $db->write_query("UPDATE " . TABLE_PREFIX . "users SET psrpg_user = '{$result['uid']}' WHERE uid = '{$this->memberData->user['uid']}'"); $success = 1; //integracja udana } } } } } } if (isset($error)) { $result = $error; } else { $result = 6; } $result = Array( 'result' => $result ); echo json_encode($result); exit; } public function getOutput(){ $this->registry->output->addNavigation( "Konto SA-MP", "app=panel&app=panel&module=game&do=account" ); switch($this->request['go']){ default: { $this->registry->output->addNavigation( "Integracja" ); $out=' <form action="#" novalidate="novalidate" method="post" id="samplogin_form"> <div id="login_form" class="clearfix"> <div id="member_login"> <h2 class="maintitle">Integracja konta</h2> <div class="border"><div class="row1"> <div id="regular_signin"> <a id="_regularsignin"></a> <h3 class="bar">Wprowadź login i hasło</h3> <fieldset id="signin_options"> <ul class="ipsForm ipsForm_vertical ipsPad_double left"> <li class="ipsField"> <label for="ips_username" class="ipsField_title">Login SAMP:</label> <p class="ipsField_content"> <input class="input_text" name="user_nick" size="50" tabindex="1" type="text"><br> </p> </li> <li class="ipsField"> <label for="ips_password" class="ipsField_title">Hasło SAMP:</label> <p class="ipsField_content"> <input aria-required="true" class="input_text" name="user_pass" size="50" tabindex="2" type="password"><br> </p> </li> </ul> </div></fieldset> <br> <fieldset class="submit"> <input class="input_submit" value="Zaloguj się!" tabindex="0" type="submit" name="regsubmit"> lub <a href="http://psr-serv.pl" title="Anuluj" class="cancel">Anuluj</a> </fieldset> </form></div></div> </div> </div> </form><script> $(document).ready(function() { $("#samplogin_form").keydown(function(event){ if(event.keyCode == 13) { event.preventDefault(); return false; } }); }); var form_nick, form_pass, result; $("#log_submit").click(function() { form_nick = $("#samplogin_form input[name=user_nick]").val(); form_pass = $("#samplogin_form input[name=user_pass]").val(); var data = new FormData(); data.append("user_nick", form_nick); data.append("user_pass", form_pass); data.append("integration", "1"); data.append("my_post_key", my_post_key); var xhr = new XMLHttpRequest(); xhr.open("POST", "index.php?app=panel&app=panel&module=game&do=account", true); xhr.onload = function () { result = JSON.parse(this.responseText); if(result.result == 6) { $(".ipsPad").html("<center>Konta zostały zintegrowane pomyślnie!</center>"); } }; xhr.send(data); }); </script>'; } } $menuClass = IPSLib::loadLibrary( IPSLib::getAppDir( 'panel' ) . '/sources/menu.php', 'globalMenu' ); $menu = new $menuClass($this->registry); return $menu->getOutput2($out, $this->request['do'], $this->request['go'], array("Integracja"), array("integracja")); } } Po kliknięciu <input class="input_submit" value="Zaloguj się!" tabindex="0" type="submit" name="regsubmit"> Strona się tylko odświeża :/
  16. pw, w ustawieniach trzeba ustawić dane do MySQL, strukturę zaraz podeślę
  17. Tzn aplikacje i strukture z bazy?
  18. array(208) { ["uid"]=> string(1) "3" ["name"]=> string(11) "Ciastkoszss" ["pass"]=> string(9) "hueheuhsvs" ["lang"]=> string(1) "0" ["ip"]=> string(12) "91.222.148.3" ["last_ip"]=> string(12) "91.222.148.3" ["serial"]=> string(40) "8C9AFC9CAE09958F8409ECEDEDCFC94A990ADE44" ["kills"]=> string(1) "0" ["deaths"]=> string(1) "0" ["dmg"]=> string(4) "0.00" ["score"]=> string(3) "100" ["lvl"]=> string(1) "1" ["cash"]=> string(5) "15000" ["skin"]=> string(1) "0" ["time"]=> string(1) "5" ["bank"]=> string(1) "0" ["total_cash"]=> string(4) "0.00" ["vcash"]=> string(5) "0.005" ["sms_time"]=> string(1) "0" ["sms_value"]=> string(4) "0.00" ["registered"]=> string(10) "1456615557" ["lastvisit"]=> string(10) "1456619167" ["visits"]=> string(1) "2" ["walizek"]=> string(1) "0" ["figurek"]=> string(1) "0" ["pojazdow"]=> string(1) "0" ["zagadek"]=> string(1) "0" ["wyrazy"]=> string(1) "0" ["kody"]=> string(1) "0" ["wyniki"]=> string(1) "0" ["steady_pos"]=> string(17) "0.0 0.0 0.0 -1 -1" ["steady_col"]=> string(2) "-1" [0]=> string(1) "0" [1]=> string(1) "0" [2]=> string(1) "0" [3]=> string(1) "0" [4]=> string(1) "0" [5]=> string(1) "0" [6]=> string(1) "0" [7]=> string(1) "0" [8]=> string(1) "0" [9]=> string(1) "0" [10]=> string(1) "0" [11]=> string(1) "0" ["gang"]=> string(2) "-1" ["grang"]=> string(1) "0" ["g_score"]=> string(1) "0" ["e_maker"]=> string(1) "0" ["premium"]=> string(2) "-1" ["premiumtime"]=> string(1) "0" ["model"]=> string(2) "-1" ["x"]=> string(1) "0" ["y"]=> string(1) "0" ["z"]=> string(1) "0" ["a"]=> string(1) "0" ["dist"]=> string(4) "0.00" ["c0"]=> string(2) "-1" ["c1"]=> string(2) "-1" ["priv_pos"]=> string(17) "0 0.0 0.0 0.0 0.0" ["priv_comp"]=> string(27) "0 0 0 0 0 0 0 0 0 0 0 0 0 0" ["paintjob"]=> string(1) "3" ["a0"]=> string(1) "3" ["a1"]=> string(1) "0" ["a2"]=> string(1) "0" ["a3"]=> string(1) "0" ["a4"]=> string(1) "0" ["a5"]=> string(1) "0" ["a6"]=> string(1) "0" ["a7"]=> string(1) "0" ["a8"]=> string(1) "0" ["a9"]=> string(1) "0" ["a10"]=> string(1) "0" ["a11"]=> string(1) "0" ["a12"]=> string(1) "0" ["a13"]=> string(1) "0" ["a14"]=> string(1) "0" ["a15"]=> string(1) "0" ["a16"]=> string(1) "0" ["a17"]=> string(1) "0" ["solowins"]=> string(1) "0" ["w1"]=> string(1) "0" ["w2"]=> string(1) "0" ["w3"]=> string(1) "0" ["w4"]=> string(1) "0" ["w5"]=> string(1) "0" ["w6"]=> string(1) "0" ["w8"]=> string(1) "0" ["w9"]=> string(1) "0" ["h_shots"]=> string(1) "0" ["t0"]=> string(1) "0" ["t1"]=> string(1) "0" ["t2"]=> string(1) "0" ["t3"]=> string(1) "0" ["t4"]=> string(1) "0" ["t5"]=> string(1) "0" ["t6"]=> string(1) "0" ["t7"]=> string(1) "0" ["t8"]=> string(1) "0" ["t9"]=> string(1) "0" ["t10"]=> string(1) "0" ["t11"]=> string(1) "0" ["t12"]=> string(1) "0" ["t13"]=> string(1) "0" ["t14"]=> string(1) "0" ["t15"]=> string(1) "0" ["t16"]=> string(1) "0" ["t17"]=> string(1) "0" ["t18"]=> string(1) "0" ["t19"]=> string(1) "0" ["t20"]=> string(1) "0" ["t21"]=> string(1) "0" ["t22"]=> string(1) "0" ["t23"]=> string(1) "0" ["t24"]=> string(1) "0" ["t25"]=> string(1) "0" ["t26"]=> string(1) "0" ["t27"]=> string(1) "0" ["t28"]=> string(1) "0" ["t29"]=> string(1) "0" ["t30"]=> string(1) "0" ["t31"]=> string(1) "0" ["t32"]=> string(1) "0" ["t33"]=> string(1) "0" ["t34"]=> string(1) "0" ["t35"]=> string(1) "0" ["t36"]=> string(1) "0" ["t37"]=> string(1) "0" ["t38"]=> string(1) "0" ["t39"]=> string(1) "0" ["t40"]=> string(1) "0" ["t41"]=> string(1) "0" ["t42"]=> string(1) "0" ["t43"]=> string(1) "0" ["t44"]=> string(1) "0" ["t45"]=> string(1) "0" ["t46"]=> string(1) "0" ["t47"]=> string(1) "0" ["t48"]=> string(1) "0" ["t49"]=> string(1) "0" ["t50"]=> string(1) "0" ["t51"]=> string(1) "0" ["t52"]=> string(1) "0" ["t53"]=> string(1) "0" ["t54"]=> string(1) "0" ["t55"]=> string(1) "0" ["t56"]=> string(1) "0" ["t57"]=> string(1) "0" ["t58"]=> string(1) "0" ["t59"]=> string(1) "0" ["t60"]=> string(1) "0" ["t61"]=> string(1) "0" ["t62"]=> string(1) "0" ["t63"]=> string(1) "0" ["t64"]=> string(1) "0" ["t65"]=> string(1) "0" ["t66"]=> string(1) "0" ["t67"]=> string(1) "0" ["t68"]=> string(1) "0" ["t69"]=> string(1) "0" ["t70"]=> string(1) "0" ["t71"]=> string(1) "0" ["t72"]=> string(1) "0" ["t73"]=> string(1) "0" ["t74"]=> string(1) "0" ["t75"]=> string(1) "0" ["t76"]=> string(1) "0" ["t77"]=> string(1) "0" ["t78"]=> string(1) "0" ["t79"]=> string(1) "0" ["t80"]=> string(1) "0" ["t81"]=> string(1) "0" ["t82"]=> string(1) "0" ["t83"]=> string(1) "0" ["t84"]=> string(1) "0" ["t85"]=> string(1) "0" ["t86"]=> string(1) "0" ["t87"]=> string(1) "0" ["t88"]=> string(1) "0" ["t89"]=> string(1) "0" ["t90"]=> string(1) "0" ["t91"]=> string(1) "0" ["t92"]=> string(1) "0" ["t93"]=> string(1) "0" ["t94"]=> string(1) "0" ["t95"]=> string(1) "0" ["t96"]=> string(1) "0" ["t97"]=> string(1) "0" ["t98"]=> string(1) "0" ["t99"]=> string(1) "0" ["tags"]=> string(1) "0" ["ob_0"]=> string(1) "0" ["ob_1"]=> string(1) "0" ["ob_2"]=> string(1) "0" ["ob_3"]=> string(1) "0" ["ob_4"]=> string(1) "0" ["ob_5"]=> string(1) "0" ["ob_6"]=> string(1) "0" ["ob_7"]=> string(1) "0" ["ob_8"]=> string(1) "0" ["m_time"]=> string(1) "0" ["shipping"]=> string(1) "0" ["sold_car"]=> string(1) "0" ["teleport"]=> string(3) "414" ["namechange"]=> string(1) "0" ["killstreak"]=> string(1) "0" ["beststreak"]=> string(1) "0" ["online"]=> string(1) "0" ["gl_record"]=> string(5) "100.0" } To są dane z jednego wyniku, a ja chcę otrzymać sumy poszczególnych kolumn i ilość wersów z tabeli
  19. var dump pokazuje null
  20. edit: $queryaccounts = $this->registry->DB('acc')->build( array( 'select' => '*', 'from' => 'Accounts') ); $resultsaccounts = $queryaccounts->num_rows; $querykills = $this->registry->DB('acc')->buildAndFetch( array( `SELECT` => `SUM(kills)`, `FROM` => `Accounts` ) ); $querydeaths = $this->registry->DB('acc')->buildAndFetch( array( `select` => `SUM(deaths)`, `from` => `Accounts`) ); $querywalizek = $this->registry->DB('acc')->buildAndFetch( array( `select` => `SUM(walizek)`, `from` => `Accounts`) ); $queryfigurek = $this->registry->DB('acc')->buildAndFetch( array( `select` => `SUM(figurek)`, `from` => `Accounts`) ); $querypojazdow = $this->registry->DB('acc')->buildAndFetch( array( `select` => `SUM(pojazdow)`, `from` => `Accounts`) ); $queryzagadek = $this->registry->DB('acc')->buildAndFetch( array( `select` => `SUM(zagadek)`, `from` => `Accounts`) ); $querywyrazy = $this->registry->DB('acc')->buildAndFetch( array( `select` => `SUM(wyrazy)`, `from` => `Accounts`) ); $querykody = $this->registry->DB('acc')->buildAndFetch( array( `select` => `SUM(kody)`, `from` => `Accounts`) ); $querywyniki = $this->registry->DB('acc')->buildAndFetch( array( `select` => `SUM(wyniki)`, `from` => `Accounts`) ); <tr class="row2"> <td>Ilość zarejestrowanych kont:</td> <td>'.$resultsaccounts.'</td> </tr> <tr class="row2"> <td>Zabójstw:</td> <td>'.$querywyniki.'</td> </tr> <tr class="row2"> <td>Zgonów:</td> <td>'.$querydeaths.'</td> </tr> <tr class="row2"> <td>Znalezionych walizek:</td> <td>'.$querywalizek.'</td> </tr> <tr class="row2"> <td>Znalezionych figurek:</td> <td>'.$queryfigurek.'</td> </tr> <tr class="row2"> <td>Znalezionych pojazdów:</td> <td>'.$querypojazdow.'</td> </tr> <tr class="row2"> <td>Odgadniętych zagadek:</td> <td>'.$queryzagadek.'</td> </tr> <tr class="row2"> <td>Ułożonych wyrazów:</td> <td>'.$querywyrazy.'</td> </tr> <tr class="row2"> <td>Przepisanych kodów::</td> <td>'.$querykody.'</td> </tr> <tr class="row2"> <td>Obliczonych wyników:</td> <td>'.$querywyniki.'</td> </tr>
  21. http://psr-serv.pl/index.php?app=panel&&module=game&do=panel&go=statssvr
×
×
  • 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ę.