|
Posted by Joseph Melnick on 10/10/99 11:17
you could modify the input file.
name1.jpg,some text here
name2.jpg,todays text here
name3.jpg,different text here
in the script:
change this line
if(count($lines)<$dayofyear) $todayspicture = $lines[$dayofyear];
to
if(count($lines)<$dayofyear) {
$todaysdata = $lines[$dayofyear]; // get line from array
$todaysdataarray = explode(",",$todaysdata); // create array of todays data
$todayspicture = $todaysdataarray[0]; // assign first element of array to
todays picture
$alt = $todaysdataarray[1]; // assign second element of array to alt
}
Joseph Melnick
JM Web Consultants
http://www.jphp.com
"Luigi Donatello Asero" <jaggillarfotboll@telia.com> wrote in message
news:UeLme.25973$d5.176316@newsb.telia.net...
>
> "Joseph Melnick" <jmelnick@jphp.com> skrev i meddelandet
> news:GYSdnSQYc4sl5QbfRVn-uA@rogers.com...
>> Hello Luigi,
>>
>> What you could try: without using a database.
>> 1. create a file with all of the picture names. named: pictures.txt
>> name1.jpg
>> name2.jpg
>> name3.jpg
>>
>>
>> 2. use date() to give you the day of the year
>>
>> $todayspicture = 'defaultpic.jpg';
>> $dayofyear = date("z"); // day of year 0-365
>> // today is day 149 so to start from zero subtract from 149 from $dayof
> year
>> $lines = file("pictures.txt");
>> if(count($lines)<$dayofyear) $todayspicture = $lines[$dayofyear];
>>
>> Hope this helps
>>
>> Joseph Melnick
>> JM Web Consultants
>> http://www.jphp.com
>
>
> Thank you very much for your answer.
> Is there any way to let robots save the "alt text" in the pictures even if
> they were changed automatically everyday?
> Where should I write the "alt text" if I used the kind of code which you
> suggested?
> Which were the advantages/disadvantages to use/not to use a database?
>
>
> --
> Luigi ( un italiano che vive in Svezia)
> https://www.scaiecat-spa-gigi.com/it/svezia.html
>
>
>
>>
>
>
>
Navigation:
[Reply to this message]
|