Back to vBulletin 3.8 Add-ons

Photo Popup - Insert pictures easily from vB Albums, Photopost, vBGallery, Photoplog
Mod Version: 3.5, by cellarius

vB Version: 3.8.x Rating: (48 votes - 4.88 average) Installs: 403
Released: 20 Jan 2009 Last Update: 18 Nov 2009 Downloads: 3170
Not Supported Uses Plugins Template Edits Auto-Template Additional Files Translations  

Whats new in Version 3.5
  • now supports attachments
    • config file will be installed automatically (from folder UPLOAD/includes)
    • remember to add the product option "attachments" in your AdminCP when upgrading
    • make sure you reupload photo_popup.php
  • new config file for CND Garage 2.x
    • new config file photo_popup_config_cndgarage.php
    • if you're using CND Garage in a lower version that 2.x,
      • and you're upgrading: just continue to use the old file
      • and you're doing a fresh install: delete the new config file, and rename photo_popup_config_cndgarage.php.old (remove the .old)



What does it do?


When creating or editing a post, your users can open a popup window that will show them pictures in the chosen gallery or albums. Now also supports attachments: Reuse what you uploaded! A click on the picture inserts it into the editor.

Works with
  • vBulletin 3.7.x and 3.8.x, vB Blog (probably anything that uses the vB editor)
  • Photopost Pro
  • Photopost vBGallery
  • Photoplog
  • CNG Garage

Detailed features list
Installation
  1. Extract the archive.
  2. Upload the contents of folder "UPLOAD" to your forum root. Note how the folder structure in this folder mirrors the folder structure in your forum root, so every file will be in the right place.
  3. a) If you intend to use only the vBulletin forums albums, proceed to step 4.
    b) If you intend to use any other gallery product, see "Product configuration" in second post.
  4. Install the product.
  5. a) If you are using Template Modification System (TMS), you're done.
    b) If not, do the template modifications explained in template_edits.txt manually.

Basic Configuration
  • if you're using only vB albums, everything is done via AdminCP->Options->Photo-Popup
  • Decide there how many rows and columns the popup table will have, what gallery products to use, which insert options you want to allow, activate code mode on a usergroup permission basis, or activate debug mode
  • See "Product Configuration" in second post.

Upgrade

  • Just reimport the product-xml-file, overwriting the old version, and reupload the photo-popup.php.
  • Please check in config_file_versions.txt whether the config file for one of the products you use has been changed since last update.
  • If the config file for one of your products has been updated, upload it from config files folder to your includes directory. Don't forget to take note of any any changes and settings in the old file and adapt the new one accordingly, if necessary.

Support and debugging


Ill help whenever I find the time. Before asking, please activate debug mode and post the information given there (especially under "Code". Please try the two links given - do they look "normal" and do they work? Debug information is only shown to Administrators (usergroup 6). Always state the products you use, including the software versions. Also read the infromation in the second post of this thread

Spoiler (click to open)


Detailed features list
  • works with vB's attachment system (finally reuse them!), the integreted album system and/or Photpost, vBGallery or Photoplog gallery software: decide which of them you want to use, or use them all.
  • active in main editor, quickreply and quickedit
  • 10 different options in what way to insert the images
  • decide what options you want to offer: thumbnail with link to original image or album/gallery page, thumbnail or original image alone, thumbnail or original image with link to album/gallery below the image (plus, for Photopost, all of that for medium sized images, too - make sure you have set PP to save medium images, though).
  • decide whether you want to let your users filter the images shown in the popup by albums
  • has a code mode, where the images selected don't get inserted into the editor, but the respective code is shown in a codebox (and, if allowed by the browser, automatically copied to clipboard). Code mode can be enabled for certain usergroups only.
  • four drop-down menus possible: show pictures from where? (albums or Photopost), show only pictures from a certain album/category, insert options (max. 10 different), code mode (no, html, bbcode). User sees only options that make sense (i.e.: if you allow only one option for inserting the images, the user will not see the corresponding drop-down menu). So if you want to, you can keep it absolutely simple with no menu at all, or have the full choice of options for your users.
  • adds a blank after every inserted image (otherwise, if users insert several images in line there would be no line break, thus ultimately breaking your fixed style layout)
  • stores the settings/filters the user uses in the popup in a cookie that stays valid for the session
  • the script will detect whether editor is in wysiwyg or codeview-mode and act accordingly, so that in wysiwyg-mode the actual image will be visible
  • the script will auto-close once the user saves his post
  • supports gallery product installation in a different database than vB's
  • Fully phrased

Product Configuration


It's quite straightforward, really. For most products you won't have to open the config files at all.
  • ff you want to use a product other than vB albums and attachments (the config file for those is in the UPLOAD/includes folder and thus uploaded by default), you will find the corresponding file in the UPLOAD - product configurations folder, there in subfolder includes. All config files are named photo_popup_config_[name of product].
  • You can check this list if there is anything that you want or have to do in the config file. All settings are explained in the config files in detail.
    There are mandatory settings only for Photopost Pro. For all other products, you can skip the rest of this point, if you want to. There may be some explanations how configuration works for your product, however.
    • All products: If applicable, you can override the global settings for medium images insertion and allow album selection. This means:
      • $medium_override: set this to TRUE if you want to offer medium insertion out of one product (so you enter them in AdminCP) but you want to deactivate it for this product. Only applicable if the product does save medium images. If not, the config file is set accordingly already. Useful if you have turned off medium image saving in Photopost Pro, for example.
      • album_override: set this to TRUE if you have activated the selection of albums in AdminCP, but want to deactivate it only for this product.
    • Photopost: For this product, there are several mandatory settings to be done:
      • $url_path: The URL to the directory where your gallery index page resides (starting with http://%29
      • $data_dir: The URL to the directory where Photopost stores the uploaded images (default is subdirectory data in the gallery root
      • $db_prefix: The Prefix used in the Photopost database. Default is "pp_".
      • if you have a different database, you have to provide the settings for database name, host, user and password.
    • vBGallery:
      • Photo Popup determines whether your vBG is configured to run in safe mode environment. If this is the case, the folder structure in your data directory is different. The script will adapt accordingly.
        Example: data folder for user 1234. Safe mode on will result in a folder structure 1/2/3/4, while safe mode off will leave it at 1234.
      • VBGallery can be configured to save the original image files when uploading. If this is the case, Photo Popup will automatically link these original files to the insert options for "original" images. The image size used on vBG pages will be linked to "medium" options. If vBG does not safe original images, the size used on vBG pages will be linked to "original" and "medium" options will be deactivated.
    • Photoplog:
      • LITE: For use with the lite version, use the photo_popup_config_photoplog file
      • PRO: For use with the pro version, there are two different products (can be used simultaneously); shows categories or useralbums in albums-dropdown:
        • photo_popup_config_photoplog_categories
        • photo_popup_config_photoplog_useralbums
      • Saves the original images plus thumbnails in three sizes (small, medium, large), resulting in four different image sizes available. As this mod can handle only three, there's a choice:
        • $medium_swith: can be set to "medium" or "large". This affects the insertion of medium sized images in photo popup. If set to medium, it will pull Photoplog's medium sized images, if set to large the large ones.
    • CND Garage
      • There are two config files issued with this mod. Depending on the version you are using, you need to either
        • use the photo_popup_config.php file if you are running CND Garage 2.x
        • delete the existing photo_popup_config.php file and remove the ".old"-extension from photo_popup_config.php.old file if you are running an older version.
  • Upload the config file(s) for all the product(s) you want to use into the includes folder of your forum root.


A note on vBGallery and Photoplog support

I have installed vBGallery and Photoplog only in a local testing environment. Please note that I can only give limited support for those add-ins.

A note on "conflicts" with other editor/quickreply/quickedit mods

Normally, there should be no fundamental conflict. The template edits for this mod do nothing but to add an additional button to the toolbar in quickreply and quickedit and a link to the main editor.
However, if other mods you have installed already induced template changes there, you might have to adapt the template changes accordingly. A good solution might be to melt the template changes for this mod into the template changes for the other. I'm afraid I'll not be able to help you there, since I do not have those mods installed. But ask away here or, perhaps even more promising, in the thread for the other mod, perhaps anyone else has.Please take note of this post here, too.
On principle, you should be able to add the link that opens the popup anywhere within the various editor-tamplates in any form you like - whether you put up text or the button in front of the link, doesn't really matter. What you essentially need is a link like this one somewhere within the editor:
HTML Code:
<a href="#" onclick="window.open('photo_popup.php?$session[sessionurl]e=$editorid','fotos','scrollbars=yes,resizable=yes,width={$vbulletin->options['photo_popup_width']},height={$vbulletin->options['photo_popup_heigth']}'); return false" title="$vbphrase[photo_popup_insertlink]">$vbphrase[photo_popup_insert]</a>]
If you don't want text, remove "$vbphrase[photo_popup_insert]" and replace it with the editor image "$vbphrase[photo_popup_insert]" - or anything else.

Credits

Credits go to the Geek for the idea for this hack and hints I took from the code of his old Gallery popup. Especially the trouble-rousing injection-process of the images into the editor follows different lines altogether, using vB-built-in functions.
The camera-icon in quickreply and quickedit is taken from the fabulous silk iconset:
http://www.famfamfam.com/lab/icons/silk/


Close
.

Hopes for the future
World peace, happiness, health and lot's of money


Version history

  • Version 3.5
    • new: supports attachments
    • new config file for CND Garage > 2.x
  • Version 3.4 / 3.4.1: Album dropdown not populated if using mysqli,Photopost not saving medium sized images, Fix for PHP 5.3.0 related bug (bugfixes)
  • Version 3.3 new/updated config file vBGallery (bugfixes); session-handling fixed; workaround for vbseo problem with Firefox in WYSIWYG editor
    • Important: template edits have to be redone!In every manually done template edit find: photo_popup.php?e=$editorid and replace with photo_popup.php?$session[sessionurl]e=$editorid
  • Version 3.2 new/updated product config file vBGallery (bugfixes), some additional error checking and error messages, debug information enhanced
  • Version 3.1 new/updated product config files: cnd garage (thanks to wottech for cooperation), photoplog categories, photoplog albums, photoplog, vBGallery; some additional cookie error checking; error checking in AdminCP removed; bugfixes from this thread.
  • Version 3.0 code reorganisation: implemeting of new galleries made easier by outsourcing of the relevant settings and database queries into seperate config files; new feature: support for vBGallery and Photoplog (lite?) added; minor bugfixes
  • 3.0.1 Important bugfix if you are using vB albums: wrong database query in config file. To fix this, it's enough to reupload photo_popup_config_albums.
  • 2.2 New feature: 2 plugins to show correct location and activity in "who's online". Bugfix: Bit of unphrased German removed from template (in pagenav dropdown). For upgrade from 2.1 just import product file, no uploads necessary.
  • 2.1 New feature: Code mode. Lets you see the corresponding bb- or html-code instead of sending the image to the editor. If your browser allows that, the code is also copied to clipboard. Bugfix: Fixed a problem where pagination misbehaved when working with vB albums
  • 2.0 New feature: Support for quickreply and quickedit!
  • 1.4 New feature: Three new insert-options: thumbnail, medium and original image not linked themselves, but with a link to the gallery/album in the line below. This should be especially interesting for the users of the image resizer mod.
  • 1.3 feature improvement/bugfix: default popup size is now determined before opening, not after (window.resize method causing issues in Firefox). Auto-close of the popup now using the YUI Event Listener; the needed library is already part of vB's standard distribution. New feature: title bar with "close this window"-link.
  • 1.2 new feature: popup closes after editing is completed; smaller changes in Layout
  • 1.1 new feature:set popup window size, to go with your table settings; minor bugfixes
  • 1.0 Initial release

Development and bugfix releases for config files

If the need arises, there will be development or bugfix releases of config files between official releases of this mod. The zip file attached to this post will always be up to date. At the moment, there are no development/bugfix-releases.


Translations

Deutsche Übersetzung bei http://www.vbulletin-germany.org/showthread.php?p=47961.
Arabian translation

Spoiler (click to open)


Thanks for this, wottech!

And:

New translation: Arabian (thanks to Subah)
Attached Files
File Type: xml Photopopup-Ar.xml (7.7 KB, 37 views)

Close
, thanks to Subah.
Russian translation

Spoiler (click to open)


cellarius,

a) i've made russian translation for this hack, there are two language files since it is customary to run cyrillic forums either in windows-1251 (ansi) codepage or utf-8. i've attached them to this message.
b) i've made a little patch to make the script itself more friendly to non-ansi codepages. the diff is attached as well.
Attached Files
File Type: zip photo_popup-russian-cp1251.xml.zip (2.7 KB, 27 views)
File Type: zip photo_popup-russian-utf8.xml.zip (3.0 KB, 21 views)
File Type: txt photo-popup-diff.txt (1.2 KB, 28 views)

Close
, thanks to nohuhu.


Screenshots

AdminCP, Photopost settings, Photo Popup in action, quickreply

### Don't forget to click install! ###
(No support if you don't)

Download

File Type: %1$s photo_popup_3-3.zip (24.6 KB, 428 downloads)
File Type: %1$s photo_popup_3-4.zip (24.5 KB, 236 downloads)
File Type: %1$s photo_popup_3-4-1.zip (24.6 KB, 378 downloads)
File Type: %1$s photo_popup_3-5.zip (27.2 KB, 960 downloads)

Screenshots

Click image for larger version
Name:	screen_popup_1-3.jpg
Views:	6736
Size:	154.1 KB
ID:	93283   Click image for larger version
Name:	screen_admincp_1-3.jpg
Views:	2192
Size:	115.5 KB
ID:	93284   Click image for larger version
Name:	screen_quickreply_2-0.jpg
Views:	4227
Size:	58.5 KB
ID:	93356  

Similar Mods

Miscellaneous Hacks PP-Popup - Photo-Popup for Photopost vBulletin 3.7 Add-ons

vblts.ru supports vBulletin®, 2022-2024