Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6761693
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T14:13:21+00:00 2026-05-26T14:13:21+00:00

I was wondering if anyone would be able to help me fix this script…It

  • 0

I was wondering if anyone would be able to help me fix this script…It basically just calls either a slideshow if the file is an image, a vimeo player if it has a vimeo url, and an embedded swf if it is a flash file.

<div id='jessslide'>
    <?php
$photos=file("work.txt");
echo "<div id='slider-wrapper'>";
foreach($photos as $image){
$flag=0;
$item=explode("|",$image);
if($item[0]==$fields[0]){
$photo=trim($item[1]);

// check for Vimeo
if(strpos($photo, "vimeo.com") && $flag==0){
echo "<iframe src='$photo?title=0&amp;byline=0&amp;portrait=0' width='900' height='500'     frameborder='0' webkitAllowFullScreen allowFullScreen></iframe>";
$flag=1;
}
// check for Flash
if(strpos($photo, ".swf") && $flag==0){
echo "<object id='myId' classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' width='900'     height='500'><param name='movie' value='$photo' />
            <!--[if !IE]>-->
            <object type='application/x-shockwave-flash' data='images/work/$photo' width='900' height='500'>
            <!--<![endif]-->
            <div>
            <h1>Alternative content</h1>
            <p><a href='http://www.adobe.com/go/getflashplayer'><img src='http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif' alt='Get Adobe Flash player' /></a></p>
            </div>
            <!--[if !IE]>-->
            </object>
            <!--<![endif]-->
        </object>";
$flag=1;
}
// If it's not Vimeo or Flash, then it must be a photo
if($flag==0){
echo "<div id='slider' class='nivoSlider'><img src='images/work/$photo' alt='' /></div>\n";
}
}
}
echo "</div>";
?>
  </div>

Everything works fine, however, the slideshow only displays 1 image. When viewing the generated source, this is what is displaying for the slideshow:

 <div id='jessslide'>
    <div id='slider-wrapper'><div id='slider' class='nivoSlider'><img src='images/work/sparklingsweet1.jpg' alt='' /></div>
<div id='slider' class='nivoSlider'><img src='images/work/sparklingsweet2.jpg' alt='' /></div>
<div id='slider' class='nivoSlider'><img src='images/work/sparklingsweet3.jpg' alt='' /></div>
<div id='slider' class='nivoSlider'><img src='images/work/sparklingsweet4.jpg' alt='' /></div>
<div id='slider' class='nivoSlider'><img src='images/work/sparklingsweet5.jpg' alt='' /></div>
<div id='slider' class='nivoSlider'><img src='images/work/sparklingsweet6.jpg' alt='' /></div>
<div id='slider' class='nivoSlider'><img src='images/work/sparklingsweet7.jpg' alt='' /></div>
</div>
</div>

And this is what the correct working slideshow output should look like:

<div id='slider-wrapper'>
<div id='slider' class='nivoSlider'>
<img src='images/work/sparklingsweet1.jpg' alt='' />
<img src='images/work/sparklingsweet2.jpg' alt='' />
<img src='images/work/sparklingsweet3.jpg' alt='' />
<img src='images/work/sparklingsweet4.jpg' alt='' />
<img src='images/work/sparklingsweet5.jpg' alt='' />
<img src='images/work/sparklingsweet6.jpg' alt='' />
<img src='images/work/sparklingsweet7.jpg' alt='' />
</div>
</div>

So it seems to be a div issue…I’m not doing something right with the divs in the php. Anyone wanna be awesome and help me out with this silly div issue? 🙂

*There is only one div outside of the php script on the php page I have, which is the “jessslide”.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T14:13:21+00:00Added an answer on May 26, 2026 at 2:13 pm
    <div id='jessslide'>
        <?php
        $photos=file("work.txt");
        foreach($photos as $image){
            $flag=0;
            $item=explode("|",$image);
            if($item[0]==$fields[0]){
                $photo=trim($item[1]);
    
                // check for Vimeo
                if(strpos($photo, "vimeo.com") && $flag==0):
                    echo "<iframe src='$photo?title=0&amp;byline=0&amp;portrait=0' width='900' height='500'     frameborder='0' webkitAllowFullScreen allowFullScreen></iframe>";
                    $flag=1;
    
                // check for Flash
                elseif(strpos($photo, ".swf") && $flag==0):
                    echo "<object id='myId' classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' width='900'     height='500'><param name='movie' value='$photo' />
                                <!--[if !IE]>-->
                                <object type='application/x-shockwave-flash' data='images/work/$photo' width='900' height='500'>
                                <!--<![endif]-->
                                <div>
                                <h1>Alternative content</h1>
                                <p><a href='http://www.adobe.com/go/getflashplayer'><img src='http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif' alt='Get Adobe Flash player' /></a></p>
                                </div>
                                <!--[if !IE]>-->
                                </object>
                                <!--<![endif]-->
                            </object>";
                    $flag=1;
    
                // If it's not Vimeo or Flash, then it must be a photo
                else :
                    $photoarray[] = $photo;
                endif;
            }
        }
        if (isset($photoarray)):
            echo "<div id='slider-wrapper'><div id='slider' class='nivoSlider'>";
            foreach ($photoarray as $photo):
                echo "<img src='images/work/$photo' alt='' />\n";
            endforeach;
            echo "</div></div>";
        endif;
    
        ?>
    </div>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Just wondering if anyone would be able to help with the following VBScript script
I was wondering if anyone would help with the following: I have a date
I am wondering if anyone knows a java script library that would add a
Wondering if anyone can help me with this annoying but trivial (in terms of
Wondering if anyone can help with this. I have a table with some fixed
I was wondering if anyone would be able to provide me with some guidance
http://www.liveprofile.com/ I was wondering if anyone would be able to explain roughly how an
Hi brothers and sisters, I am wondering if anyone would share their experience on
I provide a web service to my organisation. i was wondering would anyone recommeding
I was wondering if anyone had an example of what an array would look

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.