Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions

Reply
 
Thread Tools Display Modes
  #1  
Old 07-02-2013, 05:35 AM
NeXuM NeXuM is offline
 
Join Date: Mar 2003
Posts: 105
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default can't open large RSS files

This is really weird and i really don't understand why it is happenning. I can't open large RSS feeds even if i limit vbulletin to import the first 10 items.

So i have created some test rss feeds to see at what point the bug happens.

This RSS feed will work perfectly:
http://pirate-punk.com/feed_test2.php

But if i add ONE more entry it stops working:
http://pirate-punk.com/feed_test.php

vBulletin tells me "XML error : No error at line 0" and this non-sense isn't helping me.

I'm really annoyed and i've tried everything.

Please can someone help me before i smash my keyboard on my head ? :P

I use vBulletin 3.6.4. A few years ago i have opened really large RSS files without problems but a few months ago i have moved to a new dedicated server. Maybe it is some option in php.ini preventing to open large files ?
Reply With Quote
  #2  
Old 07-02-2013, 06:38 AM
Zachery's Avatar
Zachery Zachery is offline
 
Join Date: Jul 2002
Location: Ontario, Canada
Posts: 11,440
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Do you have suhosin or mod_security loaded? What is the actual difference between the two files?
Reply With Quote
  #3  
Old 07-02-2013, 07:25 AM
NeXuM NeXuM is offline
 
Join Date: Mar 2003
Posts: 105
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

How can i know if i have suhosin or mod_security loaded ? i checked my phpinfo but couldn't find any match for those names

There is no big difference between the files. the first one (feed_test2.php) didn't work so i removed some <item> in the RSS file until it started working.
The only difference now is that "feed_test2.php" has one more <item> than "feed_test.php" so it must have something to do with the file size or lenght. So it is the exact same RSS feed but one has less entries.

feed_test2.php (not working) = 3536 lines (705 items in xml) php file is 69 368 bytes
feed_test.php (working) = 3531 lines (704 items in xml) php file is 69 270 bytes

My phpinfo = http://www.pirate-punk.net/phpinfo.php
XML's server phpinfo = http://www.pirate-punk.com/phpinfo.php
Both server are OVH dedicated servers
Reply With Quote
  #4  
Old 07-02-2013, 04:42 PM
Zachery's Avatar
Zachery Zachery is offline
 
Join Date: Jul 2002
Location: Ontario, Canada
Posts: 11,440
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

suhosin is a security patch, though I don't think its loaded.
mod_security is an apache module, it has rules that filter out "problematic" things.

Anything in your php/apache error logs?
Reply With Quote
  #5  
Old 07-02-2013, 05:13 PM
NeXuM NeXuM is offline
 
Join Date: Mar 2003
Posts: 105
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No, nothing in the error logs as far as i can tell. I have also my php.ini set to display errors and vBulletin isn't outputing any errors other than "Erreur XML : No error à la ligne 0"
Reply With Quote
  #6  
Old 07-03-2013, 11:18 PM
NeXuM NeXuM is offline
 
Join Date: Mar 2003
Posts: 105
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I gave up and ended up writing my own RSS poster in PHP. Everything is working now if i use my own script instead of vbulletin built-in rss poster.
Reply With Quote
  #7  
Old 07-04-2013, 04:28 AM
tbworld tbworld is offline
 
Join Date: Oct 2008
Posts: 2,126
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Would be nice if you posted your fix to help others that might have the same problem. Give a little back.
Glad your up and running though, nice site.
Reply With Quote
  #8  
Old 07-04-2013, 05:12 AM
Zachery's Avatar
Zachery Zachery is offline
 
Join Date: Jul 2002
Location: Ontario, Canada
Posts: 11,440
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

He wrote his own importer, that's not really a fix. Hard to debug this one though.

I suspect another error occurred, but you weren't being alerted to it.
Reply With Quote
  #9  
Old 07-04-2013, 07:00 AM
tbworld tbworld is offline
 
Join Date: Oct 2008
Posts: 2,126
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Zachery View Post
He wrote his own importer, that's not really a fix.
Just to be clear, I have not used the 3.6.4 version of vbulletin so I should not have used the word 'fix'. That implies that there is a bug in the vbulletin code and I have no idea if the thread-owners problem exists in that version.

My suggestion was to just help the vb.org community, and if you ask others for a solution to problems you are having: It is just nice to share your results. I mean no disrespect to the thread owner, nor vbulletin.
Reply With Quote
  #10  
Old 07-05-2013, 03:47 PM
NeXuM NeXuM is offline
 
Join Date: Mar 2003
Posts: 105
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm not sure if there is a bug with vBulletin 3.6.4 RSS importer, like i said it works with small feeds but returns an error when the feed is too large. And also, i have already used the exact same version of VB to import a very large feed but that was over 3 years ago and i have moved server since then. I'm not sure what went wrong.

Anyway, here is the script i wrote to import my RSS feed into vBulletin:

Code:
<?php
header('Content-Type: text/html; charset=utf-8');
require_once('./global.php');
require_once('./includes/functions_databuild.php');
error_reporting(E_ALL & ~E_NOTICE & ~8192);

$itemnumber = "0";

$xml = file_get_contents("your_feed_url");
$sxml = simplexml_load_string($xml);

foreach($sxml->channel->item as $name => $row)
{
$itemnumber = $itemnumber + 1;
if ($itemnumber > 50) {
// uncomment if you want to limit to 50 entries
// break;
}

$forumid = 98;
$userid = "1";
$title = utf8_decode($row->title);
$pagetext = utf8_decode($row->description);


// Create a new datamanager for posting
$threaddm =& datamanager_init('Thread_FirstPost', $vbulletin, ERRTYPE_ARRAY, 'threadpost');
$allowsmilie = '0';                                                             // Are we allowing smilies in our post
$visible = '1';      // If the post visible (ie, moderated or not)

// check if the post already exists
$mtitle = addslashes(htmlspecialchars($title));
	$query = "SELECT * FROM thread WHERE title = '$mtitle' AND forumid = '$forumid' AND postuserid = '$userid'";
	$res = mysql_query($query) or die(mysql_error());
	$exist = mysql_num_rows($res);
	if ($exist == 1) {
	echo "item # $itemnumber already exists ($title)<br><br>";
	}
	if ($exist == 0) {
	echo "item # $itemnumber posted ($title)<br><br>";
		// post the shit
		$foruminfo = fetch_foruminfo($forumid);
		$threadinfo = array();
		$user = htmlspecialchars_uni( fetch_userinfo($userid) );

		$threaddm->set_info('forum', $foruminfo);
		$threaddm->set_info('thread', $threadinfo);
		$threaddm->setr('forumid', $forumid);
		$threaddm->setr('userid', $userid);
		$threaddm->setr('pagetext', $pagetext);
		$threaddm->setr('title', $title);
		$threaddm->set('allowsmilie', $allowsmilie);
		$threaddm->set('visible', $visible);

		// Lets see what happens if we save the page
		$threaddm->pre_save();
		if(count($threaddm->errors) < 1) {
			// Basically if the page will save without errors then let do it for real this time
			$threadid = $threaddm->save();
			unset($threaddm);
		} else {
			// There was errors in the practice run, so lets display them
			var_dump ($threaddm->errors);
		}
	}

}
?>
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 03:23 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.06001 seconds
  • Memory Usage 2,255KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete