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

affiliate link encoded

This is a discussion on affiliate link encoded within the osCmax v2 Installation issues forums, part of the osCmax v2.0 Forums category; i just installed RC3 and the affiliate link generated looks like the following. the problem is the "<" and other ...

      
  1. #1
    New Member
    Join Date
    Oct 2006
    Posts
    6
    Rep Power
    0


    Default affiliate link encoded

    i just installed RC3 and the affiliate link generated looks like the following. the problem is the "<" and other html tags are encoded and when i paste those into webpages, the html source code shows up in the browser. wondering if any one know how to fix it. thanks.


    <a href="http://www.nasalcleanse.com/shop/ind...id=2" target="_blank"><i mg src="http://www.nasalcleanse.com/shop/aff...id=2" border="0" alt="NasalCare Nasal Irrigator"></a>

  2. #2
    Member
    Join Date
    Oct 2006
    Location
    Cincinnati, ohio
    Posts
    43
    Rep Power
    0


    Default Re: affiliate link encoded

    I'm finding this same problem, does anyone have any idea how to fix this? It's probably something wrong in the coding within
    templates/fallback/content/affiliate_banners.tpl.php

    Or, The html output. I just don't know and am not experienced enough to know how to fix something like this.

    I'm running RC3.
    Regards,

    Ben Wade
    www.AllWebNow.com - E-commerce Web Hosting

  3. #3
    Member
    Join Date
    Oct 2006
    Location
    Cincinnati, ohio
    Posts
    43
    Rep Power
    0


    Default Re: affiliate link encoded

    My current string of code near the textarea code to copy and paste in templates/fallback/content/affiliate_banners.tpl.php
    is:

    Starting at line 60:

    <?php
    if (tep_db_num_rows($affiliate_banners_values)) {

    while ($affiliate_banners = tep_db_fetch_array($affiliate_banners_values)) {
    $affiliate_products_query = tep_db_query("select products_name from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . $affiliate_banners['affiliate_products_id'] . "' and language_id = '" . $languages_id . "'");
    $affiliate_products = tep_db_fetch_array($affiliate_products_query);
    $prod_id = $affiliate_banners['affiliate_products_id'];
    $ban_id = $affiliate_banners['affiliate_banners_id'];
    switch (AFFILIATE_KIND_OF_BANNERS) {
    case 1: // Link to Products
    if ($prod_id > 0) {
    $link = '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . FILENAME_PRODUCT_INFO . '?ref=' . $affiliate_id . '&products_id=' . $prod_id . '&affiliate_banner_id=' . $ban_id . '" target="_blank"><img src="' . HTTP_SERVER . DIR_WS_CATALOG . DIR_WS_IMAGES . $affiliate_banners['affiliate_banners_image'] . '" border="0" alt="' . $affiliate_products['products_name'] . '"></a>';
    } else { // generic_link
    $link = '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . FILENAME_DEFAULT . '?ref=' . $affiliate_id . '&affiliate_banner_id=' . $ban_id . '" target="_blank"><img src="' . HTTP_SERVER . DIR_WS_CATALOG . DIR_WS_IMAGES . $affiliate_banners['affiliate_banners_image'] . '" border="0" alt="' . $affiliate_banners['affiliate_banners_title'] . '"></a>';
    }
    break;
    case 2: // Link to Products
    if ($prod_id > 0) {
    $link = '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . FILENAME_PRODUCT_INFO . '?ref=' . $affiliate_id . '&products_id=' . $prod_id . '&affiliate_banner_id=' . $ban_id . '" target="_blank"><img src="' . HTTP_SERVER . DIR_WS_CATALOG . FILENAME_AFFILIATE_SHOW_BANNER . '?ref=' . $affiliate_id . '&affiliate_banner_id=' . $ban_id . '" border="0" alt="' . $affiliate_products['products_name'] . '"></a>';
    } else { // generic_link
    $link = '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . FILENAME_DEFAULT . '?ref=' . $affiliate_id . '&affiliate_banner_id=' . $ban_id . '" target="_blank"><img src="' . HTTP_SERVER . DIR_WS_CATALOG . FILENAME_AFFILIATE_SHOW_BANNER . '?ref=' . $affiliate_id . '&affiliate_banner_id=' . $ban_id . '" border="0" alt="' . $affiliate_banners['affiliate_banners_title'] . '"></a>';
    }
    break;
    }
    ?>
    <tr>
    <td><table width="100%" border="0" cellspacing="0" cellpadding="2">
    <tr>
    <td class="infoBoxHeading" align="center"><?php echo TEXT_AFFILIATE_NAME . ' ' . $affiliate_banners['affiliate_banners_title']; ?></td>
    </tr>
    <tr>
    <td class="smallText" align="center"><br><?php echo $link; ?></td>
    </tr>
    <tr>
    <td class="smallText" align="center"><?php echo TEXT_AFFILIATE_INFO; ?></td>
    </tr>
    <tr>
    <td class="smallText" align="center">
    <?php

    $link = htmlspecialchars($link, ENT_QUOTES);
    echo tep_draw_textarea_field('affiliate_banner', 'soft', '60', '6', $link);
    ?>
    Last edited by allwebnow; 01-19-2007 at 07:30 AM.
    Regards,

    Ben Wade
    www.AllWebNow.com - E-commerce Web Hosting

  4. #4
    New Member
    Join Date
    Sep 2006
    Posts
    28
    Rep Power
    0


    Default Re: affiliate link encoded

    Ben's code did not, for me, address the problem of affiliate link code showing up with HTML escapes (i.e. &lt; for <).

    Perhaps a version mismatch? I'm using RC3.

    I solved it by commenting out both instances of the call to htmlspecialchars() in affiliate_banners.tpl.php. Now the affiliate link HTML appears un-escaped, so can immediately be cut-and-pasted into the affiliate's website code.

  5. #5
    Member
    Join Date
    Oct 2006
    Location
    Cincinnati, ohio
    Posts
    43
    Rep Power
    0


    Default Re: affiliate link encoded

    Quote Originally Posted by brendanl79 View Post
    Ben's code did not, for me, address the problem of affiliate link code showing up with HTML escapes (i.e. &lt; for <).

    Perhaps a version mismatch? I'm using RC3.

    I solved it by commenting out both instances of the call to htmlspecialchars() in affiliate_banners.tpl.php. Now the affiliate link HTML appears un-escaped, so can immediately be cut-and-pasted into the affiliate's website code.

    That did it:

    Change same code in 2 places around line 47 and then around line 100 from:

    <?php
    $link = htmlspecialchars($link, ENT_QUOTES);
    echo tep_draw_textarea_field('affiliate_banner', 'soft', '60', '6', $link);
    ?>

    To...

    <?php
    // $link = htmlspecialchars($link, ENT_QUOTES);
    echo tep_draw_textarea_field('affiliate_banner', 'soft', '60', '6', $link);
    ?>
    Regards,

    Ben Wade
    www.AllWebNow.com - E-commerce Web Hosting

  6. #6
    New Member
    Join Date
    Sep 2006
    Posts
    28
    Rep Power
    0


    Default Re: affiliate link encoded

    Glad to hear it Ben.

    Sorry for the confusing words at the beginning of my post. I didn't realize your first and second posts were from the same person, and I mistook the latter for a proposed solution.

Similar Threads

  1. Affiliate link to entire store not single products?
    By Lobotaman in forum osCMax v2 Features Discussion
    Replies: 2
    Last Post: 10-02-2006, 03:49 AM
  2. how do i set a link active, if the link links to actual page
    By poschiman in forum osCommerce 2.2 Modification Help
    Replies: 0
    Last Post: 06-03-2006, 04:10 PM
  3. Affiliate Build-a-link Setup
    By Hanuman71 in forum osCMax v2 Features Discussion
    Replies: 1
    Last Post: 05-20-2006, 01:11 PM
  4. Affiliate link secure non-secure
    By kwiznoz in forum osCmax v2 Installation issues
    Replies: 6
    Last Post: 08-28-2005, 01:08 PM
  5. Affiliate build-a-Link
    By mgrooten in forum osCmax v1.7 Discussion
    Replies: 0
    Last Post: 07-26-2005, 07:47 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
  •