Results 1 to 6 of 6
  1. #1

    application error Sidebox Code Problem

    I am trying to add a social bookmarking site to a sidebox. Here is my homepage: http://www.lasilhouettelingerie.com/store/ (Please look in the top right corner at the Social Bookmarking sidebox).

    Here is the code where I am supposed to paste my add this code into this sidebox:

    Code:
    $content = '<div id="absolutelinksContent" class="sideBoxContent centeredContent">';
    
    /* Your html and/or javascript code goes between the 2 single quotes in the next line */
    $content .= '<!-- AddThis Button BEGIN -->
    <script type="text/javascript">var addthis_pub  = "MYUSERNAMEHERE";</script>
    <a href="http://www.addthis.com/bookmark.php" onmouseover="return addthis_open(this, '', '[URL]', '[TITLE]')" onmouseout="addthis_close()" onclick="return addthis_sendto()"><img src="http://s7.addthis.com/button1-bm.gif" width="125" height="16" border="0" alt="" /></a><script type="text/javascript" src="http://s7.addthis.com/js/152/addthis_widget.js"></script>
    <!-- AddThis Button END -->';
    
    $content .= '</div>';
    
    ?>
    According the the instructions I can paste html or javascript in between the single quoate of the $content'' line which is what I did. The code has errors (the page goes blank below this sidebox when I use the code above. Is the code syntax wrong? Anyone know how I can make this work? I am guessing it has to do with the single double quotes but I don't quite understand .php language.

  2. #2

    Default Re: Sidebox Code Problem

    Any suggestions?

  3. #3
    Join Date
    Dec 2007
    Location
    Acton, California
    Posts
    458
    Plugin Contributions
    2

    Default Re: Sidebox Code Problem

    Quote Originally Posted by lasilhouette View Post
    Any suggestions?
    Code:
    $content = '<div id="absolutelinksContent" class="sideBoxContent centeredContent">';
    $content .= '<!-- AddThis Button BEGIN -->';
    $content .= '<script type="text/javascript">var addthis_pub  = "MYUSERNAMEHERE";</script>';
    $content .= '<a href="http://www.addthis.com/bookmark.php" onmouseover="return addthis_open(this, \'\', \'[url]\', \'[TITLE]\')" onmouseout="addthis_close()" onclick="return addthis_sendto()"><img src="http://s7.addthis.com/button1-bm.gif" width="125" height="16" border="0" alt="" /></a><script type="text/javascript" src="http://s7.addthis.com/js/152/addthis_widget.js"></script>';
    $content .= '<!-- AddThis Button END -->';
    $content .= '</div>';
    For what you want to show up in a sidebox should be added to $content
    As for the single quotes, just need to escape the ones within your JS code.
    Dave
    FourSaleBuyU.com (true Auction and 'Make-an-Offer' site)

  4. #4

    Default Re: Sidebox Code Problem

    Dave,

    I have added the content with the code above to the website and the button shows just fine.

    The problem that I am having now is that when I click on send an e-mail or bookmark instead of the URL showing it shows the [url]. So it will not add to favorites or display the link when you click on send an e-mail. I suspect when social bookmarking it won't show the URL as well just the value for URL.

    Is this because the single quotes are escaped? This works on all my other php sites but I didn't have to escape my single quotes code. Please visit this page: http://www.lasilhouettelingerie.com/store/ and give it a try. For some reason it is not inserting the URL for the url value.

    Here is the exact code that I used:
    Code:
    /* Your html and/or javascript code goes between the 2 single quotes in the next line */
    $content = '<div id="absolutelinksContent" class="sideBoxContent centeredContent">';
    $content .= '<!-- AddThis Button BEGIN -->';
    $content .= '<script type="text/javascript">var addthis_pub  = "lasilhouette";</script>';
    $content .= '<a href="http://www.addthis.com/bookmark.php" onmouseover="return addthis_open(this, \'\', \'[url]\', \'[TITLE]\')" onmouseout="addthis_close()" onclick="return addthis_sendto()"><img src="http://s7.addthis.com/button1-bm.gif" width="125" height="16" border="0" alt="" /></a><script type="text/javascript" src="http://s7.addthis.com/js/152/addthis_widget.js"></script>';
    $content .= '<!-- AddThis Button END -->';
    $content .= '</div>';

  5. #5

    Default Re: Sidebox Code Problem

    I got it now. It was that the [url] is case sensitive. Changed it to capital letters [URL] and now all works fine. Once again thank you very much!

  6. #6
    Join Date
    Oct 2006
    Posts
    57
    Plugin Contributions
    0

    Default Re: Sidebox Code Problem

    is this an official Zen-Cart mod. I would like to implement this on my site as well. Can i just copy your code?

    Thanks!

 

 

Similar Threads

  1. Help Center Live - Sidebox code
    By Scrat in forum All Other Contributions/Addons
    Replies: 27
    Last Post: 20 Apr 2009, 01:28 AM
  2. Want to put php code in sidebox
    By bgroup99 in forum Basic Configuration
    Replies: 0
    Last Post: 30 Nov 2007, 08:05 PM
  3. Help putting code in a blank sidebox
    By brimsjewelry in forum Addon Sideboxes
    Replies: 6
    Last Post: 26 Oct 2007, 01:45 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •