if( preg_match("'\[temp\](.*?)\[/temp\]'i", $GLOBALS['c_page_category'] )){
$MY_PAGE_OUTPUT=my_sql( $f_5_r['page_category'], 1 , 1 , 0 , 0 ,'decode',1 );
}else{
$MY_PAGE_OUTPUT=$GLOBALS['c_page_category'];
}
$my_weblog_page_title=''.$my_weblog_page_title.'-بخش های وبلاگ';
if( preg_match("#<mainpages>(.*?)</mainpages>#s", $MY_PAGE_OUTPUT , $match)){
$my_page_source_old=$match[1];
$my_page_source='';
$f_8 = mysql_query("SELECT * FROM `$db_53` WHERE `weblog_id`='{$w_id}' ORDER BY `id` DESC") or die(mysql_error());
while($my_item = mysql_fetch_assoc($f_8)){
$my_this_part=$my_page_source_old;
$my_this_part=str_replace("<id>", $my_item['id'], $my_this_part);
$my_this_part=str_replace("<title>", my_sql( $my_item['title'], 1 , 1 , 0 , 0 ,'decode',1 ), $my_this_part);
$my_this_part=str_replace("<url>", ''.c_weblog_ur.'/post/c-'.$my_item['id'].'/1.html', $my_this_part);
if (strpos("$my_this_part","<pic>") !== false) {
if($my_item['pic']=='' || $my_item['pic']=='http://'){
$my_this_part=str_replace("<pic>", '', $my_this_part);
}else{
$my_this_part=str_replace("<pic>", my_sql( $my_item['pic'], 1 , 1 , 0 , 0 ,'decode',1 ), $my_this_part);
}
}
$my_this_part=str_replace("<note>", my_sql( $my_item['note'], 1 , 1 , 0 , 0 ,'decode',1 ), $my_this_part);
if (strpos("$my_this_part","<posts>") !== false) {
$f_10 = mysql_query("SELECT COUNT(*) FROM `$db_52` WHERE `cat_id`='{$my_item['id']}' AND `sh`='1' ") or die(mysql_error());
$r_10 = mysql_result($f_10 , 0);
$my_this_part=str_replace("<posts>", $r_10, $my_this_part);
}
$my_page_source.=$my_this_part;
}
$MY_PAGE_OUTPUT=str_replace($my_page_source_old, $my_page_source, $MY_PAGE_OUTPUT);
}