osCmax v2.5 User Manual
Results 1 to 4 of 4

bookmark code

This is a discussion on bookmark code within the osCommerce 2.2 Modification Help forums, part of the osCommerce 2.2 Forums category; Hi, This is the bookmark code to place a box in the store that people can bookmark your site with. ...

      
  1. #1
    Active Member
    Join Date
    Oct 2002
    Location
    Arkansas
    Posts
    149
    Rep Power
    0


    Default bookmark code

    Hi,

    This is the bookmark code to place a box in the store that people can bookmark your site with.

    <!-- Add Favorites //-->
    <?php
    if (strstr ($HTTP_USER_AGENT, "MSIE")) {
    $self = "http://".$HTTP_HOST.$REQUEST_URI;
    ?>

    <?php
    /*$info_box_contents = array();
    $info_box_contents[] = array('align' => 'left',
    'text' => BOX_INFORMATION_BOOKMARK
    );
    new infoBoxHeading($info_box_contents, false, false);

    $rows = 0;
    $info_box_contents = array();*/

    if ($HTTP_GET_VARS['products_id']) {
    $product_box_info = tep_db_query("select p.products_id, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . $HTTP_GET_VARS['products_id'] . "' and pd.products_id = '" . $HTTP_GET_VARS['products_id'] . "' and pd.language_id = '" . $languages_id . "'");
    $product_box_info_values = tep_db_fetch_array($product_box_info);
    $text = "<a href=\"javascript:window.external.AddFavorite('$se lf','$HTTP_HOST Online Shop - " . str_replace("'", "\'", $product_box_info_values["products_name"])."')\">Bookmark ".$product_box_info_values['products_name']."</a>";
    }
    else {
    $text = "<a href=\"javascript:window.external.AddFavorite('$se lf','$HTTP_HOST Online Shop')\">Bookmark Us</a>";
    }

    $info_box_contents[] = array('align' => 'center',
    'text' => $text);

    new infoBox($info_box_contents);
    ?>

    I have removed the <tr> and <td> tags and also commented out the first lines at the top to remove the header of the box.

    How can I get this code completely out of the box and turn the text link into a graphic link?

    I have tried commenting out this code various ways but it just removes the whole box section:

    $info_box_contents[] = array('align' => 'center',
    'text' => $text);

    new infoBox($info_box_contents);

    Any help would be appreciated.

    Thanks!
    Sincerely,
    Melinda

    www.designhosting.biz

  2. #2
    Member
    Join Date
    Nov 2002
    Location
    Pennsylvania
    Posts
    93
    Rep Power
    0


    Default

    do you need the Bookmark in a box?

    Here is the code for a simple bookmark script.

    Put this in the <head>

    Code:
    <script language="JavaScript">
    <!-- Begin
    function bookmark() {
    	bookmarkurl="http://www.yoursite.com"
    	bookmarktitle="WebPage Title"
    	if (document.all) 	window.external.AddFavorite(bookmarkurl,bookmarktitle)
    }
    //  End -->
    </script>
    put this in the <body>
    Code:
    <a href="javascript:bookmark()"><img src="your_bookmark_image.gif" alt="bookmark our site"></a>
    Mike

  3. #3
    Active Member
    Join Date
    Oct 2002
    Location
    Arkansas
    Posts
    149
    Rep Power
    0


    Default

    Thank you so much!

    I tried it and it is working in the header.php. I put head tags above the copyright notice like this:
    <head>
    <script language="JavaScript">
    <!-- Begin
    function bookmark() {
    bookmarkurl="http://www.mdesigns.biz"
    bookmarktitle="WebPage Title"
    if (document.all) window.external.AddFavorite(bookmarkurl,bookmarkti tle)
    }
    // End -->
    </script>
    </head>
    <?php
    /*
    $Id: header.php,v 1.36 2002/08/15 17:29:47 dgw_ Exp $

    osCommerce, Open Source E-Commerce Solutions
    http://www.oscommerce.com

    Copyright (c) 2001 osCommerce

    Released under the GNU General Public License
    */

    I hope this is the way you do it.
    Sincerely,
    Melinda

    www.designhosting.biz

  4. #4
    Member
    Join Date
    Nov 2002
    Location
    Pennsylvania
    Posts
    93
    Rep Power
    0


    Default

    Melinda

    In this example I am using default.php
    don't put this in the header.php

    This is a javascript and 9 times out of 10 you put your javascript functions in the head or your html document.

    Code:
    <html <?php echo HTML_PARAMS; ?>>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>"> 
    <title><?php echo TITLE; ?></title>
    <base href="<?php echo (getenv('HTTPS') == 'on' ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
    <link rel="stylesheet" type="text/css" href="stylesheet.css">
    
    <script language="JavaScript"> 
    <!-- Begin 
    function bookmark() { 
    bookmarkurl="http://www.mdesigns.biz" 
    bookmarktitle="WebPage Title" 
    if (document.all) window.external.AddFavorite(bookmarkurl,bookmarktitle) 
    } 
    // End --> 
    </script>
    
    </head>

Similar Threads

  1. Code Card Verification???
    By jasonabc in forum osCommerce 2.2 Installation Help
    Replies: 4
    Last Post: 11-24-2004, 11:52 AM
  2. Where to get colour code
    By tyz6970 in forum osCommerce 2.2 Modification Help
    Replies: 4
    Last Post: 08-02-2004, 08:46 AM
  3. Adding Mod by hand. Where does this bit of code go?
    By nfmg in forum osCMax v1.7 General Mods Discussion
    Replies: 1
    Last Post: 06-29-2004, 06:20 PM

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
  •