Lightbox in phpBB3

Discussion forum for MOD Writers regarding MOD Development.
thelane
Registered User
Posts: 5
Joined: Tue Jun 22, 2010 5:57 am

Re: Lightbox in phpBB3

Post by thelane »

ok, got it working, BUT in the overall_header, I had to use:

Code: Select all

<script type="text/javascript" src="{T_TEMPLATE_PATH}/lightbox/js/prototype.js"></script>
<script type="text/javascript" src="{T_TEMPLATE_PATH}/lightbox/js/scriptaculous.js?load=effects,builder"></script>
<script type="text/javascript" src="{T_TEMPLATE_PATH}/lightbox/js/lightbox.js"></script>
rather than what is instructed above in this topic
TheRandalovic
Registered User
Posts: 2
Joined: Fri Jan 14, 2011 6:03 am

Re: Lightbox in phpBB3

Post by TheRandalovic »

Update I got my initial problem solved after a few hours. It was a mix of phpbb3, Joomla, and wrappers... Anyways, I changed the bbcode too a little to be as simple as possible for users to utilize lightbox. This way they just have to put an image's direct link and nothing else.

BBCode usage
[lightbox]{TEXT}[/lightbox]
HTML replacement
<a href="{TEXT}" rel="lightbox"><img src="{TEXT}" width="300"></a>
Head tags of page

Code: Select all

<script type="text/javascript" src="http://www.yourdomain.com/js/prototype.js"></script>
<script type="text/javascript" src="http://www.yourdomain.com/js/scriptaculous.js?load=effects,builder"></script>
<script type="text/javascript" src="http://www.yourdomain.com/js/lightbox.js"></script>
<link rel="stylesheet" href="http://www.yourdomain.com/css/lightbox.css" type="text/css" media="screen" />

Also got the attachment link trick working too. Great thread on this topic!
surpriseinmypants
Registered User
Posts: 1
Joined: Sat Mar 26, 2011 2:58 pm

Re: Lightbox in phpBB3

Post by surpriseinmypants »

Yeah, no one's mentioned that you also need to call builder.js from your <head> in overall_header.html

Could have saved me hours.
TheRandalovic
Registered User
Posts: 2
Joined: Fri Jan 14, 2011 6:03 am

Re: Lightbox in phpBB3

Post by TheRandalovic »

Thanks surprise. The odd thing is, I had this up and running about a month ago, then I switched servers and started a fresh install. All of a sudden nothing works. Added a call for builder.js and all is well.


The best way to display this too I think is enabling thumbnail creation. And then to display attachments in lightbox, open up [Theme] > Template > attachment.html

Find

Code: Select all

<a href="{_file.U_DOWNLOAD_LINK}"><img src="{_file.THUMB_IMAGE}" alt="{_file.DOWNLOAD_NAME}" title="{_file.DOWNLOAD_NAME} ({_file.FILESIZE} {_file.SIZE_LANG}) {_file.L_DOWNLOAD_COUNT}" /></a>
and add in the reference to lightbox in the link...

Code: Select all

<a href="{_file.U_DOWNLOAD_LINK}" rel="lightbox">
I also use a simple script in functions_post.php to resize everything image attachment so they display better.
User avatar
paoloumali
Registered User
Posts: 44
Joined: Wed Jun 22, 2011 1:57 pm

Re: Lightbox in phpBB3

Post by paoloumali »

This works well with the new version: viewtopic.php?f=70&t=2164526
Mods:
OAuthorize phpBB just a simple Facebook login plugin
phpBB Bootstrapped
kybrd
Registered User
Posts: 4
Joined: Fri Oct 26, 2012 8:26 am

Re: Lightbox in phpBB3

Post by kybrd »

Thank-you this worked very nicely...
Locked

Return to “[3.0.x] MOD Writers Discussion”