473,387 Members | 1,812 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

I'm really confused

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

<?php
include "flashthumb.php";
?>

<script type="text/javascript" src="mootools.js"></script>
<script type="text/javascript" src="slideshow.js"></script>

<div id="my_slideshow" class="slideshow">
<img src="images/vote.jpg" alt="A picture" width="400" height="300" /
>
</div>
....
<script type="text/javascript">
myShow = new Slideshow('my_slideshow', {hu: 'images/', images:
['vote.jpg','thumb_rar.jpg','thumb_wav.jpg']});
</script>
<?
?>

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?
Nov 18 '07 #1
3 1174
ph*************@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

<?php
include "flashthumb.php";
>>

<script type="text/javascript" src="mootools.js"></script>
<script type="text/javascript" src="slideshow.js"></script>

<div id="my_slideshow" class="slideshow">
<img src="images/vote.jpg" alt="A picture" width="400" height="300" /
>>
</div>
...
<script type="text/javascript">
myShow = new Slideshow('my_slideshow', {hu: 'images/', images:
['vote.jpg','thumb_rar.jpg','thumb_wav.jpg']});
</script>
<?
>>

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

<?php echo $url[1]; ?>

instead of 'my_Slideshow'.

It allows you, for example, to initialize fields in the middle of html text.

--
Shelly
Nov 18 '07 #2
On 18 Nov, 22:44, "Shelly" <sheldonlg.n...@asap-consult.comwrote:
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
<?php
include "flashthumb.php";
<script type="text/javascript" src="mootools.js"></script>
<script type="text/javascript" src="slideshow.js"></script>
<div id="my_slideshow" class="slideshow">
<img src="images/vote.jpg" alt="A picture" width="400" height="300" /
</div>
...
<script type="text/javascript">
myShow = new Slideshow('my_slideshow', {hu: 'images/', images:
['vote.jpg','thumb_rar.jpg','thumb_wav.jpg']});
</script>
<?
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

<?php echo $url[1]; ?>

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.
Nov 18 '07 #3
ph*************@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

Nov 18 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: rahul8143 | last post by:
hello, I am really confused over following for code snippets. No problem that they are working codes but how? how they are evaluated by compiler? It will be my pleasure if you explain me all...
3
by: Studio P.M. | last post by:
Dear colleagues, I kindly ask the C# developers community to help me to REALLY understand the Page_Load event, so to REALLY have it under control. Reason for this question is that I cannot...
5
by: Lauren Wilson | last post by:
The more I look at the issue of digital certification for our Access app, the more confused I get. The SelfCert feature that allegedly installed with Office 2003 does not work. The entry is on my...
6
by: Sam Malone | last post by:
Am I just totally missing something here? I'm just new to VS.NET 2005 (using VB.NET) and ADO.NET. I get the impression that ADO.NET can't do what I'm used to doing with ADO (previous ADO...
10
by: Stan R. | last post by:
Hi. I'm an old programmer whose been finally reading up on xml the past week. The concepts of xml, dtd, and xsl seem pretty straight forward to me. I understand that xsl (as xslt for...
1
lolixpop
by: lolixpop | last post by:
Hi everybody thanks for reading! i have a few actionscript questions that i really need help on...any help would be greatly appreciated! Okay so i came upon this tutorial:...
4
by: Viator | last post by:
Hi folks, I have a basic question. When I do object-oriented programming using C++ or Java, all my objects reside in RAM. I do not have to think about storing and retrieving them, because they...
2
by: Peter | last post by:
Hi, I have a problem with Listview using checkboxes. If i check items by code BEFORE the form is shown the Listview.Items are confused during the ItemChecked Event !!! After showing the...
1
by: beary | last post by:
Hello everyone, I'm not sure if this is the correct forum for this, and apologies for the length of this question, but I'm desperate for some good advice... I'm in way over my head with file...
9
by: inxanu | last post by:
Hi all, I have several threads running (basically they are copying files from one place to another). I am using log4net for logging...However, sometimes i get a log4net error due to log file being...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.