Location: PHPKode > projects > Warp.cms - php/mysql content management > warp_121/lib_adv.php
<?php

// [advanced functions library v.1.2.1]
// xantis.warp.cms - version 1.2
// (c) 2002 xantis - all rights reserved
// this code is registered and protected by international copyrights laws


if (empty($yfilename)) {
	$yfilename = 'lib_adv.php';
} //end if

require("lib_main.php");


//---------------------------------------------------------------SPECIAL
function xflash_rtf_to_html ($y_flash_html) {

	//must remove slashes before

	//make line breaks
	$y_flash_html = eregi_replace('<P ALIGN="+[[:alnum:]]+"><FONT FACE="_+[[:alnum:]]+" SIZE="+[[:alnum:]]+" COLOR="#+[[:alnum:]]+"></FONT></P>', '<br>', $y_flash_html);
	$y_flash_html = eregi_replace('<P ALIGN="+[[:alnum:]]+"><FONT FACE="_+[[:alnum:]]+" SIZE="+[[:alnum:]]+" COLOR="#+[[:alnum:]]+"><B></B></FONT></P>', '<br>', $y_flash_html);
	$y_flash_html = eregi_replace('<P ALIGN="+[[:alnum:]]+"><FONT FACE="_+[[:alnum:]]+" SIZE="+[[:alnum:]]+" COLOR="#+[[:alnum:]]+"><I></I></FONT></P>', '<br>', $y_flash_html);
	$y_flash_html = eregi_replace('<P ALIGN="+[[:alnum:]]+"><FONT FACE="_+[[:alnum:]]+" SIZE="+[[:alnum:]]+" COLOR="#+[[:alnum:]]+"><U></U></FONT></P>', '<br>', $y_flash_html);
	$y_flash_html = eregi_replace('<P ALIGN="+[[:alnum:]]+"><FONT FACE="_+[[:alnum:]]+" SIZE="+[[:alnum:]]+" COLOR="#+[[:alnum:]]+"><B><I></I></B></FONT></P>', '<br>', $y_flash_html);
	$y_flash_html = eregi_replace('<P ALIGN="+[[:alnum:]]+"><FONT FACE="_+[[:alnum:]]+" SIZE="+[[:alnum:]]+" COLOR="#+[[:alnum:]]+"><B><U></U></B></FONT></P>', '<br>', $y_flash_html);
	$y_flash_html = eregi_replace('<P ALIGN="+[[:alnum:]]+"><FONT FACE="_+[[:alnum:]]+" SIZE="+[[:alnum:]]+" COLOR="#+[[:alnum:]]+"><I><U></U></I></FONT></P>', '<br>', $y_flash_html);
	$y_flash_html = eregi_replace('<P ALIGN="+[[:alnum:]]+"><FONT FACE="_+[[:alnum:]]+" SIZE="+[[:alnum:]]+" COLOR="#+[[:alnum:]]+"><B><I><U></U></I></B></FONT></P>', '<br>', $y_flash_html);

	$y_flash_html = eregi_replace('<P ALIGN="+[[:alnum:]]+"><FONT FACE="_+[[:alnum:]]+" SIZE="+[[:alnum:]]+" COLOR="#+[[:alnum:]]+"> </FONT></P>', '<br>', $y_flash_html);
	$y_flash_html = eregi_replace('<P ALIGN="+[[:alnum:]]+"><FONT FACE="_+[[:alnum:]]+" SIZE="+[[:alnum:]]+" COLOR="#+[[:alnum:]]+"><B> </B></FONT></P>', '<br>', $y_flash_html);
	$y_flash_html = eregi_replace('<P ALIGN="+[[:alnum:]]+"><FONT FACE="_+[[:alnum:]]+" SIZE="+[[:alnum:]]+" COLOR="#+[[:alnum:]]+"><I> </I></FONT></P>', '<br>', $y_flash_html);
	$y_flash_html = eregi_replace('<P ALIGN="+[[:alnum:]]+"><FONT FACE="_+[[:alnum:]]+" SIZE="+[[:alnum:]]+" COLOR="#+[[:alnum:]]+"><U> </U></FONT></P>', '<br>', $y_flash_html);
	$y_flash_html = eregi_replace('<P ALIGN="+[[:alnum:]]+"><FONT FACE="_+[[:alnum:]]+" SIZE="+[[:alnum:]]+" COLOR="#+[[:alnum:]]+"><B><I> </I></B></FONT></P>', '<br>', $y_flash_html);
	$y_flash_html = eregi_replace('<P ALIGN="+[[:alnum:]]+"><FONT FACE="_+[[:alnum:]]+" SIZE="+[[:alnum:]]+" COLOR="#+[[:alnum:]]+"><B><U> </U></B></FONT></P>', '<br>', $y_flash_html);
	$y_flash_html = eregi_replace('<P ALIGN="+[[:alnum:]]+"><FONT FACE="_+[[:alnum:]]+" SIZE="+[[:alnum:]]+" COLOR="#+[[:alnum:]]+"><I><U> </U></I></FONT></P>', '<br>', $y_flash_html);
	$y_flash_html = eregi_replace('<P ALIGN="+[[:alnum:]]+"><FONT FACE="_+[[:alnum:]]+" SIZE="+[[:alnum:]]+" COLOR="#+[[:alnum:]]+"><B><I><U> </U></I></B></FONT></P>', '<br>', $y_flash_html);


	//replace paragraphs
	$y_flash_html = eregi_replace ('<P', '<DIV', "$y_flash_html");
	$y_flash_html = eregi_replace ('</P>', '</DIV>'."\n", "$y_flash_html");

	//make real spaces where more than one
	$y_flash_html = str_replace ('  ', '&nbsp;&nbsp;', "$y_flash_html");

	//restore single quote
	$y_flash_html = eregi_replace('&apos;', "'", $y_flash_html);


	//build indents
	$y_flash_html = eregi_replace ('<TEXTFORMAT INDENT="5">', '<BLOCKQUOTE STYLE="margin-left: 20px">', "$y_flash_html");
	$y_flash_html = eregi_replace ('<TEXTFORMAT INDENT="10">', '<BLOCKQUOTE STYLE="margin-left: 25px">', "$y_flash_html");
	$y_flash_html = eregi_replace ('<TEXTFORMAT INDENT="15">', '<BLOCKQUOTE STYLE="margin-left: 30px">', "$y_flash_html");
	$y_flash_html = eregi_replace ('<TEXTFORMAT INDENT="20">', '<BLOCKQUOTE STYLE="margin-left: 35px">', "$y_flash_html");
	$y_flash_html = eregi_replace ('<TEXTFORMAT INDENT="25">', '<BLOCKQUOTE STYLE="margin-left: 40px">', "$y_flash_html");
	$y_flash_html = eregi_replace ('<TEXTFORMAT INDENT="30">', '<BLOCKQUOTE STYLE="margin-left: 45px">', "$y_flash_html");
	$y_flash_html = eregi_replace ('<TEXTFORMAT INDENT="35">', '<BLOCKQUOTE STYLE="margin-left: 50px">', "$y_flash_html");
	$y_flash_html = eregi_replace ('<TEXTFORMAT INDENT="40">', '<BLOCKQUOTE STYLE="margin-left: 55px">', "$y_flash_html");
	$y_flash_html = eregi_replace ('<TEXTFORMAT INDENT="45">', '<BLOCKQUOTE STYLE="margin-left: 60px">', "$y_flash_html");
	$y_flash_html = eregi_replace ('<TEXTFORMAT INDENT="50">', '<BLOCKQUOTE STYLE="margin-left: 65px">', "$y_flash_html");
	$y_flash_html = eregi_replace ('<TEXTFORMAT INDENT="55">', '<BLOCKQUOTE STYLE="margin-left: 70px">', "$y_flash_html");
	$y_flash_html = eregi_replace ('<TEXTFORMAT INDENT="60">', '<BLOCKQUOTE STYLE="margin-left: 75px">', "$y_flash_html");
	$y_flash_html = eregi_replace ('<TEXTFORMAT INDENT="65">', '<BLOCKQUOTE STYLE="margin-left: 80px">', "$y_flash_html");
	$y_flash_html = eregi_replace ('<TEXTFORMAT INDENT="70">', '<BLOCKQUOTE STYLE="margin-left: 85px">', "$y_flash_html");
	$y_flash_html = eregi_replace ('<TEXTFORMAT INDENT="75">', '<BLOCKQUOTE STYLE="margin-left: 90px">', "$y_flash_html");
	$y_flash_html = eregi_replace ('<TEXTFORMAT INDENT="80">', '<BLOCKQUOTE STYLE="margin-left: 95px">', "$y_flash_html");
	$y_flash_html = eregi_replace ('<TEXTFORMAT INDENT="85">', '<BLOCKQUOTE STYLE="margin-left: 100px">', "$y_flash_html");
	$y_flash_html = eregi_replace ('<TEXTFORMAT INDENT="90">', '<BLOCKQUOTE STYLE="margin-left: 105px">', "$y_flash_html");
	$y_flash_html = eregi_replace ('<TEXTFORMAT INDENT="95">', '<BLOCKQUOTE STYLE="margin-left: 110px">', "$y_flash_html");
	$y_flash_html = eregi_replace ('<TEXTFORMAT INDENT="100">', '<BLOCKQUOTE STYLE="margin-left: 115px">', "$y_flash_html");
	$y_flash_html = eregi_replace ('</TEXTFORMAT>', '</BLOCKQUOTE>', "$y_flash_html");


	//font faces
	$y_flash_html = eregi_replace ('FACE="_sans"', 'FACE="Verdana, Tahoma, Arial, sans-serif"', "$y_flash_html");
	$y_flash_html = eregi_replace ('FACE="_serif"', 'FACE="Times New Roman, Times, serif"', "$y_flash_html");
	$y_flash_html = eregi_replace ('FACE="_typewriter"', 'FACE="Courier New, Courier, mono"', "$y_flash_html");

	//font sizes
	$y_flash_html = eregi_replace ('SIZE="11"', 'SIZE="1"', "$y_flash_html");
	$y_flash_html = eregi_replace ('SIZE="13"', 'SIZE="2"', "$y_flash_html");
	$y_flash_html = eregi_replace ('SIZE="15"', 'SIZE="3"', "$y_flash_html");
	$y_flash_html = eregi_replace ('SIZE="17"', 'SIZE="4"', "$y_flash_html");

	return $y_flash_html;

} //end function


function xflash_rtf_to_html_undo ($y_flash_html) {

	//must remove slashes before

	//line breaks (no need to restore, it is just ok the <br> tag

	//restore paragraphs
	$y_flash_html = str_replace ("\n", '', "$y_flash_html");
	$y_flash_html = eregi_replace ('<DIV', '<P', "$y_flash_html");
	$y_flash_html = eregi_replace ('</DIV>', '</P>', "$y_flash_html");

	//restore spaces
	$y_flash_html = str_replace ('&nbsp;', ' ', "$y_flash_html");

	//restore single quote
	$y_flash_html = eregi_replace("'", '&apos;', $y_flash_html);


	//restore indents
	$y_flash_html = eregi_replace ('<BLOCKQUOTE STYLE="margin-left: 20px">', '<TEXTFORMAT INDENT="5">', "$y_flash_html");
	$y_flash_html = eregi_replace ('<BLOCKQUOTE STYLE="margin-left: 25px">', '<TEXTFORMAT INDENT="10">', "$y_flash_html");
	$y_flash_html = eregi_replace ('<BLOCKQUOTE STYLE="margin-left: 30px">', '<TEXTFORMAT INDENT="15">', "$y_flash_html");
	$y_flash_html = eregi_replace ('<BLOCKQUOTE STYLE="margin-left: 35px">', '<TEXTFORMAT INDENT="20">', "$y_flash_html");
	$y_flash_html = eregi_replace ('<BLOCKQUOTE STYLE="margin-left: 40px">', '<TEXTFORMAT INDENT="25">', "$y_flash_html");
	$y_flash_html = eregi_replace ('<BLOCKQUOTE STYLE="margin-left: 45px">', '<TEXTFORMAT INDENT="30">', "$y_flash_html");
	$y_flash_html = eregi_replace ('<BLOCKQUOTE STYLE="margin-left: 50px">', '<TEXTFORMAT INDENT="35">', "$y_flash_html");
	$y_flash_html = eregi_replace ('<BLOCKQUOTE STYLE="margin-left: 55px">', '<TEXTFORMAT INDENT="40">', "$y_flash_html");
	$y_flash_html = eregi_replace ('<BLOCKQUOTE STYLE="margin-left: 60px">', '<TEXTFORMAT INDENT="45">', "$y_flash_html");
	$y_flash_html = eregi_replace ('<BLOCKQUOTE STYLE="margin-left: 65px">', '<TEXTFORMAT INDENT="50">', "$y_flash_html");
	$y_flash_html = eregi_replace ('<BLOCKQUOTE STYLE="margin-left: 70px">', '<TEXTFORMAT INDENT="55">', "$y_flash_html");
	$y_flash_html = eregi_replace ('<BLOCKQUOTE STYLE="margin-left: 75px">', '<TEXTFORMAT INDENT="60">', "$y_flash_html");
	$y_flash_html = eregi_replace ('<BLOCKQUOTE STYLE="margin-left: 80px">', '<TEXTFORMAT INDENT="65">', "$y_flash_html");
	$y_flash_html = eregi_replace ('<BLOCKQUOTE STYLE="margin-left: 85px">', '<TEXTFORMAT INDENT="70">', "$y_flash_html");
	$y_flash_html = eregi_replace ('<BLOCKQUOTE STYLE="margin-left: 90px">', '<TEXTFORMAT INDENT="75">', "$y_flash_html");
	$y_flash_html = eregi_replace ('<BLOCKQUOTE STYLE="margin-left: 95px">', '<TEXTFORMAT INDENT="80">', "$y_flash_html");
	$y_flash_html = eregi_replace ('<BLOCKQUOTE STYLE="margin-left: 100px">', '<TEXTFORMAT INDENT="85">', "$y_flash_html");
	$y_flash_html = eregi_replace ('<BLOCKQUOTE STYLE="margin-left: 105px">', '<TEXTFORMAT INDENT="90">', "$y_flash_html");
	$y_flash_html = eregi_replace ('<BLOCKQUOTE STYLE="margin-left: 110px">', '<TEXTFORMAT INDENT="95">', "$y_flash_html");
	$y_flash_html = eregi_replace ('<BLOCKQUOTE STYLE="margin-left: 115px">', '<TEXTFORMAT INDENT="100">', "$y_flash_html");
	$y_flash_html = eregi_replace ('</BLOCKQUOTE>', '</TEXTFORMAT>', "$y_flash_html");


	//restore font faces
	$y_flash_html = eregi_replace ('FACE="Verdana, Tahoma, Arial, sans-serif"', 'FACE="_sans"', "$y_flash_html");
	$y_flash_html = eregi_replace ('FACE="Times New Roman, Times, serif"', 'FACE="_serif"', "$y_flash_html");
	$y_flash_html = eregi_replace ('FACE="Courier New, Courier, mono"', 'FACE="_typewriter"', "$y_flash_html");

	//restore font sizes
	$y_flash_html = eregi_replace ('SIZE="1"', 'SIZE="11"', "$y_flash_html");
	$y_flash_html = eregi_replace ('SIZE="2"', 'SIZE="13"', "$y_flash_html");
	$y_flash_html = eregi_replace ('SIZE="3"', 'SIZE="15"', "$y_flash_html");
	$y_flash_html = eregi_replace ('SIZE="4"', 'SIZE="17"', "$y_flash_html");

	return $y_flash_html;

} //end function


function xundo_htmlspecchars ($y_flash_html) {

	//must remove slashes before

	//restore <
	$y_flash_html = str_replace('&lt;', '<', "$y_flash_html");

	//restore >
	$y_flash_html = str_replace('&gt;', '>', "$y_flash_html");

	//restore "
	$y_flash_html = str_replace('&quot;', '"', "$y_flash_html");

	//restore &
	$y_flash_html = str_replace('&amp;', '&', "$y_flash_html");

	//restore spaces
	$y_flash_html = str_replace( '&nbsp;&nbsp;', '  ', "$y_flash_html");

	return $y_flash_html;

} //end function




//---------------------------------------------------------------MISC


function xshow_display_module ($ytitle, $ytext) {

	global $ybar_color;
	global $ymain_color;
	global $ydisplay_width_corrected;

	$ysize = $ydisplay_width_corrected;

	xtable_start ("$ysize");

		xtable_row_start ();
			xtable_column_start ('1', '', "$ybar_color");
				xtext_title ("&nbsp;"."$ytitle");
			xtable_column_end ();
		xtable_row_end ();

		xtable_row_start ();
			xtable_column_start ('1', '', "$ymain_color");
				xvline ("100%");
				xtext_small ("$ytext");
				xnewline ();
				xvline ("100%");
			xtable_column_end ();
		xtable_row_end ();

	xtable_end ();

} // end function


function xshow_display_std_start ($ytitle, $ysize) {

	global $ybar_color;
	global $ymain_color;
	global $ydisplay_width_corrected;

	xtable_start ("$ysize");

		xtable_row_start ();
			xtable_column_start ('1', '', "$ybar_color");
				xtext_title ("&nbsp;"."$ytitle");
			xtable_column_end ();
		xtable_row_end ();

		xtable_row_start ();
			xtable_column_start ('1', '', "$ymain_color");
				xvline ("100%");


} //end function


function xshow_display_std_end () {

				xvline ("100%");
			xtable_column_end ();
		xtable_row_end ();

	xtable_end ();

} // end function




function xshow_left_module_start ($ytitle) {

	global $ybar_color;
	global $ymain_color;
	global $ymenu_name;
	global $ymenu_width;

	$ysize = $ymenu_width;

	xtable_start ("$ysize");

		xtable_row_start ();
			xtable_column_start ('2', '100%', "$ybar_color");
				xcenter_start ();
					xtext_title ("$ytitle");
				xcenter_end ();
			xtable_column_end ();
		xtable_row_end ();

		xtable_row_start ();
			xtable_column_start ('2', '100%', "$ymain_color");
				xvline ("100%");
			xtable_column_end ();
		xtable_row_end ();

		xtable_row_start ();
			xtable_column_start ('2', '100%', "$ymain_color");

} // end function



function xshow_left_module_end () {

	global $ymain_color;
	global $ymenu_width;

	$ysize = $ymenu_width;

				xvline ("100%");
			xtable_column_end ();
		xtable_row_end ();
	xtable_end ();

} // end function


function xshow_section_menu_start () {

	global $ybar_menu_color, $ywarp_max_display_cfg;

  xcenter_start ();
  xtable_start ("$ywarp_max_display_cfg");
	xtable_row_start ();
		xtable_column_start ('1', '', "$ybar_menu_color");

} // end function


function xshow_section_menu_end () {

		xtable_column_end ();
	xtable_row_end ();
  xtable_end ();
  xcenter_end ();

} // end function


function xshow_page_title ($ytitle, $ysid) {

	global 	$ysite_back_color, $ywarp_max_display_cfg, $ybar_pagetitle_color, $ybig_title_text_color;
	global 	$ywebsite_name, $ywebsite_addr, $y_warp_xdate, $y_warp_xtime;
	global	$y_warp_top_pict, $y_warp_picts_dir ;
	global	$PHP_AUTH_PW, $PHP_AUTH_USER ;

  xcenter_start ();
  xtable_start ("$ywarp_max_display_cfg");
	xtable_row_start ();

		xtable_column_start_vcenter ('1', "$ywarp_max_display_cfg", "$ysite_back_color");
			xcenter_start ();

				//top picture
				if (substr($y_warp_top_pict, -4, 4) == '.swf') {
					xwriteflash_nobg ("$ywebsite_addr"."$y_warp_picts_dir".'/'."$y_warp_top_pict", '750', '75');
					xnewline ();
				} //end if
				elseif (!empty($y_warp_top_pict)) {
					xpict ("$ywebsite_addr"."$y_warp_picts_dir".'/'."$y_warp_top_pict", '750', '75');
					xnewline ();
				} //end elseif

				$ytitle = xundo_htmlspecchars($ytitle);

				xwriteflash_nobg_var ("$ywebsite_addr"."title_cnt.swf",
					"&flash_form_backcolor=".rawurlencode($ybar_pagetitle_color).
					"&flash_form_textcolor=".rawurlencode($ybig_title_text_color).
					"&flash_form_text_title=".rawurlencode($ywebsite_name." / ".$ytitle).
					"&flash_form_text_date=".rawurlencode($y_warp_xdate).
					"&flash_form_text_time=".rawurlencode($y_warp_xtime).
					"&xurl=".rawurlencode("$ywebsite_addr"."counter.php?wpsid=$ysid&wxu=".MD5($PHP_AUTH_USER)."&wxp=".(MD5(base64_encode($PHP_AUTH_PW)))).
					"&xbase=".rawurlencode("$ywebsite_addr").
					"&"
				, '750', '25');

			xcenter_end ();
		xtable_column_end ();

	xtable_row_end ();
  xtable_end ();
  xcenter_end ();

} // end function


function xshow_page_title_ssl ($ytitle, $ysid) {

	global 	$ysite_back_color, $ywarp_max_display_cfg, $ybar_pagetitle_color, $ybig_title_text_color;
	global 	$ywebsite_name, $ywebsite_addr_secure, $y_warp_xdate, $y_warp_xtime;
	global	$y_warp_top_pict, $y_warp_picts_dir ;
	global	$PHP_AUTH_PW, $PHP_AUTH_USER ;

  xcenter_start ();
  xtable_start ("$ywarp_max_display_cfg");
	xtable_row_start ();

		xtable_column_start_vcenter ('1', "$ywarp_max_display_cfg", "$ysite_back_color");
			xcenter_start ();

				//top picture
				if (substr($y_warp_top_pict, -4, 4) == '.swf') {
					xwriteflash_nobg ("$ywebsite_addr_secure"."$y_warp_picts_dir".'/'."$y_warp_top_pict", '750', '75');
					xnewline ();
				} //end if
				elseif (!empty($y_warp_top_pict)) {
					xpict ("$ywebsite_addr_secure"."$y_warp_picts_dir".'/'."$y_warp_top_pict", '750', '75');
					xnewline ();
				} //end elseif

				$ytitle = xundo_htmlspecchars($ytitle);

				xwriteflash_nobg_var ("$ywebsite_addr_secure"."title_cnt.swf",
					"&flash_form_backcolor=".rawurlencode($ybar_pagetitle_color).
					"&flash_form_textcolor=".rawurlencode($ybig_title_text_color).
					"&flash_form_text_title=".rawurlencode($ywebsite_name." / ".$ytitle).
					"&flash_form_text_date=".rawurlencode($y_warp_xdate).
					"&flash_form_text_time=".rawurlencode($y_warp_xtime).
					"&xurl=".rawurlencode("$ywebsite_addr_secure"."counter.php?wpsid=$ysid&wxu=".MD5($PHP_AUTH_USER)."&wxp=".(MD5(base64_encode($PHP_AUTH_PW)))).
					"&"
				, '750', '25');

			xcenter_end ();
		xtable_column_end ();

	xtable_row_end ();
  xtable_end ();
  xcenter_end ();

} // end function


function xrecheck_secure_header_ret_usrid ($yshow_lnk) {

	global	$PHP_AUTH_PW, $PHP_AUTH_USER, $wpsid,
		$arr_var_result,
		$ymain_color, $ywebsite_addr,
		$warp_registrat_fail, $y_warp_back_text_x ;

	global	$wrshruid_xhlock_fct_usr_id ;


	//------------------------ check user auth

		//read from users
		$WARP_B64_ENC_AUTH_PASSW = base64_encode($PHP_AUTH_PW);
		xmysql_read_data ("SELECT id FROM users WHERE ( (usr_name='$PHP_AUTH_USER') AND (usr_pass='$WARP_B64_ENC_AUTH_PASSW') )");

		$wrshruid_xhlock_fct_usr_id = '';
		$wrshruid_xhlock_fct_usr_id = $arr_var_result[0];

		if (empty($wrshruid_xhlock_fct_usr_id)) {
			xcenter_start ();
				xtable_start ('');
					xtable_row_start ();
						xtable_column_start_vcenter ('1', '40', "$ymain_color");
							xspace ();
							xwriteflash_bg_var ('flagger.swf',
							"&xaction=".rawurlencode('err').
							"&"
							, '30', '30', "$ymain_color");
						xtable_column_end ();

						xtable_column_start_vcenter ('1', '', "$ymain_color");
							xtext_small ("$warp_registrat_fail");
							xspace ();
							xspace ();
							if ($yshow_lnk == 'y') {
								xtext_small ('|');
								xspace ();
								xtext_link ("$y_warp_back_text_x", "$ywebsite_addr"."xw_main.php?wpsid=$wpsid", '_self');
								xspace ();
								xspace ();
							} //end if
						xtable_column_end ();
					xtable_row_end ();
				xtable_end ();
			xcenter_end ();

			echo("\n");
			die("</body>\n</html>\n");

		} //end if
		else {
			return $wrshruid_xhlock_fct_usr_id ;
		} //end else

	//------------------------

} // end function



function xzerr_die_after_header ($y_text) {

global	$ymain_color, $y_warp_back_text_x, 
	$ywebsite_addr, $wpsid ;

		xcenter_start ();
			xtable_start ('');
				xtable_row_start ();
					xtable_column_start_vcenter ('1', '40', "$ymain_color");
						xspace ();
						xwriteflash_bg_var ('flagger.swf',
						"&xaction=".rawurlencode('err').
						"&"
						, '30', '30', "$ymain_color");
					xtable_column_end ();
					xtable_column_start_vcenter ('1', '', "$ymain_color");
						xtext_small ("$y_text");
						xspace ();
						xspace ();
						xtext_small ('|');
						xspace ();
						xtext_link ("$y_warp_back_text_x", "$ywebsite_addr"."xw_main.php?wpsid=$wpsid", '_self');
						xspace ();
						xspace ();
					xtable_column_end ();
				xtable_row_end ();
			xtable_end ();
		xcenter_end ();

		echo("\n");
		die("</body>\n</html>\n");

} // end function



//---------------------------------------------------------------PRODS

function xestab_ptyp ($ece, $p_ece, $p_pr) {

$yxq_prod_type = '';

//===================================

if ($ece == 'y') {
	if ($p_pr <> '0') {
		if ($p_ece == 'y') {
			$yxq_prod_type = 'e';
		} //end if
		else {
			$yxq_prod_type = 'p';
		} //end else
	} //end if
	else {
		$yxq_prod_type = 'x';
	} //end else
} //end if

//===================================

if ($ece == 'n') {
	if ($p_pr <> '0') {
		$yxq_prod_type = 'p';
	} //end if
	else {
		$yxq_prod_type = 'x';
	} //end else
} //end if

//===================================

return $yxq_prod_type;

} //end function


//---------------------------------------------------------------- IDENTIFY


function xwrp_os_brows_ip_get () {

global	$HTTP_USER_AGENT, $REMOTE_ADDR;

	//--------------------identify browser & OS

	// browser identify
	$wp_browser = '';
	$wp_browser = 'other';
	if (eregi("Netscape", $HTTP_USER_AGENT) OR eregi("Mozilla", $HTTP_USER_AGENT)) {
		$wp_browser = "netscape";
	} //end if
	if (eregi("MSIE", $HTTP_USER_AGENT)) {
		$wp_browser = "msie";
	} //end if
	if (eregi("Opera", $HTTP_USER_AGENT)) {
		$wp_browser = "opera";
	} //end if

	// os identify
	$wp_os = '';
	$wp_os = 'other';
	if (eregi("Win", $HTTP_USER_AGENT)) {
		$wp_os = "windows";
	} //end if
	if (eregi("Mac", $HTTP_USER_AGENT) OR eregi("PPC", $HTTP_USER_AGENT)) {
		$wp_os = "mac";
	} //end if
	if (eregi("Linux", $HTTP_USER_AGENT)) {
		$wp_os = "linux";
	} //end if
	if (eregi("SunOS", $HTTP_USER_AGENT) OR eregi("Solaris", $HTTP_USER_AGENT)) {
		$wp_os = "sun";
	} //end if
	if (eregi("IRIX", $HTTP_USER_AGENT)) {
		$wp_os = "irix";
	} //end if
	if (eregi("FreeBSD", $HTTP_USER_AGENT)) {
		$wp_os = "freebsd";
	} //end if


	//--------------------- ip addr

		$wp_ip = $REMOTE_ADDR;

	//---------------------

	$xwrp_zidentify_data = array();
	$xwrp_zidentify_data['os'] = $wp_os;
	$xwrp_zidentify_data['bw'] = $wp_browser;
	$xwrp_zidentify_data['ip'] = $wp_ip;

	//---------------------

	return $xwrp_zidentify_data;

} //end function


//----------------------------------------------------------------


// end of php code
?>
Return current item: Warp.cms - php/mysql content management