Module: preformatted URLs (attachment + screenies, yay)

blazin6543

Joined: 2005-12-04
Posts: 5
Posted: Sun, 2005-12-04 22:13

no luck for me... i installed the new nightly or w/e it is and same errors.....o well i guess i wont have this mod

 
Continental

Joined: 2004-06-14
Posts: 243
Posted: Tue, 2005-12-06 10:16
Quote:
Installation/Requirements
This module requires CoreAPI 6.10 and ModuleAPI 2.4 (latest nightly snapshot of G2).

Where can I get this module working on 2.0.2 (core 1.0.0.2) stable version? not cvs?
If not provided, I'll upgrade, but I do not want to (for some reasons)

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Tue, 2005-12-06 12:55

as it says, it requires the latest nightly snapshot.
you can edit module.inc and change the requirements to 6.0, 2.0, but i'm not 100% sure if it will work.

 
shocksll
shocksll's picture

Joined: 2005-06-22
Posts: 352
Posted: Tue, 2005-12-06 17:42
Continental wrote:
Where can I get this module working on 2.0.2 (core 1.0.0.2) stable version? not cvs?
If not provided, I'll upgrade, but I do not want to (for some reasons)

You can always use an older version like the 0.8.x series. I use 0.8.5 just fine on my stable 2.0.2 (core 1.0.0.2).

 
Continental

Joined: 2004-06-14
Posts: 243
Posted: Thu, 2005-12-08 23:16

I moved to cvs, some 5 min before I had this answer... ;-) so now I'm 0.9.2 user and would like to ask the following thing:

I have resizes (in the order I have them):
640x640 (just for viewing)
320x320 (to insert in text)
1024x1024 (full size)

Strange for me, but very good, that g2 gets resize N2 (320x320) when showing short urls for resizes.

1. why this and not the others?
2. why geturls doesn't show all resizes?
3. how can I get the 640x640 path for download (even manually)?

thx

 
Continental

Joined: 2004-06-14
Posts: 243
Posted: Sun, 2005-12-11 19:15

any answer on previous topics?

also some suggestion:

1/ can we add ALT-attribute in IMG tag?
2/ can we change "title" instead of "click for image"?

how to do it?

 
ZyreX

Joined: 2004-03-04
Posts: 43
Posted: Mon, 2005-12-12 11:16

yes, as mentioned, I would like to use the 640x480 picture as a thumbnail, like this:

[img]http://zyrex.org/gallery/d/10400-2/DSC03328.jpg[/img]

the thumbnails are sooo small.. but, it works like a dream :)

 
Taps7734

Joined: 2005-09-15
Posts: 17
Posted: Sun, 2005-12-18 02:57

I really need to start poking though the code first and see if I can add it myself.... but Im not as proficient with PHP... sorry... but I have been an ASP man for the last however many years... but I can fumble my way through PHP code sometimes....

I'm thinking of one more addition to both the HTML and BBCode links..... a thumbnail that directs to a resized image.... with a seperate one for each resized sizes... Would be somewhat like the resized to original link....

Which leads me to wonder which resize photo it picks??? If I have 2 different resizes, say one that is 320x320, and another that is 640x640... which one is the resized one that this module uses?? I need to go poking around and do some testing..... otherwise trying to add stuff like this will get confusing.... nothign like having to choose between 50 different bits of code.....

Hmmm... then there is the possibility of having three seperate drop down menus on the GET URLS page.....
one for format (HTML or BBCode),
one for link data (Original Image, original image page, resized #1 image, resized #1 page, resized #2 image, resized #2 page, etc)
one for image data (text, thumbnail, resized #1, resized #2, original, etc)

Then use a javascript to have the dropdown menus create the tags on the fly.... so there is only one link to copy....

Just a thought.....

 
oRi0n

Joined: 2005-12-30
Posts: 3
Posted: Fri, 2005-12-30 00:44

I have gallery 2.0.2 and geturls 0.8.5. I've set [URLs] View formatted URLs permission for everybody, but i can't still see the thumbnails outside my site. Plz help me!

 
oRi0n

Joined: 2005-12-30
Posts: 3
Posted: Mon, 2006-01-02 01:31

I found the problem...it was not related to this module, just "Block hotlinked items" activated...

 
Stolnvw

Joined: 2005-06-14
Posts: 33
Posted: Sat, 2006-01-14 06:37

Gallery version = 2.1.0- core 1.0.18
geturls version = 0.9.1

getting a GalleryStatus undefind class error after fixing the coreapi and moduleapi numbers

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Sat, 2006-01-14 12:27

i've just attached geturls 0.9.3 which is for current nightly snapshots (and Gallery 2.1.0).
no new features, just applied the API changes and repackaged for our early adopters :)

 
Stolnvw

Joined: 2005-06-14
Posts: 33
Posted: Sat, 2006-01-14 13:07

Thanks that one works without errors

 
zedlander
zedlander's picture

Joined: 2005-11-27
Posts: 28
Posted: Mon, 2006-01-16 14:40

Hey, this is a great module. I went through the GetUrls.tpl template to make the html image codes validate with XHTML 1.1. They should be self-closing, <img src="..." />. I changed them all, and the updated file is attached. The original was from the 0.9.3 for Gallery 2.1.0 release.

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Mon, 2006-01-16 17:34

thanks, updated.

 
zedlander
zedlander's picture

Joined: 2005-11-27
Posts: 28
Posted: Tue, 2006-01-17 12:11

Another little update.
I added the alt="" attribute to the links as well, to comply with standards.
I also added onclick="this.focus(); this.select();" to all the input fields, which selects the whole field when you click on it. It's helpful for me (as a firefox user), since the copy to clipboard fuctions don't work.

By the way, is this the normal way to work on a project like this? Make changes and attach the file? I've never worked on an open-source project before...

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Tue, 2006-01-17 18:25

the geturls module is not an official module and as such not part of the project. so how we handle this module and its changes is not representative for open source or Gallery :)

feel free to apply your changes to the module and upload a new zip.

what holds me from packaging this module as an official one is that it needs some cleanup, still.
the GetUrls.tpl file is a mess. it's very repetitive with a hell lot of url encoded html for javascript etc.
so it needs a little refactoring.

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Tue, 2006-01-17 18:59

for gallery there are generally 3 levels of source control...
1) individual or small group of devs, relatively infrequent updates --- just post code in forums
2) more rapid development or larger dev group --- request access to use CVS on gallery-contrib
3) dev group wants to make an official module --- write unit tests, request code review, get module into gallery CVS

 
NBrady

Joined: 2005-10-07
Posts: 77
Posted: Sun, 2006-01-22 22:23

so is there a way to change the thumbnail dimensions?

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Mon, 2006-01-23 00:01
 
kezzi

Joined: 2006-01-26
Posts: 2
Posted: Thu, 2006-01-26 08:50

I'm still having strange issues with this. I'm running a 2.1 nightly (24/01/06) with version 0.9.3 of this mod and I still don't get the options.
Does anyone have any ideas?

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Thu, 2006-01-26 19:54

kezzi, please post your question in the new 3rd party plugins forum with [geturls] in the topic title. Be sure to describe the behavior you expect and what happened.. thanks.

 
sunkit

Joined: 2005-08-02
Posts: 23
Posted: Sat, 2006-03-04 04:47

May I ask some question?

I am using G2 2.0.3 and geturl 0.9.0, I just want to change those formatted links that will open in new windows when click, how can I do this?

THX

 
Coquevas

Joined: 2006-03-11
Posts: 3
Posted: Sat, 2006-03-11 16:15

zedlander, I'm trying to use your tpl instead of the original one, but seems impossible.

I replaced the file, nothing
Disable an re-enable the module, nothing
Uninstall and reinstall the module, nothing

Any idea?

Also I don't see the alt="" attribute inside the tpl file.

 
shocksll
shocksll's picture

Joined: 2005-06-22
Posts: 352
Posted: Sat, 2006-03-11 22:00

Did you clear your template cache?

Steve Lineberry

 
Coquevas

Joined: 2006-03-11
Posts: 3
Posted: Sun, 2006-03-12 03:37

Ok, my memory had played a dirty trick on me. I believed that the cache was cleared but actually not :( Thanks.

I'm still looking for the nonexistent alt="item title" attribute.

 
shocksll
shocksll's picture

Joined: 2005-06-22
Posts: 352
Posted: Tue, 2006-03-14 17:24
valiant wrote:
$this->_reg_objects['g'][0]->url(array('arg1' => "view=core.DownloadItem",'arg2' => "itemId=".($this->_tpl_vars['child']['thumbnail']['id'])), $this);

or something like that.

Valiant, sorry for going 4 months back on this reply, but this is the first chance i've gotten around to trying the code you suggested since i'm working on upgrading my themes to work in 2.1. What i'm trying to do is get the thumbnail id for the current album for album.tpl and current photo for photo.tpl that i'm currently viewing. I was attempting this by

$this->_tpl_vars['theme']['item']['thumbnail']['id']

(in {php} tags of course, don't ask, long story)

instead of using the geturls callback. Well that above doesn't seem to work. That's why I added the callbacks into this module as a way of passing in the current item's id and getting it's thumbnail id. So, it's not a big problem because the current version of geturls still includes the callbacks I added. But is there a way to do what I want without using the geturls callback? Thanks.

 
Coquevas

Joined: 2006-03-11
Posts: 3
Posted: Tue, 2006-03-14 17:51

Ok, now there is really alt attribute for the html <img> tags, I don't know BBCode too much but I think there is no alt for BBCode.

I added the next code to the tag generation, inside the img tag: alt=&quot;{$theme.item.title|escape}&quot;

 
shocksll
shocksll's picture

Joined: 2005-06-22
Posts: 352
Posted: Tue, 2006-03-14 19:06
shocksll wrote:
But is there a way to do what I want without using the geturls callback? Thanks.

So to answer my own question, i added this code

$theme =& $template->getVariableByReference('theme');
	list ($ret, $thumbnail) = GalleryCoreApi::fetchThumbnailsByItemIds(array($item->getId()));
	if ($ret) {
		return array($ret->wrap(__FILE__, __LINE__), null);
	}
	if (!empty($thumbnail)) {
		$theme['item']['thumbnail'] = (array)$thumbnail[$item->getId()];
	}	

to the showPhotoPage and showAlbumPage functions in the theme.inc after the loadCommonTemplateData call. Once that was done I could use

$this->_tpl_vars['theme']['item']['thumbnail']['id']

to access the thumbnail id.

 
edalzell

Joined: 2003-04-06
Posts: 14
Posted: Fri, 2006-03-24 05:49

When might a version compatible with G2.1 come out?

Edit: didn't see the first post...version already out!!

 
joe7rocks
joe7rocks's picture

Joined: 2004-10-07
Posts: 560
Posted: Thu, 2006-03-30 22:42

is it only me who get an additional "?" after every url?
like |url=http://mysite.com/g2/v/exiftest/P1000598.JPG.html?||img|http://mysite.com/g2/d/748-2/P1000598.JPG?|/img||/url|
using it in a 2.1install

 
NBrady

Joined: 2005-10-07
Posts: 77
Posted: Thu, 2006-04-13 21:27

I get that same error to joe7

 
Banta

Joined: 2006-04-18
Posts: 35
Posted: Sat, 2006-04-22 02:12

Sorry to be dense,

What do I have to do to install this into the latest g2.1 ? I DL it and copied it to the gallery2/modules folder, but it never did show up in my admin>modules list. So, I cannot seem to figure out how to complete the install.

Thanks for your help

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Sat, 2006-04-22 03:12

make sure you have modules/*/module.inc
post in the 3rd party plugins support forum for any additional questions.

 
rebel2k

Joined: 2002-10-18
Posts: 39
Posted: Sun, 2006-05-07 19:13

seems that geturls plugin isn´t working with gallery 2.1.1 or????
+

Quote:
Gallery-Version = 2.1.1 Kern 1.1.0.1
PHP-Version = 4.3.3 apache2handler
Webserver = Apache/2.0.48 (Linux/SuSE)
Datenbank = mysqlt 4.0.15, lock.system=flock
Werkzeuge = ArchiveUpload, Exif, Gd, ImageMagick, NetPBM, Ffmpeg, Thumbnail
Beschleunigung = none, none
Betriebssystem = Linux h51539 2.4.29 #3 SMP Tue Feb 15 01:47:49 CET 2005 i686
Standard-Motiv = PGtheme
Sprache = de_DE
Browser = Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.0.3) Gecko/20060426 Firefox/1.5.0.3

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Sun, 2006-05-07 23:55

formatted urls works with g2.1 / g2.1.1 and there's an old version available that works with 2.0 as well.
http://codex.gallery2.org/index.php/Gallery2:User_Contributions#Modules

 
ashsimmonds

Joined: 2006-05-08
Posts: 2
Posted: Mon, 2006-05-08 14:45

so was the bit about choosing which resize to show in the R2F option ever discovered? :?

 
dshah

Joined: 2005-11-04
Posts: 23
Posted: Sat, 2006-05-20 01:09

I installed the module, but it doesn't show up the links etc when guest is surfing gallery (without login). Is there a way to make sure links are visible to ALL

 
morphix

Joined: 2006-05-25
Posts: 3
Posted: Thu, 2006-05-25 17:05
dshah wrote:
I installed the module, but it doesn't show up the links etc when guest is surfing gallery (without login). Is there a way to make sure links are visible to ALL

I'm actually having the exact same problem. I've tried messing around with the various settings in Formated Urls thing but none of them seem to do anything.

In particular these

Show URLs available for:
Anonymous users
Active user

The rest of the stuff works as intended but it would be nice to have the formatted urls show up for people who don't register. As the site is just designed for me to upload the albums and friends be able to hotlink the pictures on their various myspace bullshit blogs.

 
Ilse

Joined: 2005-09-27
Posts: 19
Posted: Sat, 2006-07-29 09:04

This is wonderful module! I was just looking for it when I came across this post. I immediately installed it and it's working perfectly! Thank you very much for this module!

Regards,
Ilse M
~Scrapping is not just a hobby, but a way of life~
Look for my gallery at:
http://www.ilsesjournal.com/gallery

 
vaporinc
vaporinc's picture

Joined: 2004-04-01
Posts: 13
Posted: Sun, 2006-08-13 17:28
Quote:
dshah wrote:

I installed the module, but it doesn't show up the links etc when guest is surfing gallery (without login). Is there a way to make sure links are visible to ALL
I'm actually having the exact same problem. I've tried messing around with the various settings in Formated Urls thing but none of them seem to do anything.
In particular these
Show URLs available for:
Anonymous users
Active user
The rest of the stuff works as intended but it would be nice to have the formatted urls show up for people who don't register. As the site is just designed for me to upload the albums and friends be able to hotlink the pictures on their various myspace bullshit blogs.

- Download the module. The download location is listed on the User Contributions page.

- Install and activate the module

- In site admin -> Formatted URLs, you can change the settings

- In site admin -> themes -> matrix (or any other theme), you can instantiate the formatted URLs block, e.g. add it to the photo blocks list

- In main.php edit permissions, you can add the [geturls] View Formatted URls to the everybody or any other group

- In the item action links in the sidebar, you can click on view formatted URLs

- If the the option is enabled to show URLs under each thumbnail in the album pages, you can click on + under each thumbnail to see the formatted URLs

 
hebergeo

Joined: 2006-08-25
Posts: 1
Posted: Fri, 2006-08-25 04:46

Hey there, nice mod too bad it ain't working for anonymous surfers.

I did all mentionned aboved, only registred users can see url. Most people really dont care that register user see it .. You should def set it so when we install it, anonymous users surfing can see it. That it not the case atm.

Download the module. The download location is listed on the User Contributions page.

- Install and activate the module - I did that

- In site admin -> Formatted URLs, you can change the settings - I did that

- In site admin -> themes -> matrix (or any other theme), you can instantiate the formatted URLs block, e.g. add it to the photo blocks list - I did that

- In main.php edit permissions, you can add the [geturls] View Formatted URls to the everybody or any other group - Can you explain ? which main.php ? what line ? what code needs to be change ?

- In the item action links in the sidebar, you can click on view formatted URLs - I did that

- If the the option is enabled to show URLs under each thumbnail in the album pages, you can click on + under each thumbnail to see the formatted URLs - I did that

nice mod, too bad its not user friendly, and you need to have 2 hours hacking files to try to have it work

Atm its not working on my gallery for anonymous

 
ayamaguc

Joined: 2006-10-02
Posts: 21
Posted: Mon, 2006-10-02 23:23

Thanks all for putting together a very nice mod. I grabbed the 2006/01/14 package as linked here
http://codex.gallery2.org/index.php/Gallery2:UserContributions#Modules

and it is working fine (Gallery 2.1.2). I've also played with the Zedlander (whole field select) and Coquevas (alt tag) updates to GetUrls.tpl and they work as expected. Grab the Coquesvas one from further in the thread -- it includes both enhancements. Don't forget to clear your template cache after replacing the file.

I was thinking it over, and off the top of my head, there are four types of content to embed (text link, thumbnail, resize, and full size), and four possible destinations (album view page, resized image, full image, and none/no link). 16 cases, though 2 are dupes, so 14. This mod really only addresses 4 of them. So I was thinking of going in and hacking around to try to extend it (HTML only -- I know nothing of BBCode which is just barely less than I know about PHP).

As I see it, I would need to add to the checklist of options in the Admin panel and extend the set of URLs that are created with the appropriate code, right? I think enough cases are covered that I can do this by example, but any info from the knowledgeable would be appreciated.

Any suggestions, tips, warnings, guides, etc.?

 
mikeage
mikeage's picture

Joined: 2005-01-23
Posts: 138
Posted: Mon, 2006-10-16 11:03

I've created a slightly modified version of this module (which I love, BTW!) with the following changes:
* Added configuration option to show or hide the IE specific "copy-to-clipboard" links (default: yes)
* Added configuration option for the width of the textbox in the album view for each element (default: 25 (the previous fixed value))
* Added Zedlander's patch to auto-select the text of a URL
* Added Coquevas's patch to set the alt tag
* Increased version number to 0.9.4 (since the database schema changed (additions only))

I have a two more things I'd like to do:
1. Customize the type of output returned (as per ayamaguc's email) to select exactly what type of combinations are desired (link to full image, thumbnail link to resized image, resized image, link to page containing the resized image, etc)
2. Remove the ? after each link. I'm not sure where that's coming from, though

Anywhere, he's my version of geturls 0.9.4. I've tested it on 2.1.2 only.

 
sameoldg

Joined: 2006-07-18
Posts: 5
Posted: Tue, 2006-10-17 00:58

I am using gallery 2.1a and the 9.3 module does not seem to work. After uploading it, it does not appear in the admin->modules page. Also, i dont have URL_Rewrite activated, is that module needed? i also tried the 8.5 version but and that would load in the admin screen with the error that my core and module api version did not match. my core and module apis are 7.3 and 3.0 respectively. After editing the module.inc file of the 8.5 version to allow my api's i recieved this error when trying to install the module<br>
Fatal error: Call to undefined function: iserror() in /hsphere/local/home/bombacla/bigservings.com/gallery/modules/geturls/module.inc on line 64
<br>Is there away to edit the code so that i can use either the 8.5 or the 9.3 module. Thanks.

 
IceStorm

Joined: 2006-10-28
Posts: 14
Posted: Sat, 2006-10-28 19:41
sameoldg wrote:
I am using gallery 2.1a and the 9.3 module does not seem to work. After uploading it, it does not appear in the admin->modules page. Also, i dont have URL_Rewrite activated, is that module needed? i also tried the 8.5 version but and that would load in the admin screen with the error that my core and module api version did not match. my core and module apis are 7.3 and 3.0 respectively. After editing the module.inc file of the 8.5 version to allow my api's i recieved this error when trying to install the module<br>
Fatal error: Call to undefined function: iserror() in /hsphere/local/home/bombacla/bigservings.com/gallery/modules/geturls/module.inc on line 64
<br>Is there away to edit the code so that i can use either the 8.5 or the 9.3 module. Thanks.

In the MODULES section of administration, look for the FORMATTED LINKS under "Display". Thats what its called.

 
sameoldg

Joined: 2006-07-18
Posts: 5
Posted: Sat, 2006-10-28 21:33

Thanks for the reply Icestorm. I have the module installed now however i am having problems using it with phpbb none of the images will show up they at best i can get links. Any ideas how to fix this.

here is the page i used to test it.

http://www.bigservings.com/phpbb/viewtopic.php?p=22#22

 
FastZ
FastZ's picture

Joined: 2005-05-09
Posts: 26
Posted: Tue, 2006-10-31 05:54

Hey guys, I ran into a small snag here trying to install this module. This is what showed up on my site admin > modules page for the Formatted Links module:

Status: Incompatible Module (Inactive)
Formatted Links 0.9.2
Show BBcode/HTML formatted URLs
Incompatible module!
Core API Required: 5.1 (available: 7.2)
Module API Required: 0.10 (available: 3.0)

I changed the 5,1 and 0,10 on lines 46-47 (was 47-48 for me) to 7,2 and 3,0 and that got rid of the error on the modules page under site admin but then when I got to install the module from the link to the right of it on the modules list, it just pulls up a blank page and doesn't go any further. Any help?

EDIT: I installed the 0.93 version of this module. Here is what I get when I try to install the module from the Site Admin > Modules page:

 Error (ERROR_COLLISION) : Duplicate permission id: geturls.view

    * in modules/core/classes/helpers/GalleryPermissionHelper_advanced.class at line 853 (gallerycoreapi::error)
    * in modules/core/classes/GalleryCoreApi.class at line 879 (gallerypermissionhelper_advanced::registerpermission)
    * in modules/geturls/module.inc at line 63 (gallerycoreapi::registerpermission)
    * in modules/core/classes/GalleryModule.class at line 157 (geturlsmodule::upgrade)
    * in modules/core/AdminModules.inc at line 64 (geturlsmodule::installorupgrade)
    * in main.php at line 199 (adminmodulescontroller::handlerequest)
    * in main.php at line 87
    * in main.php at line 80

System Information
Gallery version 	2.1
PHP version 	4.4.4 cgi
Webserver 	Apache
Database 	mysql 4.1.18-standard-log
Toolkits 	ImageMagick, Gd
Operating system 	Linux cgi1102.int.bizland.net 2.4.32-grsec #1 Fri Mar 17 12:22:27 EST 2006 i686
Browser 	Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1) Gecko/20061010 Firefox/2.0
 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Tue, 2006-10-31 07:42

your problem is similar to this:
http://gallery.menalto.com/node/29469

you'll have to manually fix the db, but it should be easy. don't forget to clean the cache once you're done.
FAQ: How can I clear cached data?

 
FastZ
FastZ's picture

Joined: 2005-05-09
Posts: 26
Posted: Tue, 2006-10-31 21:58

Explain this to me because That thread you sent me to might have well been written in Egyptian.

mindless wrote:
you need to remove any rows for comments module from table g2_PermissionSetMap. the module must have been installed sometime before and was not uninstalled properly.

Where is this table g2_PermissionSetMap?

And plus I'm pretty sure I have never installed this module EVER and there is no way to uninstall it from the Site Admin > Modules page.