"last 5 updated galleries" - PHP & Standalone

KGJohnson
KGJohnson's picture

Joined: 2003-06-30
Posts: 25
Posted: Thu, 2004-02-19 09:00

I'm building a new welcome page for my site and want to show a random picture and the last 5 updated albums.
I have the random picture working in standalone ! Hooray ! Thanks go to http://www.barcahall.com/gallery-block-random.html for an excellent web page with clear instructions.
The framework for the new page is at http://www.toxicstar.co.uk/random.php and I'm now looking for the source and the "Iframe" HTML to support the "last 5 albums updated".
The wiki link which should cover this http://www.transitgallery.com/files/ doesn't appear to work now and I cannot find a recent thread.

I've just upgraded my gallery to version 1.4.2 and wondered if somebody out there could supply me with the source and some instructions to install.

I'm not looking for anything exotic... as I have zero PHP skills, so please be gentle and don't assume it's obvious. Believe me, I find it isn't most of the time.

Thanks in advance. :D

 
drazin

Joined: 2002-11-23
Posts: 144
Posted: Thu, 2004-02-19 19:42

you can find it with a quick search.

to see it in effect....www.drazin.org

 
ppmnt
ppmnt's picture

Joined: 2003-01-12
Posts: 238
Posted: Mon, 2004-02-23 17:22

KGJohnson,

I got your Yahoo ping. Check out this thread: http://gallery.menalto.com/index.php?name=PNphpBB2&file=viewtopic&t=3630&postdays=0&postorder=asc&start=0

This is where I originally explained how to do this (with recursive albums). I have updated the first post to make it easier to read. The links to transitgallery don't work anymore, he has taken the files down. However, that was the old version anyway, it only included top level albums. In the post above you find instructions for inlcuding all sub-albums.

If you have issues with it, please post in that thread.

Good luck! :D

 
KGJohnson
KGJohnson's picture

Joined: 2003-06-30
Posts: 25
Posted: Tue, 2004-02-24 09:04

ppmnt,

Thanks for the offer of support I was beginning to worry. I pinged your yahoo ID after already reading your posting that you have attached. All 46 pages of it. I must confess to being more confused at the end than the beginnng. I think that may have something to do with the way the topic moved around several modules and it's massive length. As mentioned, I got the block-random.php working in no time as the instructions from Jeff where clear and designed for a standalone site. I had assumed that the last-updates.php would be a similar level of complexity. So added the last-updates.php to gallery root, then added the IFRAME & javascript logic to my web page. My initial attemps however didn't work so...

Can I ask a small favour. To level set and confirm I'm doing and using the right things.. can you attach to this posting a few items to get me started.

1) I'm running 1.4.2 and would like a last-updates.php file which works with this version.
2) A sample of the IFRAME source which uses this file. (I'm one of those freaky non-nuke people)
3) If required a sample of the javaScript to support the IFRAME resizing. This assumes that Jeff's script isn't appropriate.
4) Any additional changes needed. i.e. adding the last-updates.php to the "safe" modules in the gallery/index.php
5) Any hints and tips on installing.

In return should I ever get it working I will write a little web page for future users. Problably along the lines that Jeff did for block-random.php... if I cannot tread on his generous nature to append it to his page.
I appreciate that there are other modules such as "10 Top albums" but I'm just intrested in the "last updates" for the moment.

Small steps !

 
KGJohnson
KGJohnson's picture

Joined: 2003-06-30
Posts: 25
Posted: Mon, 2004-03-01 09:06

ppmnt & Jeff,

Well I gave it another go over the weekend without any luck.

I followed the instructions as per the original thread. I didn't try to build in the iframe functionality as the last-updates.php came back with nothing.
On a positive note with a combination of Jeff's IFRAME example, JadeDragons skins and eclecticpixels customisation tutorial I now have a header & footer wrap and colour scheme that matches the rest of my website.
With a little help hopefully I can get the last updated working and then I will be a very happy bunny.

Could the issue be around the fact I'm running version 1.4.2 ? Could this have any implications ?
Any way I have attached the files I've used... what I did was...

Following the original thread...
1) Added the three functions to the end of the AlbumDB.php file in the classes folder.
2) Added the last-updates.php file linked from the posting into the gallery root.
3) Added the last-updates.php to the include in the root Index.php as a "safe_to_include".

I tried to run the last-updates.php direct and get an empty HTML shell. I checked the albums directory and it doesn't hold a cache... which I assume should be there as you get with the random block.
I did switch "debug" on in the gallery configure but that didn't seem to do anything and I couldn't find a file being created.

I'm at the end of my limited expertise. I know this can work because Jeff got it working from the original posting. So it has to be something I'm doing or not doing... or a conflict with the version I'm running. I'm happy to stick some debug "displays" into the last-updates,php if somebody can tell me what to do.

HELP PLEASE !

 
ppmnt
ppmnt's picture

Joined: 2003-01-12
Posts: 238
Posted: Tue, 2004-03-02 05:04

KGJohnson,

I was out of town last week, but I did see your posting. I am working on a page right now on my web site that will explain how to do this better than just the original thread. While I'm at it I'm also modifying the code with some improvements.

Now I don't know about 1.4.2, I'm not running it yet. I know thow that it works fine with all versions since 1.3.3 (and also before then). Also, it works for a lot of folks, you are only the second person to have the problem with the cache file not being created. And to tell you the truth, the last time that happened I was just puzzled.

So other scripts can create their cache file fine?

 
ppmnt
ppmnt's picture

Joined: 2003-01-12
Posts: 238
Posted: Tue, 2004-03-02 06:20

March 1, 2004-
I've still been getting quite a few requests for help with these scripts. I realize that this is not the easiest thing to do if you are not familiar with PHP. So I've decided to put together some >> help pages << on these two features (last X updates and top X albums).

I have also updated the code and improved the scripts some, as well as made it easier to customize. For example, it is now easy to set the number of albums to be displayed. You can also display the top X albums with a rank (like on >> my web site <<).

Unless you already have it working and you are happy with it, please download the new versions.

I have updated the first post of the original thread.

 
KGJohnson
KGJohnson's picture

Joined: 2003-06-30
Posts: 25
Posted: Tue, 2004-03-02 16:24

Thanks for the help.. I managed to get something working, with the new scripts, which is a step forward. The refereance web page is excellent, just what is needed. Perhaps you and Jeff could reference each others pages. The two of you should be added to the Gallery site as reference for "add-ons".

Two problems remain, which I would appreciate help with...

The links show as abbreviated which my normal links are much longer
FROM PHP... http://www.toxicstar.co.uk/gallery/Feb2004
MINE IN WEBSITE... http://www.toxicstar.co.uk/gallery/view_album.php?set_albumName=Feb2004
The abbreviations don't work on my site. I had thought this was "short-names" and something you switched on but I have looked through the configuration pages and not found anything in 1.4.2. Will keep looking as I'm sure it must be there. But should the php code generate whatever is appropriate ?

I cannot seem to be able to force the format to shrink. My play/demo page is http://www.toxicstar.co.uk/last.php. Tried all the usual combinations.

 
ppmnt
ppmnt's picture

Joined: 2003-01-12
Posts: 238
Posted: Tue, 2004-03-02 17:47

KGJohnson --

Thanks, I'm glad you like it. I hope it'll make it easier in the future. :wink:

That's great news that you got it, well, sort of working! The issue with your URLs is mod_rewrite. Gallery uses an Apache module called mod_rewrite to shorten the URLs and make them more human-friendly. You can find info on this in in the gallery documentation >> here <<.

This is optional. There is a .htaccess file in your gallery install directory that does the rewriting (well, that is it tells Apache how to rewrite it) if your web server supports it. The last updates script uses the same function as gallery to create the album URL, there should be no difference between links created by gallery as opposed to links created by this script. For some reason, those links are being rewritten, while others are not, almost like it thinks that mod_rewrite is enabled.

There are other important values in your .htaccess file, so don't just remove or rename it.

According to Netcracft you are running Apache 1.3.28, so using mod_rewrite should not be a problem. If you own the Apache server, you could check that mod_rewrite is enabled. Otherwise you might want to check with your hosting provider to make sure it is enabled and working correctly (it can be very useful, and newer versions of Apache have it enabled by default).

Hope that gets you started,
~Eva

 
KGJohnson
KGJohnson's picture

Joined: 2003-06-30
Posts: 25
Posted: Tue, 2004-03-02 22:26

ppmnt,

Not disputing what you say... especially as I don't know much about this... I will read the posting you mentioned.

However if it's a setting then why does the block-random work fine and presents the correct extended link not the shortened one ?

This would tend to imply the lastXupdates isn't constructing the link in the same was as block-random is able to ? Would random-block approach not be better as I don't then need to worry about environment setting with my ISP. Who I think are unlikely to change the server settings for me.

No advice about the font handling ? Your web page implied the font would come from the webpage that is being invoked.

Regards
Kevin

 
ppmnt
ppmnt's picture

Joined: 2003-01-12
Posts: 238
Posted: Thu, 2004-03-04 02:02

Just to update others that might be reading this, we resolved Kevin's problem with Instant Messanger. His .htaccess file didn't have the proper entries for rewriting short URLs. He is now using an iframe to show this on his web site.

To fix the font issue he is now reading a style file. I will update the scripts to allow that option soon.

~Eva

 
KGJohnson
KGJohnson's picture

Joined: 2003-06-30
Posts: 25
Posted: Mon, 2004-03-15 16:32

Thanks to Jeff and especially PPMNT for all their help. It was painful experience all round but I got there with their help.

I have wrote a support page of my experiences for those who come later. I don't plan to support it but feel free to use it.

http://www.toxicstar.co.uk/Gallery_lastXupdates.htm

I still have a wish to understand the way links are built so I don't need to use mod_rewrite but that has not stopped it working. If I ever find the time to resolve the problem I will add it to the page.

Thanks to one and all.... !

Regards
Kevin :lol:

 
the_menace

Joined: 2004-02-16
Posts: 39
Posted: Mon, 2004-03-15 17:24

Hi there. I was wondering if somebody could help me out with my problem related to this one. I was able to install the lastxupdates.php and it worked fine except when I used it as an Iframe. Its the only method that I can use for my page because I can't change the extension to .php.

I have this code that I'm using but it always stretches out the page when I add the Iframe code in between. It would be nice if somebody fix this for me.

<table width="100%" cellpadding="2" cellspacing="0" border="0" class="forumline" bgcolor="#F48520" style="border-collapse: collapse" bordercolor="#111111">
<tr>
<td class="catHead" height="25"><span class="genmed"><b>Latest Albums</b></span></td>
</tr>
<tr>
<td class="row1" align="left"><span class="genmed" style="line-height: 150%">

<iframe width="300" height="320" frameborder="0" src="http://www.sac-life.com/gallery/lastXupdates.php">

<br />

 
KGJohnson
KGJohnson's picture

Joined: 2003-06-30
Posts: 25
Posted: Tue, 2004-03-16 08:51

Hello,

If you read mine or Jeff's support pages you will see a javascript to resize the IFRAME. If that doesn't work then it's just the way you are building your HTML tables.

If you also change the table width from "100%" to "300" which is changing it from 100% to 300 pixels (your IFRAME size). You may also find this helps.

Also for future reference adding the link to your test page helps people review the code in context. Rather than embedding code in the thread.

Regards
Kevin :D

 
Terje-
Terje-'s picture

Joined: 2004-01-20
Posts: 90
Posted: Tue, 2004-03-16 12:48

Is there a way we can get this working without using the mod-rewrite URLs? I'm not using apache, hence the links are not working. :-|

 
KGJohnson
KGJohnson's picture

Joined: 2003-06-30
Posts: 25
Posted: Tue, 2004-03-16 16:29

I'm sure there is but it's beyond my current understanding of PHP. I won't have a reply in the shortterm. Sorry

Perhaps somebody with the expertise can help ?

 
orayoflighto

Joined: 2003-11-23
Posts: 25
Posted: Thu, 2004-09-09 22:30

I a trying to do exactly what KGJohnson did only I want to use the include function to call the lastXupdates.php and the block-random-enhanced.php

I got them both to work but my problem lies when I call them both using include fuctions.

eg:
<?PHP
include("/lastXupdates.php");
?>
<?PHP
include("/block-random-enhanced.php");
?>

I read that lastXupdates.php borrowed some code from the random script and I am wondering if there is a problem with using the same variable or something like that.

the error I get is:

Fatal error: Cannot redeclare editfield() (previously declared in /util.php:27) in util.php on line 27

any ideas?

 
KGJohnson
KGJohnson's picture

Joined: 2003-06-30
Posts: 25
Posted: Mon, 2004-10-04 14:35

Hi,

Just back from an absence and I'm catching up on the backlog :lol:

I cannot check as your profile/note doesn't have a website.

Are you still needing assitant ?

Regards
Kevin