By the way. The debug-mode is working. But for what must I search?
My ISP (german www.1and1.com) has a very short time-out. (simple shared-webhosting)
There was another user in this thread who has had the same problem.
Any idea?
myriagon
Joined: 2004-01-22
Posts: 130
Posted: Tue, 2004-06-08 21:05
It looks as though there's a photo in the ul_2004_05_irland album that's causing the problem. I've added more debug to try and diagnose it. Download the latest version (2.01) from here and specify debug=3
Thanks Jeremy for your help.
I have replaced stats.php (only this file).
Debug-Mode 3 is activated ;-)
I have rebuilded the thumbnails, too.
bificypdog
Joined: 2004-03-15
Posts: 26
Posted: Tue, 2004-06-08 21:32
Wow. A lot of work.
I have deleted pretty much pics.
I deleted those pics where the debug-script stops.
And now:
Fatal error: out of dynamic memory in yy_create_buffer() in /homepages/30/*********/htdocs/domain2/modules/gallery/util.php on line 1032
Line 1022-1033 from my util.php
----------------------------------------
function getImagePath($name, $skinname='') {
global $gallery;
if (!$skinname) {
$skinname = $gallery->app->skinname;
}
if (isset($gallery->app->photoAlbumURL)) {
$base = $gallery->app->photoAlbumURL;
} else {
$base = '.';
}
myriagon
Joined: 2004-01-22
Posts: 130
Posted: Tue, 2004-06-08 22:18
bificypdog - there's a possibility that one of the photos was corrupt in some way. I would be interested to see the debug output before you deleted the photos.
You now appear to have a memory problem. If I try using stats.php without postnuke - see http://www.carsten-volmer.de/modules/gallery/stats.php?type=views then it works great. If memory is the problem then this can be explained because postnuke will itself be using memory which when added to what stats.php needs, is enough to go over the limit. Taking postnuke out means that less memory is needed and it works ok. I suggest increasing the memory limit - at the moment that is set to 40M. See my response to priest above for details about using ini_set to increase the memory.
Your help is greatly appreciated. This looks like an awsome addon.. Thank you for all your hard work!!!
floridave
Joined: 2003-12-22
Posts: 27300
Posted: Wed, 2004-06-09 03:19
schauber,
You are using 1.4.4 beta? The API has changed yet again. I think there is one location in stats.php where you need to change pluralize_n to pluralize_n2
then look for echo error_format(sprintfand change to echo gallery_error(sprintf
See if that works and if it does not post back. I just removed my 1.4.4 test gallery :roll:
Dave
myriagon
Joined: 2004-01-22
Posts: 130
Posted: Wed, 2004-06-09 04:18
myriagon wrote:
bificypdog - there's a possibility that one of the photos was corrupt in some way. I would be interested to see the debug output before you deleted the photos.
Thinking about this again I don't think the above is correct. I suspect what was happening before you deleted some photos was that it was exhausting the available memory earlier. This happened in code where there was no friendly error message. After deleting the photos it now successfully gets through that code, only to run out of memory later when it attempts to display the results.
is it possible to show oldest Photos first, sorted by date or cdate?
Thanks
Kai
myriagon
Joined: 2004-01-22
Posts: 130
Posted: Wed, 2004-06-09 12:34
Kai,
I wondered when someone would ask that question. I've thought about doing oldest already but no one asked for it so currently it's not supported. The code changes required should be fairly straightforward so when I get some time I will add oldest.
schauber,
You are using 1.4.4 beta? The API has changed yet again. I think there is one location in stats.php where you need to change pluralize_n to pluralize_n2
then look for echo error_format(sprintfand change to echo gallery_error(sprintf
See if that works and if it does not post back. I just removed my 1.4.4 test gallery :roll:
Dave
Shadow_Wolf
Joined: 2004-04-03
Posts: 181
Posted: Sun, 2004-06-20 08:24
Is there a way to exclude certain Albums and/or Sub-Albums?
tenaki
Joined: 2003-04-08
Posts: 106
Posted: Sun, 2004-06-20 11:46
Can I just check (linited knowledge here) Can I upload the stats.tar add say views to it and point my browser at it and it will work?
If OK I can upload all the rest and NOT interfere with the existing gallery code is that about right I only really want latest and most viewed
itcheg
Joined: 2003-11-30
Posts: 87
Posted: Sun, 2004-06-20 13:20
Thanks for a great hack.
Don't know if I'm missing something but at least for me if you click next after your at page 10 it will go to 11 (as indicative in the URL) but it still says page numbers 1 through 10 (as opposed to 11-20).
Another issue is that gallery reports that I have 1572, while when I use stats.php hack it only says 1557.
This hack should definitely be a standard Gallery feature, Keep up the great work.
myriagon
Joined: 2004-01-22
Posts: 130
Posted: Wed, 2004-06-23 22:10
Shadow_Wolf - there's no way at the moment to exclude certain albums or sub-albums. It could be done with a simple hardcoded hack. The following would exclude Album1 and Album2...
Search for:
if (isset($album))
{
if ( $showNestedAlbums )
.....
change to:
if ( "Album1" == $statsAlbum->fields['name'] ||
"Album2" == $statsAlbum->fields['name'] )
continue;
if (isset($album))
{
if ( $showNestedAlbums )
.....
Regards,
Jeremy
myriagon
Joined: 2004-01-22
Posts: 130
Posted: Wed, 2004-06-23 22:21
tenaki wrote:
Can I just check (linited knowledge here) Can I upload the stats.tar add say views to it and point my browser at it and it will work?
Yes it should.
tenaki wrote:
If OK I can upload all the rest and NOT interfere with the existing gallery code is that about right I only really want latest and most viewed
stats does NOT interfere with the existing gallery code. You can safely extract the files from the tar and they should have no effect on the existing gallery files. There are two gallery patches for voting but you can ignore those if you don't want to change the way voting works.
There's a new version of stats (2.02) here This includes support for reversing the sort order so that rather than displaying the latest first, stats can now display the oldest first. All stats types can be reversed except for random. Search for $reverseOrder in the readme for more details. Thanks Kai for suggesting this.
I have also fixed an issue with hidden albums being included incorrectly. Now albums that are hidden will not be displayed unless the user is admin.
This version of stats will not work with the 1.4.4 beta yet. Checkout floridave's reply above to get stats working with 1.4.4 beta.
There's a new version of stats (2.02) here This includes support for reversing the sort order so that rather than displaying the latest first, stats can now display the oldest first. All stats types can be reversed except for random. Search for $reverseOrder in the readme for more details. Thanks Kai for suggesting this.
Jeremy,
thank you for implementing my suggestion in your script. :D
Kai
tenaki
Joined: 2003-04-08
Posts: 106
Posted: Fri, 2004-06-25 20:55
And thanks for answering my question as well. It's much appreciated
samlewit
Joined: 2002-10-12
Posts: 37
Posted: Sat, 2004-06-26 22:02
Hey thanks for the easiest mod I've ever used! Really gracefully done. Excellent.
I am having a teeny problem though. When I list stats by viewed, the first is 157, then 1422 and downward from there. Could it be that the 157 is corrupted or something?
Actually, as I look at it again indepth, the numbers are all over the place. It goes up and down within a group. Maybe I missed a fix for it here?
Sam - the reason for it being all over the place is that you need to use "views", not "viewed". I've just tried http://www.bayarearailfan.org/gallery/stats.php?type=views and it works ok. BTW if you haven't already tried it have a go with the latest comments type like this
I have been testing out GalleryV1.4.4 and stats.phpV2.02 and have discovered that the frame around the images is not the correct height.
Gallery V1.4.4 fixes a issue where the height of a frame can't be a percentage (html compliance as well as fixing a Safari issue).-- From inline_imagewrap.inc,v 1.28
Quote:
// Safari/Opera ignore height="100%" for table, but this ensures HTML
// standards, so do it for all browsers
$hLL = $imageHeight - $heightLLT - $heightLLB;
$hRR = $imageHeight - $heightRRT - $heightRRB;
The value ($gallery->html_wrap['imageWidth'] & $gallery->html_wrap['imageHeight']) that stats.php sent the inline_gallerythumb.frame and ultimately inline_imagewrap.inc where not correct because it uses a scaled image of the thumb.
I think I have a work around for this:
in stats.php
Look for
Stats.php works fine when stand alone. When I try this: http://server/modules.php?op=modload&name=gallery&file=index&include=stats.php?type=cdate
all I get is a blank page. I have also tried this: http://server/modules.php?op=modload&name=gallery&file=index&include=cdate.php where cdate is stats.php with the variable $type set to cdate within the script. This works well, so I assume this is not a problem with memory,
What to try next?
Kind Regards
/Jenny
myriagon
Joined: 2004-01-22
Posts: 130
Posted: Sun, 2004-07-04 16:03
floridave - thanks for looking into the problem with frame height and the latest Gallery code. I will try to add it next time I do a release.
Jenny - try changing the final "?" to a "&" - eg. http://server/modules.php?op=modload&name=gallery&file=index&include=stats.php&type=cdate
itcheg - I knew about page 10 not going to 11... I didn't think anyone would ever get that far but as you've raised it, I will try and fix it for the next release. For the other issue you raised...
Quote:
Another issue is that gallery reports that I have 1572, while when I use stats.php hack it only says 1557.
This is caused by gallery reporting the number of images + albums while stats reports the number of images.
Jenny - try changing the final "?" to a "&" - eg. http://server/modules.php?op=modload&name=gallery&file=index&include=stats.php&type=cdate
Thank you so much, that worked.
/Jenny
Shadow_Wolf
Joined: 2004-04-03
Posts: 181
Posted: Fri, 2004-07-09 02:39
Quote:
Shadow_Wolf - there's no way at the moment to exclude certain albums or sub-albums. It could be done with a simple hardcoded hack. The following would exclude Album1 and Album2...
Search for:
Code:
if (isset($album))
{
if ( $showNestedAlbums )
.....
if (isset($album))
{
if ( $showNestedAlbums )
.....
Regards,
Jeremy
That is great. Thank you. I just have one question, when an album isn't a album number is actually named like Out-of-Order, do I put that where it says "Album 1"?
What controls that way that the stats.php display things? Is that controlled in stats.php or does it call upon the header/footer that the gallery uses? The reason I'm asking is because I want to use the random image but I want a smaller area for it to place in a certain spot on the website. If you go here you can see what I mean, I would like to cut it in half basically so it takes up less space. http://www.protoculturex.com/artgallery/stats.php?type=random&total=1
Moritz-
Joined: 2004-07-08
Posts: 3
Posted: Fri, 2004-07-09 11:16
myriagon,
Is it possible for you to make something like a monthly reset of views, and that the pictures that got the most views in that month get written to an .html file, so that all the best views of each month are stored?
Greetings
itcheg
Joined: 2003-11-30
Posts: 87
Posted: Sun, 2004-07-11 08:53
In gallery ver 1.4.4 RC1 stats.php seems not to like the showview function it complains that it can't get the views
Fatal error: Call to undefined function: pluralize_n()
I don't know much php but I commented out the showview function and it works (except for the views function of course)
[edit] A quick look in the ChangeLog for gallery v1.4.4-RC2 reveald in 1.4.4-cvs-b112 "* Change: Complete replace of pluralize_n with n2" so I changed the stats.php code
There's a new version of stats (2.03) here This supports Gallery 1.4.4rc1 and includes floridave's workaround for the image height issues. Thanks floridave for that.
Moritz - I like the idea of showing stats by month. I might do something if I get some time. A quick workaround could be to save the html generated by stats using IE or whatever each month, then use the admin option to reset the views counter for each album.
Shadow_Wolf
Quote:
That is great. Thank you. I just have one question, when an album isn't a album number is actually named like Out-of-Order, do I put that where it says "Album 1"?
Yes use Out-of-Order or whatever the album name is - I used Album1 as an example. I'm not exactly clear what you mean by your second question but stats uses stats.header.default (or stats.header) and stats.footer.default (or stats.footer). These inturn include wrapper.header and wrapper.footer.
Moritz - I like the idea of showing stats by month. I might do something if I get some time. A quick workaround could be to save the html generated by stats using IE or whatever each month, then use the admin option to reset the views counter for each album.
Great, this is exactly what i mean, i guess you will make loads of users happy, if you can find the time and enthousiasm at least!
I could help a little generating the stats and stuff, but i have too few time to catch up how the whole gallery thing works with its unlimited variables .
Regards
Moritz
carmosin
Joined: 2003-11-18
Posts: 15
Posted: Tue, 2004-07-13 11:13
Hi,
I have installed the latest stats.php and Gallery v1.4.5-cvs-b13. I am using Postnuke.
When accessing stats.php through standalone gallery, everything works fine, but when I try to access it through postnuke it says:
Fatal error: Failed opening required './stats.config.default.php' (include_path='.:/usr/share/pear') in /var/www/html/modules/gallery/stats.php on line 73
Is this a known problem, and if so, what am I doing wrong?
/Jenny
kai_tom
Joined: 2004-04-08
Posts: 347
Posted: Tue, 2004-07-13 19:59
Hi,
i have the same problem with my Gallery 1.4.4-RC1 embedded in Mambo.
I have removed the ./ in line 62 in stats.php
$GALLERY_BASEDIR = './';
to
$GALLERY_BASEDIR = '';
Now stats.php works again
Kai
myriagon
Joined: 2004-01-22
Posts: 130
Posted: Tue, 2004-07-13 20:42
It seems that GALLERY_BASEDIR has become GALLERY_BASE in the latest version of Gallery.
kai_tom's workaround should do for now. I will change stats sometime soon.
the global $GALLERY_BASEDIR is completely gone and not needed or used at any place in Gallery.
In some functions there is a locale var called $GALLERY_BASE. But its only used in that function.
We have a constant GALLERY_BASE bu its not replacement in any way.
See getGalleryPaths() in util.php.
Jens
@Jeremy: we would like to integrate your stats.php into official code for Gallery 1.4.5.
I am responsible for this task and will contact you soon.
Raven69
Joined: 2004-01-16
Posts: 24
Posted: Fri, 2004-07-16 11:24
Tim_j wrote:
...
@Jeremy: we would like to integrate your stats.php into official code for Gallery 1.4.5.
I am responsible for this task and will contact you soon.
@Jeremy: You did (and hopefully will continue doing so) an excellent job.
I like your STATS mod and am looking forwarding finding it integrated into one of the next versions.
I have redownloaded the package and extract it with power archiver.
The other file was extracted with winrar. I think that was the problem.
I haven't changed the sourcecode before, so it must be winrar.
Now, everthing is fine. Thanx.
-------------
Same problem here:
With Postnuke:
CHANGED/modules.php?set_albumName=&op=modload&name=gallery&file=index&include=stats.php&type=date
Without Postnuke:
CHANGED/modules/gallery/stats.php?latest
I have done no changes. Only updated stats.php from 2.00 to 2.03
Herr.Vorragend
Joined: 2004-07-16
Posts: 120
Posted: Fri, 2004-07-16 17:06
one more question: ;-)
Is it possible to localize "stats" in the future?
I will help you with the german translation (it is much more better than my englisch) ,-)
Raven69
Joined: 2004-01-16
Posts: 24
Posted: Fri, 2004-07-16 17:24
if necessary, I will support you with german translation, too.
Greetz from Vienna, Austria, EUROPE :wink:
RaVen
myriagon
Joined: 2004-01-22
Posts: 130
Posted: Fri, 2004-07-16 22:16
Thanks guys for all your support
Jens is looking to get stats into Gallery. As he's the team lead for the translation team it's probably best if I let him arrange the localizing - particular as my language skills are limited to basic French and I've never localized php code before.
How do I use the script to get JUST the thumbnail, caption and comment? I want to embed this on the main page of gallery.
Ultima
Joined: 2004-07-19
Posts: 12
Posted: Wed, 2004-07-21 15:57
Ultima wrote:
How do I use the script to get JUST the thumbnail, caption and comment? I want to embed this on the main page of gallery.
I got something working using your script and the random block generator. I didn't modify header/footer because I didn't want it on EVERY page, only the front page. You guys can see what I did at my gallery, and give me any suggestions on how to improve the look, etc... I've noticed that sometimes the random block generator doesn't work.. the image just doesn't appear.
Herr.Vorragend
Joined: 2004-07-16
Posts: 120
Posted: Fri, 2004-07-30 12:05
Hi,
I have embedded gallery into postnuke.
No I receive an error after updating to 1.4.4 final.
Warning: main(./stats.config.default.php) [function.main]: failed to create stream: Datei oder Verzeichnis nicht gefunden in /www/htdocs/xxxxx/modules/gallery/stats.php on line 73
Fatal error: main() [function.main]: Failed opening required './stats.config.default.php' (include_path='.:..') in /www/htdocs/xxxxx/modules/gallery/stats.php on line 73
$GALLERY_BASEDIR = './';
to
$GALLERY_BASEDIR = '';
prints another error:
Quote:
Warning: main() [function.main]: open_basedir restriction in effect. File(../stats.config.default.php) is not within the allowed path(s): (/www/htdocs/xxxxxx/) in /www/htdocs/xxxxxx/modules/gallery/stats.php on line 73
Warning: main(stats.config.default.php) [function.main]: failed to create stream: Die Operation ist nicht erlaubt in /www/htdocs/xxxxxx/modules/gallery/stats.php on line 73
Fatal error: main() [function.main]: Failed opening required 'stats.config.default.php' (include_path='.:..') in /www/htdocs/xxxxxx/modules/gallery/stats.php on line 73
Herr.Vorragend
Joined: 2004-07-16
Posts: 120
Posted: Mon, 2004-08-02 13:27
Other question:
Is the current version of stats.php (2.03) working with gallery 1.4.4 ?
Or will there be a newer release in the future?
myriagon
Joined: 2004-01-22
Posts: 130
Posted: Mon, 2004-08-02 13:50
Sorry for not replying earlier - I've been very busy recently.
The fatal error that you are getting appears to be because stats cannot open its default configuration file (stats.config.default.php). That would suggest that the current working directory is not the same as the gallery directory. I don't know very much about postnuke but one thing you could try is editing line 73 of stats.php to hardcode the path to stats.config.default.php - that's not ideal and you might get other path type problems too but it would at least prove the theory.
As for the other question about 1.4.4, the latest version of stats worked with the 1.4.4 rc. If it doesn't work with the final version then please reply and I will get it fixed.
Gallery is installed in \modules\gallery.
So there are stats.php and the config-file, too.
I changed the line 73 as following:
/www/htdocs/xxxxx/modules/gallery/
And now it is working.
Thank you very much Jeremy.
scoobidoobidooooo
Joined: 2003-11-06
Posts: 12
Posted: Thu, 2004-08-12 15:45
Hey, I recently updated the gallery to version 1.4.4 and I downloaded the last stats.tar.gz and installed it. I seems to work correctly except that I can't show the pictures in a 3*3 array like before. Now all the pictures are in only one column. I tried to change $numRows and $numCols but it didn't do any changes.
Thanks for your help
Stephane
Triumph-design
Joined: 2004-08-14
Posts: 2
Posted: Sat, 2004-08-14 11:41
Heya!
Great hack, works fine for me, though i have some serious problems.
When i open my website it shows the 3 latest photo's
I include stats.php and i edited stats.php with the line
$type = "date"; so that wouldn't gave the variable "type" away.
This way i could include stats.php in my code.
But my navigation goes like this:
Posts: 26
OK. I turned it off.
By the way. The debug-mode is working. But for what must I search?
My ISP (german www.1and1.com) has a very short time-out. (simple shared-webhosting)
There was another user in this thread who has had the same problem.
Any idea?
Posts: 130
It looks as though there's a photo in the ul_2004_05_irland album that's causing the problem. I've added more debug to try and diagnose it. Download the latest version (2.01) from here and specify debug=3
Regards,
Jeremy
www.tearoom.me.uk
Posts: 26
Thanks Jeremy for your help.
I have replaced stats.php (only this file).
Debug-Mode 3 is activated ;-)
I have rebuilded the thumbnails, too.
Posts: 26
Wow. A lot of work.
I have deleted pretty much pics.
I deleted those pics where the debug-script stops.
And now:
Line 1022-1033 from my util.php
----------------------------------------
Posts: 130
bificypdog - there's a possibility that one of the photos was corrupt in some way. I would be interested to see the debug output before you deleted the photos.
You now appear to have a memory problem. If I try using stats.php without postnuke - see http://www.carsten-volmer.de/modules/gallery/stats.php?type=views then it works great. If memory is the problem then this can be explained because postnuke will itself be using memory which when added to what stats.php needs, is enough to go over the limit. Taking postnuke out means that less memory is needed and it works ok. I suggest increasing the memory limit - at the moment that is set to 40M. See my response to priest above for details about using ini_set to increase the memory.
Regards,
Jeremy
www.tearoom.me.uk
Posts: 115
I did a quick search but didn't come up with anything, so I'm going to ask...
I just downloaded your stats package and when i run it, no matter what type I use, I get:
Upload Date: 01/06/2004
Viewed:
Fatal error: Call to undefined function: pluralize_n() in f:\apache2\htdocs\gallery\stats.php on line 1722
I'm on a win2k server with Apache running.
I'm running Gallary 1.4.4-cvs-b165
http://waffull.com
http://waffull.com/gallery/stats.php?type=date
Your help is greatly appreciated. This looks like an awsome addon.. Thank you for all your hard work!!!
Posts: 27300
schauber,
You are using 1.4.4 beta? The API has changed yet again. I think there is one location in stats.php where you need to change
pluralize_n
topluralize_n2
then look for
echo error_format(sprintf
and change toecho gallery_error(sprintf
See if that works and if it does not post back. I just removed my 1.4.4 test gallery :roll:
Dave
Posts: 130
Thinking about this again I don't think the above is correct. I suspect what was happening before you deleted some photos was that it was exhausting the available memory earlier. This happened in code where there was no friendly error message. After deleting the photos it now successfully gets through that code, only to run out of memory later when it attempts to display the results.
Regards,
Jeremy
www.tearoom.me.uk
Posts: 347
Hi,
is it possible to show oldest Photos first, sorted by date or cdate?
Thanks
Kai
Posts: 130
Kai,
I wondered when someone would ask that question. I've thought about doing oldest already but no one asked for it so currently it's not supported. The code changes required should be fairly straightforward so when I get some time I will add oldest.
Regards,
Jeremy
Posts: 115
Dave,
Thank you, that worked perfectly.
httpe://waffull.com/gallery/stats.php
Appreciate your help!!
Marc
Posts: 181
Is there a way to exclude certain Albums and/or Sub-Albums?
Posts: 106
Can I just check (linited knowledge here) Can I upload the stats.tar add say views to it and point my browser at it and it will work?
If OK I can upload all the rest and NOT interfere with the existing gallery code is that about right I only really want latest and most viewed
Posts: 87
Thanks for a great hack.
Don't know if I'm missing something but at least for me if you click next after your at page 10 it will go to 11 (as indicative in the URL) but it still says page numbers 1 through 10 (as opposed to 11-20).
Another issue is that gallery reports that I have 1572, while when I use stats.php hack it only says 1557.
This hack should definitely be a standard Gallery feature, Keep up the great work.
Posts: 130
Shadow_Wolf - there's no way at the moment to exclude certain albums or sub-albums. It could be done with a simple hardcoded hack. The following would exclude Album1 and Album2...
Search for:
change to:
Regards,
Jeremy
Posts: 130
Yes it should.
stats does NOT interfere with the existing gallery code. You can safely extract the files from the tar and they should have no effect on the existing gallery files. There are two gallery patches for voting but you can ignore those if you don't want to change the way voting works.
Regards,
Jeremy
www.tearoom.me.uk
Posts: 130
There's a new version of stats (2.02) here This includes support for reversing the sort order so that rather than displaying the latest first, stats can now display the oldest first. All stats types can be reversed except for random. Search for $reverseOrder in the readme for more details. Thanks Kai for suggesting this.
I have also fixed an issue with hidden albums being included incorrectly. Now albums that are hidden will not be displayed unless the user is admin.
This version of stats will not work with the 1.4.4 beta yet. Checkout floridave's reply above to get stats working with 1.4.4 beta.
Regards,
Jeremy
www.tearoom.me.uk
Posts: 347
Jeremy,
thank you for implementing my suggestion in your script. :D
Kai
Posts: 106
And thanks for answering my question as well. It's much appreciated
Posts: 37
Hey thanks for the easiest mod I've ever used! Really gracefully done. Excellent.
I am having a teeny problem though. When I list stats by viewed, the first is 157, then 1422 and downward from there. Could it be that the 157 is corrupted or something?
Actually, as I look at it again indepth, the numbers are all over the place. It goes up and down within a group. Maybe I missed a fix for it here?
The path is www.bayarearailfan.org/gallery/stats.php?type=viewed
Thanks
Sam
Posts: 130
Sam - the reason for it being all over the place is that you need to use "views", not "viewed". I've just tried http://www.bayarearailfan.org/gallery/stats.php?type=views and it works ok. BTW if you haven't already tried it have a go with the latest comments type like this
Regards,
Jeremy
www.tearoom.me.uk
Posts: 27300
I have been testing out GalleryV1.4.4 and stats.phpV2.02 and have discovered that the frame around the images is not the correct height.
Gallery V1.4.4 fixes a issue where the height of a frame can't be a percentage (html compliance as well as fixing a Safari issue).-- From inline_imagewrap.inc,v 1.28
The value ($gallery->html_wrap['imageWidth'] & $gallery->html_wrap['imageHeight']) that stats.php sent the inline_gallerythumb.frame and ultimately inline_imagewrap.inc where not correct because it uses a scaled image of the thumb.
I think I have a work around for this:
in stats.php
Look for
and remove the next 2 lines:
skip this line
$gallery->html_wrap['imageTag'] = $statsAlbum->getThumbnailTag($photoIndex, $thumbSize);
and add:Then further down find where the functions are:
<?php
/*
* Functions
*/
and add these to new functions:
The last 2 functions strip out the proper values of the height and width from the image tag that is sent to the inline_imagewrap.inc.
I don't think that the width needed to be fiddled with but I did it anyway.
see it in action on my V1.4.4 test gallery:
http://langleycom.com/g1/stats.php?type=date
Posts: 15
Stats.php works fine when stand alone. When I try this: http://server/modules.php?op=modload&name=gallery&file=index&include=stats.php?type=cdate
all I get is a blank page. I have also tried this: http://server/modules.php?op=modload&name=gallery&file=index&include=cdate.php where cdate is stats.php with the variable $type set to cdate within the script. This works well, so I assume this is not a problem with memory,
What to try next?
Kind Regards
/Jenny
Posts: 130
floridave - thanks for looking into the problem with frame height and the latest Gallery code. I will try to add it next time I do a release.
Jenny - try changing the final "?" to a "&" - eg. http://server/modules.php?op=modload&name=gallery&file=index&include=stats.php&type=cdate
itcheg - I knew about page 10 not going to 11... I didn't think anyone would ever get that far but as you've raised it, I will try and fix it for the next release. For the other issue you raised...
This is caused by gallery reporting the number of images + albums while stats reports the number of images.
Regards,
Jeremy
www.tearoom.me.uk
Posts: 15
Thank you so much, that worked.
/Jenny
Posts: 181
That is great. Thank you. I just have one question, when an album isn't a album number is actually named like Out-of-Order, do I put that where it says "Album 1"?
What controls that way that the stats.php display things? Is that controlled in stats.php or does it call upon the header/footer that the gallery uses? The reason I'm asking is because I want to use the random image but I want a smaller area for it to place in a certain spot on the website. If you go here you can see what I mean, I would like to cut it in half basically so it takes up less space.
http://www.protoculturex.com/artgallery/stats.php?type=random&total=1
Posts: 3
myriagon,
Is it possible for you to make something like a monthly reset of views, and that the pictures that got the most views in that month get written to an .html file, so that all the best views of each month are stored?
Greetings
Posts: 87
In gallery ver 1.4.4 RC1 stats.php seems not to like the showview function it complains that it can't get the views
Fatal error: Call to undefined function: pluralize_n()
I don't know much php but I commented out the showview function and it works (except for the views function of course)
[edit] A quick look in the ChangeLog for gallery v1.4.4-RC2 reveald in 1.4.4-cvs-b112 "* Change: Complete replace of pluralize_n with n2" so I changed the stats.php code
where pluralzie_n should be pluralize_n2
(I don't know if this is right, don't know much php but it now seems to work fine) [/edit]
Posts: 27300
itcheg,
There is 2 things to change:
http://gallery.menalto.com/index.php?name=PNphpBB2&file=viewtopic&p=78766#78766
Posts: 130
There's a new version of stats (2.03) here This supports Gallery 1.4.4rc1 and includes floridave's workaround for the image height issues. Thanks floridave for that.
Moritz - I like the idea of showing stats by month. I might do something if I get some time. A quick workaround could be to save the html generated by stats using IE or whatever each month, then use the admin option to reset the views counter for each album.
Shadow_Wolf
Yes use Out-of-Order or whatever the album name is - I used Album1 as an example. I'm not exactly clear what you mean by your second question but stats uses stats.header.default (or stats.header) and stats.footer.default (or stats.footer). These inturn include wrapper.header and wrapper.footer.
Regards,
Jeremy
www.tearoom.me.uk
Posts: 3
Great, this is exactly what i mean, i guess you will make loads of users happy, if you can find the time and enthousiasm at least!
I could help a little generating the stats and stuff, but i have too few time to catch up how the whole gallery thing works with its unlimited variables .
Regards
Moritz
Posts: 15
Hi,
I have installed the latest stats.php and Gallery v1.4.5-cvs-b13. I am using Postnuke.
When accessing stats.php through standalone gallery, everything works fine, but when I try to access it through postnuke it says:
Fatal error: Failed opening required './stats.config.default.php' (include_path='.:/usr/share/pear') in /var/www/html/modules/gallery/stats.php on line 73
Is this a known problem, and if so, what am I doing wrong?
/Jenny
Posts: 347
Hi,
i have the same problem with my Gallery 1.4.4-RC1 embedded in Mambo.
I have removed the ./ in line 62 in stats.php
$GALLERY_BASEDIR = './';
to
$GALLERY_BASEDIR = '';
Now stats.php works again
Kai
Posts: 130
It seems that GALLERY_BASEDIR has become GALLERY_BASE in the latest version of Gallery.
kai_tom's workaround should do for now. I will change stats sometime soon.
Jeremy
www.tearoom.me.uk
Posts: 6818
Hello,
the global $GALLERY_BASEDIR is completely gone and not needed or used at any place in Gallery.
In some functions there is a locale var called $GALLERY_BASE. But its only used in that function.
We have a constant GALLERY_BASE bu its not replacement in any way.
See getGalleryPaths() in util.php.
Jens
@Jeremy: we would like to integrate your stats.php into official code for Gallery 1.4.5.
I am responsible for this task and will contact you soon.
Posts: 24
@Jeremy: You did (and hopefully will continue doing so) an excellent job.
I like your STATS mod and am looking forwarding finding it integrated into one of the next versions.
Congratulations again
RaVen
Posts: 26
Gallery v1.4.3-pl2
Embedded-Postnuke-Link:
modules.php??et_albumName=&op=modload&name=gallery&file=index&include=stats.php&type=comments
OR SAME with the Directlink
modules/gallery/stats.php&type=comments
Following error on the screen:
if ( !$reverseOrder ) echo " Latest Comments"; else echo " Oldest Comments"; } else if ( $type == "random" ) { echo " Random Images"; } ?>
Another example:
...stats.php&type=date
These errors are printed at the header of the page. Above the pictures.
Any idea?
Posts: 130
bificypdog - what has changed since it last worked and what is the url of your website so I can see it for myself?
Regards,
Jeremy
www.tearoom.me.uk
Posts: 120
STOP SEARCHING
I have redownloaded the package and extract it with power archiver.
The other file was extracted with winrar. I think that was the problem.
I haven't changed the sourcecode before, so it must be winrar.
Now, everthing is fine. Thanx.
-------------
Same problem here:
With Postnuke:
CHANGED/modules.php?set_albumName=&op=modload&name=gallery&file=index&include=stats.php&type=date
Without Postnuke:
CHANGED/modules/gallery/stats.php?latest
I have done no changes. Only updated stats.php from 2.00 to 2.03
Posts: 120
one more question: ;-)
Is it possible to localize "stats" in the future?
I will help you with the german translation (it is much more better than my englisch) ,-)
Posts: 24
if necessary, I will support you with german translation, too.
Greetz from Vienna, Austria, EUROPE :wink:
RaVen
Posts: 130
Thanks guys for all your support
Jens is looking to get stats into Gallery. As he's the team lead for the translation team it's probably best if I let him arrange the localizing - particular as my language skills are limited to basic French and I've never localized php code before.
Regards,
Jeremy
www.tearoom.me.uk
Posts: 12
How do I use the script to get JUST the thumbnail, caption and comment? I want to embed this on the main page of gallery.
Posts: 12
I got something working using your script and the random block generator. I didn't modify header/footer because I didn't want it on EVERY page, only the front page. You guys can see what I did at my gallery, and give me any suggestions on how to improve the look, etc... I've noticed that sometimes the random block generator doesn't work.. the image just doesn't appear.
Posts: 120
Hi,
I have embedded gallery into postnuke.
No I receive an error after updating to 1.4.4 final.
http://www.domain.de/modules.php?set_albumName=&op=modload&name=gallery&file=index&include=stats.php
http://www.domain.de/modules/gallery/stats.php works
Any idea?
--------------------------------------
Changing line 62 from
$GALLERY_BASEDIR = './';
to
$GALLERY_BASEDIR = '';
prints another error:
Posts: 120
Other question:
Is the current version of stats.php (2.03) working with gallery 1.4.4 ?
Or will there be a newer release in the future?
Posts: 130
Sorry for not replying earlier - I've been very busy recently.
The fatal error that you are getting appears to be because stats cannot open its default configuration file (stats.config.default.php). That would suggest that the current working directory is not the same as the gallery directory. I don't know very much about postnuke but one thing you could try is editing line 73 of stats.php to hardcode the path to stats.config.default.php - that's not ideal and you might get other path type problems too but it would at least prove the theory.
As for the other question about 1.4.4, the latest version of stats worked with the 1.4.4 rc. If it doesn't work with the final version then please reply and I will get it fixed.
Regards,
Jeremy
www.tearoom.me.uk
Posts: 120
Gallery is installed in \modules\gallery.
So there are stats.php and the config-file, too.
I changed the line 73 as following:
/www/htdocs/xxxxx/modules/gallery/
And now it is working.
Thank you very much Jeremy.
Posts: 12
Hey, I recently updated the gallery to version 1.4.4 and I downloaded the last stats.tar.gz and installed it. I seems to work correctly except that I can't show the pictures in a 3*3 array like before. Now all the pictures are in only one column. I tried to change $numRows and $numCols but it didn't do any changes.
Thanks for your help
Stephane
Posts: 2
Heya!
Great hack, works fine for me, though i have some serious problems.
When i open my website it shows the 3 latest photo's
I include stats.php and i edited stats.php with the line
$type = "date"; so that wouldn't gave the variable "type" away.
This way i could include stats.php in my code.
But my navigation goes like this:
http://website/?page=home
When i navigate i get an error in my stats.php:
Error: Cache update required. [Update]
How can i stop that ?
to see my problem visit http://213.84.84.88/rch4n/ (webserver which is up 24/7)
well i hope to hear from you