Module: ARTFU: Auto rename filename, title, url - automatically on upload

tforward

Joined: 2012-08-08
Posts: 10
Posted: Thu, 2012-08-09 06:21

Yes, the table's there with 10962 for all "album_count" entries.

And cut/paste of mod page ARTFU entries:

artfu incr_length 6
artfu incr_start 310962
artfu inc_title 1
artfu inc_url 1
artfu pad_zero empty
artfu to_incr 1
artfu to_item_id empty
artfu to_prefix 1
artfu to_prefix_val fb
artfu to_suffix empty
artfu to_suffix_val suffix

Hmmmm.... just realized. 10962 vs 310962. Could the string be getting truncated somewhere before it gets entered?

 
tforward

Joined: 2012-08-08
Posts: 10
Posted: Thu, 2012-08-09 05:22

OK, I just totally cleared out the album photos using the gallery "organize album" util and confirmed the folder was empty using cpanel's file manager. Uploaded 118 pics using Gallery3's "add photo" button, all having numeric filenames like "46548913489443213.jpg" and only the first was renamed to fb310962.jpg.

In case it matters, here's my DB info.

Server: Localhost via UNIX socket
Server version: 5.1.63-cll
Protocol version: 10
MySQL charset: UTF-8 Unicode (utf8)

Curiouser and curiouser.

 
jnash
jnash's picture

Joined: 2004-08-02
Posts: 814
Posted: Thu, 2012-08-09 17:06

Bug fixed in v6 - http://codex.gallery2.org/Gallery3:Modules:ARTFU

Download and install v6 from the link above.

Thanks tforward!

Oh, also, you might want to clear out the artfu_counts table where the album_id = 0 (or if you haven't used it fully yet, just empty the table)

FYI -> [ for some reason I dropped a line that saved out the parent_id of the item (the album it belongs to) along with the incremented value, thus, subsequent attempts to rename resulted in the conflict and failed out. ]

 
tforward

Joined: 2012-08-08
Posts: 10
Posted: Thu, 2012-08-09 20:46

Oh, BOOM, I caused an upgrade LOL. Thank you so much, jnash!!

Will make the changes and let ya know how it worked.

Cheers very much to you!

 
tforward

Joined: 2012-08-08
Posts: 10
Posted: Fri, 2012-08-10 04:58

Repeated the same 100+ upload... works perfectly!

Thank you so very much!

 
jnash
jnash's picture

Joined: 2004-08-02
Posts: 814
Posted: Fri, 2012-08-10 13:46

Perfect, thanks for the feedback. Glad it worked out. Stupid error, missed a line.

 
tforward

Joined: 2012-08-08
Posts: 10
Posted: Fri, 2012-08-10 20:01

No worries at all!

Quick question. The album-name/folder-name still shows up in the URL. Am I missing something in the settings?

I kind of expected "mydomain.com/fb3194467" in the address bar when viewing the album and pics but...

"mydomain.com/index.php/album-name/fb3194467" is what I'm seeing.

I'm sure I'm missing something perfectly obvious.

Thanks.

 
jnash
jnash's picture

Joined: 2004-08-02
Posts: 814
Posted: Sat, 2012-08-11 00:46

No, what you're seeing is the way the gallery works. There isn't (an easy) way to do what you're presenting. It would require some masterful rewrite rules, and is outside the scope of this module.

 
tforward

Joined: 2012-08-08
Posts: 10
Posted: Sat, 2012-08-11 04:51

Ah, thank you. Will still continue to use ARTFU because I love the auto rename.

:)

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Sat, 2012-08-11 06:02
Quote:
I kind of expected "mydomain.com/fb3194467" in the address bar when viewing the album and pics but...

"mydomain.com/index.php/album-name/fb3194467" is what I'm seeing.

How would one differentiate from fb3194467 being in two or more albums? Why not just place all items in the root album?

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
tforward

Joined: 2012-08-08
Posts: 10
Posted: Sun, 2012-08-12 02:37

Dave, I think I was originally thinking the incremented ARTFU numbers would all be unique values in the same way item_ID is. But unique numbers for the file renaming isn't needed. In fact, maybe two minutes ago I discovered the .htaccess file in the Gallery3 root, found the commented out lines to remove "index.php" from the URL, turned that on, and promptly slapped myself in the head.

ARTFU's folder and file renaming combined with the mod rewrite already in the .htaccess file gave me precisely what I was looking for.

Thanks, Dave and jnash!