vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   Atakan Rss Feeds Views 2.00 (https://vborg.vbsupport.ru/showthread.php?t=108400)

Mysticales 08-14-2006 10:30 PM

Im trying this out for now.. Gonna see how it is, cause if this works nice.. no need to get a bot to make a thread with RSS news.

Mysticales 08-18-2006 03:59 AM

Hey question, we like this hack alot, is there a way to make it so it only shows a preview of each news article shown? Like a small preview, few sentances, then after that it will say "More" which is a link to the orig article so they can be guided to the full news shown?

naeemakhtar 08-18-2006 04:27 PM

pls delete...

mholtum 08-23-2006 02:16 AM

is this going to be converted for 3.6?

liljimmy 09-24-2006 02:42 AM

Quote:

Originally Posted by hex1848
I was able to get this fixed. The reason it was breaking is that many hosting providers have disabled fopen. As mentioned in a previous post in this thread the fopen calls needed to be replaced with cURL. I did a little research to figure out what needed to be done.

You need to edit the includes/xmlparser.php file and replace the render_news function with the code below:

New function (use this):
PHP Code:

function render_news($feed_url$showdetail$headlinestyle$detailstyle) {
    global 
$show_detail$headline_style$detail_style$max$count$insideitem$insideimage$code2;
    
$insideitem=false;
    
$insideimage=false;
    
$count 0;
    
$show_detail $showdetail;
    
$headline_style $headlinestyle;
    
$detail_style $detailstyle;

    
$xml_parser xml_parser_create();
    
xml_set_element_handler($xml_parser"startElement""endElement");
    
xml_set_character_data_handler($xml_parser"characterData");
    
    
$ch curl_init();
    
curl_setopt($chCURLOPT_URL$feed_url);
    
curl_setopt ($chCURLOPT_RETURNTRANSFER1);
    
$store curl_exec ($ch);
    
$xml curl_exec ($ch);
    
curl_close ($ch); 
    
    if (!
xml_parse($xml_parser$xmlTrue))
     {
     die(
sprintf("XML error: %s at line %d",
      
xml_error_string(xml_get_error_code($xml_parser)),
      
xml_get_current_line_number($xml_parser)));
     }
 
    
// Free up memory used by the XML parser
    
xml_parser_free($xml_parser);


Old function (for comparison):

PHP Code:

function render_news($feed_url$showdetail$headlinestyle$detailstyle) {
    global 
$show_detail$headline_style$detail_style$max$count$insideitem$insideimage$code2;
    
$insideitem=false;
    
$insideimage=false;
    
$count 0;
    
$show_detail $showdetail;
    
$headline_style $headlinestyle;
    
$detail_style $detailstyle;

    
$xml_parser xml_parser_create();
    
xml_set_element_handler($xml_parser"startElement""endElement");
    
xml_set_character_data_handler($xml_parser"characterData");
    
$fp = @fopen($feed_url,"r");
//           or die("Error reading RSS data.");
    
if ($fp) {
        while (
$data fread($fp4096))
           
xml_parse($xml_parser$datafeof($fp))
               or die(
sprintf("XML error: %s at line %d",  
                   
xml_error_string(xml_get_error_code($xml_parser)),  
                   
xml_get_current_line_number($xml_parser)));
        
fclose($fp);
        } else {
        
$code2 .= "<span class=\""$detail_style ."\">Syndicated content not available</span>";
        }
        
    
    
// Free up memory used by the XML parser
    
xml_parser_free($xml_parser);



That works wonderfully! Many, many, many thanks Hex!!! :cool:

jyajay 11-12-2006 01:00 PM

Quote:

Originally Posted by mholtum
is this going to be converted for 3.6?

Doesn't need to, works fine with 3.6.3 :)

Vehbi KOC 07-30-2007 01:21 PM

eline sağlık Atakan:)
thank you....

IRCMedya 10-12-2007 01:47 PM

S?persin birader ;)

Thank you.

otto 02-03-2008 10:32 AM

First: Sorry for my bad english! ;)

For german friends and all others with the same ?,?,?,? ... problem:

please make the follow steps:

Wegen des Umlautproblems: ?,?,? ...
in der Datei newsview.php suche:
PHP Code:

render_news($rssxxxtrue'news''news'); 

und ersetze mit:
PHP Code:

render_news($rssxxxtrue'news''news');

$trans = array("ü" => "?",
               
";amp;uuml;" => "?",
               
"ö" => "?",
               
";amp;ouml;" => "?",
               
"ä" => "?",
               
";amp;auml;" => "?",
               
"?œ" => "?",
               
"?–" => "?",
               
"?‰" => "?",
               
"é" => "?",
               
"«" => ">",
               
"»" => "<",
               
"?€ž" => "''",
               
"?€œ" => "''",
               
"?Ÿ" => "?",
               
";amp;szlig;" => "?",
               
"ô" => "?",
               
";quot;" => "''",
               );
$code2 strtr($code2,$trans); 

So klapts :up:

@ Modder

Great Mod - thanks! :up:

evesve 02-10-2008 04:14 PM

Thanks!

2 more lines for Swedes:
PHP Code:

               "å" => "?",
               
"Å" => "?"



All times are GMT. The time now is 06:06 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01177 seconds
  • Memory Usage 1,781KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (5)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete