Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

tep_href_link question


PupStar

Recommended Posts

Posted

Hi Guys,

 

I am having another blonde moment :'(

 

I am using this code

 

tep_draw_button(HEADER_TITLE_LOGIN, 'person', '<a href="#" data-reveal-id="myModal">Sign In</a>') . '  ' .

 

However my mind block is causing me this headache

 

headerokp.jpg

 

Any help would be appreciated.

 

Thanks

 

Mark

Posted

is it the use of " double quotes instead of single ' ?

 

thought of that already but it just crashes the site completely :-"

Posted

thought of that already but it just crashes the site completely :-"

single quotes but escaped?

\'

instead of "

Posted

single quotes but escaped?

\'

instead of "

 

that fixes the display issue but breaks the link.

 

Thanks

 

Mark

Posted

that fixes the display issue but breaks the link.

 

Thanks

 

Mark

This is what I have in mine http://www.electricalcity.co.uk , I also have a mind blank at mo - but I am sure this could be adapted for yours

 

<?php if (!tep_session_is_registered('customer_id'))
{ 
?>
  <a title="Login" href="<?php echo tep_href_link(FILENAME_LOGIN); ?>" class="topmenu_link"><?php echo TEXT_LOGIN ?></a>
<?php
} else {
?>
  <a title="Logoff" href="<?php echo tep_href_link(FILENAME_LOGOFF, '', 'SSL'); ?>" class="topmenu_link"><?php echo TEXT_LOGOFF ?></a>
<?php
}
?>

Posted

This is what I have in mine http://www.electricalcity.co.uk , I also have a mind blank at mo - but I am sure this could be adapted for yours

 

<?php if (!tep_session_is_registered('customer_id'))
{ 
?>
  <a title="Login" href="<?php echo tep_href_link(FILENAME_LOGIN); ?>" class="topmenu_link"><?php echo TEXT_LOGIN ?></a>
<?php
} else {
?>
  <a title="Logoff" href="<?php echo tep_href_link(FILENAME_LOGOFF, '', 'SSL'); ?>" class="topmenu_link"><?php echo TEXT_LOGOFF ?></a>
<?php
}
?>

 

Paul,

 

I am trying to do it my way so I can still use tep_draw_button which will keep all my header links the same.

 

I had a quick look at your site and noticed that when you click the 'Log In' button the page changes to the login page and then the login popup appears. The way I am doing it is with this jquery modal Reveal

 

Maybe something will jump into my mind whilst out for a chinese tonight :thumbsup:

 

Mark

Posted

ok so this is where I am upto now.

 

tep_draw_button(HEADER_TITLE_LOGIN, 'person', '<a href="' . tep_href_link(FILENAME_LOGIN, '#', 'SSL') . '" data-reveal-id="myModal">') . 'Sign In Now</a>  ' .

 

The link works perfectly but does not display correctly.

 

One nut well and truely done in :blink:

 

Mark

Posted

Sorry guys but if you can help then please do as I could really do with getting this sorted tonight.

 

Thanks

 

Mark :thumbsup:

 

ok so this is where I am upto now.

 

tep_draw_button(HEADER_TITLE_LOGIN, 'person', '<a href="' . tep_href_link(FILENAME_LOGIN, '#', 'SSL') . '" data-reveal-id="myModal">') . 'Sign In Now</a>  ' .

 

The link works perfectly but does not display correctly.

 

One nut well and truely done in :blink:

 

Mark

  • 2 weeks later...
Posted

If you PM me the URL I'll take a peek.

 

If this is being developed on your localhost I guess you're on your own.

:blush:

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Posted

ok so this is where I am upto now.

 

tep_draw_button(HEADER_TITLE_LOGIN, 'person', '<a href="' . tep_href_link(FILENAME_LOGIN, '#', 'SSL') . '" data-reveal-id="myModal">') . 'Sign In Now</a>  ' .

 

The link works perfectly but does not display correctly.

 

One nut well and truely done in :blink:

 

Mark

Try this in place of the code you posted:

 

tep_draw_button(HEADER_TITLE_LOGIN, 'person', tep_href_link(FILENAME_LOGIN, '#', 'SSL')) .

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Posted

Try this in place of the code you posted:

 

tep_draw_button(HEADER_TITLE_LOGIN, 'person', tep_href_link(FILENAME_LOGIN, '#', 'SSL')) .

 

that works fine. I do however need the

 

data-reveal-id="myModal"

 

for the login modal to work.

 

Mark

Posted

I was afraid of that.

 

The fact is there is no place in the current code base to supply those parameters.

:'(

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Posted

I was afraid of that.

 

The fact is there is no place in the current code base to supply those parameters.

:'(

 

so maybe its time to write a new function then. Will have a go at that tonight after tea and bath.

 

Cheers anyway mate :thumbsup:

Posted

Copy the code for the function tep_draw_button() in the file /includes/functions/html_output.php and create another function called tep_draw_button2()

 

Then in the new function change this line:

 

      $button .= '<a id="tdb' . $button_counter . '" href="' . $link . '"';

To:

 

      $button .= '<a data-reveal-id="myModal" id="tdb' . $button_counter . '" href="' . $link . '"';

Then change the code in the header to use tep_draw_button2() for the login button only.

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Posted

Copy the code for the function tep_draw_button() in the file /includes/functions/html_output.php and create another function called tep_draw_button2()

 

Then in the new function change this line:

 

      $button .= '<a id="tdb' . $button_counter . '" href="' . $link . '"';

To:

 

      $button .= '<a data-reveal-id="myModal" id="tdb' . $button_counter . '" href="' . $link . '"';

Then change the code in the header to use tep_draw_button2() for the login button only.

 

Jim, that works well apart from screwing with the ui-icons.

 

Take a look at the link I pm'd you the other day.

 

Mark

Posted

I have your source code you sent me.

 

I'll play around with the code on my WAMP server and see if I can get it to work.

 

I've doodled with the code in Firefox so I know what will work.

 

It's just a question of getting the output correct.

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Posted

I have your source code you sent me.

 

I'll play around with the code on my WAMP server and see if I can get it to work.

 

I've doodled with the code in Firefox so I know what will work.

 

It's just a question of getting the output correct.

 

Cheers Jim, I must sign off now and get some sleep as I have an early start and a late finish tomorrow urgh.

 

Thanks for all your efforts, it truely is appreciated.

 

Mark

Posted

In the new function tep_draw_button2() remove this line of code:

 

    static $button_counter = 1;

That made the code look like it will work when I tested it on my WAMP server.

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Posted

And be sure the new function is after the original one in the code.

If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Posted

In the new function tep_draw_button2() remove this line of code:

 

    static $button_counter = 1;

That made the code look like it will work when I tested it on my WAMP server.

 

Jim,

 

That was spot on! :thumbsup:

 

Many Thanks :D

 

Mark

Archived

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

×
×
  • Create New...