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

// [forum module 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 ($warp_module_var_check_auth != 'x99warpv12.cms') {
	$y_hlocalmodz_xdate = date("Y-m-d");
	$y_hlocalmodz_xtime = date("H:i:s");
	$wpmod_xdyech =	"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">\n".
			"<!--:: xantis.warp.cms :: Xantis Warp - Content Management Server - v.1.2 :: $y_hlocalmodz_xdate :: $y_hlocalmodz_xtime :: -->\n".
			"<html>\n".
			"<head>\n".
			"<title>! ! !</title>\n".
			"<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">\n".
			"</head>\n".
			"<body bgcolor=\"#FFFFFF\" leftmargin=\"0\" topmargin=\"0\" marginwidth=\"0\" marginheight=\"0\">\n".
			"<br>\n".
			"<div align=\"center\"><object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://active.macromedia.com/flash6/cabs/swflash.cab#version=6,0,0,0\" width=\"30\" height=\"30\">\n".
			"<param name=\"movie\" value=\"flagger.swf\">\n".
			"<param name=\"flashvars\" value=\"&xaction=err&\">\n".
			"<param name=\"quality\" value=\"high\">\n".
			"<param name=\"bgcolor\" value=\"#FFFFFF\">\n".
			"<param name=\"menu\" value=\"false\">\n".
			"<embed src=\"flagger.swf\" flashvars=\"&xaction=err&\" quality=\"high\" bgcolor=\"#FFFFFF\" width=\"30\" height=\"30\" menu=\"false\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\"></embed>\n".
			"</object>\n".
			"</div>\n".
			"</body>\n".
			"</html>\n" ;
	die("$wpmod_xdyech");
} //end if


//---------------------
if (empty($fop)) {
   $fop = 'categ';
} //end if
//---------------------


//======================require secure

function forum_secure () {

	global 	$mod_req_sec;
	global 	$fop;
	global	$ywarp_forum_restrict_topic_acc, $ywarp_forum_restrict_reply_acc ;

	if ( (($fop == 'topic') AND ($ywarp_forum_restrict_topic_acc == 'y')) OR (($fop == 'repl') AND ($ywarp_forum_restrict_reply_acc == 'y')) OR ($fop == 'pstt') OR ($fop == 'pstr') OR ($fop == 'edtt') OR ($fop == 'edtr') ) {
		$mod_req_sec = 'y';
	} // end if

	return $mod_req_sec;

} //end function

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


function forum_module () {
//-------------------

//remote and lib vars
global 	$PHP_AUTH_USER, $PHP_AUTH_PW, $arr_var_result, $var_result_size, 
	$ydisplay_width_corrected, $wpqid, $wpsid ;

// cfg vars
global 	$ywebsite_addr, $y_warp_picts_dir, $ysite_back_color, $ybar_menu_color, $ymain_color, $ysmall_text_color,
	$y_warp_total_text, $y_warp_next_text, $y_warp_prev_text, $y_warp_back_text, $y_warp_filter_text_bttn,
	$y_warp_post_text_bttn, $y_warp_filter_text, $y_warp_filtered_text, $y_warp_filter_remove, $y_warp_filter_hint,
	$y_warp_post_text_mark, $y_warp_post_text_hint, $y_warp_print_text, $y_warp_refresh_text, $y_warp_update_txt,
	$y_warp_filter_sign ;

// cfg vars
global 	$y_warp_max_forums_perpage, $yforum_last_topic, $yforum_last_reply, $yforum_sender, $yforum_message, $yforum_subject,
	$yforum_posted_on, $yforum_created_on, $yforum_sender_name, $yforum_status_post, $yforum_process_post, $yforum_err_post,
	$yforum_thanks_post, $yforum_forum_title_short, $yforum_categ_title, $yforum_categ_title_short, $yforum_categ_title_selected,
	$yforum_topic_title, $yforum_topic_title_short, $yforum_topics, $yforum_topic_title_selected, $yforum_topic_post_new,
	$yforum_reply_title, $yforum_reply_title_short, $yforum_replies, $yforum_reply_title_selected, $yforum_reply_post_new,
	$y_warp_preview_text_bttn, $y_warp_edit_text, $yforum_updated_on, $yforum_topic_update_it, $yforum_reply_update_it,
	$yforum_err_accdeny_toedit, $ywarp_categ_lock_txt ;

//local vars
global 	$fop, $fcategid, $ftopicid, $freplyid, $offset, $qval ;

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


$limit = $y_warp_max_forums_perpage;

//###################################### OP forums


if ($fop=='categ') {

	//----------------------------------------------get data

	//---------------------
	if (empty($offset)) {
	   $offset = 0;
	} //end if
	//---------------------

	$wquerry_main = "SELECT id, name, w_date, topic_lock FROM forum_categs";

	$wquerry_main_c = "SELECT COUNT(*) FROM forum_categs";

	$arr_forum_result = array();

	xmysql_count_data ($wquerry_main_c);
	xmysql_read_data ($wquerry_main." ORDER BY id DESC LIMIT $offset, $limit");
	$arr_forum_result = $arr_var_result;
	$yforums_categ_nums = $var_result_size;

	//---------------------------------------------
		//vars
		$newoffsetnext = $offset + $limit ;
		$newoffsetprev = $offset - $limit ;
		$offsetlistedmin = $offset + 1;

		if ($newoffsetnext <= $yforums_categ_nums) {
			$offsetlistedmax = $newoffsetnext;
		} //end if
		else {
			$offsetlistedmax = $yforums_categ_nums;
		} //end else

		if ($offsetlistedmax == 0) {
			$offsetlistedmin = 0;
		} //end if
	//---------------------------------------------

	//==================== forums categs where bar

	xtable_start ("$ydisplay_width_corrected");
		xtable_row_start ();
			xtable_column_start ('1', '', "$ybar_menu_color");
				xtext_small ('|');
				xspace ();
				xtext_small ("<b>$yforum_forum_title_short</b>");
				xspace ();
				xtext_small ('|');
			xtable_column_end ();
		xtable_row_end ();
	xtable_end ();

	xnewline ();

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


	//==================== forums categs nav bar

	xtable_start ("$ydisplay_width_corrected");
		xtable_row_start ();
			xtable_column_start ('1', '', "$ybar_menu_color");
				xtext_small ('|');
				xspace ();
				xtext_small ("<b>$yforum_categ_title_short</b> [<b>$offsetlistedmin</b> - <b>$offsetlistedmax</b> (<b>$yforums_categ_nums</b> $y_warp_total_text)]");
				xspace ();
				xtext_small ('|');
			xtable_column_end ();

			xtable_column_start ('1', '', "$ybar_menu_color");
				xcenter_right_start ();
					xtext_small ('|');
						xspace ();
						//Show PREV
						if ($newoffsetprev >= 0) {
							xtext_link ("$y_warp_prev_text", "$ywebsite_addr"."xw_main.php"."?wpqid=$wpqid&wpsid=$wpsid&fop=categ&offset=$newoffsetprev", '_self');
							xspace ();
							xtext_small ('|');
							xspace ();
						} //end if

						//Show NEXT
						if ($newoffsetnext < $yforums_categ_nums) {
							xtext_link ("$y_warp_next_text", "$ywebsite_addr"."xw_main.php"."?wpqid=$wpqid&wpsid=$wpsid&fop=categ&offset=$newoffsetnext", '_self');
							xspace ();
							xtext_small ('|');
							xspace ();
						} //end if
				xcenter_end ();
			xtable_column_end ();
		xtable_row_end ();
	xtable_end ();

	xnewline ();

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

	//===================================== display

	xshow_display_std_start ("$yforum_categ_title"." [$y_warp_total_text : $yforums_categ_nums]", "$ydisplay_width_corrected") ;

	xcenter_start ();
	xtable_start ('450');

	xtable_row_start ();
		xtable_column_start_vcenter ('3', '450', "$ybar_menu_color");
			xspace ();
		xtable_column_end ();
	xtable_row_end ();


	$arr_count = count($arr_forum_result);
	for ($i=0; $i < $arr_count; $i++) {
		$i_id = $i;
		$i_name = $i + 1;
		$i_wdate = $i + 2;
		$i_lock = $i + 3;
		$i = $i + 3;


		//get data about last reply within each categ

		xmysql_count_data ("SELECT COUNT(*) FROM forum_replies WHERE (block_c='$arr_forum_result[$i_id]') ");
		$hvx_all_repl = $var_result_size;
		xmysql_read_data ("SELECT MAX(id) FROM forum_replies WHERE (block_c='$arr_forum_result[$i_id]') ");
		//$arr_var_result;
		$y_forum_replies_maxid = $arr_var_result[0];
		xmysql_read_data ("SELECT w_time, w_date FROM forum_replies WHERE (id='$y_forum_replies_maxid') ");
		$hvx_all_repl_arr = array();
		$hvx_all_repl_arr = $arr_var_result;



		//get data about last topic within each categ

		xmysql_count_data ("SELECT COUNT(*) FROM forum_topics WHERE (block='$arr_forum_result[$i_id]') ");
		//$var_result_size;
		xmysql_read_data ("SELECT MAX(id) FROM forum_topics WHERE (block='$arr_forum_result[$i_id]') ");
		$y_forum_topics_maxid = $arr_var_result[0];
		xmysql_read_data ("SELECT w_time, w_date FROM forum_topics WHERE (id='$y_forum_topics_maxid') ");
		//$arr_var_result;


		//--------------------------------------list forums

		xtable_row_start ();
			xtable_column_start_vcenter ('1', '10', "$ymain_color");
				xspace ();
			xtable_column_end ();

			xtable_column_start_vcenter ('1', '40', "$ymain_color");
				xpict_alt ("$ywebsite_addr"."$y_warp_picts_dir".'/forum_categ.jpg', '30', '30', "$yforum_categ_title_selected");
			xtable_column_end ();

			xtable_column_start_vcenter ('1', '400', "$ymain_color");
				xtext_link ("$arr_forum_result[$i_name]", "$ywebsite_addr"."xw_main.php"."?wpqid=$wpqid&wpsid=$wpsid&fop=topic&fcategid=$arr_forum_result[$i_id]&offset=0", '_self');

				//locked categ
				if ($arr_forum_result[$i_lock] == 'y') {
					xtext_small (' &nbsp;&nbsp;'.'[ '."$ywarp_categ_lock_txt".' ]');
				} //end if

			xtable_column_end ();
		xtable_row_end ();


		xtable_row_start ();
			xtable_column_start_vcenter ('1', '10', "$ymain_color");
				xspace ();
			xtable_column_end ();

			xtable_column_start_vcenter ('1', '40', "$ymain_color");
				xspace ();
			xtable_column_end ();

			xtable_column_start_vcenter ('1', '400', "$ymain_color");
				xcenter_right_start ();
					xtext_small ("|");
					xspace ();
					xtext_small ("$yforum_created_on"." : "."<b>$arr_forum_result[$i_wdate]</b>");
					xspace ();
					xtext_small ("|");
				xcenter_end ();
			xtable_column_end ();
		xtable_row_end ();


		xtable_row_start ();
			xtable_column_start_vcenter ('1', '10', "$ymain_color");
				xspace ();
			xtable_column_end ();

			xtable_column_start_vcenter ('1', '40', "$ymain_color");
				xspace ();
			xtable_column_end ();

			xtable_column_start_vcenter ('1', '400', "$ymain_color");
				xcenter_right_start ();

					xtext_small ("|");
					xspace ();
					xtext_small ("$yforum_last_topic"." : "."<b>$arr_var_result[0]"." - "."$arr_var_result[1]</b>");
					xspace ();
					xtext_small ("|");
					xspace ();
					xtext_small ("$yforum_topics"." : "."<b>$var_result_size</b>");
					xspace ();
					xtext_small ("|");

					xnewline ();

					xtext_small ("|");
					xspace ();
					xtext_small ("$yforum_last_reply"." : "."<b>$hvx_all_repl_arr[0]"." - "."$hvx_all_repl_arr[1]</b>");
					xspace ();
					xtext_small ("|");
					xspace ();
					xtext_small ("$yforum_replies"." : "."<b>$hvx_all_repl</b>");
					xspace ();
					xtext_small ("|");

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

		xtable_row_start ();
			xtable_column_start_vcenter ('3', '450', "$ybar_menu_color");
				xspace ();
			xtable_column_end ();
		xtable_row_end ();

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

	}//end for


	xtable_end ();
	xcenter_end ();
	xshow_display_std_end ();

	xnewline ();

	//==================== forums categs nav bar

	xtable_start ("$ydisplay_width_corrected");
		xtable_row_start ();
			xtable_column_start ('1', '', "$ybar_menu_color");
				xtext_small ('|');
				xspace ();
				xtext_small ("<b>$yforum_categ_title_short</b> [<b>$offsetlistedmin</b> - <b>$offsetlistedmax</b> (<b>$yforums_categ_nums</b> $y_warp_total_text)]");
				xspace ();
				xtext_small ('|');
			xtable_column_end ();

			xtable_column_start ('1', '', "$ybar_menu_color");
				xcenter_right_start ();
					xtext_small ('|');
						xspace ();
						//Show PREV
						if ($newoffsetprev >= 0) {
							xtext_link ("$y_warp_prev_text", "$ywebsite_addr"."xw_main.php"."?wpqid=$wpqid&wpsid=$wpsid&fop=categ&offset=$newoffsetprev", '_self');
							xspace ();
							xtext_small ('|');
							xspace ();
						} //end if

						//Show NEXT
						if ($newoffsetnext < $yforums_categ_nums) {
							xtext_link ("$y_warp_next_text", "$ywebsite_addr"."xw_main.php"."?wpqid=$wpqid&wpsid=$wpsid&fop=categ&offset=$newoffsetnext", '_self');
							xspace ();
							xtext_small ('|');
							xspace ();
						} //end if
				xcenter_end ();
			xtable_column_end ();
		xtable_row_end ();
	xtable_end ();

	xnewline ();

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

} //end if

//###################################### END - OP forums





//###################################### OP topics


if ($fop=='topic') {


//---------------------
if (empty($offset)) {
   $offset = 0;
} //end if
//---------------------


//------------------------------------------------------establish vars
//vars
$qval = rawurldecode($qval);
$qwval_src = trim($qval);
$qwval_src_arr = array ();
$qwval_src_arr = explode("$y_warp_filter_sign", $qwval_src);
$qval_url = rawurlencode(stripslashes($qval));
$xurl = "$ywebsite_addr"."xw_main.php"."?wpqid=$wpqid&wpsid=$wpsid&fop=$fop&fcategid=$fcategid&offset=0";
//----------------------------------------

//------------------------------------------------------search querry
//filter empties
$qwval_src_arr_new = array ();
for ($i=0 ; $i<count($qwval_src_arr) ; $i++) {
	if ( trim($qwval_src_arr[$i]) <> '' ) {
		array_push ($qwval_src_arr_new, trim($qwval_src_arr[$i]));
	} //end if
} //end for

//build the querry
if (count($qwval_src_arr_new) <> '0') {
	$w_querryx_bld = " AND ";
	for ($i=0 ; $i<count($qwval_src_arr_new) ; $i++) {
		$w_querryx_bld_i = $qwval_src_arr_new[$i];
		$w_querryx_bld = " ".$w_querryx_bld." ( (subject LIKE '%".$w_querryx_bld_i."%') OR (message LIKE '%".$w_querryx_bld_i."%') OR (sender LIKE '%".$w_querryx_bld_i."%') ) ";
		if ($i <> ( count($qwval_src_arr_new) - 1 ) ) {
			$w_querryx_bld = $w_querryx_bld." AND " ;
		} //end if
	} //end for
} //end if

//[set text if filtered] or [empty querry]
$w_src_filteredby = " - ".$y_warp_filtered_text ;
if (count($qwval_src_arr_new) == '0') {
	$w_querryx_bld = ' ';
	$w_src_filteredby = '';
} //end if

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


//----------------------------------------------get data


//---------------the selected categ

	$arr_forum_result = array();

	xmysql_read_data ("SELECT name, topic_lock FROM forum_categs WHERE (id='$fcategid') ");
	$arr_forum_result = $arr_var_result;

//----------------topics

	$wquerry_main = "SELECT id, subject, sender, w_date, w_time FROM forum_topics WHERE ( (block='$fcategid') ".$w_querryx_bld." )";
	$wquerry_main_c = "SELECT COUNT(*) FROM forum_topics WHERE ( (block='$fcategid') ".$w_querryx_bld." )";
	$arr_forum_topics_result = array();

	xmysql_count_data ($wquerry_main_c);
	xmysql_read_data ($wquerry_main." ORDER BY id DESC LIMIT $offset, $limit");
	$arr_forum_topics_result = $arr_var_result;
	$yforums_topics_nums = $var_result_size;


//---------------------------------------------
	//offset vars
	$newoffsetnext = $offset + $limit ;
	$newoffsetprev = $offset - $limit ;
	$offsetlistedmin = $offset + 1;

	if ($newoffsetnext <= $yforums_topics_nums) {
		$offsetlistedmax = $newoffsetnext;
	} //end if
	else {
		$offsetlistedmax = $yforums_topics_nums;
	} //end else

	if ($offsetlistedmax == 0) {
		$offsetlistedmin = 0;
	} //end if
//---------------------------------------------


//==================== forums topics where bar

	xtable_start ("$ydisplay_width_corrected");
		xtable_row_start ();
			xtable_column_start ('1', '', "$ybar_menu_color");
				xtext_small ('|');
				xspace ();
				xtext_small ("<b>$yforum_forum_title_short</b>");
				xspace ();
				xtext_small ('|');
				xspace ();
				xtext_link ("$yforum_categ_title_short", "$ywebsite_addr"."xw_main.php"."?wpqid=$wpqid&wpsid=$wpsid&fop=categ&offset=0", '_self');
				xspace ();
				xtext_small ('|');
				xspace ();
				xtext_link ("$y_warp_refresh_text", "$ywebsite_addr"."xw_main.php"."?wpqid=$wpqid&wpsid=$wpsid&fop=topic&fcategid=$fcategid&offset=0&qval=", '_self');
				xspace ();
				xtext_small ('|');
			xtable_column_end ();
		xtable_row_end ();
	xtable_end ();

	xnewline ();

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


//===================================== display

	xtable_start ("$ydisplay_width_corrected");
	xtable_row_start ();
		xtable_column_start_vcenter ('1', '30%', "$ybar_menu_color");
			xcenter_right_start ();
				xvpix_h ('5');
				xnewline ();
				xpict_alt ("$ywebsite_addr"."$y_warp_picts_dir".'/forum_xpost.jpg', '30', '30', "$yforum_topic_post_new");
				xspace ();
				xspace ();
			xcenter_end ();
		xtable_column_end ();

		xtable_column_start_vcenter ('1', '50%', "$ybar_menu_color");
				xspace ();
				xspace ();
				//locked categ
				if ($arr_forum_result[1] == 'y') {
					xtext_small ("$yforum_topic_post_new");
					xtext_small (' &nbsp;&nbsp;'.'[ '."$ywarp_categ_lock_txt".' ]');
				} //end if
				else {
					xtext_link ("$yforum_topic_post_new", "$ywebsite_addr"."xw_main.php"."?wpqid=$wpqid&wpsid=$wpsid&fop=pstt&fcategid=$fcategid", '_self');
				} //end else
		xtable_column_end ();

		xtable_column_start_vcenter ('1', '20%', "$ybar_menu_color");
				xspace ();
		xtable_column_end ();
	xtable_row_end ();

	xtable_row_start ();
		xtable_column_start ('3', '100%', "$ysite_back_color");
				xspace ();
		xtable_column_end ();
	xtable_row_end ();

	xtable_row_start ();
		xtable_column_start ('3', '100%', "$ysite_back_color");
			xcenter_start ();

				xwriteflash_nobg_var ("$ywebsite_addr"."src_frm.swf",
					"&flash_form_backcolor=".rawurlencode($ymain_color).
					"&flash_form_textcolor=".rawurlencode($ysmall_text_color).
					"&flash_form_text_flby=".rawurlencode($y_warp_filter_text).
					"&flash_form_text_hint=".rawurlencode($y_warp_filter_hint).
					"&flash_form_text_bttn=".rawurlencode($y_warp_filter_text_bttn).
					"&flash_form_logo=".rawurlencode("$ywebsite_addr"."$y_warp_picts_dir".'/forum_topic.jpg').
					"&flash_form_listall=".rawurlencode($y_warp_filter_remove).
					"&qval_hint=".rawurlencode("[$yforum_topic_title_selected | $yforum_message | $yforum_sender]").
					"&qval=".$qval_url.
					"&xurl=".rawurlencode("$xurl").
					"&"
				, '500', '40');

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

	xnewline ();

	//==================== forums topics nav bar

	xtable_start ("$ydisplay_width_corrected");
		xtable_row_start ();
			xtable_column_start ('1', '', "$ybar_menu_color");
				xtext_small ('|');
				xspace ();
				xtext_small ("<b>$yforum_topics</b> [<b>$offsetlistedmin</b> - <b>$offsetlistedmax</b> (<b>$yforums_topics_nums</b> $y_warp_total_text)]"."$w_src_filteredby");
				xspace ();
				xtext_small ('|');
			xtable_column_end ();

			xtable_column_start ('1', '', "$ybar_menu_color");
				xcenter_right_start ();
					xtext_small ('|');
						xspace ();
						//Show PREV
						if ($newoffsetprev >= 0) {
							xtext_link ("$y_warp_prev_text", "$ywebsite_addr"."xw_main.php"."?wpqid=$wpqid&wpsid=$wpsid&fop=topic&fcategid=$fcategid&offset=$newoffsetprev&qval=$qval_url", '_self');
							xspace ();
							xtext_small ('|');
							xspace ();
						} //end if

						//Show NEXT
						if ($newoffsetnext < $yforums_topics_nums) {
							xtext_link ("$y_warp_next_text", "$ywebsite_addr"."xw_main.php"."?wpqid=$wpqid&wpsid=$wpsid&fop=topic&fcategid=$fcategid&offset=$newoffsetnext&qval=$qval_url", '_self');
							xspace ();
							xtext_small ('|');
							xspace ();
						} //end if
				xcenter_end ();
			xtable_column_end ();
		xtable_row_end ();
	xtable_end ();

	xnewline ();

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


	xshow_display_std_start ("$yforum_topic_title"." [$y_warp_total_text : $yforums_topics_nums"."$w_src_filteredby"."]", "$ydisplay_width_corrected") ;

	xcenter_start ();
	xtable_start ('450');

	xtable_row_start ();
		xtable_column_start_vcenter ('1', '10', "$ymain_color");
			xspace ();
		xtable_column_end ();

		xtable_column_start_vcenter ('1', '40', "$ymain_color");
			xpict_alt ("$ywebsite_addr"."$y_warp_picts_dir".'/forum_categ.jpg', '30', '30', "$yforum_categ_title_selected");
		xtable_column_end ();

		xtable_column_start_vcenter ('1', '400', "$ymain_color");
			xtext_small ("$yforum_categ_title_selected"." : "."<b>".$arr_forum_result[0]."</b>");
		xtable_column_end ();
	xtable_row_end ();

	xtable_row_start ();
		xtable_column_start_vcenter ('3', '450', "$ymain_color");
			xspace ();
		xtable_column_end ();
	xtable_row_end ();

	xtable_row_start ();
		xtable_column_start_vcenter ('3', '450', "$ybar_menu_color");
			xspace ();
		xtable_column_end ();
	xtable_row_end ();


	$arr_count = count($arr_forum_topics_result);
	for ($i=0; $i < $arr_count; $i++) {
		$i_id = $i;
		$i_subject = $i + 1;
		$i_sender = $i + 2;
		$i_wdate = $i + 3;
		$i_wtime = $i + 4;
		$i = $i + 4;

		//get data about last reply within each topic

		xmysql_count_data ("SELECT COUNT(*) FROM forum_replies WHERE (block='$arr_forum_topics_result[$i_id]') ");
		//$var_result_size;
		xmysql_read_data ("SELECT MAX(id) FROM forum_replies WHERE (block='$arr_forum_topics_result[$i_id]') ");
		//$arr_var_result;
		$y_forum_replies_maxid = $arr_var_result[0];
		xmysql_read_data ("SELECT w_time, w_date FROM forum_replies WHERE (id='$y_forum_replies_maxid') ");
		//$arr_var_result;


		//--------------------------------------list forum topics


		xtable_row_start ();
			xtable_column_start_vcenter ('1', '10', "$ymain_color");
				xspace ();
			xtable_column_end ();

			xtable_column_start_vcenter ('1', '40', "$ymain_color");
				xpict_alt ("$ywebsite_addr"."$y_warp_picts_dir".'/forum_topic.jpg', '30', '30', "$yforum_topic_title_selected");
			xtable_column_end ();

			xtable_column_start_vcenter ('1', '400', "$ymain_color");
				xtext_link ("$arr_forum_topics_result[$i_subject]", "$ywebsite_addr"."xw_main.php"."?wpqid=$wpqid&wpsid=$wpsid&fop=repl&fcategid=$fcategid&ftopicid=$arr_forum_topics_result[$i_id]&offset=0&qval=", '_self');
			xtable_column_end ();
		xtable_row_end ();

		xtable_row_start ();
			xtable_column_start_vcenter ('1', '10', "$ymain_color");
				xspace ();
			xtable_column_end ();

			xtable_column_start_vcenter ('1', '40', "$ymain_color");
				xspace ();
			xtable_column_end ();

			xtable_column_start_vcenter ('1', '400', "$ymain_color");
				xtext_small ("|");
				xspace ();
				xtext_small ("$yforum_sender"." : "."<b>$arr_forum_topics_result[$i_sender]</b>");
				xspace ();
				xtext_small ("|");
				xnewline ();
				xcenter_right_start ();
					xtext_small ("|");
					xspace ();
					xtext_small ("$yforum_posted_on"." : "."<b>$arr_forum_topics_result[$i_wtime]"." - "."$arr_forum_topics_result[$i_wdate]</b>");
					xspace ();
					xtext_small ("|");
				xcenter_end ();
			xtable_column_end ();
		xtable_row_end ();

		xtable_row_start ();
			xtable_column_start_vcenter ('1', '10', "$ymain_color");
				xspace ();
			xtable_column_end ();

			xtable_column_start_vcenter ('1', '40', "$ymain_color");
				xspace ();
			xtable_column_end ();

			xtable_column_start_vcenter ('1', '400', "$ymain_color");
				xcenter_right_start ();
					xtext_small ("|");
					xspace ();
					xtext_small ("$yforum_last_reply"." : "."<b>$arr_var_result[0]"." - "."$arr_var_result[1]</b>");
					xspace ();
					xtext_small ("|");
					xspace ();
					xtext_small ("$yforum_replies"." : "."<b>$var_result_size</b>");
					xspace ();
					xtext_small ("|");
				xcenter_end ();
			xtable_column_end ();
		xtable_row_end ();

		xtable_row_start ();
			xtable_column_start_vcenter ('3', '450', "$ybar_menu_color");
				xspace ();
			xtable_column_end ();
		xtable_row_end ();

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

	}//end for


	xtable_end ();
	xcenter_end ();
	xshow_display_std_end ();

	xnewline ();



	//==================== forums topics nav bar

	xtable_start ("$ydisplay_width_corrected");
		xtable_row_start ();
			xtable_column_start ('1', '', "$ybar_menu_color");
				xtext_small ('|');
				xspace ();
				xtext_small ("<b>$yforum_topics</b> [<b>$offsetlistedmin</b> - <b>$offsetlistedmax</b> (<b>$yforums_topics_nums</b> $y_warp_total_text)]"."$w_src_filteredby");
				xspace ();
				xtext_small ('|');
			xtable_column_end ();

			xtable_column_start ('1', '', "$ybar_menu_color");
				xcenter_right_start ();
					xtext_small ('|');
						xspace ();
						//Show PREV
						if ($newoffsetprev >= 0) {
							xtext_link ("$y_warp_prev_text", "$ywebsite_addr"."xw_main.php"."?wpqid=$wpqid&wpsid=$wpsid&fop=topic&fcategid=$fcategid&offset=$newoffsetprev&qval=$qval_url", '_self');
							xspace ();
							xtext_small ('|');
							xspace ();
						} //end if

						//Show NEXT
						if ($newoffsetnext < $yforums_topics_nums) {
							xtext_link ("$y_warp_next_text", "$ywebsite_addr"."xw_main.php"."?wpqid=$wpqid&wpsid=$wpsid&fop=topic&fcategid=$fcategid&offset=$newoffsetnext&qval=$qval_url", '_self');
							xspace ();
							xtext_small ('|');
							xspace ();
						} //end if
				xcenter_end ();
			xtable_column_end ();
		xtable_row_end ();
	xtable_end ();

	xnewline ();

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


} //end if

//###################################### END - OP topics



//###################################### OP replies


if ($fop=='repl') {


//---------------------
if (empty($offset)) {
   $offset = 0;
} //end if
//---------------------


//------------------------------------------------------establish vars
//vars
$qval = rawurldecode($qval);
$qwval_src = trim($qval);
$qwval_src_arr = array ();
$qwval_src_arr = explode("$y_warp_filter_sign", $qwval_src);
$qval_url = rawurlencode(stripslashes($qval));
$xurl = "$ywebsite_addr"."xw_main.php"."?wpqid=$wpqid&wpsid=$wpsid&fop=$fop&fcategid=$fcategid&ftopicid=$ftopicid&offset=0";
//----------------------------------------


//------------------------------------------------------search querry
//filter empties
$qwval_src_arr_new = array ();
for ($i=0 ; $i<count($qwval_src_arr) ; $i++) {
	if ( trim($qwval_src_arr[$i]) <> '' ) {
		array_push ($qwval_src_arr_new, trim($qwval_src_arr[$i]));
	} //end if
} //end for

//build the querry
if (count($qwval_src_arr_new) <> '0') {
	$w_querryx_bld = " AND ";
	for ($i=0 ; $i<count($qwval_src_arr_new) ; $i++) {
		$w_querryx_bld_i = $qwval_src_arr_new[$i];
		$w_querryx_bld = " ".$w_querryx_bld." ( (subject LIKE '%".$w_querryx_bld_i."%') OR (message LIKE '%".$w_querryx_bld_i."%') OR (sender LIKE '%".$w_querryx_bld_i."%') ) ";
		if ($i <> ( count($qwval_src_arr_new) - 1 ) ) {
			$w_querryx_bld = $w_querryx_bld." AND " ;
		} //end if
	} //end for
} //end if

//[set text if filtered] or [empty querry]
$w_src_filteredby = " - ".$y_warp_filtered_text ;
if (count($qwval_src_arr_new) == '0') {
	$w_querryx_bld = ' ';
	$w_src_filteredby = '';
} //end if

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


//----------------------------------------------get data

//---------------the user

	$usr_auth_id = '';
	$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') ) ");
	$usr_auth_id = $arr_var_result[0];


//---------------the selected categ

	$arr_forum_result = array();

	xmysql_read_data ("SELECT name FROM forum_categs WHERE (id='$fcategid') ");
	$arr_forum_result = $arr_var_result;

//----------------the selected topic

	$arr_forum_topics_result = array();
	$xhlocx_prev_topicx = '';
	$xhlocx_next_topicx = '';

	xmysql_read_data ("SELECT sender, subject, message, w_date, w_time, id, w_uid_auth, w_updated FROM forum_topics WHERE (id='$ftopicid') ");
	$arr_forum_topics_result = $arr_var_result;

	//get prev topic
	xmysql_read_data ("SELECT id FROM forum_topics WHERE ( (id>'$ftopicid') AND (block='$fcategid') ) ORDER BY id ASC LIMIT 0,1 ");
	$xhlocx_prev_topicx = $arr_var_result[0];

	//get next topic
	xmysql_read_data ("SELECT id FROM forum_topics WHERE ( (id<'$ftopicid') AND (block='$fcategid') ) ORDER BY id DESC LIMIT 0,1 ");
	$xhlocx_next_topicx = $arr_var_result[0];


//----------------replies

	$wquerry_main = "SELECT sender, subject, message, w_date, w_time, id, w_uid_auth, w_updated FROM forum_replies WHERE ( (block='$ftopicid') ".$w_querryx_bld." )";
	$wquerry_main_c = "SELECT COUNT(*) FROM forum_replies WHERE ( (block='$ftopicid') ".$w_querryx_bld." )";

	$arr_forum_replies_result = array();

	xmysql_count_data ($wquerry_main_c);
	xmysql_read_data ($wquerry_main." ORDER BY id DESC LIMIT $offset, $limit");
	$arr_forum_replies_result = $arr_var_result;
	$yforums_replies_nums = $var_result_size;

//---------------------------------------------
	//offset vars
	$newoffsetnext = $offset + $limit ;
	$newoffsetprev = $offset - $limit ;
	$offsetlistedmin = $offset + 1;

	if ($newoffsetnext <= $yforums_replies_nums) {
		$offsetlistedmax = $newoffsetnext;
	} //end if
	else {
		$offsetlistedmax = $yforums_replies_nums;
	} //end else

	if ($offsetlistedmax == 0) {
		$offsetlistedmin = 0;
	} //end if
//---------------------------------------------


//==================== forums replies where bar

	xtable_start ("$ydisplay_width_corrected");
		xtable_row_start ();
			xtable_column_start ('1', '', "$ybar_menu_color");
				xtext_small ('|');
				xspace ();
				xtext_small ("<b>$yforum_forum_title_short</b>");
				xspace ();
				xtext_small ('|');
				xspace ();
				xtext_link ("$yforum_categ_title_short", "$ywebsite_addr"."xw_main.php"."?wpqid=$wpqid&wpsid=$wpsid&fop=categ&offset=0", '_self');
				xspace ();
				xtext_small ('|');
				xspace ();
				xtext_link ("$yforum_topics", "$ywebsite_addr"."xw_main.php"."?wpqid=$wpqid&wpsid=$wpsid&fop=topic&fcategid=$fcategid&offset=0&qval=", '_self');
				xspace ();
				xtext_small ('|');
				xspace ();
				xtext_link ("$y_warp_refresh_text", "$ywebsite_addr"."xw_main.php"."?wpqid=$wpqid&wpsid=$wpsid&fop=repl&fcategid=$fcategid&ftopicid=$ftopicid&offset=0&qval=", '_self');
				xspace ();
				xtext_small ('|');
			xtable_column_end ();
		xtable_row_end ();
	xtable_end ();

	xnewline ();

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


	xshow_display_std_start ("$yforum_topic_title_selected", "$ydisplay_width_corrected") ;

	xcenter_start ();
	xtable_start ('450');

	xtable_row_start ();
		xtable_column_start_vcenter ('1', '10', "$ymain_color");
			xspace ();
		xtable_column_end ();

		xtable_column_start_vcenter ('1', '40', "$ymain_color");
			xpict_alt ("$ywebsite_addr"."$y_warp_picts_dir".'/forum_categ.jpg', '30', '30', "$yforum_categ_title_selected");
		xtable_column_end ();

		xtable_column_start_vcenter ('1', '400', "$ymain_color");
			xtext_small ("$yforum_categ_title_selected"." : "."<b>".$arr_forum_result[0]."</b>");
		xtable_column_end ();
	xtable_row_end ();

	xtable_row_start ();
		xtable_column_start_vcenter ('3', '450', "$ybar_menu_color");
			xcenter_right_start ();
				xspace ();
				if ( (!empty($xhlocx_prev_topicx)) OR (!empty($xhlocx_next_topicx)) ) {
					xtext_small ('|');
					xspace ();
				} //end if
				if (!empty($xhlocx_prev_topicx)) {
					xtext_link ("$y_warp_prev_text", "$ywebsite_addr"."xw_main.php"."?wpqid=$wpqid&wpsid=$wpsid&fop=repl&fcategid=$fcategid&ftopicid=$xhlocx_prev_topicx&offset=0&qval=", '_self');
					xspace ();
					xtext_small ('|');
				} //end if
				if (!empty($xhlocx_next_topicx)) {
					xtext_link ("$y_warp_next_text", "$ywebsite_addr"."xw_main.php"."?wpqid=$wpqid&wpsid=$wpsid&fop=repl&fcategid=$fcategid&ftopicid=$xhlocx_next_topicx&offset=0&qval=", '_self');
					xspace ();
					xtext_small ('|');
				} //end if
			xcenter_end ();
		xtable_column_end ();
	xtable_row_end ();

	xtable_row_start ();
		xtable_column_start_vcenter ('1', '10', "$ymain_color");
			xspace ();
		xtable_column_end ();

		xtable_column_start_vcenter ('1', '40', "$ymain_color");
			xpict_alt ("$ywebsite_addr"."$y_warp_picts_dir".'/forum_topic.jpg', '30', '30', "$yforum_topic_title_selected");
		xtable_column_end ();

		xtable_column_start_vcenter ('1', '400', "$ymain_color");
			xtext_small ("$yforum_topic_title_selected"." : "."<b>$arr_forum_topics_result[1]</b>");
		xtable_column_end ();
	xtable_row_end ();

	xtable_row_start ();
		xtable_column_start_vcenter ('1', '10', "$ymain_color");
			xspace ();
		xtable_column_end ();

		xtable_column_start_vcenter ('1', '40', "$ymain_color");
			xspace ();
		xtable_column_end ();

		xtable_column_start_vcenter ('1', '400', "$ymain_color");
			xtext_small ("$yforum_sender"." : "."<b>$arr_forum_topics_result[0]</b>");
		xtable_column_end ();
	xtable_row_end ();

	xtable_row_start ();
		xtable_column_start_vcenter ('1', '10', "$ymain_color");
			xspace ();
		xtable_column_end ();

		xtable_column_start_vcenter ('1', '40', "$ymain_color");
			xspace ();
		xtable_column_end ();

		xtable_column_start_vcenter ('1', '400', "$ymain_color");
			xnewline ();
			xtext_small ("<i>$yforum_message"." :</i>");
			if (!empty($arr_forum_topics_result[7])) {
				xtext_small ('<i>&nbsp;&nbsp;('."$yforum_updated_on".' : '."$arr_forum_topics_result[7]".')</i>') ;
			} //end if
			xnewline();
			xvline ('100%');
			xnewline();
		xtable_column_end ();
	xtable_row_end ();

	xtable_row_start ();
		xtable_column_start_vcenter ('1', '10', "$ymain_color");
			xspace ();
		xtable_column_end ();

		xtable_column_start_vcenter ('1', '40', "$ymain_color");
			xspace ();
		xtable_column_end ();

		xtable_column_start_vcenter ('1', '400', '#FFFFFF');
			xcenter_start();
			xtable_start('98%');
				xtable_row_start ();
					xtable_column_start_vcenter ('1', '', '#FFFFFF');
						xtext_small ("$arr_forum_topics_result[2]");
					xtable_column_end ();
				xtable_row_end ();
			xtable_end();
			xcenter_end();
		xtable_column_end ();
	xtable_row_end ();

	xtable_row_start ();
		xtable_column_start_vcenter ('1', '10', "$ymain_color");
			xspace ();
		xtable_column_end ();

		xtable_column_start_vcenter ('1', '40', "$ymain_color");
			xspace ();
		xtable_column_end ();

		xtable_column_start_vcenter ('1', '400', "$ymain_color");
			xvline ('100%');
		xtable_column_end ();
	xtable_row_end ();


	xtable_row_start ();
		xtable_column_start_vcenter ('2', '50', "$ymain_color");

				$op_var = 'topic';
				$op_var = base64_encode($op_var);
				$op_var = rawurlencode($op_var);

				xpict_link ("$ywebsite_addr"."$y_warp_picts_dir".'/print_mini.jpg', "$y_warp_print_text", '20', '20', "$ywebsite_addr"."print_redir.php?xid=$arr_forum_topics_result[5]&xop=$op_var&wpsid=$wpsid", 'wnd_prn');

				if ($usr_auth_id == $arr_forum_topics_result[6]) {
					xspace();
					xpict_link ("$ywebsite_addr"."$y_warp_picts_dir".'/edit_mini.jpg', "$y_warp_edit_text", '20', '20', "$ywebsite_addr"."xw_main.php"."?wpqid=$wpqid&wpsid=$wpsid&fop=edtt&fcategid=$fcategid&ftopicid=$ftopicid", '_self');
				} //end if


		xtable_column_end ();

		xtable_column_start_vcenter ('1', '400', "$ymain_color");
			xcenter_right_start ();
				xtext_small ("|");
				xspace ();
				xspace ();
				xtext_small ("$yforum_posted_on"." : "."<b>$arr_forum_topics_result[4]"." - "."$arr_forum_topics_result[3]</b>");
				xspace ();
				xspace ();
				xtext_small ("|");
			xcenter_end ();
		xtable_column_end ();
	xtable_row_end ();

	xtable_row_start ();
		xtable_column_start_vcenter ('3', '450', "$ybar_menu_color");
			xspace ();
		xtable_column_end ();
	xtable_row_end ();


	xtable_end ();
	xcenter_end ();
	xshow_display_std_end ();
	xnewline ();

// end listed topic

	xtable_start ("$ydisplay_width_corrected");
	xtable_row_start ();
		xtable_column_start_vcenter ('1', '30%', "$ybar_menu_color");
			xcenter_right_start ();
				xvpix_h ('5');
				xnewline ();
				xpict_alt ("$ywebsite_addr"."$y_warp_picts_dir".'/forum_xpost.jpg', '30', '30', "$yforum_reply_post_new");
				xspace ();
				xspace ();
			xcenter_end ();
		xtable_column_end ();

		xtable_column_start_vcenter ('1', '50%', "$ybar_menu_color");
				xspace ();
				xspace ();
				xtext_link ("$yforum_reply_post_new", "$ywebsite_addr"."xw_main.php"."?wpqid=$wpqid&wpsid=$wpsid&fop=pstr&fcategid=$fcategid&ftopicid=$ftopicid", '_self');
		xtable_column_end ();

		xtable_column_start_vcenter ('1', '20%', "$ybar_menu_color");
				xspace ();
		xtable_column_end ();
	xtable_row_end ();

	xtable_row_start ();
		xtable_column_start ('3', '100%', "$ysite_back_color");
				xspace ();
		xtable_column_end ();
	xtable_row_end ();

	xtable_row_start ();
		xtable_column_start ('3', '100%', "$ysite_back_color");
			xcenter_start ();

				xwriteflash_nobg_var ("$ywebsite_addr"."src_frm.swf",
					"&flash_form_backcolor=".rawurlencode($ymain_color).
					"&flash_form_textcolor=".rawurlencode($ysmall_text_color).
					"&flash_form_text_flby=".rawurlencode($y_warp_filter_text).
					"&flash_form_text_hint=".rawurlencode($y_warp_filter_hint).
					"&flash_form_text_bttn=".rawurlencode($y_warp_filter_text_bttn).
					"&flash_form_logo=".rawurlencode("$ywebsite_addr"."$y_warp_picts_dir".'/forum_reply.jpg').
					"&flash_form_listall=".rawurlencode($y_warp_filter_remove).
					"&qval_hint=".rawurlencode("[$yforum_reply_title_selected | $yforum_message | $yforum_sender]").
					"&qval=".$qval_url.
					"&xurl=".rawurlencode("$xurl").
					"&"
				, '500', '40');

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

	xnewline ();

	//==================== forums replies nav bar

	xtable_start ("$ydisplay_width_corrected");
		xtable_row_start ();
			xtable_column_start ('1', '', "$ybar_menu_color");
				xtext_small ('|');
				xspace ();
				xtext_small ("<b>$yforum_replies</b> [<b>$offsetlistedmin</b> - <b>$offsetlistedmax</b> (<b>$yforums_replies_nums</b> $y_warp_total_text)]"."$w_src_filteredby");
				xspace ();
				xtext_small ('|');
			xtable_column_end ();

			xtable_column_start ('1', '', "$ybar_menu_color");
				xcenter_right_start ();
					xtext_small ('|');
						xspace ();
						//Show PREV
						if ($newoffsetprev >= 0) {
							xtext_link ("$y_warp_prev_text", "$ywebsite_addr"."xw_main.php"."?wpqid=$wpqid&wpsid=$wpsid&fop=repl&fcategid=$fcategid&ftopicid=$ftopicid&offset=$newoffsetprev&qval=$qval_url", '_self');
							xspace ();
							xtext_small ('|');
							xspace ();
						} //end if

						//Show NEXT
						if ($newoffsetnext < $yforums_replies_nums) {
							xtext_link ("$y_warp_next_text", "$ywebsite_addr"."xw_main.php"."?wpqid=$wpqid&wpsid=$wpsid&fop=repl&fcategid=$fcategid&ftopicid=$ftopicid&offset=$newoffsetnext&qval=$qval_url", '_self');
							xspace ();
							xtext_small ('|');
							xspace ();
						} //end if
				xcenter_end ();
			xtable_column_end ();
		xtable_row_end ();
	xtable_end ();

	xnewline ();

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

	xshow_display_std_start ("$yforum_reply_title"." [$y_warp_total_text : $yforums_replies_nums]"."$w_src_filteredby", "$ydisplay_width_corrected") ;

	xcenter_start ();
	xtable_start ('450');


	xtable_row_start ();
		xtable_column_start_vcenter ('3', '450', "$ybar_menu_color");
			xspace ();
		xtable_column_end ();
	xtable_row_end ();


	$arr_count = count($arr_forum_replies_result);
	for ($i=0; $i < $arr_count; $i++) {
		$i_sender = $i;
		$i_subject = $i + 1;
		$i_message = $i + 2;
		$i_wdate = $i + 3;
		$i_wtime = $i + 4;
		$i_id = $i + 5;
		$i_uid = $i + 6;
		$i_updated = $i + 7;
		$i = $i + 7;


		//--------------------------------------list forum replies

		xtable_row_start ();
			xtable_column_start_vcenter ('1', '10', "$ymain_color");
				xspace ();
			xtable_column_end ();

			xtable_column_start_vcenter ('1', '40', "$ymain_color");
				xpict_alt ("$ywebsite_addr"."$y_warp_picts_dir".'/forum_reply.jpg', '30', '30', "$yforum_reply_title_selected");
			xtable_column_end ();

			xtable_column_start_vcenter ('1', '400', "$ymain_color");
				xtext_small ("$yforum_reply_title_selected"." : "."<b>$arr_forum_replies_result[$i_subject]</b>");
			xtable_column_end ();
		xtable_row_end ();

		xtable_row_start ();
			xtable_column_start_vcenter ('1', '10', "$ymain_color");
				xspace ();
			xtable_column_end ();

			xtable_column_start_vcenter ('1', '40', "$ymain_color");
				xspace ();
			xtable_column_end ();

			xtable_column_start_vcenter ('1', '400', "$ymain_color");
				xtext_small ("$yforum_sender"." : "."<b>$arr_forum_replies_result[$i_sender]</b>");
			xtable_column_end ();
		xtable_row_end ();

		xtable_row_start ();
			xtable_column_start_vcenter ('1', '10', "$ymain_color");
				xspace ();
			xtable_column_end ();

			xtable_column_start_vcenter ('1', '40', "$ymain_color");
				xspace ();
			xtable_column_end ();

			xtable_column_start_vcenter ('1', '400', "$ymain_color");
				xnewline ();
				xtext_small ("<i>$yforum_message"." :</i>");
				if (!empty($arr_forum_replies_result[$i_updated])) {
					xtext_small ('<i>&nbsp;&nbsp;('."$yforum_updated_on".' : '."$arr_forum_replies_result[$i_updated]".')</i>') ;
				} //end if
				xnewline ();
				xvline ('100%');
				xnewline ();
			xtable_column_end ();
		xtable_row_end ();

		xtable_row_start ();
			xtable_column_start_vcenter ('1', '10', "$ymain_color");
				xspace ();
			xtable_column_end ();

			xtable_column_start_vcenter ('1', '40', "$ymain_color");
				xspace ();
			xtable_column_end ();

			xtable_column_start_vcenter ('1', '400', '#FFFFFF');
				xcenter_start();
				xtable_start('98%');
					xtable_row_start ();
						xtable_column_start_vcenter ('1', '', '#FFFFFF');
							xtext_small ("$arr_forum_replies_result[$i_message]");
						xtable_column_end ();
					xtable_row_end ();
				xtable_end();
				xcenter_end();
			xtable_column_end ();
		xtable_row_end ();

		xtable_row_start ();
			xtable_column_start_vcenter ('1', '10', "$ymain_color");
				xspace ();
			xtable_column_end ();

			xtable_column_start_vcenter ('1', '40', "$ymain_color");
				xspace ();
			xtable_column_end ();

			xtable_column_start_vcenter ('1', '400', "$ymain_color");
				xvline ('100%');
			xtable_column_end ();
		xtable_row_end ();

		xtable_row_start ();
			xtable_column_start_vcenter ('2', '50', "$ymain_color");

				$op_var = 'reply';
				$op_var = base64_encode($op_var);
				$op_var = rawurlencode($op_var);

				xpict_link ("$ywebsite_addr"."$y_warp_picts_dir".'/print_mini.jpg', "$y_warp_print_text", '20', '20', "$ywebsite_addr"."print_redir.php?xid=$arr_forum_replies_result[$i_id]&xop=$op_var&wpsid=$wpsid", 'wnd_prn');

				if ($usr_auth_id == $arr_forum_replies_result[$i_uid]) {
					xspace();
					xpict_link ("$ywebsite_addr"."$y_warp_picts_dir".'/edit_mini.jpg', "$y_warp_edit_text", '20', '20', "$ywebsite_addr"."xw_main.php"."?wpqid=$wpqid&wpsid=$wpsid&fop=edtr&fcategid=$fcategid&ftopicid=$ftopicid&freplyid=$arr_forum_replies_result[$i_id]", '_self');
				} //end if

			xtable_column_end ();

			xtable_column_start_vbottom ('1', '400', "$ymain_color");
				xcenter_right_start ();
					xtext_small ("|");
					xspace ();
					xspace ();
					xtext_small ("$yforum_posted_on"." : "."<b>$arr_forum_replies_result[$i_wtime]"." - "."$arr_forum_replies_result[$i_wdate]</b>");
					xspace ();
					xspace ();
					xtext_small ("|");
				xcenter_end ();
			xtable_column_end ();
		xtable_row_end ();

		xtable_row_start ();
			xtable_column_start_vcenter ('3', '450', "$ybar_menu_color");
				xspace ();
			xtable_column_end ();
		xtable_row_end ();

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

	}//end for


	xtable_end ();
	xcenter_end ();
	xshow_display_std_end ();

	xnewline ();



	//==================== forums replies nav bar

	xtable_start ("$ydisplay_width_corrected");
		xtable_row_start ();
			xtable_column_start ('1', '', "$ybar_menu_color");
				xtext_small ('|');
				xspace ();
				xtext_small ("<b>$yforum_replies</b> [<b>$offsetlistedmin</b> - <b>$offsetlistedmax</b> (<b>$yforums_replies_nums</b> $y_warp_total_text)]"."$w_src_filteredby");
				xspace ();
				xtext_small ('|');
			xtable_column_end ();

			xtable_column_start ('1', '', "$ybar_menu_color");
				xcenter_right_start ();
					xtext_small ('|');
						xspace ();
						//Show PREV
						if ($newoffsetprev >= 0) {
							xtext_link ("$y_warp_prev_text", "$ywebsite_addr"."xw_main.php"."?wpqid=$wpqid&wpsid=$wpsid&fop=repl&fcategid=$fcategid&ftopicid=$ftopicid&offset=$newoffsetprev&qval=$qval_url", '_self');
							xspace ();
							xtext_small ('|');
							xspace ();
						} //end if

						//Show NEXT
						if ($newoffsetnext < $yforums_replies_nums) {
							xtext_link ("$y_warp_next_text", "$ywebsite_addr"."xw_main.php"."?wpqid=$wpqid&wpsid=$wpsid&fop=repl&fcategid=$fcategid&ftopicid=$ftopicid&offset=$newoffsetnext&qval=$qval_url", '_self');
							xspace ();
							xtext_small ('|');
							xspace ();
						} //end if
				xcenter_end ();
			xtable_column_end ();
		xtable_row_end ();
	xtable_end ();

	xnewline ();

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


} //end if

//###################################### END - OP replies



//###################################### OP post topic


if ($fop=='pstt') {


	//==================== forums post topic where bar

	xtable_start ("$ydisplay_width_corrected");
		xtable_row_start ();
			xtable_column_start ('1', '', "$ybar_menu_color");
				xtext_small ('|');
				xspace ();
				xtext_small ("<b>$yforum_forum_title_short</b>");
				xspace ();
				xtext_small ('|');
				xspace ();
				xtext_link ("$yforum_categ_title_short", "$ywebsite_addr"."xw_main.php"."?wpqid=$wpqid&wpsid=$wpsid&fop=categ&offset=0", '_self');
				xspace ();
				xtext_small ('|');
				xspace ();
				xtext_link ("$yforum_topics", "$ywebsite_addr"."xw_main.php"."?wpqid=$wpqid&wpsid=$wpsid&fop=topic&fcategid=$fcategid&offset=0&qval=", '_self');
				xspace ();
				xtext_small ('|');
			xtable_column_end ();
		xtable_row_end ();
	xtable_end ();

	xnewline ();

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



//---------------------------------------------Get data

//---------------the selected categ

	$arr_forum_result = array();

	$usr_auth_id = '';
	$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') ) ");
	$usr_auth_id = $arr_var_result[0];

	xmysql_read_data ("SELECT name FROM forum_categs WHERE (id='$fcategid') ");
	$arr_forum_result = $arr_var_result;
//-----------------


xshow_display_std_start ("$yforum_topic_post_new", "$ydisplay_width_corrected") ;

xcenter_start ();
xtable_start ('450');


	xtable_row_start ();
		xtable_column_start ('1', '10', "$ybar_menu_color");
			xspace ();
		xtable_column_end ();

		xtable_column_start_vcenter ('1', '40', "$ybar_menu_color");
			xnewline ();
			xpict_alt ("$ywebsite_addr"."$y_warp_picts_dir".'/forum_categ.jpg', '30', '30', "$yforum_categ_title_selected");
		xtable_column_end ();

		xtable_column_start_vcenter ('1', '400', "$ybar_menu_color");
			xnewline ();
			xtext_small ("$yforum_categ_title_selected"." : "."<b>$arr_forum_result[0]</b>");
		xtable_column_end ();
	xtable_row_end ();

	xtable_row_start ();
		xtable_column_start ('1', '10', "$ybar_menu_color");
			xspace ();
		xtable_column_end ();

		xtable_column_start_vcenter ('1', '40', "$ybar_menu_color");
			xnewline ();
			xpict_alt ("$ywebsite_addr"."$y_warp_picts_dir".'/forum_topic.jpg', '30', '30', "$yforum_topic_post_new");
		xtable_column_end ();

		xtable_column_start_vcenter ('1', '400', "$ybar_menu_color");
			xnewline ();
			xtext_small ("$yforum_topic_post_new"." : ");
		xtable_column_end ();
	xtable_row_end ();

	xtable_row_start ();
		xtable_column_start ('3', '450', "$ybar_menu_color");

				$op_var = 'topic';
				xwriteflash_nobg_var ("$ywebsite_addr"."fpost_frm.swf",
					"&flash_form_backcolor=".rawurlencode($ybar_menu_color).
					"&flash_form_textcolor=".rawurlencode($ysmall_text_color).
					"&flash_form_text_subj=".rawurlencode($y_warp_post_text_mark.$yforum_subject." : ").
					"&flash_form_text_msg=".rawurlencode($y_warp_post_text_mark.$yforum_message." : ").
					"&flash_form_text_sender=".rawurlencode($y_warp_post_text_mark.$yforum_sender_name." : ").
					"&sender_var=".rawurlencode("$PHP_AUTH_USER").
					"&flash_form_text_hint=".rawurlencode($y_warp_post_text_hint).
					"&flash_form_text_bttn=".rawurlencode($y_warp_post_text_bttn).
					"&flash_form_text_bttn_pw=".rawurlencode($y_warp_preview_text_bttn).
					"&flash_form_text_back=".rawurlencode($y_warp_back_text).
					"&flash_form_text_status=".rawurlencode($yforum_status_post." : ").
					"&flash_form_text_process=".rawurlencode($yforum_process_post).
					"&flash_form_logo=".rawurlencode("$ywebsite_addr"."$y_warp_picts_dir".'/forum_xpost.jpg').
					"&flash_form_userid=".rawurlencode($usr_auth_id).
					"&flash_form_blockid=".rawurlencode($fcategid).
					"&flash_form_op=".rawurlencode($op_var).
					"&xurl=".rawurlencode("$ywebsite_addr"."forum_op.php").
					"&xurlpw=".rawurlencode("$ywebsite_addr"."forum_pvw.php").
					"&wxu=".rawurlencode(MD5($PHP_AUTH_USER)).
					"&wxp=".rawurlencode(MD5(base64_encode($PHP_AUTH_PW))).
					"&"
				, '450', '520');

		xtable_column_end ();
	xtable_row_end ();


xtable_end ();
xcenter_end ();
xshow_display_std_end ();
xnewline ();



} //end if

//###################################### END - OP post topic



//###################################### OP post reply


if ($fop=='pstr') {


	//==================== forums post reply where bar

	xtable_start ("$ydisplay_width_corrected");
		xtable_row_start ();
			xtable_column_start ('1', '', "$ybar_menu_color");
				xtext_small ('|');
				xspace ();
				xtext_small ("<b>$yforum_forum_title_short</b>");
				xspace ();
				xtext_small ('|');
				xspace ();
				xtext_link ("$yforum_categ_title_short", "$ywebsite_addr"."xw_main.php"."?wpqid=$wpqid&wpsid=$wpsid&fop=categ&offset=0", '_self');
				xspace ();
				xtext_small ('|');
				xspace ();
				xtext_link ("$yforum_topics", "$ywebsite_addr"."xw_main.php"."?wpqid=$wpqid&wpsid=$wpsid&fop=topic&fcategid=$fcategid&offset=0&qval=", '_self');
				xspace ();
				xtext_small ('|');
				xspace ();
				xtext_link ("$yforum_replies", "$ywebsite_addr"."xw_main.php"."?wpqid=$wpqid&wpsid=$wpsid&fop=repl&fcategid=$fcategid&ftopicid=$ftopicid&offset=0&qval=", '_self');
				xspace ();
				xtext_small ('|');
			xtable_column_end ();
		xtable_row_end ();
	xtable_end ();

	xnewline ();

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



//---------------------------------------------Get data

//---------------the real user auth id

	$usr_auth_id = '';
	$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') ) ");
	$usr_auth_id = $arr_var_result[0];


//---------------the selected categ

	$arr_forum_result = array();

	xmysql_read_data ("SELECT name FROM forum_categs WHERE (id='$fcategid') ");
	$arr_forum_result = $arr_var_result;

//----------------the selected topic

	$arr_forum_topics_result = array();

	xmysql_read_data ("SELECT subject FROM forum_topics WHERE (id='$ftopicid') ");
	$arr_forum_topics_result = $arr_var_result;

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

xshow_display_std_start ("$yforum_reply_post_new", "$ydisplay_width_corrected") ;

xcenter_start ();
xtable_start ('450');


	xtable_row_start ();
		xtable_column_start ('1', '10', "$ybar_menu_color");
			xspace ();
		xtable_column_end ();

		xtable_column_start_vcenter ('1', '40', "$ybar_menu_color");
			xnewline ();
			xpict_alt ("$ywebsite_addr"."$y_warp_picts_dir".'/forum_categ.jpg', '30', '30', "$yforum_categ_title_selected");
		xtable_column_end ();

		xtable_column_start_vcenter ('1', '400', "$ybar_menu_color");
			xnewline ();
			xtext_small ("$yforum_categ_title_selected"." : "."<b>$arr_forum_result[0]</b>");
		xtable_column_end ();
	xtable_row_end ();

	xtable_row_start ();
		xtable_column_start ('1', '10', "$ybar_menu_color");
			xspace ();
		xtable_column_end ();

		xtable_column_start_vcenter ('1', '40', "$ybar_menu_color");
			xnewline ();
			xpict_alt ("$ywebsite_addr"."$y_warp_picts_dir".'/forum_topic.jpg', '30', '30', "$yforum_topic_title_selected");
		xtable_column_end ();

		xtable_column_start_vcenter ('1', '400', "$ybar_menu_color");
			xnewline ();
			xtext_small ("$yforum_topic_title_selected"." : "."<b>$arr_forum_topics_result[0]</b>");
		xtable_column_end ();
	xtable_row_end ();

	xtable_row_start ();
		xtable_column_start ('1', '10', "$ybar_menu_color");
			xspace ();
		xtable_column_end ();

		xtable_column_start_vcenter ('1', '40', "$ybar_menu_color");
			xnewline ();
			xpict_alt ("$ywebsite_addr"."$y_warp_picts_dir".'/forum_reply.jpg', '30', '30', "$yforum_reply_post_new");
		xtable_column_end ();

		xtable_column_start_vcenter ('1', '400', "$ybar_menu_color");
			xnewline ();
			xtext_small ("$yforum_reply_post_new"." : ");
		xtable_column_end ();
	xtable_row_end ();

	xtable_row_start ();
		xtable_column_start ('3', '450', "$ybar_menu_color");

				$op_var = 'reply';
				xwriteflash_nobg_var ("$ywebsite_addr"."fpost_frm.swf",
					"&flash_form_backcolor=".rawurlencode($ybar_menu_color).
					"&flash_form_textcolor=".rawurlencode($ysmall_text_color).
					"&flash_form_text_subj=".rawurlencode($y_warp_post_text_mark.$yforum_subject." : ").
					"&flash_form_text_msg=".rawurlencode($y_warp_post_text_mark.$yforum_message." : ").
					"&flash_form_text_sender=".rawurlencode($y_warp_post_text_mark.$yforum_sender_name." : ").
					"&sender_var=".rawurlencode("$PHP_AUTH_USER").
					"&flash_form_text_hint=".rawurlencode($y_warp_post_text_hint).
					"&flash_form_text_bttn=".rawurlencode($y_warp_post_text_bttn).
					"&flash_form_text_bttn_pw=".rawurlencode($y_warp_preview_text_bttn).
					"&flash_form_text_back=".rawurlencode($y_warp_back_text).
					"&flash_form_text_status=".rawurlencode($yforum_status_post." : ").
					"&flash_form_text_process=".rawurlencode($yforum_process_post).
					"&flash_form_logo=".rawurlencode("$ywebsite_addr"."$y_warp_picts_dir".'/forum_xpost.jpg').
					"&flash_form_userid=".rawurlencode($usr_auth_id).
					"&flash_form_blockid=".rawurlencode($ftopicid).
					"&flash_form_op=".rawurlencode($op_var).
					"&xurl=".rawurlencode("$ywebsite_addr"."forum_op.php").
					"&xurlpw=".rawurlencode("$ywebsite_addr"."forum_pvw.php").
					"&wxu=".rawurlencode(MD5($PHP_AUTH_USER)).
					"&wxp=".rawurlencode(MD5(base64_encode($PHP_AUTH_PW))).
					"&"
				, '450', '520');

		xtable_column_end ();
	xtable_row_end ();


xtable_end ();
xcenter_end ();
xshow_display_std_end ();
xnewline ();

	

} //end if

//###################################### END - OP post reply



//###################################### OP edit topic


if ($fop=='edtt') {


	//==================== forums post reply where bar

	xtable_start ("$ydisplay_width_corrected");
		xtable_row_start ();
			xtable_column_start ('1', '', "$ybar_menu_color");
				xtext_small ('|');
				xspace ();
				xtext_small ("<b>$yforum_forum_title_short</b>");
				xspace ();
				xtext_small ('|');
				xspace ();
				xtext_link ("$yforum_categ_title_short", "$ywebsite_addr"."xw_main.php"."?wpqid=$wpqid&wpsid=$wpsid&fop=categ&offset=0", '_self');
				xspace ();
				xtext_small ('|');
				xspace ();
				xtext_link ("$yforum_topics", "$ywebsite_addr"."xw_main.php"."?wpqid=$wpqid&wpsid=$wpsid&fop=topic&fcategid=$fcategid&offset=0&qval=", '_self');
				xspace ();
				xtext_small ('|');
				xspace ();
				xtext_link ("$yforum_replies", "$ywebsite_addr"."xw_main.php"."?wpqid=$wpqid&wpsid=$wpsid&fop=repl&fcategid=$fcategid&ftopicid=$ftopicid&offset=0&qval=", '_self');
				xspace ();
				xtext_small ('|');
			xtable_column_end ();
		xtable_row_end ();
	xtable_end ();

	xnewline ();

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



//---------------------------------------------Get data

//---------------the real user auth id

	$usr_auth_id = '';
	$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') ) ");
	$usr_auth_id = $arr_var_result[0];


//---------------the selected categ

	$arr_forum_result = array();

	xmysql_read_data ("SELECT name FROM forum_categs WHERE (id='$fcategid') ");
	$arr_forum_result = $arr_var_result;


//----------------get the topic

	$arr_forum_topic_edit_result = array();

	xmysql_read_data ("SELECT id, subject, message, sender FROM forum_topics WHERE ( (id='$ftopicid') AND (block='$fcategid') AND (w_uid_auth='$usr_auth_id') ) ");
	$arr_forum_topic_edit_result = $arr_var_result;

	//check security
	if (empty($arr_forum_topic_edit_result[0])) {
		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 ("$yforum_err_accdeny_toedit");
						xspace ();
						xspace ();
					xtable_column_end ();
				xtable_row_end ();
			xtable_end ();
		xcenter_end ();

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

	$rtfy_msg_subj = $arr_forum_topic_edit_result[1];
	$rtfy_msg_msg = $arr_forum_topic_edit_result[2];
	$rtfy_msg_snd = $arr_forum_topic_edit_result[3];

	//reprocess vars - needs no remove slashes
	$rtfy_msg_subj = xundo_htmlspecchars ($rtfy_msg_subj);
	$rtfy_msg_msg = xundo_htmlspecchars($rtfy_msg_msg);
	$rtfy_msg_msg = xflash_rtf_to_html_undo ($rtfy_msg_msg);


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



xshow_display_std_start ("$yforum_topic_update_it", "$ydisplay_width_corrected") ;

xcenter_start ();
xtable_start ('450');


	xtable_row_start ();
		xtable_column_start ('1', '10', "$ybar_menu_color");
			xspace ();
		xtable_column_end ();

		xtable_column_start_vcenter ('1', '40', "$ybar_menu_color");
			xnewline ();
			xpict_alt ("$ywebsite_addr"."$y_warp_picts_dir".'/forum_categ.jpg', '30', '30', "$yforum_categ_title_selected");
		xtable_column_end ();

		xtable_column_start_vcenter ('1', '400', "$ybar_menu_color");
			xnewline ();
			xtext_small ("$yforum_categ_title_selected"." : "."<b>$arr_forum_result[0]</b>");
		xtable_column_end ();
	xtable_row_end ();

	xtable_row_start ();
		xtable_column_start ('1', '10', "$ybar_menu_color");
			xspace ();
		xtable_column_end ();

		xtable_column_start_vcenter ('1', '40', "$ybar_menu_color");
			xnewline ();
			xpict_alt ("$ywebsite_addr"."$y_warp_picts_dir".'/forum_topic.jpg', '30', '30', "$yforum_topic_update_it");
		xtable_column_end ();

		xtable_column_start_vcenter ('1', '400', "$ybar_menu_color");
			xnewline ();
			xtext_small ("$yforum_topic_update_it"." : ");
		xtable_column_end ();
	xtable_row_end ();

	xtable_row_start ();
		xtable_column_start ('3', '450', "$ybar_menu_color");

				$op_var = 'xedtt';
				xwriteflash_nobg_var ("$ywebsite_addr"."fpost_frm.swf",
					"&flash_form_backcolor=".rawurlencode($ybar_menu_color).
					"&flash_form_textcolor=".rawurlencode($ysmall_text_color).
					"&flash_form_text_subj=".rawurlencode($y_warp_post_text_mark.$yforum_subject." : ").
					"&flash_form_text_msg=".rawurlencode($y_warp_post_text_mark.$yforum_message." : ").
					"&flash_form_text_sender=".rawurlencode($y_warp_post_text_mark.$yforum_sender_name." : ").
					"&subj_var=".rawurlencode("$rtfy_msg_subj").
					"&msg_var=".rawurlencode("$rtfy_msg_msg").
					"&sender_var=".rawurlencode("$rtfy_msg_snd").
					"&flash_form_text_hint=".rawurlencode($y_warp_post_text_hint).
					"&flash_form_text_bttn=".rawurlencode($y_warp_update_txt).
					"&flash_form_text_bttn_pw=".rawurlencode($y_warp_preview_text_bttn).
					"&flash_form_text_back=".rawurlencode($y_warp_back_text).
					"&flash_form_text_status=".rawurlencode($yforum_status_post." : ").
					"&flash_form_text_process=".rawurlencode($yforum_process_post).
					"&flash_form_logo=".rawurlencode("$ywebsite_addr"."$y_warp_picts_dir".'/forum_xpost.jpg').
					"&flash_form_userid=".rawurlencode($usr_auth_id).
					"&flash_form_blockid=".rawurlencode($ftopicid).
					"&flash_form_op=".rawurlencode($op_var).
					"&xurl=".rawurlencode("$ywebsite_addr"."forum_op.php").
					"&xurlpw=".rawurlencode("$ywebsite_addr"."forum_pvw.php").
					"&wxu=".rawurlencode(MD5($PHP_AUTH_USER)).
					"&wxp=".rawurlencode(MD5(base64_encode($PHP_AUTH_PW))).
					"&"
				, '450', '520');

		xtable_column_end ();
	xtable_row_end ();


xtable_end ();
xcenter_end ();
xshow_display_std_end ();
xnewline ();

	

} //end if

//###################################### END - OP edit topic



//###################################### OP edit reply


if ($fop=='edtr') {


	//==================== forums post reply where bar

	xtable_start ("$ydisplay_width_corrected");
		xtable_row_start ();
			xtable_column_start ('1', '', "$ybar_menu_color");
				xtext_small ('|');
				xspace ();
				xtext_small ("<b>$yforum_forum_title_short</b>");
				xspace ();
				xtext_small ('|');
				xspace ();
				xtext_link ("$yforum_categ_title_short", "$ywebsite_addr"."xw_main.php"."?wpqid=$wpqid&wpsid=$wpsid&fop=categ&offset=0", '_self');
				xspace ();
				xtext_small ('|');
				xspace ();
				xtext_link ("$yforum_topics", "$ywebsite_addr"."xw_main.php"."?wpqid=$wpqid&wpsid=$wpsid&fop=topic&fcategid=$fcategid&offset=0&qval=", '_self');
				xspace ();
				xtext_small ('|');
				xspace ();
				xtext_link ("$yforum_replies", "$ywebsite_addr"."xw_main.php"."?wpqid=$wpqid&wpsid=$wpsid&fop=repl&fcategid=$fcategid&ftopicid=$ftopicid&offset=0&qval=", '_self');
				xspace ();
				xtext_small ('|');
			xtable_column_end ();
		xtable_row_end ();
	xtable_end ();

	xnewline ();

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



//---------------------------------------------Get data

//---------------the real user auth id

	$usr_auth_id = '';
	$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') ) ");
	$usr_auth_id = $arr_var_result[0];


//---------------the selected categ

	$arr_forum_result = array();

	xmysql_read_data ("SELECT name FROM forum_categs WHERE (id='$fcategid') ");
	$arr_forum_result = $arr_var_result;

//----------------the selected topic

	$arr_forum_topics_result = array();

	xmysql_read_data ("SELECT subject FROM forum_topics WHERE (id='$ftopicid') ");
	$arr_forum_topics_result = $arr_var_result;


//----------------get the reply

	$arr_forum_reply_edit_result = array();

	xmysql_read_data ("SELECT id, subject, message, sender FROM forum_replies WHERE ( (id='$freplyid') AND (block='$ftopicid') AND (w_uid_auth='$usr_auth_id') ) ");
	$arr_forum_reply_edit_result = $arr_var_result;

	//check security
	if (empty($arr_forum_reply_edit_result[0])) {
		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 ("$yforum_err_accdeny_toedit");
						xspace ();
						xspace ();
					xtable_column_end ();
				xtable_row_end ();
			xtable_end ();
		xcenter_end ();

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

	$rtfy_msg_subj = $arr_forum_reply_edit_result[1];
	$rtfy_msg_msg = $arr_forum_reply_edit_result[2];
	$rtfy_msg_snd = $arr_forum_reply_edit_result[3];

	//reprocess vars - needs no remove slashes
	$rtfy_msg_subj = xundo_htmlspecchars ($rtfy_msg_subj);
	$rtfy_msg_msg = xundo_htmlspecchars($rtfy_msg_msg);
	$rtfy_msg_msg = xflash_rtf_to_html_undo ($rtfy_msg_msg);

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



xshow_display_std_start ("$yforum_reply_update_it", "$ydisplay_width_corrected") ;

xcenter_start ();
xtable_start ('450');


	xtable_row_start ();
		xtable_column_start ('1', '10', "$ybar_menu_color");
			xspace ();
		xtable_column_end ();

		xtable_column_start_vcenter ('1', '40', "$ybar_menu_color");
			xnewline ();
			xpict_alt ("$ywebsite_addr"."$y_warp_picts_dir".'/forum_categ.jpg', '30', '30', "$yforum_categ_title_selected");
		xtable_column_end ();

		xtable_column_start_vcenter ('1', '400', "$ybar_menu_color");
			xnewline ();
			xtext_small ("$yforum_categ_title_selected"." : "."<b>$arr_forum_result[0]</b>");
		xtable_column_end ();
	xtable_row_end ();

	xtable_row_start ();
		xtable_column_start ('1', '10', "$ybar_menu_color");
			xspace ();
		xtable_column_end ();

		xtable_column_start_vcenter ('1', '40', "$ybar_menu_color");
			xnewline ();
			xpict_alt ("$ywebsite_addr"."$y_warp_picts_dir".'/forum_topic.jpg', '30', '30', "$yforum_topic_title_selected");
		xtable_column_end ();

		xtable_column_start_vcenter ('1', '400', "$ybar_menu_color");
			xnewline ();
			xtext_small ("$yforum_topic_title_selected"." : "."<b>$arr_forum_topics_result[0]</b>");
		xtable_column_end ();
	xtable_row_end ();

	xtable_row_start ();
		xtable_column_start ('1', '10', "$ybar_menu_color");
			xspace ();
		xtable_column_end ();

		xtable_column_start_vcenter ('1', '40', "$ybar_menu_color");
			xnewline ();
			xpict_alt ("$ywebsite_addr"."$y_warp_picts_dir".'/forum_reply.jpg', '30', '30', "$yforum_reply_update_it");
		xtable_column_end ();

		xtable_column_start_vcenter ('1', '400', "$ybar_menu_color");
			xnewline ();
			xtext_small ("$yforum_reply_update_it"." : ");
		xtable_column_end ();
	xtable_row_end ();

	xtable_row_start ();
		xtable_column_start ('3', '450', "$ybar_menu_color");

				$op_var = 'xedtr';
				xwriteflash_nobg_var ("$ywebsite_addr"."fpost_frm.swf",
					"&flash_form_backcolor=".rawurlencode($ybar_menu_color).
					"&flash_form_textcolor=".rawurlencode($ysmall_text_color).
					"&flash_form_text_subj=".rawurlencode($y_warp_post_text_mark.$yforum_subject." : ").
					"&flash_form_text_msg=".rawurlencode($y_warp_post_text_mark.$yforum_message." : ").
					"&flash_form_text_sender=".rawurlencode($y_warp_post_text_mark.$yforum_sender_name." : ").
					"&subj_var=".rawurlencode("$rtfy_msg_subj").
					"&msg_var=".rawurlencode("$rtfy_msg_msg").
					"&sender_var=".rawurlencode("$rtfy_msg_snd").
					"&flash_form_text_hint=".rawurlencode($y_warp_post_text_hint).
					"&flash_form_text_bttn=".rawurlencode($y_warp_update_txt).
					"&flash_form_text_bttn_pw=".rawurlencode($y_warp_preview_text_bttn).
					"&flash_form_text_back=".rawurlencode($y_warp_back_text).
					"&flash_form_text_status=".rawurlencode($yforum_status_post." : ").
					"&flash_form_text_process=".rawurlencode($yforum_process_post).
					"&flash_form_logo=".rawurlencode("$ywebsite_addr"."$y_warp_picts_dir".'/forum_xpost.jpg').
					"&flash_form_userid=".rawurlencode($usr_auth_id).
					"&flash_form_blockid=".rawurlencode($freplyid).
					"&flash_form_op=".rawurlencode($op_var).
					"&xurl=".rawurlencode("$ywebsite_addr"."forum_op.php").
					"&xurlpw=".rawurlencode("$ywebsite_addr"."forum_pvw.php").
					"&wxu=".rawurlencode(MD5($PHP_AUTH_USER)).
					"&wxp=".rawurlencode(MD5(base64_encode($PHP_AUTH_PW))).
					"&"
				, '450', '520');

		xtable_column_end ();
	xtable_row_end ();


xtable_end ();
xcenter_end ();
xshow_display_std_end ();
xnewline ();

	

} //end if

//###################################### END - OP edit reply


} //END FUNCTION



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

//init
//forum_secure ();

//forum_module ();

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

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