View Single Post
  #1531  
Old 10-21-2009, 02:40 PM
AfterWorldForum AfterWorldForum is offline
 
Join Date: Dec 2008
Posts: 154
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quick revision to my edit in post 1523.

One of my users found that someone had been able to bid less than the starting price, and it's due to me having been sloppy.

Quote:
And another edit further down. Look for:


Code:
Code:
	              if ($item['price'] + $item['inc'] > $vbulletin->GPC['bid']) {
	                  eval(standard_error(fetch_error('vbay_bid_higher')));
	              }
              if ($item['bids'] > 0) {
Replace with:

Code:
Code:
              if ($item['bids'] > 0) {
	              if ($item['price'] + $item['inc'] > $vbulletin->GPC['bid']) {
	                  eval(standard_error(fetch_error('vbay_bid_higher')));
	              }
I intended this to work and only insist the price + inc would be required after an initial bid was made. After all, if you're the first bidder on Ebay, you perfectly well can make an offer equal to the quoted startbid.

But my fix was incomplete. When there were no bids, it would be possible to bid whatever one liked. EVEN if that price was below the start price.

Luckily, the fix is also easy:

If you made the fix mentioned above, find this in the code:
Code:
              if ($item['bids'] > 0) 
				 {
	              if ($item['price'] + $item['inc'] > $vbulletin->GPC['bid']) {
	                  eval(standard_error(fetch_error('vbay_bid_higher')));
	              }
                  $pmhigh_bidder = $vbulletin->db->query("select * from " . TABLE_PREFIX . "user where userid='{$item['highbidder']}'");
                  $pmbidder = $vbulletin->db->fetch_array($pmhigh_bidder);
                  $title = "$vbphrase[vbay_pm_you_have_been_outbid] {$item['name']}";
                  $message = $vbphrase['vbay_pm_you_have_been_outbid_message'];
                  send_pm($vbulletin->userinfo['username'], $vbulletin->userinfo['userid'], $pmbidder['username'], $title, $message);
              }
Below that, add:
Code:
			  // Ensure that bid is higher thandesired opening bid
			  else
			  {
					if ($item['price'] > $vbulletin->GPC['bid']) {
	                  eval(standard_error(fetch_error('vbay_bid_higher')));
	              }
			  }
A thousand pardons to everyone.

Still a great mod, though. Anxiously awaiting the next version. I might throw in some loggin features when the next version is available, but I figured I'd wait before going down that road.

By the way, will it be possible to somehow skip reimporting the languages and phrases? I reworded quite a bit, and would prefer keeping my edits
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02165 seconds
  • Memory Usage 1,772KB
  • 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
  • (4)bbcode_code
  • (1)bbcode_quote
  • (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