Jump to content

[Image hovering, working with bbcode]


NerdieTony

Recommended Posts

Ok, first, here's my code:

<?php
    $img_src = 'http://i.imgur.com/ZRjnZlR.png';
    $mouseover_src = 'http://i.imgur.com/GPI0JA5.png';
    echo('<a href="#"><img src="' . $img_src .
        '" onmouseover="this.src=\'' . $mouseover_src . 
        '\'" onmouseout="this.src=\'' . $img_src . '\'" /></a>');
?>

Here's the outcome: http://cheesestatz.com/acnl.php

 

The only problem is, i want to use this link as an image inside the bbcode for another forum

 

But the outcome isn't an image, and i want it to be. 

 

The outcome is this: http://prntscr.com/d6c7ql

 

 

I'm not sure how to make it so the hover image works within the bbcode....

any ideas?

 

Link to comment
Share on other sites

Showing us a screenshot of a broken image doesn't really accomplish anything.

 

You've managed to post a small snippet of PHP code demonstrating your image swapping technique, and an example of what kind of BBCode you want to enter into a... whatever you're entering it into. How about posting the code involved in turning that BBCode into HTML markup? And while you're in there, how about giving more detail about that broken image; what URL it has for the src would be a great start.

Link to comment
Share on other sites

Showing us a screenshot of a broken image doesn't really accomplish anything.

 

You've managed to post a small snippet of PHP code demonstrating your image swapping technique, and an example of what kind of BBCode you want to enter into a... whatever you're entering it into. How about posting the code involved in turning that BBCode into HTML markup? And while you're in there, how about giving more detail about that broken image; what URL it has for the src would be a great start.

Ok, the bbcode tags was changed from to [imageee] so the bbcode can show. The bbcode is support to be img tags html (So basically [imageee]http[/imageee] is <img src="http"></img>, like most messaging boards) The reason i posted that code because is because it's the code for the URL  , (http://cheesestatz.com/acnl.php) and how you see the image there, but it's not displaying as an image on forums.  

 

Then url in the source is in the php, both images but the main image url is http://cheesestatz.com/acnl.php.

 

I know i want to make it as an image so i'll need to add this header('Content-Typeimage/png') but i want it to change images when it's hovered, but i'm not quietly sure how to do that with php, only html. Since i can't use the html and the header together (i believe), so how would i make it work?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.