vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.8 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=235)
-   -   New Posting Features - Photo Popup - Insert pictures easily from vB Albums, Photopost, vBGallery, Photoplog (https://vborg.vbsupport.ru/showthread.php?t=202385)

cellarius 04-13-2009 05:09 PM

Quote:

Originally Posted by KenDude (Post 1789775)
Your vbgallery directory structure is not parsed correctly.

It is - for the newest release that I am running for testing purposes. Your directory structure reflects an older version. A fix for this has been posted somewhere in this thread. Just search for it.

cellarius 04-13-2009 05:13 PM

Quote:

Originally Posted by KenDude (Post 1789879)
FYI I have the latest and greatest vbgallery, and it needed this too!

So maybe it does not change a directory structure that is already in place. Anyway, my installation uses the 1/2/3/4 format. If anyone can clarify when vBG uses which format and whether there is an easy way to detect it, I'll happily adapt the mod. As long as this is not the case, vBG-users who have 1234-structure will have to apply that patch.

0ptima 04-13-2009 07:47 PM

the 1234-structure is used when php is in safe mode.

0ptima 04-13-2009 09:24 PM

1 Attachment(s)
Quote:

Originally Posted by cellarius (Post 1790368)
So maybe it does not change a directory structure that is already in place. Anyway, my installation uses the 1/2/3/4 format. If anyone can clarify when vBG uses which format and whether there is an easy way to detect it, I'll happily adapt the mod. As long as this is not the case, vBG-users who have 1234-structure will have to apply that patch.

My gallery uses the 1/2/3/4 format (the format used when you are not using safemode) and this hack worked fine for me as my user ID is 1. When I switched to a test user with ID 123, the hack stopped working. I had to apply the patch provided by wottech here.

To determine whether a gallery is using safemode, in ACP, go to VbGallery -> Maintenance and scroll to the bottom.

BTW, this is a great hack ! :)

tandy 04-14-2009 05:41 AM

Quote:

Originally Posted by abroad (Post 1781111)
vb Albums: Did anybody figure out how to fix it? Can't insert pictures from the popup window.

I have the same problem, i do the same on 2 of my site, one is working, the other does not, in the second i have the popup window but can't insert picture from album, and in the bottom of both popup windows i have error in page.

cellarius 04-14-2009 06:33 AM

Quote:

Originally Posted by 0ptima (Post 1790560)
My gallery uses the 1/2/3/4 format (the format used when you are not using safemode) and this hack worked fine for me as my user ID is 1. When I switched to a test user with ID 123, the hack stopped working. I had to apply the patch provided by wottech here.

To determine whether a gallery is using safemode, in ACP, go to VbGallery -> Maintenance and scroll to the bottom.

BTW, this is a great hack ! :)

Thanks - for the compliments and the hint concerning safe mode.

New config file for vbGallery!
v 3.1b

So - there's just another new config file for vBGallery with the following fixes and new features:
  • Photo Popup determins correct folder structure
    by checking whether vBG is running in safe mode environment and setting the folder structure accordingly. This is determined by a variable that vBG sets in its config database. The code for pulling together I borrowed from wottech, who posted a fix here.
  • Photo Popup now checks whether vBG is set to save the originally uploaded images.
    If this is the case, all "original"-options for inserting the images are linked to those original images, the images shown in the Gallery are linked to the "medium" options. If original size images are not safed, the behaviour is as it was up to now: The images shown in the Gallery are linked to the "original" options, the "medium" options are disabled. If you have "save originals on upload" active but do not want to allow them to be inserted, you can set the new "original_override"-switch at the top of the config file to "TRUE".
Please check out the new config file and report any bugs here :)

File removed for a later version, check next posts!

KenDude 04-14-2009 05:29 PM

But wait there's more! Sorry but you have another error in the code as well with vbgallery.

If a user uploads a photo titled MyPhoto.JPG into vbgallery, vbg will create a thumbnail called MyPhoto_thumb.jpg by default.

However, your code in the pop up window is looking for MyPhoto_thumb.JPG (extension in caps like the original file) and so the user will see red x's instead of thumbnails when they look through their images because Linux treats the file extensions in a case sensitive manner.

Now if you click on that red x inserted thumbnail it WILL take you to the correct full size photo because the full size photo does end in .JPG or whatever the all caps extension happened to be.

This should be as easy as making the _thumb file always end in a lowercase version of whatever the original extension is or else storing the actual thumbnail file name or checking it in some way.

For now I have told my members NOT to choose the thumbnail insertion when looking through their vbgallery files to insert but to choose full size insertion until the code can be fixed to handle the file extension case problem.

Thanks in advance for the fix, sorry to keep piling these on you, but my members are a picky bunch and usually find any issues with any code with any browser, etc... :)

cellarius 04-14-2009 09:05 PM

Quote:

Originally Posted by KenDude (Post 1791181)
If a user uploads a photo titled MyPhoto.JPG into vbgallery, vbg will create a thumbnail called MyPhoto_thumb.jpg by default.

Correct. So far I follow you when trying to reproduce this.

Quote:

However, your code in the pop up window is looking for MyPhoto_thumb.JPG (extension in caps like the original file) and so the user will see red x's instead of thumbnails when they look through their images because Linux treats the file extensions in a case sensitive manner.
Hm, that's where I'm losing you: the code for the thumbnails is genereted by strtolower-ing the file extension, thus it is always lowercase.
Quote:

Now if you click on that red x inserted thumbnail it WILL take you to the correct full size photo because the full size photo does end in .JPG or whatever the all caps extension happened to be.
Actually, the path and filename used to show the thumbnails in the popup window and for the insertion process come from exactly the same variable - they can not be different. Their extensions both have to be lowercase.
By the way: If I'm uploading an image that has a uppercase extension, vBG changes the original uppercase extension to lowercase.


Quote:

This should be as easy as making the _thumb file always end in a lowercase version
That's what the script does at the moment, actually...


Quote:

Thanks in advance for the fix, sorry to keep piling these on you, but my members are a picky bunch and usually find any issues with any code with any browser, etc... :)
No problem, really. Since I do not use vBG in a productive environment, I don't have the ability to do such intensive testing. This way, sooner or later we'll get it goin' :D

So, after some more thinking, I decided to take more information directly from the database. All filenames - thumbs, originals, everything including extensions - are now taken directly from the database and thus should mirror exactly what vBG uses. If it works there, it should also work with this mod. Please test the attached config file and see whether it solves the problem. If not, please check whether vBG indeed saves original files with uppercase extensions (which it does not for me - and I was unable to find an option in the vBG settings, tho I did not look too hard) and provide the content of the debug table field for "Code".

cellarius 04-14-2009 09:17 PM

Quote:

Originally Posted by tandy (Post 1790816)
I have the same problem, i do the same on 2 of my site, one is working, the other does not, in the second i have the popup window but can't insert picture from album, and in the bottom of both popup windows i have error in page.

Since the error descriptions on this have been more than vague up to now, there really is no way to address this issue. I do not experience any errors. At least state which browser you are using and what the error is (exact error message!). Are you sure you have uploaded the latest version of photo_popup.php?

KenDude 04-14-2009 10:32 PM

Thanks for looking into this. Since I've had vbgallery for a couple of years there is some chance that vbgallery has changed over time. I have confirmed that a member who uploaded a photo ending in .JPG has a thumb ending in .jpg and hence has a red x problem. I am out of town currently but will return tomorrow and will try your new config file to see if it takes care of the problem by pulling the names directly from the database. I would hope that it would since the database could contain photos that vbgallery has stored differently at different times.

I was going to ask about your config setting for storing the original file. While there IS a setting for that in vbgallery to apply universally I don't use it. By default if someone uploads it creates a thumbnail and resizes to say 800x600 or whatever my default settings are. However, you can override that with settings for each category and in fact I do that. So I have some categories where say an image that is 3000x2000 will be uploaded and a thumbnail is created, an 800x600 version is created and the original 3000x2000 image is also saved. I don't know if running vbgallery in this way poses a problem for your mod if users try to insert say a medium sized photo or the original, etc. I just wanted to point out that some of us don't use the save original setting universally, but rather use it for only certain categories. Hope that helps!


All times are GMT. The time now is 08:06 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01339 seconds
  • Memory Usage 1,779KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (11)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (2)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete