Results 1 to 3 of 3

Thread: Addon img sold

  1. #1
    Join Date
    Feb 2009
    Posts
    6

    Default Addon img sold

    I've installed the addon imgsold 1.6 and everything is working fine, except when i replace template tag {image_thumb_1} in search_result_default.html with {addon_imgsold_thumb}, the table doesn't close anymore. I'm not an php-expert but i found that the link to the listing_detail page isn't closed (no </a>)

    here's the text from addon.inc.php where i think the error is:

    // Listing Images
    $sql2 = "SELECT listingsdb_title FROM " . $config['table_prefix'] . "listingsdb WHERE listingsdb_id = $listingID";
    $recordSet2 = $conn->Execute($sql2);
    if (!$recordSet2) {
    $misc->log_error($sql2);
    }
    $Title = $misc->make_db_unsafe ($recordSet2->fields['listingsdb_title']);
    if ($config['url_style'] == '1') {
    $fullurl = '<a href="' . $config["baseurl"] . '/index.php?action=listingview&amp;listingID=' . $listingID . '">';
    } else {
    $url_title = str_replace("-", "", $Title);
    $url_title = str_replace("/", "", $url_title);
    $fullurl = '<a href="' . $config["baseurl"] . '/listing-' . urlencode($url_title) . '-' . $listingID . '.html">';
    }


    $sql = "SELECT listingsimages_id, listingsimages_thumb_file_name FROM " . $config['table_prefix'] . "listingsimages WHERE listingsdb_id = $listingID ORDER BY listingsimages_rank";
    $recordSet = $conn->Execute($sql);
    if (!$recordSet) {
    $misc->log_error($sql);
    }

    $num_images = $recordSet->RecordCount();
    if ($num_images == 0) {
    if ($config['show_no_photo'] == 1) {
    $listing_image = $fullurl.'<img src="' . $config["baseurl"] . '/images/nophoto.gif" alt="' . $lang['no_photo'] . '" /></a>';
    } else {
    $listing_image = '';
    }
    }
    else {
    $thumbPath = getImageUrl($listingID, $recordSet->fields['listingsimages_thumb_file_name']);
    list($displaywidth, $displayheight, $type, $attr) = getimagesize($thumbPath);
    $listing_image = $fullurl.'<img src="' . getImageUrl($listingID, $recordSet->fields['listingsimages_thumb_file_name']). '" alt="' . $caption . '\" ';
    if ($displayheight != 0 && $displaywidth != 0) {
    $listing_image .= " height=\"$displayheight\" width=\"$displaywidth\" ";
    }
    $listing_image .= '" />';
    }
    return $listing_image;
    }

    and this is how the source looks like:

    <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="listing_result_box" >
    <tr>
    <td align="center">
    <table width="98%" border="0" align="center" cellpadding="4" cellspacing="0" class="listing_result_content">
    <tr>
    <td align="left" valign="top" style="width: 125px;"><a href="http://www.mysite.nl/bedrijfsmakelaar/listing-Woonhuis+huur+Dorpsstraat+Enter-2.html"><img src="http://www.mysite.nl/bedrijfsmakelaar/images/listing_photos/thumb_2_voorbeeld_verhuurd.jpg" alt="\" height="68" width="100" " /></td>
    <td align="left" valign="top">
    <strong><a href="listing-woonhuis-huur-dorpsstraat-enter-2.html">Woonhuis huur Dorpsstraat Enter</a></strong><br /><br />
    Dorpsstraat 100<br />
    Enter, Overijssel 7468AA<br /><br />
    Op goede locatie aan doorgaande weg bieden wij u een winkelruimte met bovenwoning aan... <a href="listing-woonhuis-huur-dorpsstraat-enter-2.html">Meer Info</a></td>..

    Thanx

  2. #2
    Join Date
    Feb 2009
    Posts
    6

    Default Re: Addon img sold

    I've found the problem, marked it red. Line 654 - 664 addon.inc.php

    else {
    $thumbPath = getImageUrl($listingID, $recordSet->fields['listingsimages_thumb_file_name']);
    list($displaywidth, $displayheight, $type, $attr) = getimagesize($thumbPath);
    $listing_image = $fullurl.'<img src="' . getImageUrl($listingID, $recordSet->fields['listingsimages_thumb_file_name']). '" alt="' . $caption . '\" ';
    if ($displayheight != 0 && $displaywidth != 0) {
    $listing_image .= " height=\"$displayheight\" width=\"$displaywidth\" ";
    }
    $listing_image .= '" />';
    }
    return $listing_image;
    }

  3. #3
    Join Date
    Mar 2004
    Posts
    17

    Default Re: Addon img sold

    Hi thanks for the heads up.

    I have also found something which may help people who use the hyphen - in seo friendly pages that use this addon. ( I am using V.2.5.5)

    If you are using the {addon_imgsold_thumb} tag in search results and use the - hyphen for SEO friendly titles and urls.
    I found it changes the hyphens to a + sign and thus your links don't work.

    About line 636 in addon.inc.php needs this extra line of code adding: -
    $url_title = strtolower(str_replace(" ", $config['seo_url_seperator'], $url_title));

    example: -

    $url_title = str_replace("-", "", $Title);
    $url_title = str_replace("/", "", $url_title);
    $url_title = strtolower(str_replace(" ", $config['seo_url_seperator'], $url_title));
    $fullurl = '<a href="' . $config["baseurl"] . '/listing-' . urlencode($url_title) . '-' . $listingID . '.html">';

Similar Threads

  1. Sold Stamp Addon
    By TheBazaMan in forum Addon help, ideas and discussion (CLOSED)
    Replies: 8
    Last Post: 10-21-2008, 03:16 AM
  2. Sold Addon - not displaying in IE
    By meadwench in forum Addon help, ideas and discussion (CLOSED)
    Replies: 2
    Last Post: 01-16-2008, 07:20 PM
  3. Addon SOLD properties / objects page available?
    By polderweb in forum Addon help, ideas and discussion (CLOSED)
    Replies: 0
    Last Post: 09-15-2007, 07:03 AM
  4. Sold to Sold page
    By beechmontboy in forum General Help (CLOSED)
    Replies: 0
    Last Post: 07-19-2007, 11:00 AM
  5. Sold Mod
    By TGA13 in forum Mods (CLOSED)
    Replies: 10
    Last Post: 06-24-2005, 12:19 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
  •