Change default $URL in functions.inc.php

A place to discuss and receive support for the Web Auction application.

Change default $URL in functions.inc.php

Postby JGerrity » Fri Mar 16, 2012 10:23 am

Hello,

Is there an easy way to change the URL that is sent as part of the user outbid email? I know it's using the $url variable within functions.inc.php However, I'd like to create a generic method to change the default site URL (My auction does not user index.php as the default. I was thinking that creating a new Define within config.inc.php and then using that $ENV would work but it doesn't.

ie: within config.inc.php
Code: Select all
define('AUCTION_SITE_URL', 'http://www.yourdomain.com/auction.html');


Then within functions.inc.php:
Code: Select all
$url = getenv('AUCTION_SITE_URL');


I could just hard code $url but wanted to keep if flexible.

Thanks,
J.
JGerrity
 
Posts: 16
Joined: Fri Mar 02, 2012 4:43 pm

Re: Change default $URL in functions.inc.php

Postby shannah » Fri Mar 16, 2012 3:27 pm

I'm not sure I fully understand the situation. Is the current outbid URL actually incorrect? or is it just ugly?
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: Change default $URL in functions.inc.php

Postby JGerrity » Sat Mar 17, 2012 7:54 am

Hello,

The current outbid email uses the $URL variable that translates to index.php and the product view. The URL I would like to send out is something different and not anything to do with the auction or index. Instead of hard coding it I was going to make it a variable such as http://www.xyz.com/auction.html

Was thinking of putting that variable into a conf file , but easiest would be to just hardcore the URL in the email response within functions.inc.php

This is because my auction is within a <iframe> tag of a web page so I want users to go to that and not index.php

Cheers,
J
JGerrity
 
Posts: 16
Joined: Fri Mar 02, 2012 4:43 pm

Re: Change default $URL in functions.inc.php

Postby shannah » Sat Mar 17, 2012 9:01 am

So the link will just go to a generic page that won't contain any information about the product that they've been outbid on?
You could either hard-code this or specify it in the conf.ini file somewhere. You can always obtain values from the conf.ini file with:
Code: Select all
$app = Dataface_Application::getInstance();
$myvalue = $app->_conf['myconfigitem'];

This would retrieve the myconfigitem value from the conf.ini file
Code: Select all
myconfigitem="A value for my config item"


Or you could create your own section in the conf.ini file:
Code: Select all
[mysection]
    myconfigitem="my value"

Then you would retrieve it with
Code: Select all
$app->_conf['mysection']['myconfigitem']


-Steve
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: Change default $URL in functions.inc.php

Postby JGerrity » Sat Mar 17, 2012 12:36 pm

Perfect!

Thanks again Steve for your timely support!

BTW, yes I realize in's counter-intuitive to point them to a generic page that doesn't contain information about the particular item. I've actually set the auction up to only have one item to bid on per week so they will always go back to the main (public template) site (which again is an HTML file with the auction contained within an <iframe> within.

Also, I haven't tested this but is it possible to setup items to not appear or be hidden once the auction is closed? I don't want to delete them (but could if needed). Instead keep the items for historical reference but only show the new item with the current open and close dates.

Cheers,
J
JGerrity
 
Posts: 16
Joined: Fri Mar 02, 2012 4:43 pm


Return to Web Auction Discussion

Who is online

Users browsing this forum: No registered users and 1 guest

cron
Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved