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. ...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
|
#1
| |||
| |||
| 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! |
|
#2
| |||
| |||
| 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>
Code: <a href="javascript:bookmark()"><img src="your_bookmark_image.gif" alt="bookmark our site"></a> |
|
#3
| |||
| |||
| 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. |
|
#4
| |||
| |||
| 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>
|
| Thread Tools | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Code Card Verification??? | jasonabc | osCommerce 2.2 Installation Help | 4 | 11-24-2004 12:52 PM |
| Where to get colour code | tyz6970 | osCommerce 2.2 Modification Help | 4 | 08-02-2004 08:46 AM |
| Adding Mod by hand. Where does this bit of code go? | nfmg | osCMax v1.7 General Mods Discussion | 1 | 06-29-2004 06:20 PM |