Hi everyone!
I’m completely new to creating php dynamic pages - so for the moment, I am using txt files to manage my simple data! I’ll explain my set up first. I have one php page - it gets data from two .txt files:
brief.txt: written content (title and supporting text)
photos.txt: image file names.
I am using php pagination, and this changes the content in the php page by referring to the numbers I have used in the .txt file, here is the code I am using:
[php]<?php
$data=file(“brief.txt”);
$pages=0;
foreach($data as $temp){
$x=explode("|",$temp);
if($x[0]>0){
$pages=$pages+1;
}
}
if($_GET[‘p’]){
$page=$_GET[‘p’];
}
if($_GET[‘i’]){
$index=$_GET[‘i’];
}
if($index == “p”){
$page=$page-1;
}
if($index == “n”){
$page=$page+1;
}
if($page < 1){
$page=1;
}
if($page > $pages){
$page=$pages;
}
$line=$data[$page-1];
$fields=explode("|",$line);
?>[/php]
and this is an example of my text file
brief.txt:
1|TITLE 1|Content goes here
2|TITLE 2|Content goes here
photos.txt:
1|imageone1.jpg
2|imagetwo1.jpg
Hopefully that all makes sense! Now, my problem is, I have a few video files. At the moment, the images load in a jquery slideshow. I would like to somehow have the script change, for example, when it makes page 3 with a video file it doesn’t create the slideshow, but instead creates a video player and can load the url of my video that is placed in the txt file. The code I am using at the moment for the jquery slideshow is this:
[php]<?php
echo"
I would like the above code, to change to a jquery media player when you go to a page with a video (vimeo) or flash movie (swf). The videos are hosted elsewhere online, while the flash movies are hosted locally.
I hope that’s not too confusing. I would be so grateful if someone would be able to help me out!