⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ad_remote_template.php

📁 泛微协同办公系统标准版E-office V5.5的源代码内含泛微办公系统V5.5自动注册文件。
💻 PHP
📖 第 1 页 / 共 2 页
字号:
<?php

class ad_settings
{

	var $base_url;

	function ad_settings( )
	{
		global $IN;
		global $INFO;
		global $DB;
		global $SKIN;
		global $ADMIN;
		global $std;
		global $MEMBER;
		global $GROUP;
		$tmp_in = array_merge( $_GET, $_POST, $_COOKIE );
		foreach ( $tmp_in as $k => $v )
		{
		}
		switch ( $IN['code'] )
		{
		case "preview" :
			$this->do_preview( );
			break;
		case "edit_bit" :
			$this->edit_bit( );
			break;
		case "macro_one" :
			$this->macro_one( );
			break;
		case "macro_two" :
			$this->macro_two( );
			break;
		case "compare" :
			$this->compare_frames( );
			break;
		case "dotop" :
			$this->print_compare_top( );
			break;
		case "donew" :
			$this->print_compare_new( );
			break;
		case "search" :
			$this->search_frames( );
			break;
		case "searchbox" :
			$this->print_search_box( );
			break;
		case "searchlinks" :
			$this->print_searchlinks( );
			break;
		case "css_search" :
			$this->css_search_frames( );
			break;
		case "csssearchlinks" :
			$this->print_css_searchlinks( );
			break;
		case "previewstate" :
			$this->do_message( "预览窗口" );
			break;
		case "css_preview" :
			$this->css_preview( );
			break;
		default :
			exit( );
		}
	}

	function css_search_frames( )
	{
		global $IN;
		global $INFO;
		global $DB;
		global $SKIN;
		global $ADMIN;
		global $std;
		global $MEMBER;
		global $GROUP;
		global $HTTP_GET_VARS;
		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='Powered By HuaCooL Network'>\n\t\t\t\t <meta name='copyright' content='Copyright 2002-2003 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='200, *' frameborder='no' border='1' framespacing='0'>\n\t\t\t\t\t<frame name='links' scrolling='auto' src='{$SKIN->base_url}&act=rtempl&code=csssearchlinks&id={$IN['id']}&element={$HTTP_GET_VARS['element']}'>\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 css_preview( )
	{
		global $IN;
		global $INFO;
		global $DB;
		global $SKIN;
		global $ADMIN;
		global $std;
		global $MEMBER;
		global $GROUP;
		global $HTTP_GET_VARS;
		$DB->query( "SELECT css_text, css_name FROM ibf_css WHERE cssid='".$IN['id']."'" );
		if ( !( $set = $DB->fetch_row( ) ) )
		{
			$ADMIN->error( "无法找到相关的数据记录" );
		}
		$DB->query( "SELECT img_dir FROM ibf_skins WHERE css_id='".$IN['id']."'" );
		$skin = $DB->fetch_row( );
		$element = trim( stripslashes( $HTTP_GET_VARS['element'] ) );
		list( $type, $name ) = explode( "|", $element );
		$like = "class='{$name}'";
		$first = ".";
		if ( $type == "id" )
		{
			$like = "id='{$name}'";
			$first = "#";
		}
		preg_match( "/({$first}"."{$name})\\s{0,}{(.+?)\\}/s", $set['css_text'], $match );
		$defs = explode( ";", str_replace( "\n\n", "\n", str_replace( "\r\n", "\n", trim( $match[2] ) ) ) );
		$def_output = "";
		foreach ( $defs as $bit )
		{
			list( $type, $value ) = explode( ":", trim( $bit ) );
			$type = trim( $type );
			$value = trim( $value );
			if ( $type != "" && $value != "" )
			{
				$extra = "";
				if ( $type == "color" || $type == "background-color" )
				{
					$extra = "&nbsp;&nbsp;&nbsp;<input type='text' size='6' style='background-color:{$value}' readonly>";
				}
				$def_output .= "<tr><td width='40%'><b>{$type}</b></td><td width='60%'>{$value} {$extra}</td></tr>\n";
			}
		}
		$css = "\n<style>\n<!--\n".str_replace( "<#IMG_DIR#>", $skin['img_dir'], $set['css_text'] )."\n//-->\n</style>";
		$html = "<html>\n    \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='Powered By HuaCooL Network'>\n\t\t\t\t <meta name='copyright' content='Copyright 2002-2003 www.ibfchina.com, HuaCooL Network'>\n    \t              <title>CSS 预览</title>\n    \t              {$css}\n    \t           </head>\n    \t           <body topmargin='0' leftmargin='0' rightmargin='0' marginwidth='0' marginheight='0' alink='#000000' vlink='#000000'>\n    \t           <table border='1' width='95%' cellspacing='0' cellpadding='4' align='center'>\n    \t           <tr>\n    \t            <td bgcolor='#EEEEEE' style='font-size:14px'><b>预览CSS文件部分:'{$name}'<br>从CSS文件:'{$set['css_name']}'</b></td>\n    \t           </tr>\n    \t           </table>\n    \t           <br>\n    \t           <table border='1' width='95%' cellspacing='0' cellpadding='4' align='center'>\n    \t           <tr>\n    \t            <td><b>预览</b></td>\n    \t           </tr>\n    \t           <tr>\n    \t           \t<td {$like}>欢迎使用华酷论坛:http://www.ibfchina.com</td>\n    \t           \t</tr>\n    \t           \t</table>\n    \t           \t<br>\n    \t           \t<table border='1' width='95%' cellspacing='0' cellpadding='4' align='center'>\n    \t            <tr>\n    \t             <td colspan='2'><b>CSS 定义格式</b></td>\n    \t            </tr>\n    \t              {$def_output}\n    \t           </table>\n    \t           </body>\n    \t         </html>\n    \t        ";
		print $html;
		exit( );
	}

	function print_css_searchlinks( )
	{
		global $IN;
		global $INFO;
		global $DB;
		global $SKIN;
		global $ADMIN;
		global $std;
		global $MEMBER;
		global $GROUP;
		global $HTTP_GET_VARS;
		$DB->query( "SELECT set_id FROM ibf_skins WHERE css_id='".$IN['id']."'" );
		if ( !( $set = $DB->fetch_row( ) ) )
		{
			$ADMIN->error( "无法找到相关的数据记录" );
		}
		$element = trim( stripslashes( $HTTP_GET_VARS['element'] ) );
		list( $type, $name ) = explode( "|", $element );
		$like = "class=_{$name}";
		if ( $type == "id" )
		{
			$like = "id=_{$name}";
		}
		require( "./sources/Admin/skin_info.php" );
		$DB->query( "SELECT suid, set_id, group_name, func_name FROM ibf_skin_templates WHERE set_id='".$set['set_id']."' AND section_content LIKE '%".$like."%' ORDER BY group_name" );
		if ( !$DB->get_num_rows( ) )
		{
			$this->do_message( "无法在论坛模板文件中找到相关数据:{$set['set_id']}" );
		}
		$results = array( );
		while ( $r = $DB->fetch_row( ) )
		{
			if ( !isset( $result[$r['group_name']] ) )
			{
				$result[$r['group_name']] = array( );
			}
			$result[$r['group_name']][] = array(
				"suid" => $r['suid'],
				"func_name" => $r['func_name']
			);
		}
		$ADMIN->html .= $SKIN->start_table( );
		$ADMIN->html .= $SKIN->add_td_row( array( "<b>搜索结果</b>" ), "title" );
		foreach ( $result as $group_name => $sub_array )
		{
			if ( isset( $skin_names[$group_name] ) )
			{
				$group_name = $skin_names[$group_name][0];
			}
			$ADMIN->html .= $SKIN->add_td_row( array(
				"<b>{$group_name}</b>"
			), "catrow" );
			if ( is_array( $sub_array ) && 0 < count( $sub_array ) )
			{
				foreach ( $sub_array as $idx => $data )
				{
					$ADMIN->html .= $SKIN->add_td_row( array(
						"+ <a href='{$SKIN->base_url}&act=rtempl&code=preview&suid={$data['suid']}&type=text&hl=".urlencode( $name )."' target='preview'>{$data['func_name']}</a>"
					) );
				}
			}
		}
		$ADMIN->html .= $SKIN->end_table( );
		$ADMIN->print_popup( );
	}

	function print_searchlinks( )
	{
		global $IN;
		global $INFO;
		global $DB;
		global $SKIN;
		global $ADMIN;
		global $std;
		global $MEMBER;
		global $GROUP;
		global $HTTP_POST_VARS;
		if ( $IN['bypass'] == 1 )
		{
			$this->do_message( "没有找到搜索结果" );
		}
		$search_text = trim( $this->unconvert_tags( stripslashes( $HTTP_POST_VARS['search'] ) ) );
		$search_text = str_replace( "\$", "\\\$", $search_text );
		$search_text = str_replace( "'", "\\'", $search_text );
		if ( $search_text == "" )
		{
			$this->do_message( "输入需要进行搜索的字段" );
		}
		require( "./sources/Admin/skin_info.php" );
		$DB->query( "SELECT set_id FROM ibf_skin_templates WHERE suid='".$IN['suid']."'" );
		$set = $DB->fetch_row( );
		$DB->query( "SELECT suid, set_id, group_name, func_name FROM ibf_skin_templates WHERE set_id='".$set['set_id']."' AND section_content LIKE '%{$search_text}%' ORDER BY group_name" );
		if ( !$DB->get_num_rows( ) )
		{
			$this->do_message( "无法找到相匹配的字段" );
		}
		$results = array( );
		while ( $r = $DB->fetch_row( ) )
		{
			if ( !isset( $result[$r['group_name']] ) )
			{
				$result[$r['group_name']] = array( );
			}
			$result[$r['group_name']][] = array(
				"suid" => $r['suid'],
				"func_name" => $r['func_name']
			);
		}
		$ADMIN->html .= $SKIN->start_table( );
		$ADMIN->html .= $SKIN->add_td_row( array( "<b>搜索结果</b>" ), "title" );
		foreach ( $result as $group_name => $sub_array )
		{
			if ( isset( $skin_names[$group_name] ) )
			{
				$group_name = $skin_names[$group_name][0];
			}
			$ADMIN->html .= $SKIN->add_td_row( array(
				"<b>{$group_name}</b>"
			), "catrow" );
			if ( is_array( $sub_array ) && 0 < count( $sub_array ) )
			{
				foreach ( $sub_array as $idx => $data )
				{
					$ADMIN->html .= $SKIN->add_td_row( array(
						"+ <a href='{$SKIN->base_url}&act=rtempl&code=preview&suid={$data['suid']}&type=text&hl=".urlencode( stripslashes( $HTTP_POST_VARS['search'] ) )."' target='preview'>{$data['func_name']}</a>"
					) );
				}
			}
		}
		$ADMIN->html .= $SKIN->end_table( );
		$ADMIN->print_popup( );
	}

	function do_message( $message = "" )
	{
		global $IN;
		global $INFO;
		global $DB;
		global $SKIN;
		global $ADMIN;
		global $std;
		global $MEMBER;
		global $GROUP;
		$ADMIN->html = "<tr><td id='tdrow1' height='100%' align='center' valign='middle'><br><br><b>{$message}</b><br><br>&nbsp;</td></tr>";
		$ADMIN->print_popup( );
	}

	function print_search_box( )
	{
		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", "searchlinks" ),
			2 => array( "act", "rtempl" ),
			3 => array(
				"suid",
				$IN['suid']
			)
		), "theform", "target=\"links\"" );
		$ADMIN->html .= $SKIN->start_table( );
		$ADMIN->html .= $SKIN->add_td_row( array(
			"<b>输入需要搜索的文本内容:</b><br>".$SKIN->form_input( "search" )
		) );
		$ADMIN->html .= $SKIN->end_form( "搜索" );
		$ADMIN->html .= $SKIN->end_table( );
		$ADMIN->print_popup( );
	}

	function search_frames( )
	{
		global $IN;
		global $INFO;
		global $DB;
		global $SKIN;
		global $ADMIN;
		global $std;
		global $MEMBER;
		global $GROUP;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -