SitePoint Sponsor

User Tag List

Page 2 of 2 FirstFirst 12
Results 26 to 40 of 40
  1. #26
    SitePoint Zealot
    Join Date
    Oct 2007
    Location
    In the blogosphere
    Posts
    108
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you really wanted to do something like that, you would the script to include the <img src> tags, something ti doesn't currently do.
    bLueFrogX's Blog - Random Ramblings of a NEET Techie ★

  2. #27
    SitePoint Member
    Join Date
    Oct 2007
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thats what i have been trying to do with,

    $images=array(
    "<a href='link1.html'><img src='img1.gif'></a>",
    "<a href='link2.html'><img src='img2.gif'></a>",
    "<a href='link3.html'><img src='img3.gif'></a>"
    );

    but i seem unable to output it on the page. Any suggestions where im going wrong?

  3. #28
    SitePoint Zealot
    Join Date
    Oct 2007
    Location
    In the blogosphere
    Posts
    108
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yep, its wrong in the sense that you're trying to adapt the script for something it wasn't meant to do making it overly complex in the process.


    Refer to http://www.sitepoint.com/forums/showthread.php?t=510395 , that might fit your requirements more.
    bLueFrogX's Blog - Random Ramblings of a NEET Techie ★

  4. #29
    SitePoint Member
    Join Date
    Oct 2007
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That looks just the job, will try it when i get home from work.

    Thanks

  5. #30
    howhowdecarabao
    SitePoint Community Guest
    Hi!
    I tried the code but why dont my website show the pictures..I did reszie in html with length="" and width=""
    Thanks a lot!!

  6. #31
    SitePoint Member
    Join Date
    Oct 2007
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This is what i use to show 9 pictures and it works.

    PHP Code:
    <?
    $images
    [0]['src'] = '../img/Thumbnails/XXXX.jpg';
    $images[0]['link'] = '/docs/XXXX.php';
    $images[0]['alt'] = 'XXXX';

    $images[1]['src'] = '../img/Thumbnails/YYYY.jpg';
    $images[1]['link'] = '/docs/YYYY.php';
    $images[1]['alt'] = 'YYYY';

    $images[2]['src'] = '../img/Thumbnails/ZZZZ.jpg';
    $images[2]['link'] = '/docs/ZZZZ.php';
    $images[2]['alt'] = 'ZZZZ';

    // etc etc


    shuffle$images );
    $i 0;
    echo 
    '<p id="bottomHorizontalLinePictures">';

    foreach( 
    $images as $arr )
    {    
        if (
    $i  9)
        {
            
    $html '<a href="' $arr['link'] . '"><img src="' $arr['src'] . '" alt="' $arr['alt'] . '" class="combinedSmallPhotos"></a>';
            echo 
    $html;
            
    $i++;
        }
    }
    echo 
    '</p>';
    ?>

  7. #32
    me
    SitePoint Community Guest
    remove the / in /> and it will work

  8. #33
    SitePoint Member
    Join Date
    Apr 2008
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    what am I doing wrong

    what am I doing wrong

    I am getting the error;
    Cannot modify header information - headers already sent by (output started at /home/seehereo/public_html/jengasupplementscom/2/rotate.php:9) in /home/seehereo/public_html/jengasupplementscom/2/rotate.php on line 33

    example
    http://jengasupplements.com.au/2/rotate.php

    PHP Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Untitled Document</title>
    </head>

    <body>
    <?php 
    // rotate images randomly but w/o dups on same page - format: 
    // <img src='rotate.php?i=0'> - rotate image #0 - use 'i=1' 
    // for second, etc 
    // (c) 2004 David Pankhurst - use freely, but please leave in my credit 
    $images=array( // list of files to rotate - add as needed 
     
    "bomb.gif"
     
    "frown.gif"
     
    "grim.gif"
     
    "smile.gif" ); 
    $total=count($images); 
    $secondsFixed=10// seconds to keep list the same 
    $seedValue=(int)(time()/$secondsFixed); 
    srand($seedValue); 
    for (
    $i=0;$i<$total;++$i// shuffle list 'randomly' 

     
    $r=rand(0,$total-1); 
     
    $temp =$images[$i]; 
     
    $images[$i]=$images[$r]; 
     
    $images[$r]=$temp

    $index=(int)($_GET['i']); // image index passed in 
    $i=$index%$total// make sure index always in bounds 
    $file=$images[$i]; 
    header("Location: $file"); // and pass file reference back 
    ?>



    <img src='rotate.php?i=0'>image #1 
    <img src='rotate.php?i=1'>image #2 
    <img src='rotate.php?i=2'>image #3






    </body>
    </html>

  9. #34
    SitePoint Member
    Join Date
    Apr 2008
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I figured it out...

    I created a rotate.php with just the configuration php (top stuff), then created a index file with just the <img src='http://www.xx.com/rotate.php?i=0'>image #1
    and it worked fine
    http://jengasupplements.com.au/2/1.php

  10. #35
    SitePoint Member
    Join Date
    Apr 2008
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    attached is a zip file with pre made files for dummies like me
    Attached Files Attached Files

  11. #36
    SitePoint Member
    Join Date
    Nov 2006
    Location
    Berlin
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    is it possible to make links around the images?
    How to do it?

  12. #37
    Anonymous
    SitePoint Community Guest
    Yeah, how do you put links around the images. I want to rotate the images but also link the images to different pages depending on the image.

  13. #38
    Brad
    SitePoint Community Guest
    How would you use this to add links to the images while keeping the link attached to the image you specify.

  14. #39
    SitePoint Enthusiast
    Join Date
    Apr 2009
    Posts
    42
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i know this thread is like super old. but i found this script today and it's exactly what i need. i just had a question about it.

    would it be possible to stagger the rotation of the images... like say you have images 1 2 3... could image 2 be set to rotate a few seconds after image 1..
    so that all the images are not rotating at the exact same time if they are lined up in a row?

    i'm also wondering if u could set a hyperlink to the images i never saw a response really for that question though it seemed to have been asked prior

  15. #40
    SitePoint Enthusiast
    Join Date
    Apr 2009
    Posts
    42
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    anyone have any ideas on this?


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
  •