[Suggestion/request] photoalbum

Creating and modifying plugins.
mgroeninger
Regular
Posts: 546
Joined: Mon Dec 20, 2004 11:57 pm
Contact:

Post by mgroeninger »

lordcoffee,
Ok, the foreach thing happens because I assumed an array would be passed in the code. It is an easy fix, and I will put an update in a couple of minutes... in the mean time you can fix it by going to roughly line 375 and replacing:

Code: Select all

                foreach($directories_temp AS $f => $dir) {
                    if ($display_dir_tree == 'yes') {
                        $dir['filecount'] = $temp_filecount[$dir['relpath']];
                    } else {
                        $dir['filecount'] = $temp_filecount[$getpathtemp.$dir['relpath']];
                    }
                    if ($dir['filecount'] == '') {$dir['filecount'] = 0; }
                    $directories[$dir['name']] = $dir;
                }
                
with:

Code: Select all

                if (is_array($directories_temp)) {
                    foreach($directories_temp AS $f => $dir) {
                        if ($display_dir_tree == 'yes') {
                            $dir['filecount'] = $temp_filecount[$dir['relpath']];
                        } else {
                            $dir['filecount'] = $temp_filecount[$getpathtemp.$dir['relpath']];
                        }
                        if ($dir['filecount'] == '') {$dir['filecount'] = 0; }
                        $directories[$dir['name']] = $dir;
                    }
                }
just a simple if statement...

Now, on your first gallery the problem is that either subpage is not set in your configuration, or the plugin isn't reading the setting correctly... can you make sure it is subpage is not blank?

On gallery2 I have no idea what is happening... It looks like the template is not getting the full "$file" array... Have you edited the template at all?
lordcoffee
Regular
Posts: 308
Joined: Tue Nov 29, 2005 10:22 pm
Location: Munich - Germany
Contact:

Post by lordcoffee »

O.K. there's no more failure message but no Image is shown large on click. It'll always show the frontpage if I click on anyone.

You have to excuse my bad english.:oops: What did you mean with "subpage is not blank"?

And no, I didn't edited the template file.

Lordcoffee
mgroeninger
Regular
Posts: 546
Joined: Mon Dec 20, 2004 11:57 pm
Contact:

Post by mgroeninger »

You have to excuse my bad english.Embarassed What did you mean with "subpage is not blank"?


It's not your bad english, it's me not explaining well. :D

In the configuration of the plugin, there is a setting called "Subpage name for gallery view" in english... It should be the third setting down. Can you make sure that it is set to something? (the default should be "gallery")

The final problem is a template problem... I will figure out what the template should have in it and then post (hopefully in a few minutes).
lordcoffee
Regular
Posts: 308
Joined: Tue Nov 29, 2005 10:22 pm
Location: Munich - Germany
Contact:

Post by lordcoffee »

:D

Yes, it's set to "fuddel" (means something like whatever)...
would it be helpfull if would post a screenshot of the setting if done?

Thanks again,
Lordcoffee!
mgroeninger
Regular
Posts: 546
Joined: Mon Dec 20, 2004 11:57 pm
Contact:

Post by mgroeninger »

lordcoffee wrote:would it be helpfull if would post a screenshot of the setting if done?
Nope... I have a feeling it is a code problem some where....

Ok, to fix the pop-ups you can change line 84 of plugin_usergallery.tpl from:

Code: Select all

<a href="javascript:popImage('{$plugin_usergallery_file.link}','{$plugin_usergallery_file.name}','{$plugin_usergallery_file.dimensions_width}','{$plugin_usergallery_file.dimensions_height}')"><img class="gallery_thumb" {if $plugin_usergallery_fixed_width !=0}height={$plugin_usergallery_fixed_width}px width={$plugin_usergallery_fixed_width}px{/if} src="{$image.link}" border="0" alt="" /></a>
to:

Code: Select all

<a href="javascript:popImage('{$image.fullimage}','{$image.name}','{$image.dimensions_width}','{$image.dimensions_height}')"><img class="gallery_thumb" {if $plugin_usergallery_fixed_width !=0}height={$plugin_usergallery_fixed_width}px width={$plugin_usergallery_fixed_width}px{/if} src="{$image.link}" border="0" alt="" /></a>
I will look into the subpage problem now...
mgroeninger
Regular
Posts: 546
Joined: Mon Dec 20, 2004 11:57 pm
Contact:

Post by mgroeninger »

Ok, the subpage problem (making the images invalid in your "Gallerie" link):

Add the line at about line 283:

Code: Select all

$sub_page = $this->get_config('subpage');
It needs to be before these lines:

Code: Select all

      $serendipity['smarty']->assign('plugin_usergallery_httppath',$serendipity['rewrite'] != 'none' 
                                             ? $serendipity['serendipityBaseURL'] . $this->get_config('permalink')
                                             : $serendipity['serendipityBaseURL'] . $serendipity['indexFile'] . '?serendipity[subpage]='.$sub_page);
        $serendipity['smarty']->assign('plugin_usergallery_httppath_extend',$serendipity['rewrite'] != 'none' 
                                             ? $serendipity['serendipityBaseURL'] . $this->get_config('permalink').'?'
                                             : $serendipity['serendipityBaseURL'] . $serendipity['indexFile'] . '?serendipity[subpage]='.$sub_page.'&');
mgroeninger
Regular
Posts: 546
Joined: Mon Dec 20, 2004 11:57 pm
Contact:

Post by mgroeninger »

To summarize... (sorry for posting so many times...):

The 1.1 version of the usergallery plugin has a variety of errors:
1) we did not check that several arrays were in fact arrays before treating them as such.
2) our templates referenced an incorrect variable.
3) we tried to use a variable before we actually set it.

I have updated the plugin to fix these and I have bumped the version number to 1.2.

lordcoffee, sorry about all that. Thank you so much for being patient and for trying the plugin!
lordcoffee
Regular
Posts: 308
Joined: Tue Nov 29, 2005 10:22 pm
Location: Munich - Germany
Contact:

Post by lordcoffee »

I think it's good to have php-noobs like me to test the plugins or themes the hard way to find and fix most of the bugs :wink:

I'll edit the files tonight. I'm at work and my boss will earn some money (me to of course) :)
I'll post my results here.

Thanks again, Lordcoffee
SHRIKEE
Regular
Posts: 128
Joined: Tue Feb 21, 2006 2:49 am
Location: Netherlands
Contact:

Post by SHRIKEE »

heh, yea noobs for the win...

anyway, im wondering if its usefull to maintain a page like this:
http://www.sothq.net/projects/usergallery.html

please give you comments wether to keep it or not. Thanks!

Oh and sorry for misleading people with the server settings. Ive seen a lot of scripts working weird or not working at all, and the sollution was in those settings alot of times :) so by default i suggest to change them as discussed. *dont hate me now garvin* :wink:
My kingdom For i am king of my heap of trash

Developing code on:
Workstation: Windows 2000 sp4, TSW webcoder 2005
Server: fedora core 4 amd64, apache 2.0.54, php 5.0.4, mysql 4.1.11.
lordcoffee
Regular
Posts: 308
Joined: Tue Nov 29, 2005 10:22 pm
Location: Munich - Germany
Contact:

Post by lordcoffee »

mgroeninger you're great!

Works all fine now! Thank you both for this great plugin!

Thanks, Lordcoffee!
flatloop
Regular
Posts: 14
Joined: Thu Mar 16, 2006 3:04 pm
Contact:

Post by flatloop »

Hello fellas,

I've almost got this wicked plugin installed and working. It seems though I'm missing a file. When I click on a thumbnail, it throws this error:

Code: Select all

Warning: Smarty error: unable to read resource: "file:/var/www/serendipity/plugins/serendipity_event_usergallery/plugin_usergallery_imagedisplay.tpl" in /var/www/serendipity/bundled-libs/Smarty/libs/Smarty.class.php on line 1088
I checked the path and it's right that tpl file is not there. Any clue as to why? Better yet, do you know where I can get one?

The other small issue I have is that the sidebar is staying on the bottom of the page, under the thumbnails. It doesn't matter if I have 2 or 4 columns it's always under the thumbnails. Once these are conquered, I will have my dream photo page, something I've been working for quite sometime now. Thanks for all your great work on this awesome product.
SHRIKEE
Regular
Posts: 128
Joined: Tue Feb 21, 2006 2:49 am
Location: Netherlands
Contact:

Post by SHRIKEE »

check the CVS for the missing file.
http://cvs.sourceforge.net/viewcvs.py/p ... ergallery/

About the template. I dont know why this is. Everything is alright in here.
Maybe you can give us some more details:
screen resolution
browser + version
which operating system

Maybe someone can figure your problem out :)
I have tested the files on both Firefox 1.5 and Internet exploder 6 and i have no problems. Im using a resolution of 1024x768 32bit and 1280x1024 32bit
My kingdom For i am king of my heap of trash

Developing code on:
Workstation: Windows 2000 sp4, TSW webcoder 2005
Server: fedora core 4 amd64, apache 2.0.54, php 5.0.4, mysql 4.1.11.
mgroeninger
Regular
Posts: 546
Joined: Mon Dec 20, 2004 11:57 pm
Contact:

Post by mgroeninger »

flatloop,
How did you install the plugin? Using spartucus? Or manually using another method?
I think the easiest wasy to fix the problem with the template is to manually create the file and place the text in it. The current version of the file is available at http://cvs.sourceforge.net/viewcvs.py/* ... pl?rev=1.3

As for the template problem, I can recreate it by switching to the theme you are using. There seems to be something strange about the way it handles a div open and close somewhere (it looks to me like a div is opened someplace and then is not closed in the same file).

A simple way around this is to copy plugin_usergallery.tpl into the "templates\andreas08" folder, and then edit it.

In this case, you just need to add a </div> tag to the end of the file.

I'd love to look into it further, but css makes my head hurt...

Let me know if all that makes sense...
Matt
mgroeninger
Regular
Posts: 546
Joined: Mon Dec 20, 2004 11:57 pm
Contact:

Post by mgroeninger »

Actually, it looks like a div was opened in plugin_usergallery.tpl that went unclosed. I will update it in CVS...

Carl, (if your reading this thread) sorry to imply your template was wrong. *grin*

Matt
flatloop
Regular
Posts: 14
Joined: Thu Mar 16, 2006 3:04 pm
Contact:

Post by flatloop »

Excellent the error is gone, thanks for the file. I'll look into the div tags a little later. Just an FYI, it's only on the pages with thumbnails that the sidebar is not on the side, when I click for a bigger, the sidebar is in the right place.

Thanks guys, this stuff is sooooo cool. You make it easy for us non-coders to look good. Thanks again.
Post Reply