Joined: Aug 30, 2005 Posts: 2204 Location: near Albany NY
Posted:
Tue Sep 12, 2006 8:24 pm
I'm guessing that the problem is that Gallery 2 deliberately "obfuscates" the name of the jpg file where the image is stored so you have to go thru the database and Gallery program to display them. I'm guessing also that the bbcode img is probably looking for an image file directly whereas the html code you wrote works okay.
So what's wrong with using the code just the way you wrote it ... if I may ask. I have a lot of Gallery images in my forum posts and that's the way I do it with Gallery 2.
So what's wrong with using the code just the way you wrote it ... if I may ask. I have a lot of Gallery images in my forum posts and that's the way I do it with Gallery 2.
Sorry, I don't quite follow. You mean you use html to display your G2 images in your forums? I suppose that's not the end of the world, but I have a number of users who might get lost in doing so, being accustomed to using the bbcode.
I just figured there was a line somewhere in a config file somewhere which would simply allow the obfuscated images to work using bbcode.
Joined: Aug 30, 2005 Posts: 2204 Location: near Albany NY
Posted:
Tue Sep 12, 2006 8:37 pm
Oh, users!&*^ ... well I suppose that if you can figure out what the jpg file names are you can do it that way. Usually what I do is go into Gallery in another window and right click on the image I want to use and click on copy image location. If I'm not mistaken with Gallery 1.5 that gave you the jpg file but with 2 it gives you the type of link that you listed. I can use the CPANel file manager to find the name of the jpg file and I'd bet that if I linked to it using the bbcode img thingy it might work. But your users won't have access to CPANEL or a similar tool so I don't see how they'd find out the jpg file name. I'll take a look at options on a couple of my systems in the next few days and see what works and what doesn't. Post here if you figure a solution first ... please.
I'll take a look at options on a couple of my systems in the next few days and see what works and what doesn't. Post here if you figure a solution first ... please.
Wow, I can't begin to thank you. For some reason this is really important to my users I've been staring the problem down for a few days now, with no luck. I'll keep at it and report back if I find anything.
Joined: Aug 30, 2005 Posts: 2204 Location: near Albany NY
Posted:
Wed Sep 13, 2006 8:23 am
Dauthus, based on my experiments this morning I think you are right. I just created a forum post trying to use the bbcode img tag but pointing it to a link like the one oy gave in his first post here and it just stripped out anything between the img tags. So that doesn't work.
OY, are you sure that first link works. Because on my system it is just stripped, I wind up with opening and closing img tags with nothing in between.
I looked at what I did in my posts and there are two ways of getting images in with Gallery2. Remember that the recommendation for installing Gallery2 is to put the albums directory (usually called g2data) outside your webroot. Unless I'm wrong then, you can't really "point" to the jpg files with a link ... they are above /. Plus you really don't want people having access to those raw files anyway I don't think. And you surely don't want to give CPANEL or equivalent to all your users.
So, what remains? One solution is to use the url bbcode tag and put the link like you did in the first post in there. That's not as "satisfying" as having the image show right in the post but on the other hand folks can just click on it and have it in a new window.
The other solution would be to copy selected gallery images over to a directory that is within your web root and let people use the img tag on these. As long as they are jpg or gif files that should work but of course an admin would have to be involved to copy the images ahead of time.
I don't have a lot of users who want to do any of this but for those few I make sure that they know about opening Gallery in a separate window or tab and right clicking on the image (it can be either the thumbnail or the full size) and then copying the image location and then pasting that into the forum post within the url tags.
Incidentally, the img src does work the way you mention OY, in a news post. But in the forums I just get the link shown on the screen and not the image.
Joined: Aug 29, 2004 Posts: 7487 Location: Arizona
Posted:
Thu Sep 14, 2006 5:44 am
Another possible solution would be to use mod_rewrite to rewrite the Gallery2 URLs so that they have .html extensions, but don't ask me how to do that (or whether it will work for sure)... as I have not played with Gallery in years.
Joined: Feb 26, 2006 Posts: 141 Location: Springfield, MA
Posted:
Sat Nov 18, 2006 10:08 pm
I'm in the same boat, but I've disabled HTML in my Forums so I either get this functionality or have to enable HTML.
In addition to integration for phpNuke, Nukedgallery.net also has integration for Gallery2 with a standalone phpBB implementation.
This post (
Only registered users can see links on this board! Get registered or login to the forums!
) seems to indicate that implementing the g2image portion of that integration into the Forums module may allow the functionality discussed here.
I've posted to the thread asking for more information, and will bring any information back here. However, if anyone has insights as to what parts/pieces of this integration is needed to get g2image working, I'd love to hear.
Joined: Feb 26, 2006 Posts: 141 Location: Springfield, MA
Posted:
Sun Nov 19, 2006 11:22 am
Here is the what I posted on nukedgallery.net:
Well, I've played with this quite a bit, and have learned some things...
What I built:
* the table - I named mine nuke_gallery2 and placed it in the same DB as the rest of the site.
* include/constants.php - in RN this is off of the site root.
* include/bbcode.php - RN this is off of the site root.
* the g2image directory - but there is an issue of where to place it (see below)
* the changes to posting_body.tpl - be careful that you change the one that is being called. Some phpnuke themes have their own embedded themes and functions for the forums - RavenNuke default theme is one of them. You need to change it both in subSilver under Forums AND in the other themes that have it.
* the g2helper.inc - g2image.php calls this to get data out of the table.
Lessons learned:
There is a fundamental issue with where g2image.php lives in relationship to the Forums themselves.
In the standard integration, it seems that Forums live in / and is called from /. The integration (g2image.php) lives in /g2image/g2image.php and called from /g2image/g2image.php. It includes that up one direcory level for includes and forum includes and modules.
In RN (and I think phpnuke in general), the Forums live in /modules/Forums but are called from /forums.html . This makes the Forums act like you are calling them from /. The integration (unaltered) puts g2image in /modules/Forums/g2image/g2image.php. When you select the g2Img button, it calls the g2ic function which creates a child browser for
Only registered users can see links on this board! Get registered or login to the forums!
which does not exist. You get a 404.
I tried to solve this two different ways:
Let's make /modules/Forums/g2image/g2image.php work
I tried changing the posting_body.tpl to call /modules/Forums/g2image/g2image.php, but that gives me lots of errors for the includes in common.php. This resulted in several changes to g2image.php
Joined: Aug 30, 2005 Posts: 2204 Location: near Albany NY
Posted:
Mon Nov 20, 2006 9:12 am
1. You can "manually" copy images from g2data to a directory your users can access. Give them the location and they should be able to use img tags in forum posts. Not practical for large volumes of stuff, may not be practical on many sites.
2. They can go into Gallery, view an image, right click, do a copy image location, and paste that into the url tags of a Forum post. Then they'll have a link to the image but not the image itself.
3. Someone can go further with the research into making Gallery work with Forums but I think it's probably a hopeless task. Gallery doesn't want you to have direct access to your pictures, it wants all access to go thru the database and the Gallery programs for good reasons and you are going to have a hard time getting around this.
Joined: Feb 26, 2006 Posts: 141 Location: Springfield, MA
Posted:
Mon Nov 20, 2006 11:07 am
Well, I would consider it, but other posts seems to indicated issues with G1 and Sentinel. Also, I figured that G2 is the "latest and greatest." Subsequent to my testing, I backed off the integration with Forums and am opting to turn on HTML for img tags. This seems to get me where I want to be for now .
Hopefully my post at nukedgallery.net will yield a hybrid integration for phpNuke imbedded Forums.
Joined: Aug 30, 2005 Posts: 2204 Location: near Albany NY
Posted:
Mon Nov 20, 2006 1:34 pm
There are fixes to make Sentinel work with Gallery 1.x (or the other way round really) and they aren't too complicated. They are posted somewhere here. I guess if you HAVE to have Gallery images in your posts that would be an option.
Having experimented with this approach, Gallery images in posts, I'm not an enthusiast for the idea. For one thing if you ever convert your site to a different url the links get broken. I guess that's true for other aspects of a site too, downloads etc. and any articles that have links to Gallery pictures, but it is nonetheless a major hassle to deal with.
I think that what I'd do if I had to do it is just copy the jpgs that I wanted to use over to a separate directory that could be kept relatively static. It all depends I guess on how dynamic things need to be. If people are going to be constantly adding pictures to Gallery and wanting to immediately link to them in posts my solution won't work very well.
Joined: Aug 29, 2004 Posts: 7487 Location: Arizona
Posted:
Tue Nov 21, 2006 6:21 pm
Quote:
For one thing if you ever convert your site to a different url the links get broken. I guess that's true for other aspects of a site too, downloads etc. and any articles that have links to Gallery pictures, but it is nonetheless a major hassle to deal with.
I try wherever possible to use relative links within the "data" of my site. Because, you are right, this can be a royal pain and if you have a lot of content, that can destroy your site really, really fast.
Joined: Aug 30, 2005 Posts: 2204 Location: near Albany NY
Posted:
Tue Nov 21, 2006 6:27 pm
Yes, I try too Montego. I guess going into Gallery and right clicking and copying "copy image location" and then posting that (with an absolute url) into my posts seduced me into taking the short cut approach. Maybe it's a blessing, in a way, that with release 2.x of Gallery, that doesn't work.
I'm facing this problem, although according to the docs, using url rewrite on gallery2 will give you .jpg .gif extensions etc. Trouble is, getting it to work correctly with RN, the only settings I tried messed up my gallery access.
Surely its just a check for the end sequence that gallery2 puts out
I don't know if you can put an asterisk there or not, because quite frankly all that regexp stuff is seriously confusing, I think I'd go mental if I understood that. *cough* anyway can someone who does understand that regexp stuff take a crack at this?
If you notice the third part checked for (the file extension begins with a period and I noted from the Gallery url that there is a period in the name it outputs, so why not use whats after that as a dummy file extension?
That way it solves all your problems, no moving files, no allowing html, it just takes what it gets and allows it through thereby being concatenated with the previous part of the URL, as I think thats the only thing that prevents other file types being used in [img] tags.
Guys, could you help, this is my almost last stage of working this out, and its functionality my forums need as they've been used to it with coppermine for so long now.
View next topic View previous topic
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum