Skip to content

Support Jaipho

Jaipho beta is a free script and we hope that you enjoy using it. If you do, here is a way that you can show us that you appreciate the hard work that we've done for you!





Pipho - PHP image gallery for iPhone

Or, what happens when Jaipho meets PHP.
Although Jaipho is meant to be used as secondary image gallery script, some of my colleagues convinced me that there should be server side solution too. They just wanted to upload photos on server and let the script do everything else.
Pipho is exactly that. It reads photos from desired folder, on the fly creates resized thumbnail and slide images, and dumps Jaipho javascript read images part. In addition, it supports text files as descriptions for both, gallery and slides.

In short, Pipho is a PHP Jaipho implementation example.

If you are making iPhone optimized site, and you already do not have gallery engine on your site, this is perfect solution for you.

Package description

It is PHP5 package written in Zend Framework coding standard, but at this moment it does not requires any class from it. PHP classes are stored in library folder. Two classes are representing the main logic.

Pipho_DeviceInfo holds information about optimal images size for device which accesses the gallery. Right now it holds only iPhone and iPad information. You will also use it to check will user be redirected to Jaipho at all with Pipho_DeviceInfo::isSupported() method.

Pipho_FileManager is a class which have methods for loading photos from your desired folder. It will automatically create best fit thumbnails and slide images from your original photo. Results are returned as Pipho_Image and Pipho_Gallery objects. Pipho_Image class has method getJsReadImage() which will return image data formated as Jaipho Javascript dao.ReadImage() method.

Installation

Unpack download package and upload it to your webserver. Package also contains Jaipho javascript source, what means that it can be used without any additional download.
Ensure that the photos folder (PIPHO_PHOTOS_FOLDER_DESTINATION constant) and all it's sub folders are writable. If this is not a case, Pipho will throw an exception. You can do it by running Linux command "chmod -R 777 photos/" from your webroot or with your ftp client (e.g. WinSCP)
You can test installation with browser on your desktop computer. It is much easier to detect problems than testng with iPhone.

Adding your own photos

1. Upload your photos inside the photos folder PIPHO_PHOTOS_FOLDER. Your photos have to be organized in folders: e.g. photos/mygallery/, photos/vacation/, photos/newimages/... Gallery folder name is used as gallery_id value. Photos folder should be inside your webroot folder. In other words, the photos should be accessible with your web browser. E.g. www.mysite.com/photos/mygallery/image.jpg
2. Add description file in each folder. It should be always named _gallery.txt. First line is a title, and all other lines are considered as gallery description. Gallery description is not used at the moment. This is optional step. If you skip it, gallery name will be set as it folder name.
3. You can add titles and description for your images. Just add txt filename with the same name as image has (for myimage.jpg, add myimage.txt). First line is image title, and all other is description (same as gallery description file).

Watching galleries for the first time

In the moment when you try to see gallery with your browser, Pipho will check do the thumbnails and slides exists, and if they don't it will resize them on the fly.
It can be time consuming operation and there are two errors that PHP might throw.
- Fatal error: Maximum execution time of 30 seconds exceeded. You can increase execution time with PHP function set_time_limit ( int $seconds ).
- Fatal error: Allowed memory size of 33554432 bytes exhausted. This might happened if your photos are few MByets large. You can increase allowed memory for script with ini_set("memory_limit","64M")

Both of this functions should be added at the beginning of script where Pipho is implemented (index.php in downloaded package). It's recommended that you try all your galleries by yourself first, and after all thumbs and slides are created, you can remove those two functions.

Configuration

At the beginning of index.php is set of constants which you can change to accomplish your particular needs.

PIPHO_PHOTOS_FOLDER - holds a path to your source photos folder. Since Pipho 1.02 this folder does not have to be inside your webroot
PIPHO_PHOTOS_FOLDER_DESTINATION - holds a path to your destination photos folder. This folder will be used to display images by web browser (iPhone, iPad...) and it has to be somewhere in webroot
PIPHO_JAIPHO_THEME - sets the folder where is css file. By default you can set it to Themes/Default or Themes/iUI
PIPHO_FORCE_WRITE - if set to true, the image resizing will be called on every page load, no matter if the resized images already exists. Use it only for debugging.
PIPHO_SLIDE_RESIZE_ENABLED - if you already have optimal resized images for usage on iPhone, you can turn off resizing engine by setting this const to false. Otherwise, if enabled, your images can be downgraded in quality.

PIPHO_SORT_IMAGES_ENABLED - turn on or off sort order in which the images will be shown.
PIPHO_SORT_IMAGES_SORT_TYPE - as there are different types of sorting here you can set which particular type you need. For possible values you can check at http://www.php.net/manual/en/array.constants.php
PIPHO_SORT_IMAGES_REVERSE - set it to true if for any reason you need the reverse order

PIPHO_SORT_GALLERIES_ENABLED - same as the IMAGES version, with only difference that it affects the order in galleries list.
PIPHO_SORT_GALLERIES_SORT_TYPE - same as the IMAGES version
PIPHO_SORT_GALLERIES_REVERSE - same as the IMAGES version

Please note few more things
- PHP GD library has to be installed on your server. If it is not, you'll PHP will throw error "Call to undefined function imagecreatefromjpeg()"
- Pipho requires PHP 5. Otherwise, php will throw error with text "syntax error, unexpected '{'"

Comments

Subfolder support?

November 20, 2012 by Rob (not verified), 26 weeks 4 days ago
Comment id: 2261

Any plans to ever add support for sub folders?
I have my Halloween party photos sorted by year, and it would be great to be able to point to the root and have the year folders displayed first

2010 Halloween
-- Contest
-- Creatures
-- Horror
2011 Halloween
-- Contest
-- Creatures
-- Horror
2012 Halloween
-- Contest
-- Creatures
-- Horror

No subfolders

November 21, 2012 by Tole, 26 weeks 4 days ago
Comment id: 2263

No, I do not plan to support subfolders in close future. Right now, the focus is on adding new Jaipho features (zoom for example).

Message UIwebview when thumbnail clicked

June 27, 2012 by Rob (not verified), 47 weeks 4 days ago
Comment id: 831

I noticed when you click a thumbnail - (BOOL)webView: shouldStartLoadWithRequest: navigationType: is not fired. I am going to attempt to fix the situation but I was wondering if this is already implemented? I have your gallery in a UIwebview.

Also thanks for the work! Its amazing!

RE: Message UIwebview when thumbnail clicked

July 6, 2012 by Tole, 46 weeks 2 days ago
Comment id: 847

Sorry on delayed answer.
I do not have experience with UIwebview and objective C, but I guess that there is no such event because there is no page load. Thumbs and slider view are just two divs, and there is no additional requests in between.

This ROCKS!

May 3, 2012 by Ryan (not verified), 1 year 3 weeks ago
Comment id: 739

Man I have been struggling with an easy to use way to get photo albums in my apps. I was adding pics one by one (taking over a minute each)!!

Now I just create a new folder, upload the pics to my server, and link to the gallery id via iframe!

SICK!

5 million gold stars!

open page in slideshow at defined image

November 28, 2011 by serialchick (not verified), 1 year 25 weeks ago
Comment id: 630

Hey,
this code is awesome, but I'm having trouble with the Start Modes. I want to be able to click on a link and go to a certain image in the slide show. I know it can do this because it's basically what the thumbs do when you click them, I'm just not sure of the syntax you used or what I need to code.
Thanks,

RE: open page in slideshow at defined image

November 29, 2011 by Tole, 1 year 25 weeks ago
Comment id: 631

Just add an index of desired image to your link. Let's say that your normal link looks like jaipho/index.php, if you want to to open the second slide the link should be jaipho/index.php#1, if you want to start with 10th slide it should be jaipho/index.php#9, and so on.
It is usual in programming that the indexes are starting from 0 (0 stands for 1st item in collection)

Fatal error: Maximum

August 11, 2011 by Lazaros (not verified), 1 year 41 weeks ago
Comment id: 561

Fatal error: Maximum execution time of 30 seconds exceeded in

probable somewhere is one settings to stop load after 30 sec..

anyone know where is?

hello, i ve problem...in my

November 21, 2011 by dasky (not verified), 1 year 26 weeks ago
Comment id: 626

hello, i ve problem...in my first domain, in the "public" folder work, ive try with another domain and when i open the page it say me this:

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, webmaster@meet-trans.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

the folder heve permission 777...:(((
what can be the problem???

Php and apache settings

November 23, 2011 by Tole, 1 year 26 weeks ago
Comment id: 628

Well, there can be several reasons - gd library missing, php4 (php5 is required).
But, first you have to be able to see the real error which was thrown. The text you pasted looks like predefined error page.
Maybe it would be good idea to contact technical support on your problematic server.

RE: Fatal error: Maximum

August 12, 2011 by Tole, 1 year 41 weeks ago
Comment id: 564

This is a feature, not a bug ;)

OK, what happened? Pipho was resizing the images and it can be a very consuming operation. Especially if you have large gallery.
After you see that message, you have to open the same url again. And again until all images are resized.

In the future, I plan to fix this issue.

kind of a bug then if it

October 9, 2011 by Dave (not verified), 1 year 32 weeks ago
Comment id: 591

kind of a bug then if it needs fixed lol certainly not a feature

Help with multiple galleries!!!

August 11, 2011 by Ed583 (not verified), 1 year 41 weeks ago
Comment id: 559

Hi,

I have very little experience with PHP. I have multiple galleries organized as follows:

photos/gallery1
photos/gallery1/gallery1a
photos/gallery2
photos/gallery2/gallery2a

etc...

If I edit the "test" value of gallery _id in index.php, I can only get one gallery to show. Is there a way to view the list of galleries and navigate among them to view each one, or do I have to view each one using a separate URL (and separate index.php file)?
If there's a solution can you post the specific code example? Thanks!!!

RE: Help with multiple galleries!!!

August 11, 2011 by Tole, 1 year 41 weeks ago
Comment id: 560

Well, besides index.php (used to display selected gallery), there is also a list.php which displays all galleries found at /photos folder. You also have a "Back" button on thumbnails view which should lead you to a list.php.
Basically, when you download and start Pipho, everything should work OK. Just upload your galleries in photos folder.

Well, there is one issue regarding your galleries. Pipho can not handle nested galleries, so your structure should look like this:

photos/gallery1
photos/gallery1a
photos/gallery2
photos/gallery2a
.....

Thanks for the quick reply.

August 11, 2011 by Ed583 (not verified), 1 year 41 weeks ago
Comment id: 562

Thanks for the quick reply. When I hit the Back button, I get the following error:
"Fatal error: Class 'Pipho_ItemNotExistsException' not found in /home/epctrad1/public_html/gallery/library/Pipho/FileManager.php on line 151"

Am I missing some settings in FileManager.php?

Empty gallery bug

August 12, 2011 by Tole, 1 year 41 weeks ago
Comment id: 565

The reason is the empty folder which is placed in your photos directory. Just remove it and everything will be OK.

Bug that I mentioned in title is that there is missing require_once at the top of the FileManager. Just add to the top of the file this line.

require_once 'Pipho/ItemNotExistsException.php';

Now in that case it will not work anyway, but you'll see more informative error message.

getelementbyid current-display image

August 5, 2011 by Lazaros (not verified), 1 year 42 weeks ago
Comment id: 556

how i can get id or url for image to display now-current image?

Current image

August 5, 2011 by Tole, 1 year 42 weeks ago
Comment id: 557

There is a reference to a current slide inside slider object. If you are trying to refernce it from outside the Jaipho you should try something like:

 var src = app.mrSlider.mrCurrentSlide.mrImage.mSrc;

where the object types are
mrSlider is JphSlider_Slider
mrCurrentSlide is JphSlider_Slide
mrImage is Jph_Image

Consider also to place your adaptations to JphSlider_Behavior object. It is a place which defines all user interactions.

Using WpTouch or How To Pipho with Wordpress

June 15, 2011 by rudolf (not verified), 1 year 49 weeks ago
Comment id: 532

How to redirect Wptouch to Pipho and serve all the images attached to a post/page

Requirements:
- the post/page must have a Custom Field named "wpipho" with any value in it
- folder structure as in "domain.com/wordpress" and "domain.com/pipho" , or modify scripts

Steps:
1. REDIRECTING WPTOUCH TO PIPHO
Add the following to the very beginning of /wordpress/wp-content/plugins/wptouch/themes/default/header.php and modify "domain.com" to yours:

global $post;
$cft = get_post_meta($post->ID, 'wpipho', true);
$go = "http://domain.com/pipho/";
if ($cft && (stristr($_SERVER['HTTP_USER_AGENT'],'iPhone')
 || stristr($_SERVER['HTTP_USER_AGENT'],'iPod')
 || stristr($_SERVER['HTTP_USER_AGENT'],'iPad'))) header( 'Location: '. $go . '?post='.$post->ID );

2. CONNECT PIPHO TO WORPRESS AND GET POST ID
Add the following to the beginning of /pipho/index.php:

require_once "../wordpress/wp-blog-header.php";
$ID = $_GET['post'];

(in the next steps keep editing /pipho/index.php)

3. CHANGING THE BACK BUTTON, AS WE HAVE NO PIPHO GALLERIES LIST
Locate this link href="list.php" around line 100 and change to:
<a class="button" href="javascript:history.back()" >

4. CHANGING THE TITLE OF THE GALLERY TO THE TITLE OF THE POST
In the lines just after the previous step, delete echo $gallery->title and put:

$our_post = get_post($ID);
echo $our_post->post_title;

5. DISPLAYING OUR WORDPRESS POST GALLERY (Caption and Description of each image will be used as Title and Description)
Around line 180, locate and delete the following lines:

foreach ($images as $image)
        {
                echo $image->getJsReadImage(); 
        }

insert this ones:
$count = 0;
$results = get_children( array(
        'post_parent' => $ID,
        'post_status' => 'inherit',
        'post_type' => 'attachment',
        'post_mime_type' => 'image',
        'order' => 'ASC',
        'orderby' => 'menu_order') );
foreach ( $results as $image )
{
        $thumb=wp_get_attachment_image_src( $image->ID, 'thumbnail' );
        echo "dao.ReadImage( ".$count.",'".$image->guid."','".$thumb[0]."','".$image->post_excerpt."','".$image->post_content."');"."\r\n";
        $count++;
}

END OF HOW TO

in case of doubts or customization requests, drop me an email (haven't seen Subscribe to Comments or RSS for this Jaipho page...¿?)
good luck :o)

But, what do you need to include in the post?

June 16, 2011 by cgvarela (not verified), 1 year 49 weeks ago
Comment id: 535

But, what do you need to include in the post?
Can you give us an example, please?
And with the wpipho filed too, please?

editing image folders

May 21, 2011 by Mark (not verified), 2 years 6 days ago
Comment id: 514

Hey,

First off, thank you so much for this script, it's really amazing!

I'm having some problems if I edit a gallery folder. If I remove an image my deleting it from the folder I get the following message

Failed to read image size [photos/2007_b/.DS_Store]

I'm pretty sure that once the site I'm trying to put together goes live, I will want to edit the images in the galleries. Is there a specific way that you are meant to remove images?

RE: editing image folders

May 22, 2011 by Tole, 2 years 4 days ago
Comment id: 515

In Pipho_FileManager class there is a $skipList property which contains the filenames which OS, or some other applications generate in ones image folders. Just add .DS_Store to a list.

RE: editing image folders

September 21, 2011 by pv (not verified), 1 year 35 weeks ago
Comment id: 584

it works when you lower it to -> '.ds_store'
maybe Tole can skip all hidden files (starting with a point)
thnx for the work
pv

can't handle '?' or single quote in file names

May 7, 2011 by Chris (not verified), 2 years 2 weeks ago
Comment id: 507

Some of my pictures have the '?' character in the filename, this causes pipho/jaipho to fail to display them. It's a urlencoding issue. In _createImage() I ran the returned values for $image_path, $image->urlThumb, and $image->urlSlide through a function that encodes '?' as %3F. Doing the full php urlencode() didn't work, but I didn't investigate much further.

Images with a single quote in the filename fail also. In that same encoding function, I used the php addslashes() function. Seems to have cured that problem.

Sorry I don't have a good patch for you, but hope this helps.

handle movie file in gallery?

May 3, 2011 by Chris (not verified), 2 years 3 weeks ago
Comment id: 503

What's the best thing to do with movie files (.mov files) in a gallery folder? Right now pipho/jaipho fails with an error 'failed to read image size'.

I think I can modify jaipho js to ignore the movie files, but is there a way to be able to play them through jaipho?

thanks

RE: handle movie file in gallery?

May 5, 2011 by Tole, 2 years 3 weeks ago
Comment id: 505

Sorry, videos are not supported right now.

Hey, thanks for the awsome

March 22, 2011 by Anonymous (not verified), 2 years 9 weeks ago
Comment id: 475

Hey, thanks for the awsome work, great for my home server,
one problem but- I can't zoom into photos. I tend to have large pics, which I can zoom into to read stuff (music tabliture mostly...). Is there a way have the full sized image on the page, with the page controls in the same place, witch you can zoom into and move around and such?
thanks.

No zoom support yet

March 22, 2011 by Tole, 2 years 9 weeks ago
Comment id: 477

Sorry, there is no zoom support yet, and there is no already written easy solution.

deleting 'resized' folder

March 2, 2011 by acquiesce (not verified), 2 years 12 weeks ago
Comment id: 442

hi there, any inputs here that once the resized is created, is there a way to remove this folder for housekeeping? i'm having problem in setting the permission. does his relates to the server settings? Thanks.

multiple galleries

March 1, 2011 by acquiesce (not verified), 2 years 12 weeks ago
Comment id: 439

hi there,

i'm trying to build multiple galleries like mentioned above

photos/mygallery/, photos/vacation/, photos/newimages

however i always gets back to having to set the photos/test and only one gallaery been created.

any idea?

multiple galleries.

March 2, 2011 by acquiesce (not verified), 2 years 12 weeks ago
Comment id: 443

apparently i re-test this and it works by just adding in new folders under /photos
strange it didnt work yesterday.

multiple galleries.

March 2, 2011 by acquiesce (not verified), 2 years 12 weeks ago
Comment id: 441

fixed. duplicated the index.php, rename it to index2.php and edit the 'test' gallery constant. Cool.

i found this command at

March 2, 2011 by acquiesce (not verified), 2 years 12 weeks ago
Comment id: 440

i found this command at index.php

$gallery_id = isset( $_GET['gallery_id']) ? $_GET['gallery_id'] : 'test';

apparently the gallery are hardcoded. how do i g about craeting multiple galleries?
sorry not really a programmer person :)

Default gallery

March 3, 2011 by Tole, 2 years 12 weeks ago
Comment id: 447

This 'test' thing is actually a default selection - this gallery will be displayed if somebody calls your script directly (e.g. index.php). Otherwise, when the script is called from galley listing (list.php) the gallery_id is populated with passed value (e.g. index.php?gallery_id=mygallery).

I'll have to put few more comments on this in source code ;)

start from list.php

November 17, 2011 by dasky (not verified), 1 year 27 weeks ago
Comment id: 623

hi, great work
how want to know if is possible start form list.php
i've try to remove "test" folder and set
$gallery_id =isset( $_GET['gallery_id']) ? $_GET['gallery_id'] : '';
but this not work.
it giveme back this error:
"Could not load first image. Gallery [resized] has no images."

i need this becouse the folder in the photos dir will change name always
is possible???
thanks

RE: start from list.php

November 18, 2011 by Tole, 1 year 27 weeks ago
Comment id: 624

Just rename it to index.php, and the other one to something else (gallery.php, jaipho.php ...)
Accordingly, change the links between them. The easiest way is to search for the name in your text (or php) editor for them.
All the changes are in those two html files index and list.

great thanks very very

November 21, 2011 by dasky (not verified), 1 year 26 weeks ago
Comment id: 625

great thanks very very much...:))))

Javascript Swipe Speed

January 10, 2011 by CoryR (not verified), 2 years 19 weeks ago
Comment id: 391

Hello,
Thanks for such a cool script. Is there a way to change the speed that the swipe effect occurs when viewing photos in the slide show view? I need it to be more responsive.

RE: Javascript Swipe Speed

January 11, 2011 by Tole, 2 years 19 weeks ago
Comment id: 393

Swipe speed is configured through the SLIDE_SCROLL_DURATION javascript variable. This and all other options are listed at http://www.jaipho.com/content/jaipho-configuration

List.php Page is Blank

December 27, 2010 by CRobbins (not verified), 2 years 21 weeks ago
Comment id: 377

Hello,
First, thanks for such an awesome program. This is saving me a ton of time. I have a bit of an issue however. For some reason, my list.php page comes up blank when it is accessed from a browser. The index.php file is beautiful, but I'm assuming that an error is occuring rather soon in the script for list.php, as it just displays the address in the title bar.

I deleted the "test" directory, but I placed two other folders with the proper _gallery.txt files inside of them, so I'm not sure why the list.php file would stop functioning.

Thanks again!

RE: List.php Page is Blank

December 27, 2010 by Tole, 2 years 21 weeks ago
Comment id: 378

Please try to set display_errors on in php. I guess that there is some php error behind your problem.

Blank Page Gone, but Having Trouble Sorting

December 30, 2010 by CRobbins (not verified), 2 years 21 weeks ago
Comment id: 382

No php error is present. For some reason, I can't export a picture from iPhoto into the photo directory. I'm not sure if it is because of the embedded camera info or what. Regardless exporting from iPhoto causes the page to blank out until the offending picture(s) is(are) removed. It is annoying to have to edit the pictures first, but I will live.

I would like to be able to sort the images by modification date though. I am able to use the normal php sort flags like SORT_NUMERIC, SORT_ASC, and SORT_DESC, but I haven't figured out how to make the images sort by date. Due to the upload script I am using, all of my images start with a random number, so pictures are always in some sort of numerical order.

Help with that would be great if you have the time. Thanks again for the awesome scripts.

RE: Blank Page Gone, but Having Trouble Sorting

December 31, 2010 by Tole, 2 years 21 weeks ago
Comment id: 384

I still don't understand the embedded camera info issue.

Regarding the sort issue, here is the copy/paste from a mail conversation on the same matter.

Yes, there is no such sort type. But this is another one interesting feature that you need.
To sort by date, you should follow this few steps:

1. Open the class Pipho_FileManager
2. add at the end this function

        function filemtime_pipho( $file)
        {
            return filemtime( PIPHO_PHOTOS_FOLDER.'/'.$file);
        }

3. replace this for gallery list sort
        if (PIPHO_SORT_GALLERIES_ENABLED)
        {
            if (PIPHO_SORT_GALLERIES_REVERSE)
                rsort( $folders, PIPHO_SORT_GALLERIES_SORT_TYPE);
            else
                sort( $folders, PIPHO_SORT_GALLERIES_SORT_TYPE);  
        }

with
array_multisort( array_map('filemtime_pipho', $folders), SORT_ASC, $folders);

4. replace this for gallery images sort
        if (PIPHO_SORT_IMAGES_ENABLED)
        {
            if (PIPHO_SORT_IMAGES_REVERSE)
                rsort( $images, PIPHO_SORT_IMAGES_SORT_TYPE);
            else
                sort( $images, PIPHO_SORT_IMAGES_SORT_TYPE);  
        }

with
array_multisort( array_map('filemtime_pipho', $images), SORT_ASC, $images);

I don't understand the camera

January 11, 2011 by CRobbins (not verified), 2 years 19 weeks ago
Comment id: 392

I don't understand the camera info issue either. I just know that if I export from iPhoto, the photos have information attached to it, and pipho isn't able to read them as a normal image file.

My gallery uses two folders, "official" and "submitted," for storage, both are inside the photos directory.
When I try to implement the sorting feature you linked to, I get a php warning:
Warning: filemtime() [function.filemtime]: stat failed for photos/1.jpg at ...

I receive this once per image in the photos subdirectories. If I change the value:
return filemtime( PIPHO_PHOTOS_FOLDER.'/'.$file);

to
return filemtime( PIPHO_PHOTOS_FOLDER.'/submitted/'.$file);

I remove the error for all of the images in the "submitted" folder, and only receive the error for the images in the "official" folder.

Even without errors, the images do not show up according to modification date; they appear in a completely random order.

I am REALLY confused.

RE: I don't understand the camera

January 11, 2011 by Tole, 2 years 19 weeks ago
Comment id: 394

It seems that filemtime_pipho() example works only in folders case. It is because the folders array is populated with full folder paths and the filemtime() can get the time.
On the other hand, images array contains only image filenames which are useless for file functions.
So you should use some modified filemtime_pipho() function which will has the path information too.

jqtouch & nested folders

November 2, 2010 by mgood (not verified), 2 years 29 weeks ago
Comment id: 347

I just wanted to check in to see if anyone has found a successful way to integrate jaipho and pipho with jqtouch? I'm also looking to see if anyone has found a successful way to have nested folders as well!
Any help would be greatly appreciated!
Cheers!
Mike

Skip / Ignore List

November 1, 2010 by Corn (not verified), 2 years 29 weeks ago
Comment id: 346

Thanks for your effort on this - I have a home server of family images that we can now browse on the ipad - the one issue I'm running into is that my galley folder include files I want to ignore e.g. PSDs and AVIs.

I can see your skiplist function but how to I add a wilcard to this array '*.avi' does not work.

Thanks in advance for any help with this

RE: Skip / Ignore List

November 2, 2010 by Tole, 2 years 29 weeks ago
Comment id: 348

In php class Pipho_FileManager there is an property $skipList. Just add your entries in it (e.g. '.avi', '.psd').
If you need more complex skip logic, you can do it in _isValidFile() method.

extension doesn't work

May 25, 2011 by Mike Parker (not verified), 2 years 2 days ago
Comment id: 518

Hello,

Wonderful gallery! I tried adding '.php' and '.xml' to the skip array in FileManager and it does not work. If I enter the full filename ex: 'photos.xml' it works. Is there any way to make it ignore all files of a certain extension? currently I have to add around 15 entries to each gallery.

Thank you!
Mike

How to skip non image files

May 25, 2011 by Tole, 2 years 1 day ago
Comment id: 521

Yes, the $skipList property in Pipho_FileManager contains only full filanemes to skip.

Checking is done in _isValidFile() method, and you should add your cases to that method.
Here is an example how you can fix it.

protected function _isValidFile( $filename)
{              
        if (in_array( strtolower( $filename), $this->skipList))
                return false;
        if (strpos( $filename, '.ext') !== false)
                return false;
        if (strpos( $filename, '.ext2') !== false)
                return false;
        // ...
        return true;
}