Reply to Re: I'm really confused

Your name:

Reply:


Posted by phill.luckhurst@googlemail.com on 11/19/07 07:57

On 18 Nov, 23:34, Iván Sánchez Ortega <ivansanchez-...@rroba-
escomposlinux.-.punto.-.org> wrote:
> phill.luckhu...@googlemail.com wrote:
> > so what is needed is something along the lines of
>
> > myShow = new Slideshow('my_slideshow', {hu: 'images/', images:
> > ['$url[1]','$url[2]','$url[3]']});
>
> So you need to quote the array values, then concatenate them all with
> commas...
>
> <?php
>
> foreach($url as $u)
> {
> $quotedurl[] = "'" . $u . "'";
>
> }
>
> $concatenatedstuff = implode(',',$quotedurl);
>
> echo "myShow = new Slideshow('my_slideshow', {hu: 'images/', images:
> [$concatenatedstuff]});";
>
> ?>
>
> > I really must learn how to code.
>
> Yep...
>
> --
> ----------------------------------
> Iván Sánchez Ortega -ivansanchez-algarroba-escomposlinux-punto-org-
>
> Proudly running Debian Linux with 2.6.22-3-amd64 kernel, KDE 3.5.8, and PHP
> 5.2.4-2 generating this signature.
> Uptime: 00:32:43 up 7:33, 2 users, load average: 0.31, 0.47, 0.45

Woo hoo,

That's done the trick. Almost

The script works fine if I manually create a list of images but when
created with $concantatedstuff it runs once and does not loop. Wierd,
I'm sure I'll work it out eventually.

You can see it running here.

http://www.windsurf.me.uk/cpg133/mooslide.php

<?php
include "flashthumb.php";
print "<head>";
print "<script type='text/javascript' src='mootools.js'></script>";
print "<script type='text/javascript' src='slideshow.js'></script>";
print "";
print "<div id='my_slideshow' class='slideshow'>";
print "<img src='images/TITLE3.jpg' alt='A picture' width='400'
height='300' />";
print "</div>";
foreach($url as $u)
{
$quotedurl[] = "'" . $u . "'";



}
$concatenatedstuff = implode(',',$quotedurl);
print "<script language=\"JavaScript\">\n";
print "myShow = new Slideshow('my_slideshow', {type: 'combo', resize:
true, duration: [2000, 4000], width: 400, height: 300, hu: '',
images:
[$concatenatedstuff]});";
print "</script>";

?>

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация