Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: Feature Listing Does Not Show

  1. #1
    Join Date
    Jan 2005
    Posts
    51

    Question Feature Listing Does Not Show

    When someone saves a search or add's to a favorite - those features work great.

    But on the page that shows their favorites or searches we have a "Feature Listing" in our "user_top.htm;" and the link does not take it to them.

    Here is the line of code that shows the "Featured Listing":

    <?php renderFeaturedListingsVertical2(1); ?>

    Where the "Feature Listing" link works it takes you to:

    listings/listingview.php?listingID=3

    But since the Saved Searched and Favorites are in the "members" folder it gets confused and trys to find the listing in the "members" folder.

    /members/listingview.php?listingID=3 - this is page it trys to go to - we need to get out of the members folder

    How do I TELL it to JUMP out of the members folder to find the listing?

    Do I tell it where the base is or something - if so how do you do it?

    Again - this feature works every where except when we are on in page in the
    /members folder.

    So how do I get this code to work and not look for it in the members folder:

    <?php renderFeaturedListingsVertical2(1); ?>
    Last edited by bcsweb1; 01-13-2005 at 11:29 AM. Reason: More info

  2. #2
    Join Date
    May 2004
    Location
    Long Island, NY
    Age
    49
    Posts
    9,796

    Default

    You need to change the link in the featuredlistingsfunction (in style.php) to $config[baseurl]/listingview.php?listingID=$ID.

  3. #3
    Join Date
    Jan 2005
    Posts
    51

    Default Here is the code - I am lost on "where to put" your Fix

    Here is the code ...can you tell me in BOLD where I should put your fix at..

    I just copied the feature listing code from the style.php.

    function renderFeaturedListingsVertical($num_of_listings)
    {
    echo "<table><tr>";
    // shows the images connected to a given image

    global $conn, $lang, $config, $style;
    // grab the images
    $listingID = make_db_extra_safe($listingID);
    $sql = "SELECT ID, Title FROM " . $config[table_prefix] . "listingsDB WHERE (featured = 'yes')";
    $recordSet = $conn->SelectLimit($sql, $num_of_listings, 0 );
    if ($recordSet === false)
    {
    log_error($sql);
    }

    $returned_num_listings = $recordSet->RecordCount();
    if ($returned_num_listings > 0)
    {
    echo "<td width=\"$style[image_column_width]\" valign=\"top\" class=\"row_main\" align=\"center\">";
    echo "<b>$lang[featured_listings]</b><br><hr width=\"75%\">";
    while (!$recordSet->EOF)
    {
    $Title = make_db_unsafe ($recordSet->fields[Title]);
    $ID = make_db_unsafe ($recordSet->fields[ID]);

    $sql2 = "SELECT thumb_file_name FROM " . $config[table_prefix] . "listingsImages WHERE (listing_id = $ID) ORDER BY rank";
    $recordSet2 = $conn->SelectLimit($sql2, 1, 0 );
    if ($recordSet2 === false)
    {
    log_error($sql);
    }
    while (!$recordSet2->EOF)
    {
    $thumb_file_name = make_db_unsafe ($recordSet2->fields[thumb_file_name]);

    // gotta grab the image size
    $imagedata = GetImageSize("$config[listings_upload_path]/$thumb_file_name");
    $imagewidth = $imagedata[0];
    $imageheight = $imagedata[1];
    $shrinkage = $config[thumbnail_width]/$imagewidth;
    $displaywidth = $imagewidth * $shrinkage;
    $displayheight = $imageheight * $shrinkage;

    echo "<a href=\"listingview.php?listingID=$ID\"> ";

    echo "<img src=\"$config[listings_view_images_path]/$thumb_file_name\" height=\"$displayheight\" width=\"$displaywidth\" alt=\"$lang[click_to_learn_more]\"><br> ";
    echo "<b>$Title</b></a><br><br>";
    $recordSet2->MoveNext();
    } // end while
    $recordSet->MoveNext();
    } // end while
    echo "</td>";
    } // end if ($num_images > 0)
    echo "</tr></table>";
    } // end function renderFeaturedListingsVertical
    Attached Files Attached Files
    Last edited by bcsweb1; 01-13-2005 at 11:58 AM. Reason: Attached File

  4. #4
    Join Date
    May 2004
    Location
    Long Island, NY
    Age
    49
    Posts
    9,796

    Default

    Change this line: echo "<a href=\"listingview.php?listingID=$ID\"> ";

  5. #5
    Join Date
    Jan 2005
    Posts
    51

    Default Did not work...

    I did a search in style.php for:

    echo "<a href=\"listingview.php?listingID=$ID\"> ";

    And replaced the whole line with:

    $config[baseurl]/listingview.php?listingID=$ID

    And it created a zillion errors.

    Am I suppose to live echo or any part of that line?

    Can you type out exactly how it should appear?

  6. #6
    Join Date
    Dec 2004
    Posts
    34

    Default

    I think he's telling you to do this... by the way, I had the same problem on with the featured in the header... must be we started with the same template.

    Code:
    echo "<a href=\"$config[baseurl]/listingview.php?listingID=$ID\"> ";

  7. #7
    Join Date
    May 2004
    Location
    Long Island, NY
    Age
    49
    Posts
    9,796

    Default

    I hope you didn't make the change to every instance in style.php or you're going to have problems. As I originally said you only needed to change the link section.


    Change this: echo "<a href=\"listingview.php?listingID=$ID\"> ";

    to this: echo "<a href=\"$config[baseurl]/listingview.php?listingID=$ID\"> ";

  8. #8
    Join Date
    Jan 2005
    Posts
    51

    Default Nothing - no errors but still did not work

    Well, that one did not produce an error but it did not stop it from looking at the members folder.

    There are many of the same lines and I am not sure which line with that code I am suppose to replace.

    Sorry - a little extra help :(

    ??

  9. #9
    Join Date
    May 2004
    Location
    Long Island, NY
    Age
    49
    Posts
    9,796

    Default

    You need to change the one that is under the renderFeaturedlistingsVertical function. If you change it as instructed, there is no way it can point to the members folder.

    Change the line in red below.
    function renderFeaturedListingsVertical($num_of_listings)
    {
    echo "<table><tr>";
    // shows the images connected to a given image

    global $conn, $lang, $config, $style;
    // grab the images
    $listingID = make_db_extra_safe($listingID);
    $sql = "SELECT ID, Title FROM " . $config[table_prefix] . "listingsDB WHERE (featured = 'yes')";
    $recordSet = $conn->SelectLimit($sql, $num_of_listings, 0 );
    if ($recordSet === false)
    {
    log_error($sql);
    }

    $returned_num_listings = $recordSet->RecordCount();
    if ($returned_num_listings > 0)
    {
    echo "<td width=\"$style[image_column_width]\" valign=\"top\" class=\"row_main\" align=\"center\">";
    echo "<b>$lang[featured_listings]</b><br><hr width=\"75%\">";
    while (!$recordSet->EOF)
    {
    $Title = make_db_unsafe ($recordSet->fields[Title]);
    $ID = make_db_unsafe ($recordSet->fields[ID]);

    $sql2 = "SELECT thumb_file_name FROM " . $config[table_prefix] . "listingsImages WHERE (listing_id = $ID) ORDER BY rank";
    $recordSet2 = $conn->SelectLimit($sql2, 1, 0 );
    if ($recordSet2 === false)
    {
    log_error($sql);
    }
    while (!$recordSet2->EOF)
    {
    $thumb_file_name = make_db_unsafe ($recordSet2->fields[thumb_file_name]);

    // gotta grab the image size
    $imagedata = GetImageSize("$config[listings_upload_path]/$thumb_file_name");
    $imagewidth = $imagedata[0];
    $imageheight = $imagedata[1];
    $shrinkage = $config[thumbnail_width]/$imagewidth;
    $displaywidth = $imagewidth * $shrinkage;
    $displayheight = $imageheight * $shrinkage;

    echo "<a href=\"listingview.php?listingID=$ID\"> ";

    echo "<img src=\"$config[listings_view_images_path]/$thumb_file_name\" height=\"$displayheight\" width=\"$displaywidth\" alt=\"$lang[click_to_learn_more]\"><br> ";
    echo "<b>$Title</b></a><br><br>";
    $recordSet2->MoveNext();
    } // end while
    $recordSet->MoveNext();
    } // end while
    echo "</td>";
    } // end if ($num_images > 0)
    echo "</tr></table>";
    } // end function renderFeaturedListingsVertical

  10. #10
    Join Date
    Jan 2005
    Posts
    51

    Thumbs down That did not work.. it only happens in the member areas

    That did not work...did not produce errors but it did not work...

    Remember the feature listing is in the user_top.html

    And the line that uses is:

    <?php renderFeaturedListingsVertical2(1); ?>

    So, even though we are chaging the style.php do we need to change something in the user_top.html as well?

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
  •