Strike-Force.ne
07-21-2009, 10:00 PM
This code is a result of looking for something similar a while back for my forum. I originally made this for vb 3.6.8 (https://vborg.vbsupport.ru/showthread.php?p=1439967#post1439967) but have confirmed it works for 3.8.2 and 3.8.3 as well.
This BB Code contains not only a button which allows the viewer to go to the site being displayed, but it also contains a "Back" and "Forward" button so the user can navigate the iFramed site without having to leave your site. This allows the user to decide whether the posted site is worth more of their time or not without forcing them to view it in order to go "back" or "forward".
To install this BB Code: AdminCP -> Custom BB Codes -> Add new BB Code
Title: iFrame
Tag: if
Replacement: <!-- Start iFrame by Strike-Force.net -->
<table border="0" bgcolor="#89723C" width="100%"> <tr>
<td> <br> <center> <head>
<script type="text/javascript">
function goBack()
{
window.history.back()
}
</script>
<input type="button" value="Back" onclick="goBack()">
<script type="text/javascript">
function newDoc()
{
window.location.assign("{param}");
}
</script>
<input type="button" value="Visit Site" onClick="window.open('{param}')" />
<script type="text/javascript">
function goforward()
{
window.history.forward()
}
</script>
<input type="button" value="Forward" onclick="history.go(1)"> </head> </center> <br> </td> </tr> </table>
<iframe src="{param}" width="100%" height="500"> </iframe>
<!-- End iFrame by Strike-Force.net -->
Example: http://www.google.com
Description: Places a site within a small framed window in a post.
Use {option}: No
Button Image: (button image is optional, and I don't use one personally)
I have also created a colored border around the buttons which can easily be changed to suit the color scheme of your site. This can be changed by changing the bgcolor value to whatever color you choose on this line:
<table border="0" bgcolor="#89723C" width="100%"> <tr>
The height and width of the iFrame can be adjusted by changing this line:
<iframe src="{param}" width="100%" height="500"> </iframe>
Here's an example of this on my vb 3.6.8 install but it looks the same on 3.8.3: http://www.strike-force.net/showthread.php?t=280
You will need to install the plugin Advanced BBCode Permissions if you want to restrict who can use this BBcode.
This BB Code contains not only a button which allows the viewer to go to the site being displayed, but it also contains a "Back" and "Forward" button so the user can navigate the iFramed site without having to leave your site. This allows the user to decide whether the posted site is worth more of their time or not without forcing them to view it in order to go "back" or "forward".
To install this BB Code: AdminCP -> Custom BB Codes -> Add new BB Code
Title: iFrame
Tag: if
Replacement: <!-- Start iFrame by Strike-Force.net -->
<table border="0" bgcolor="#89723C" width="100%"> <tr>
<td> <br> <center> <head>
<script type="text/javascript">
function goBack()
{
window.history.back()
}
</script>
<input type="button" value="Back" onclick="goBack()">
<script type="text/javascript">
function newDoc()
{
window.location.assign("{param}");
}
</script>
<input type="button" value="Visit Site" onClick="window.open('{param}')" />
<script type="text/javascript">
function goforward()
{
window.history.forward()
}
</script>
<input type="button" value="Forward" onclick="history.go(1)"> </head> </center> <br> </td> </tr> </table>
<iframe src="{param}" width="100%" height="500"> </iframe>
<!-- End iFrame by Strike-Force.net -->
Example: http://www.google.com
Description: Places a site within a small framed window in a post.
Use {option}: No
Button Image: (button image is optional, and I don't use one personally)
I have also created a colored border around the buttons which can easily be changed to suit the color scheme of your site. This can be changed by changing the bgcolor value to whatever color you choose on this line:
<table border="0" bgcolor="#89723C" width="100%"> <tr>
The height and width of the iFrame can be adjusted by changing this line:
<iframe src="{param}" width="100%" height="500"> </iframe>
Here's an example of this on my vb 3.6.8 install but it looks the same on 3.8.3: http://www.strike-force.net/showthread.php?t=280
You will need to install the plugin Advanced BBCode Permissions if you want to restrict who can use this BBcode.