Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 10-09-2012, 08:43 PM   PM User | #1
pollardhimself
New Coder

 
Join Date: Feb 2009
Posts: 85
Thanks: 3
Thanked 0 Times in 0 Posts
pollardhimself is an unknown quantity at this point
Embed-able php photogallery that grabs a images in a dir.

I really like the look of Pagemap Imagewall However I don't have a lot of php experience, this has trouble with images, and I don't know how to embed it into my website.

I've been looking for a long time for something that can
  • Handle images over 5 mb
  • Easily Embedded into a existing .php page
  • Creates Thumbnails of images
  • Grabs all image from a directory folder


Trying to get it embedded into this page
pollardhimself is offline   Reply With Quote
Old 10-09-2012, 09:27 PM   PM User | #2
nigel12
New to the CF scene

 
Join Date: Oct 2012
Location: Birmingham
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
nigel12 is an unknown quantity at this point
Hi, I myself use the below code, what it does is this.
I allow people to upload images in to a directory,
All images in that directory get displayed on a webpage 1 at a time I have set a timer to 4 seconds.

So create a php file make sure it is empty then add the following code to it. You can see in the code below the php file is called getimages.php do not change any code in the file below you need to put this code in the same folder as your images.


PHP Code:
<?
//PHP SCRIPT: getimages.php
Header("content-type: application/x-javascript");

//This function gets the file names of all images in the current directory
//and ouputs them as a JavaScript array
function returnimages($dirname=".") {
$pattern="(\.jpg$)|(\.png$)|(\.jpeg$)|(\.gif$)"//valid image extensions
$files = array();
$curimage=0;
if(
$handle opendir($dirname)) {
while(
false !== ($file readdir($handle))){
if(
eregi($pattern$file)){ //if this file is a valid image
//Output it as a JavaScript array element
echo 'galleryarray['.$curimage.']="'.$file .'";';
$curimage++;
}
}

closedir($handle);
}
return(
$files);
}

echo 
'var galleryarray=new Array();'//Define array in JavaScript
returnimages() //Output the array elements containing the image file names
?>
The next part is the code we need to place in the document where we want the images to display. I myself have created a table on the page where I want my images to display and put this code in to that. Now the code below you will need to change some info. So remember where I have used "pics" that is because the directory where my images are stored is called "pics" without the quotes. You would need to change that to the name of your directory.


PHP Code:
<script src="pics/getimages.php"></script>

<script type="text/javascript">

var curimg=0
function rotateimages(){
document.getElementById("slideshow").setAttribute("src", "pics/"+galleryarray[curimg])
curimg=(curimg<galleryarray.length-1)? curimg+1 : 0
}

window.onload=function(){
setInterval("rotateimages()", 4500)
}
</script>

<div style="width: 125px; height: 125px">
<img id="slideshow" src="pics/bear.gif" /></div> 
If I have got the wrong idea about what you want take no notice of me
oh one last thing the very last line of code you see above looks like

<img id="slideshow" src="pics/bear.gif" /></div>

You will see I have specified the name of a particular gif image that is because my slide show will always start with that image

Last edited by nigel12; 10-09-2012 at 09:30 PM..
nigel12 is offline   Reply With Quote
Old 10-10-2012, 12:09 AM   PM User | #3
DrDOS
Senior Coder

 
Join Date: Sep 2010
Posts: 1,155
Thanks: 10
Thanked 148 Times in 148 Posts
DrDOS is infamous around these parts
What kind of image processing software is on the machine, it's usually GD
, which I'm not keen on because it uses fixed code, or Imagemagick, which is easier to code and more flexible, but requires shell access for most uses, you can use perl libraries though? That will determine how much of the code is written.
DrDOS is offline   Reply With Quote
Old 10-10-2012, 08:24 PM   PM User | #4
pollardhimself
New Coder

 
Join Date: Feb 2009
Posts: 85
Thanks: 3
Thanked 0 Times in 0 Posts
pollardhimself is an unknown quantity at this point
Quote:
nigel12
I wasn't really looking for a slide show wanted more of a image gallery that creates thumbnails for all the images in a directory and displays them on my existing page.


And it doesn't seem to like anything over 5Mb either

Anyway to modify the Pagemap Imagewall to allow it to be embedded into my webpage and make it handle images over 5mb

Last edited by pollardhimself; 10-10-2012 at 08:26 PM..
pollardhimself is offline   Reply With Quote
Old 10-10-2012, 08:32 PM   PM User | #5
pollardhimself
New Coder

 
Join Date: Feb 2009
Posts: 85
Thanks: 3
Thanked 0 Times in 0 Posts
pollardhimself is an unknown quantity at this point
Quote:
Originally Posted by DrDOS View Post
What kind of image processing software is on the machine, it's usually GD
, which I'm not keen on because it uses fixed code, or Imagemagick, which is easier to code and more flexible, but requires shell access for most uses, you can use perl libraries though? That will determine how much of the code is written.
Its hosted at hostmonster.com
pollardhimself is offline   Reply With Quote
Old 10-10-2012, 09:44 PM   PM User | #6
LJackson
Senior Coder

 
Join Date: Jun 2008
Location: Cornwall
Posts: 1,973
Thanks: 289
Thanked 12 Times in 12 Posts
LJackson is on a distinguished road
dunno if this is the sort of thing you are after
http://webcheatsheet.com/php/create_...ail_images.php
__________________
Kernow Connect: Online Shopping, Price Comparison, Maximum Savings On Top UK Stores
Follow Us On: Twitter | Facebook
LJackson is offline   Reply With Quote
Old 10-11-2012, 12:06 AM   PM User | #7
DrDOS
Senior Coder

 
Join Date: Sep 2010
Posts: 1,155
Thanks: 10
Thanked 148 Times in 148 Posts
DrDOS is infamous around these parts
Quote:
Originally Posted by pollardhimself View Post
Its hosted at hostmonster.com
It says photogaleries/coppermine

I don't see anything else. Coppermine is nice, might have something you can use.
DrDOS is offline   Reply With Quote
Old 10-11-2012, 03:36 PM   PM User | #8
pollardhimself
New Coder

 
Join Date: Feb 2009
Posts: 85
Thanks: 3
Thanked 0 Times in 0 Posts
pollardhimself is an unknown quantity at this point
Quote:
Originally Posted by DrDOS View Post
It says photogaleries/coppermine

I don't see anything else. Coppermine is nice, might have something you can use.
Yeah they have some built in scripts, nothing that I liked
pollardhimself is offline   Reply With Quote
Old 10-11-2012, 04:25 PM   PM User | #9
DrDOS
Senior Coder

 
Join Date: Sep 2010
Posts: 1,155
Thanks: 10
Thanked 148 Times in 148 Posts
DrDOS is infamous around these parts
Quote:
Originally Posted by pollardhimself View Post
Yeah they have some built in scripts, nothing that I liked
Do their scripts indicate that they are using GD or Imagemagick?
You may be able to use direct access.
DrDOS is offline   Reply With Quote
Old 10-12-2012, 02:04 PM   PM User | #10
pollardhimself
New Coder

 
Join Date: Feb 2009
Posts: 85
Thanks: 3
Thanked 0 Times in 0 Posts
pollardhimself is an unknown quantity at this point
Quote:
Originally Posted by DrDOS View Post
Do their scripts indicate that they are using GD or Imagemagick?
You may be able to use direct access.
Looks like imagemagick is... what will this do for me?

https://my.hostmonster.com/cgi/help/imagemagick




http://nishantsoni.in/how-to-install...h-centos.html/

Last edited by pollardhimself; 10-12-2012 at 02:06 PM..
pollardhimself is offline   Reply With Quote
Old 10-12-2012, 05:55 PM   PM User | #11
DrDOS
Senior Coder

 
Join Date: Sep 2010
Posts: 1,155
Thanks: 10
Thanked 148 Times in 148 Posts
DrDOS is infamous around these parts
Quote:
Originally Posted by pollardhimself View Post
I would go with Imagemagick since it is easier to code for. I see that they have convert, do they have any of the other applications, identify, mogrify, etc. ? Do you have shell access or do you have to use magickwand? I'm not familiar with it. Shell access is very easy, you just write a php script for it, it calls the BASH shell to run the script. You have a bit of learning to do, but you will be rewarded with a great deal of power over image processing. Imagemagick has a very good website.
DrDOS is offline   Reply With Quote
Old 10-22-2012, 06:44 PM   PM User | #12
pollardhimself
New Coder

 
Join Date: Feb 2009
Posts: 85
Thanks: 3
Thanked 0 Times in 0 Posts
pollardhimself is an unknown quantity at this point
Just wanted to share if anyone was looking for the same thing I found a awesome on that does more than I even wanted!

Handles large images
Embed-able
Will grab images out of a dir
Has admin panel with tons of options


KoschtIT Image Gallery
pollardhimself is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 01:30 AM.


Advertisement
Log in to turn off these ads.