PDA

View Full Version : PHP CSS Slideshow Generator


marshall_26
June 3rd, 2007, 09:17 PM
This script will create a css slideshow via picture URLs.

It will also crawl a users myspace profile, and create a slideshow of their top friends.

It's nothing impressive, it's just something I done while I was bored.

If anyone has any use for it feel free to use it.

Firefox doesn't support filter blur so the slideshow looks a lot better in IE.

EXAMPLE: http://www.divaglitter.com/image_slideshow/


<?php

///Copyright 2006 DivaGlitter.com///

$site ="INSERT-HERE"; ////// Website URL
$ctab ="INSERT-HERE"; //// URL of image for corner tab (optional)

$anchor[] = 'Myspace generator';

$anchor[] = 'Myspace';

$anchor[] = 'Myspace layout';

$anchor[] = 'Myspace slideshow';

$anchor[] = 'Comment myspace';

$anchor[] = 'Myspace background';

$anchor[] = 'Myspace slideshow generator';

srand ((double) microtime() * 1000000);
$random_anchor = rand(0,count($anchor)-1);

if($_POST['getit']){

$imgloc1 = $_POST['imgloc1'];
$imgloc2 = $_POST['imgloc2'];
$imgloc3 = $_POST['imgloc3'];
$imgloc4 = $_POST['imgloc4'];
$imgloc5 = $_POST['imgloc5'];
$imgloc6 = $_POST['imgloc6'];
$imgloc7 = $_POST['imgloc7'];
$imgloc8 = $_POST['imgloc8'];
$imgloc9 = $_POST['imgloc9'];
$imgloc10 = $_POST['imgloc10'];

echo '<marquee behavior=alternate DIRECTION=left to right WIDTH=100% Height=70 STYLE="filter:blur(add=2, direction=directions, strength=80)"><marquee width=300>';
if($imgloc1 !== ''){
echo'<a href="'.$site.'" target="_blank"><img src="'.$imgloc1.'" height="200" width="100" border="0"></a>';
}
if($imgloc2 !== ''){
echo'<a href="'.$site.'" target="_blank"><img src="'.$imgloc2.'" height="200" width="100" border="0"></a>';
}
if($imgloc3 !== ''){
echo'<a href="'.$site.'" target="_blank"><img src="'.$imgloc3.'" height="200" width="100" border="0"></a>';
}
if($imgloc4 !== ''){
echo'<a href="'.$site.'" target="_blank"><img src="'.$imgloc4.'" height="200" width="100" border="0"></a>';
}
if($imgloc5 !== ''){
echo'<a href="'.$site.'" target="_blank"><img src="'.$imgloc5.'" height="200" width="100" border="0"></a>';
}
if($imgloc6 !== ''){
echo'<a href="'.$site.'" target="_blank"><img src="'.$imgloc6.'" height="200" width="100" border="0"></a>';
}
if($imgloc7 !== ''){
echo'<a href="'.$site.'" target="_blank"><img src="'.$imgloc7.'" height="200" width="100" border="0"></a>';
}
if($imgloc8 !== ''){
echo'<a href="'.$site.'" target="_blank"><img src="'.$imgloc8.'" height="200" width="100" border="0"></a>';
}
if($imgloc9 !== ''){
echo'<a href="'.$site.'" target="_blank"><img src="'.$imgloc9.'" height="200" width="100" border="0"></a>';
}
if($imgloc10 !== ''){
echo'<a href="'.$site.'" target="_blank"><img src="'.$imgloc10.'" height="200" width="100" border="0"></a>';
}
echo'</MARQUEE></MARQUEE><br><br>';

echo '<textarea cols="55" rows="5" onClick="this.focus();this.select()">
<marquee behavior=alternate DIRECTION=left to right WIDTH=100% Height=70 STYLE="filter:blur(add=2, direction=directions, strength=80)"><marquee width=300>

<a target="_blank" href="'.$site.'"><img src="'.$imgloc1.'" height="200" width="100" border="0"></a>

<a target="_blank" href="'.$site.'"><img src="'.$imgloc2.'" height="200" width="100" border="0"></a>

<a target="_blank" href="'.$site.'"><img src="'.$imgloc3.'" height="200" width="100" border="0"></a>

<a target="_blank" href="'.$site.'"><img src="'.$imgloc4.'" height="200" width="100" border="0"></a>

<a target="_blank" href="'.$site.'"><img src="'.$imgloc5.'" height="200" width="100" border="0"></a>

<a target="_blank" href="'.$site.'"><img src="'.$imgloc6.'" height="200" width="100" border="0"></a>

<a target="_blank" href="'.$site.'"><img src="'.$imgloc7.'" height="200" width="100" border="0"></a>

<a target="_blank" href="'.$site.'"><img src="'.$imgloc8.'" height="200" width="100" border="0"></a>

<a target="_blank" href="'.$site.'"><img src="'.$imgloc9.'" height="200" width="100" border="0"></a>

<a target="_blank" href="'.$site.'"><img src="'.$imgloc10.'" height="200" width="100" border="0"></a>';
echo '</marquee></marquee><p align="center"><font size="1" face="Arial"><a href="'.$site.'"><img src="'.$ctab.'" style="position:absolute; left:0px; top: 0px;z-index:9;" border="0" alt="'.$anchor[$random_anchor].'"></a></textarea>';
}


////////Top Friends////////
if($_POST['id']){
$pro = 'http://myspace.com/'.$_POST['id'];
$ch = curl_init();
curl_setopt ($ch, CURLOPT_URL, $pro);
curl_setopt ($ch, CURLOPT_HEADER, 0);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
$pic_result = curl_exec ($ch);
curl_close ($ch);

preg_match_all('/friendImageLink">.*?<\/a>/is', $pic_result, $found, PREG_SET_ORDER);

/////Preview Friends/////
echo '<marquee behavior=alternate DIRECTION=left to right WIDTH=100% Height=70 STYLE="filter:blur(add=2, direction=directions, strength=80)"><marquee width=300>';

foreach ($found as $pics) {
$pic = implode("", $pics);
$pic = str_replace('friendImageLink">','',$pic);
$pic = str_replace('<img src="','',$pic);
$pic = str_replace('"></a>','',$pic);
echo '<a target="_blank" href="'.$site.'"><img src="'.$pic.'" border="0" height="120" width="80"></a>';
}

echo '</marquee></marquee>';

///////////Code Friends/////////////
echo '<textarea cols="55" rows="5" onClick="this.focus();this.select()"><marquee behavior=alternate DIRECTION=left to right WIDTH=100% Height=70 STYLE="filter:blur(add=2, direction=directions, strength=80)"><marquee width=300>';

foreach ($found as $pics) {
$pic = implode("", $pics);
$pic = str_replace('friendImageLink">','',$pic);
$pic = str_replace('<img src="','',$pic);
$pic = str_replace('"></a>','',$pic);
echo '<a target="_blank" href="'.$site.'"><img src="'.$pic.'" border="0" height="120" width="80"></a>';
}
echo '</marquee></marquee><p align="center"><font size="1" face="Arial"><a href="'.$site.'"><img src="'.$ctab.'" style="position:absolute; left:0px; top: 0px;z-index:9;" border="0" alt="alt="'.$anchor[$random_anchor].'"></a></textarea>';
}

/////////////////////////////
?><br><br>

<table border="0" width="336" cellpadding="0" cellspacing="3">
<tr>
<form method="POST" action="<?echo $_SERVER[’PHP_SELF’];?>">
Myspace id: <input type="text" name="id" size="12" Maxlength="25">
<input type="submit" value="Use Top Friends" name="freinds">
</form>
</tr>
<tr>
<form method="POST" action="<?echo $_SERVER[’PHP_SELF’];?>">
<td width="120">

<tr>
<td width="120">
<font face="Verdana" size="1" color="#1E5275">
<b>Image URL(1):</b></font></td>
<td>
<input type="text" name="imgloc1" size="30"></td>
</tr>

<tr>
<td width="120">
<font face="Verdana" size="1" color="#1E5275">
<b>Image URL(2):</b></font></td>
<td>
<input type="text" name="imgloc2" size="30"></td>
</tr>
<tr>

<td width="120">
<font face="Verdana" size="1" color="#1E5275">
<b>Image URL(3):</b></font></td>
<td>
<input type="text" name="imgloc3" size="30"></td>
</tr>
<tr>
<td width="120">

<font face="Verdana" size="1" color="#1E5275">
<b>Image URL(4):</b></font></td>
<td>
<input type="text" name="imgloc4" size="30"></td>
</tr>
<tr>
<td width="120">
<font face="Verdana" size="1" color="#1E5275">

<b>Image URL(5):</b></font></td>
<td>
<input type="text" name="imgloc5" size="30"></td>
</tr>
<tr>
<td width="120">
<font face="Verdana" size="1" color="#1E5275">
<b>Image URL(6):</b></font></td>

<td>
<input type="text" name="imgloc6" size="30"></td>
</tr>
<tr>
<td width="120">
<font face="Verdana" size="1" color="#1E5275">
<b>Image URL(7):</b></font></td>
<td>

<input type="text" name="imgloc7" size="30"></td>
</tr>
<tr>
<td width="120">
<font face="Verdana" size="1" color="#1E5275">
<b>Image URL(8):</b></font></td>
<td>
<input type="text" name="imgloc8" size="30"></td>

</tr>
<tr>
<td width="120">
<font face="Verdana" size="1" color="#1E5275">
<b>Image URL(9):</b></font></td>
<td>
<input type="text" name="imgloc9" size="30"></td>

</tr>
<tr>
<td width="120">
<font face="Verdana" size="1" color="#1E5275">
<b>Image URL(10):</b></font></td>
<td>
<input type="text" name="imgloc10" size="30"></td>

</tr>

<tr>
<td width="120">
&nbsp;</td>
<td align="right">
<input type="submit" value="Create" name="getit"></td>

</tr>
</table>

kenzie
June 3rd, 2007, 09:28 PM
Thanks! :biggrin:

omen
June 3rd, 2007, 09:32 PM
Thanks, I'll be sure to put that to use :)

deep
June 3rd, 2007, 09:38 PM
thats pretty nice, good job

marshall_26
June 3rd, 2007, 09:38 PM
Welcome and thanks,

Also notice the $anchor[] = 'Myspace generator';

It generates a random anchor text add as many as you like or mod them to target keywords.

minnseoelite
June 3rd, 2007, 09:49 PM
thanks very cool

Sergio
June 3rd, 2007, 10:27 PM
I tested it, and only one of my friends came out, so you might want to double check it.

marshall_26
June 3rd, 2007, 10:36 PM
I tested it, and only one of my friends came out, so you might want to double check it.

hmmm... works perfectly fine on my sites, been using it for months, is your profile public?

Sergio
June 3rd, 2007, 10:39 PM
Yeah it's public. Give it a try if you want here's my friendID 68433479.

marshall_26
June 3rd, 2007, 11:11 PM
Yeah it's public. Give it a try if you want here's my friendID 68433479.

Your using firefox right?? It doesn't support filter blur, and can cause issues. It works fine with IE try it :) It's a CSS thing

I know that kind of sucks but so does firefox not supporting scrollbars... my logs show 89% users are using IE anyway so I don't worry about it.

BTW since this uses curl you can use 68433479 or sergioisgod

Assailant
June 4th, 2007, 12:08 AM
thanks...nice stuff...shsouldnt this be in the freebie section?