I"m really confused
am 18.11.2007 22:14:39 von phill.luckhurst
I haven't a clue with PHP so please spoon feed me.
In the middle of a script that I have been looking at there is this
code which I have extracted to run on it's own
include "flashthumb.php";
?>
>
....
?>
Now flashthumb.php generates a list of filenames in the variable
$url[1], $url[2], $url[3] etc
how would I use those in the myshow line instead of
'vote.jpg','thumb_rar.jpg','thumb_wav.jpg'
or am I totally barking mad and getting it wrong?
Re: I"m really confused
am 18.11.2007 23:44:12 von Shelly
phill.luckhurst@googlemail.com wrote:
> I haven't a clue with PHP so please spoon feed me.
>
> In the middle of a script that I have been looking at there is this
> code which I have extracted to run on it's own
>
>
> include "flashthumb.php";
>>
>
>
>
>
>
>
>>
>
> ...
>
>
>>
>
> Now flashthumb.php generates a list of filenames in the variable
> $url[1], $url[2], $url[3] etc
>
> how would I use those in the myshow line instead of
> 'vote.jpg','thumb_rar.jpg','thumb_wav.jpg'
>
> or am I totally barking mad and getting it wrong?
Suppose the value of $url[1] is the one that corresponds to 'my_slideshow'
and holds that value. Then you would use
instead of 'my_Slideshow'.
It allows you, for example, to initialize fields in the middle of html text.
--
Shelly
Re: I"m really confused
am 19.11.2007 00:03:27 von phill.luckhurst
On 18 Nov, 22:44, "Shelly" wrote:
> phill.luckhu...@googlemail.com wrote:
> > I haven't a clue with PHP so please spoon feed me.
>
> > In the middle of a script that I have been looking at there is this
> > code which I have extracted to run on it's own
>
> >
> > include "flashthumb.php";
>
> >
> >
>
> >
> >
>
> >
> > ...
> >
> >
>
> > Now flashthumb.php generates a list of filenames in the variable
> > $url[1], $url[2], $url[3] etc
>
> > how would I use those in the myshow line instead of
> > 'vote.jpg','thumb_rar.jpg','thumb_wav.jpg'
>
> > or am I totally barking mad and getting it wrong?
>
> Suppose the value of $url[1] is the one that corresponds to 'my_slideshow'
> and holds that value. Then you would use
>
>
>
> instead of 'my_Slideshow'.
>
> It allows you, for example, to initialize fields in the middle of html text.
>
> --
> Shelly- Hide quoted text -
>
> - Show quoted text -
I don't think I explained myself properly or I don't quite understand
what you mean.
The code above generates a slideshow from the images listed.
$url is an exploded array generated by flashthumb.pbp of filenames
picked from a directory
so $url[1] would be vote.jpg
$url[2] would be rar.jpg
$url[3] would be wav.jpg
etc
except flashthumb selects random jpegs.
The line
myShow = new Slideshow('my_slideshow', {hu: 'images/', images:
['vote.jpg','thumb_rar.jpg','thumb_wav.jpg']});
inserts those images into a slideshow script
so what is needed is something along the lines of
myShow = new Slideshow('my_slideshow', {hu: 'images/', images:
['$url[1]','$url[2]','$url[3]']});
but that obviously is not the correct syntax to insert those values
I really must learn how to code.
Re: I"m really confused
am 19.11.2007 00:34:41 von ivansanchez-alg
phill.luckhurst@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...
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
Re: I"m really confused
am 19.11.2007 08:57:16 von phill.luckhurst
On 18 Nov, 23:34, Iv=E1n S=E1nchez Ortega
escomposlinux.-.punto.-.org> wrote:
> phill.luckhu...@googlemail.com wrote:
> > so what is needed is something along the lines of
>
> > myShow =3D 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...
>
>
>
> foreach($url as $u)
> {
> $quotedurl[] =3D "'" . $u . "'";
>
> }
>
> $concatenatedstuff =3D implode(',',$quotedurl);
>
> echo "myShow =3D new Slideshow('my_slideshow', {hu: 'images/', images:
> [$concatenatedstuff]});";
>
> ?>
>
> > I really must learn how to code.
>
> Yep...
>
> --
> ----------------------------------
> Iv=E1n S=E1nchez Ortega -ivansanchez-algarroba-escomposlinux-punto-org-
>
> Proudly running Debian Linux with 2.6.22-3-amd64 kernel, KDE 3.5.8, and PH=
P
> 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
include "flashthumb.php";
print "
";
print "";
print "";
print "";
print "";
print "
height=3D'300' />";
print "
";
foreach($url as $u)
{
$quotedurl[] =3D "'" . $u . "'";
}
$concatenatedstuff =3D implode(',',$quotedurl);
print "";
?>