Item Location Mod 1

View item state instead of country on items page

  1. drakky20

    drakky20 Active Member

    Joined:
    Mar 11, 2012
    Messages:
    253
    Likes Received:
    24
    drakky20 submitted a new resource:

    Item Location Mod - Item Location Mod

    Read more about this resource...
     
    Last edited by a moderator: Apr 9, 2015
  2. drakky20

    drakky20 Active Member

    Joined:
    Mar 11, 2012
    Messages:
    253
    Likes Received:
    24
    this version is no good , I'll repost the corrected file soon as I can, sometime in the next week sorry
     
  3. pani100

    pani100 Well-Known Member

    Joined:
    May 9, 2011
    Messages:
    2,327
    Likes Received:
    449
    Hello drakky20,
    What is wrong with this mod?
    I have installed it, done a bit of moddification to it like added country as well and working fine for me.
     
  4. drakky20

    drakky20 Active Member

    Joined:
    Mar 11, 2012
    Messages:
    253
    Likes Received:
    24
    you will pobably get errors in the error log

    here is the corrected version
     

    Attached Files:

  5. pani100

    pani100 Well-Known Member

    Joined:
    May 9, 2011
    Messages:
    2,327
    Likes Received:
    449
    Thanks for that,
    I had done a lot of changes to the functions_sell.inc.php in the past with country, prov ,city and zip already added and they where as your correct version, that's why I wasn't getting any errors. Must of just passed through your instructions thinking yep they are there.. next.
     
  6. j2000

    j2000 New Member

    Joined:
    Apr 29, 2012
    Messages:
    38
    Likes Received:
    0
    strange

    Hi , i have to test "item_location_mod_fixed.txt" and "item_location_mod.txt"
    There's error when i want "sell an item" error, message is : error sell.php line 496.

    See instruction :
    If i remove this part , sell an item is OK .

    So now below is my "sell.php" (zip)
    View attachment sell.zip

    Please let me know...

    Regards

    Joel
     
  7. drakky20

    drakky20 Active Member

    Joined:
    Mar 11, 2012
    Messages:
    253
    Likes Received:
    24
    Joel
    replace about line 494
    PHP:
    'B_SUBTITLE' => ($system->SETTINGS['subtitle'] == 'y')
    with

    PHP:
    'B_SUBTITLE' => ($system->SETTINGS['subtitle'] == 'y'),
    it needs a , at the end
     
    j2000 likes this.
  8. j2000

    j2000 New Member

    Joined:
    Apr 29, 2012
    Messages:
    38
    Likes Received:
    0
    This effect for when or what drakky20 ?

    Thanks

    Joel
     
  9. drakky20

    drakky20 Active Member

    Joined:
    Mar 11, 2012
    Messages:
    253
    Likes Received:
    24
    not sure what you mean by "This effect for when or what" the edit requires the , at the end of the line before you add my code to work is all
     
  10. j2000

    j2000 New Member

    Joined:
    Apr 29, 2012
    Messages:
    38
    Likes Received:
    0
    Sorry make u confused....

    1:When i not include this parts , i can "sell an item" and there's item location in auction submit form .
    2:When i include this parts ( , your correction) , i can "sell an item" and there's item location in auction submit form .
    3:When i include this parts ( , without your correction) , i can not "sell an item" .

    Point 1 and 2 , i can "sell an item" .
    So this part
    it must effect to what part of selling (because in sell.php) ?
     
  11. nay27uk

    nay27uk Super Moderator Staff Member

    Joined:
    Nov 24, 2009
    Messages:
    5,572
    Likes Received:
    547

    Is all thats doing is assigning the variables $city, $prov, and $zip to the template .tpl file so it shows on the sell page, in sell.tpl somwhere you will see.

    {PROV}
    {CITY}
    {ZIP}

    Without that in sell.tpl those sections would never show up.

    If you dont understand how the templating system works have a read of MY THREAD where I explain it a little bit better
     
    Last edited: May 6, 2012
    j2000 likes this.
  12. drakky20

    drakky20 Active Member

    Joined:
    Mar 11, 2012
    Messages:
    253
    Likes Received:
    24
    simple it's just php requires it , it's what they call syntax,
    if you mean what part does this code do , it allows the seller to specify a different location for the item other than where the seller is located , example i live in this suburb but I have an old car i left at my friends house which is in a different suburb , now a car is too big to post so obviously the buyer will have to pick it up , the buyer might decide that the location of the car is too far away to go and pick up , yet the seller might live in the same suburb as the buyer. without this mod the buyer will always assume the item is where the seller's location is listed on the auction.
    hope that makes sense
     
  13. pani100

    pani100 Well-Known Member

    Joined:
    May 9, 2011
    Messages:
    2,327
    Likes Received:
    449
    Just to make it clear when you are assigning variables in the array they need to be seperated by a comma apart from the last one. That can have a comma or not. but all the previous ones need a comma.
    Example:
    PHP:
    $template->assign_vars(array(
        
    'B_SUBTITLE' => ($system->SETTINGS['subtitle'] == 'y'),
        
    'B_AUTORELIST' => ($system->SETTINGS['autorelist'] == 'y'),
        
    'COUNTRY' => $country,
        
    'PROV' => $prov,
        
    'CITY' => $city,
        
    'ZIP' => $zip //no comma on last variable will work 
    ));
    Will work.

    PHP:
    $template->assign_vars(array(
        
    'B_SUBTITLE' => ($system->SETTINGS['subtitle'] == 'y'),
        
    'B_AUTORELIST' => ($system->SETTINGS['autorelist'] == 'y'),
        
    'COUNTRY' => $country,
        
    'PROV' => $prov,
        
    'CITY' => $city,
        
    'ZIP' => $zip,     //comma on last variable will work 
    ));

    PHP:
    $template->assign_vars(array(
        
    'B_SUBTITLE' => ($system->SETTINGS['subtitle'] == 'y'),
        
    'B_AUTORELIST' => ($system->SETTINGS['autorelist'] == 'y'),
        
    'COUNTRY' => $country //missing comma, will not work
        
    'PROV' => $prov,
        
    'CITY' => $city,
        
    'ZIP' => $zip  
    ));
     
    j2000 likes this.
  14. netley

    netley New Member

    Joined:
    Jun 21, 2012
    Messages:
    16
    Likes Received:
    0
    Hi,

    I think j2000 problem is being misunderstood, i understand the problem cause i think i am having the same problem.

    I have both Item Location Mod and Item Condition Mod installed and it seems they are conflicting with each other as when you are placing an auction everything seems fine, but once the auction is submitted then the problem shows itself. Please see the enclosed screenie of my item page.

    [​IMG]

    I hope this picture explains the problem a little better, as you can see the Location is where the Condition should be and the Condition is where the Location should be. Separately these two mods work fine and are a good additional to an already good script, just together, which is how i would like to use them the above happens.

    I am new to this script and have jumped straight in with version 1.04, but i don't think that is the problem and j2000 commented on this before 1.04 came out, so he must be using 1.03 or earlier.

    I am trying to find a solution myself, but i am still getting to grips with WeBid itself and i am no expert coder, more trial & error. Hopefully now the problem is more understood the author or one of the other posters may have some idea. I am surprised though that nobody else using the two mods together hasn't encountered the same issue.
     
    Last edited: Jun 21, 2012
  15. nay27uk

    nay27uk Super Moderator Staff Member

    Joined:
    Nov 24, 2009
    Messages:
    5,572
    Likes Received:
    547
    shift the code in item.tpl for both mods around
     
  16. drakky20

    drakky20 Active Member

    Joined:
    Mar 11, 2012
    Messages:
    253
    Likes Received:
    24

    just looks to me like you have the values swapped around in item.tpl
    try this

    find
    PHP:
    <a href="#description">{L_018}</a> &nbsp;&nbsp;&nbsp
                          <
    table border='0' width="100%" cellspacing="0" cellpadding="1">
                            <!-- 
    auction type -->
    replace with this

    PHP:
    <a href="#description">{L_018}</a> &nbsp;&nbsp;&nbsp
                          <
    table border='0' width="100%" cellspacing="0" cellpadding="1">
                            <!-- 
    display item description mod -->
                            <
    tr>
                             <
    td width="50%" align="left"><b>{L_1036}:</b> </td>
                              <
    td align="left">{ITEM_CONDITION}</td>
                            </
    tr>
                            <
    tr>
                             <
    td width="50%" align="left"><b>{L_1037}:</b> </td>
                              <
    td align="left">{ITEM_MANUFACTURER}</td>
                            </
    tr>
                            <
    tr>
                            <
    td width="50%" align="left"><b>{L_1038}:</b> </td>
                              <
    td align="left">{ITEM_MODEL}</td>
                            </
    tr>
                            <
    tr>
                            <
    td width="50%" align="left"><b>{L_1039}:</b> </td>
                              <
    td align="left">{ITEM_COLOUR}</td>
                            </
    tr>
                            <
    tr>
                            <
    td width="50%" align="left"><b>{L_1040}:</b> </td>
                              <
    td align="left">{ITEM_YEAR}</td>
                            </
    tr>
                            <!--  
    end display item description mod  -->
                            <!-- 
    auction type -->

    find this


    PHP:
    <td width="50%" align="left">{L_923}: </td>
                                                        
                              <
    td align="left">{COUNTRY}</td

    replace with this

    PHP:
    <!-- display city not country also display item actual location
                             
    <td width="50%" align="left"><b>{L_1033}: </b> </td>
                               <
    td align="left"> <b></b> {CITY} {PROV} ({ZIP})<br></td>
               <!--  
    end display item actual location -->                          


    if that doesn't work send me your item.tpl, item.php and messages.inc.php and I'll sort it for you
     
  17. netley

    netley New Member

    Joined:
    Jun 21, 2012
    Messages:
    16
    Likes Received:
    0
    Hi,

    Thanks for the replies and the kind offer of looking over my files.

    I can see your line of thinking that maybe i had the code around the wrong way and this was causing it to display the information in the wrong place. So after going through the instructions and code again, it seemed that everything was where it should be and also checked the code suggested by drakky20 which is part of the instructions anyway. So no joy there.

    I was looking at the database table 'web auctions' and noticed that the information was actually being written to the database, so surely my problem is something to do with the database. I to was having problems inputting the sql's and chose to create them manually, it seems this was my problem. I have deleted the new fields and inputted them again with the sql's supplied with semi colons on the end and everything works fine, well almost.....

    Whilst testing it i have noticed that if you input information into the condition ie. model, colour, then when you place another auction the information entered from the previous auction is retained. Not sure if this is just me or has this been experienced by anybody else.
     
  18. netley

    netley New Member

    Joined:
    Jun 21, 2012
    Messages:
    16
    Likes Received:
    0
    That's weird.....it's not doing it now

    Ignore the last part of my previous post as it is not retaining the previous auction information, not sure what i have done.

    All working fine. Thank you
     
  19. drakky20

    drakky20 Active Member

    Joined:
    Mar 11, 2012
    Messages:
    253
    Likes Received:
    24
    no problem you're welcome , yes the order in which you put the data into the database is important so it sounds like you had the edits in functions_sell.inc.php in the wrong order , unfortunately i couldn't supply both mods as 1 mod as some people might only want 1 of them , glad to hear you got it going
    on the subject of values being storeed from the previous auction i did see that once , it happens if you don't complete the listing as the values are stored as sessions once the listing is posted the sessions are cleared
     
  20. liran

    liran New Member

    Joined:
    May 17, 2012
    Messages:
    136
    Likes Received:
    2
    hey there.. im having a problem after adding this mod.

    error log:
    Code:
    
    
    
    06-10-2012, 13:12:02:: database error please contact you site admin. INSERT INTO webid_auctions VALUES (NULL, 2, 'awfasgasgas', '', '1349518322', 'gasgasg', '', 58, 0, '0.99', '0', '0', '0', '1', '1', '0', '1', 'paypal', 0, '1349604722', 0, 0, 1, 1, 0, 0, 0, 0, 'n', '', 'n', 'n', 'n', 'n', 0, 'new', '', '', '', ', 'asfasf', 'asfasf', '55555')
     You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'asfasf', 'asfasf', '55555')' at line 1
    ..bla..
    
    
    
    
    
    i think its related with the
    function addauction()

    heres what i had before adding this mod:

    Code:
    function addauction()
    {
    	global $DBPrefix, $_SESSION, $user, $a_starts, $a_ends, $payment_text, $system, $fee;
    
    	return "INSERT INTO " . $DBPrefix . "auctions VALUES (NULL, " . $user->user_data['id'] . ", '" . $system->cleanvars($_SESSION['SELL_title']) . "', '" . $system->cleanvars($_SESSION['SELL_subtitle']) . "', '" .  $a_starts . "', '" . addslashes($_SESSION['SELL_description']) . "', '" . $system->cleanvars($_SESSION['SELL_pict_url']) . "', " . $_SESSION['SELL_sellcat1'] . ", " . intval($_SESSION['SELL_sellcat2']) . ", '" . $system->input_money(($_SESSION['SELL_buy_now_only'] == 'n') ? $_SESSION['SELL_minimum_bid'] : $_SESSION['SELL_buy_now_price']) . "', '" . $system->input_money($_SESSION['SELL_shipping_cost']) . "', '" . $system->input_money(($_SESSION['SELL_with_reserve'] == 'yes') ? $_SESSION['SELL_reserve_price'] : 0) . "', '" . $system->input_money(($_SESSION['SELL_with_buy_now'] == 'yes') ? $_SESSION['SELL_buy_now_price'] : 0) . "', '" . $_SESSION['SELL_atype'] . "', '" . $_SESSION['SELL_duration'] . "', '" . $system->input_money($_SESSION['SELL_customincrement']) . "', '" . $_SESSION['SELL_shipping'] . "', '" . $payment_text . "', " . (($_SESSION['SELL_international']) ? 1 : 0) . ", '" . $a_ends . "', 0, 0, " . (($_SESSION['SELL_file_uploaded']) ? 1 : 0) . ", " . $_SESSION['SELL_iquantity'] . ", 0, " . intval($_SESSION['SELL_relist']) . ", 0, 0, 'n', '" . $system->cleanvars($_SESSION['SELL_shipping_terms']) . "', '" . $_SESSION['SELL_buy_now_only'] . "', '" . $_SESSION['SELL_is_bold'] . "', '" . $_SESSION['SELL_is_highlighted'] . "', '" . $_SESSION['SELL_is_featured'] . "', " . $fee .
    ", '" . $system->cleanvars($_SESSION['SELL_item_condition']) . "', '" . $system->cleanvars($_SESSION['SELL_item_manufacturer']) . "', '" . $system->cleanvars($_SESSION['SELL_item_model']) . "', '" . $system->cleanvars($_SESSION['SELL_item_colour']) . "', '" . $system->cleanvars($_SESSION['SELL_item_year']) . "')";
    
    
     ")";
    }
    
    here's what it become:
    Code:
    
    function addauction()
    {
    	global $DBPrefix, $_SESSION, $user, $a_starts, $a_ends, $payment_text, $system, $fee;
    
    	return "INSERT INTO " . $DBPrefix . "auctions VALUES (NULL, " . $user->user_data['id'] . ", '" . $system->cleanvars($_SESSION['SELL_title']) . "', '" . $system->cleanvars($_SESSION['SELL_subtitle']) . "', '" .  $a_starts . "', '" . addslashes($_SESSION['SELL_description']) . "', '" . $system->cleanvars($_SESSION['SELL_pict_url']) . "', " . $_SESSION['SELL_sellcat1'] . ", " . intval($_SESSION['SELL_sellcat2']) . ", '" . $system->input_money(($_SESSION['SELL_buy_now_only'] == 'n') ? $_SESSION['SELL_minimum_bid'] : $_SESSION['SELL_buy_now_price']) . "', '" . $system->input_money($_SESSION['SELL_shipping_cost']) . "', '" . $system->input_money(($_SESSION['SELL_with_reserve'] == 'yes') ? $_SESSION['SELL_reserve_price'] : 0) . "', '" . $system->input_money(($_SESSION['SELL_with_buy_now'] == 'yes') ? $_SESSION['SELL_buy_now_price'] : 0) . "', '" . $_SESSION['SELL_atype'] . "', '" . $_SESSION['SELL_duration'] . "', '" . $system->input_money($_SESSION['SELL_customincrement']) . "', '" . $_SESSION['SELL_shipping'] . "', '" . $payment_text . "', " . (($_SESSION['SELL_international']) ? 1 : 0) . ", '" . $a_ends . "', 0, 0, " . (($_SESSION['SELL_file_uploaded']) ? 1 : 0) . ", " . $_SESSION['SELL_iquantity'] . ", 0, " . intval($_SESSION['SELL_relist']) . ", 0, 0, 'n', '" . $system->cleanvars($_SESSION['SELL_shipping_terms']) . "', '" . $_SESSION['SELL_buy_now_only'] . "', '" . $_SESSION['SELL_is_bold'] . "', '" . $_SESSION['SELL_is_highlighted'] . "', '" . $_SESSION['SELL_is_featured'] . "', " . $fee .
    ", '" . $system->cleanvars($_SESSION['SELL_item_condition']) . "', '" . $system->cleanvars($_SESSION['SELL_item_manufacturer']) . "', '" . $system->cleanvars($_SESSION['SELL_item_model']) . "', '" . $system->cleanvars($_SESSION['SELL_item_colour']) . "', '" . $system->cleanvars($_SESSION['SELL_item_year']) . ", '" .$system->cleanvars($_SESSION['SELL_city']) . "', '" .$system->cleanvars($_SESSION['SELL_prov']) . "', '" . $system->cleanvars($_SESSION['SELL_zip']) . "')";
    
    
     ")";
    }
    
    
    
    
    if somone can help me it will be great, btw if you can explain to me how to you use this function it will even be greater :p .
    thanks.
     

Share This Page