SitePoint Sponsor

User Tag List

Results 1 to 13 of 13
  1. #1
    SitePoint Addict
    Join Date
    Feb 2012
    Location
    Kiwi in Bangkok
    Posts
    353
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Help please - Photos are not showing

    Hello

    on my site, uploaded photos are not showing, only "No Image Available"

    on the Sell & Wanted Ads pages is a upload a photo option to display a photo with the Ad,

    I have listed a couple of Sell and Wanted Ads, yet no photos are showing, only the "No Image Available"

    I looked in: /public_html /uplimg and yes the photos/images have been uploaded to the server,

    if you look at the Home page http://numberthree.netne.net/index.php you will see the "No Image Available"

    your help appreciated

  2. #2
    SitePoint Enthusiast
    Join Date
    Apr 2004
    Location
    Michigan
    Posts
    79
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    1. Have you contacted the creator of the script?
    2. It would help to see some relevant code

  3. #3
    Foozle Reducer ServerStorm's Avatar
    Join Date
    Feb 2005
    Location
    Burlington, Canada
    Posts
    2,699
    Mentioned
    89 Post(s)
    Tagged
    2 Thread(s)
    RayWilk

    Have you checked the permission that are set by the upload script (if it does indeed set permissions). I have seen scripts that upload images with root permission yet the apache server is set with www-data permissions. Images uploaded will not be shown until they are mapped to www-data. I know on some server configurations, masks are needed to set correct permissions on uploading things. A different angle I know, but one you might want to check.

    One way to determine this is try to browse to the uploaded image folder and read an image. So if you site was abc.com then you might go abc.com/uploads/big_table.jpg. See if it loads. If it does then permissions are fine, it is your script or a path set incorrectly.

    Steve
    ictus==""

  4. #4
    SitePoint Addict
    Join Date
    Feb 2012
    Location
    Kiwi in Bangkok
    Posts
    353
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hello Steve (ServerStorm)

    good to hear from you, and your ideas

    ok I can confirm that the image/photo is in the uplimg folder and readable,

    http://numberthree.netne.net/uplimg/...209d08f7e6.jpg

    so it is seems to be my script, or script path,

    could someone please help me in finding the script fault?


  5. #5
    SitePoint Addict
    Join Date
    Feb 2012
    Location
    Kiwi in Bangkok
    Posts
    353
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hello litebearer

    I appreciated your reply,

    please tell me what code you would like to see?

    I am on a learning curve here

  6. #6
    SitePoint Mentor silver trophy
    Rubble's Avatar
    Join Date
    Dec 2005
    Location
    Cambridge, England
    Posts
    2,206
    Mentioned
    74 Post(s)
    Tagged
    3 Thread(s)
    As your code is brought there may be a control pannel with the settings; check there and see if you need to set a path to the image folder.

    It looks like the code is searching for the image and if it is not found it displays the "No image available" image.

    Is the data is stored in a database? You could use phpmyadmin to see what is stored there for the image path.

    The simplest and quickest way to get the answer would be as Liteberer said - contact the people who sold you the software.

  7. #7
    SitePoint Addict
    Join Date
    Feb 2012
    Location
    Kiwi in Bangkok
    Posts
    353
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hello Rubble,

    good to hear from you,

    I have had a look in Admin Area, I can not find any area requiring a path setting, or a path needing setting for images/photos

    I just had a look in my Servers Control Panel phpmyadmin, and can see no reference to images/photos in the database names,

    Yes I agree if no image found it displays the "No image available" image.

    your ideas/help appreciated


  8. #8
    SitePoint Addict
    Join Date
    Feb 2012
    Location
    Kiwi in Bangkok
    Posts
    353
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I am just guessing here, yet I have had trouble with several php's in this script, would it be the thumbnail.php ?

    idea 2: should the image be loaded to cache ?

    ...............................................................................................................................................................

    <?
    #################################################################
    ## PHP Pro Bid v6.10 ##
    ##-------------------------------------------------------------##
    ## thumbnail.php ##
    ##-------------------------------------------------------------##
    #################################################################

    include_once('includes/class_image.php');

    $image = new image();

    (string) $pic = null;

    $pic = str_ireplace(' ','%20',$_GET['pic']);

    $thumbnail_width = abs(intval($_GET['w']));

    $is_square = ($_GET['sq']=='Y')? true : false;
    $is_border = ($_GET['b']=='Y') ? true : false;

    $pic_no_spaces = str_ireplace('%20','',$pic);

    $pic_cached = str_ireplace($image->image_basedir,'',$pic_no_spaces);

    $allowed_extension = $image->allowed_extension($pic);

    /* check to see if file already exists in cache, and output it with no processing if it does */
    $cached_filename = $image->set_cache_filename($pic_cached, $thumbnail_width, $is_square, $is_border);

    if (is_file($cached_filename) && $allowed_extension) /* display cached filename */
    {
    $photo = file_get_contents($cached_filename);

    ob_start();
    header("Content-type: image/jpeg");
    print($photo);
    ob_end_flush();
    }
    else /* create new thumbnail, and add it into the cache directory as well */
    {

    $allowed_widths = array(50, 55, 60, 70, 75, 80, 90, 100, 150, 250, 275, 300, 500, 750, $layout['hpfeat_width'], $layout['catfeat_width']);
    //$allowed_widths = sort($allowed_widths, SORT_NUMERIC);

    if (!in_array($thumbnail_width, $allowed_widths))
    {
    $difference = 0;
    $new_width = $thumbnail_width;
    foreach ($allowed_widths as $value)
    {
    $diff = abs($thumbnail_width - $value);

    if ($diff < $difference || $difference == 0)
    {
    $difference = $diff;
    $new_width = $value;
    }
    }

    $thumbnail_width = $new_width;
    }

    (array) $info = null;

    $info = null;

    $info = @getimagesize($pic);
    list($im_width, $im_height, $im_type, $im_attr) = $info;

    if (empty($info) || $im_type>3) $pic = 'images/broken.gif';

    if (isset($pic) && $thumbnail_width>0 && $allowed_extension)
    {
    $cache_output = $image->set_cache_filename($pic_cached, $thumbnail_width, $is_square, $is_border);
    $image->generate_thumb($pic, $thumbnail_width, $is_square, $is_border, $cache_output);
    //header('Location: ' . $cache_output);

    $photo = file_get_contents($cached_filename);

    ob_start();
    header("Content-type: image/jpeg");
    print($photo);
    ob_end_flush();
    }
    else if (!isset($pic))
    {
    echo "<strong>ERROR/strong> No image submitted";
    }
    else if ($thumbnail_width<=0)
    {
    echo "<strong>ERROR/strong> Invalid resizing option";
    }
    else if (!$allowed_extension)
    {
    echo "<strong>ERROR/strong> Prohibited file extension";
    }
    }
    ?>

  9. #9
    SitePoint Mentor silver trophy
    Rubble's Avatar
    Join Date
    Dec 2005
    Location
    Cambridge, England
    Posts
    2,206
    Mentioned
    74 Post(s)
    Tagged
    3 Thread(s)
    I would say you are looking for "noimg.gif" within the code somewhere and it is not here.

    You could check: includes/class_image.php but there are so many files and the database it could be like looking for a needle in a haystack.

  10. #10
    SitePoint Addict
    Join Date
    Feb 2012
    Location
    Kiwi in Bangkok
    Posts
    353
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hello Rubble,

    I did a search for "noimg.gif" the search results are in the attached screen print

    Attached Images Attached Images

  11. #11
    SitePoint Addict
    Join Date
    Feb 2012
    Location
    Kiwi in Bangkok
    Posts
    353
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This is from auction_details.tpl.php
    ......................................................................................


    <td width="20%" align="center">
    <table width="100%" border="0" cellspacing="3" cellpadding="3">
    <? if (!empty($item_details['ad_image'][0])) { ?>
    <tr>
    <td align="center">
    <? $ad_image = (!empty($item_details['ad_image'][0])) ? $item_details['ad_image'][0] : 'themes/' . $setts['default_theme'] . '/img/system/noimg.gif'; ?>
    <div class="wraptocenter" id="ad_image"><span></span>
    <img <? echo ($setts['thumb_display_type'] == 'h') ? 'name="main_ad_image"' : ''; ?> src="thumbnail.php?pic=<?=$ad_image;?>&w=250&sq=Y" border="0" alt="<?=$item_details['name'];?>">
    </div>
    <? if (item::count_contents($item_details['ad_image']) && $setts['thumb_display_type'] == 'h') { ?>
    <div style="padding-top: 10px; width: 250px;"><?=$ad_image_thumbnails;?></div>
    <? } ?>
    </td>

  12. #12
    SitePoint Mentor silver trophy
    Rubble's Avatar
    Join Date
    Dec 2005
    Location
    Cambridge, England
    Posts
    2,206
    Mentioned
    74 Post(s)
    Tagged
    3 Thread(s)
    Check this in your database 'ad_image'

  13. #13
    SitePoint Addict
    Join Date
    Feb 2012
    Location
    Kiwi in Bangkok
    Posts
    353
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hello Rubble

    ok went to phpMyAdmin

    searched for "ad_image"

    1 match(es) inside table content_pages

    Clicked on Browse, info below

    COLLATE latin1_general_ci
    OR `topic_content` LIKE CONVERT( _utf8 '%ad_image%'
    USING latin1 )
    COLLATE latin1_general_ci
    OR `topic_lang` LIKE CONVERT( _utf8 '%ad_image%'
    USING latin1 )
    COLLATE latin1_general_ci
    OR `topic_order` LIKE '%ad_image%'
    OR `reg_date` LIKE '%ad_image%'
    OR `page_id` LIKE CONVERT( _utf8 '%ad_image%'
    USING latin1 )
    COLLATE latin1_general_ci
    OR `page_handle` LIKE CONVERT( _utf8 '%ad_image%'
    USING latin1 )
    COLLATE latin1_general_ci
    OR `show_link` LIKE '%ad_image%'
    )
    LIMIT 0 , 30


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
  •