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. Tworzę mapę z serwera SAMP, pętlę foreach ze znacznikami do mapy nie mogę dodać do szablonu więc kombinuję z zapisem co 30 minut do pliku i potem załączenie go w szablonie za pomocą script src.
  2. Witam, mam pytanie, jak wykorzystać funkcję file_put_contents w IC 4.2? Mam taki błąd: You have used a file write function directly (/applications/panel/modules/front/home/index.php::111). Please use the proper APIs instead. 111 linijka: file_put_contents($file, $outs); zmienna file: $file = 'applications/panel/sources/mapcache.js';
  3. Do zapytania dodajesz where z datą posta < obecny czas - tydzien w sekundach.
  4. \IPS\Output::i()->output = 'tekst' . $values['name']; O to Ci chodzi?
  5. Chyba że jest inny sposób na stworzenie paginacji.
  6. Źle to określiłem, pobieram dane z JSONa zamiast z MySQL i chcę utworzyć tabelę z danymi pobranymi właśnie JSONem
  7. Witam, chciałbym wykorzystać \IPS\Helpers\Table\Db do JSONa, czy jest taka możliwość?
  8. Witam, mam problem z zapytaniem SQL w IP.Board 3, mianowicie wyświetla mi tylko pierwszy rekord, jest ktoś w stanie naprowadzić mnie na błąd? $this->registry->DB('samp_db')->build( array( 'select' => 'lastvisit, name, premium, premiumtime, skin, online', 'from' => 'Accounts', 'where' => 'premium>=1', 'order'=> 'premium desc' )); $this->registry->DB('samp_db')->execute(); while ($row = $this->registry->DB('samp_db')->fetch()) { $output .= '<tr class="row2"> <td style="text-align: center;">'.$panel->formatSkin($row['skin']).'</td> <td style="text-align: center;">'.$panel->formatName($row['name'], '1').' ('.$panel->formatName($row['name'], '2').')</td> <td style="text-align: center;">'; if ($row['online'] == 1) { $output .= '<span data-tooltip="Aktualnie przebywa na serwerze." class="ipsBadge ipsBadge_green">Aktywny</span>'; } else { $output .= '<span class="ipsText_small desc">'.$this->registry->class_localization->getDate( $row['lastvisit'], 'LONG', 1, 1 ).'</span>'; } $output .= '</td> <td style="text-align: center;"><span class="ipsText_small desc">'.$this->registry->class_localization->getDate( $row['premiumtime'], 'LONG', 1, 1 ).'</span></td> </tr>'; }
  9. X3nO

    Strefa Rozrywki

    Wersja 1.0.0

    0 pobrań

    Szablon z dawnego serwera SAMP. Sprzedaję, gdyż nie potrzebuję już go.
    30 zł
  10. X3nO

    Strefa Rozrywki

    Strefa Rozrywki Zobacz plik Szablon z dawnego serwera SAMP. Sprzedaję, gdyż nie potrzebuję już go. Dodający X3nO Dodano 24.11.2016 Kategoria Style i grafika Wspierana wersja IP.Board Wspierana wersja IP.Board: 4.1.9
  11. Sprzedam poniższy layout. Jest również możliwość zakodowania go. Cena to 200PLN za PSD. GG: 54684331
  12. Witam, mam na sprzedanie szablon pod IP.Board 3.4 (Aplikacja od SSów trochę przycięła.) Cena jaka mnie interesuje to 300PLN. Kontakt GG:10055455 Dorzucam PSD do szablonu.
  13. $check = \IPS\Db::i()->select( 'id', 'amx_rejestracja_konta', array('ipsid=?', \IPS\Member::loggedIn()->member_id) ); $check = count($check); if (!$check) { $form = new \IPS\Helpers\Form( 'form', 'amxPanel_auth'); $form->addHeader(\IPS\Member::loggedIn()->language()->addToStack( 'amxPanel_auth_header' )); $form->add( new \IPS\Helpers\Form\Text( 'amxPanel_auth_name', NULL, TRUE, array( 'minLength' => 2, 'maxLength' => 20), NULL, NULL, NULL, 'nazwa' ) ); $form->add( new \IPS\Helpers\Form\Password('amxPanel_auth_pass', NULL, TRUE, array( 'minLength' => 2, 'maxLength' => 20 ), NULL, NULL, NULL, 'pass' ) ); if ($values = $form->values()) { try { $check_values = \IPS\Db::i()->select( 'id', 'amx_rejestracja_konta', array("Name=? AND Password=?", $values['amxPanel_auth_name'], $values['amxPanel_auth_pass']) )->first(); } catch(\UnderflowException $e) {} if ($check_values['id']) { try { $check_authed = \IPS\Db::i()->select( 'id', 'amx_rejestracja_konta', array("Name=? AND ipsid=?", $values['amxPanel_auth_name'], 0) )->first(); } catch(\UnderflowException $e) {} if ($check_authed) { try { \IPS\Db::i()->update( 'amx_rejestracja_konta', array( "Name=? AND ipsid=?", $values['amxPanel_auth_name'], \IPS\Member::loggedIn()->member_id ) )->first(); } catch(\UnderflowException $e) {} \IPS\Output::i()->redirect( \IPS\Http\Url::internal( "app=amxpanel", 'front', 'main' ), \IPS\Member::loggedIn()->language()->addToStack('Zautoryzowano konto.') ); } else { \IPS\Output::i()->redirect( \IPS\Http\Url::internal( "app=amxpanel", 'front', 'main' ), \IPS\Member::loggedIn()->language()->addToStack('Podane konto jest już zautoryzowane') ); } } else { \IPS\Output::i()->redirect( \IPS\Http\Url::internal( "app=amxpanel", 'front', 'main' ), \IPS\Member::loggedIn()->language()->addToStack('Podane dane są nieprawidłowe.') ); } } \IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'main' )->authArea($form); } else { //ZALOGOWANY } I wyświetla się wiadomość "Podane dane są nieprawidłowe." mimo wpisania dobrych ;/
  14. Możesz mi pokazać przykładowe użycie tej funkcji w moim przypadku?
  15. Trochę zmieniłem: $check = \IPS\Db::i()->select( 'id', 'amx_rejestracja_konta', array('ipsid=?', \IPS\Member::loggedIn()->member_id) ); $check = count($check); $form = new \IPS\Helpers\Form( 'form', 'amxPanel_auth'); $form->addHeader(\IPS\Member::loggedIn()->language()->addToStack( 'amxPanel_auth_header' )); $form->add( new \IPS\Helpers\Form\Text( 'amxPanel_auth_name', NULL, TRUE, array( 'minLength' => 2, 'maxLength' => 20), NULL, NULL, NULL, 'nazwa' ) ); $form->add( new \IPS\Helpers\Form\Password('amxPanel_auth_pass', NULL, TRUE, array( 'minLength' => 2, 'maxLength' => 20 ), NULL, NULL, NULL, 'pass' ) ); if ($values = $form->values()) { $check_values = \IPS\Db::i()->select( 'id', 'amx_rejestracja_konta', array("Name=? AND Password=?", $values['amxPanel_auth_name'], $values['amxPanel_auth_pass']) )->first(); if ($check_values['id']) { $check_authed = \IPS\Db::i()->select( 'id', 'amx_rejestracja_konta', array("Name=? AND ipsid=?", $values['amxPanel_auth_name'], 0) )->first(); if ($check_authed) { \IPS\Db::i()->update( 'amx_rejestracja_konta', array( "Name=? AND ipsid=?", $values['amxPanel_auth_name'], \IPS\Member::loggedIn()->member_id ) )->first(); \IPS\Output::i()->redirect( \IPS\Http\Url::internal( "app=amxpanel", 'front', 'main' ), \IPS\Member::loggedIn()->language()->addToStack('Zautoryzowano konto.') ); } else { \IPS\Output::i()->redirect( \IPS\Http\Url::internal( "app=amxpanel", 'front', 'main' ), \IPS\Member::loggedIn()->language()->addToStack('Podane konto jest już zautoryzowane') ); } } else { \IPS\Output::i()->redirect( \IPS\Http\Url::internal( "app=amxpanel", 'front', 'main' ), \IPS\Member::loggedIn()->language()->addToStack('Podane dane są nieprawidłowe.') ); } } \IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'main' )->authArea($form); Lecz po wpisaniu danych do formularza mam błąd nomessage związany z first(): UnderflowException thrown with message "" Stacktrace: #5 UnderflowException in /public_html/system/Db/Select.php:333 #4 IPS\Db\_Select:first in /public_html/applications/amxpanel/modules/front/main/index.php:44 #3 IPS\amxpanel\modules\front\main\_index:manage in /public_html/system/Dispatcher/Controller.php:96 #2 IPS\Dispatcher\_Controller:execute in /public_html/applications/amxpanel/modules/front/main/index.php:14 #1 IPS\amxpanel\modules\front\main\_index:execute in /public_html/system/Dispatcher/Dispatcher.php:129 #0 IPS\_Dispatcher:run in /public_html/index.php:1
  16. Hej, mam problem, robię integracje kont (Konto z serwera oraz IPS 4). Kompletnie nie wiem co jest źle. Pokazuje się, że login lub hasło są nie prawidłowe, mimo tego, że dobrze wpisuję. Próbowałem robić te zapytanie w ->select i ->query ale ten sam efekt. Kod IPS 4: foreach ( \IPS\Db::i( 'amx_db' )->select( 'COUNT(*) as count', 'registersystem', array( 'ipsid=?', \IPS\Member::loggedIn()->member_id )) as $a ) { $row[] = $a; } if (!$row[0]) { $form = new \IPS\Helpers\Form( 'form', 'game_authorize'); $form->addHeader(\IPS\Member::loggedIn()->language()->addToStack( 'Autoryzacja konta' )); $form->add( new \IPS\Helpers\Form\Text( 'game_auth_name', NULL, TRUE, array( 'minLength' => 2, 'maxLength' => 20), NULL, NULL, NULL, 'nazwa' ) ); $form->add( new \IPS\Helpers\Form\Password('game_auth_pass', NULL, TRUE, array( 'minLength' => 2, 'maxLength' => 20 ), NULL, NULL, NULL, 'pass' ) ); if ($values = $form->values()) { $qr = []; foreach(\IPS\Db::i( 'amx_db' )->query("SELECT * FROM registersystem WHERE Name='".\IPS\Request::i()->game_auth_name."' AND Password='".\IPS\Request::i()->game_auth_pass."'") as $c) { $qr[] = $c; } if (count($qr) == 0) { $error = "Login lub hasło są nie prawidłowe."; } else { $x3no = []; foreach( \IPS\Db::i( 'amx_db' )->select( '*', 'registersystem', array( 'Name="'.\IPS\Request::i()->game_auth_name.'" AND ipsid!="0"' ) ) as $h ) { $x3no[] = $h; } if (count($x3no) > 0) { $error = "Konto jest zintegrowane z innym uzytkownikiem"; } else { \IPS\Db::i( 'amx_db' )->query("UPDATE registersystem SET ipsid=".\IPS\Member::loggedIn()->member_id." WHERE `Name` LIKE '".\IPS\Request::i()->game_auth_name."'"); $sukces = 1; } } if (!empty($error)) { \IPS\Output::i()->redirect( \IPS\Http\Url::internal( "app=amxpanel", 'front', 'main' ), \IPS\Member::loggedIn()->language()->addToStack($error) ); } elseif ($sukces == 1) { \IPS\Output::i()->redirect( \IPS\Http\Url::internal( "app=amxpanel", 'front', 'main' ), \IPS\Member::loggedIn()->language()->addToStack('Twoje konta zostały pomyślnie zintegrowane') ); } } \IPS\Output::i()->output = \IPS\Theme::i()->getTemplate( 'main' )->authArea($form); Kod, który na IPB 3 działał: if (!$check_integration['ipsid'] == $this->memberData['member_id']) { $error = "<center><br/><br/><b>Masz już zintegrowane konto.</b></center>"; } else { $this->registry->DB('amx_db')->build( array( 'select' => '*', 'from' => 'registersystem', 'where' => 'Name="'.IPSText::parseCleanValue($_POST['user_nick']).'" AND Password="'.IPSText::parseCleanValue($_POST['user_pass']).'"' ) ); $this->registry->DB('amx_db')->execute(); if ($this->registry->DB('amx_db')->getTotalRows() == 0) { $error = "<center><br/><br/><b>Login lub hasło są nie prawidłowe.</b></center>"; } else { $result = $this->registry->DB('amx_db')->buildAndFetch( array( 'select' => '*', 'from' => 'registersystem', 'where' => 'Name="'.htmlentities($_POST['user_nick']).'" AND Password="'.md5(md5(htmlentities($_POST['user_pass']))).'"' ) ); $this->registry->DB('amx_db')->execute(); $query2 = $this->registry->DB('amx_db')->build( array( 'select' => '*', 'from' => 'registersystem', 'where' => 'Name = "'.$_POST['user_nick'].'" AND ipsid != "0"' ) ); $this->registry->DB('amx_db')->execute(); if ($this->registry->DB('amx_db')->getTotalRows() > 0) { $error = "<center><br/><br/><b>Konto jest zintegrowane z innym uzytkownikiem.</b></center>"; } else { $this->registry->DB('amx_db')->update( "registersystem", array('ipsid' => "".$this->memberData['member_id']."" ), 'Name="'.$_POST['user_nick'].'"' ); $this->registry->DB('amx_db')->execute(); $sukces = 1; } } } if (isset($error)) { $result = $error; } elseif (isset($sukces)) { $result = "<center><br/><br/><b>Twoje konta zostały pomyślnie zintegrowane!</b></center>"; } $panel .= $result;
  17. Witam, mam pytanie dotyczące szablonów w IP.Board 3. Czy jest jakaś funkcja szablonów dla for()? Wiem, ze jest <foreach> dla foreach() ale czy jest takie coś dla for()? Jeśli nie ma to jak najoptymalniej używać tej funkcji? Z góry dziękuje za odpowiedzi,
  18. Dzięki, działa. O tym bym nawet nie pomyślał. Dzięki za pomoc
  19. Jest to template hook, wyświetlany przed reputacją. Cały kod: <?php class show { private $registry; private $DB; private $memberData; private $settings; public function __construct() { $this->registry = ipsRegistry::instance(); $this->DB = $this->registry->DB(); $this->memberData =& $this->registry->member()->fetchMemberData(); $this->settings =& $this->registry->fetchSettings(); } public function getOutput() { $panelClass = IPSLib::loadLibrary( IPSLib::getAppDir( 'panel' ) . '/extensions/panel.php', 'panel' ); $panelClass = new $panelClass($this->registry); $panelClass->ConnectMySQL(); $member = IPSMember::load($this->request['id']); $check_integration = $this->registry->DB('samp_db')->buildAndFetch( array( 'select' => 'Score, Forum_ID', 'from' => 'Players', 'where' => 'Forum_ID="'.$member['member_id'].'"' ) ); $this->registry->DB('samp_db')->execute(); if ($check_integration['Forum_ID'] != 0) { return '<div class="reputation" style="color: #fff; background: #003D59;" data-tooltip="Ilość respektu na serwerze."><span class="number">'.$check_integration['Score'].'</span><span class="title">Respekt</span></div><br />'; } } }
×
×
  • 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ę.