View Single Post
  #319  
Old 10-07-2005, 03:40 PM
ixian's Avatar
ixian ixian is offline
 
Join Date: Oct 2001
Location: Denver, CO
Posts: 189
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well, thanks to The Geek, coder extraordinare of such addons as Geek Article System and Geek Mark, I got the variables problem fixed with PHP 5.0.5 and here's the thing - it might take care of the duplicate post problem some of you are experiencing as well.

In a nutshell, PHP 5.0.4 and above "fixed" a bug with passing variables as part of a string. You aren't supposed to be able to do that and in fact in a lot of cases it won't work if you do, but PHP previously wouldn't report an error message when it happened. Now it does and in fact stops the script from running further. This has caused some consternation as a lot of scripts which previously "worked" ended up breaking because of this fix, but in fact it's really a good thing long term since it exposes errors in code people never realized were there.

Case in point, this script: With PHP 5.0.5 the class_ffrss.php file errors out with the message I posted earlier. The string in question is on line 371:
Code:
$ThreadDM->setr('dateline', $this->get_dateline());
Which as you can plainly see is passing a variable as part of the string itself, which is a no no. You will also note that said string has to do with getting the date of the RSS feed it is about to post, which I suspect is the root cause of the double-posting a lot of you have been seeing - the string above will produce no error with PHP versions lower than 5.0.4 but neither will it work correctly.

To fix this error, replace line 371 shown above with:
Code:
$dateline = $this->get_dateline();
$ThreadDM->setr('dateline', $dateline);
The above will work whether you have PHP 5.0.5 or not, remember the "bug" has always been there, new versions of PHP just bother to point it out.

This works just fine for me and as an added bonus I have yet to see a duplicate post, although I can't guarentee this is the fix for that issue.

And be sure to thank The Geek and vote for his hacks because that guy is a genius.
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01177 seconds
  • Memory Usage 1,764KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.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_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • 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
  • showpost_complete