phpbb-auction.com Forum Index phpbb-auction.com
Download, Support, Documentation
 
Donate to phpbb-auction.com to support the project


phpbb-Auction
  Home
   - News
   - Bug report/Patches
   - Future Features
  Demo
  Downloads
   - Version 1.3m  (Core /Lang /Mods)
   - Version 1.2m  (Core /Lang /Mods)
   - Version 1.0m  (Core /Lang /Mods)
   - All
  Services
  Documentation
   - Features
   - Documents
   - How-Tos
   - About
  Support
   - English
   - German
  Development
   - Changlog
   - Requests
   - Team
   - CVS
  Community
   - Website of the Month
   - Websites
   - Community Forum
   - Member

Navigation
FAQFAQ
SearchSearch
UsergroupsUsergroups
RegisterRegister
ProfileProfile
Log in to check your private messagesLog in to check your private messages
Log inLog in

Forum
Changing start time auctions
Sun Feb 07, 2010 4:33 am FR
Easy: what code to use to update sql table?
Fri Oct 16, 2009 8:39 am guyb
Unlimited products(downloads)
Wed Oct 14, 2009 7:09 pm hoimyr
Seller chooses currency
Sun Oct 11, 2009 8:00 pm hoimyr
Cant select end date without getting error
Sun Oct 11, 2009 6:43 pm hoimyr

About
Author: FR
Credits:
Brookfresh, Brad Lawryk, Crogon, DaMysterious, EklipzeDesigns, ML, musashi, phpBB Group, phpBB-Auction-Team, php-styles, sanman, Tel, Vampy, wGEric

Supported Sites





Statistics
User: 20106
Posts: 18401
Latest User: freddieaq16

I get an error when I want to view an auction

 
Post new topic   Reply to topic    phpbb-auction.com Forum Index -> Older Version
View previous topic :: View next topic  
Author Message
Kiss News
Super Auctioneer
Super Auctioneer


Joined: 15 Jul 2004
Posts: 232

PostPosted: Thu Jul 29, 2004 12:41 am    Post subject: I get an error when I want to view an auction Reply with quote

Hello!
I have just installed the auction here:
http://www.kissfanshop.de/phpbb2/auction_room.php?ar=1
When I click on the auction to see it "3 paar stinkende Socken", I get this error:
Quote:
Parse error: parse error in /mnt/ls6/15/131/00000000/htdocs/phpbb2/auction_offer_view.php on line 217
Code:


auction_offer_view.php line 217 is:
$lang['auction_offer_add_to_watchlist'] . '" title="' . $lang['auction_offer_add_to_watchlist'] . '" border="0" /></a>';
}
} // End if
// FEATURE OFFER
if ( $userdata['user_level']==1 )
Quote:

shall I take off // End if to solve the problem?
Back to top
View user's profile Send private message
FR
Site Admin
Site Admin


Joined: 26 Jan 2004
Posts: 1764
Location: root directory

PostPosted: Thu Jul 29, 2004 7:16 am    Post subject: Reply with quote

the // If is correct.
please post some more code around line 217 and indicate the 217 row.
_________________
Want to say thank you. Use my Amazon Wishlist
Meet the world on movie-on.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
Kiss News
Super Auctioneer
Super Auctioneer


Joined: 15 Jul 2004
Posts: 232

PostPosted: Thu Jul 29, 2004 8:21 am    Post subject: Reply with quote

line 190-248 of auction_offer_view.php
Quote:
));
} // End for
}
else
{
$auction_offer_bid_total = $lang['auction_no_bid'];
$auction_offer_bid_max = $lang['auction_no_bid'];
} // End if

// Extra-features currently just for admin
$auction_offer_delete_image = '';
$auction_offer_move_image = '';
$auction_offer_edit_image = '';
$auction_offer_special_image = '';
$auction_offer_add_to_watchlist_image = '';

if ($userdata['user_level'] == ADMIN)
{
$auction_offer_delete_image = '<a href="' . append_sid("auction_offer.$phpEx?mode=delete&" . POST_AUCTION_OFFER_URL . "=" . $auction_offer_id) . '"><img src="' . $images['icon_auction_delete'] . '" alt="' . $lang['auction_offer_delete'] . '" title="' . $lang['auction_offer_delete'] . '" border="0" /></a>';
$auction_offer_special_image = '<a href="' . append_sid("auction_offer.$phpEx?mode=feature&" . POST_AUCTION_OFFER_URL . "=" . $auction_offer_id) . '"><img src="' . $images['icon_auction_feature'] . '" alt="' . $lang['auction_offer_feature'] . '" title="' . $lang['auction_offer_feature'] . '" border="0" /></a>';
$auction_offer_move_image = '<a href="' . append_sid("auction_offer.$phpEx?mode=move_select&" . POST_AUCTION_OFFER_URL . "=" . $auction_offer_id) . '"><img src="' . $images['icon_auction_move'] . '" alt="' . $lang['auction_offer_move'] . '" title="' . $lang['auction_offer_move'] . '" border="0" /></a>';
}

if ($userdata['user_level'] != ANONYMOUS)
{
$auction_offer_add_to_watchlist_image = '<a href="' . append_sid("auction_myauctions.php?mode=add_to_watchlist&" . POST_AUCTION_OFFER_URL . "=" . $auction_offer_id) . '"><img src="' . $images['icon_auction_watch'] . '" alt="' . $lang['auction_offer_add_to_watchlist'] . '" title="' . $lang['auction_offer_add_to_watchlist'] . '" border="0" /></a>';
}
} // End if

// FEATURE OFFER
if ( $userdata['user_level']==1 )
{
$auction_offer_feature_link = append_sid("auction_offer.$phpEx?mode=feature&" . POST_AUCTION_OFFER_URL . "=" . $auction_offer_id . '');
}
else
{
$auction_offer_feature_link = "";
} // End if

// Move offer
if ( $userdata['user_level']==1 )
{
$auction_offer_move_link = append_sid("auction_offer.$phpEx?mode=move_select&" . POST_AUCTION_OFFER_URL . "=" . $auction_offer_id . '');
}
else
{
$auction_offer_move_link = "";
} // End if


// UPDATE OFFER-VIEWS
$sql = "UPDATE " . AUCTION_OFFER_TABLE . "
SET auction_offer_views = auction_offer_views + 1
WHERE PK_auction_offer_id = " . $auction_offer_id . "";

if( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not update offer views', '', __LINE__, __FILE__, $sql);
}

it is basically the original file with one bug fixed that was reported...
Back to top
View user's profile Send private message
FR
Site Admin
Site Admin


Joined: 26 Jan 2004
Posts: 1764
Location: root directory

PostPosted: Thu Jul 29, 2004 11:51 am    Post subject: Reply with quote

Rolling Eyes

try to delete the
} // End if
in the line with the error.
_________________
Want to say thank you. Use my Amazon Wishlist
Meet the world on movie-on.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
Kiss News
Super Auctioneer
Super Auctioneer


Joined: 15 Jul 2004
Posts: 232

PostPosted: Thu Jul 29, 2004 3:36 pm    Post subject: Reply with quote

OK, after I delete line 217 it works:
http://www.kissfanshop.de/phpbb2/auction_offer_view.php?ao=1

why did only I have this problem?

some icons are not showing up? some icons seem to be in the wrong folder...? May I ask, what the correct folder is they should be in?


When I want to place a bid (on my own auction), it works (although i think it should NOT work bidding on your own auctions if I am not mistaken...),
and I get some Error-lines:
Quote:
Warning: Missing argument 2 for prepare_message() in /mnt/ls6/15/131/00000000/htdocs/phpbb2/includes/functions_post.php on line 46

Warning: Missing argument 3 for prepare_message() in /mnt/ls6/15/131/00000000/htdocs/phpbb2/includes/functions_post.php on line 46

Warning: Missing argument 4 for prepare_message() in /mnt/ls6/15/131/00000000/htdocs/phpbb2/includes/functions_post.php on line 46

Warning: Missing argument 2 for prepare_message() in /mnt/ls6/15/131/00000000/htdocs/phpbb2/includes/functions_post.php on line 46

Warning: Missing argument 3 for prepare_message() in /mnt/ls6/15/131/00000000/htdocs/phpbb2/includes/functions_post.php on line 46

Warning: Missing argument 4 for prepare_message() in /mnt/ls6/15/131/00000000/htdocs/phpbb2/includes/functions_post.php on line 46

you are welcome to test it (log in: tester/tester)
http://www.kissfanshop.de/phpbb2/auction.php
Back to top
View user's profile Send private message
FR
Site Admin
Site Admin


Joined: 26 Jan 2004
Posts: 1764
Location: root directory

PostPosted: Thu Jul 29, 2004 3:45 pm    Post subject: Reply with quote

you can bid on your own offers. why not?
there was a discussion about it. next version has a switch to turn it off.

The other error you are getting has been discussed before, too. There should be a fix around on this board.

Think that was the thread:
http://www.phpbb-auction.com/viewtopic.php?t=181&highlight=preparemessage

I suggest you wait for the next release.
_________________
Want to say thank you. Use my Amazon Wishlist
Meet the world on movie-on.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
Kiss News
Super Auctioneer
Super Auctioneer


Joined: 15 Jul 2004
Posts: 232

PostPosted: Thu Jul 29, 2004 4:22 pm    Post subject: Reply with quote

I installed all bug fixes...

also this one:
http://www.phpbb-auction.com/viewtopic.php?p=1707#1707

but I get basically the same Error than the original poster in that other thread when I do this
Quote:
Parse error: parse error in /mnt/ls6/15/131/00000000/htdocs/phpbb2/auction_offer.php on line 790


line 790 is that NEW prepare-message...
Back to top
View user's profile Send private message
Kiss News
Super Auctioneer
Super Auctioneer


Joined: 15 Jul 2004
Posts: 232

PostPosted: Fri Jul 30, 2004 12:53 pm    Post subject: Reply with quote

this is line 46 in includes/functions_post.php

Quote:
function prepare_message($message, $html_on, $bbcode_on, $smile_on, $bbcode_uid = 0)
Back to top
View user's profile Send private message
FR
Site Admin
Site Admin


Joined: 26 Jan 2004
Posts: 1764
Location: root directory

PostPosted: Fri Jul 30, 2004 2:45 pm    Post subject: Reply with quote

Kiss News wrote:
this is line 46 in includes/functions_post.php

Quote:
function prepare_message($message, $html_on, $bbcode_on, $smile_on, $bbcode_uid = 0)



thats not helping us. Sad
We need the file that is showing the error, not the one producing it. (i know its confusing)
Its the file shown in the address-bar when you get the error displayed (probably its the auction_offer_view.php).
Post the whole code in here and disable html (its a small box below the input textarea)
_________________
Want to say thank you. Use my Amazon Wishlist
Meet the world on movie-on.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
Kiss News
Super Auctioneer
Super Auctioneer


Joined: 15 Jul 2004
Posts: 232

PostPosted: Fri Jul 30, 2004 2:55 pm    Post subject: Reply with quote

when this Error is shown, the URL says
Quote:
http://www.kissfanshop.de/phpbb2/auction_offer.php?mode=bid&ao=3


auction_offer_view is in the URL before I place the bid..

so, do you need the auction_offer.php file?
Back to top
View user's profile Send private message
Kiss News
Super Auctioneer
Super Auctioneer


Joined: 15 Jul 2004
Posts: 232

PostPosted: Fri Jul 30, 2004 3:00 pm    Post subject: Reply with quote

however, here is auction_offer.php (I hope this is the one you need Rolling Eyes )


Quote:
<?php
/***************************************************************************
* auction_offer.php
* -------------------
* begin : January 2004
* copyright : (C) FR
* email : fr@php-styles.com
*
***************************************************************************/

/***************************************************************************
*
* This hack is released under the GPL License.
* This hack can be freely used, but not distributed, without permission.
* Intellectual Property is retained by the author listed above.
*
***************************************************************************/

define('IN_PHPBB', 1);
define('SHOW_ONLINE', true);
$phpbb_root_path = './';
include_once($phpbb_root_path . 'extension.inc');
include_once($phpbb_root_path . 'common.'.$phpEx);
include_once($phpbb_root_path . 'auction/functions_blocks.php');
include_once($phpbb_root_path . 'auction/functions_general.php');
include_once($phpbb_root_path . 'auction/functions_validate.php');
include_once($phpbb_root_path . 'auction/auction_constants.php');
include_once($phpbb_root_path . 'includes/functions_post.php');

// BEGIN session management
$userdata = session_pagestart($user_ip, 444);
init_userprefs($userdata);
// END session management

// START Include language file
$language = $board_config['default_lang'];
if( !file_exists($phpbb_root_path . 'language/lang_' . $language . '/lang_auction.'.$phpEx) )
{
$language = 'english';
}
include($phpbb_root_path . 'language/lang_' . $language . '/lang_auction.' . $phpEx);
// END include language file

// BEGIN include auction-config information
$auction_config_data = init_auction_config();
// END include auction-config information

if ( $auction_config_data['auction_disable'] == 1 )
{
message_die(GENERAL_MESSAGE, $lang['auction_disable']);
}


// Information for the standard Who-is-Online-Block
$total_posts = get_db_stat('postcount');
$total_users = get_db_stat('usercount');
$newest_userdata = get_db_stat('newestuser');
$newest_user = $newest_userdata['username'];
$newest_uid = $newest_userdata['user_id'];

if( $total_posts == 0 )
{
$l_total_post_s = $lang['Posted_articles_zero_total'];
}
else if( $total_posts == 1 )
{
$l_total_post_s = $lang['Posted_article_total'];
}
else
{
$l_total_post_s = $lang['Posted_articles_total'];
}

if( $total_users == 0 )
{
$l_total_user_s = $lang['Registered_users_zero_total'];
}
else if( $total_users == 1 )
{
$l_total_user_s = $lang['Registered_user_total'];
}
else
{
$l_total_user_s = $lang['Registered_users_total'];
}
// End information for standard Who-is-online-Block

// Include-Blocks
includeTickerBlock();
includeAuctionRoomBlock();
includeCloseToEndBlock();
includeStatisticBlock();
includeMyAuctionsBlock($userdata);
includeCalendarBlock();
includeSearchBlock();
includeTermsBlock();
includeNewsBlock();
includeAuctionSpecialBlock();

// Mode setting
if( isset($HTTP_POST_VARS['mode']) || isset($HTTP_GET_VARS['mode']) )
{
$mode = ( isset($HTTP_POST_VARS['mode']) ) ? $HTTP_POST_VARS['mode'] : $HTTP_GET_VARS['mode'];
}
else
{
$mode = "";
}

if( !empty($mode) )
{
switch($mode)
{
case 'add':

include('./includes/page_header.php');

if ( $auction_config_data['auction_offer_disable'] == 1 )
{
message_die(GENERAL_MESSAGE, $lang['auction_offer_disable']);
}

// check if user is logged in
if ($userdata['user_id']<0)
{
message_die(GENERAL_MESSAGE, 'You need to login to create an offer');
}

// New offers are just allowed if auction-room-stat is not locked
$sql = "SELECT auction_room_state
FROM " . AUCTION_ROOM_TABLE . "
WHERE PK_auction_room_id=" . $HTTP_GET_VARS[POST_AUCTION_ROOM_URL] . "";
if( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not query auction-room state-information', '', __LINE__, __FILE__, $sql);
}
$auction_room_state_row = $db->sql_fetchrow($result);
if ($auction_room_state_row['auction_room_state']==AUCTION_ROOM_LOCKED)
{
message_die(GENERAL_MESSAGE, $lang['auction_room_locked']);
}

// drop down for auction-rooms
$sql = "SELECT PK_auction_room_id,
auction_room_title
FROM " . AUCTION_ROOM_TABLE . "
WHERE auction_room_state=" . AUCTION_ROOM_UNLOCKED . " ";
if( !$result = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, "Couldn't get list of Auction-Rooms/Categories", "", __LINE__, __FILE__, $sql);
}
$auction_room_list_dd = "";
while( $row = $db->sql_fetchrow($result) )
{
$select = "";
if ($row['PK_auction_room_id'] == $HTTP_GET_VARS[POST_AUCTION_ROOM_URL])
{
$select = " selected=\"selected\"";
}
$auction_room_list_dd .= "<option value=\"" . $row['PK_auction_room_id'] . "\" " . $select . ">" . $row['auction_room_title'] . "</option>";
}

// dropdown-menu for days
$dayToEnd_dd = "<option value=0>" . " - " . "</option>
<option value=1>" . $lang['auction_1_day'] . "</option>
<option value=2>" . $lang['auction_2_day'] . "</option>
<option value=3>" . $lang['auction_3_day'] . "</option>
<option value=4>" . $lang['auction_4_day'] . "</option>
<option value=5>" . $lang['auction_5_day'] . "</option>
<option value=6>" . $lang['auction_6_day'] . "</option>
<option value=7>" . $lang['auction_7_day'] . "</option>
<option value=14>" . $lang['auction_14_day'] . "</option>
<option value=31>" . $lang['auction_31_day'] . "</option>
<option value=62>" . $lang['auction_62_day'] . "</option>";


if ( $auction_config_data['auction_offer_allow_bold'] == 1)
{
$template->assign_block_vars('offer_bold', array(
'L_AUCTION_OFFER_BOLD' => $lang['auction_offer_bold'] . " ( +" . $auction_config_data['auction_offer_cost_bold'] . " " . $auction_config_data['currency'] . ")"));
}
if ( $auction_config_data['auction_offer_allow_on_top'] == 1)
{
$template->assign_block_vars('offer_on_top', array(
'L_AUCTION_OFFER_ON_TOP' => $lang['auction_offer_on_top'] . " ( +" . $auction_config_data['auction_offer_cost_on_top'] . " " . $auction_config_data['currency'] . ")"));
}
if ( $auction_config_data['auction_offer_allow_special'] == 1)
{
$template->assign_block_vars('offer_special', array(
'L_AUCTION_OFFER_SPECIAL' => $lang['auction_offer_special'] . " ( +" . $auction_config_data['auction_offer_cost_special'] . " " . $auction_config_data['currency'] . ")"));
}
if ( $auction_config_data['auction_offer_allow_shipping'] == 1)
{
$template->assign_block_vars('offer_shipping', array(
'L_AUCTION_OFFER_SHIPPING_PRICE' => $lang['auction_offer_shipping_price'] . "( " . $auction_config_data['currency'] . " )"));
}
// BEGIN allow picture upload
if ( $auction_config_data['auction_offer_pictures_allow'] == 1)
{
$template->assign_block_vars('offer_picture', array(
'L_AUCTION_OFFER_PICTURE' => $lang['auction_offer_picture']));
}
// END allow picture upload
// Allow coupons
if ( $auction_config_data['auction_allow_coupons'] == 1)
{
$template->assign_block_vars('offer_coupon', array(
'L_AUCTION_OFFER_COUPON_EXPLAIN' => $lang['coupon_use_explain'],
'L_AUCTION_OFFER_COUPON' => $lang['coupon_use']));
}

$template->set_filenames(array(
'body' => 'auction_add_offer.tpl')
);

$template->assign_vars(array(
'TOTAL_POSTS' => sprintf($l_total_post_s, $total_posts),
'TOTAL_USERS' => sprintf($l_total_user_s, $total_users),
'NEWEST_USER' => sprintf($lang['Newest_user'], '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&amp;" . POST_USERS_URL . "=$newest_uid") . '">', $newest_user, '</a>'),
'L_ONLINE_EXPLAIN' => $lang['Online_explain'],

'NAVIGATION_STRING' => $navigation_string,
'AUCTION_NEW_OFFER' => $lang['auction_new_offer'],
'L_AUCTION_OFFER_OFFERER'=> $lang['auction_offer_offerer'],
'L_AUCTION_OFFER_TITLE' => $lang['auction_offer_title'],
'L_AUCTION_OFFER_TITLE_EXPLAIN' => $lang['auction_offer_title_explain'],
'L_AUCTION_OFFER_TEXT'=> $lang['auction_offer_text'],
'L_AUCTION_OFFER_TEXT_EXPLAIN'=> $lang['auction_offer_text_explain'],
'L_AUCTION_OFFER_TIME_START' => $lang['auction_offer_time_start'],
'L_AUCTION_OFFER_TIME_STOP' => $lang['auction_offer_time_stop'],
'L_AUCTION_OFFER_PRICE_START' => $lang['auction_offer_price_start'] . "( " . $auction_config_data['currency'] . " )",
'L_AUCTION_NEW_OFFER' => $lang['auction_new_offer'],
'L_AUCTION_ROOM_TITLE' => $lang['auction_room_title'],
'L_AUCTION_OR_DATE' => $lang['auction_or_date'],
'L_AUCTION_NOW' => $lang['auction_now'],
'AUCTION_ROOM_TITLE' => $auction_room_title,
'AUCTION_TIME_TO_END_DD' => $dayToEnd_dd,
'AUCTION_ROOM_LIST_DD' => $auction_room_list_dd,

'AUCTION_OFFER_OFFERER' => $userdata['username'],
'MODAUTHOR' => $lang['modauthor'],
'MODPOWERED' => $lang['modpowered'],

'S_AUCTION_ADD_OFFER_ACTION' => append_sid("auction_offer.$phpEx?mode=create&" . POST_AUCTION_ROOM_URL . "=" . $HTTP_GET_VARS[POST_AUCTION_ROOM_URL])
)
);
$template->pparse('body');

include($phpbb_root_path . 'includes/page_tail.'.$phpEx);

break;

case 'quickview' :


break;

case 'create':

$auction_offer_price = 0;

if ( empty($HTTP_POST_VARS['auction_offer_title']))
{
message_die(GENERAL_MESSAGE, $lang['auction_no_title']);
}

if ($HTTP_POST_VARS['auction_offer_price_start']>$auction_config_data['auction_offer_amount_max'])
{
message_die(GENERAL_MESSAGE, $lang['auction_offer_amount_to_high']);
}

if ($HTTP_POST_VARS['auction_offer_price_start']=="")
{
$auction_offer_initial_price = $auction_config_data['auction_offer_amount_min'];
}
else
{
$auction_offer_initial_price = $HTTP_POST_VARS['auction_offer_price_start'];
}

if ($HTTP_POST_VARS['auction_offer_price_start']<0)
{
message_die(GENERAL_MESSAGE, $lang['auction_offer_amount_not_negative']);
}

if (doubleval($HTTP_POST_VARS['auction_offer_shipping_price'])<0)
{
message_die(GENERAL_MESSAGE, $lang['auction_offer_amount_not_negative']);
}

if (empty($HTTP_POST_VARS['offer_special']) )
{
$auction_offer_special = 0;
}
else
{
$auction_offer_special = 1;
$auction_offer_price += doubleval($auction_config_data['auction_offer_cost_special']);
}
if (empty($HTTP_POST_VARS['offer_on_top']) )
{
$auction_offer_on_top = 0;
}
else
{
$auction_offer_on_top = 1;
$auction_offer_price += doubleval($auction_config_data['auction_offer_cost_on_top']);
}
if (empty($HTTP_POST_VARS['offer_bold']) )
{
$auction_offer_bold = 0;
}
else
{
$auction_offer_bold = 1;
$auction_offer_price += doubleval($auction_config_data['auction_offer_cost_bold']);
}

$auction_offer_price += doubleval($auction_config_data['auction_offer_cost_basic']);

// BEGIN DATE-Handling
if (empty($HTTP_POST_VARS['time_start_now']) )
{
if ( $HTTP_POST_VARS['time_to_end_dd'] == 0 )
{
checkAuctionDates($HTTP_POST_VARS['auction_offer_time_start_m'], $HTTP_POST_VARS['auction_offer_time_start_d'], $HTTP_POST_VARS['auction_offer_time_start_y'], $HTTP_POST_VARS['auction_offer_time_stop_m'], $HTTP_POST_VARS['auction_offer_time_stop_d'], $HTTP_POST_VARS['auction_offer_time_stop_y']);
// Day +1 ???????? Dont know why so far - maybe the timezone
$auction_offer_time_stop = mktime(0,0,0,$HTTP_POST_VARS['auction_offer_time_stop_m'],$HTTP_POST_VARS['auction_offer_time_stop_d']+1,$HTTP_POST_VARS['auction_offer_time_stop_y']);
$auction_offer_time_start = mktime(0,0,0,$HTTP_POST_VARS['auction_offer_time_start_m'],$HTTP_POST_VARS['auction_offer_time_start_d']+1,$HTTP_POST_VARS['auction_offer_time_start_y']);
}
else
{
checkAuctionDatesStart($HTTP_POST_VARS['auction_offer_time_start_m'], $HTTP_POST_VARS['auction_offer_time_start_d'], $HTTP_POST_VARS['auction_offer_time_start_y']);
$auction_offer_time_start = mktime(0,0,0,$HTTP_POST_VARS['auction_offer_time_start_m'],$HTTP_POST_VARS['auction_offer_time_start_d']+1,$HTTP_POST_VARS['auction_offer_time_start_y']);
$auction_offer_time_stop = DateAdd('d',$HTTP_POST_VARS['time_to_end_dd'],$auction_offer_time_start);
}
}
else
{
if ( $HTTP_POST_VARS['time_to_end_dd'] == 0 )
{
checkAuctionDatesStop($HTTP_POST_VARS['auction_offer_time_stop_m'], $HTTP_POST_VARS['auction_offer_time_stop_d'], $HTTP_POST_VARS['auction_offer_time_stop_y']);
$auction_offer_time_start = time();
$auction_offer_time_stop = mktime(0,0,0,$HTTP_POST_VARS['auction_offer_time_stop_m'],$HTTP_POST_VARS['auction_offer_time_stop_d']+1,$HTTP_POST_VARS['auction_offer_time_stop_y']);
}
else
{
$auction_offer_time_start = time();
$auction_offer_time_stop = DateAdd('d',$HTTP_POST_VARS['time_to_end_dd'],time());
}
}
// END DATE-Handling

if ( $HTTP_POST_FILES['auction_offer_picture_file']['size']>0 )
{
$filetype = $HTTP_POST_FILES['auction_offer_picture_file']['type'];
$filesize = $HTTP_POST_FILES['auction_offer_picture_file']['size'];
$filename = $HTTP_POST_FILES['auction_offer_picture_file']['tmp_name'];

if ( $auction_config_data['auction_offer_picture_size_allow'] <$filesize )
{
message_die(GENERAL_MESSAGE, $lang['auction_picture_filesize_to_big']);
}

switch ($filetype)
{

case 'image/jpeg':
case 'image/jpg':
case 'image/pjpeg':
if ( $auction_config_data['auction_offer_picture_jpeg_allow'] == 1 )
{
$filetype_adj = '.jpg';
}
else
{
message_die(GENERAL_MESSAGE, $lang['auction_offer_picture_filetype_not_allowed']);
}
break;
case 'image/png':
case 'image/x-png':
if ( $auction_config_data['auction_offer_picture_gif_allow'] == 1 )
{
$filetype_adj = '.png';
}
else
{
message_die(GENERAL_MESSAGE, $lang['auction_offer_picture_filetype_not_allowed']);
}
break;
case 'image/gif':
if ( $auction_config_data['auction_offer_picture_gif_allow'] == 1 )
{
$filetype_adj = '.gif';
}
else
{
message_die(GENERAL_MESSAGE, $lang['auction_offer_picture_filetype_not_allowed']);
}
break;
default:
message_die(GENERAL_MESSAGE, $lang['auction_offer_picture_filetype_not_allowed']);
}

$filename_adj = md5(uniqid(rand())) . $filetype_adj;
copy($filename, AUCTION_PICTURE_UPLOAD_PATH . $filename_adj);
@chmod(AUCTION_PICTURE_UPLOAD_PATH . $filename_adj, 0777);
}

// if payment-system is activated then we first need to mark the offer unpaid
if ( ($auction_config_data['auction_paymentsystem_activate_paypal'] OR $auction_config_data['auction_paymentsystem_activate_moneybooker']) AND $auction_offer_price != 0)
{
$offer_paid = 0;
}
else
{
$offer_paid = 1;
}

// COUPON-HANDLING
if (!empty($HTTP_POST_VARS['auction_offer_coupon']) )
{
$sql = "SELECT cc.auction_coupon_config_amount, c.auction_coupon_date_used
FROM (" . AUCTION_COUPON_TABLE . " c
LEFT JOIN " . AUCTION_COUPON_CONFIG_TABLE . " cc on c.FK_auction_coupon_config_id =cc.PK_auction_coupon_config_id)
WHERE c.PK_auction_coupon_id='" . $HTTP_POST_VARS['auction_offer_coupon']. "'
AND c.auction_coupon_date_used=0";

if( !$result = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, "Couldn't check coupon.", "", __LINE__, __FILE__, $sql);
}

$row = $db->sql_fetchrow($result);

if ( $row['auction_coupon_date_used'] == "")
{
$coupon_valid_flag = 0; // Coupon not valid
}
else
{
$coupon_valid_flag = 1; // Coupon valid
$coupon_amount = doubleval($row['auction_coupon_config_amount']);

// Lock this coupon
$sql = "UPDATE " . AUCTION_COUPON_TABLE . "
SET FK_auction_coupon_used_user_id=" . $userdata['user_id'] . ",
auction_coupon_date_used= " . time() . "
WHERE PK_auction_coupon_id='" . $HTTP_POST_VARS['auction_offer_coupon']. "'";

if( !$result = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, "Couldn't lock coupon.", "", __LINE__, __FILE__, $sql);
}
}

// if it's a 100% bonus-coupon the offer is paid
if ( ($row['auction_coupon_config_amount'] == 1) OR ($row['auction_coupon_config_amount'] == 1.00) )
{
$offer_paid = 1;
}
}


// INSERT OFFER
$sql = "INSERT INTO
" . AUCTION_OFFER_TABLE . " (FK_auction_offer_room_id, FK_auction_offer_user_id, auction_offer_title, auction_offer_text, auction_offer_time_start, auction_offer_time_stop, auction_offer_price_start, auction_offer_special, auction_offer_on_top, auction_offer_bold, auction_offer_shipping_price, auction_offer_picture, auction_offer_paid )
VALUES (" . $HTTP_POST_VARS['auction_room_id'] . ", " . $userdata['user_id'] . ",'" . prepare_message(addslashes(unprepare_message(htmlspecialchars(trim(stripslashes($HTTP_POST_VARS['auction_offer_title']))))), $board_config['allow_html'], $board_config['allow_bbcode'], $board_config['allow_smilies'], 0) . "','" . prepare_message(addslashes(unprepare_message(htmlspecialchars(trim(stripslashes($HTTP_POST_VARS['auction_offer_text']))))), $board_config['allow_html'], $board_config['allow_bbcode'], $board_config['allow_smilies'], 0) . "'," . $auction_offer_time_start . "," . $auction_offer_time_stop . "," . doubleval($auction_offer_initial_price) . ", " . $auction_offer_special. "," . $auction_offer_on_top . "," . $auction_offer_bold . ", " . doubleval($HTTP_POST_VARS['auction_offer_shipping_price']) . ", '" . $filename_adj . "', " . $offer_paid . ")";


if( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not insert offer', '', __LINE__, __FILE__, $sql);
}

$sql = "SELECT MAX(PK_auction_offer_id) as max_id
FROM " . AUCTION_OFFER_TABLE . "";


if( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not get offer id', '', __LINE__, __FILE__, $sql);
}

$auction_offer_max_id = $db->sql_fetchrow($result);

$auction_offer_id = $auction_offer_max_id['max_id'];

include('./includes/page_header.php');

if ( (($auction_config_data['auction_paymentsystem_activate_paypal'] == 1) OR $auction_config_data['auction_paymentsystem_activated_moneybooker']) AND ($offer_paid==0) AND ($auction_offer_price != 0))
{

//$auction_offer_price += doubleval($auction_config_data['auction_offer_cost_basic']);

if ( $coupon_valid_flag == 1 )
{
$auction_offer_price = doubleval($auction_offer_price*$coupon_amount);
}

if ( $auction_config_data['auction_paymentsystem_activate_paypal'] == 1 )
{
$template->assign_block_vars('paypal', array(
'PAYPAL_IMAGE' => PAYPAL_IMAGE ));
}
// Accept moneybooker payments
if ( $auction_config_data['auction_paymentsystem_activate_moneybooker'] == 1 )
{
$template->assign_block_vars('moneybooker', array(
'MONEYBOOKER_IMAGE' => MONEYBOOKER_IMAGE));
}

$template->assign_vars(array(
'L_AUCTION_PRICE_TOTAL' => $lang['auction_price_total'],
'L_AUCTION_PRICE_BASIC' => $lang['auction_price_basic'],
'L_AUCTION_PRICE_BOLD' => $lang['auction_price_bold'],
'L_AUCTION_PRICE_ON_TOP' => $lang['auction_price_on_top'],
'L_AUCTION_PRICE_SPECIAL' => $lang['auction_price_special'],
'L_AUCTION_PAYMENT' => $lang['auction_payment'],
'L_AUCTION_PAYMENT_EXPLAIN' => $lang['auction_payment_explain'],
'L_AUCTION_PAYMENTSYSTEM_PAYWITH_PAYPAL' => $lang['auction_paymentsystem_paywith_paypal'],
'L_AUCTION_PAYMENTSYSTEM_PAYWITH_PAYPAL_NOW' => $lang['auction_paymentsystem_paywith_paypal_now'],
'L_AUCTION_PAYMENT_PRINT' =>$lang['auction_payment_print'],
'L_AUCTION_PAYMENTSYSTEM_PAYWITH_MONEYBOOKER' => $lang['auction_paymentsystem_paywith_moneybooker'],

'AUCTION_OFFER_ID' => $auction_offer_id,
'AUCTION_OFFER_TITLE' => $board_config['site_desc'] . " - ". $HTTP_POST_VARS['auction_offer_title'],
'AUCTION_PAYPAL_ADRESS' => $auction_config_data['auction_paymentsystem_paypal_email'],
'AUCTION_PAYMENT_NOTIFICATION' => "http://" . $_SERVER['HTTP_HOST'] . $board_config['script_path'] . "/auction_ipn.php",
'AUCTION_PAYMENT_RETURN' => "http://" . $_SERVER['HTTP_HOST'] . $board_config['script_path'] . "/auction.php",
'AUCTION_PAYMENT_CURRENCY' =>$auction_config_data['currency'],
'AUCTION_PRICE_BASIC' => $auction_config_data['auction_offer_cost_basic'] . " " . $auction_config_data['currency'],
'AUCTION_PRICE_BOLD' => ( $HTTP_POST_VARS['offer_bold'] ) ? "" . $auction_config_data['auction_offer_cost_bold'] . " " . $auction_config_data['currency'] : "- " . $auction_config_data['currency'],
'AUCTION_PRICE_ON_TOP' => ( $HTTP_POST_VARS['offer_on_top'] ) ? "" . $auction_config_data['auction_offer_cost_on_top'] . " " . $auction_config_data['currency'] : "- " . $auction_config_data['currency'],
'AUCTION_PRICE_SPECIAL' => ( $HTTP_POST_VARS['offer_special'] ) ? "" . $auction_config_data['auction_offer_cost_special'] . " " . $auction_config_data['currency'] : "- " . $auction_config_data['currency'],
'AUCTION_PRICE_TOTAL' => $auction_offer_price,
'AUCTION_CURRENY' => $auction_config_data['currency'],
'AUCTION_MONEYBOOKER_EMAIL' => $auction_config_data['auction_paymentsystem_moneybooker_email'],

'S_AUCTION_ADD_OFFER_ACTION' => append_sid("auction_offer.$phpEx?mode=create&" . POST_AUCTION_ROOM_URL . "=" . $HTTP_GET_VARS[POST_AUCTION_ROOM_URL]),
'MODAUTHOR' => $lang['modauthor'],
'MODPOWERED' => $lang['modpowered']
));
}
else
{
$message = $lang['auction_offer_saved'] . "<br /><br />" . sprintf($lang['Click_return_auction_index'], "<a href=\"" . append_sid("auction.$phpEx") . "\">", "</a>") . "<br /><br />" . sprintf($lang['Click_return_auction_room'], "<a href=\"" . append_sid("auction_room.$phpEx?ar=" . $HTTP_POST_VARS['auction_room_id']) . "\">", "</a>");
message_die(GENERAL_MESSAGE, $message);
}

$template->set_filenames(array(
'body' => 'auction_add_offer_pay.tpl')
);

$template->pparse('body');
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);

break;

case 'late_pay':

include('./includes/page_header.php');

$sql = "SELECT *
FROM " . AUCTION_OFFER_TABLE . "
WHERE PK_auction_offer_id = " . $HTTP_GET_VARS[POST_AUCTION_OFFER_URL] . "";

if( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not query offer', '', __LINE__, __FILE__, $sql);
}

$auction_offer = $db->sql_fetchrow($result);
$cost_bold = ( $auction_offer['auction_offer_bold'] ) ? $auction_config_data['auction_offer_cost_bold'] : 0;
$cost_special = ( $auction_offer['auction_offer_special'] ) ? $auction_config_data['auction_offer_cost_special'] : 0;
$cost_on_top = ( $auction_offer['auction_offer_on_top'] ) ? $auction_config_data['auction_offer_cost_on_top'] : 0;
$cost_total = $cost_bold + $cost_special + $cost_on_top + $auction_config_data['auction_offer_cost_basic'];


$template->set_filenames(array(
'body' => 'auction_add_offer_pay.tpl'));

if ( $auction_config_data['auction_paymentsystem_activate_paypal'] == 1 )
{
$template->assign_block_vars('paypal', array(
'PAYPAL_IMAGE' => PAYPAL_IMAGE ));
}
// Accept moneybooker payments
if ( $auction_config_data['auction_paymentsystem_activate_moneybooker'] == 1 )
{
$template->assign_block_vars('moneybooker', array(
'MONEYBOOKER_IMAGE' => MONEYBOOKER_IMAGE));
}

$template->assign_vars(array(
'L_AUCTION_PRICE_TOTAL' => $lang['auction_price_total'],
'L_AUCTION_PRICE_BASIC' => $lang['auction_price_basic'],
'L_AUCTION_PRICE_BOLD' => $lang['auction_price_bold'],
'L_AUCTION_PRICE_ON_TOP' => $lang['auction_price_on_top'],
'L_AUCTION_PRICE_SPECIAL' => $lang['auction_price_special'],
'L_AUCTION_PAYMENT' => $lang['auction_payment'],
'L_AUCTION_PAYMENT_EXPLAIN' => $lang['auction_payment_explain'],
'L_AUCTION_PAYMENT_EXPLAIN_MONEYBOOKER' => ( $auction_config_data['auction_paymentsystem_activate_moneybooker'] ) ? $lang['auction_payment_explain_moneybooker'] : "",
'L_AUCTION_PAYMENT_EXPLAIN_PAYPAL' => ( $auction_config_data['auction_paymentsystem_activate_paypal'] ) ? $lang['auction_payment_explain_paypal'] : "",

'L_AUCTION_PAYMENTSYSTEM_PAYWITH_PAYPAL' => $lang['auction_paymentsystem_paywith_paypal'],
'L_AUCTION_PAYMENTSYSTEM_PAYWITH_PAYPAL_NOW' => $lang['auction_paymentsystem_paywith_paypal_now'],
'L_AUCTION_PAYMENT_PRINT' =>$lang['auction_payment_print'],
'L_AUCTION_PAYMENTSYSTEM_PAYWITH_MONEYBOOKER' => $lang['auction_paymentsystem_paywith_moneybooker'],

'AUCTION_PAYPAL_ADRESS' => $auction_config_data['auction_paymentsystem_paypal_email'],
'AUCTION_PAYMENT_NOTIFICATION' => "http://" . $_SERVER['HTTP_HOST'] . $board_config['script_path'] . "auction_ipn.php",
'AUCTION_PAYMENT_RETURN' => "http://" . $_SERVER['HTTP_HOST'] . $board_config['script_path'] . "auction.php",
'AUCTION_PAYMENT_CURRENCY' =>$auction_config_data['currency'],
'AUCTION_CURRENY' => $auction_config_data['currency'],
'AUCTION_PRICE_BASIC' => $auction_config_data['auction_offer_cost_basic'] . " " . $auction_config_data['currency'],
'AUCTION_MONEYBOOKER_EMAIL' => $auction_config_data['auction_paymentsystem_moneybooker_email'],

'AUCTION_PRICE_BOLD' => ( $auction_offer['auction_offer_bold'] ) ? "" . $auction_config_data['auction_offer_cost_bold'] . " " . $auction_config_data['currency'] : "- " . $auction_config_data['currency'],
'AUCTION_PRICE_ON_TOP' => ( $auction_offer['auction_offer_on_top'] ) ? "" . $auction_config_data['auction_offer_cost_on_top'] . " " . $auction_config_data['currency'] : "- " . $auction_config_data['currency'],
'AUCTION_PRICE_SPECIAL' => ( $auction_offer['auction_offer_special'] ) ? "" . $auction_config_data['auction_offer_cost_special'] . " " . $auction_config_data['currency'] : "- " . $auction_config_data['currency'],
'AUCTION_PRICE_TOTAL' => $cost_total,
'AUCTION_OFFER_TITLE' => $board_config['site_desc'] . " - ". $auction_offer['auction_offer_title'],
'AUCTION_OFFER_ID' => $auction_offer['PK_auction_offer_id'],

'S_AUCTION_ADD_OFFER_ACTION' => append_sid("auction_offer.$phpEx?mode=create&" . POST_AUCTION_ROOM_URL . "=" . $HTTP_GET_VARS[POST_AUCTION_ROOM_URL]),
'MODAUTHOR' => $lang['modauthor'],
'MODPOWERED' => $lang['modpowered']
));

$template->pparse('body');
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);

break;

case 'move_select' :
if ( $userdata['user_level'] == 1)
{
// Get drop down for select box
$sql = "SELECT PK_auction_room_id, auction_room_title
FROM " . AUCTION_ROOM_TABLE;

if( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not query auction-start and stop date', '', __LINE__, __FILE__, $sql);
}

$dd_string = "<select name=\"auction_room_id\">";
while( $auction_room = $db->sql_fetchrow($result) )
{
$dd_string .= "<option value=\"" . $auction_room['PK_auction_room_id'] . "\">" . $auction_room['auction_room_title'] . "</option>";
}
$dd_string .= "</select>";

include('./includes/page_header.php');

$template->set_filenames(array(
'body' => 'auction_move_offer.tpl')
);

$template->assign_vars(array(
'L_AUCTION_OFFER_MOVE' => $lang['auction_offer_move'],
'L_AUCTION_OFFER_MOVE_NOW' => $lang['auction_offer_move_now'],
'DD_AUCTION_ROOM' => $dd_string,
'S_AUCTION_MOVE' => append_sid("auction_offer.$phpEx?mode=move&" . POST_AUCTION_OFFER_URL . "=" . $HTTP_GET_VARS[POST_AUCTION_OFFER_URL])
));

$template->pparse('body');

include($phpbb_root_path . 'includes/page_tail.'.$phpEx);

}

break;

case 'move' :
if ($userdata['user_level'] == 1 )
{
$sql = "UPDATE " . AUCTION_OFFER_TABLE . "
SET FK_auction_offer_room_id=" . $HTTP_POST_VARS['auction_room_id'] . "
WHERE PK_auction_offer_id= " . $HTTP_GET_VARS[POST_AUCTION_OFFER_URL] . "";

if( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not move offer', '', __LINE__, __FILE__, $sql);
}

$navigation_text = "<br><br><a href=\"" . append_sid("auction.php") . "\">" . $lang['return_to_auction_index'] . "<br><br><a href=\"" . append_sid("auction_room.php?" . POST_AUCTION_ROOM_URL . "=" . $HTTP_POST_VARS['auction_room_id']) . "\">" . $lang['return_to_auction_room'] . "</a>";
message_die(GENERAL_MESSAGE, $lang['auction_offer_moved'] . $navigation_text);
}

break;
case 'bid':

include('./includes/page_header.php');

// check if user is logged in
if ($userdata['user_id']<0)
{
message_die(GENERAL_MESSAGE, 'Please login in to bid');
}

// Check start and stop of offer
$sql = "SELECT auction_offer_time_start, auction_offer_time_stop, FK_auction_offer_user_id, auction_offer_price_start, FK_auction_offer_last_bid_user_id, auction_offer_title, auction_offer_last_bid_price
FROM " . AUCTION_OFFER_TABLE . "
WHERE PK_auction_offer_id= " . $HTTP_GET_VARS[POST_AUCTION_OFFER_URL] . "";

if( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not query auction-start and stop date', '', __LINE__, __FILE__, $sql);
}
$auction_corresponding_bids_start_stop_row = $db->sql_fetchrow($result);
if ($auction_corresponding_bids_start_stop_row['auction_offer_time_start']>time())
{
message_die(GENERAL_MESSAGE, $lang['auction_offer_not_started']);
}
if ($auction_corresponding_bids_start_stop_row['auction_offer_time_stop']<time())
{
message_die(GENERAL_MESSAGE, $lang['auction_offer_over']);
}

// if no bid exists, the new bid needs to be higher than the initial price, and a good bid
$last = $auction_corresponding_bids_start_stop_row['auction_offer_last_bid_price'];
if ( ($auction_corresponding_bids_start_stop_row['auction_offer_last_bid_price'] == 0 ) || ($auction_corresponding_bids_start_stop_row['auction_offer_last_bid_price']=""))
{
if ( $HTTP_POST_VARS['auction_your_amount'] == 0 )
{
$message = $lang['auction_bid_not_there'] . "<br /><br />" . sprintf($lang['Click_return_offer'], "<a href=\"" . append_sid("auction_offer_view.$phpEx?ao=" . $HTTP_GET_VARS[POST_AUCTION_OFFER_URL]) . "\">", "</a>");
message_die(GENERAL_MESSAGE, $message);
}
if ( $HTTP_POST_VARS['auction_your_amount'] < $auction_corresponding_bids_start_stop_row['auction_offer_price_start'])
{
$message = $lang['auction_bid_too_low'] . "<br /><br />" . sprintf($lang['Click_return_offer'], "<a href=\"" . append_sid("auction_offer_view.$phpEx?ao=" . $HTTP_GET_VARS[POST_AUCTION_OFFER_URL]) . "\">", "</a>");
message_die(GENERAL_MESSAGE, $message);
}
}

// if bid exists, the new bid needs to be higher than the current price +0.99, and a good bid
if ( $last > 0 )
{
if ( $HTTP_POST_VARS['auction_your_amount'] == 0 )
{
$message = $lang['auction_bid_not_there'] . "<br /><br />" . sprintf($lang['Click_return_offer'], "<a href=\"" . append_sid("auction_offer_view.$phpEx?ao=" . $HTTP_GET_VARS[POST_AUCTION_OFFER_URL]) . "\">", "</a>");
message_die(GENERAL_MESSAGE, $message);
}
if ( $HTTP_POST_VARS['auction_your_amount'] <= $last+0.99)
{
$message = $lang['auction_bid_too_low'] . "<br /><br />" . sprintf($lang['Click_return_offer'], "<a href=\"" . append_sid("auction_offer_view.$phpEx?ao=" . $HTTP_GET_VARS[POST_AUCTION_OFFER_URL]) . "\">", "</a>");
message_die(GENERAL_MESSAGE, $message);
}
}

// in any case, the bid must be lower than the maximum allowed on the board
if ( $HTTP_POST_VARS['auction_your_amount'] > $auction_config_data['auction_offer_amount_max'])
{
$message = $lang['auction_bid_amount_too_high'] . "<br /><br />" . sprintf($lang['Click_return_offer'], "<a href=\"" . append_sid("auction_offer_view.$phpEx?ao=" . $HTTP_GET_VARS[POST_AUCTION_OFFER_URL]) . "\">", "</a>");
message_die(GENERAL_MESSAGE, $message);
}

if ( $auction_config_data['auction_allow_self_bids'] == 0 AND $auction_corresponding_bids_start_stop_row['FK_auction_offer_user_id'] == $userdata['user_id'] )
{
message_die(GENERAL_MESSAGE, $lang['no_selfbids']);
}

// UPDATE Last bid in offer-table. I know its not normalized, but it saves us a lot of sql-queries on the users frontend.
$sql = "UPDATE " . AUCTION_OFFER_TABLE . "
SET auction_offer_last_bid_price = " . doubleval($HTTP_POST_VARS['auction_your_amount']) . ",
FK_auction_offer_last_bid_user_id = ". $userdata['user_id'] . "
WHERE PK_auction_offer_id = " . $HTTP_GET_VARS[POST_AUCTION_OFFER_URL] . "";
if( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not update offer-table', '', __LINE__, __FILE__, $sql);
}

// Insert into bid-table
$sql= "INSERT INTO
". AUCTION_BID_TABLE . " (FK_auction_bid_offer_id, FK_auction_bid_user_id, auction_bid_time, auction_bid_price)
VALUES(" . $HTTP_GET_VARS[POST_AUCTION_OFFER_URL] . "," . $userdata['user_id'] . ", " . time() .", " . doubleval($HTTP_POST_VARS['auction_your_amount']) . ")";

if( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not update bid-table', '', __LINE__, __FILE__, $sql);
}
else
{

// Notify outbid

$outbid_pm_subject = $lang['outbid'] . " - " . prepare_message(addslashes(unprepare_message(htmlspecialchars(trim(stripslashes($auction_corresponding_bids_start_stop_row['auction_offer_title']))))));
$outbid_pm = $lang['outbid_pm'];
$privmsgs_date = date("U");
$sql = "INSERT INTO " . PRIVMSGS_TABLE . "
(privmsgs_type,
privmsgs_subject,
privmsgs_from_userid,
privmsgs_to_userid,
privmsgs_date,
privmsgs_enable_html,
privmsgs_enable_bbcode,
privmsgs_enable_smilies,
privmsgs_attach_sig)
VALUES ('0',
'" . str_replace("\'", "''", addslashes(sprintf($outbid_pm_subject,$board_config['sitename']))) . "',
'2',
" . $auction_corresponding_bids_start_stop_row['FK_auction_offer_last_bid_user_id'] . ",
" . $privmsgs_date . ",
'0',
'1',
'1',
'0')";
if ( !$db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Could not insert private message sent info', '', __LINE__, __FILE__, $sql);
}

$outbid_sent_id = $db->sql_nextid();
$outbid_text = $lang['outbid_pm_text'];

$sql = "INSERT INTO " . PRIVMSGS_TEXT_TABLE . "
(privmsgs_text_id, privmsgs_text)
VALUES ($outbid_sent_id,
'" . str_replace("\'", "''", addslashes(sprintf($outbid_pm,$board_config['sitename']))) . "</br></br><a href=auction_offer_view.php?ao=" . $HTTP_GET_VARS[POST_AUCTION_OFFER_URL] . '>' . prepare_message(addslashes(unprepare_message(htmlspecialchars(trim(stripslashes($auction_corresponding_bids_start_stop_row['auction_offer_title'])))))) . '</a></br>' . $board_config['board_email_sig'] . "')";

if ( !$db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Could not insert private message sent text', '', __LINE__, __FILE__, $sql);
}
$sql = "UPDATE " . USERS_TABLE . "
Set user_new_privmsg=user_new_privmsg+1, user_unread_privmsg=user_unread_privmsg+1
WHERE user_id=" . $auction_corresponding_bids_start_stop_row['FK_auction_offer_last_bid_user_id'];

if ( !$db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Could not update user table for outbid notification', '', __LINE__, __FILE__, $sql);
}
// End Notify

$message = $lang['auction_room_bid_successful'] . "<br /><br />" . sprintf($lang['Click_return_offer'], "<a href=\"" . append_sid("auction_offer_view.$phpEx?ao=" . $HTTP_GET_VARS[POST_AUCTION_OFFER_URL]) . "\">", "</a>") . "<br /><br />" . sprintf($lang['Click_return_auction_index'], "<a href=\"" . append_sid("auction.$phpEx") . "\">", "</a>");
message_die(GENERAL_MESSAGE, $message);

}

include($phpbb_root_path . 'includes/page_tail.'.$phpEx);

break;

case 'feature' :

if ( $userdata['user_level']<>1 )
{
message_die(GENERAL_MESSAGE, $lang['auction_no_permission']);
}
else
{
$sql = "UPDATE " . AUCTION_OFFER_TABLE . "
SET auction_offer_special = 1
WHERE PK_auction_offer_id = " . $HTTP_GET_VARS[POST_AUCTION_OFFER_URL] . "";

if( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not update offer-table', '', __LINE__, __FILE__, $sql);
}
message_die(GENERAL_MESSAGE, $lang['auction_offer_feature_successful']);
}
break;
case 'search':

include('./includes/page_header.php');

if (empty($HTTP_POST_VARS['auction_item']) && empty($HTTP_POST_VARS['auction_username']))
{
message_die(GENERAL_MESSAGE, $lang['auction_neither_item_nor_username_selected']);
}
if ( !empty($HTTP_POST_VARS['auction_item']) && !empty($HTTP_POST_VARS['auction_username']))
{
$sql = "SELECT o.PK_auction_offer_id, o.auction_offer_title, o.auction_offer_time_start, o.auction_offer_time_stop, u.username
FROM (" . AUCTION_OFFER_TABLE . " o
LEFT JOIN " . USERS_TABLE . " u ON u.user_id = o.FK_auction_offer_user_id)
WHERE o.auction_offer_title LIKE '%" . $HTTP_POST_VARS['auction_item'] . "%' AND u.username='" . $HTTP_POST_VARS['auction_username'] . "' AND o.auction_offer_time_stop>" . time() . "";
}
elseif ( !empty($HTTP_POST_VARS['auction_item']) )
{
$sql = "SELECT o.PK_auction_offer_id, o.auction_offer_title as auction_offer_title, o.auction_offer_time_start, o.auction_offer_time_stop, u.username
FROM (" . AUCTION_OFFER_TABLE . " o
LEFT JOIN " . USERS_TABLE . " u ON u.user_id = o.FK_auction_offer_user_id)
WHERE o.auction_offer_title LIKE '%" . $HTTP_POST_VARS['auction_item'] . "%' AND o.auction_offer_time_stop>" . time() . "";
}
elseif ( !empty($HTTP_POST_VARS['auction_username']) )
{
$sql = "SELECT o.PK_auction_offer_id, o.auction_offer_title, o.auction_offer_time_start, o.auction_offer_time_stop, u.username
FROM (" . AUCTION_OFFER_TABLE . " o
LEFT JOIN " . USERS_TABLE . " u ON u.user_id = o.FK_auction_offer_user_id)
WHERE u.username='" . $HTTP_POST_VARS['auction_username'] . "' AND o.auction_offer_time_stop>" . time() . "
ORDER BY o.auction_offer_time_start";
}

if( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not query search-data', '', __LINE__, __FILE__, $sql);
}
while ($auction_search_row = $db->sql_fetchrow($result))
{
$auction_search_matches[] = $auction_search_row;
}

$template->set_filenames(array(
'body' => 'auction_search.tpl'));

$template->assign_vars(array(
'TOTAL_POSTS' => sprintf($l_total_post_s, $total_posts),
'TOTAL_USERS' => sprintf($l_total_user_s, $total_users),
'NEWEST_USER' => sprintf($lang['Newest_user'], '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&amp;" . POST_USERS_URL . "=$newest_uid") . '">', $newest_user, '</a>'),
'L_ONLINE_EXPLAIN' => $lang['Online_explain'],
'AUCTION_SEARCH_MATCHES_TITLE' => 'Searchmatches',
'L_AUCTION_SEARCH_MATCHES_OFFER_TIME_START' => $lang['auction_offer_time_start'],
'L_AUCTION_SEARCH_MATCHES_OFFER_TIME_STOP' => $lang['auction_offer_time_stop'],
'L_AUCTION_SEARCH_MATCHES_OFFER_TITLE' => $lang['auction_offer_title'],
'L_AUCTION_SEARCH_MATCHES_OFFER_OFFERER' => $lang['auction_offer_offerer'],
'MODAUTHOR' => $lang['modauthor'],
'MODPOWERED' => $lang['modpowered']));

if ( count($auction_search_matches) == 0 )
{
message_die(GENERAL_MESSAGE, $lang['auction_no_offers_found']);

}
for ($i = 0; $i < count($auction_search_matches); $i++)
{
$template->assign_block_vars('offerrow', array(
'TOTAL_POSTS' => sprintf($l_total_post_s, $total_posts),
'TOTAL_USERS' => sprintf($l_total_user_s, $total_users),
'NEWEST_USER' => sprintf($lang['Newest_user'], '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&amp;" . POST_USERS_URL . "=$newest_uid") . '">', $newest_user, '</a>'),
'L_ONLINE_EXPLAIN' => $lang['Online_explain'],
'AUCTION_SEARCH_MATCHES_OFFER_TITLE' => $auction_search_matches[$i]['auction_offer_title'],
'AUCTION_SEARCH_MATCHES_OFFER_OFFERER' => $auction_search_matches[$i]['username'],
'AUCTION_SEARCH_MATCHES_OFFER_LINK' => "<a href=\"".append_sid("auction_offer_view.$phpEx?" . POST_AUCTION_OFFER_URL . "=" . $auction_search_matches[$i]['PK_auction_offer_id']) . "\">" . $auction_search_matches[$i]['auction_offer_title'] . "</a>",
'AUCTION_SEARCH_MATCHES_OFFER_TIME_START' => create_date($board_config['default_dateformat'], $auction_search_matches[$i]['auction_offer_time_start'], $board_config['board_timezone']),
'AUCTION_SEARCH_MATCHES_OFFER_TIME_STOP' => create_date($board_config['default_dateformat'], $auction_search_matches[$i]['auction_offer_time_stop'], $board_config['board_timezone'])
));
}

$template->pparse('body');

include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
break;

case 'delete':

include('./includes/page_header.php');
if ( $userdata['user_level']<>1 )
{
message_die(GENERAL_MESSAGE, $lang['auction_no_permission']);
}
else
{
$sql = "SELECT auction_offer_picture
FROM " . AUCTION_OFFER_TABLE . "
WHERE PK_auction_offer_id = " . $HTTP_GET_VARS[POST_AUCTION_OFFER_URL] . "";

if( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not query offer', '', __LINE__, __FILE__, $sql);
}

$offer_picture = $db->sql_fetchrow($result);

@unlink(AUCTION_PICTURE_UPLOAD_PATH . $offer_picture['auction_offer_picture']);

$sql = "DELETE
FROM " . AUCTION_OFFER_TABLE . "
WHERE PK_auction_offer_id = " . $HTTP_GET_VARS[POST_AUCTION_OFFER_URL] . "";

if( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not delete offer in offer-table', '', __LINE__, __FILE__, $sql);
}
$sql = "DELETE
FROM " . AUCTION_BID_TABLE . "
WHERE FK_auction_bid_offer_id = " . $HTTP_GET_VARS[POST_AUCTION_OFFER_URL] . "";
if( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not delete corresponding bids', '', __LINE__, __FILE__, $sql);
}
message_die(GENERAL_MESSAGE, $lang['auction_offer_successful_deleted']);
}

include($phpbb_root_path . 'includes/page_tail.'.$phpEx);

default:
message_die(GENERAL_MESSAGE, $lang['No_mode']);
break;
}
}

?>
Back to top
View user's profile Send private message
Kiss News
Super Auctioneer
Super Auctioneer


Joined: 15 Jul 2004
Posts: 232

PostPosted: Fri Jul 30, 2004 3:02 pm    Post subject: Reply with quote

and here is auction_offer_view.php (you can delete this post if you don't need it, soeey Rolling Eyes )
Quote:
<?php
/***************************************************************************
* auction_offer_view.php
* -------------------
* begin : January 2004
* copyright : (C) FR
* email : fr@php-styles.com
*
***************************************************************************/

/***************************************************************************
*
* This hack is released under the GPL License.
* This hack can be freely used, but not distributed, without permission.
* Intellectual Property is retained by the author listed above.
*
***************************************************************************/

define('IN_PHPBB', 1);
define('SHOW_ONLINE', true);
$phpbb_root_path = './';
include_once($phpbb_root_path . 'extension.inc');
include_once($phpbb_root_path . 'common.'.$phpEx);
include_once($phpbb_root_path . 'auction/functions_blocks.php');
include_once($phpbb_root_path . 'auction/functions_general.php');
include_once($phpbb_root_path . 'auction/functions_validate.php');
include_once($phpbb_root_path . 'auction/auction_constants.php');
include_once($phpbb_root_path . 'includes/functions_post.php');

// Start session management
$userdata = session_pagestart($user_ip, 445);
init_userprefs($userdata);
// End session management

// Start Include language file
$language = $board_config['default_lang'];
if( !file_exists($phpbb_root_path . 'language/lang_' . $language . '/lang_auction.'.$phpEx) )
{
$language = 'english';
}
include($phpbb_root_path . 'language/lang_' . $language . '/lang_auction.' . $phpEx);
// end include language file


$auction_config_data = init_auction_config();

// Dont show anything if auction is deactivated
( $auction_config_data['auction_disable'] == 1 ) ? message_die(GENERAL_MESSAGE, $lang['auction_disable']) : "";

// Information for the standard Who-is-Online-Block
$total_posts = get_db_stat('postcount');
$total_users = get_db_stat('usercount');
$newest_userdata = get_db_stat('newestuser');
$newest_user = $newest_userdata['username'];
$newest_uid = $newest_userdata['user_id'];

if( $total_posts == 0 )
{
$l_total_post_s = $lang['Posted_articles_zero_total'];
}
else if( $total_posts == 1 )
{
$l_total_post_s = $lang['Posted_article_total'];
}
else
{
$l_total_post_s = $lang['Posted_articles_total'];
}

if( $total_users == 0 )
{
$l_total_user_s = $lang['Registered_users_zero_total'];
}
else if( $total_users == 1 )
{
$l_total_user_s = $lang['Registered_user_total'];
}
else
{
$l_total_user_s = $lang['Registered_users_total'];
}
// End information for standard Who-is-online-Block

// Include-Blocks
includeTickerBlock();
includeAuctionRoomBlock();
includeCloseToEndBlock();
includeStatisticBlock();
includeMyAuctionsBlock($userdata);
includeCalendarBlock();
includeSearchBlock();
includeTermsBlock();
includeNewsBlock();
includeAuctionSpecialBlock();


// START
if ( $HTTP_GET_VARS[POST_AUCTION_OFFER_URL] <> "")
{
$auction_offer_id = $HTTP_GET_VARS[POST_AUCTION_OFFER_URL];
}

// Check if id is set
if ( $HTTP_POST_VARS['auction_quickview_id'] <> "")
{
$auction_offer_id = $HTTP_POST_VARS['auction_quickview_id'];
}

// Grab offer data
$sql = "SELECT o.*,
u.username,
u.user_id
FROM (" . AUCTION_OFFER_TABLE . " o
LEFT JOIN " . USERS_TABLE . " u ON u.user_id = o.FK_auction_offer_user_id)
WHERE o.PK_auction_offer_id = '" . $auction_offer_id . "'";

if( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not query offer', '', __LINE__, __FILE__, $sql);
} // End if
$auction_offer_row = $db->sql_fetchrow($result);

// Does auction exist with this id ?
( $auction_offer_row['auction_offer_title']=="" ) ? message_die(GENERAL_MESSAGE, $lang['auction_offer_does_not_exist']) : "";

// Do not display "not paid" offers to anybody except creator and admin
if ($auction_offer_row['auction_offer_paid']==0 AND $auction_offer_row['FK_auction_offer_user_id']<>$userdata['user_id'] AND $userdata['user_level']<>1 )
{
message_die(GENERAL_MESSAGE, $lang['auction_offer_does_not_exist']);
} // End if

if (count($auction_offer_row)>0)
{

// get username of max-bid
$sql = "SELECT b.*,
u.username,
u.user_id,
u.user_level
FROM (" . AUCTION_BID_TABLE . " b
LEFT JOIN " . USERS_TABLE . " u ON u.user_id = b.FK_auction_bid_user_id)
WHERE b.FK_auction_bid_offer_id=" . $auction_offer_id . "
ORDER BY b.auction_bid_price DESC";

if( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not query corresponding bids', '', __LINE__, __FILE__, $sql);
} // End if

$auction_offer_max_bidder_id = "-";
$auction_offer_max_bidder_name = "-";

while ($auction_corresponding_bidder_row = $db->sql_fetchrow($result))
{
if ( $auction_offer_max_bidder_name=="-" )
{
$auction_offer_max_bidder_price = $auction_corresponding_bidder_row['auction_bid_price'];
$auction_offer_max_bidder_id = $auction_corresponding_bidder_row['user_id'];
$auction_offer_max_bidder_name = $auction_corresponding_bidder_row['username'];
} // End if
$auction_corresponding_bidder_matches[] = $auction_corresponding_bidder_row;
} // End while

if ( count($auction_corresponding_bidder_matches) == 0 )
{
$template->assign_block_vars('bidrow', array(
'AUCTION_OFFER_BID_CLASS' => 'row2',
'AUCTION_OFFER_BID_NO' => $lang['auction_no_bid']
));
} // End if

for ($i = 0; $i < count($auction_corresponding_bidder_matches); $i++)
{
// create different colors for bid history
// bcmod does not work for every php-version !!!!
//if ( bcmod($i+1, 2) == 1 )
// {
$row_class = 'row2';
// }
//else
// {
// $row_class = 'row3';
// } // End if

$template->assign_block_vars('bidrow', array(
'AUCTION_OFFER_BID_CLASS' => $row_class,
'AUCTION_OFFER_BID_BIDDER_NAME' => '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&amp;" . POST_USERS_URL . "=" . $auction_corresponding_bidder_matches[$i]['user_id'] . "") . '">( ' . $auction_corresponding_bidder_matches[$i]['username'] . ' )</a>',
'AUCTION_OFFER_BID_BIDDER_RATING' => '<a href="' . append_sid("auction_rating.$phpEx?mode=view&" . POST_USERS_URL . "=" . $auction_corresponding_bidder_matches[$i]['user_id'] . "") . '">[ ' . $lang['auction_user_rating'] . ' ] </a>',
'AUCTION_OFFER_BID_PRICE' => $auction_corresponding_bidder_matches[$i]['auction_bid_price'] . " " . $auction_config_data['currency']
));
} // End for
}
else
{
$auction_offer_bid_total = $lang['auction_no_bid'];
$auction_offer_bid_max = $lang['auction_no_bid'];
} // End if

// Extra-features currently just for admin
$auction_offer_delete_image = '';
$auction_offer_move_image = '';
$auction_offer_edit_image = '';
$auction_offer_special_image = '';
$auction_offer_add_to_watchlist_image = '';

if ($userdata['user_level'] == ADMIN)
{
$auction_offer_delete_image = '<a href="' . append_sid("auction_offer.$phpEx?mode=delete&" . POST_AUCTION_OFFER_URL . "=" . $auction_offer_id) . '"><img src="' . $images['icon_auction_delete'] . '" alt="' . $lang['auction_offer_delete'] . '" title="' . $lang['auction_offer_delete'] . '" border="0" /></a>';
$auction_offer_special_image = '<a href="' . append_sid("auction_offer.$phpEx?mode=feature&" . POST_AUCTION_OFFER_URL . "=" . $auction_offer_id) . '"><img src="' . $images['icon_auction_feature'] . '" alt="' . $lang['auction_offer_feature'] . '" title="' . $lang['auction_offer_feature'] . '" border="0" /></a>';
$auction_offer_move_image = '<a href="' . append_sid("auction_offer.$phpEx?mode=move_select&" . POST_AUCTION_OFFER_URL . "=" . $auction_offer_id) . '"><img src="' . $images['icon_auction_move'] . '" alt="' . $lang['auction_offer_move'] . '" title="' . $lang['auction_offer_move'] . '" border="0" /></a>';
}

if ($userdata['user_level'] != ANONYMOUS)
{
$auction_offer_add_to_watchlist_image = '<a href="' . append_sid("auction_myauctions.php?mode=add_to_watchlist&" . POST_AUCTION_OFFER_URL . "=" . $auction_offer_id) . '"><img src="' . $images['icon_auction_watch'] . '" alt="' . $lang['auction_offer_add_to_watchlist'] . '" title="' . $lang['auction_offer_add_to_watchlist'] . '" border="0" /></a>';
}
} // End if

// FEATURE OFFER
if ( $userdata['user_level']==1 )
{
$auction_offer_feature_link = append_sid("auction_offer.$phpEx?mode=feature&" . POST_AUCTION_OFFER_URL . "=" . $auction_offer_id . '');
}
else
{
$auction_offer_feature_link = "";
} // End if

// Move offer
if ( $userdata['user_level']==1 )
{
$auction_offer_move_link = append_sid("auction_offer.$phpEx?mode=move_select&" . POST_AUCTION_OFFER_URL . "=" . $auction_offer_id . '');
}
else
{
$auction_offer_move_link = "";
} // End if


// UPDATE OFFER-VIEWS
$sql = "UPDATE " . AUCTION_OFFER_TABLE . "
SET auction_offer_views = auction_offer_views + 1
WHERE PK_auction_offer_id = " . $auction_offer_id . "";

if( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not update offer views', '', __LINE__, __FILE__, $sql);
}

$auction_offer_time_start = create_date($board_config['default_dateformat'], $auction_offer_row['auction_offer_time_start'], $board_config['board_timezone']);
$auction_offer_time_stop = create_date($board_config['default_dateformat'], $auction_offer_row['auction_offer_time_stop'], $board_config['board_timezone']);
if ($auction_offer_row['auction_offer_time_stop']<time() )
{
$auction_time_remaining = '-';
}
else
{
$auction_time_remaining = datediff(time(), $auction_offer_row['auction_offer_time_stop']);
}
// create auction-offer-message (not started, active, or over)
if ( $auction_offer_row['auction_offer_time_start']> time())
{
$auction_offer_time_message = "<font color=\"red\">" . $lang['auction_offer_not_started'] . "</font>";
}
elseif ($auction_offer_row['auction_offer_time_stop']<time())
{
$auction_offer_time_message = "<font color=\"red\">" . $lang['auction_offer_over'] . "</font>";
}
else
{
$auction_offer_time_message = "<font color=\"red\">" . $lang['auction_offer_status_active'] . "</font>";
}

// getting seller-info
$sql = "SELECT u.username, u.user_id, u.user_posts, u.user_from, u.user_website, u.user_email, u.user_icq, u.user_aim, u.user_yim, u.user_regdate, u.user_msnm, u.user_viewemail, u.user_rank, u.user_sig, u.user_sig_bbcode_uid, u.user_avatar, u.user_avatar_type, u.user_allowavatar, u.user_allowsmile
FROM " . USERS_TABLE . " u
WHERE u.user_id = " . $auction_offer_row['user_id'] . "";

if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, "Could not obtain post/user information.", '', __LINE__, __FILE__, $sql);
}

$sellerrow = array();
if ($row = $db->sql_fetchrow($result))
{
do
{
$sellerrow[] = $row;
}
while ($row = $db->sql_fetchrow($result));
$db->sql_freeresult($result);
}

$temp_url = append_sid("profile.$phpEx?mode=viewprofile&amp;" . POST_USERS_URL . "=" . $auction_offer_row['user_id'] . "");
$profile_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_profile'] . '" alt="' . $lang['Read_profile'] . '" title="' . $lang['Read_profile'] . '" border="0" /></a>';
$profile = '<a href="' . $temp_url . '">' . $lang['Read_profile'] . '</a>';

$temp_url = append_sid("privmsg.$phpEx?mode=post&amp;" . POST_USERS_URL . "=" . $auction_offer_row['user_id'] . "");
$pm_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_pm'] . '" alt="' . $lang['Send_private_message'] . '" title="' . $lang['Send_private_message'] . '" border="0" /></a>';
$pm = '<a href="' . $temp_url . '">' . $lang['Send_private_message'] . '</a>';

$email_uri = ( $board_config['board_email_form'] ) ? append_sid("profile.$phpEx?mode=email&amp;" . POST_USERS_URL .'=' . $auction_offer_row['user_id']) : 'mailto:' . $sellerrow[0]['user_email'];

$email_img = '<a href="' . $email_uri . '"><img src="' . $images['icon_email'] . '" alt="' . $lang['Send_email'] . '" title="' . $lang['Send_email'] . '" border="0" /></a>';
$email = '<a href="' . $email_uri . '">' . $lang['Send_email'] . '</a>';

$www_img = ( $sellerrow[0]['user_website'] ) ? '<a href="' . $sellerrow[0]['user_website'] . '" target="_userwww"><img src="' . $images['icon_www'] . '" alt="' . $lang['Visit_website'] . '" title="' . $lang['Visit_website'] . '" border="0" /></a>' : '';
$www = ( $sellerrow[0]['user_website'] ) ? '<a href="' . $sellerrow[0]['user_website'] . '" target="_userwww">' . $lang['Visit_website'] . '</a>' : '';

if ( !empty($sellerrow[0]['user_icq']) )
{
$icq_img = '<a href="http://wwp.icq.com/scripts/search.dll?to=' . $sellerrow[0]['user_icq'] . '"><img src="' . $images['icon_icq'] . '" alt="' . $lang['ICQ'] . '" title="' . $lang['ICQ'] . '" border="0" /></a>';
$icq = '<a href="http://wwp.icq.com/scripts/search.dll?to=' . $sellerrow[0]['user_icq'] . '">' . $lang['ICQ'] . '</a>';
}
else
{
$icq_status_img = '';
$icq_img = '';
$icq = '';
}

$aim_img = ( $sellerrow[0]['user_aim'] ) ? '<a href="aim:goim?screenname=' . $sellerrow[0]['user_aim'] . '&amp;message=Hello+Are+you+there?"><img src="' . $images['icon_aim'] . '" alt="' . $lang['AIM'] . '" title="' . $lang['AIM'] . '" border="0" /></a>' : '';
$aim = ( $sellerrow[0]['user_aim'] ) ? '<a href="aim:goim?screenname=' . $sellerrow[0]['user_aim'] . '&amp;message=Hello+Are+you+there?">' . $lang['AIM'] . '</a>' : '';

$temp_url = append_sid("profile.$phpEx?mode=viewprofile&amp;" . POST_USERS_URL . "=" . $auction_offer_row['user_id'] . "");
$msn_img = ( $sellerrow[0]['user_msnm'] ) ? '<a href="' . $temp_url . '"><img src="' . $images['icon_msnm'] . '" alt="' . $lang['MSNM'] . '" title="' . $lang['MSNM'] . '" border="0" /></a>' : '';
$msn = ( $sellerrow[0]['user_msnm'] ) ? '<a href="' . $temp_url . '">' . $lang['MSNM'] . '</a>' : '';

$yim_img = ( $sellerrow[0]['user_yim'] ) ? '<a href="http://edit.yahoo.com/config/send_webmesg?.target=' . $sellerrow[0]['user_yim'] . '&amp;.src=pg"><img src="' . $images['icon_yim'] . '" alt="' . $lang['YIM'] . '" title="' . $lang['YIM'] . '" border="0" /></a>' : '';
$yim = ( $sellerrow[0]['user_yim'] ) ? '<a href="http://edit.yahoo.com/config/send_webmesg?.target=' . $sellerrow[0]['user_yim'] . '&amp;.src=pg">' . $lang['YIM'] . '</a>' : '';

// Prepare image
if ( empty($auction_offer_row['auction_offer_picture']))
{
//set a default image
$auction_offer_picture = "<img src=\"". $phpbb_root_path . 'auction/images/nopic.gif' . "\" alt=\"No image\"></img>";
}
else
{
$auction_offer_picture = "<img src=\"". $phpbb_root_path . AUCTION_PICTURE_UPLOAD_PATH . $auction_offer_row['auction_offer_picture'] . "\" onload=\"javascript:if(this.width > 150)this.width = (150)\"></img>";
}
// START RATING WINDOW

// as SELLER

// Prepare categories
$sql = "SELECT * FROM " . AUCTION_RATING_TABLE . "";

if( !$result = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, "Couldn't get list of rating-options", "", __LINE__, __FILE__, $sql);
}

$rating_category_list = "";
while( $row = $db->sql_fetchrow($result) )
{
$auction_category_list .= "<option value=\"" . $row['PK_auction_rating_id']. "\">" . $row['auction_rating_title'] . "</option>";
}

// Rating as seller
if ( ( $auction_offer_row['auction_offer_time_stop']<time() ) && ( $userdata['user_id']==$auction_offer_row['user_id'] && $auction_offer_row['auction_offer_last_bid_price']>0 ))
{
$template->assign_block_vars('raterow', array(
'L_AUCTION_RATE_SELLER' => $lang['auction_rate_buyer'],
'L_AUCTION_RATING_PERSON'=> $lang['auction_offer_buyer'],
'L_AUCTION_RATE_SELLER_TEXT' => $lang['auction_rate_seller_text'],
'L_AUCTION_RATE_NOW' => $lang['auction_rate_now'],
'L_AUCTION_RATING_CATEGORY' => $lang['auction_rating_category'],
'AUCTION_OFFER_RATING_CATEGORIES' => $auction_category_list,
'AUCTION_OFFER_OFFERER' => $auction_offer_max_bidder_name,
'S_AUCTION_RATE_ACTION' => append_sid("auction_rating.$phpEx?mode=create&" . POST_AUCTION_OFFER_URL . "=" . $auction_offer_id)
));
}
// Rating as buyer
if ( ( $auction_offer_row['auction_offer_time_stop']<time() ) && ( $userdata['user_id']==$auction_offer_max_bidder_id ))
{
$template->assign_block_vars('raterow', array(
'L_AUCTION_RATE_SELLER' => $lang['auction_rate_seller'],
'L_AUCTION_RATING_PERSON'=> $lang['auction_offer_offerer'],
'L_AUCTION_RATE_SELLER_TEXT' => $lang['auction_rate_seller_text'],
'L_AUCTION_RATE_NOW' => $lang['auction_rate_now'],
'AUCTION_OFFER_OFFERER' => $auction_offer_row['username'],
'L_AUCTION_RATING_CATEGORY' => $lang['auction_rating_category'],
'AUCTION_OFFER_RATING_CATEGORIES' => $auction_category_list,
'S_AUCTION_RATE_ACTION' => append_sid("auction_rating.$phpEx?mode=create&" . POST_AUCTION_OFFER_URL . "=" . $auction_offer_id)

));
}
// END RATING

// BEGIN prepare meassage

$message = $auction_offer_row['auction_offer_text'];
if ( !$board_config['allow_html'] )
{
if ( $board_config['allow_html'] )
{
$message = preg_replace('#(<)([\/]?.*?)(>)#is', "&lt;\\2&gt;", $message);
}
}


// Parse message and/or sig for BBCode if reqd
if ( $board_config['allow_bbcode'] )
{
$message = ( $board_config['allow_bbcode'] ) ? bbencode_second_pass($message, 0) : preg_replace('/\:[0-9a-z\:]+\]/si', ']', $message);
}

$message = make_clickable($message);

// Parse smilies
if ( $board_config['allow_smilies'] )
{
$message = smilies_pass($message);
}
// END prepare message


// Output page
$page_title = $lang['auction_user_rating_view_offer'] . ' (' . $lang['auction_offer_time_stop'] . ' ' . $auction_offer_time_stop . ') - ' . $auction_offer_row['auction_offer_title'];
include($phpbb_root_path . 'includes/page_header.'.$phpEx);

// Display bid-fields only if auction is still active
if (( $auction_offer_row['auction_offer_time_stop']>time()) && ($auction_offer_row['auction_offer_time_start']<time()))
{
$template->assign_block_vars('bidnowrow', array(
'L_AUCTION_YOUR_NAME' => $lang['auction_your_name'],
'L_AUCTION_YOUR_AMOUT' => $lang['auction_your_amout'] . " (in " . $auction_config_data['currency'] . ")",
'L_AUCTION_BID_NOW' => $lang['auction_bid_now']
));
}

$template->set_filenames(array(
'body' => 'auction_view_offer_body.tpl')
);

$template->assign_vars(array(
'TOTAL_POSTS' => sprintf($l_total_post_s, $total_posts),
'TOTAL_USERS' => sprintf($l_total_user_s, $total_users),
'NEWEST_USER' => sprintf($lang['Newest_user'], '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&amp;" . POST_USERS_URL . "=$newest_uid") . '">', $newest_user, '</a>'),
'L_ONLINE_EXPLAIN' => $lang['Online_explain'],
'L_AUCTION_OFFER_QUICK_VIEW_ID' => $lang['auction_offer_quick_view_id'],

'AUCTION_OFFER_ID' => $auction_offer_row['PK_auction_offer_id'],
'AUCTION_OFFER_TITLE' => $auction_offer_row['auction_offer_title'],
'AUCTION_OFFER_OFFERER' => "<a href=\"" . append_sid("profile.$phpEx?mode=viewprofile&amp;" . POST_USERS_URL . "=" . $auction_offer_row['user_id']) . "\">" . $auction_offer_row['username'] . "</a>",
'AUCTION_OFFER_OFFERER_RATING' => append_sid("auction_rating.$phpEx?mode=view&" . POST_USERS_URL . "=" . $auction_offer_row['user_id'] . ""),
'L_AUCTION_OFFER_OFFERER_RATING' => $lang['auction_user_rating'],
'AUCTION_OFFER_TEXT'=> $message,
'AUCTION_OFFER_TIME_START'=> $auction_offer_time_start,
'AUCTION_OFFER_TIME_STOP'=> $auction_offer_time_stop,
'AUCTION_OFFER_TIME_REMAINING' => $auction_time_remaining,
'AUCTION_OFFER_PRICE_START'=> $auction_offer_row['auction_offer_price_start'] . " " . $auction_config_data['currency'],
'AUCTION_OFFER_VIEWS'=> $auction_offer_row['auction_offer_views'],
'AUCTION_OFFER_BIDS_TOTAL' => count($auction_corresponding_bidder_matches),
'AUCTION_OFFER_LAST_BID_PRICE'=> $auction_offer_bid_max . " " . $auction_config_data['currency'],
'ACUTION_ROOM_YOUR_NAME' => $userdata['username'],
'AUCTION_OFFER_BIDDER' => $auction_corresponding_bidder,
'AUCTION_OFFER_TIME_MESSAGE' => $auction_offer_time_message,
'AUCTION_OFFER_DELETE_IMAGE' => $auction_offer_delete_image,
'AUCTION_OFFER_ADD_TO_WATCHLIST_IMAGE' => $auction_offer_add_to_watchlist_image,
'AUCTION_OFFER_PICTURE' => $auction_offer_picture,
'AUCTION_OFFER_MOVE_IMAGE' =>$auction_offer_move_image,
'AUCTION_OFFER_EDIT_IMAGE' =>$auction_offer_edit_image,
'AUCTION_OFFER_SPECIAL_IMAGE' =>$auction_offer_special_image,
'AUCTION_OFFER_SHIPPING_PRICE' => $auction_offer_row['auction_offer_shipping_price'] . " " . $auction_config_data['currency'],

'AUCTION_CURRENT_BID' => ( $auction_offer_max_bidder_price>0 ) ? $auction_offer_max_bidder_price . " " . $auction_config_data['currency'] : $auction_offer_row['auction_offer_price_start'] . " " . $auction_config_data['currency'],
'AUCTION_MINIMUM_BID' => ( $auction_offer_max_bidder_price>0) ? ($auction_offer_max_bidder_price+1) . " " . $auction_config_data['currency']: $auction_offer_row['auction_offer_price_start'] . " " . $auction_config_data['currency'],
'AUCTION_SEND_PM' => append_sid("privmsg.$phpEx?mode=post&" . POST_USERS_URL . "=" . $auction_offer_row['user_id']),
'AUCTION_SEND_EMAIL' => ( $board_config['board_email_form'] ) ? append_sid("profile.$phpEx?mode=email&amp;" . POST_USERS_URL .'=' . $auction_offer_row['user_id']) : 'mailto:' . $sellerrow[0]['user_email'],
'L_AUCTION_TIME_REMAINING' => $lang['auction_time_remaining'],
'L_AUCTION_MINIMUM_BID' => $lang['auction_minimum_bid'],
'L_AUCTION_CURRENT_BID' => $lang['auction_current_bid'],
'L_AUCTION_SEND_MAIL' => $lang['auction_send_mail'],
'L_AUCTION_SEND_PM' => $lang['auction_send_pm'],

'L_AUCTION_OFFER_SHIPPING_PRICE' => $lang['auction_offer_shipping_price'],
'L_AUCTION_OFFER_TIME_STATUS' => $lang['auction_offer_time_status'],
'L_AUCTION_OFFER_OFFERER'=> $lang['auction_offer_offerer'],
'L_AUCTION_OFFER_TEXT'=> $lang['auction_offer_text'],
'L_AUCTION_OFFER_TIME_START' => $lang['auction_offer_time_start'],
'L_AUCTION_OFFER_TIME_STOP' => $lang['auction_offer_time_stop'],
'L_AUCTION_OFFER_PRICE_START' => $lang['auction_offer_price_start'],
'L_AUCTION_OFFER_VIEWS' => $lang['auction_offer_views'],
'L_AUCTION_OFFER_STATE' => $lang['auction_offer_state'],
'L_AUCTION_YOUR_BID' => $lang['auction_your_bid'],
'L_AUCTION_OFFER_BIDS_TOTAL' => $lang['auction_offer_bid_total'],


'L_AUCTION_OFFER_LAST_BID_PRICE' => $lang['auction_offer_last_bid_price'],
'PROFILE_IMG' => $profile_img,
'PROFILE' => $profile,
'SEARCH_IMG' => $search_img,
'SEARCH' => $search,
'PM_IMG' => $pm_img,
'PM' => $pm,
'EMAIL_IMG' => $email_img,
'EMAIL' => $email,
'WWW_IMG' => $www_img,
'WWW' => $www,
'ICQ_IMG' => $icq_img,
'ICQ' => $icq,
'AIM_IMG' => $aim_img,
'AIM' => $aim,
'MSN_IMG' => $msn_img,
'MSN' => $msn,
'YIM_IMG' => $yim_img,
'YIM' => $yim,
'U_AUCTION_OFFER_FEATURE_LINK' => $auction_offer_feature_link,
'U_AUCTION_OFFER_MOVE_LINK' => $auction_offer_move_link,

'S_AUCTION_YOUR_BID_ACTION' => append_sid("auction_offer.$phpEx?mode=bid&" . POST_AUCTION_OFFER_URL . "=" . $auction_offer_id),
'MODAUTHOR' => $lang['modauthor'],
'MODPOWERED' => $lang['modpowered']
)
);

//
// Generate the page
//
$template->pparse('body');

include($phpbb_root_path . 'includes/page_tail.'.$phpEx);


?>
Back to top
View user's profile Send private message
FR
Site Admin
Site Admin


Joined: 26 Jan 2004
Posts: 1764
Location: root directory

PostPosted: Fri Jul 30, 2004 4:42 pm    Post subject: Reply with quote

Ok, you still got 2 missing
1.
Code:
$outbid_pm_subject = $lang['outbid'] . " - " . prepare_message(addslashes(unprepare_message(htmlspecialchars(trim(stripslashes($auction_corresponding_bids_start_stop_row['auction_offer_title']))))));


Replace with

Code:
$outbid_pm_subject = $lang['outbid'] . " - " . prepare_message(addslashes(unprepare_message(htmlspecialchars(trim(stripslashes($auction_corresponding_bids_start_stop_row['auction_offer_title']))))), $board_config['allow_html'], $board_config['allow_bbcode'], $board_config['allow_smilies'], 0);


2.
Code:
$sql = "INSERT INTO " . PRIVMSGS_TEXT_TABLE . "
(privmsgs_text_id, privmsgs_text)
VALUES ($outbid_sent_id,
'" . str_replace("\'", "''", addslashes(sprintf($outbid_pm,$board_config['sitename']))) . "</br></br><a href=auction_offer_view.php?ao=" . $HTTP_GET_VARS[POST_AUCTION_OFFER_URL] . '>' . prepare_message(addslashes(unprepare_message(htmlspecialchars(trim(stripslashes($auction_corresponding_bids_start_stop_row['auction_offer_title'])))))) . '</a></br>' . $board_config['board_email_sig'] . "')";


Replace with

Code:
$sql = "INSERT INTO " . PRIVMSGS_TEXT_TABLE . "
(privmsgs_text_id, privmsgs_text)
VALUES ($outbid_sent_id,
'" . str_replace("\'", "''", addslashes(sprintf($outbid_pm,$board_config['sitename']))) . "</br></br><a href=auction_offer_view.php?ao=" . $HTTP_GET_VARS[POST_AUCTION_OFFER_URL] . '>' . prepare_message(addslashes(unprepare_message(htmlspecialchars(trim(stripslashes($auction_corresponding_bids_start_stop_row['auction_offer_title']))))), $board_config['allow_html'], $board_config['allow_bbcode'], $board_config['allow_smilies'], 0) . '</a></br>' . $board_config['board_email_sig'] . "')";


Hope it works.
The input-box here is a really bad php-editor, lol
_________________
Want to say thank you. Use my Amazon Wishlist
Meet the world on movie-on.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
Kiss News
Super Auctioneer
Super Auctioneer


Joined: 15 Jul 2004
Posts: 232

PostPosted: Fri Jul 30, 2004 5:46 pm    Post subject: Reply with quote

Yes, now it works. Thanks!

werde mal feste testen und dann mächtig Verbesserungsvorschläge machen Very Happy
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    phpbb-auction.com Forum Index -> Older Version All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


phpbb-auction.com - Developed by www.digital-media-lab.com
Sponsored by: www.globibo.com - www.learn2go.de - www.talentone.org - www.language-school.in - www.ping-ke.cn