Create a FREE account or Login
|
|
As a guest, you don't have access to our FULL navigation system. |
|
PHPNuke Blocks Updated Albums block for Gallery
Posted on Thursday, June 12, 2003 @ 11:53:20 CDT We got a request not too long ago about creating a block that would display the albums that have updated since the user's last visit. Well, after a lot of headaches, it's finally here...Read on for more..
This has been tested with Gallery 1.3.3, 1.3.4, and the latest 1.3.5-cvs version, on PHPNuke 6.5 and 6.6. Get the zip file here. The installation is easy.
Unzip the files to your website. The add_fields.php file goes in your root directory, the block-updatedGallery.php file goes in your blocks directory, and the index_php_patch file goes in your modules/Your_Account/ directory.
Make the following changes to the following files:
- add_fields.php:
- Change the $WEB_ROOT variable to reflect the path to your root directory of your website.
- block-updatedGallery.php:
- Change the $WEB_ROOT variable to reflect the path to your root directory of your website.
- Change the $GALLERY_BASEDIR value to reflect the path to your Gallery directory.
- Change the ALBUM_LIST definition to reflect the path of your Gallery albums.
- Change the WEB_BASE_ADDR definition to point to the address of your website (ie: http://www.mysite.com, http://www.my_isp.com/my_site, etc).
- Lastly, change the GALLERY_NAME definition to whatever you named your Gallery module.
- modules/Your_Account/index.php:
- Find the function "docookie", somewhere around line 691. Change the line reading
setcookie("user","$info",time()+2592000);
to setcookie("user","$info",time()+3600);
This makes the users cookie expire after an hour, forcing the to log back in again if they come back tomorrow.
- Find the function "login", it should be right underneath the "docookie" function. Immediately after the include("config.php"); line, add the following:
# COPY CURRENT TIME TO PREVIOUS TIME AND UPDATE CURRENT TIME IN USER TABLE.
$gettime = "SELECT user_id,user_current_visit,user_last_visit FROM ".$user_prefix."_users WHERE username='$username'";
$timeinfo = $db->sql_query($gettime);
$usertimes = $db->sql_fetchrow($timeinfo);
$updatesql = "UPDATE ".$user_prefix."_users SET user_current_visit='".time()."',user_last_visit='".$usertimes[1]."' WHERE user_id='".$usertimes[0]."'";
$updatequery = $db->sql_query($updatesql); Each of these two changes to this file can be found in the index_php_patch file.
Save those changes, and point your browser to your website's address followed by "add_fields.php" (ie http://www.yoursite.com/add_fields.php). This will update your Nuke database. Once the update is complete, delete the add_fields.php file. Add/activate the block through the admin menu, and you're set.
|
| | |
|
Re: Updated Albums block for Gallery (Score: 1) by RandyO on Friday, June 13, 2003 @ 18:02:32 CDT (User Info | Send a Message) | That was a request I made and thank you so much! I do find your site full of great help by the way |
|
Re: Updated Albums block for Gallery (Score: 1) by chumpo on Friday, July 18, 2003 @ 08:46:17 CDT (User Info | Send a Message) http://www.chumpo.com | nice block. it took seconds to add to my site. www period chumpo period com [wwww.chumpo.com] i'm not sure why you don't include the install instructions text on this page in a text file included with the zip that one downloads. you know, install instructions?
keep up the kick rump nuke/gallery work.
would it be possible to build a block that would display the most viewed photo in gallery? maybe make it adjustable to display most viewed today, this week, month, year? or perhaps a block that showed' the most commented on photo?
curious chumpos what to know. |
|
|
|
|
|