Soyez le premier à donner votre avis sur cette source.
Snippet vu 5 579 fois - Téléchargée 28 fois
<? # -- CONFIGURATION - # $conf_host = "cubelan.euroserv.com"; $conf_port = 80; $conf_httpquery = "GET http://cubelan.euroserv.com/rcube.php HTTP/1.0\n\n"; $conf_limitnews = 5; # -- /CONFIGURATION - # function get_tagint($str_base,$str_tag) { $wprop_name_start = 1; $ftag_end_pos = $wprop_name_end = $wprop_equal = $wprop_value = $wprop_value_start = $wprop_value_end = $prop_value_quote = 0; $thiscar = $tag_int = $cprop_name = $cprop_value = $cprop_name_bu = ""; $properties = array(); $tag_startpos = strpos($str_base,"<$str_tag"); $tag_endpos = strpos($str_base,"</$str_tag>"); # - CHERCHE CHAQUE PROPRIETE DU TAG - # for($i=(strlen($str_tag)+2);$i<($tag_endpos-$tag_startpos);$i++) { $thiscar = substr($str_base,$tag_startpos+$i,1); if($wprop_name_start==1 && $thiscar!=" " && $thiscar!="=" && $thiscar!=">") { $cprop_name .= $thiscar; $wprop_name_start = 0; $wprop_name_end = 1; } elseif($wprop_name_start==1 && $thiscar==">") { $wprop_name_start = $wprop_name_end = $wprop_equal = $wprop_value_start = $wprop_value_end = $prop_value_quote = 0; $ftag_end_pos = $tag_startpos+$i; } elseif($wprop_name_end==1 && $thiscar!=" " && $thiscar!="=") { $cprop_name .= $thiscar; } elseif($wprop_name_end==1 && ($thiscar==" " || $thiscar=="=")) { $wprop_name_end = 0; if($thiscar=="=") { $wprop_value_start = 1; } $cprop_name_bu = $cprop_name; $properties[$cprop_name_bu] = "tg"; $cprop_name = ""; } elseif($wprop_value_start==1 && $thiscar!=" ") { if($thiscar == "\"") { $prop_value_quote=1; $wprop_value_start=0; $wprop_value_end=1; } else { $prop_value_quote=0; $wprop_value_start=0; $wprop_value_end=1; $cprop_value.="$thiscar"; } } elseif($wprop_value_end==1) { if(($prop_value_quote==1 && $thiscar=="\"") || ($prop_value_quote==0 && $thiscar==" ")) { $wprop_value_end=0; $prop_value_quote=0; $wprop_name_start=1; $properties[$cprop_name_bu]=$cprop_value; $cprop_value="";} else { $cprop_value.="$thiscar"; } } } # - RECUPERE LE CONTENU DU TAG - # $tag_int = substr($str_base,$ftag_end_pos+1,$tag_endpos-($ftag_end_pos+1)); $result = array(); $result[0] = $properties; $result[1] = $tag_int; return $result; } $rnws_source = $rnws_txt = $doc_headers = ""; $pos_pagestart = $headers_count = $headers_fnsh = 0; $headers = array(); $fp = fsockopen($conf_host, $conf_port, &$errno, &$errstr, 30); if(!$fp) { echo "err: $errstr ($errno)<br>\n"; } else { fputs($fp,$conf_httpquery); while(!feof($fp)) { $rnws_source .= fgets($fp,128); } fclose($fp); } # - RECUPERE LES HEADERS, ET LES STOCK DANS UN ARRAY - # $headers_tempo = ""; while($headers_fnsh == 0) { $line_endpos = strpos($rnws_source,"\r\n"); if($header_count == 0) { $headers_tempo = substr($rnws_source,0,$line_endpos); } else { $headers_tempo = substr($rnws_source,2,$line_endpos); } if($headers_tempo == "") { $headers_fnsh = 1; } else { $headers[$headers_count] = $headers_tempo; $rnws_source = substr($rnws_source,$line_endpos+2,strlen($rnws_source)-($line_endpos+2)); $headers_count += 1; } } $rnws_source = substr($rnws_source,2,strlen($rnws_source)-2); $arr_news = array(); $arr_news = split("</NEWS>",$rnws_source); $news_counter = 0; # - PARCOURE TOUTES LES NEWS - # foreach($arr_news as $news_code => $news_rcode) { if($news_counter <= $conf_limitnews && ($news_rcode != "" && $news_rcode != "\n")) { $this_newsrcode = $news_rcode . "</NEWS>"; $rcode_props = array(); $rcode_props = get_tagint("$this_newsrcode","NEWS"); echo "<A style=\"font-family:verdana;font-size:11px;\">" .date("d/m/Y",$rcode_props[0][postdate]) . "</A> : <A style=\"font-family:verdana;font-size:11px;color:#0000aa;\" href=\"http://cubelan.euroserv.com/index.php?newsid=" .$rcode_props[0][id]. "\" target=_blank>" .$rcode_props[0][title] . "<BR>"; $news_counter += 1; } } ?>
Vous n'êtes pas encore membre ?
inscrivez-vous, c'est gratuit et ça prend moins d'une minute !
Les membres obtiennent plus de réponses que les utilisateurs anonymes.
Le fait d'être membre vous permet d'avoir un suivi détaillé de vos demandes et codes sources.
Le fait d'être membre vous permet d'avoir des options supplémentaires.