Home Articles CV / Résumé Downloads Photo Gallery Web LinksNovember 21 2008 12:24:48
View Thread
Adnan's Webspace | PHP Fusion | Infusions
Author Photo gallery Slide show
wadday
Member

User Avatar

Posts: 12
Location: Maldives - Island
Joined: 28.12.06
Posted on 30-01-2007 14:39
hey adnan,
can you help me on this...i have make the changes for the slide show...in the photo gallery...but seems to having some problem...
check... http://www.abadhuves.net.tc
thank you
wadday@funaadu.com www.fuvahmulah.com Send Private Message
Author Sponsored Link
Advertisement


Location: Internet
Author RE: Photo gallery Slide show
Adnan
Super Administrator

Posts: 80
Location: Montreal, Canada
Joined: 23.03.06
Posted on 31-01-2007 05:32
Its an issue with the gfx watermark ...

open slideshow.php (i think tht's what i called it, lol) and replace
".BASEDIR."gfx.php?full=n&photo_id="




with

".PHOTODIR.$data['photo_thumb2']."




that should use the middle size thumbnail for the slideshow, and not worry about the gfx.

Adnan.
http://www.theadnanahmed.com Send Private Message
Author RE: Photo gallery Slide show
wadday
Member

User Avatar

Posts: 12
Location: Maldives - Island
Joined: 28.12.06
Posted on 31-01-2007 15:26
this is how its look like...
".BASEDIR."gfx.php?full=n&photo_id="

still having problem.....
wadday@funaadu.com www.fuvahmulah.com Send Private Message
Author RE: Photo Gallery slide show
wadday
Member

User Avatar

Posts: 12
Location: Maldives - Island
Joined: 28.12.06
Posted on 31-01-2007 15:30
This is the file scripts...that i have...in

<?php
require_once "maincore.php";
if(isset($album_id) && isNUM($album_id)) {
$result = dbquery(
"SELECT ta.*, tu.user_id,user_name FROM ".$db_prefix."photo_albums ta
LEFT JOIN ".$db_prefix."users tu ON ta.album_user=tu.user_id
WHERE album_id='$album_id'"
);
$data = dbarray($result);
if (!checkgroup($data['album_access'])) {
fallback(BASEDIR."index.php");
} else {
?>
<center>
<form name="PlayForm">
<table>
<tr>
<td><input type="button" onclick="animImageDec();setCurrImage()" value="<<">
<td><input type="button" onclick="startPlayReverse()" value="<< Play">
<td><input type="button" onclick="clearLastUpdate()" value="Stop">
<td><input type="button" onclick="startPlay()" value="Play >>">
<td><input type="button" onclick="animImageInc();setCurrImage()" value=">>">
<td><input type="button" onclick="timeoutValue = parseInt(document.PlayForm.IntervalValue.value)" value="Change Interval >>">
<td><input type="text" name="IntervalValue" style='width:40px;'>milliseconds</td></tr>
</table>

</form>

<?php

echo "<p>";

echo "<span style=\"display:none\">";

$results = dbquery("SELECT * FROM ".$db_prefix."photos WHERE album_id='".$album_id."'");
$rows = dbrows($results);
while ($data = dbarray($results)) {
define("PHOTODIR", PHOTOS.(!SAFEMODE ? "album_".$data['album_id']."/" : ""));
echo "<img src=\"".BASEDIR."gfx.php?full=n&photo_id=".$data['photo_id']."\">\n";
}
echo "</span>";

echo "<img name=\"MainImage\" src=\"".IMAGES."wait.jpg\" border=\"0\">
<script language=\"javascript\">";
$i = 1;
$results2 = dbquery("SELECT * FROM ".$db_prefix."photos WHERE album_id='".$album_id."'");
while ($data = dbarray($results2)) {
define("PHOTODIR", PHOTOS.(!SAFEMODE ? "album_".$data['album_id']."/" : ""));
echo "img".$i." = new Image();\n";
echo "img".$i.".src = \"".BASEDIR."gfx.php?full=n&photo_id=".$data['photo_id']."\";\n";
$i++;
}

echo "imgarray = new Array(".$rows.");";
$i = 1;
$results3 = dbquery("SELECT * FROM ".$db_prefix."photos WHERE album_id='".$album_id."'");
while ($data = dbarray($results3)) {
define("PHOTODIR", PHOTOS.(!SAFEMODE ? "album_".$data['album_id']."/" : ""));
echo "imgarray[".$i."] = new Image();\n";
echo "imgarray[".$i."].src = \"".BASEDIR."gfx.php?full=n&photo_id=".$data['photo_id']."\";\n";
$i++;
}

echo "var timeoutValue = 3000;
var animDelay = 1000;
var numOfImages = ".$rows.";

</script>";

?>


<script language="javascript">
var imageIndex = 0;
var timeoutID = 0;
var playMode = 1;


function animImageInc()
{
if (imageIndex < numOfImages)
imageIndex++
else
imageIndex = 1;
}

function animImageDec()
{
if (imageIndex > 1)
imageIndex--;
else
imageIndex = numOfImages;
}

function setCurrImage()
{
document.MainImage.src = imgarray[imageIndex].src;
}

function updateAnim()
{
var currTimeoutValue;

currTimeoutValue = timeoutValue;

if (playMode == 1)
{
animImageInc();
if (imageIndex == numOfImages)
currTimeoutValue += animDelay;
}
else
{
animImageDec();
if (imageIndex == 1)
currTimeoutValue += animDelay;
}
setCurrImage();
timeoutID = setTimeout("updateAnim()", currTimeoutValue);
}

function clearLastUpdate()
{
clearTimeout(timeoutID);
timeoutID = 0;
}

function startPlay()
{
clearLastUpdate();
playMode = 1;
updateAnim();
}

function startPlayReverse()
{
clearLastUpdate();
playMode = 2;
updateAnim();
}


updateAnim();

</script>


<script language="javascript">
document.PlayForm.IntervalValue.value = timeoutValue;
</script>

<form method="post">
<input type="button" value="Close Window"
onclick="window.close()">
</form>
</center>
<?php
}
} else {
fallback(BASEDIR."index.php");
}
?>





Edit: Use the Code button and not the quote button, so that the forum stays nice and tidy, when pasting pieces of code! :) -Adnan.
Edited by Adnan on 02-02-2007 23:06
wadday@funaadu.com www.fuvahmulah.com Send Private Message
Author RE: Photo gallery Slide show
Adnan
Super Administrator

Posts: 80
Location: Montreal, Canada
Joined: 23.03.06
Posted on 02-02-2007 23:03
Replace your slideshow.php with this one,

<?php
require_once "maincore.php";
define("SAFEMODE", @ini_get("safe_mode") ? true : false);

if(isset($album_id) && isNUM($album_id)) {
$result = dbquery(
"SELECT ta.*, tu.user_id,user_name FROM ".$db_prefix."photo_albums ta
LEFT JOIN ".$db_prefix."users tu ON ta.album_user=tu.user_id
WHERE album_id='$album_id'"
);
$data = dbarray($result);
if (!checkgroup($data['album_access'])) {
fallback(BASEDIR."index.php");
} else {
?>
<body bgcolor="#3BB9FF">
<center>
<form name="PlayForm">
<table>
<tr>
<td><input type="button" onclick="animImageDec();setCurrImage()" value="<<">
<td><input type="button" onclick="startPlayReverse()" value="<< Play">
<td><input type="button" onclick="clearLastUpdate()" value="Stop">
<td><input type="button" onclick="startPlay()" value="Play >>">
<td><input type="button" onclick="animImageInc();setCurrImage()" value=">>">
<td><input type="button" onclick="timeoutValue = parseInt(document.PlayForm.IntervalValue.value)" value="Change Interval >>">
<td><input type="text" name="IntervalValue" style='width:40px;'>milliseconds</td></tr>
</table>

</form>

<?php

echo "<p>";

echo "<span style=\"display:none\">";

$results = dbquery("SELECT * FROM ".$db_prefix."photos WHERE album_id='".$album_id."'");
$rows = dbrows($results);
while ($data = dbarray($results)) {
define("PHOTODIR", PHOTOS.(!SAFEMODE ? "album_".$data['album_id']."/" : ""));
echo "<img src=\"".PHOTODIR.$data['photo_thumb2']."\">\n";
}
echo "</span>";

echo "<img name=\"MainImage\" src=\"".IMAGES."wait.jpg\" border=\"0\">
<script language=\"javascript\">";
$i = 1;
$results2 = dbquery("SELECT * FROM ".$db_prefix."photos WHERE album_id='".$album_id."'");
while ($data = dbarray($results2)) {
define("PHOTODIR", PHOTOS.(!SAFEMODE ? "album_".$data['album_id']."/" : ""));
echo "img".$i." = new Image();\n";
echo "img".$i.".src = \"".PHOTODIR.$data['photo_thumb2']."\";\n";
$i++;
}

echo "imgarray = new Array(".$rows.");";
$i = 1;
$results3 = dbquery("SELECT * FROM ".$db_prefix."photos WHERE album_id='".$album_id."'");
while ($data = dbarray($results3)) {
define("PHOTODIR", PHOTOS.(!SAFEMODE ? "album_".$data['album_id']."/" : ""));
echo "imgarray[".$i."] = new Image();\n";
echo "imgarray[".$i."].src = \"".PHOTODIR.$data['photo_thumb2']."\";\n";
$i++;
}

echo "var timeoutValue = 3000;
var animDelay = 1000;
var numOfImages = ".$rows.";

</script>";

?>


<script language="javascript">
var imageIndex = 0;
var timeoutID = 0;
var playMode = 1;


function animImageInc()
{
if (imageIndex < numOfImages)
imageIndex++
else
imageIndex = 1;
}

function animImageDec()
{
if (imageIndex > 1)
imageIndex--;
else
imageIndex = numOfImages;
}

function setCurrImage()
{
document.MainImage.src = imgarray[imageIndex].src;
}

function updateAnim()
{
var currTimeoutValue;

currTimeoutValue = timeoutValue;

if (playMode == 1)
{
animImageInc();
if (imageIndex == numOfImages)
currTimeoutValue += animDelay;
}
else
{
animImageDec();
if (imageIndex == 1)
currTimeoutValue += animDelay;
}
setCurrImage();
timeoutID = setTimeout("updateAnim()", currTimeoutValue);
}

function clearLastUpdate()
{
clearTimeout(timeoutID);
timeoutID = 0;
}

function startPlay()
{
clearLastUpdate();
playMode = 1;
updateAnim();
}

function startPlayReverse()
{
clearLastUpdate();
playMode = 2;
updateAnim();
}


updateAnim();

</script>


<script language="javascript">
document.PlayForm.IntervalValue.value = timeoutValue;
</script>

<form method="post">
<input type="button" value="Close Window"
onclick="window.close()">
</form>
</center>
</body>
<?php
}
} else {
fallback(BASEDIR."index.php");
}
?>



http://www.theadnanahmed.com Send Private Message
Author Sponsored Link
Advertisement


Location: Internet
Author RE: Photo gallery Slide show
wadday
Member

User Avatar

Posts: 12
Location: Maldives - Island
Joined: 28.12.06
Posted on 03-02-2007 12:43
sorry dear...next time i'll make sure...to use that..thanks for that and thanks for the code...its working now...
wadday@funaadu.com www.fuvahmulah.com Send Private Message
Author RE: Photo gallery Slide show
Adnan
Super Administrator

Posts: 80
Location: Montreal, Canada
Joined: 23.03.06
Posted on 03-02-2007 22:25
Oops ... didn't mean to sound harsh or anything, lol.
http://www.theadnanahmed.com Send Private Message
Jump to Forum:

This site is optimized for viewing with Firefox!
All articles, pictures, and any other material obtained from this site is Copyright © 2007, and may not be reproduced without permission from the author.
Link Exchange - Directory - Windows Hosting