Support Forum Softcomplex logo
About Us  | Services  | Download  | Order  | Support  | |
| Search | Today's Posts | Stats | Board Rules | Not logged in [ Login | Register ]
go to bottom
Last active: Never

Printable Version | Subscribe | Add to Favourites   Post new thread
Author: Subject: PHP code within Tigra Scroller
fohanlon
Junior Member

Posts: 2
Registered: 3/23/2005
Location: Ireland
Member Is Offline
posted on 3/23/2005 at 12:18 AM Reply With Quote
PHP code within Tigra Scroller


Hi,

I have searched your forum and downloaded the .zip file that contains the scroll.html and scroll.tpl1.php files.

However, I wish to query a directory of images.

Ideally I would like something along the following code to appear between the <?php ?> tags:

<?php
require("../config.php");
$handle = opendir("/var/www/html/images/weddings_images/");
$pics = array();
$count = 0;

while(($file = readdir($handle)) != false)
{
if(strtolower(substr($file, -4)) == ".jpg" || strtolower(substr($file, -4)) == ".gif" || strtolower(substr($file, -4)) == ".png")
{
$pics[$count] = $file;
$count++;
}
}
closedir($handle);
sort($pics);

echo "<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr bgcolor="#000000">";

$i = 0;
while($i < $count) {

echo "<td valign="middle" align="center"><img hspace="0" src="../../images/weddings_images/$pics[$i]; "></td>";

$i++;
}

echo "</tr></table>";

However, I am having difficulty understanding your line of php etc.

<?php echo "'<b><center>Tigra Scroller Advantages</center></b>'"?>

in so far as:

Does all php have to be echo between ' '

Any variants I try and I get the undefined main line 2 error.

Any examples of implementing mysql queries in your scroller would be greatly appreciated.

Thanks for your help

Fergal.
View User's Profile View All Posts By User U2U Member
rock
Moderator

Posts: 687
Registered: 4/15/2003
Member Is Offline
posted on 3/23/2005 at 03:29 PM Reply With Quote

What forum topic do you mean?
View User's Profile View All Posts By User U2U Member
fohanlon
Junior Member

Posts: 2
Registered: 3/23/2005
Location: Ireland
Member Is Offline
posted on 3/23/2005 at 03:50 PM Reply With Quote

Hi Rock,

Its at http://www.softcomplex.com/forum/viewthread_537/

and it was written by yourself with following reply:

scroll.html changes are:
document.write("<script language='javascript' src='scroll.tpl" + n_id + ".php'><\/script><link rel='stylesheet' href='scroll" + n_id + ".css'>")

instead of

document.write("<script language='javascript' src='scroll.tpl" + n_id + ".js'><\/script><link rel='stylesheet' href='scroll" + n_id + ".css'>")

You could find modified scroll.html (v1.5) and tpl.php sample in the attachment.

Attachment: ts_files.zip (3kb)

Fergal.
View User's Profile View All Posts By User U2U Member
rock
Moderator

Posts: 687
Registered: 4/15/2003
Member Is Offline
posted on 3/23/2005 at 04:36 PM Reply With Quote

Quote:
Originally posted by fohanlon
However, I am having difficulty understanding your line of php etc.

<?php echo "'<b><center>Tigra Scroller Advantages</center></b>'"?>

in so far as:

Does all php have to be echo between ' '

Direct content should be valid JS string to be accepted, so you need to enclose the html with qouta or double quota signs and even escape the output if needed.
View User's Profile View All Posts By User U2U Member
Post new thread

Related Links:
Product Page
Product Demonstrations Live Demos:
Multiple vertical scrolling
Horizontal scrolling
Free Download Free Download
Product Documentation Documentation:
Documenation Page
Change Log
Support Forum Technical Support
Support Forum
   

Go To Top


Powered by XMB 1.9.1 Nexus
Developed By Aventure Media & The XMB Group © 2002-2004