📄 ad_remote_template.php
字号:
print "<html>\n\t\t\t\t <head>\n\t\t\t\t <meta http-equiv='Content-Type' content='text/html; charset=gb2312'>\n\t\t\t\t <meta name='author' content='Chinese Version Development By HuaCooL Network'>\n\t\t\t\t <meta name='copyright' content='Copyright 2002 www.ibfchina.com, HuaCooL Network'>\t\t\t<title>搜索</title>\n\t\t\t\t </head>\n\t\t\t\t <frameset cols='200, *' frameborder='no' border='1' framespacing='0'>\n\t\t\t\t\t <frameset rows='*, 100' frameborder='no' border='1' framespacing='0'>\n\t\t\t\t\t <frame name='links' scrolling='auto' src='{$SKIN->base_url}&act=rtempl&code=searchlinks&suid={$IN['suid']}&bypass=1'>\n\t\t\t\t\t <frame name='searchbox' scrolling='no' src='{$SKIN->base_url}&act=rtempl&code=searchbox&suid={$IN['suid']}'>\n\t\t\t\t\t </frameset>\n\t\t\t\t\t<frame name='preview' scrolling='auto' src='{$SKIN->base_url}&act=rtempl&code=previewstate'>\n\t\t\t\t </frameset>\n\t\t\t </html>";
exit( );
}
function compare_frames( )
{
global $IN;
global $INFO;
global $DB;
global $SKIN;
global $ADMIN;
global $std;
global $MEMBER;
global $GROUP;
print "<html>\n\t\t\t\t <head>\n\t\t\t\t <meta http-equiv='Content-Type' content='text/html; charset=gb2312'>\n\t\t\t\t <meta name='author' content='Chinese Version Development By HuaCooL Network'>\n\t\t\t\t <meta name='copyright' content='Copyright 2002 www.ibfchina.com, HuaCooL Network'>\n\t\t\t\t <title>比较</title>\n\t\t\t\t </head>\n\t\t\t\t <frameset cols='50%, 50%' frameborder='yes' border='1' framespacing='0'>\n\t\t\t\t <frameset rows='30, *' frameborder='yes' border='1' framespacing='0'>\n\t\t\t\t <frame name='origtop' scrolling='auto' src='{$SKIN->base_url}&act=rtempl&code=dotop&content=orig'>\n\t\t\t\t <frame name='origbot' scrolling='auto' src='{$SKIN->base_url}&act=rtempl&code=preview&suid={$IN['suid']}&type=css'>\n\t\t\t\t </frameset>\n\t\t\t\t\t<frameset rows='30, *' frameborder='yes' border='1' framespacing='0'>\n\t\t\t\t <frame name='newtop' scrolling='auto' src='{$SKIN->base_url}&act=rtempl&code=dotop&content=new'>\n\t\t\t\t <frame name='newbot' scrolling='auto' src='{$SKIN->base_url}&act=rtempl&code=donew&suid={$IN['suid']}'>\n\t\t\t\t </frameset>\n\t\t\t\t </frameset>\n\t\t\t </html>";
exit( );
}
function print_compare_top( )
{
global $IN;
global $INFO;
global $DB;
global $SKIN;
global $ADMIN;
global $std;
global $MEMBER;
global $GROUP;
$content = $IN['content'] == "orig" ? "默认模板" : "当前模板";
print "<html>\n\t\t\t <body marginheight='0' marginwidth='0' leftmargin='0' topmargin='0' bgcolor='#000055'>\n\t\t\t <center><font face='verdana' size='2' color='white'><b>{$content}</b></font></center>\n\t\t\t </body></html>";
exit( );
}
function print_compare_new( )
{
global $IN;
global $INFO;
global $DB;
global $SKIN;
global $ADMIN;
global $std;
global $MEMBER;
global $GROUP;
$DB->query( "SELECT * FROM ibf_skin_templates WHERE suid='".$IN['suid']."'" );
if ( !( $template = $DB->fetch_row( ) ) )
{
$ADMIN->error( "你必须指定一个存在的模板ID,请返回后重试" );
}
$DB->query( "SELECT css_id, img_dir FROM ibf_skins WHERE set_id='".$template['set_id']."'" );
$r = $DB->fetch_row( );
$DB->query( "SELECT css_text FROM ibf_css WHERE cssid='".$r['css_id']."'" );
$css = $DB->fetch_row( );
$css_text = "\n<style>\n<!--\n".str_replace( "<#IMG_DIR#>", "style_images/".$r['img_dir'], $css['css_text'] )."\n//-->\n</style>";
print "<html><head>\n\t\t\t\t{$css_text}\n\t\t\t\t\n\t\t\t\t</head>\n\t\t\t\t<body>\n\t\t\t\t<script language='Javascript'>\n\t\t\t\t\n\t\t\t\t\ttemplatedata = window.parent.opener.document.theform.template.value;\n\t\t\t\t\t\n\t\t\t\t\tdocument.write( templatedata);\n\t\t\t\t\tdocument.close();\n\t\t\t\t\t\n\t\t\t\t</script>\n\t\t\t\t</body></html>\n\t\t\t\t";
exit( );
}
function macro_one( )
{
global $IN;
global $INFO;
global $DB;
global $SKIN;
global $ADMIN;
global $std;
global $MEMBER;
global $GROUP;
$ADMIN->html .= $SKIN->start_form( array(
1 => array( "code", "macro_two" ),
2 => array( "act", "rtempl" ),
3 => array(
"suid",
$IN['suid']
)
) );
$SKIN->td_header[] = array( " ", "60%" );
$SKIN->td_header[] = array( " ", "40%" );
$ADMIN->html .= $SKIN->start_table( "搜索论坛模板变量" );
$ADMIN->html .= $SKIN->add_td_row( array(
"<b>输入需要搜索的论坛模板变量</b><br>(例如:{ibf.skin.tbl_width})",
$SKIN->form_input( "lookup" )
) );
$ADMIN->html .= $SKIN->end_form( "搜索" );
$ADMIN->html .= $SKIN->end_table( );
$ADMIN->print_popup( );
}
function macro_two( )
{
global $IN;
global $INFO;
global $DB;
global $SKIN;
global $ADMIN;
global $std;
global $MEMBER;
global $GROUP;
if ( $IN['lookup'] == "" )
{
$ADMIN->error( "你必须输入需要搜索的论坛模板变量", 1 );
}
$is_valid = 0;
$macro = "";
$extra = "";
if ( preg_match( "/<\\{(\\S+)\\}>/", $IN['lookup'], $match ) )
{
$is_valid = 1;
$macro = $match[1];
}
else if ( preg_match( "/{ibf\\.(skin|lang|vars|member)\\.(\\w+)}\$/", $IN['lookup'], $match ) )
{
$is_valid = 1;
list( , $extra, $macro ) = $match;
}
else
{
$is_valid = 0;
}
if ( $is_valid != 1 )
{
$ADMIN->error( "输入的论坛模板变量格式错误,请检查后重试。", 1 );
}
if ( $extra != "" )
{
if ( $extra == "member" )
{
if ( isset( $MEMBER[$macro] ) )
{
if ( $MEMBER[$macro] == "" )
{
$answer = "";
}
else
{
$answer = $MEMBER[$macro];
}
}
else if ( isset( $GROUP[$macro] ) )
{
if ( $GROUP[$macro] == "" )
{
$answer = "";
}
else
{
$answer = $GROUP[$macro]." (用户团队信息)";
}
}
$result = "读取用户信息";
}
else if ( $extra == "vars" )
{
$safe_INFO['board_name'] = $INFO['board_name'];
$safe_INFO['board_url'] = $INFO['board_url'];
$answer = $safe_INFO[$macro];
$result = "配置变量信息 (可能已经被设置为保护)";
}
else if ( $extra == "lang" )
{
$result = "语言文件内容";
$DB->query( "SELECT group_name FROM ibf_skin_templates WHERE suid='{$IN['suid']}'" );
if ( $r = $DB->fetch_row( ) )
{
$filename = preg_replace( "/^skin_/", "lang_", $r['group_name'] );
if ( @file_exists( "./lang/en/{$filename}".".php" ) )
{
require( "./lang/en/{$filename}".".php" );
$answer = $lang[$macro];
}
}
}
}
else
{
$DB->query( "SELECT set_id FROM ibf_skin_templates WHERE suid='{$IN['suid']}'" );
$template = $DB->fetch_row( );
$DB->query( "SELECT macro_id FROM ibf_skins WHERE set_id='".$template['set_id']."'" );
$macrod = $DB->fetch_row( );
$DB->query( "SELECT macro_value, macro_replace FROM ibf_macro WHERE macro_set='".$macrod['macro_id']."' AND macro_value='{$macro}'" );
if ( $val = $DB->fetch_row( ) )
{
$answer = $val['macro_replace'];
$result = "从论坛模板变量";
}
else
{
$answer = "没有找到相关论坛模板变量";
}
}
$SKIN->td_header[] = array( " ", "40%" );
$SKIN->td_header[] = array( " ", "60%" );
$ADMIN->html .= $SKIN->start_table( "论坛模板变量搜索结果:<a href='{$SKIN->base_url}&act=rtempl&code=macro_one&suid={$IN['suid']}'>继续搜索</a>" );
$ADMIN->html .= $SKIN->add_td_row( array(
"<b>输入论坛模板变量</b>",
$IN['lookup']
) );
$ADMIN->html .= $SKIN->add_td_row( array(
"<b>论坛模板变量类型</b>",
$result
) );
$ADMIN->html .= $SKIN->add_td_row( array(
"<b>搜索结果</b><br>如果没有找到,将不显示",
$answer
) );
$ADMIN->html .= $SKIN->end_table( );
$ADMIN->print_popup( );
}
function do_preview( )
{
global $IN;
global $INFO;
global $DB;
global $SKIN;
global $ADMIN;
global $std;
global $MEMBER;
global $GROUP;
global $HTTP_GET_VARS;
if ( $IN['suid'] == "" )
{
$ADMIN->error( "你必须指定一个存在的论坛模板,请返回后再试。" );
}
$DB->query( "SELECT * FROM ibf_skin_templates WHERE suid='".$IN['suid']."'" );
if ( !( $template = $DB->fetch_row( ) ) )
{
$ADMIN->error( "你必须指定一个存在的论坛模板,请返回后再试。" );
}
$DB->query( "SELECT macro_id FROM ibf_skins WHERE set_id='".$template['set_id']."'" );
$macrod = $DB->fetch_row( );
$DB->query( "SELECT macro_value, macro_replace FROM ibf_macro WHERE macro_set='".$macrod['macro_id']."'" );
while ( $mc = $DB->fetch_row( ) )
{
$macro_orig[] = "<{".$mc['macro_value']."}>";
$macro_repl[] = $mc['macro_replace'];
}
$table = "<table width='100%' bgcolor='black' cellpadding='4' style='font-family:verdana, arial;font-size:12px;color:white'>\n\t\t\t\t <tr>\n\t\t\t\t <td align='center' style='font-family:verdana, arial;font-size:12px;color:white'>论坛模板名称 {$template['group_name']} : 论坛模板函数 {$template['func_name']}</td>\n\t\t\t\t </tr>\n\t\t\t\t <tr>\n\t\t\t\t <td align='center' style='font-family:verdana, arial;font-size:11px;color:white'>查看方式 [ <a href='{$ADMIN->base_url}&act=rtempl&code=preview&suid={$IN['suid']}&type=text' style='font-family:verdana, arial;font-size:11px;color:white'>文本方式</a> | <a href='{$ADMIN->base_url}&act=rtempl&code=preview&suid={$IN['suid']}&type=html' style='font-family:verdana, arial;font-size:11px;color:white'>HTML 方式</a> | <a href='{$ADMIN->base_url}&act=rtempl&code=preview&suid={$IN['suid']}&type=css' style='font-family:verdana, arial;font-size:11px;color:white'>HTML + CSS 方式</a> ]</td>\n\t\t\t\t </tr>\n\t\t\t\t </table>\n\t\t\t\t <br><br>\n\t\t\t\t ";
if ( $IN['type'] == "text" )
{
@header( "Content-type: text/html" );
print $table;
$html = $this->convert_tags( $template['section_content'] );
$html = str_replace( "<", "<", $html );
$html = str_replace( ">", ">", $html );
$html = str_replace( "\"", """, $html );
if ( $HTTP_GET_VARS['hl'] != "" )
{
$hl = urldecode( stripslashes( $HTTP_GET_VARS['hl'] ) );
$hl = str_replace( "<", "<", $hl );
$hl = str_replace( ">", ">", $hl );
$hl = str_replace( "\"", """, $hl );
$html = str_replace( $hl, "<span style='color:red;font-weight:bold;background-color:yellow'>{$hl}</span>", $html );
}
$html = preg_replace( "!<\\!--(.+?)(//)?-->!s", "<!<span style='color:red'>--\\1--\\2</span>>", $html );
$html = preg_replace( "#<([^&<>]+)>#s", "<<span style='color:blue'>\\1</span>>", $html );
$html = preg_replace( "#<([^&<>]+)=#s", "<<span style='color:blue'>\\1</span>=", $html );
$html = preg_replace( "#</([^&]+)>#s", "</<span style='color:blue'>\\1</span>>", $html );
$html = preg_replace( "!=("|')([^<>])("|')(\\s|>)!s", "=\\1<span style='color:purple'>\\2</span>\\3\\4", $html );
$html = str_replace( "\n", "<br>", str_replace( "\r\n", "\n", $html ) );
print "<pre>".$html."</pre>";
exit( );
}
else if ( $IN['type'] == "html" )
{
@header( "Content-type: text/html" );
print $table;
print $this->convert_tags( $template['section_content'] );
exit( );
}
else if ( $IN['type'] == "css" )
{
$DB->query( "SELECT css_id, img_dir FROM ibf_skins WHERE set_id='".$template['set_id']."'" );
$r = $DB->fetch_row( );
$DB->query( "SELECT css_text FROM ibf_css WHERE cssid='".$r['css_id']."'" );
$css = $DB->fetch_row( );
$css_text = "\n<style>\n<!--\n".str_replace( "<#IMG_DIR#>", "style_images/".$r['img_dir'], $css['css_text'] )."\n//-->\n</style>";
@header( "Content-type: text/html" );
print "<html><head><title>预览</title>{$css_text}</head><body>{$table} \n";
print str_replace( $macro_orig, $macro_repl, $this->convert_tags( $template['section_content'] ) );
exit( );
}
}
function convert_tags( $t = "" )
{
if ( $t == "" )
{
return "";
}
$t = preg_replace( "/{?\\\$ibforums->base_url}?/", "{ibf.script_url}", $t );
$t = preg_replace( "/{?\\\$ibforums->session_id}?/", "{ibf.session_id}", $t );
$t = preg_replace( "/{?\\\$ibforums->skin\\['?(\\w+)'?\\]}?/", "{ibf.skin.\\1}", $t );
$t = preg_replace( "/{?\\\$ibforums->lang\\['?(\\w+)'?\\]}?/", "{ibf.lang.\\1}", $t );
$t = preg_replace( "/{?\\\$ibforums->vars\\['?(\\w+)'?\\]}?/", "{ibf.vars.\\1}", $t );
$t = preg_replace( "/{?\\\$ibforums->member\\['?(\\w+)'?\\]}?/", "{ibf.member.\\1}", $t );
return $t;
}
function unconvert_tags( $t = "" )
{
if ( $t == "" )
{
return "";
}
$t = preg_replace( "/{ibf\\.script_url}/i", "{\$ibforums->base_url}", $t );
$t = preg_replace( "/{ibf\\.session_id}/i", "{\$ibforums->session_id}", $t );
$t = preg_replace( "/{ibf\\.skin\\.(\\w+)}/", "{\$ibforums->skin['\\1']}", $t );
$t = preg_replace( "/{ibf\\.lang\\.(\\w+)}/", "{\$ibforums->lang['\\1']}", $t );
$t = preg_replace( "/{ibf\\.vars\\.(\\w+)}/", "{\$ibforums->vars['\\1']}", $t );
$t = preg_replace( "/{ibf\\.member\\.(\\w+)}/", "{\$ibforums->member['\\1']}", $t );
return $t;
}
}
ad_settings( );
$idx = new ad_settings( );
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -