Hi guys sorry to be a pain in the ass but I am in the 'learning' process of teaching myself php so I am totally clueless to my problem.
I installed the block for random pictures to be shown from my gallery so it can be shown on the home page as a block, now the problem is only ONE picture showed up and after killing my refresh page button a thousand times this is the error that kept coming up:
<!-- BBCode Start --><TABLE BORDER=0 ALIGN=CENTER WIDTH=85%><TR><TD><font class="pn-sub">Code:</font><HR></TD></TR><TR><TD><FONT class="pn-sub"><PRE>Warning: rand() expects parameter 2 to be long, string given in /htdocs/www/modules/gallery/block-random.php on line 138
ERROR: requested index [] out of bounds [11]
Fatal error: Call to a member function on a non-object in /htdocs/www/modules/gallery/classes/Album.php on line 570</TD></TR></TABLE><!-- BBCode End -->
Any ideas guys? please email me if you can at
The Gallery is one of the best photo albums I have seen for the web - and even better intagrated into postnuke. Thank you guys.
Posts: 38
same problem here.
the random image worked exactly once, and then gives me the same error every time.
Postnuke .72
php 4.2.2
Posts: 3
Random Image Block searches through all your albums and will store all albums with permission that allows EVERYBODY group to read will be stored into an array. Therefore if you have assigned specific permissions to all your albums, which means that there is no EVERYBODY group, than you may experience strange behaviour.
Solution? Try this, for some of your albums, include the EVERYBODY group into the permissions, remember to include the EVERYBODY permissions for your sub-albums too. Than delete the cache file ../your_album_directory/block-random.cache than try again.
Other than inflating my session counts, it works great. Have not had time to figure out this part yet :smile:
My site
<!-- BBCode Start --><A HREF="http://www.joyfulcity.com" TARGET="_blank">JoyFulCity.Com</A><!-- BBCode End -->
Posts: 38
i haven't messed with any of the perms for any of my galleries, and there is no block-random.cache file, so i dunno what's up here.
i'll go learn php to debug this script i guess. oh well, another thing for the ol' resume i guess. :-/
Posts: 1
change the readCache() function in the block_random.php
<!-- BBCode Start --><TABLE BORDER=0 ALIGN=CENTER WIDTH=85%><TR><TD><font class="pn-sub">Code:</font><HR></TD></TR><TR><TD><FONT class="pn-sub"><PRE>
function readCache() {
global $cache;
if ($fd = fs_fopen(CACHE_FILE, "r")) {
while ($line = fgets($fd, 4096)) {
list($key, $val) = explode("/", trim($line));
$cache[$key] = $val;
}
fclose($fd);
}
}
</TD></TR></TABLE><!-- BBCode End -->
Random block works fine now with Postnuke 7.14
Posts: 5
You are a godsend thankee!!
Posts: 2
Yes! It works in PostNuke 0.714 :smile:
But!!! It gives enother bug! :sad:
After that the counter of PostNuke in block "Who us online" begin count each refresh as new guest!
Who one can fix it? :???:
Posts: 14
Yes the fix worked great!
But I have the same problem also with the guest count.
Does anyone have a solution to this?
Thanks!
Brew