![]() |
![]() ![]() |
![]() |
![]()
Post
#1
|
|
Grupa: Zarejestrowani Postów: 61 Pomógł: 0 Dołączył: 15.11.2012 Ostrzeżenie: (0%) ![]() ![]() |
Witam, nie bardzo do końca wiem, co chce tutaj napisać. Wiem jedynie co chce osiagnąć. Mam danego ifa gdzie trzymam w bazie wybraną wartość od 0 do 2
Osiągnąć chciałbym by móc sterować tymi wartościami i móc wybrać jaka petla if ma się wyświetlać na stronie. Tutaj mam co nie co naskrobane, tyle że wyświetla błąd. Błąd: Kod A PHP Error was encountered Severity: Notice Message: Undefined variable: songtitle Zawartość controlera Kod public function index() { require APPPATH . 'vendor/Shoutcastv2.php'; $sc = new CI_Shoutcast(Settings_model::$db_config['shoutcast_host'], Settings_model::$db_config['shoutcast_port']); //$content_data = array(); if (Settings_model::$db_config['shoutcast_version'] == 2) { if (! $sc->getBasicStats()) { $content_data['error'] = $sc->getError(); } else { $content_data['currentlisteners'] = $sc->currentListeners; $content_data['peaklisteners'] = $sc->peakListeners; $content_data['maxlisteners'] = $sc->maxListeners; $content_data['uniquelisteners'] = $sc->uniqueListeners; $content_data['bitrate'] = $sc->bitrate; $content_data['songtitle'] = $sc->songTitle; } } $content_data['streamstatus'] = $sc->streamStatus; $this->quick_page_setup(Settings_model::$db_config['active_theme'], 'main', 'Shoutcast', 'shoutcast', 'header', 'footer', Settings_model::$db_config['active_theme'], $content_data); } View Kod <?php if (!empty($streamstatus)) { ?> <?php print $songtitle; ?> <?php print $peaklisteners; ?> <?php }else{ ?> <?php print $error; ?> <?php } ?> Dokładnie chodzi mi o tp: Kod if (Settings_model::$db_config['shoutcast_version'] == 2) { Gdzie wartość 2, wyświetla wybraną funkcje którą chce uzyskać Ten post edytował armind 16.04.2017, 20:38:28 |
|
|
![]()
Post
#2
|
|
![]() Grupa: Moderatorzy Postów: 36 557 Pomógł: 6315 Dołączył: 27.12.2004 ![]() |
Czego nie rozumiesz w komunikacie
Cytat Message: Undefined variable: songtitle ? Przenosze -------------------- "Myśl, myśl, myśl..." - Kubuś Puchatek || "Manual, manual, manual..." - Kubuś Programista "Szukaj, szukaj, szukaj..." - Kubuś Odkrywca || "Debuguj, debuguj, debuguj..." - Kubuś Developer |
|
|
![]() ![]() |
![]() |
Wersja Lo-Fi | Aktualny czas: 8.07.2025 - 06:00 |