Wallpaper script problem - any help would be Appreciated

Discussion in 'PHP' started by jjrichone, Sep 26, 2009.

  1. #1
    Does any know how add a link to the image?

    At the moment when I click on the wallpaper image there is no link.

    Here is the code:



    if ($Wallpaper1 != NULL) {
    $size='';
    $size=getimagesize("images/wallpapers/".$Wallpaper1);
    if ($Settings['Enable_Watermark'] == '1') {
    $dHTML .= '<a href="'.$image_path.'images/wmwallpapers/'.str_replace(" ","-",$Title).'-1.jpeg" style="text-decoration: underline;">'.$size[0].'x'.$size[1].'</a> ';
    } else {
    $dHTML .= '<a href="'.$image_path.'images/wallpapers/'.$Wallpaper1.'" style="text-decoration: underline;">'.$size[0].'x'.$size[1].'</a> ';
    }
    }
    ________
     
    jjrichone, Sep 26, 2009 IP
  2. orionoreo

    orionoreo Peon

    Messages:
    145
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    the script you provided doesn't have any images... all it did was produce some links... your result should be displaying something like 1200x1024 1024x768 with links... and its not even outputting it yet

    do you have the full code?
     
    orionoreo, Sep 26, 2009 IP
  3. jjrichone

    jjrichone Peon

    Messages:
    41
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    There is quite a lot of code. I will try and paste the most relevant section:

    :eek:

    $WallpaperNav=$aWallpaperNav.$WallpaperNav."</span>";

    }



    if ($Wallpaper1 != NULL) {

    $size='';

    $size=getimagesize("images/wallpapers/".$Wallpaper1);

    if ($Settings['Enable_Watermark'] == '1') {

    $dHTML .= '<a href="'.$image_path.'images/wmwallpapers/'.str_replace(" ","-",$Title).'-1.jpeg" style="text-decoration: underline;">'.$size[0].'x'.$size[1].'</a> ';

    } else {

    $dHTML .= '<a href="'.$image_path.'images/wallpapers/'.$Wallpaper1.'" style="text-decoration: underline;">'.$size[0].'x'.$size[1].'</a> ';

    }

    }

    if ($Wallpaper2 != NULL) {

    $size='';

    $size=getimagesize("images/wallpapers/".$Wallpaper2);

    if ($Settings['Enable_Watermark'] == '1') {

    $dHTML .= '<a href="'.$image_path.'images/wmwallpapers/'.str_replace(" ","-",$Title).'-2.jpeg" style="text-decoration: underline;">'.$size[0].'x'.$size[1].'</a> ';

    } else {

    $dHTML .= '<a href="'.$image_path.'images/wallpapers/'.$Wallpaper2.'" style="text-decoration: underline;">'.$size[0].'x'.$size[1].'</a> ';

    }

    }

    if ($Wallpaper3 != NULL) {

    $size='';

    $size=getimagesize("images/wallpapers/".$Wallpaper3);

    if ($Settings['Enable_Watermark'] == '1') {

    $dHTML .= '<a href="'.$image_path.'images/wmwallpapers/'.str_replace(" ","-",$Title).'-3.jpeg" style="text-decoration: underline;">'.$size[0].'x'.$size[1].'</a> ';

    } else {

    $dHTML .= '<a href="'.$image_path.'images/wallpapers/'.$Wallpaper3.'" style="text-decoration: underline;">'.$size[0].'x'.$size[1].'</a> ';

    }

    }

    if ($Wallpaper4 != NULL) {

    $size='';

    $size=getimagesize("images/wallpapers/".$Wallpaper4);

    if ($Settings['Enable_Watermark'] == '1') {

    $dHTML .= '<a href="'.$image_path.'images/wmwallpapers/'.str_replace(" ","-",$Title).'-4.jpeg" style="text-decoration: underline;">'.$size[0].'x'.$size[1].'</a> ';

    } else {

    $dHTML .= '<a href="'.$image_path.'images/wallpapers/'.$Wallpaper4.'" style="text-decoration: underline;">'.$size[0].'x'.$size[1].'</a> ';

    }

    }

    if ($Wallpaper5 != NULL) {

    $size='';

    $size=getimagesize("images/wallpapers/".$Wallpaper5);

    if ($Settings['Enable_Watermark'] == '1') {

    $dHTML .= '<a href="'.$image_path.'images/wmwallpapers/'.str_replace(" ","-",$Title).'-5.jpeg" style="text-decoration: underline;">'.$size[0].'x'.$size[1].'</a> ';

    } else {

    $dHTML .= '<a href="'.$image_path.'images/wallpapers/'.$Wallpaper5.'" style="text-decoration: underline;">'.$size[0].'x'.$size[1].'</a> ';

    }

    }
     
    jjrichone, Sep 26, 2009 IP
  4. ThomasTwen

    ThomasTwen Peon

    Messages:
    113
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #4
    <a href="www.mysite.com">
    <img src="www.mysite.com/img.jpg">
    </a>
    
    Code (markup):
    The above HTML code will display an image that can be clicked like any other link.

    Do you need this code or help with implementing it in PHP?
     
    ThomasTwen, Sep 26, 2009 IP