Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

something is strange, tep_href_link does not work


AndreD

Recommended Posts

Posted

I installed newsletter_products contribution.

 

how is it possible, that this

define('TEXT_UNSUBSCRIBE', 'You are receiving this notice because you have subscribed to our newsletter. To unsubscribe, follow this: '. tep_href_link(HTTP_CATALOG_SERVER) .' link.');

 

results in this string, instead of link, (when previewing newsletter) :

You are receiving this notice because you have subscribed to our newsletter. To unsubscribe, follow this: http://www.mydomain.no/admin/http://www.mydomain.no link.

 

, and where did it got "admin" from ? - and why is there no link, only text ?

 

my admin/configure.php says: define('HTTP_CATALOG_SERVER', 'http://www.mydomain.no');

 

(of course, I anonymized the site in this example)

Posted
I installed newsletter_products contribution.

 

how is it possible, that this

define('TEXT_UNSUBSCRIBE', 'You are receiving this notice because you have subscribed to our newsletter. To unsubscribe, follow this: '. tep_href_link(HTTP_CATALOG_SERVER) .' link.');

 

results in this string, instead of link, (when previewing newsletter) :

, and where did it got "admin" from ? - and why is there no link, only text ?

 

my admin/configure.php says: define('HTTP_CATALOG_SERVER', 'http://www.mydomain.no');

 

(of course, I anonymized the site in this example)

 

Well i don't know the contribution, but the following may help ..

define('TEXT_UNSUBSCRIBE', 'You are receiving this notice because you have subscribed to our newsletter.
To unsubscribe, follow this: <a href="'. tep_href_link(HTTP_CATALOG_SERVER . DIR_WS_CATALOG . FILENAME_DEFAULT, 'command=unsubscribe') . '" title="unsubscribe me">Unsubscribe</a>');

 

Please note that the above ASSUMES that it goes to catalog/index.php and it ASSUMES WRONGLY that it should have a querystring of ?command=unsubscribe

Posted
Thank you.

Something is fishy...

 

the link generated by the code sends me to

 

http://www.domain.no/admin/http://www.doma...and=unsubscribe

 

I don't understand where the "admin" comes from.

 

your catalog/admin/includes/configure.php is wrong then, it should look like ..

 

  define('HTTP_SERVER', 'http://www.mydomain.no'); // eg, http://localhost or - https://localhost should not be NULL for productive servers
 define('HTTP_CATALOG_SERVER', 'http://www.mydomain.no');
 define('HTTPS_CATALOG_SERVER', 'https://www.mydomain.no');
 define('ENABLE_SSL_CATALOG', 'true'); // secure webserver for catalog module
 define('DIR_FS_DOCUMENT_ROOT', '/<my-full-server-path>/public_html/'); // where your pages are located on the server.
 define('DIR_WS_ADMIN', '/admin/');
 define('DIR_FS_ADMIN', '/<my-full-server-path>/public_html/admin/');
 define('DIR_WS_CATALOG', '/');
 define('DIR_FS_CATALOG', '/<my-full-server-path>/public_html/');

 

And btw you should not have a folder called admin it is very insecure, rename it.

Posted
your catalog/admin/includes/configure.php is wrong then, it should look like ..

 

.....

And btw you should not have a folder called admin it is very insecure, rename it.

 

my *does* look like that, only difference was that my DIR_FS_DOCUMENT_ROOT did not end with an "/"

 

any other ideas ?

 

will rename admin soon, must have stuff to work 100% before making new change.

 

thanks/Regards

André

Posted
any other ideas ?

 

i just looked at the admin version of tep_href_link(). it starts by assigning the return value to HTTP_SERVER . DIR_WS_ADMIN and then adds the parameter that you're passing to the function. the result is exactly what you're seeing: http://www.mydomain.no/admin/http://www.mydomain.no

 

you probably don't want to use the function. i think i'd just build the link by hand as in:

define('TEXT_UNSUBSCRIBE', 'You are receiving this notice because you have subscribed to our newsletter. To unsubscribe, follow this: <a href="'. HTTP_CATALOG_SERVER . '">link.</a>');

 

i hope this helps.

Posted
i just looked at the admin version of tep_href_link(). it starts by assigning the return value to HTTP_SERVER . DIR_WS_ADMIN and then adds the parameter that you're passing to the function. the result is exactly what you're seeing: http://www.mydomain.no/admin/http://www.mydomain.no

 

you probably don't want to use the function. i think i'd just build the link by hand as in:

define('TEXT_UNSUBSCRIBE', 'You are receiving this notice because you have subscribed to our newsletter. To unsubscribe, follow this: <a href="'. HTTP_CATALOG_SERVER . '">link.</a>');

 

i hope this helps.

 

You should never hard code links in oscommerce, very bad practise.

 

I don't know why I missed the obvious before (must have been half asleep).

 

But the link is

 

define('TEXT_UNSUBSCRIBE', 'You are receiving this notice because you have subscribed to our newsletter.

To unsubscribe, follow this: <a href="'. tep_catalog_href_link(FILENAME_DEFAULT, 'MyParams=xxx') . '">link.</a>');

Posted
...

 

define('TEXT_UNSUBSCRIBE', 'You are receiving this notice because you have subscribed to our newsletter.

To unsubscribe, follow this: <a href="'. tep_catalog_href_link(FILENAME_DEFAULT, 'MyParams=xxx') . '">link.</a>');

 

Thank you, now the link is generated like it should be.

Posted
You should never hard code links in oscommerce, very bad practise.

 

agreed. generally i wouldn't recommend that but since this was in the admin code i figured breaking the rules wasn't going to be that bad.

 

for whatever reason i assumed that he wanted to go back to his main catalog/index.php - not back to the admin/index.php (i guess i was half asleep too...) and to do that would require getting rid of the admin/ part of the url. but i like your solution better, since it's doing what he wanted in the first place. :blush:

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...