Module: preformatted URLs (attachment + screenies, yay)

rebel2k

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

Damn, it seems that the 'img' bbcode tags did not work in all forums that uses bbcode!

any idea why?
I THINK, but I am not sure, some forums checks if the file in the 'img' tag is a real .gif / .png .jpg file!
Am I right?
I show you an example what I mean:
the thumb I want to include:
http://www.wallpapergallery.org/main.php?g2_view=core.DownloadItem&g2_itemId=2039
and that one for validating:
http://www.wallpapergallery.org/images/abm.jpg

Result: (click to expand)
[img]http://www.wallpapergallery.org/images/www.wallpapergallery.org_small.jpg[/img]

Maybe my configuration is bad??!?
Please help me.

best regards
Rebel2k

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Sat, 2005-10-15 15:16

rebel2k
yes, some forums (e.g. phpbb) only accept urls that are simple .jpg / .gif / .png addresses.

so you should enable G2's short urls (activate the rewrite module) and you're set.

 
rebel2k

Joined: 2002-10-18
Posts: 39
Posted: Sat, 2005-10-15 20:09

thx! I will try it soon!

but an other case:

seems that unregisterd users did Not see the Get item URLs link in the navigation menu!

How can this could be fiexed?

 
bgolat

Joined: 2005-10-20
Posts: 3
Posted: Fri, 2005-10-21 00:08

any updates on this? i would like unregistered users to be able and see.

 
shocksll
shocksll's picture

Joined: 2005-06-22
Posts: 352
Posted: Fri, 2005-10-21 14:11
bgolat wrote:
any updates on this? i would like unregistered users to be able and see.

Did you set the permissions correctly? See http://pictures.thelineberrys.com/gallery2/gallery2.php?g2_view=core.ShowItem&g2_itemId=27&g2_navId=x75edd9a0

You are an unregistered user and you should be able to get the urls. You have to give everybody access to [URLs] View formatted URLs

 
rebel2k

Joined: 2002-10-18
Posts: 39
Posted: Tue, 2005-10-25 14:26

damn you are right shocksll! Thanks for you hint ;) now it works well!!

just one think I must to know:

how can I make this plugin multilanguage?
maybe it would be enough when I could translate "Quick URLs" in 2-3 other languages!

 
ZyreX

Joined: 2004-03-04
Posts: 43
Posted: Wed, 2005-10-26 12:55

as I asked about earlier, is it possible to use the resized image rather than the thumbnail?
When showing pictures in forums, it's more reasonable (IMHO) to show the resized image, e.g. 640x480..

If that had been possible, I would love this plugin more than I already do..

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Sun, 2005-11-06 00:33

i've downloaded geturls-0.8.5.zip and changed a few things.
- coding style: changed variable, class names (camelstyle)
- coding style: lines should be max 100 chars long
- fixed and removed a lot of things that didn't make sense
- weird: Callback.inc didn't serve a purpose before
- removed: getItemAdminViews
- changed: the view is now a normal view, it's no longer an admin view
- added: formatted URLs block: you can use it in the sidebar or on photo / album pages (see site admin -> themes -> themename -> blocks)
- added: GuestMode: choose in site admin whether to show URLs for the active user or for anonymous users
- added: shows now links for all items (album, photos, data items in general). resizes and fullsize only for photo items
- block options: width of the input fields (determines width of the block), showWarnings (long warnings are ugly in the sidebar)
- changed: warnings are only shown if we're in guestMode

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Sun, 2005-11-06 02:06

cool, now unit test it and put it in bharat's review queue :)

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Sun, 2005-11-06 02:12

nah, it's not ready for primetime, but much better than before.
GetUrls.tpl is a little messy, gotta rethink when to show what and clean up the html. maybe add JS to show the whole output minimized and only show more on click. minor changes needed.
then unit tests and then i'm +1 for a commit.

@module authors:
feel free to enhance the 0.9.0 version of the module. just wanted to clean it up a little since sooner or later, it would have been needed anyway :)

 
shocksll
shocksll's picture

Joined: 2005-06-22
Posts: 352
Posted: Mon, 2005-11-07 12:21
valiant wrote:
- weird: Callback.inc didn't serve a purpose before

I was using the callback.inc in one of my themes to get the url of a child thumbnail on an album and/or photo page. Is there a better way to do that? Thanks for all your work.

 
shocksll
shocksll's picture

Joined: 2005-06-22
Posts: 352
Posted: Mon, 2005-11-07 12:30

So to answer my own question it does look like that instead of this

$this->_reg_objects['g'][0]->url(array('arg1' => "view=core.DownloadItem",'arg2' => "itemId=".($this->_tpl_vars['block']['geturls']['LoadUrls']['thumbid']))

I should be doing this

$this->_reg_objects['g'][0]->url(array('arg1' => "view=core.ShowItem",'arg2' => "itemId=".($this->_tpl_vars['child']['thumbnail'])), $this);

But on an album or photo page would this code work?

$this->_reg_objects['g'][0]->url(array('arg1' => "view=core.ShowItem",'arg2' => "itemId=".($this->_tpl_vars['item']['thumbnail'])), $this);

There was some reason I made the callback.inc but I'm trying to remember why.

Steve Lineberry

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Mon, 2005-11-07 12:44

ah, sorry for removing it then.

$this->_reg_objects['g'][0]->url( ?

i guess you call there
global $gallery;
$urlGen =& $gallery->getUrlGenerator;
$url = $urlGen->generateUrl(...);

so it seems you want a DownloadItem link. not a ShowItem link. or do you want a clickable thumbnail?

if you're in a photo.tpl, then you should use {g->url arg1="view=core.DownloadItem" arg2="itemId=`$theme.item.thumbnail.id`"} could work for just a thumbnail
clickable thumbnail in album.tpl:
{g->image id="%ID%" item=$child image=$child.thumbnail class="%CLASS% giThumbnail"}

maybe if you explain what exactly you're trying to do, i could help.
if you need to load extra data for your theme, then I'd do it in theme.inc and not in the callback of geturls.

 
shocksll
shocksll's picture

Joined: 2005-06-22
Posts: 352
Posted: Mon, 2005-11-07 14:06

Ok, check out this page for instance.

http://eclecticthreads.thelineberrys.com/gallery2/gallery2embedded.php?g2_view=core.ShowItem&g2_itemId=1153

Click on customize and add to cart.

This will popup another window with the thumbnail image of the item in a box and allows people to enter values in the boxes.

So in the theme, I need to pass this popup page the url for the thumbnail in the querystring. I can get the url of the thumbnail for a child object in the album and according to your code above I should be able to get the thumbnail for an album/photo.

The reason i'm using php code instead of smarty code is because i'm calling some php functions I wrote in the smarty template, so no i'm not doing global $gallery...etc. I'm just doing a php block in the smarty template.

I'll give your code a shot when I get a chance. Originally when I was making this I just couldn't figure out how to get the thumbnails I needed so I created the callback in the getitemurls. Thanks.

Steve Lineberry

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Mon, 2005-11-07 14:39

$this->_reg_objects['g'][0]->url(array('arg1' => "view=core.DownloadItem",'arg2' => "itemId=".($this->_tpl_vars['child']['thumbnail']['id'])), $this);

or something like that.

 
pippin88

Joined: 2005-09-17
Posts: 23
Posted: Thu, 2005-11-10 08:18

Nice changes valiant.

How do I make it a block but only visible to logged in users? Is this possible?

Could you make it possible to get all the URLs for an album at once from the album menu?

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Thu, 2005-11-10 13:39

this already works.
when using this new module version, you need to uninstall the previous one first.
but then it works.
edit permission -> [URLs] View formatted URLs
add / remove this permission from the everybody / registered users group if you want.

 
pippin88

Joined: 2005-09-17
Posts: 23
Posted: Sat, 2005-11-12 09:30

Got it working cheers Valiant.

Willing to have a look at giving a page of URLs coverin every item in an album?

 
Dutchovens

Joined: 2005-11-16
Posts: 3
Posted: Thu, 2005-11-17 05:59

When I try to edit permission -> [URLs] View formatted URLs in 8.5.0 and 0.9.0 I get this error:

Quote:
Error Detail -
Error (ERROR_STORAGE_FAILURE)

* in modules/core/classes/GalleryStorage/DatabaseStorage.class at line 1238 (gallerystatus::error)
* in modules/core/classes/GalleryStorage.class at line 294 (mysqldatabasestorage::addmapentry)
* in modules/core/classes/interfaces/GalleryAccessMap.inc at line 97 (gallerystorage::addmapentry)
* in modules/core/classes/helpers/GalleryPermissionHelper_advanced.class at line 310 (galleryaccessmap::addmapentry)
* in modules/core/classes/helpers/GalleryPermissionHelper_advanced.class at line 80 (gallerypermissionhelper_advanced::_changepermission)
* in modules/core/classes/GalleryCoreApi.class at line 671 (gallerypermissionhelper_advanced::addgrouppermission)
* in modules/core/ItemPermissions.inc at line 203 (gallerycoreapi::addgrouppermission)
* in main.php at line 174 (itempermissionscontroller::handlerequest)
* in main.php at line 87
* in modules/core/classes/GalleryEmbed.class at line 153
* in index.php at line 148 (galleryembed::handlerequest)

System Information
Gallery version 2.0.1
PHP version 4.3.11 cgi-fcgi
Webserver Apache
Database mysql 4.0.24-max-log
Toolkits ImageMagick, Gd
Operating system Linux linhostjava04.prod.mesa1.secureserver.net 2.4.21-27.ELsmp #1 SMP Wed Dec 1 21:59:02 EST 2004 i686
Browser Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Thu, 2005-11-17 12:52

i guess upgrading doesn't work 100%. please deactivate and uninstall the module, then install it again.

 
Dutchovens

Joined: 2005-11-16
Posts: 3
Posted: Thu, 2005-11-17 17:20

I got it working. I was trying to activate it for everyone and it didn't work, but when I use it for Registered Users it works fine.

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Thu, 2005-11-17 19:08

what exactly doesn't work? adding the geturls permission to the everybody group?

 
Dutchovens

Joined: 2005-11-16
Posts: 3
Posted: Fri, 2005-11-18 05:23

Adding the geturls permission to the everybody group causes that error, but when I tryed adding it to the Registered Users group it worked fine.

I only allow registered users to access the gallery anyway, so I'm fine with it this way, but it might be different for other people.

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Fri, 2005-11-18 13:39

well, i can't reproduce the error... if it happens to anyone else, please let me know.

 
chacness

Joined: 2005-11-19
Posts: 5
Posted: Sat, 2005-11-19 21:30

I have version 0.9.0 of the module installed and I am getting a weird output for my link.
I get this "<a href="v/slamfest/DSCF0007.JPG.html">click for image</a>"
when I should be getting this
"<a href="www.mysite.com/gallery2/v/slamfest/DSCF0007.JPG.html">click for image</a>"
Anyone got any ideas?

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Sat, 2005-11-19 21:42

ah, bharat's relative URL changes in the core code have also a consequence on this module. i'll fix it.

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Sat, 2005-11-19 22:19

a fixed version (0.9.1) is attached to the first post.

 
bdmilitary

Joined: 2005-11-23
Posts: 9
Posted: Wed, 2005-11-23 10:31

Hello,

I am having some problems. I installed everything correctly but the main problems are:

1. I want normal viewers to be able to see the URL codes too. How do I do that?
2. You know on Photobucket.com, Imageshack.us and tinypic.com the URL codes are available on Photo and album view withgout clicking on any dropdown menus. Is their a way for me to display the URL codes on the photo view atleast?

[img]http://photobucket.com/tutorials/images/background_image.jpg[/img]

Many thanks in advance.

BMF Webmaster
My gallery: http://www.bdmilitary.com/gallery/main.php

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Wed, 2005-11-23 13:45

1. edit permissions, add permission for geturls view formatted urls to the everybody group (or to the registered users group)
2. not yet. we could add a getItemSummaries function, then you'd have it

 
pippin88

Joined: 2005-09-17
Posts: 23
Posted: Wed, 2005-11-23 23:57

I'd really like what bdmilitary is asking for, the only real missing feature of this great mod.

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Thu, 2005-11-24 01:20

i have it working, but now we need a whole bunch of other options. -> what to show as itemSummaries.
what labels? i guess you don't want decriptions there, just
URL [____]
BBCode [____]

etc.

plesse provide such short titles for all existing features of this module, then i can change the module accordingly.

 
bdmilitary

Joined: 2005-11-23
Posts: 9
Posted: Thu, 2005-11-24 01:34

Valiant the custom features should be like this:

Hotlink for forums (1) [IMG]http://img502.imageshack.us/img502/6751/bdmil4uc.png[*IMG]
Hotlink for forums (2) [img=http://img502.imageshack.us/img502/6751/bdmil4uc.png]
Hotlink for Websites <a href="http://imageshack.us"><img src="http://img502.imageshack.us/img502/6751/bdmil4uc.png" border="0" width="600" alt="Image Hosted by ImageShack.us" /></a>
Show image to friends http://img502.imageshack.us/my.php?image=bdmil4uc.png
Direct link to image http://img502.imageshack.us/img502/6751/bdmil4uc.png

The main aim I want to establish with my gallery is:

1. Have an image sharing/hosting service going
2. Image rating feature
3. Integration with my IPB database.

If I can get these three main features going I will be very happy since this this definitely the best gallery management software I have seen. I am really happy about it so far.

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Thu, 2005-11-24 01:40

actually, i think "Hotlink" is not a very common word, users won't understand it.
And "Hotlink for forums (1)" is too long.
remember, you don't want to have a album view that has too much stuff under each thumbnail.

 
bdmilitary

Joined: 2005-11-23
Posts: 9
Posted: Thu, 2005-11-24 01:55

Valiant you are current, how about we just have "URL"?

Also I mainly want the full URL short cut codes on the Photo view pages as they will all fit their properly. In album view we could just have URL (The direct link) and thumbnail URL code linking to main photo page.

Thank you.

 
pippin88

Joined: 2005-09-17
Posts: 23
Posted: Thu, 2005-11-24 02:03

valiant - will we be able to select which ones we want to show like we currently can on the photo pages?

I only use the BBcode clickable thumbnail line, so the naming isn't a big issue for me.

What about calling them BB, HTML, Full?

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Thu, 2005-11-24 02:15

i'm experimenting. currently, i have added a javascript block toggle. so if you click on +, you see the URLs for a thumbnail, else it's just a single line.

 
bdmilitary

Joined: 2005-11-23
Posts: 9
Posted: Thu, 2005-11-24 02:22

That is an excellent idea Valiant! I think we could fit all the features in the Photo view if we use the "+" block toggle.

 
bdmilitary

Joined: 2005-11-23
Posts: 9
Posted: Thu, 2005-11-24 02:43

Valiant can you also add a select (highlight) + copy feature for all the shortcut URL codes to make it easier for users because I have the PG theme and right click on their is disabled. Thank you.

 
pippin88

Joined: 2005-09-17
Posts: 23
Posted: Thu, 2005-11-24 03:16

That's a neat idea bdmilitary.

So I can grab all the pictures clickable thumbs very quickly rather than lots of selecting, then copying then pasting.

However, I think having this as a menu (as in the menu on the side containing add photos etc) item would be better. Just a link that you click on and it copies all the appropriate URLs. Different menu items for different types, eg HTML or BBCode

Possible?

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Thu, 2005-11-24 03:43

i really want someone other to work on this module. i'm too busy.

i've added getItemSummaries in version 0.9.2 (get it from the first post). you can disable it in the site admin view.

it looks awful, that should be motivation enough to improve it.

things that need to be refactored in this module:
- templates/GetUrls.tpl is a big mess: it does too much logic (if/then/else, ..). Move as much logic as possible to the helper class function.
- Use different templates for the view, block and the itemSummaries.
- Add more site admin options
- Clean up GetUrlsSiteAdmin.inc controller, do first input validation, then db queries
- the helper function should better accept a list of Ids (better performance for getItemSummaries

Style:
- the getItemSummaries "block" needs a better html/css style etc.

much to do...so please someone take the 0.9.2 version of this module and work on it

 
bdmilitary

Joined: 2005-11-23
Posts: 9
Posted: Thu, 2005-11-24 04:53

I got error when I tried installing it. Where can I get Core API & Module API upgrade?

IT SAYS:

Incompatible module!
Core API Required: 6.10 (available: 6.8)
Module API Required: 2.4 (available: 2.0)

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Thu, 2005-11-24 04:57

upgrade to the latest nightly snapshot of G2. download link is in the upper right of this page.

 
bdmilitary

Joined: 2005-11-23
Posts: 9
Posted: Thu, 2005-11-24 09:53

Can you give me the exact link because I don't want to destroy the gallery as their are two nightly shots folders.

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Thu, 2005-11-24 14:38

downloads -> Nightly snapshots: Jesse Mullan's page -> gallery2
G2/gallery-2.0.1+-nightly.zip
or
G2/gallery-2.0.1+-nightly.tar.gz

 
bdmilitary

Joined: 2005-11-23
Posts: 9
Posted: Fri, 2005-11-25 11:04

Valiant I don't want people seeing the original images. Can you please redirect the watermarked version.

For example when I click on the second BBCode Formatted Links option (Show image directly:) it shows:
[img]http://www.bdmilitary.com/gallery/d/927-1/Armed+Forces+Medical+College+_2__+Airport+Road_+Dhaka.jpg[/img]

But I want the watermarked picture instead - like this one:
http://www.bdmilitary.com/gallery/v/land/army/formations/Armed+Forces+Medical+College+_2__+Airport+Road_+Dhaka.jpg.html

Will this be possible?

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Fri, 2005-11-25 11:15

for now, someone else has to develop this module further.
and you better activate hotlink watermark support.

 
blazin6543

Joined: 2005-12-04
Posts: 5
Posted: Sun, 2005-12-04 19:48

ok im gonna try installin the nightly thing but will i lose any of the work i already have on my site? including modules or anything else?

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Sun, 2005-12-04 20:26

you shouldn't lose anything.

 
blazin6543

Joined: 2005-12-04
Posts: 5
Posted: Sun, 2005-12-04 20:34

so i just upload the files into the gallery folder and override every file and reinstall or what? ive never done this with gallery2 :(

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Sun, 2005-12-04 20:53

FAQ: How to upgrade Gallery2?
or look at your README.html

use FTP to overwrite all files.