Вывод плеера на отдельной странице

Часто нужно выводить iframe плеера на отдельной странице. Есть множество способов сделать это. Один из вариантов описан ниже.
1. Открываем engine/modules/show.full.php находим
else $tpl->load_template( 'fullstory.tpl' );
Выше вставляем
PHP:
elseif(isset($_GET["iframe"]) && intval($_GET["iframe"]) == 1)
{
$tpl->load_template( 'iframe.tpl' );
$xf_iframe = xfieldsdataload($row['xfields']);
if(count($xf_iframe))
{
$xfieldsdata = $xf_iframe;
foreach($xfields as $value)
{
$preg_safe_name = preg_quote($value[0], "'");
if ($value[6] AND !empty($xfieldsdata[$value[0]]))
{
$temp_array = explode(",", $xfieldsdata[$value[0]]);
$value3 = array();
foreach($temp_array as $value2)
{
$value2 = trim($value2);
$value2 = str_replace("'", "'", $value2);
if ($config['allow_alt_url'])
$value3[] = "<a href=\"" . $config['http_home_url'] . "xfsearch/" . urlencode($value2) . "/\">" . $value2 . "</a>";
else
$value3[] = "<a href=\"$PHP_SELF?do=xfsearch&xf=" . urlencode($value2) . "\">" . $value2 . "</a>";
}
$xfieldsdata[$value[0]] = implode(", ", $value3);
unset($temp_array);
unset($value2);
unset($value3);
}
if (empty($xfieldsdata[$value[0]]))
{
$tpl->copy_template = preg_replace("'\\[xfgiven_{$preg_safe_name}\\](.*?)\\[/xfgiven_{$preg_safe_name}\\]'is", "", $tpl->copy_template);
$tpl->copy_template = str_replace("[xfnotgiven_{$value[0]}]", "", $tpl->copy_template);
$tpl->copy_template = str_replace("[/xfnotgiven_{$value[0]}]", "", $tpl->copy_template);
}
else
{
$tpl->copy_template = preg_replace("'\\[xfnotgiven_{$preg_safe_name}\\](.*?)\\[/xfnotgiven_{$preg_safe_name}\\]'is", "", $tpl->copy_template);
$tpl->copy_template = str_replace("[xfgiven_{$value[0]}]", "", $tpl->copy_template);
$tpl->copy_template = str_replace("[/xfgiven_{$value[0]}]", "", $tpl->copy_template);
}
$xfieldsdata[$value[0]] = stripslashes($xfieldsdata[$value[0]]);
$tpl->copy_template = str_replace("[xfvalue_{$value[0]}]", $xfieldsdata[$value[0]], $tpl->copy_template);
}
}
if( $config['allow_alt_url'] )
{
if( $config['seo_type'] == 1 OR $config['seo_type'] == 2 )
{
if( $category_id AND $config['seo_type'] == 2 )
{
$c_url = get_url(/uploads/mini/noimage.jpg);
$full_link = $config['http_home_url'] . $c_url . "/" . $row['id'] . "-" . $row['alt_name'] . ".html";
}
else
$full_link = $config['http_home_url'] . $row['id'] . "-" . $row['alt_name'] . ".html";
}
else
$full_link = $config['http_home_url'] . date( 'Y/m/d/', $row['date'] ) . $row['alt_name'] . ".html";
}
else
$full_link = $config['http_home_url'] . "index.php?newsid=" . $row['id'];
$tpl->set('{full-link}', $full_link);
$tpl->compile('main');
$tpl->clear();
echo $tpl->result['main'];
die();
}
Далее находим
PHP:
$news_seiten = explode( "{PAGEBREAK}", $row['full_story'] );
Выше вставляем
PHP:
$tpl->set('{iframe_link}', $short_link . $news_name . "/iframe.html");
2. Открываем .htaccess находим
# Сам пост
Ниже вставляем
RewriteRule ^([0-9]{4})/([0-9]{2})/([0-9]{2})/(.*)/iframe.html$ index.php?subaction=showfull&year=$1&month=$2&day=$3&news_name=$4&seourl=$4&iframe=1 [L]
RewriteRule ^([^.]+)/([0-9]+)-(.*)/iframe.html$ index.php?newsid=$2&seourl=$3&seocat=$1&iframe=1 [L]
RewriteRule ^([0-9]+)-(.*)/iframe.html$ index.php?newsid=$1&seourl=$2&iframe=1 [L]
3. Создаем iframe.tpl внутри своего шаблона в нем доступны доп поля и {full-link} ссылка на основную статью.
Ссылка с iframe доступна тегом {iframe_link} в шаблоне fullstory.tpl
Источник
Похожие статьи:
Комментарии: