View Full Version : Multiple Photos with Height and Width properties?
James Costa
06-22-2008, 08:14 AM
Anyone know how I can get multiple photos on one page with the <IMAGE_HEIGHT> and <IMAGE_WIDTH> tags compatible?
Thanks,
James
Dkozikowski
06-22-2008, 08:20 AM
http://www.pixelpost.org/extend/addons/multiphoto/ ?
James Costa
06-22-2008, 08:33 AM
I'm using that, but it doesn't support those tags. Even if someone could tell me the row that the width and height of images are put it (e.g. the row that <IMAGE_HEIGHT> outputs) I might be able to make my stuff work...
James Costa
06-22-2008, 08:38 AM
In multipost.php in said addon it has something that basically grabs the content from the rows of the tables and uses it as the tags (same as PP does). I was thinking that...
$temp = str_replace("<IMAGE_WIDTH>",$row['image_width'],$temp);
image_width being the row that the image width is placed in for each image.
Would this work? Any suggestions on how it could?
Dkozikowski
06-22-2008, 09:29 AM
Not exactly as Pixelpost does not store the image width/height in the database.
Try this.
Open the multiphoto.php addon and find the following on line 24:
while ($row=mysql_fetch_array($results)) {
Beneath that line of code add the following:
list($width, $height) = getimagesize(ltrim($cfgrow['imagepath'],'./').$row['image']);
$tpl = str_replace("<IMAGE_WIDTH>",$width,$tpl);
$tpl = str_replace("<IMAGE_HEIGHT>",$height,$tpl);
I have not tested the above code modifications but it should work.
James Costa
06-22-2008, 09:42 AM
Doesn't seem to be working:
http://rosepizzulo.com/playground/
The border should wrap around the image.
Note, look at this in FireFox because right now Internet Explorer 7 isn't working with it (if you could figure that out as well, you're a star).
James Costa
06-22-2008, 09:42 AM
Note, the multiphoto template is set up as follows:
new Array("images/<IMAGE_NAME>", "<IMAGE_WIDTH>", "<IMAGE_HEIGHT>", "<IMAGE_NOTES>"),
Dkozikowski
06-22-2008, 09:46 AM
Of course it did not work because you are not using the multiphoto addon.
You're going to have to be real clear what you want done because that link shows no resemblance of a "multiphoto" type page.
James Costa
06-22-2008, 09:46 AM
Another bug I'm finding is that the code seems to think there is more arrays than there actually is...
James Costa
06-22-2008, 09:47 AM
I am using the multiphoto plugin in a different form. View the code, I am using it to output the lines that the javascript needs.
Dkozikowski
06-22-2008, 09:55 AM
Another bug I'm finding is that the code seems to think there is more arrays than there actually is...
No clue. This is not my addon. I can't even get it to install on my dev blog without it crashing with fatal errors.
James Costa
06-22-2008, 09:55 AM
Found reason for the "extra array". multipost.php outputs another line with a <div> on it that the javascript is getting confused with. Can't feel to take out that little batch of code. Any ideas?
Sorry I'm asking so much - you're going above and beyond what I honestly expected (from using Wordpress, their forums are completely useless).
James Costa
06-22-2008, 09:57 AM
But as for the actual tag output for the height and width - any ideas on how this could work? (Or are you trying to test it on your servers right now?)
Dkozikowski
06-22-2008, 09:58 AM
I am using the multiphoto plugin in a different form. View the code, I am using it to output the lines that the javascript needs.
I see. So you are hacking this addon to make it spit out javascript code for you?
I can't help you unless you show me your hacked code.
Dkozikowski
06-22-2008, 10:00 AM
But as for the actual tag output for the height and width - any ideas on how this could work? (Or are you trying to test it on your servers right now?)
My server won't work with this addon. It breaks my local dev version of pixelpost with some really odd errors.
James Costa
06-22-2008, 10:04 AM
Sorry to seem like an ass, but are there any solutions with or without the addon? I need something easy this client can essentially dump photos into, and the client wanted it to be something like a slideshow as made on the page in progress. Been looking through the pixelpost plugins and found a couple of hopefuls, but I wanted a script that adjusted itself automatically on one page with the heights and widths of the images (however, if this can be done simpler with doing things on separate pages, I'm willing to take whatever at this point).
Dkozikowski
06-22-2008, 10:08 AM
I can help you with some custom code that will spit out the info you want but i'll need to know what needs to be done.
you need to fill in this info?
new Array("<IMAGE>", "<IMAGE_WIDTH>", "<IMAGE_HEIGHT>", "<IMAGE_TITLE>")
How many arrays do you want? Do you want an array for all photos or limit it to the 10 or so most recent?
Dkozikowski
06-22-2008, 10:09 AM
There are also some slideshow addons already, http://www.pixelpost.org/extend/?s=slideshow&sort=updated&req=Any and you can try searching the forum for more as not all addons make it to our extend section.
James Costa
06-22-2008, 10:12 AM
What I eventually need with the code is to have it display the contents from a specific category with as many arrays as there are photos in the category.
Thanks for the extra links, I'll look through those as well, but I'd love to see what you could conjure (if you have the time) in terms of making this work.
Dkozikowski
06-22-2008, 10:14 AM
I have time but none of it is "free".
Do you have any PHP knowledge? I can get you off on the right track. . .
James Costa
06-22-2008, 10:17 AM
I have a little bit of a base but I can more work with it, not write something from scratch.
Dkozikowski
06-22-2008, 10:41 AM
I'll see what I can do.
What kind of client is this for?
Dkozikowski
06-22-2008, 11:47 AM
Something like this: http://dwilkinsjr.com/dwilkinsjr/devblog/index.php?x=array
James Costa
06-22-2008, 03:43 PM
The client is a photographer.
kevincrafts
06-22-2008, 04:05 PM
Sorry to be late to the game on this one - I am confused as to what exactly you are trying to do. Adding the image height and width to the addon can be done.
dwilkinsjr, you are the first to say this addon has not run on your system - can you give me more details?
Dkozikowski
06-22-2008, 06:09 PM
The client is a photographer.
OK, but is that example link what you need?
By choosing a category, all images from that category are listed within a formated JS array.
I just have it output on the page as a test for you.
Dkozikowski
06-22-2008, 06:17 PM
Sorry to be late to the game on this one - I am confused as to what exactly you are trying to do. Adding the image height and width to the addon can be done.
dwilkinsjr, you are the first to say this addon has not run on your system - can you give me more details?
Hey, I finally got it to run. It was a late late night and I must admit, i did not read the directions :p
I wasn't aware the multiphoto folder had to be uploaded also.
Maybe update your addon so everything is in 1 folder as Pixelpost 1.7 handles sucking in addons a bit differently than previous version. If you prefix a folder name with an underscore ( _ ), Pixelpost will include all files within the prefixed folder as an addon. However, files contained within subfolders of the prefixed folder are not considered addons and will not be included. Perfect for support files (multiphoto_template.html).
So, your folder structure would look like:
Folders are bold, files are italic.
_multiphoto
multiphoto.php
multiphoto
multiphoto_template.html
kevincrafts
06-22-2008, 07:17 PM
Thanks for the tip - the addon is now updated with the new file structure, so if you are upgrading, delete the old multiphoto.php and multiphoto directory from your addons directory.
I've also added the support for the <IMAGE_WIDTH> and <IMAGE_HEIGHT> tags for each image.
Download it here (http://www.pixelpost.org/extend/addons/multiphoto/download/)
vBulletin® v3.7.3, Copyright ©2000-2013, Jelsoft Enterprises Ltd.