Page 4 of 7
Posted: Thu Mar 09, 2006 4:42 pm
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?
Posted: Thu Mar 09, 2006 4:56 pm
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.

What did you mean with "subpage is not blank"?
And no, I didn't edited the template file.
Lordcoffee
Posted: Thu Mar 09, 2006 5:00 pm
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.
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).
Posted: Thu Mar 09, 2006 5:04 pm
by lordcoffee
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!
Posted: Thu Mar 09, 2006 5:10 pm
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...
Posted: Thu Mar 09, 2006 5:15 pm
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.'&');
Posted: Thu Mar 09, 2006 5:27 pm
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!
Posted: Thu Mar 09, 2006 5:45 pm
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
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
Posted: Thu Mar 09, 2006 6:28 pm
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*

Posted: Thu Mar 09, 2006 8:01 pm
by lordcoffee
mgroeninger you're great!
Works all fine now! Thank you both for this great plugin!
Thanks, Lordcoffee!
Posted: Fri Mar 17, 2006 3:29 pm
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.
Posted: Fri Mar 17, 2006 3:35 pm
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
Posted: Fri Mar 17, 2006 5:50 pm
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
Posted: Fri Mar 17, 2006 5:58 pm
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
Posted: Fri Mar 17, 2006 6:01 pm
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.