Iframe For External Links »  Show posts from    to     

Icy Phoenix


Old Support Topics - Iframe For External Links



My_PeSePe [ Mon 30 May, 2011 10:06 ]
Post subject: Iframe For External Links
Well, I found this code and let me know if you can adapt for us to use in Icy. The code included 3 images that are the image will come out of our control.

Code: [Hide] [Select]
<?php

/**
* @ignore
*/
define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);

// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup();

$config_link = array(
'style' => 'prosilver',
'height' => 80,
// 'style' => 'subsilver',
// 'height' => 100,
'page_title' => 'Enlace Externo - ' . $config['sitename'],
'noframes' => 'Su navegador no permite frames. No se puede navegar por la demo<br /><a href="index.php">Haga clic aqui para cargar phpBB3</a>',
'text_to_display' => '<strong>Estas en una pagina externa a <em>Nombre de tu website</em></strong><br />Puedes volver al foro o cerrar el marco dejando solo la web externa.',
'back_to_board' => 'Volver al Foro',
'close_frame' => 'Cerrar marco',
);

// Send a proper content-language to the output
$user_lang = $user->lang['USER_LANG'];
if (strpos($user_lang, '-x-') !== false)
{
$user_lang = substr($user_lang, 0, strpos($user_lang, '-x-'));
}

// Determine board url - we may need it later
$board_url = generate_board_url() . '/';
$web_path = (defined('PHPBB_USE_BOARD_URL_PATH') && PHPBB_USE_BOARD_URL_PATH) ? $board_url : $phpbb_root_path;
$site_logo_img = $user->img('site_logo');
$t_stylesheet_link = (!$user->theme['theme_storedb']) ? "{$web_path}styles/" . $user->theme['theme_path'] . '/theme/stylesheet.css' : append_sid("{$phpbb_root_path}style.$phpEx", 'id=' . $user->theme['style_id'] . '&amp;lang=' . $user->data['user_lang'], true, $user->session_id);
$s_content_direction = $user->lang['DIRECTION'];

$u_index = append_sid("{$phpbb_root_path}index.$phpEx");
$this_file = $phpbb_root_path . $user->page['page_name'];
$this_top = $this_file . '?panel=top';
$this_bottom = $this_file . '?panel=bottom';

$url = str_replace(array('ira=', 'panel=top&', 'panel=bottom&'), '', $_SERVER['QUERY_STRING']);

$html = '';

$panel = request_var('panel', '');

switch ($panel)
{
default :
$html = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>' . $config_link['page_title'] . '</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta http-equiv="content-language" content="' . $user_lang . '" />
<meta http-equiv="content-style-type" content="text/css" />
<meta http-equiv="imagetoolbar" content="no" />
<meta name="resource-type" content="document" />
<meta name="distribution" content="global" />

<script type="text/javascript" src="styles/prosilver/template/forum_fn.js"></script>

<link href="{T_THEME_PATH}/print.css" rel="stylesheet" type="text/css" media="print" title="printonly" />
<link href="{T_THEME_PATH}/stylesheet.css" rel="stylesheet" type="text/css" media="screen, projection" />

<link href="{T_THEME_PATH}/normal.css" rel="stylesheet" type="text/css" title="A" />
<link href="{T_THEME_PATH}/medium.css" rel="alternate stylesheet" type="text/css" title="A+" />
<link href="{T_THEME_PATH}/large.css" rel="alternate stylesheet" type="text/css" title="A++" />
</head>

<frameset rows="' . $config_link['height'] . ', *" frameborder="NO" border="0" framespacing="0">
<frame src="' . $this_top . '&ira=' . $url .' " scrolling="no" noresize name="frame1" id="frame1">
<frame src="' . $this_bottom . '&ira=' . $url .' " name="frame2" id="frame2">
</frameset>
<noframes><body>' . $config_link['noframes'] . '</body></noframes>
</html>';
display($html);
break;

case 'top':
switch ($config_link['style'])
{
default :
case 'prosilver':
$html = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="' . $s_content_direction . '" lang="' . $user_lang . '" xml:lang="' . $user_lang . '">
<head>
<title>' . $config_link['page_title'] . '</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta http-equiv="content-language" content="' . $user_lang . '" />
<meta http-equiv="content-style-type" content="text/css" />
<meta http-equiv="imagetoolbar" content="no" />
<meta name="resource-type" content="document" />
<meta name="distribution" content="global" />

<link rel="stylesheet" href="' . $t_stylesheet_link . '" type="text/css" media="screen, projection" />

<style type="text/css">
body { padding: 1px 0;color: white; }
a:link { color: #e4b322; }
a:visited { color: #e4b322; }
a:hover { color: #FFF; }
a:active { color: #e4b322; }
img { }
iframe { }
#wrap { padding:0 5px; }
.enlaces { font-weight: bold; }
.table_main { background: url("./images/iframe/bg_iframe.gif") repeat-x scroll 0 0 transparent; }
</style>

</head>

<body id="phpbb" class="section-index ' . $s_content_direction . '">



<table class="table_main" width="100%" height="100%" cellpadding="0" cellspacing="0" background="./images/iframe/bg_iframe.gif">
<tr>
<td align="left" valign="top">
<a href="index.php" target="_parent"><img src="./images/iframe/site_logo.png" alt="Volver al Index de Foros" /></a>;
</td>
<td width="60%" align="center" valign="top">
<div class="iframe"><div class="icon">
' . $config_link['text_to_display'] . '
<br />
<a class="button2" href="' . $u_index . '" title="' . $config_link['back_to_board'] . '" target="_parent">' . $config_link['back_to_board'] . '</a>&nbsp;&nbsp;<a class="button2" href="' . $url . '" title="' . $config_link['close_frame'] . '" target="_parent">' . $config_link['close_frame'] . '</a>
</div></div>
</td>
<td width="20%" rowspan="2" align="right" valign="top" style="padding-right:10px;padding-top: 10px;">
' . $config_link['Copyright'] . '
</td>
</tr>
</table>



</body>
</html>';
break;

case 'subsilver':
$html = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="' . $s_content_direction . '" lang="' . $user_lang . '" xml:lang="' . $user_lang . '">
<head>
<title>' . $config_link['page_title'] . '</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta http-equiv="content-language" content="' . $user_lang . '" />
<meta http-equiv="content-style-type" content="text/css" />
<meta http-equiv="imagetoolbar" content="no" />
<meta name="resource-type" content="document" />
<meta name="distribution" content="global" />

<link rel="stylesheet" href="' . $t_stylesheet_link . '" type="text/css" />

<style type="text/css">
body { }
img { }
iframe { }
#wrapcentre { margin: 1px 5px 0; }
.enlaces { font-weight: bold; }
.table_main { background: url("./images/iframe/bg_iframe.gif") repeat-x scroll 0 0 transparent; }
</style>

</head>

<body class="' . $s_content_direction . '">

<div id="wrapheader">
<div id="logodesc">
<table class="table_main" width="100%" height="100%" cellpadding="0" cellspacing="0">
<tr>
<td align="left" valign="top">
<a href="' . $u_index . '" title="' . $config_link['back_to_board'] . '">' . $site_logo_img . '</a>
</td>
<td width="60%" align="center" valign="top">
<br />
' . $config_link['text_to_display'] . '
<br />
<br />
<br />
<a class="btnmain" href="' . $u_index . '" title="' . $config_link['back_to_board'] . '" target="_parent">' . $config_link['back_to_board'] . '</a>&nbsp;&nbsp;<a class="btnlite" href="' . $url . '" title="' . $config_link['close_frame'] . '" target="_parent">' . $config_link['close_frame'] . '</a>
</td>
<td width="20%" rowspan="2" align="right" valign="middle">
&nbsp;
</td>
</tr>
</table>
</div>
</div>

</body>
</html>';
break;
}

display($html);
break;

case 'bottom':
header("Location: " . $url);
break;
}

function display($html = '')
{
// application/xhtml+xml not used because of IE
header('Content-type: text/html; charset=UTF-8');

header('Cache-Control: private, no-cache="set-cookie"');
header('Expires: 0');
header('Pragma: no-cache');

echo $html;

garbage_collection();
exit_handler();
}

?>


Try calling it from the constants.php with the following line:

Code: [Hide] [Select]
define('EXTERNAL_LINK_PREFIX', 'http://www.tuwebsite.com/enlace.php?ira='); // Example: 'http://anonym.to?'


Mighty Gorgon [ Sat 04 Jun, 2011 11:51 ]
Post subject: Re: Iframe For External Links
Sorry but I don't get the purpose on doing something like this. Do you have a demo screenshot?

In theory you should create a CMS Block for something like this, or just create a special TPL file (you can use PHP in Icy Phoenix TPL files).

What's your main goal?


mort [ Sat 04 Jun, 2011 12:23 ]
Post subject: Re: Iframe For External Links
I would think that any script that is case-specific for various templates, would be a nightmare to implement and would probably prove to be pretty useless in the long run?

case 'prosilver':
Blah!

case 'subsilver':
Blah!



stefen [ Mon 06 Jun, 2011 14:14 ]
Post subject: Re: Iframe For External Links
I second you


Informpro [ Mon 06 Jun, 2011 14:17 ]
Post subject: Re: Iframe For External Links
Icy Phoenix deals with templates this : if your template is subsilver, and if you use $template->pparse(), it'll first look in subsilver's directory then in default's directory. So, then HTML that'll be parsed will depend on the enabled template. Isn't that what your need, and the default behavior ?


mort [ Mon 06 Jun, 2011 23:49 ]
Post subject: Re: Iframe For External Links
The point I was making is that the different IP styles use different layouts and that the iframe script would no doubt need to be modified each time there is a different "User-Created" theme on offer that someone wants to use with this MOD.

IF anyone converts this MOD then they would have to support changing it for every other template that comes along -

And imho that's where the whole thing starts to fall apart.



spydie [ Tue 07 Jun, 2011 00:26 ]
Post subject: Re: Iframe For External Links
hm

IMHO the iframe could adapt itself to the center block width and height automaticly, or you just create a new page, with the frame included and just the overall_header and footer. Or you use a highslide/ or shadowbox to open the frame in front of the template, since the script got a close button/link

that should´nt break anything in any template

well investiganting a bit. i would opt for the shadowbox solution on this one.

example : http://menudivertido.blogspot.com/2008/01/shadowbox.html

click on the iframe link in that page to see what i mean


Informpro [ Tue 07 Jun, 2011 14:45 ]
Post subject: Re: Iframe For External Links
If you need to modify common templates parts as JS and CSS, you just have to modify $template->css_includes and $template->js_includes (or include, can't remember :p).




Powered by Icy Phoenix