Permalink module: permanent short URLs for your albums and images

paour
paour's picture

Joined: 2002-08-14
Posts: 1479
Posted: Thu, 2005-09-29 16:28

The Permalinks module is now in CVS

If you track CVS, please remember to delete your modules/permalinks directory before you cvs update -d.

What does it do?

One of the nice and bad aspects of G1 was that the namespace of albums was flat: you couldn't have two albums named the same within the same gallery. G2, with its truly hierarchical albums, fixes this, at the expense of those nice short descriptive URLs: URLs in G2 are either very long or meaningless (with the rewrite module).

With Permalinks, you can have the best of both worlds: short descriptive URLs for some of your albums (and even any other item) which have the added benefit of not changing if you move an album into a different parent album.

How to use:

After activating the module, you need to enable the corresponding URL Rewrite (the URL Rewrite module also needs to be enabled). Once that's done, you can define a Permalink for any item in that item's edit interface. You can then access the item using a short URL that doesn't depend on the item's location, like

New version (1.0.3)

  • renamed to Permalinks
  • added ability to automatically create permalinks when a new album is created
  • moved the permalinks creation interface to the General tab in Edit Item (instead of its own tab)
  • moved to a map rather than an entity
  • needs the current CVS version of Gallery (Gallery 2.0.2 is not recent enough)
  • unit tests

How to upgrade (from FlatUrl)

  • if you want to keep your existing mappings, make a copy of the g2_FlatUrl table to a new table called g2_FlatUrl1
  • disable and uninstall the FlatUrl module
  • in the Maintenance section of the admin interface, delete the database cache
  • extract the permalinks.zip file into the modules directory
  • install and enable Permalinks
  • you can copy your existing mappings with the following query (you may need to alter it slightly):
 insert into g2_PermalinksMap select g_aliasName, g_destId from g2_FlatUrl1
AttachmentSize
permalinks.zip25.28 KB
 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Thu, 2005-09-29 17:01

kudos :)

let me know if you need some hints on the automatic creation of flat urls.
basically, you have to listen for entity:save events, check the entityType (isa GalleryAlbumItem) and then add the flat url.

 
robert070612

Joined: 2003-08-05
Posts: 565
Posted: Thu, 2005-09-29 17:16

paour---- I saw FlatURL in SourceForge but couldn't make any difference (to my test site) with it. Having the same trouble with this attachment (probably the same zip). The FlatURL stuff appears in the right places but no flat namespace just the same (clean) existing hierarchy;~/ Yes, URLrewrite is active and I have enabled FlatURL's option within URLrewrite. What gives? Does FlatURL only work on a G2 that's in the root or still called gallery or something?
----best wishes, Robert

 
pelle
pelle's picture

Joined: 2004-12-10
Posts: 389
Posted: Thu, 2005-09-29 17:29

Great to see someone make use of the rewrite module :)

From what I've understand (correct me if I'm wrong, I looked through it quickly) this is passive, as in doesn't create the flat urls for core.ShowItem links. I think you'll be glad to know that I'm working on a system to allow modules to register functions when parsing keywords (eg, f/%flat% - where %flat% is replaced with the flat url). This new system is working for mod_rewrite (you'll see some other options too, not yet coded) and if you want I could send you the code to play with.

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Thu, 2005-09-29 17:45

what about calling this module "permalinks" or something like that, since it creates permanent links to items...
hmm, maybe flat urls is also fine :)

 
robert070612

Joined: 2003-08-05
Posts: 565
Posted: Thu, 2005-09-29 18:00

Yes please pelle, just as long it isn't 'too' tricky;~)

 
paour
paour's picture

Joined: 2002-08-14
Posts: 1479
Posted: Thu, 2005-09-29 22:31

Yeah, permalinks is a better name. As you can tell, I was casting around for a better name. I guess once I've added the unit test code, I'll put it in CVS, with this new name.

Gallery Remote developer

 
paour
paour's picture

Joined: 2002-08-14
Posts: 1479
Posted: Thu, 2005-09-29 22:33

pelle: yes, you mentioned that in your email. Since my needs were simple, I stuck with the what was currently available, though I had to cast around a bit before I found the keyword that worked for me :-)

Gallery Remote developer

 
paour
paour's picture

Joined: 2002-08-14
Posts: 1479
Posted: Thu, 2005-09-29 22:35

icpix, once it's installed, you can create the flat URLs in the item's (album or image) Edit Item page.

Gallery Remote developer

 
robert070612

Joined: 2003-08-05
Posts: 565
Posted: Fri, 2005-09-30 21:56

paour: (been away all day - birthday)

!? As per my initial comment above.

I think everything is in place (as far as I can tell), but I can't see any difference from the out-of-the-box heirarchy to the one apparently organised by FlatURL;~/

Something is amiss, perhaps it's my expectations or understanding. I have put word values into the (FlatURsL) alias box but I see nothing different to the URL of that photo or album;~/ It's there, I change the alias, but all is still the same. Rewrite is activated too.

Existing URL:
ht*p://mysite.com/stock/v/public/cornwall/west-penwith/050828_49745.jpg.html

Alias box:
whatever

Actual resulting FlatURL:
ht*p://mysite.com/stock/v/public/cornwall/west-penwith/050828_49745.jpg.html

Expected FlatURL:
ht*p://mysite.com/whatever

Or perhaps:
ht*p://mysite.com/whatever.jpg.html

----best wishes, Robert

 
paour
paour's picture

Joined: 2002-08-14
Posts: 1479
Posted: Sat, 2005-10-01 09:59

Creating a FlatURL for an item doesn't mean that when you navigate to the item, G2 will automatically use the short URL for it. It means that if you do type in the corresponding short URL, you'll get to the item.

Gallery Remote developer

 
robert070612

Joined: 2003-08-05
Posts: 565
Posted: Sat, 2005-10-01 10:33

paour---- Oh dear, my fault;~/ I had assumed that as it involved the (url) rewrite module that FlatURL acted similarly. All my pictures have unique filenames (Date_CanonSequenceNbr.jpg). The out-of-the-box urls (with all the PHP & and ? and = stuff) are uncomfortable to use and view. The much cleaner, thoroughly logical and Search Engine Friendly urls generated by the rewrite module are clearly much easy to use, impressively nicer on the eye and search engine friendly. I was hoping that FlatURLs would give my unique filenames the opportunity to be <ht*p://mysite.com/filename>. There would be no search engine (file not found) issues with any movement around directories on the grounds of creativity or logicality.
----best wishes, Robert

 
rebel2k

Joined: 2002-10-18
Posts: 39
Posted: Sat, 2005-10-15 14:42

Have i to edit all my photos and albums to geht this flaturl feature to all my pics?

 
bluefin
bluefin's picture

Joined: 2003-10-02
Posts: 9
Posted: Sat, 2005-10-15 22:43

I just installed Gallery 2.0.1 with embedded into Drupal 4.6.0. It appears that flaturl doesn't seem to work correctly in this embedded environment? I get the following error:

Quote:
Error (ERROR_MISSING_OBJECT, ERROR_UNKNOWN) : Parent 7 path f

* in modules/core/classes/helpers/GalleryFileSystemEntityHelper_simple.class at line 118 (gallerystatus::error)
* in modules/core/classes/GalleryCoreApi.class at line 1762 (galleryfilesystementityhelper_simple::fetchchildidbypathcomponent)
* in modules/core/classes/helpers/GalleryFileSystemEntityHelper_simple.class at line 63 (gallerycoreapi::fetchchildidbypathcomponent)
* in modules/core/classes/GalleryCoreApi.class at line 1708 (galleryfilesystementityhelper_simple::fetchitemidbypath)
* in modules/core/classes/GalleryView.class at line 344 (gallerycoreapi::fetchitemidbypath)
* in modules/core/classes/GalleryView.class at line 219 (showitemview::_getitem)
* in main.php at line 287 (showitemview::doloadtemplate)
* in main.php at line 87
* in modules/core/classes/GalleryEmbed.class at line 153
* in /data/web/wicked/public/modules/gallery/gallery.module at line 276 (galleryembed::handlerequest)
* in ??? at line 0
* in /data/web/wicked/public/includes/menu.inc at line 354
* in /data/web/wicked/public/index.php at line 18

My embedded environment is /gallery2/ on the filesystem. The Drupal module is gallery.module, which is accessed as http://www.wickedar.com/gallery

I created a flaturl alias for an album, named "Wicked_Ocean", which should create the flaturl link of:

http://www.wickedar.com/gallery/f/Wicked_Ocean

But I get the above quoted error when accessing it. The non-rewrite URL (eg the long link) of:

http://www.wickedar.com/gallery?g2_controller=flaturl.Redirect&g2_filename=Wicked_Ocean

works just fine. So the REWRITE URL doesn't seem to be mapped correctly through the embedded Gallery installation. I did check and the REWRITE rules and CONDITIONS exist in the .htaccess file in the Gallery2 install directory.

Any thoughts? Thank you!

I look forward to the flaturl working, and working such that the Gallery installation automatically generates *and* UTILIZES all flaturls natively. This is somethign Drupal does with it's "clean urls" implementation - it makes things look so ... damned clean ... and professional. It's a nasty mess having all of the ? and & embedded URL stuff.

Thank you. (Yes, I did the setup steps under the rewrite module, and created the flaturl alias without any problems).

 
pelle
pelle's picture

Joined: 2004-12-10
Posts: 389
Posted: Sun, 2005-10-16 15:05

The way URL Rewrite works does not allow your base file name in the pattern. With Gallery standalone you may not for instance have any patterns with 'main.php' in them. With drupal short urls turned on you may not have 'gallery' in the pattern. However, if you have drupal and dont turn on the short urls you may have 'gallery' in your pattern since the base file is index.php?q=gallery.

Why it works for show item: It's actually not the Gallery patterns that catches this case, its durpal. Try index.php?q=gallery/your/path.jpg

Background: We provide a block/watermark hotlinked files feauture. This is possible thanks to mod_rewrite doing an internal redirect and reparsing the url. Gallery restricts hotlinked files by query string variables - thus we need to rewrite any short style url first and then parse the url once more. To prevent an infinite loop we need to break at a sertain point -> when the url contains the base file (main.php or in your case gallery).

 
comstimpy

Joined: 2005-11-03
Posts: 2
Posted: Thu, 2005-11-03 14:17

I downloaded flaturl/permalink but I haven't seen, or can't find instructions on where to place the file, and how to activate it. I placed the file into /gallery/modules and checked the modules page in site admin, but don't see it listed to activate. Any assistance would be appreciated.

 
comstimpy

Joined: 2005-11-03
Posts: 2
Posted: Thu, 2005-11-03 14:31

Please disregard previous post...guess I had some premature panic :)

 
guertin

Joined: 2004-11-11
Posts: 19
Posted: Thu, 2005-11-10 17:16

FlatURL is a nice tool. However, I've run into a little problem with symlinks and FlatURL. I'm wondering if anyone has any insight into what might be going on.

I just installed a new web server and took the opportunity to install Gallery 2. My old web server had Gallery 1.4. Since all my old albums were accessed through the URL http://caddis.middlebury.edu/gallery/ and my new ones use the URL http://caddis.middlebury.edu/gallery2/, I made the symlink gallery -> gallery2 in my web server, and everything works fine.

However, I also have some URLs out there that point directly to some of my old albums, such as http://caddis.middlebury.edu/gallery/lime_rock_scda_2005. Even after installing FlatURL in gallery 2, these direct links don't work. However, http://caddis.middlebury.edu/gallery2/lime_rock_scda_2005 does work. Note the "gallery2" in the URL. IOW, the symlink gallery -> gallery2 does not work with FlatURL.

Any ideas? Right now none of my old links to albums are working. :-(

 
pelle
pelle's picture

Joined: 2004-12-10
Posts: 389
Posted: Thu, 2005-11-10 17:57

You should create an empty directory called gallery and place a .htaccess file there to redirect all old G1 URLs to your G2. It is descirbed in the migrate module on how to achive this. Upon migration you get the option to save the old URL map for all G1 items.

 
guertin

Joined: 2004-11-11
Posts: 19
Posted: Thu, 2005-11-10 18:53

Thanks! Serves me right for not RTFM-ing carefully enough. :-)

 
paour
paour's picture

Joined: 2002-08-14
Posts: 1479
Posted: Mon, 2005-12-12 11:54

I've updated the module to 1.0.2. Read the top of the thread.

The new version will be committed to CVS as soon as I write some unit tests for it. If you're tracking CVS, save yourself the trouble and wait for the CVS version.

--
Gallery Remote developer

 
minoltamaniac
minoltamaniac's picture

Joined: 2005-10-03
Posts: 83
Posted: Mon, 2005-12-12 15:38

Hi, is there another place to download this mod? Like some other zip files I download from this site I get an error trying to open the zip with multiple unzipping programs.
"End-of-central-directory signature not found. Either this file is not a Zip file, or it constitutes one disk of a multi-part Zip file"

Please direct me to copy of the zip or otherwise that I can open. I don't seem to have any problems with any other zips other than the ones that come from this menalto site.

thx

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Mon, 2005-12-12 15:55

use firefox and not internet explorer to download the file.

 
paour
paour's picture

Joined: 2002-08-14
Posts: 1479
Posted: Mon, 2005-12-12 16:06

minoltamaniac: which browser are you using? I think Firefox would work better if you're using IE. At this point there is no alternate download site.

--
Gallery Remote developer

 
minoltamaniac
minoltamaniac's picture

Joined: 2005-10-03
Posts: 83
Posted: Mon, 2005-12-12 16:37

Duhhh, sorry I spaced trying a new browser, all good now. Why is it ie can't handle some of the zips on this site anyway?

Thanks for the quick replies.

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Mon, 2005-12-12 17:00

that's really offtopic, please continue this zip problem issue in another topic. short answer: has to do with the webserver/php doing some compression itself.

 
minoltamaniac
minoltamaniac's picture

Joined: 2005-10-03
Posts: 83
Posted: Mon, 2005-12-12 17:45

OK, now I seem to have a problem with the mod. I have been using rewrite on 2.0.1 and I tried installing the permalinks mod to a couple of my sites. The mod is active and the permalink function in rewrite is also active. I have gallery installed on dozens of my domains and I get the same errors when trying to install on others. The ones I have tried installing this on are standalone but I have a couple doszen multisites that I will do next. Do I need 2.0.2 for this module to run? Or have I forgotten a key step? Or am I completely clueless here? I did not upgrade, I just tried to install your latest version. BTW, I have 130 photo-related domains so updating to 2.0.2 takes me a while.

edit:removed sys info

 
paour
paour's picture

Joined: 2002-08-14
Posts: 1479
Posted: Mon, 2005-12-12 17:58

Oops, you're right, it probably does need a newer revision of the core classes because it uses the new Db stuff. Even 2.0.2 won't be enough, you'll need the CVS snapshots. I'll fix the dependancy.

--
Gallery Remote developer

 
minoltamaniac
minoltamaniac's picture

Joined: 2005-10-03
Posts: 83
Posted: Mon, 2005-12-12 18:17

thanks for the quick info

 
paour
paour's picture

Joined: 2002-08-14
Posts: 1479
Posted: Wed, 2005-12-14 10:01

The module is now part of the cvs HEAD.

--
Gallery Remote developer

 
joe7rocks
joe7rocks's picture

Joined: 2004-10-07
Posts: 560
Posted: Wed, 2005-12-14 13:07

hi
nice mod, congrats! :)
before i'd setup, could you tell me if it's an option to generate "permalinks" for existant albums? :)
I just guess not all ppl find/found this before g2 install.. :)

aand is it an option too to automatically generate links on _picture_ upload?

10x

 
paour
paour's picture

Joined: 2002-08-14
Posts: 1479
Posted: Wed, 2005-12-14 14:09

joe7rocks: right now, you have to create permalinks manually, so if you have lots of existing albums it may take a while. On the other hand, if you migrated from G1, you probably have short URLs for your old albums that way :-). You can also easily generate permalinks in the DB if you know some SQL. I could help with that, or add the functionality to the module... which raises the issue of the admin interface when you have tons of permalinks...

Right now, I've only implemented the features to automatically create permalinks for new albums. It's easy to add the same for pictures, but that would make the permalinks namespace very crowded very fast...

--
Gallery Remote developer

 
joe7rocks
joe7rocks's picture

Joined: 2004-10-07
Posts: 560
Posted: Wed, 2005-12-14 14:55

hi!

Yes. Makin 2000+permalinks manually would take a while ;)
Though i have migrated from g1, but that's a bit different point of view, as my users won't see those urls anymore..so they won't be able to copypaste that links anywhere..
So you thunk 2000+ permalinks would kill the admin interface? why exactly? simple layout problems? :)

I was a bit wrong with the other thing.. certainly permlinks for pics not really needed, instead http://albumPermlink/fullUrlpart_of_pic.jpg.html would be just fine.

 
paour
paour's picture

Joined: 2002-08-14
Posts: 1479
Posted: Wed, 2005-12-14 16:10

joe7rocks: regarding the 2000+ links in the Permalinks admin page: it would look bad and take a while to download, it's better to have pagination in those cases. But it would certainly work, just ugly...

Regarding the pics permalinks: it's definitely possible, even fairly easy. I just don't think automatically creating permlinks for each image that is uploaded is really useful, but I can be convinced :-)

--
Gallery Remote developer

 
bluefin
bluefin's picture

Joined: 2003-10-02
Posts: 9
Posted: Wed, 2005-12-14 17:15
Quote:
Regarding the pics permalinks: it's definitely possible, even fairly easy. I just don't think automatically creating permlinks for each image that is uploaded is really useful, but I can be convinced

I would strongly vote for permalinks for all end-user facing items, including pics. I have been using Drupal as a CMS for ages now, and find that so many people comment on the clean URLs that is native to Drupal. I believe that Gallery should also have clean URLS through and through. It makes copy-n-paste operations easier, it helps with search engine ranking, and it's just plain classy.

I would like to see the permalinks generate all URLs and links in a clean URL style; in the same manner that Drupal does. Any link that's output by Drupal passes through the Clean URL method, and all URLs displayed and used with in the HTML code rely on it. It's a very very nice clean setup. Me likey lots...

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Wed, 2005-12-14 17:25

bluefin

permalinks in g2 is just an option/alternative. if you have the url rewrite module installed, you've got "clean" URLs anyway. the permalinks module just adds the option that if you move an item from one album to another, the short url is still the same.

 
minoltamaniac
minoltamaniac's picture

Joined: 2005-10-03
Posts: 83
Posted: Thu, 2005-12-15 02:56

The admin interface thing for large collections would be excellent because I already have about 20,000 images that I would like to get permalinked. I don't know any sql either and I am sure there are many others that would like permalinks but are in the same boat as myself.

Thank you.

 
paour
paour's picture

Joined: 2002-08-14
Posts: 1479
Posted: Thu, 2005-12-15 06:46

minoltamaniac: you seem to have edited your post like 10 times :-)

To address some of the issues you mentioned in earlier revisions of your post: Permalinks are not suited to being applied automatically to huge numbers of images, because there is no guarantee that two different images won't have the same permalink name. This makes the module name a bit of a misnomer, I realize.

If you want to use unique permanent URLs for your images, I think we need a better way to do it, and I think this discussion is going to make it happen sooner rather than later. But I think it's something that needs to be addressed by a solution that is closer to the basic core of Gallery than the Permalinks module, even if it is closer to the true meaning of what a permalink is.

--
Gallery Remote developer

 
paour
paour's picture

Joined: 2002-08-14
Posts: 1479
Posted: Thu, 2005-12-15 07:37

valiant suggested the functionality you're looking for already exists, and is easy to configure (even if it needs better documentation): in the Rewrite module admin page, edit the Show Item URL Pattern to replace v/%path% with v/%itemId%.

Boom! instant short permanent automatic legacy-supporting URLs that appear by default in your URL bar when you navigate your Gallery. Isn't it great?

--
Gallery Remote developer

 
minoltamaniac
minoltamaniac's picture

Joined: 2005-10-03
Posts: 83
Posted: Fri, 2005-12-16 00:09

paour, got you again! You will find I am the king of edit question, everywhere, everytime... Thanks for addressing whole issue and pointing out that easy change in rewrite. Yes, I am extremely pleaased and you can just kick me whenever you see me for the question switcharoos. Thanks much.

 
minoltamaniac
minoltamaniac's picture

Joined: 2005-10-03
Posts: 83
Posted: Sat, 2005-12-17 00:44

I am not happy, I made that change and crashed a site that gets 100,000 page views a day. I can't do anything, no admin, no nothing, no changeback. Please advise as this really sucks. I get this error

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
More information about this error may be available in the server error log.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

--------------------------------------------------------------------------------

This ain't cool.

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Sat, 2005-12-17 00:55

- delete the .htaccess file in your gallery2 folder
- disable the url rewrite module with a hand crafted link, see:
FAQ: Images don't show up and the album / photo links don't work, what can I do?

- visit site admin -> modules and uninstall the url rewrite module
- now you can install and activate the url rewrite module again

for future support requests, please ask in the support forums and not in the development forum.

 
minoltamaniac
minoltamaniac's picture

Joined: 2005-10-03
Posts: 83
Posted: Sat, 2005-12-17 01:12

OK, I'll remember that. I thought since it was broken in this thread it could be fixed in this thread. Guessed wrong... Please be advised that if you use paour's quick fix to pemalinks, and then you try to switch back, you may need to do some work ! Before I switched back I cans see that was not the solution I was looking for. I think my vision of permalinks might be difficult to implement anyway. Thanks for the info and sorry for the freakout.

 
minoltamaniac
minoltamaniac's picture

Joined: 2005-10-03
Posts: 83
Posted: Sat, 2005-12-17 01:50

This is my vision.

All files assigned Unique_id/regular_filename url when uploaded (or whatever works). Use mod-rewrite if needed to make search friendly url so url becomes Unique_id/search_friendly (or whatever works).

Now just make sure that it is permanent by using unique id so that when you move that image, or mess with gallery stuff, the url stays the same. Sorta like slug's uhmmmm "no broken links" setup at pbase. I know they have technical issues at times and the links sometimes break, but when his system is running properly, the links are permanent. It would be like taking slug's system and adding search words after the unique id. Pretty impossible or what?

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Sat, 2005-12-17 03:39

it's already exactly like that for downloadItem requests (short url pattern /d/id-serial/path/filename
only the id (which is unique) is used for the actual download.
serial is used for modified-since / caching. it doesn't matter if serial changes.
path/filename are ignored for downloadItem (some users think this should be fixed since it allows confusing people, e.g. d/15-2/ is a awful pciture (.e.g goatse/tubegirl, ..) and someone adds a link d/15-2/Tommy_Doe.jpg in a forum. so everyone who clicks on the url would think they see a photo of tommy when they actually get a very awful photo and some might thing that was tommy on the photo.

so permant URLs in this sense come at a cost.

so you also want this behavior for showitem urls, something like /v/id/path/file. i don't think we allow this yet. you can file a feature request though.

 
minoltamaniac
minoltamaniac's picture

Joined: 2005-10-03
Posts: 83
Posted: Sat, 2005-12-17 04:37

Yeah my goal would be this... I want rock solid urls that are search friendly. Main reason being I do over 100 of my own domains, and I use about 2 dozen gallery installations to feed static regular html pages, and external db driven php pages, with thousands of resized .jpgs created by g2 as well as feeding the catagory menus solid g2 album links. So I use about 3 different resizes created by g2 that need to stay constant forever. Ideally all original or semi-original image and page urls would stay the same after move image to other albums, as well as when you generate additional resizes on those images. So in the end I end up with about 25 g2 galleries to browse and buy images from that are also search friendly. Most of these g2 galleries contain about 2000-5000 images and each of those galleries has another just as important purpose and that is to feed images to all of my other sites. One of those sites I have is a custom built database driven photo sales site that eventually will have all images from all 25 g2 sites browsable and saleable. This site has has a huge backend for inventory control, digital download file delivery, shipping, discounting, dynamic menus, taxing, coupons, 5 level logins, affilliate programs, auto newletters, invoicing etc, etc. My other sites are all regular html pages that contain 1000's of g2 dlinks that I create by custom template. I need everything constant or I start getting red x's everywhere on the db driven site and the static sites. Myself, as my libraries grow I am constantly changing and creating albums and stuff, so I need those links to stay solid or I start seeing massive numbers of x's at my other 80 sites and on the pages that are regular html at the sites I have g2 on.

So to avoid even one red x, for now I am using the horribly laboreous technique of letting g2 do the resizes and then I throw them into a folder on the server myself, where they will stay forever.

I tried to follow your example where confusion on forum images can arrise, but I don't really see what you are saying, I guess. To me, this would be what you see is what you get permalinks, and the direct linking thing would not be a problem. Beings I don't really know how to make this solution myself since I am dumb with code, and since current permalinks and g2 does not do this trick, how exactly would you yourself, being a coder and seeing a bit of my dilemma, word this feature request if a feature request is all I can wish for? To me this would be the complete, search friendly, permalink feature. I guess that is what I should request if no one has a better idea or solution on a way to do this?

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Sat, 2005-12-17 07:42

@malicious confusion example:
the actual download url is:
- http://fbi.gov/d/15-2/agents/Tom_Peterson.jpg
a malicious person adds the following link to a website, e.g. into a forum or into an official application or so
- http://fbi.gov/d/15-2/terrorists/Ossama_Bin_Laden.jpg
or
- http://fbi.gov/d/15-2/mostWanted/deadOrAlive/Tom_Peterson.jpg

both image urls point to the same picture (id = 15).
but everyone who clicks on http://fbi.gov/d/15-2/terrorists/Ossama_Bin_Laden.jpg will see a picture of Mr Tom Peterson but they will assume that the bad guy Ossama Bin Laden looks like the guy on the photo.
so if they see Mr Peterson on the street, they will panic and alarm the police or even more, shoot the poor guy since that's the right / duty of a good American to shoot the bad guys!

hope that example was colorful enough :)

thus, you'd need a switch, whether you want "path verification" or not for short urls that have a id in them. at least.

 
minoltamaniac
minoltamaniac's picture

Joined: 2005-10-03
Posts: 83
Posted: Sat, 2005-12-17 08:07

Ok, that's what I thought you are getting at. I've pretty much dealt with worse net antics for years and I am guessing this would not concern me much. I would be certain to make this sacrifice even if it did bother me as project conclusion speed is my top priority at this point. Cleanliness can come later or on my next round of sites. Thanks for the clarity repost on that.

 
LFrank

Joined: 2005-02-19
Posts: 1023
Posted: Wed, 2005-12-21 11:07

having enabled Permalinks, activated the Rewrite-Rule and trying to go to Edit Photo/Item/Album, I get
the following (or simillar) error:



An error has occurred.

Back to the Gallery
Error Detail -
Error (ERROR_STORAGE_FAILURE)

    * in modules\core\classes\GalleryStorage\DatabaseStorage.class at line 305 (GalleryStatus::error)
    * in modules\core\classes\GalleryStorage.class at line 248 (DatabaseStorage::search)
    * in modules\core\classes\Gallery.class at line 223 (GalleryStorage::search)
    * in modules\permalinks\classes\helpers\PermalinksMapHelper.class at line 61 (Gallery::search)
    * in modules\permalinks\PermalinksOption.inc at line 93 (PermalinksMapHelper::fetchAliasesForItem)
    * in modules\core\ItemEdit.inc at line 303 (PermalinksOption::loadTemplate)
    * in modules\core\ItemAdmin.inc at line 147 (ItemEditView::loadTemplate)
    * in modules\core\classes\GalleryTheme.class at line 689 (ItemAdminView::loadTemplate)
    * in modules\core\classes\GalleryView.class at line 312 (GalleryTheme::loadTemplate)
    * in main.php at line 337 (GalleryView::doLoadTemplate)
    * in main.php at line 88
    * in main.php at line 81

I have to disable the module to be able to get into edit-mode.

Any idea what happens?
CU
Lutz

Gallery version=2.0.2+ core 1.0.10
PHP version=5.1.1 apache2handler
Webserver=Apache/2.2.0 (Win32) DAV/2 PHP/5.1.1 mod_ssl/2.2.0 OpenSSL/0.9.8a mod_perl/2.0.2 Perl/v5.8.7
Database=mysql 5.0.16-nt-log
Gallery-URL=http://lf-photodesign.de

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Wed, 2005-12-21 14:51

enable buffered debug mode to see the actual error...

 
LFrank

Joined: 2005-02-19
Posts: 1023
Posted: Wed, 2005-12-21 16:03

Oops, could have had that idea myself ... Sorry

assigned template variables:
{$ErrorPage}	Array (12)
isAdmin => 1
stackTrace => Error (ERROR_STORAGE_FAILURE)<ul><li...
code => Array (1)
  storageFailure => 1
phpversion => 5.1.1
php_uname => Windows NT DELL-4550 5.1 build 2600
php_sapi_name => apache2handler
webserver => Apache/2.2.0 (Win32) DAV/2 PHP/5.1.1 ...
browser => Mozilla/5.0 (Windows; U; Windows NT 5...
dbType => mysql
dbVersion => 5.0.16-nt-log
toolkits => SquareThumb, ImageMagick, NetPBM, Gd
version => 2.0.2+
{$SCRIPT_NAME}	/GALLERY2/main.php
{$_debug_config_keys}	Array (2)
0 => files
1 => vars
{$_debug_config_vals}	Array (2)
0 => Array (0)
1 => Array (0)
{$_debug_keys}	Array (5)
0 => ErrorPage
1 => SCRIPT_NAME
2 => head
3 => l10Domain
4 => theme
{$_debug_tpls}	Array (2)
0 => Array (3)
  type => template
  filename => themes/PGtheme/templates/error.tpl
  depth => 0
1 => Array (4)
  type => template
  filename => modules/core/templates/ErrorPage.tpl
  depth => 1
  exec_time => 1,3382790088654
{$_debug_vals}	Array (5)
0 => Array (12)
  isAdmin => 1
  stackTrace => Error (ERROR_STORAGE_FAILURE)<ul><li...
  code => Array (1)
    storageFailure => 1
  phpversion => 5.1.1
  php_uname => Windows NT DELL-4550 5.1 build 2600
  php_sapi_name => apache2handler
  webserver => Apache/2.2.0 (Win32) DAV/2 PHP/5.1.1 ...
  browser => Mozilla/5.0 (Windows; U; Windows NT 5...
  dbType => mysql
  dbVersion => 5.0.16-nt-log
  toolkits => SquareThumb, ImageMagick, NetPBM, Gd
  version => 2.0.2+
1 => /GALLERY2/main.php
2 => Array (3)
  tpl => Array (0)
  style => Array (0)
  javascript => Array (1)
    0 => lib/javascript/BlockToggle.js
3 => themes_PGtheme
4 => Array (1)
  errorTemplate => modules/core/templates/ErrorPage.tpl
{$head}	Array (3)
tpl => Array (0)
style => Array (0)
javascript => Array (1)
  0 => lib/javascript/BlockToggle.js
{$l10Domain}	themes_PGtheme
{$theme}	Array (1)
errorTemplate => modules/core/templates/ErrorPage.tpl

Gallery version=2.0.2+ core 1.0.10
PHP version=5.1.1 apache2handler
Webserver=Apache/2.2.0 (Win32) DAV/2 PHP/5.1.1 mod_ssl/2.2.0 OpenSSL/0.9.8a mod_perl/2.0.2 Perl/v5.8.7
Database=mysql 5.0.16-nt-log
Gallery-URL=http://lf-photodesign.de