Log in

View Full Version : Messed up RSS2 external file


steveneff
04-25-2008, 12:10 PM
I have the DaniWeb style rewrite on my vbulletin and decided to add these to external.php. After making the edits it worked fine at first but the RSS2 feed had two sets off links (RSS1 is OK), one with the original urls and another with the new urls. I left this thinking It would correct itself once a few new post?s had been added.
After a while when I checked the feed it still had both sets of urls, hadn?t updated and reported an error at the top ?Internet Explorer was unable to update this feed and will try again later.? I uploaded the original file but this did not fix the error, so again put my edited version back up thinking it may sort itself.

In the early hours this morning I had a massive attack on my forums that I fended off with the htaccess ?deny from? and went to bed.

This morning I checked my RSS2 feed and it still has the error, I also got some email?s about database error?s (around the time of the attack) from the RSS

Database error in vBulletin :

Invalid SQL:

SELECT *
FROM datastore
WHERE title IN ('','options','bitfields','attachmentcache','forum cache','usergroupcache','stylecache','languagecach e','products','pluginlist','cron','profilefield');

MySQL Error : Lost connection to MySQL server during query Error Number : 2013
Date : Friday, April 25th 2008 @ 05:03:05 AM
Script : /forums/external.php?type=RSS2
Referrer :
IP Address : 86.0.133.9
Username :
Classname : vB_Database


Database error in vBulletin 3.6.9:

Invalid SQL:

SELECT *
FROM session
WHERE userid = 0
AND host = '66.249.70.146'
AND idhash = 'b7a7a78a0f0ab05079e72c6a96628b62'
LIMIT 1;

MySQL Error : Lost connection to MySQL server during query Error Number : 2013
Date : Friday, April 25th 2008 @ 05:03:20 AM
Script : /forums/calendar.php?do=add&c=1&day=2001-12-1
Referrer :
IP Address : 66.249.70.146
Username :
Classname : vB_Database


Are these error?s just part of the attack and I should ignore them or are they part of my messed up external.php mod?
Is it possible to flush the externall.php feeds from the database to have a fresh look at the output?
Is there anything obvious I may have done wrong changing the urls in external.php?

Thanks for your help.

--------------- Added 1209130790 at 1209130790 ---------------

Edits I made in external.php

Original
case 'RSS':
$xml->add_group('item');
$xml->add_tag('title', unhtmlspecialchars($thread['title']));
$xml->add_tag('link', $vbulletin->options['bburl'] . "/showthread.php?t=$thread[threadid]&goto=newpost", array(), false, true);

Changed to
case 'RSS':
$xml->add_group('item');
$xml->add_tag('title', unhtmlspecialchars($thread['title']));
$xml->add_tag('link', $vbulletin->options['bburl'] . "/thread$thread[threadid].html", array(), false, true);


Original
case 'RSS1':
$xml->add_group('item', array('rdf:about' => $vbulletin->options['bburl'] . "/showthread.php?t=$thread[threadid]"));
$xml->add_tag('title', unhtmlspecialchars($thread['title']));
$xml->add_tag('link', $vbulletin->options['bburl'] . "/showthread.php?t=$thread[threadid]&goto=newpost", array(), false, true);

Changed to
case 'RSS1':
$xml->add_group('item', array('rdf:about' => $vbulletin->options['bburl'] . "/thread$thread[threadid].html"));
$xml->add_tag('title', unhtmlspecialchars($thread['title']));
$xml->add_tag('link', $vbulletin->options['bburl'] . "/thread$thread[threadid].html", array(), false, true);


Original
case 'RSS2':
$xml->add_group('item');
$xml->add_tag('title', unhtmlspecialchars($thread['title']));
$xml->add_tag('link', $vbulletin->options['bburl'] . "/showthread.php?t=$thread[threadid]&goto=newpost", array(), false, true);

Changed to
case 'RSS2':
$xml->add_group('item');
$xml->add_tag('title', unhtmlspecialchars($thread['title']));
$xml->add_tag('link', $vbulletin->options['bburl'] . "/thread$thread[threadid].html", array(), false, true);


Original
$xml->add_tag('category', unhtmlspecialchars($vbulletin->forumcache["$thread[forumid]"]['title_clean']), array('domain' => $vbulletin->options['bburl'] . "/forumdisplay.php?f=$thread[forumid]"));
$xml->add_tag('dc:creator', unhtmlspecialchars($thread['postusername']));
$xml->add_tag('guid', $vbulletin->options['bburl'] . "/showthread.php?t=$thread[threadid]", array('isPermaLink' => 'true'));

Changed to
$xml->add_tag('category', unhtmlspecialchars($vbulletin->forumcache["$thread[forumid]"]['title_clean']), array('domain' => $vbulletin->options['bburl'] . "/forum$thread[forumid].html"));
$xml->add_tag('dc:creator', unhtmlspecialchars($thread['postusername']));
$xml->add_tag('guid', $vbulletin->options['bburl'] . "/thread$thread[threadid].html", array('isPermaLink' => 'true'));

Dismounted
04-25-2008, 12:44 PM
The error indicates that in the middle of a query, the MySQL daemon cut the connection or shut down. It was probably part of the attack and it has probably restarted now.

steveneff
04-25-2008, 01:02 PM
Few, half way there, thanks dismounted, any idea's about the external.php RSS2 problem?

--------------- Added 1209136420 at 1209136420 ---------------

after uploading my updated external.php again this does now look to be working ok(maybe things got messed up as I was working on this when I got attacked).
It still has some duplicate post's because of the old urls but new post's are comming through on there own(new daniweb url only), so I guess the old urls will clear out in time. It would be nice if there was a way to clear them now.


*Warning*

If anyone else using the DaniWeb rewrite want's to make these edit's, you may want to replace the goto=newpost urls with the newpostinthread url, I didn't because I don't see the point in going to new post in thread, I just want the threads listed.

--------------- Added 1209136896 at 1209136896 ---------------

The old urls have now gone, they may have only been there because I was subcribed to the feed, after I unsubscribed they disapered.