Ir para conteúdo

Devlong

Members
  • Total de itens

    4
  • Registro em

  • Última visita

Tudo que Devlong postou

  1. Devlong

    Trying to get property of non-object in

    Estou com esse erro quando tento usar PHP 7.1 ( no PHP 5.6 não dar erro ) rsslib.php <?php $RSS_Content = array(); function RSS_Tags($item, $type = 1, $channel_name="", $image="") { $y = array(); $tnl = $item->getElementsByTagName("title"); $tnl = $tnl->item(0); $title = $tnl->firstChild->textContent; $tnl = $item->getElementsByTagName("link"); $tnl = $tnl->item(0); $link = $tnl->firstChild->textContent; $tnl = $item->getElementsByTagName("pubDate"); $tnl = $tnl->item(0); $date = $tnl->firstChild->textContent; $y["channel"] = $channel_name; $y["title"] = $title; $y["link"] = $link; $y["date"] = $date; $y["type"] = $type; $y["image"] = $image; return $y; } function RSS_Channel( $channel, $key ) { global $RSS_Content; $items = $channel->getElementsByTagName("item"); $y = RSS_Tags($channel, 0); $channel_name = $y['title']; foreach($items as $item) { $y = RSS_Tags($item, 1, $channel_name, $key); array_push($RSS_Content, $y); } } function RSS_Retrieve( $urls = array() ) { global $RSS_Content; $RSS_Content = array(); foreach ( $urls as $key => $url ) { $doc_{$key} = new DOMDocument(); $doc_{$key}->load( $url ); $channels_{$key} = $doc_{$key}->getElementsByTagName("channel"); foreach( $channels_{$key} as $channel ) { RSS_Channel( $channel, $key ); } } } function RSS_RetrieveLinks($url) { global $RSS_Content; $doc = new DOMDocument(); $doc->load($url); $channels = $doc->getElementsByTagName("channel"); $RSS_Content = array(); foreach($channels as $channel) { $items = $channel->getElementsByTagName("item"); foreach($items as $item) { $y = RSS_Tags($item, 1); array_push($RSS_Content, $y); } } } function RSS_Links($url, $size = 15) { global $RSS_Content; $page = "<ul>"; RSS_RetrieveLinks($url); if($size > 0) $recents = array_slice($RSS_Content, 0, $size + 1); foreach($recents as $article) { $type = $article["type"]; if($type == 0) continue; $title = $article["title"]; $link = $article["link"]; $page .= "<li><a href=\"$link\">$title</a></li>\n"; } $page .="</ul>\n"; return $page; } function RSS_Display( $urls=array(), $size = 15, $site = 0 ) { global $RSS_Content; $site = 0; $site = (intval($site) == 0) ? 1 : 0; RSS_Retrieve( $urls ); RSS_Sort(); if($size > 0) { $recents = array_slice($RSS_Content, 0, $size); } return $recents; } function RSS_Sort() { global $RSS_Content; for( $i =0; $i < count( $RSS_Content ); $i++ ) { $array = array(); for( $j =$i+1; $j < count( $RSS_Content ) - $i; $j++ ) { if( strtotime($RSS_Content[$i]['date']) < strtotime($RSS_Content[$j]['date']) ) { $temp = array( 'channel' => $RSS_Content[$i]['channel'], 'title' => $RSS_Content[$i]['title'], 'link' => $RSS_Content[$i]['link'], 'date' => $RSS_Content[$i]['date'], //'description' => $RSS_Content[$i]['description'], 'image' => $RSS_Content[$i]['image'], 'type' => $RSS_Content[$i]['type'], ); $temp2 = array( 'channel' => $RSS_Content[$j]['channel'], 'title' => $RSS_Content[$j]['title'], 'link' => $RSS_Content[$j]['link'], 'date' => $RSS_Content[$j]['date'], //'description' => $RSS_Content[$j]['description'], 'type' => $RSS_Content[$j]['type'], 'image' => $RSS_Content[$j]['image'], ); $RSS_Content[$i] = $temp2; $RSS_Content[$j] = $temp; } } } } ?>
  2. Devlong

    Trying to get property of non-object in

    Sim, esse arquivo puxa as informações dos post em xml(rss) forum IPS.
  3. Devlong

    Trying to get property of non-object in

    Essa! $date = $tnl->firstChild->textContent;
  4. Devlong

    Ranking PHP

    Olá amigos, eu estou tentando descobrir como fazer o meu site puxar a informação especifica de uma variável na coluna da tabela. O meu arquivo ele registra a informação na tabela char_reg_num ele usa as colunas char_id, key e value, porem eu estou querendo puxar a informação especifica da coluna key pois ele registra 2 : m_kda ( kills ) e pl_dthcount ( deaths ) e o value ( numero ) Código padrão que veio no site. $sqlpvp = "SELECT `pvpladder`.`kills`, `pvpladder`.`streaks`, `pvpladder`.`deaths`, `char`.`name`, `char`.`class`, `char`.`base_level`, `char`.`job_level`, `char`.`account_id`, `char`.`online`, `login`.`---` FROM `pvpladder` LEFT JOIN `char` ON `char`.`char_id` = `pvpladder`.`char_id` LEFT JOIN `login` ON `login`.`account_id` = `char`.`account_id` WHERE `login`.`state` = '0' ORDER BY `pvpladder`.`kills` DESC, `pvpladder`.`streaks` DESC, `pvpladder`.`deaths` DESC, `char`.`base_exp` DESC LIMIT 0, 3"; no caso o que seria substituído é o pvpladder ( nome da tabela ) kills ( m_kda + value ) deaths ( pl_dthcount + value ) streaks ( no caso esse já n seria usado ) Esse é o arquivo que registra a informação no banco de dados: https://github.com/Stolao/Npc_Release/blob/master/PvP_Ladder/Pvp_Ladder.txt
×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.