Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Embed Links with SID in Description


stevel

Recommended Posts

Firstly great contrib - just what I was looking for.

 

I've installed the contrib and all is working, there is one small bug however which doesn't stop the site working but is annoying none the less.

 

Basically the URL in the address bar comes out strange when you click the links in the product descriptions, they carry the session ID but they look odd, best described in an example.

 

A link I would expect to look like this:

 

http://www.fasteronline.co.uk/Thule-thule-...2686edefa1fb0c7

 

In fact comes out like this:

 

http://www.fasteronline.co.uk/admin/http:/...2686edefa1fb0c7

 

Adding http://www.fasteronline.co.uk/admin/ to the beginning.

 

You can see the link toward the bottom of this page

 

I am adding the link as instructed in the contrib, clicking insert link in the WYSIWYG editor (my client needs to use this) and in this case adding the link below:

 

%%+Thule-thule-5451-roof-mount-single-wheel-carrier-p-2187.html%%-

 

I'm guessing that there is some hard coded URL somewhere on the site that is causing this.

 

Basically I inherited this site and when I checked I found loads of hard coded links and and other bugs (most of which are now fixed).

 

Does anyone know what might bit of code might be causing this and where I might find it?

 

Thanks

 

Paul

Edited by pauladkins
Link to comment
Share on other sites

  • 7 months later...
  • Replies 80
  • Created
  • Last Reply

Top Posters In This Topic

How would I set this up for the PageEditor program.

 

Here is the code for their pages:

 

<?php
 require('includes/application_top.php');

 $pages_name = $HTTP_GET_VARS["page"];
 $page_query = tep_db_query("select pd.pages_title, pd.pages_body, p.pages_id, p.pages_name, p.pages_image, p.pages_status, p.sort_order from " . TABLE_PAGES . " p, " . TABLE_PAGES_DESCRIPTION . " pd where p.pages_name = '" . $pages_name . "' and p.pages_id = pd.pages_id and pd.language_id = '" . (int)$languages_id . "'");
 $page = tep_db_fetch_array($page_query);
 define('NAVBAR_TITLE', $page['pages_title']);
 define('HEADING_TITLE', $page['pages_title']);
 define('TEXT_INFORMATION', nl2br($page['pages_body']));
 define('PAGES_IMAGE', $page["pages_image"]);  
 $breadcrumb->add(NAVBAR_TITLE, tep_href_link('pages.php?page='.$pages_name, '', 'NONSSL'));
?>


<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<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">
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<?php print($test); ?>
<table border="0" width="100%" cellspacing="3" cellpadding="3">
 <tr>
   <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
<!-- left_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
<!-- left_navigation_eof //-->
   </table></td>
<!-- body_text //-->
   <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
     <tr>
       <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
         <tr>
           <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
		<td class="pageHeading" align="right"><?php echo PAGES_IMAGE ? tep_image(DIR_WS_IMAGES . PAGES_IMAGE, HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT) : tep_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
           </tr>
       </table></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
     <tr>
       <td class="main"><?php echo TEXT_INFORMATION; ?></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
     <tr>
       <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
         <tr class="infoBoxContents">
           <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
             <tr>
               <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
               <td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td>
               <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
             </tr>
           </table></td>
         </tr>
       </table></td>
     </tr>
   </table></td>

<!-- body_text_eof //-->
   <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
<!-- right_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>
<!-- right_navigation_eof //-->
   </table></td>
 </tr>
</table>
<!-- body_eof //-->

<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
<br>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

 

I don't see any where with the stripslashes

 

Thanks

 

Michael

Link to comment
Share on other sites

  • 2 weeks later...

My subscription to this topic expired and I did not see these new posts.

 

Paul,

 

The contrib uses tep_href_link to construct the URL. If you are calling the embedded_href_replace function from somewhere in admin, then you'd get that behavior. It should not show up on the catalog pages. If it does, something is wrong with your site configuration..

 

Michael,

 

I don't think an editor is the right place to use this contrib.

Link to comment
Share on other sites

My subscription to this topic expired and I did not see these new posts.

 

Paul,

 

The contrib uses tep_href_link to construct the URL. If you are calling the embedded_href_replace function from somewhere in admin, then you'd get that behavior. It should not show up on the catalog pages. If it does, something is wrong with your site configuration..

 

Michael,

 

I don't think an editor is the right place to use this contrib.

 

Steve,

 

Thanks for the reply..... I don't understand...PageEditor is in essence the same concept as something like InfoPages Unlimited except I cannot find any stripslashes.

 

I've used InfoPages Unlimited and I like it (and it works great with Embed Links) but I also use navigation tabs (Custom Nav Bar) and I cannot figure out how to call an InfoPage from one of the tabs. It ends up looking like this: information.php?info_id=2?osCsid=blablabla. I can't figure out how to get the second ? to turn into a &. But anyway. No way to integrate Embed Links into PageEditor?

Link to comment
Share on other sites

Ok, I looked at the code you showed again. This code does not use stripslashes but it does have this:

 

define('TEXT_INFORMATION', nl2br($page['pages_body']));

 

You would use embedded_href_replace around the nl2br call.

 

I don't see any reference to tabs in the code so can't advise you there.

 

Basically, any place where text is retrieved from the database and echoed to the browser, you can use embedded_href_replace to transform the text.

Link to comment
Share on other sites

  • 7 years later...

After installing this on 2.3 I had problems with this contribution outputting special characters instead of html (i.e. <a instead of <a)

 

 The solution was to change 

<p><?php echo embedded_href_replace($product_info['products_description']); ?></p>

to

<p><?php echo htmlspecialchars_decode(embedded_href_replace($product_info['products_description'])); ?></p>

Which has worked fine so far.

osCommerce user since 2003! :thumbsup:

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...