473,511 Members | 10,041 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Hyperlink to display img onMouseover?

9 New Member
Hi guys!

I'm working in PHPBB 3.0.2 and I'd like to create a BB Code that gives one thumbnail image on mouseover and the larger version in a popup window like Lightbox 2, Ajax, or the likes.

It's a linux server.

Thanks for the help!

-Free

Edit: At some point in the future, it would be nice if, when clicked, the image appears on one side and any updated text information can appear on the other side. Much of the pictures' corresponding information changes quarterly and we would like to be able to keep up with it. Thanks again!
Jul 14 '08 #1
16 5573
hsriat
1,654 Recognized Expert Top Contributor
Why don't you use the lightbox itself?
Jul 14 '08 #2
FreeSlagg
9 New Member
The following goes inside the header on a normal webpage. Which file and directory do I put this in?
Expand|Select|Wrap|Line Numbers
  1. <script type="text/javascript" src="js/prototype.js"></script>
  2. <script type="text/javascript" src="js/scriptaculous.js?load=effects,builder"></script>
  3. <script type="text/javascript" src="js/lightbox.js"></script>
This part goes in the existing stylesheet, but where do I find the stylesheet? We've got ten or twelve different styles - I hope I do not need to edit each style. (If so, I expect it would be simplest to make an include statement in each and point to one file. Within that one file write all the includes and necessary directory information for the Lightbox 2 files)
Expand|Select|Wrap|Line Numbers
  1. <link rel="stylesheet" href="css/lightbox.css" type="text/css" media="screen" />
Also, I believe this is the code to Lightbox the file:
Expand|Select|Wrap|Line Numbers
  1. <a href="images/{SIMPLETEXT1}.jpg" rel="lightbox[{SIMPLETEXT2}]">{SIMPLETEXT1}</a>
I don't mind editing the code to get what I want (lack of next and previous arrows, etc), but this is my first foray into anything SQLish. I feel quite lost on where to put the files and what exactly my point of reference is for the directories.

Also, it appears to me many of the files I would normally edit are missing or hidden. I believe I have full access within my FTP client, so I think they're simply not there.
Jul 14 '08 #3
hsriat
1,654 Recognized Expert Top Contributor
I suppose this should be working, as you are doing exactly as what told by the creator of that lightbox in that how to use page. What's the problem now?
Jul 15 '08 #4
FreeSlagg
9 New Member
I suppose this should be working, as you are doing exactly as what told by the creator of that lightbox in that how to use page. What's the problem now?
Yeah, I get *what* I'm supposed to do, but I don't understand *where* these inserts need to go.
Jul 15 '08 #5
hsriat
1,654 Recognized Expert Top Contributor
Yeah, I get *what* I'm supposed to do, but I don't understand *where* these inserts need to go.
First three need to be inside the head tag, and the hyperlink needs to be where your image is (inside the body tag).
Jul 15 '08 #6
FreeSlagg
9 New Member
First three need to be inside the head tag, and the hyperlink needs to be where your image is (inside the body tag).
Of which file though? I'm working in a PHPBB forum. I don't have a simple webpage that I can edit those lines in.

Here's a picture to help clarify.

Jul 15 '08 #7
hsriat
1,654 Recognized Expert Top Contributor
make a 'js' and a 'css' folder in your root folder and place the js files and css files in them respectively.
Jul 16 '08 #8
FreeSlagg
9 New Member
Ok, I tried adding the following to the overall_header.html of the forum style I'm using.

Expand|Select|Wrap|Line Numbers
  1. <script type="text/javascript" src="js/prototype.js"></script>
  2. <script type="text/javascript" src="js/scriptaculous.js?load=effects,builder"></script>
  3. <script type="text/javascript" src="js/lightbox.js"></script>
And then I appended the code from the Lightbox CSS to the style's own CSS file.

In the BBCode I put the following (customized for the website)

BB Code:
Expand|Select|Wrap|Line Numbers
  1. [lightbox2]{TEXT}[/lightbox2]
HTML Replacement Code:
Expand|Select|Wrap|Line Numbers
  1. <a href="http://www.website.com/pics/{TEXT}.jpg" rel="lightbox[set]" title="{TEXT}">{TEXT}</a>

Now when I post [lightbox2]sample[/lightbox2] it gives me the sample.jpg in a whole different page.

I suspect the root of this is addressed on Lightbox's Support page where it states

Expand|Select|Wrap|Line Numbers
  1. It doesn't work at all. The image opens up in a new page. What's wrong?
  2.     This is commonly caused by a conflict between scripts. Check your body tag and look for an onload attribute. Example:
  3.     <body onload="MM_preloadImages(‘/images/menu_on.gif’)…;">
  4.     A quick fix to this problem is to append the initLightbox() to the onload attribute as so:
  5.     <body onload="MM_preloadImages(‘/images/menu_on.gif’)…;initLightbox()">
Unfortunately, I haven't found a conflict source. I've since downloaded the entire forum to search more thoroughly, but I haven't turned up anything yet.
Jul 16 '08 #9
hsriat
1,654 Recognized Expert Top Contributor
I'm sure you are doing some small mistake somewhere. Do you have any test page so that I may have a look at it?
Jul 17 '08 #10
FreeSlagg
9 New Member
Sent you the information in a private message. Thank you!
Jul 18 '08 #11
hsriat
1,654 Recognized Expert Top Contributor
The problem is actually not a JavaScript problem but a PHP one. You would need to change the viewtopic.php and/or viewtopic_body.html (inside the style folder) files since you have to add those three lines of <script> to the header of the page it.

While I'm looking into your problem, I'll ask some other PHP expert to help you out.

Regards
Jul 18 '08 #12
FreeSlagg
9 New Member
Came across a PHPBB forum with Lightbox working. Sent you the information in a PM.
Jul 18 '08 #13
pbmods
5,821 Recognized Expert Expert
Subscribing. I will be in San Antonio this weekend, but I will take a look when I get back.
Jul 18 '08 #14
FreeSlagg
9 New Member
Ok, I'm thoroughly confused at this point.

I ran a search for the head tag in the 610nm style:
overall_header.html
simple_header.html
ucp_pm_viewmessage_print.html
viewtopic_print.html


I input the above three lines of script into overall_header.html and simple_header.html, then upload each file to the webhost.

When I view the page source of a topic with the BB Code, the three lines of script do not appear at all.

ucp refers to the User Control Panel, and I do know adding the script lines to viewtopic_print.html does not change anything.

At this point, I'm not sure which file to edit, but I'm leaning towards 'body' rather than 'header' files, even if it means including a head tag.

As always, I'll keep you guys posted.
Jul 21 '08 #15
FreeSlagg
9 New Member
As far as I can tell, it's an issue with the 610nm style itself. When I follow the directions and place the three script lines where they are supposed to go, they don't actually go in the head tag.

I'm still plugging at it though.
Jul 23 '08 #16
crocky
1 New Member
Hi there,

I am trying to get lightbox 2.04 to work in phpbb 3.0.2 as well and I also configured it with Garage 2.

www.mx5cartalk.com

I have made a directory called lb under my phpbb directory. My lb directory contains the css, js and image directories. It does everything it should when I run the demo file called index.html, the image does just what it should and opens up in a window that has been darkened and clicking outside of the image or on the x exits which is normal.

But when I run it in phpbb I get an error when I insert it into the styles/prosilver/template/overall_header.html file. The css file is fine and so are two of the js files, the lightbox.js file is the one that shows as an error....

Anyone...
Aug 23 '08 #17

Sign in to post your reply or Sign up for a free account.

Similar topics

5
12686
by: Martha | last post by:
When I move my mouse over a hyperlink component, the hyperlink does not change color. How do I change the color of a hyperlink when the mouse goes over the hyperlink? or Change the color of a...
2
1796
by: wazoo | last post by:
I'm hoping someone here might help me with this. I'm putting the finishing touches on my intranet web app, and I'm adding some simple JavaScript to my VB.Net Webforms. This works:...
2
2600
by: BobRoyAce | last post by:
I am brand new to ASP.NET and am now required to take over maintenance of a ..NET/C# web application. On one of the pages I'm working on there is a DataGrid which has multiple columns. One of the...
5
2500
by: Patrick.O.Ige | last post by:
I want to have a rollover image on an hyperlink inside a Repeater control but when i run the page i get "Image1 is undefined" Any ideas? I have a Hyperlink and an Image control in a repeater...
1
2047
by: mjryan | last post by:
Any idea why this code would not fire? btnMakePmt.Attributes.Add("onMouseOver", "this.src='img\\MakePmt_nav2_over.jpg'") btnMakePmt.Attributes.Add("onMouseOut",...
8
3777
by: Nathan Sokalski | last post by:
I have several System.Web.UI.WebControls.HyperLink Controls which I want to display as rollover images. I know how to make these manually using the <a> and <img> tags or the <a> tag and a...
4
8137
by: Mat | last post by:
How do you modify the color of an hyperlink when your mouse go over it? <asp:HyperLink
2
2666
by: news | last post by:
Hello, I have a webpage with some hyperlink within a button. The problem is that some of my hyperlink is shorter that others and therefore the user must navigate to the hyperlink to click on the...
13
42859
ADezii
by: ADezii | last post by:
Recently, there have been several questions and much confusion concerning the Topic of Hyperlinks. Specifically, Users wanted to know how to retrieve a File Name from a FileDialog Box, copy the Name...
5
4251
by: Silgd1 | last post by:
Hey All.... I am creating web page using Netbeans 6.0. I use A jspf (java server page fragment) that is included in most of the other pages. There are several hyperlinks on the jspf that...
0
7367
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7430
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7089
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7517
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5072
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4743
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3230
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3217
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
790
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.