NodsDorf Posted October 6, 2009 Posted October 6, 2009 I'm having a hard time trying to figure out why the website I'm working on drops the session when you click any none standard link. The website is rubberstore.com/catalog If I log in and use any of the standard OSC navigation like what is generated in the categories box, or the "new products for the %Smonth" I can stay logged in. But if i use any of my STS links the session is lost and I am logged out. I'd appreciate any help, if you would like to test this you can use the User Name: [email protected] pass: open4me Any help would be appreciated, Thank you, Don
multimixer Posted October 7, 2009 Posted October 7, 2009 I'm having a hard time trying to figure out why the website I'm working on drops the session when you click any none standard link. The website is rubberstore.com/catalog If I log in and use any of the standard OSC navigation like what is generated in the categories box, or the "new products for the %Smonth" I can stay logged in. But if i use any of my STS links the session is lost and I am logged out. I'd appreciate any help, if you would like to test this you can use the User Name: [email protected] pass: open4me Any help would be appreciated, Thank you, Don How do you create your sts links? post an example of such a link My community profile | Template system for osCommerce - New: Responsive | Feedback channel
Guest Posted October 7, 2009 Posted October 7, 2009 if you create a link go to this file includes/modules/sts_inc/general.php then create a sample link at anywhere on that file and code will look like $sts->template['link_name'] = tep_href_link('link_file_name.php'); then if you're going to use the link to any part of the website you have to use this code echo $link_name;
multimixer Posted October 7, 2009 Posted October 7, 2009 You have 2 ways to create links 1) you go to sts_inc/sts_user_code.php (or general.php as posted above) and create a tag as follows: $template_content['link1'] = '<a href=' . tep_href_link(FILENAME_SPECIALS) .' class="linSt1">' . LINK_SPECIALS . '</a>'; After this you can use $link1 wherever you want in your template. 2) You insert into your template directly <a href="<?php echo tep_href_link(FILENAME_SPECIALS); ?>" class="linSt1"><?php echo(LINK_SPECIALS); ?></a><br> In that way you will not loose the sessionID. There is an article in the tips and tricks section about this You need of course to define the text for LINK_SPECIALS in all the language files you use. If you have just one language, you can replace LINK_SPECIALS with the text you want to have displayed ie hot offers or whatever My community profile | Template system for osCommerce - New: Responsive | Feedback channel
NodsDorf Posted October 7, 2009 Author Posted October 7, 2009 You have 2 ways to create links 1) you go to sts_inc/sts_user_code.php (or general.php as posted above) and create a tag as follows: $template_content['link1'] = '<a href=' . tep_href_link(FILENAME_SPECIALS) .' class="linSt1">' . LINK_SPECIALS . '</a>'; After this you can use $link1 wherever you want in your template. 2) You insert into your template directly <a href="<?php echo tep_href_link(FILENAME_SPECIALS); ?>" class="linSt1"><?php echo(LINK_SPECIALS); ?></a><br> In that way you will not loose the sessionID. There is an article in the tips and tricks section about this You need of course to define the text for LINK_SPECIALS in all the language files you use. If you have just one language, you can replace LINK_SPECIALS with the text you want to have displayed ie hot offers or whatever Thank you guys, the way I've been doing the links is a simple <a href="catalog/location.php" text here</a> As you can see the site uses alot of STS links didn't know this tip. I'll get these updated today. Many thanks to both of you!
multimixer Posted October 7, 2009 Posted October 7, 2009 ooops $template_content you use if you are creating tags for a content template. If you are in top level templates, then you use $sts->template instead My community profile | Template system for osCommerce - New: Responsive | Feedback channel
NodsDorf Posted October 7, 2009 Author Posted October 7, 2009 Okay I've been using the OSC call method to get the links to work. <a href="<?php echo tep_href_link(FILENAME_DEFAULT);?> This has solved some of my problems. However, my next obstacle is how to use STS with categories. Since the categories don't have a filename it doesn't work the same. I suppose using the methods above I could create links, but it seems easier to use the OSC standard way to refer to categories since I may call a category "DVDs" in one place but want to refer to it as lets say "Cheap DVD's" in another or maybe have an clickable image, purpose being for search engine keywords. I'm very amature when it comes to php coding. Is there a way to refer to a category by its cPath name, but use text or an image to link to it? Just like with the example above I can use the <a href="<?php echo tep_href_link(FILENAME_DEFAULT);?> on an button or on text that I can change easily.
multimixer Posted October 7, 2009 Posted October 7, 2009 Maybe this here will work? <a href="<?php echo tep_href_link('index.php', 'cPath=21&', 'NONSSL'); ?>">Category Name Here</a> And for images this here? <a href="<?php echo tep_href_link('index.php', 'cPath=21&', 'NONSSL'); ?>"><img border="0" src="images/Your_Image.gif"> </a> Nothing comes from me, it's all in the sts forum somewhere My community profile | Template system for osCommerce - New: Responsive | Feedback channel
NodsDorf Posted October 7, 2009 Author Posted October 7, 2009 Maybe this here will work? <a href="<?php echo tep_href_link('index.php', 'cPath=21&', 'NONSSL'); ?>">Category Name Here</a> And for images this here? <a href="<?php echo tep_href_link('index.php', 'cPath=21&', 'NONSSL'); ?>"><img border="0" src="images/Your_Image.gif"> </a> Nothing comes from me, it's all in the sts forum somewhere That is exactly what I needed. Many, Many, Thanks!
Recommended Posts
Archived
This topic is now archived and is closed to further replies.