, ", AND STATIC VARIABLES $tzone=str_replace(':','',$qub['tzone']); // ****************************** Start Creat BlogAndPostTitle ****************************** if($p){ $BPT = mysql_fetch_array(mysql_query("SELECT bid,ptitle,pcomment,pcat,ptags,pdesc FROM posts$ptnum WHERE bid='$p' AND weblog='$id' AND fdate <= $fdate AND (status='1' OR status='2') limit 1")); if(!$BPT['bid']){include("blogfiles/page404.php");} $bhits = $BPT['phits']; $bstus = $BPT['status']; $bvotea = $BPT['votea']; $bvoteb = $BPT['voteb']; $incat = $BPT['pcat']; $bonecat1=explode(",",$incat); $bonecat=$bonecat1['0']; if($bonecat == "Array"){$bonecat=$incat;} if($BPT['pdesc']){$BlogAndPostDesc = $BPT['pdesc'];} else{$BlogAndPostDesc = $BPT['ptags'];$BlogAndPostDesc = str_replace(",", " ، ", $BlogAndPostDesc);} $BlogAndPostKey = $BPT['ptags']; if($vote AND $vote<=5){ if($_COOKIE[$votecookie]==$votecookie){ mysql_query("update posts$ptnum set phits=phits+1 WHERE bid='$p' AND weblog='$id' AND fdate <= $fdate AND (status='1' OR status='2') limit 1"); }else{ mysql_query("update posts$ptnum set phits=phits+1,votea=votea+1,voteb=voteb+$vote WHERE bid='$p' AND weblog='$id' AND fdate <= $fdate AND (status='1' OR status='2') limit 1");} } else{mysql_query("update posts$ptnum set phits=phits+1 WHERE bid='$p' AND weblog='$id' AND fdate <= $fdate AND (status='1' OR status='2') limit 1");} if(!$BPT['bid']){$BlogAndPostTitle="مطلب مورد نظر شما یافت نشد!";} elseif(!$BPT['ptitle']){$BlogAndPostTitle="بدون عنوان";} else{$BlogAndPostTitle = $BPT['ptitle'];} $fl6='caches/hit/'.$id.'.hit';$fh6 = @fopen($fl6, 'w');@fwrite($fh6,"");@fclose($fh6); } else if($b){ mysql_query("UPDATE pages SET phits=phits+1 WHERE weblog='$id' AND pna='$b'"); $BlogAndPostTitle = mysql_fetch_array(mysql_query("SELECT id,ptitle,phits,ptext,status FROM pages WHERE weblog='$id' AND pna='$b' limit 1")); if(!$BlogAndPostTitle['id']){include("blogfiles/page404.php");} $bhits = $BlogAndPostTitle['phits']; $bi = enbug($BlogAndPostTitle['ptext']); $bstus = $BlogAndPostTitle['status']; $BlogAndPostTitle = $BlogAndPostTitle['ptitle']; $BlogAndPostDesc = $qub['btitle']; $BlogAndPostKey = ''; if($bstus=='1'){ $template = $bi; if(!$BlogAndPostTitle){$BlogAndPostTitle="صفحه مورد نظر شما یافت نشد!";} } }else if($catz){ $BPT = mysql_fetch_array(mysql_query("SELECT id,ctitle,cdesc,ckeys FROM cats WHERE weblog='$id' AND bid='$catz' limit 0,1")); if(!$BPT['id']){include("blogfiles/page404.php");} $BlogAndPostTitle = $BPT['ctitle']; $BlogAndPostDesc = $BPT['cdesc']; $BlogAndPostKey = $BPT['ckeys']; if(!$BPT){$BlogAndPostTitle="موضوع مورد نظر شما یافت نشد!";} } else if($archivez){ $ntag = $archivex; $ntag = str_replace("|","/",$ntag); $BlogAndPostTitle = "آرشیو مطالب $ntag | $qub[btitle]"; $BlogAndPostDesc = "آرشیو مطالب $ntag"; $BlogAndPostKey = "آرشیو مطالب $ntag"; } elseif($upz){ $BlogAndPostTitle = "آرشیو مطالب $upz | $qub[btitle]"; $BlogAndPostDesc = "آرشیو مطالب $upz | $qub[btitle]"; $BlogAndPostKey = ''; } else if($tag){ $ntag = $tag; $ntag = str_replace("/page/$pz","",$tag); $BlogAndPostTitle = "$ntag | $qub[btitle]"; $BlogAndPostDesc = $qub['btitle']; $BlogAndPostKey = ''; $BlogAndPostDesc = str_replace(",", " ، ", $BlogAndPostDesc); } else if($Tags){ $BlogAndPostTitle = "آرشیو تمامی برچسب ها | $qub[btitle]"; $BlogAndPostKey = ''; $BlogAndPostDesc = ''; } else if($hafez){ $BlogAndPostTitle = "فال حافظ | $qub[btitle]"; $BlogAndPostKey = ''; $BlogAndPostDesc = ''; } else if($falhafez){ $BlogAndPostTitle = "نتیجه فال حافظ شما | $qub[btitle]"; $BlogAndPostKey = ''; $BlogAndPostDesc = ''; } else if($searchz){ $nsearchz = $searchz; $nsearchz = str_replace("/page/$pz","",$searchz); $ckdsearchz = mysql_fetch_array(mysql_query("SELECT id FROM posts$ptnum WHERE weblog='$id' AND (ptitle LIKE '%$nsearchz%' OR ptags LIKE '%$nsearchz%') AND fdate <= $fdate AND (status='1' OR status='2') limit 0,1")); if(!$ckdsearchz['id']){include("blogfiles/page404.php");} $BlogAndPostTitle = $nsearchz; $BlogAndPostDesc = $qub['btitle']; $BlogAndPostKey = ''; } else if(@$pageposts){ $BlogAndPostTitle = "عناوین مطالب $qub[btitle]"; } else{ $BlogAndPostTitle = $qub['btitle']; $BlogAndPostDesc = $qub['description']; if(!$BlogAndPostDesc){$BlogAndPostDesc = $qub['bdesc'];} $BlogAndPostKey = $qub['keywords']; } if($ckdpage[1]=='page' OR $ckdpage[2]=='page' OR $ckdpage[3]=='page'){ $BlogAndPostTitle = $BlogAndPostTitle.' - صفحه '.$pz; $BlogAndPostDesc = $BlogAndPostDesc.' - صفحه '.$pz; } $ckdprofile = mysql_fetch_array(mysql_query("Select id From profile Where weblog = '$id' AND faal='1' limit 0,1")); $profile = between("", "", $template); if(!$ckdprofile['id']){ $template = str_replace("$profile", "", $template); } $favoscript = between("", "", $template); $jsh='.jsh'; $fjsh="caches/jsh/".$id.$jsh; if(!@filesize($fjsh)){ $template = str_replace("$favoscript", "", $template); }else { $cjsh = file_get_contents($fjsh); $cjsh=enbug($cjsh); } $search_array = Array("<", ">", '"', "<-BlogAndPostTitle->", "<-BlogAndPostDesc->", "<-BlogAndPostKey->", "<-BlogTitle->", "<-BlogDescription->", "<-BlogId->", "<-BlogXmlLink->", "<-BlogTimeZone->", "<-BlogUrl->", "<-BlogCustomHtml->", "<-BlogEmail->", "<-BlogArchiveLink->","<-BlogProfileLink->"); $replace_array = Array("<", ">", '"', enbug($BlogAndPostTitle), enbug($BlogAndPostDesc), enbug($BlogAndPostKey), enbug($qub[btitle]), enbug($qub[bdesc]), enbug($qub[usern]), "http://$domain/rss.xml", "$tzone", "http://$domain", "$cjsh", "$qub[email]", "http://$domain/archive","http://$domain/profile"); $template = str_replace($search_array, $replace_array, $template); // ****************************** End Creat BlogAndPostTitle ****************************** // INPUT POSTS $insert = ""; $posts = between("", "", $template); $expost = between("", "", $template); $tagsblock = between("", "", $template); $postcatsblock = between("", "", $template); $registerr = between("", "", $template); $loginr = between("", "", $template); $forgetr = between("", "", $template); $editr = between("", "", $template); $newpostr = between("", "", $template); if($p){ $allposts = mysql_query("SELECT * FROM posts$ptnum WHERE bid='$p' AND weblog='$id' AND fdate <= $fdate AND (status='1' OR status='2') limit 1"); } else if($Tags){ $allposts = mysql_query("SELECT ptags FROM posts$ptnum WHERE weblog='$id' AND ptags!='' AND fdate <= $fdate AND (status='1' OR status='2') order by bidd desc , id desc"); $allpostz = mysql_query("SELECT id FROM posts$ptnum WHERE weblog='$id' AND ptags!='' AND fdate <= $fdate AND (status='1' OR status='2')"); include("includee/tags.php"); } else if($tag){ $adjacents = 3; $limit = $ipnum; if($pz) {$start = ($pz - 1) * $limit; }else{$start = 0;} $allposts = mysql_query("SELECT * FROM posts$ptnum WHERE weblog='$id' AND fdate <= $fdate AND FIND_IN_SET('$ntag', ptags) AND (status='1' OR status='2') order by id desc limit $start,$limit"); $allpostz = mysql_query("SELECT id FROM posts$ptnum WHERE weblog='$id' AND fdate <= $fdate AND FIND_IN_SET('$ntag', ptags) AND (status='1' OR status='2')"); } else if($pageposts){ if($pz AND $pz!='1'){$pz=$pz;}else{$pz=0;} $limit = 20; if($pz) {$start = ($pz - 1) * $limit; }else{$start = 0;} $allposts = mysql_query("SELECT bid,ptitle FROM posts$ptnum WHERE weblog='$id' AND fdate <= $fdate AND (status='1' OR status='2') order by id desc limit $start,$limit"); $allpostz = mysql_query("SELECT id FROM posts$ptnum WHERE weblog='$id' AND fdate <= $fdate AND (status='1' OR status='2')"); include("blogfiles/posts.php"); } else if($b){ $allposts = mysql_query("SELECT * FROM pages WHERE weblog='$id' AND pna='$b'"); $allpostsanum=$b; include("includee/extrapage.php"); } else if($catz){ $adjacents = 3; $limit = $ipnum; if($pz) {$start = ($pz - 1) * $limit; }else{$start = 0;} $qcatza=mysql_fetch_array(mysql_query("select * from cats where weblog='$id' AND bid='$catz' limit 1")); $qcatzaid=$qcatza['id']; if($qcatza['status']=='1'){ $qcatzb=mysql_query("select * from cats where weblog='$id' AND status='$qcatzaid'"); $qcatzd=''; while($qcatzc=mysql_fetch_array($qcatzb)){ $qcatzcid = $qcatzc['id']; $qcatzd.= ' or FIND_IN_SET('.$qcatzcid.', pcat)'; } $allposts = mysql_query("SELECT * FROM posts$ptnum WHERE weblog='$id' AND fdate <= $fdate AND (status='1' OR status='2') AND (FIND_IN_SET('$qcatzaid', pcat) $qcatzd) order by id desc limit $start,$limit") or die(mysql_error()); $allpostz = mysql_query("SELECT id FROM posts$ptnum WHERE weblog='$id' AND fdate <= $fdate AND (status='1' OR status='2') AND (FIND_IN_SET('$qcatzaid', pcat) $qcatzd)"); } else{ $allposts = mysql_query("SELECT * FROM posts$ptnum WHERE weblog='$id' AND fdate <= $fdate AND (status='1' OR status='2') AND FIND_IN_SET('$qcatzaid', pcat) order by id desc limit $start,$limit"); $allpostz = mysql_query("SELECT id FROM posts$ptnum WHERE weblog='$id' AND fdate <= $fdate AND (status='1' OR status='2') AND FIND_IN_SET('$qcatzaid', pcat)"); } } else if($archivex){ $archivexx=urldecode($archivex); $archivexx=str_replace("|page","",$archivexx); if($pz!=1){$archivexx=str_replace("|$pz","",$archivexx);} $Aarchivexx = explode("|",$archivexx); if($qub['archivetype']=='3'){ $archivexx =$Aarchivexx[0].'|'.$Aarchivexx[1].'|'.$Aarchivexx[2]; }elseif($qub['archivetype']=='2'){ $archivexx = $Aarchivexx[0].'|'.$Aarchivexx[1].'|'; }else{ $archivexx = $Aarchivexx[0]; } $slen = strlen($archivexx); $adjacents = 3; $limit = $ipnum; if($pz) {$start = ($pz - 1) * $limit; }else{$start = 0;} $allposts = mysql_query("SELECT * FROM posts$ptnum WHERE weblog='$id' AND fdate <= $fdate AND (status='1' OR status='2') AND SUBSTRING(pdate,1,$slen) = '$archivexx' order by id desc limit $start,$limit"); $allpostz = mysql_query("SELECT id FROM posts$ptnum WHERE weblog='$id' AND fdate <= $fdate AND (status='1' OR status='2') AND SUBSTRING(pdate,1,$slen) = '$archivexx'"); } else if($searchz){ $adjacents = 3; $limit = $ipnum; if($pz) {$start = ($pz - 1) * $limit; }else{$start = 0;} $allposts = mysql_query("SELECT * FROM posts$ptnum WHERE weblog='$id' AND (ptitle LIKE '%$nsearchz%' OR ptags LIKE '%$nsearchz%') AND fdate <= $fdate AND (status='1' OR status='2') order by id desc limit $start,$limit"); $allpostz = mysql_query("SELECT id FROM posts$ptnum WHERE weblog='$id' AND (ptitle LIKE '%$nsearchz%' OR ptags LIKE '%$nsearchz%') AND fdate <= $fdate AND (status='1' OR status='2')"); } else if($upz){ if($upz=='admin'){$upz=$id;} $adjacents = 3; $limit = $ipnum; if($pz) {$start = ($pz - 1) * $limit; }else{$start = 0;} $allposts = mysql_query("SELECT * FROM posts$ptnum WHERE weblog='$id' AND fdate <= $fdate AND usern='$upz' AND (status='1' OR status='2') order by id desc limit $start,$limit"); $allpostz = mysql_query("SELECT id FROM posts$ptnum WHERE weblog='$id' AND fdate <= $fdate AND usern='$upz' AND (status='1' OR status='2')"); } else if($register){ include("includee/register.php"); } else if($forget){ include("includee/forgetp.php"); } else if($New_Post){ include("includee/new_post_weblog.php"); } else if($Edit_Profile){ include("includee/edit_profile_weblog.php"); } else if($Login){ include("includee/login_weblog.php"); } else if($hafez){ include("includee/hafez.php"); } else if($falhafez){ include("includee/falhafez.php"); } else{ $adjacents = 3; $limit = $ipnum; if($pz) {$start = ($pz - 1) * $limit; }else{$start = 0;} $allposts = mysql_query("SELECT * FROM posts$ptnum WHERE weblog='$id' AND fdate <= $fdate AND (status='1' OR status='2') order by bidd desc , id desc limit $start,$limit"); $allpostz = mysql_query("SELECT id FROM posts$ptnum WHERE weblog='$id' AND fdate <= $fdate AND (status='1' OR status='2')"); } if(!$register AND !$forget AND !$New_Post AND !$Login AND !$Edit_Profile AND !$b AND !$Tags AND !$hafez AND !$falhafez AND !$pageposts){ /////////////////////////////// MEY super Cache $insert2 = ''; $cmmn="";$iiv=1; while($post = mysql_fetch_array($allposts)) { if($post['usern']==$qub['usern']){$pauthor=$qub['flname'];} else{ $pauthor=$post['usern']; $qpauthoa=mysql_fetch_array(mysql_query("select usern,flname from users where usern='$pauthor' and blog='$id' limit 1")); $pauthor=$qpauthoa['flname']; } if($iiv>1){$cmmn.=",";} $cmmn.=$post['bid'].","; $tpostid=$post['bid']; $tpcmnta=mysql_query("select id from bcomments where weblog='$id' and pid='$tpostid' and status='1'"); $cmmn.=mysql_num_rows($tpcmnta); $iiv++; if ($postz OR $post['pcomment']=='2' OR $post['pcomment']=='3'){ $cmmpnt=between("", "", $posts); $xposts = str_replace("".$cmmpnt."", "", $posts); }else{$xposts=$posts;} $insert .= $xposts; if($p OR $post['pmore']!='1' OR $postz){$insert = str_replace("".$expost."", "", $insert);} if(!$post['ptags']){$insert = str_replace("".$tagsblock."", "", $insert);} if(!$post['pcat']){$insert = str_replace("".$postcatsblock."", "", $insert);} $votecookie="votepost$id$post[bid]"; @$postvote = round($post['voteb']/$post['votea']); $insert = str_replace("<-PostVote->", "$postvote", $insert); if($vote){ if($_COOKIE[$votecookie]==$votecookie){$insert = str_replace('<-PostVoteForm->', 'امتیاز شما قبلا ثبت شده است', $insert);} else{ $insert = str_replace('<-PostVoteForm->', 'امتیاز شما ثبت شد', $insert); setcookie ("$votecookie","$votecookie",$expirecookie); } }else{ if($_COOKIE[$votecookie]==$votecookie){ if($postvote>=1){ $insert = str_replace("<-PostVoteForm->", "
", $insert); }else{ $insert = str_replace("<-PostVoteForm->", "
", $insert); } if($postvote>=2){ $insert = str_replace("", "
", $insert); }else{ $insert = str_replace("", "
", $insert); } if($postvote>=3){ $insert = str_replace("", "
", $insert); }else{ $insert = str_replace("", "
", $insert); } if($postvote>=4){ $insert = str_replace("", "
", $insert); }else{ $insert = str_replace("", "
", $insert); } if($postvote==5){ $insert = str_replace("", "
", $insert); }else{ $insert = str_replace("", "
", $insert); } }else{ if($postvote>=1){ $insert = str_replace("<-PostVoteForm->", "
", $insert); }else{ $insert = str_replace("<-PostVoteForm->", "
", $insert); } if($postvote>=2){ $insert = str_replace("", "
", $insert); }else{ $insert = str_replace("", "
", $insert); } if($postvote>=3){ $insert = str_replace("", "
", $insert); }else{ $insert = str_replace("", "
", $insert); } if($postvote>=4){ $insert = str_replace("", "
", $insert); }else{ $insert = str_replace("", "
", $insert); } if($postvote==5){ $insert = str_replace("", "
", $insert); }else{ $insert = str_replace("", "
", $insert); } } } $insert = str_replace("<-PostVoteForm->", "", $insert); $insert = str_replace("<-PostId->", enbug($post[bid]), $insert); if($post['perma']==''){$urlencodeptitle = urlencode(enbug($post['ptitle']));} else{$urlencodeptitle = urlencode(enbug($post['perma']));} if($eperma[0]!='2'){$insert = str_replace("<-PostLink->", "http://$domain/$permalinkname/".enbug($post[bid])."", $insert);} else{$insert = str_replace("<-PostLink->", "http://$domain/$permalinkname/".enbug($post[bid])."/$urlencodeptitle", $insert);} $insert = str_replace("<-PostHit->", "$post[phits]", $insert); $insert = str_replace("<-PostTitle->", enbug($post[ptitle]), $insert); $ppast='
مطلب مورد نظر رمز دارد.
لطفا رمز عبور مربوط به مطلب را وارد کرده ، دکمه تایید را کلیک کنید.'; if($post['ppasm']){$ppast.='
'.$post['ppasm'];} $ppast.='
'; if($post[pphoto]){ $pphoto=''.enbug($post[ptitle]).''; }else{$pphoto='';} $fi='.bp'; $fl="blogposts/".$id."/".$post['bid'].$fi; $pvtex = stripslashes(file_get_contents($fl)); $pvtext = explode('', $pvtex ); if(!$postz){ if($post['ppas']){ if($post['member']=='0' AND !$ppas){ $insert = str_replace("<-PostContent->", enbug($ppast), $insert); $insert = str_replace("<-PostPhoto->", "", $insert); } else if($post['member']=='0' AND $post['ppas']!=$ppas){ $insert = str_replace("<-PostContent->", "رمز وارد شده صحیح نمیباشد!
$ppast", $insert); $insert = str_replace("<-PostPhoto->", "", $insert); } else if($post['member']=='0' AND $post['ppas']==$ppas){ $insert = str_replace("<-PostContent->", enbug($pvtext[0].$pvtext[1]), $insert); $insert = str_replace("<-PostPhoto->", "$pphoto", $insert); } else if($post['member']=='1' AND $_SESSION['do_login_ok']!="mk45913722fghjkt21"){ $insert = str_replace("<-PostContent->", "
نمایش این مطلب تنها به اعضا امکان پذیر است
ابتدا ثبت نام کنید يا وارد شويد
", $insert); $insert = str_replace("<-PostPhoto->", "", $insert); } else if($post['member']=='1' AND !$ppas){ $insert = str_replace("<-PostContent->", enbug($ppast), $insert); $insert = str_replace("<-PostPhoto->", "", $insert); } else if($post['member']=='1' AND $post['ppas']!=$ppas){ $insert = str_replace("<-PostContent->", "رمز وارد شده صحیح نمیباشد!
$ppast", $insert); $insert = str_replace("<-PostPhoto->", "", $insert); } else if($post['member']=='1' AND $post['ppas']==$ppas){ $insert = str_replace("<-PostContent->", enbug($pvtext[0].$pvtext[1]), $insert); $insert = str_replace("<-PostPhoto->", "$pphoto", $insert); } else {} } else if(!$post['ppas']){ if($post['member']=='1' AND $_SESSION['do_login_ok']!="mk45913722fghjkt21"){ $insert = str_replace("<-PostContent->", "
نمایش این مطلب تنها به اعضا امکان پذیر است
ابتدا ثبت نام کنید يا وارد شويد
", $insert); $insert = str_replace("<-PostPhoto->", "", $insert); } else if($p){ $insert = str_replace("<-PostContent->", enbug($pvtext[0].$pvtext[1]), $insert); $insert = str_replace("<-PostPhoto->", "$pphoto", $insert); } else { $insert = str_replace("<-PostContent->", enbug($pvtext[0]), $insert); $insert = str_replace("<-PostPhoto->", "$pphoto", $insert); } }else {} }else {$insert = str_replace("<-PostContent->", "", $insert);$insert = str_replace("<-PostPhoto->", "", $insert);} /***************************** POST DATE ******************************/ if ($dateform=='1'){ $date=explode("|",$post['pdate']); $week = Array ("يکشنبه", "دوشنبه", "سه شنبه", "چهارشنبه", "پنجشنبه", "جمعه", "شنبه"); $months = Array ("فروردين", "ارديبهشت", "خرداد", "تير", "مرداد", "شهريور", "مهر", "آبان", "آذر", "دی", "بهمن", "اسفند"); $day=$date['3'];$mon=$date['1'];$date = $week[$day]." ".$date['2']." ".$months[($mon-1)]." ".$date['0']; }else if ($dateform=='2'){ $date=explode("|",$post['pdate']); $week = Array ("يکشنبه", "دوشنبه", "سه شنبه", "چهارشنبه", "پنجشنبه", "جمعه", "شنبه"); $day=$date['3'];$date = $week[$day]." ".$date['2']." / ".$date['1']." / ".$date['0']; }else if ($dateform=='3'){ $date=explode("|",$post['pdate']); $date = $date['2']." / ".$date['1']." / ".$date['0']; }else if ($dateform=='4'){ $date=explode("|",$post['pdate']); $week = Array ("يکشنبه", "دوشنبه", "سه شنبه", "چهارشنبه", "پنجشنبه", "جمعه", "شنبه"); $day=$date['3'];$date = $week[$day]; }else if ($dateform=='5'){ $date=explode("|",$post['pdate']); $week = Array ("يکشنبه", "دوشنبه", "سه شنبه", "چهارشنبه", "پنجشنبه", "جمعه", "شنبه"); $day=$date['3'];$date = $week[$day]." ".$date['2']." / ".$date['1']; }else if ($dateform=='6'){ $date=explode("|",$post['pdate']); $day=$date['3'];$date = $date['2']." / ".$date['1']; }else if ($dateform=='0'){ $date = ""; } $insert = str_replace("<-PostDate->", "$date", $insert); /***************************** POST TIME ******************************/ if($post['fdate']){ $time = date("G:i",$post['fdate']); }else{ $time=explode("|",$post['ptime']); if ($timeform=='1'){ $time=$time['0'].":".$time['1']; }else if ($timeform=='2'){ $h=$time['0'];$m=$time['1']; if($h>12){$time=($time['0']-12).":".$time['1']." بعد از ظهر";}else{$time=$time['0'].":".$time['1']." قبل از ظهر";} }else if ($timeform=='3'){ $h=$time['0'];$m=$time['1'];echo $h; if($h>12){$time=($time['0']-12).":".$time['1']." PM";}else{$time=$time['0'].":".$time['1']." AM";} }else if ($timeform=='4'){ $time=$time['0']; }else if ($timeform=='5'){ $h=$time['0'];$m=$time['1']; if($h>12){$time=($time['0']-12)." بعد از ظهر";}else{$time=$time['0']." قبل از ظهر";} }else if ($timeform=='6'){ $h=$time['0'];$m=$time['1']; if($h>12){$time=($time['0']-12)." PM";}else{$time=$time['0']." AM";} }else if ($timeform=='0'){ $time=""; } } $insert = str_replace("<-PostTime->", "$time", $insert); $insert = str_replace("<-PostAuthor->", "$pauthor", $insert); ////////////////////////// SPECIAL DEFINE $ptags = $post['ptags']; //////////////// TAGS $insert = preg_replace('//is', '', $insert); $tags = between("", "", $insert); $tinsert = ''; $alltags=explode(",",$ptags); $vll=0; foreach($alltags as $tag){ $tinsert .= $tags; $tinsert = str_replace("<-TagLink->", "/tag/".urlencode(enbug($tag))."", $tinsert); $tinsert = str_replace("<-TagName->", enbug($tag), $tinsert); } $insert = str_replace("".$tags."", $tinsert, $insert); if (!$tinsert){$insert = str_replace("".$tagsblock."", "", $insert);} //////////////////// end tags //$insert = str_replace("<-PostCustomField->", "$post[pcfield]", $insert); $pcfield = $post['pcfield']; $Epcfield = explode(",",$post['pcfield']); for($cf_id=1;$cf_id<$count_pcfield;$cf_id++){ //////////////// CUSTOM FIELD //$cf_id = 1; $postcfiledblock = between("", "", $template); $dcf_id = $cf_id-1; $mm = ''; if($Epcfield[$dcf_id]!=''){ $mm .= $postcfiledblock; $mm = str_replace("<-PostCustomField->", "$Epcfield[$dcf_id]", $postcfiledblock); $insert = str_replace("".$postcfiledblock."", $mm, $insert); }else{ $insert = str_replace("".$postcfiledblock."", "", $insert); } //////////////////// end CUSTOM FIELD } $pcat = $post['pcat']; //////////////// CATEGORIES $postcatal=explode(",",$post['pcat']); $vl=0;$inserto=''; while($postcatal[$vl]){ $postcat = $postcatal[$vl]; $postcata=mysql_fetch_array(mysql_query("select * from cats where id='$postcat' AND weblog='$id'")); if($postcata['perma']==''){ $urlencodepostcata = urlencode($postcata['ctitle']);} else{$urlencodepostcata = urlencode($postcata['perma']);} $urlencodepostcata=enbug($urlencodepostcata); if($cperma[0]!='2'){$inserto.="$postcata[ctitle],";} else{$inserto.="$postcata[ctitle],";} $vl++;} $insert = str_replace("<-PostCategory->", "$inserto", $insert); $insert = str_replace("".$cats."", $catinsert, $insert); if (!$catinsert){$insert = str_replace("".$postcatsblock."", "", $insert);} //////////////////// end categories $allpostsanum--; } } if ($insert == $posts){ $template = str_replace("$posts", "", $template); }else{ $insert = enbug($insert); $template = str_replace($posts, $insert, $template); } //} // ****************************** Start SendComment ****************************** $cats = between("", "", $template); $insert = ""; if($cats AND $p){ if($BPT['pcomment']==2 OR $BPT['pcomment']==3){ $template = str_replace("".$cats."", "", $template); } else{ $comment_username=$_COOKIE['comment_username']; $comment_mail=$_COOKIE['comment_mail']; $comment_web=$_COOKIE['comment_web']; $Commentsb = between("", $cats); $CommentForm="
"; $CommentForm2="
"; $CommentSubmit=""; $CommentPv=" "; $CommentUser=""; $Commentmail=""; $CommentWeb=""; $CommentText=""; $CommentCap=" \"ریست "; $CommentCapInput=""; $CommentSticher="\":)\" \":(\" \";)\" \":D\" \";))\" \":X\" \":?\" \":P\" \":*\" \"=((\" \":O\" \"@};-\" \":B\" \"/:)\" \"=D\" width=\"18\" height=\"18\" style=\"cursor:hand;\" onClick=\"SM('=D>')\"> \":S\""; $insert .= $cats; $insert = str_replace("<-CommentUser->", "$CommentUser", $insert); $insert = str_replace("<-Commentmail->", "$Commentmail", $insert); $insert = str_replace("<-CommentWeb->", "$CommentWeb", $insert); $insert = str_replace("<-CommentText->", "$CommentText", $insert); $insert = str_replace("<-CommentSticher->", "$CommentSticher", $insert); $insert = str_replace("<-CommentCap->", "$CommentCap", $insert); $insert = str_replace("<-CommentCapInput->", "$CommentCapInput", $insert); $insert = str_replace("<-CommentPv->", "$CommentPv", $insert); $insert = str_replace("<-CommentSubmit->", "$CommentSubmit", $insert); $insert = str_replace("", "$CommentForm", $insert); $insert = str_replace("", "$CommentForm2", $insert); $template = str_replace("".$cats."", $insert, $template); $template = preg_replace('//is', '', $template); } }else{$template = str_replace("".$cats."", "", $template);} // ****************************** End SendComment ****************************** // ****************************** Start CommentList ****************************** $catslistcomment = between("", "", $template); $insert = ""; if($catslistcomment AND $p){ if($BPT['pcomment']==2){ $template = str_replace("".$catslistcomment."", "", $template); } else{ $adjacents = 3; $limit ='20'; $pcom=$_GET['pcom']; if($pcom) {$start = ($pcom - 1) * $limit;}else{$start = 0;} $allcomments = mysql_query("SELECT ctitle,cmail,cweb,ctext,ctime,cdate FROM bcomments WHERE weblog='$id' AND pid='$p' AND status='1' order by id desc limit $start,$limit"); require_once "jdf.php"; while($comm = mysql_fetch_array($allcomments)) { $insert .= $catslistcomment; $insert = str_replace("<-CommentAuthor->", enbug($comm[ctitle]), $insert); $textcomm=explode("!:iFB",$comm[ctext]);if($textcomm[0]){$Commenttext=$textcomm[0];}else{$Commenttext=$comm[ctext];} if($comm['cweb'] AND $comm['cweb']!=='http://'){ $comm['cweb']=str_replace("http://","",$comm['cweb']); $CommentWeb="$comm[cweb]"; }else {$CommentWeb='';} $listcommtime=explode("/",$comm['ctime']); list( $jyear, $jmonth, $jday ) = gregorian_to_jalali($listcommtime['0'],$listcommtime['1'],$listcommtime['2']); $datei = $jyear."/".$jmonth."/".$jday." ساعت ".$comm[cdate]; $insert = str_replace("<-Commentdate->", "$datei", $insert); $insert = str_replace("<-Commenttext->", enbug($Commenttext), $insert); $insert = str_replace("<-CommentWeb->", "$CommentWeb", $insert); $insert = str_replace("<-CommentAnswer->", enbug($textcomm[1]), $insert); $insert=str_replace('/:)','',$insert); $insert=str_replace(':(','',$insert); $insert=str_replace(';))','',$insert); $insert=str_replace(':D','',$insert); $insert=str_replace(';)','',$insert); $insert=str_replace(':X','',$insert); $insert=str_replace(':?','',$insert); $insert=str_replace(':P','',$insert); $insert=str_replace(':*','',$insert); $insert=str_replace('=((','',$insert); $insert=str_replace(':O','',$insert); $insert=str_replace('@};-','',$insert); $insert=str_replace(':B','',$insert); $insert=str_replace(':)','',$insert); $insert=str_replace('=D>','',$insert); $insert=str_replace(':S','',$insert); } $template = str_replace("".$catslistcomment."", $insert, $template); include ("blogfiles/paginate-comment.php"); } }else{$template = str_replace("".$catslistcomment."", "", $template);} // ****************************** End SendComment ****************************** // ****************************** Start Searchbox ****************************** $searchbox = between("", "", $template); if(!$search2 AND $searchbox){ $insert = ""; $searchsb = between("", $searchbox); if(!$searchsb){ $searchsb = " جستجو "; } $printsearchin=''; $printsearchsu=''; $insert = $searchbox; $insert = str_replace("<-SearchBoxInput->", "$printsearchin", $insert); $insert = str_replace("<-SearchBoxSubmit->", "$printsearchsu", $insert); $template = str_replace("".$searchbox."", $insert, $template); $template = preg_replace('//is', '', $template); } else{$template = str_replace("".$searchbox."", "", $template);} // ****************************** End Searchbox ****************************** // ****************************** Start About ****************************** $cdir="caches/abt/"; $fi='.abt'; $fl=$cdir.$id.$fi; if(!is_file($fl)) {fclose(fopen($fl,"x"));} if(!filesize($fl)){ $fh = fopen($fl, 'w');fwrite($fh,""); fclose($fh); $insert3 .= $qub['mypic'].'<1>'.$qub['aboutme'].'<1>'; $fh = fopen($fl, 'w'); fwrite($fh, $insert3); fclose($fh); }else{ $fh = fopen($fl, 'r+'); if(filesize($fl)){$cts = fread($fh, filesize($fl));}else{$cts=0;} fclose($fh); $insert5=explode("<1>",$cts); $qub = array(); $qub['mypic'] = $insert5[0]; $qub['aboutme'] = enbug($insert5[1]); } if($qub['mypic']){ $template = str_replace("<-BlogPhotoLink->", "http://".$qcb['surl']."/photo/".$qub[mypic], $template); } else{ $bphoto = between("", "", $template); $template = str_replace("".$bphoto."", "", $template); } if($qub['aboutme']){ $template = str_replace("<-BlogAbout->", enbug($qub['aboutme']), $template); } else{ $template = str_replace("<-BlogAbout->", "", $template); } if(!$qub['aboutme'] AND !$qub['mypic']){ $aboutblock = between("", "", $template); $template = str_replace("". $aboutblock."", "", $template); } // ****************************** End About ****************************** // ****************************** Start Polls ****************************** $insert = ""; $cats = between("", "", $template); $submt = between("", $cats); $resl = between("", $cats); if($cats){ if(!$submt){$submt= ' ".$submt." ';} if(!$resl){$submt= ' ".$resl." ';} $allcats = mysql_query("SELECT * FROM polls WHERE weblog='$id' limit 1"); $cat = mysql_fetch_array($allcats); if($cat['ptitle']){ $pitemsa=explode("|",$cat['pitems']); $pitems=""; $oi=0; $loop = between("", "", $cats); $insertt = ''; if($cat['psj']){ $bpitems=""; }else{$bpitems="";} while($pitemsa[$oi]){ $insertt .= $loop; if($cat['psj']){ $pitems="

"; }else{ $pitems="

"; } $insertt = str_replace("<-PollAnswer->", enbug($pitems), $insertt); $oi++; } $insert .= $cats; $insert = str_replace("<-PollQuestion->", enbug($cat[ptitle]), $insert); $insert = str_replace("<-PollSubmit->", "", $insert); $insert = str_replace("<-PollResult->", "", $insert); $template = str_replace("".$cats."", "
$insert
", $template); $template = str_replace("".$loop."", $bpitems.$insertt, $template); } $catsblock = between("", "", $template); if (!$insert){$template = str_replace("". $catsblock."", "", $template);} else{ $template = preg_replace('//is', '', $template); $template = preg_replace('//is', '', $template); } } // ****************************** End Polls ****************************** // ****************************** Start Emails ****************************** $cats = between("", "", $template); if($cats){ if(!$maile){ $insert = ""; $fsize = between("", $cats); $fsizes = between("", $cats); $submt = between("", $cats); $submt2 = between("", $cats); $submts2 = between("", $cats); $submts = between("", $cats); $pitems="
"; $insert .= $cats; $insert = str_replace("<-MailForm->", "$pitems", $insert); $template = str_replace("".$cats."", $insert, $template); $template = preg_replace('//is', '', $template); $template = preg_replace('//is', '', $template); $template = preg_replace('//is', '', $template); $template = preg_replace('//is', '', $template); $template = preg_replace('//is', '', $template); $template = preg_replace('//is', '', $template); } else{$template = str_replace("".$cats."", "", $template);} } // ****************************** End Emails ****************************** // INPUT CATEGORIES $cats = between("", "", $template); $cdir="caches/cats/"; $fi='.cts'; $fl=$cdir.$id.$fi; if(!is_file($fl)) {fclose(fopen($fl,"x"));} if(!filesize($fl)){ $fh = fopen($fl, 'w');fwrite($fh,""); fclose($fh); $allcats = mysql_query("SELECT * FROM cats WHERE weblog='$id' AND status='1' order by ord"); $cccid=0; $insert = ""; $insert2 = ""; while($cat = mysql_fetch_array($allcats)) { $insert .= $cats; $insert = str_replace("<-CategoryName->", enbug($cat[ctitle]), $insert); if($cat['perma']==''){ $urlencodectitle = urlencode($cat['ctitle']); }else{ $urlencodectitle = urlencode($cat['perma']); } $urlencodectitle=enbug($urlencodectitle); if($cperma[0]=='2'){ $insert = str_replace("<-CategoryLink->", "http://$domain/$cpermalinkname/$cat[bid]/$urlencodectitle", $insert); }else{ $insert = str_replace("<-CategoryLink->", "http://$domain/$cpermalinkname/$cat[bid]", $insert); } $insert = str_replace("<-CategoryPosts->", "", $insert); $insert = str_replace("<-CategoryClass->", "cat-item cat-item-$cat[bid]", $insert); if($cperma[0]=='2'){ $insert2 .= $cat['ctitle'] . "<1>http://".$domain."/$cpermalinkname/".$cat['bid']."/$urlencodectitle<1> <1>cat-item cat-item-$cat[bid]<1><3>"; }else{ $insert2 .= $cat['ctitle'] . "<1>http://" . $domain . "/$cpermalinkname/" . $cat['bid'] . "<1> <1>cat-item cat-item-$cat[bid]<1><3>"; } $thiscatidz=$cat['id']; $allcatz = mysql_query("SELECT * FROM cats WHERE weblog='$id' AND status='$thiscatidz' order by ord"); while($catzy = mysql_fetch_array($allcatz)) { $insert .= $cats; $insert = str_replace("<-CategoryName->", enbug($catzy[ctitle]), $insert); if($catzy['perma']==''){ $urlencodecatzyctitle = urlencode($catzy['ctitle']); }else{ $urlencodecatzyctitle = urlencode($catzy['perma']); } $urlencodecatzyctitle=enbug($urlencodecatzyctitle); if($cperma[0]=='2'){ $insert = str_replace("<-CategoryLink->", "http://$domain/$cpermalinkname/$catzy[bid]/$urlencodecatzyctitle", $insert); }else{ $insert = str_replace("<-CategoryLink->", "http://$domain/$cpermalinkname/$catzy[bid]", $insert); } //$pcatvb=$catzy['id'];$pcatvbqa=mysql_query("select id from posts where weblog='$id' AND pcat='$pcatvb'");$pcatnum=0;while($pcatvbqb=mysql_fetch_array($pcatvbqa)){$pcatnum++;} //$pcatvb=$catzy['id'];$pcatnum=mysql_num_rows(mysql_query("select id from posts where weblog='$id' AND pcat='$pcatvb'")); $pcatvb=$catzy['id'];$pcatnum=mysql_fetch_array(mysql_query("select count(id) from posts$ptnum where pcat LIKE '%$pcatvb%' And weblog = '$id' AND fdate <= $fdate AND (status='1' OR status='2')")); $insert = str_replace("<-CategoryPosts->", "($pcatnum[0])", $insert); $insert = str_replace("<-CategoryClass->", "cat-item cat-item-$catzy[bid] children", $insert); if($cperma[0]=='2'){ $insert2 .= $catzy['ctitle'] . "<1>http://".$domain."/$cpermalinkname/" . $catzy['bid'] . "/$urlencodecatzyctitle<1>(" . $pcatnum[0] . ")<1>cat-item cat-item-$catzy[bid] children<1> <3>"; }else{ $insert2 .= $catzy['ctitle'] . "<1>http://".$domain."/$cpermalinkname/" . $catzy['bid'] . "<1>(" . $pcatnum[0] . ")<1>cat-item cat-item-$catzy[bid] children<1> <3>"; } } } $insert2 = $insert2.'<4>'; $fh = fopen($fl, 'w'); fwrite($fh, $insert2); fclose($fh); }else{ $fh = fopen($fl, 'r+'); if(filesize($fl)){$cts = fread($fh, filesize($fl));}else{$cts=0;} fclose($fh); $grtz=explode("<4>",$cts); $insert3=$grtz[0]; $insert4=explode("<3>",$insert3); $insert5=0; $insert = ""; while($insert4[$insert5]){ $insert6=explode("<1>",$insert4[$insert5]); $insert .= $cats; $insert = str_replace("<-CategoryName->", enbug($insert6[0]), $insert); $insert = str_replace("<-CategoryLink->", enbug($insert6[1]), $insert); $insert = str_replace("<-CategoryPosts->", enbug($insert6[2]), $insert); $insert = str_replace("<-CategoryClass->", enbug($insert6[3]), $insert); $insert5++; } } $template = str_replace("".$cats."", $insert, $template); $catsblock = between("", "", $template); if (!$insert){$template = str_replace("". $catsblock."", "", $template);} ////////////////////// end // INPUT EXTRAPAGES BLOCK $links = between("", "", $template); $cdir="caches/expg/"; $fi='.pg'; $fl=$cdir.$id.$fi; if(!is_file($fl)) {fclose(fopen($fl,"x"));} if(!filesize($fl)){ $fh = fopen($fl, 'w');fwrite($fh,""); fclose($fh); $insert = "";$insert2 = ""; $allinks = mysql_query("SELECT bid,ptitle,pna FROM pages WHERE weblog='$id' order by id"); while($link = mysql_fetch_array($allinks)) { $insert .= $links; $insert = str_replace("<-ExtraPageId->", enbug($link[bid]), $insert); $insert = str_replace("<-ExtraPageUrl->", "http://$domain/extrapage/$link[pna]", $insert); $insert = str_replace("<-ExtraPageTitle->", enbug($link[ptitle]), $insert); $insert2 .= "$link[ptitle]<1>http://$domain/extrapage/$link[pna]<1>$link[bid]<1><3>"; } $insert2 = $insert2.'<4>'; $fh = fopen($fl, 'w'); fwrite($fh, $insert2); fclose($fh); }else{ $fh = fopen($fl, 'r+'); if(filesize($fl)){$cts = fread($fh, filesize($fl));}else{$cts=0;} fclose($fh); $grtz=explode("<4>",$cts); $insert3=$grtz[0]; $insert4=explode("<3>",$insert3); $insert5=0; $insert = ""; while($insert4[$insert5]){ $insert6=explode("<1>",$insert4[$insert5]); $insert .= $links; $insert = str_replace("<-ExtraPageTitle->", enbug($insert6[0]), $insert); $insert = str_replace("<-ExtraPageUrl->", enbug($insert6[1]), $insert); $insert = str_replace("<-ExtraPageId->", enbug($insert6[2]), $insert); $insert5++; } } $template = str_replace("".$links."", $insert, $template); $linksblock = between("", "", $template); if (!$insert){$template = str_replace("". $linksblock."", "", $template);} ////////////////////// end // ****************************** Start Login ****************************** $fastlogin = between("", "", $template); if($fastlogin){ $insert = ""; $insert .= $fastlogin; $insert = str_replace('', '
', $insert); $insert = str_replace('', '
', $insert); $insert = str_replace('<-SignInBlock-UserName->', '', $insert); $insert = str_replace('<-SignInBlock-Password->', '', $insert); $insert = str_replace('<-SignInBlock-Button->', '', $insert); if($_SESSION['do_login_ok']!="mk45913722fghjkt21"){ $template = str_replace("".$fastlogin."", $insert, $template); } else{ $template = str_replace("".$fastlogin."", "", $template); } } // ****************************** End Login ****************************** // ****************************** Start Panel ****************************** $memblk = between("", "", $template); if($memblk){ $insert = ""; $insert .= $memblk; $insert = str_replace('<-Member-Name->', $_SESSION["usern"], $insert); $insert = str_replace('<-Member-UserName->', $_SESSION["bloguser"], $insert); if($_SESSION['do_login_ok']=="mk45913722fghjkt21"){ $template = str_replace("".$memblk."", $insert, $template); }else{ $template = str_replace("".$memblk."", "", $template); } } // ****************************** End Panel ****************************** // ****************************** Start Links ****************************** $links = between("", "", $template); if($links){ $cdir="caches/links/"; $fi='.lnk'; $fl=$cdir.$id.$fi; if(!is_file($fl)) {fclose(fopen($fl,"x"));} if(!filesize($fl)){ $fh = fopen($fl, 'w');fwrite($fh,""); fclose($fh); $insert = "";$insert2 = ""; $allinks = mysql_query("SELECT * FROM links WHERE weblog='$id' and status = '1' order by ord desc , id desc limit $lnum"); while($link = mysql_fetch_array($allinks)) { $insert .= $links; $insert = str_replace("<-LinkDescription->", enbug($link[ldesc]), $insert); $insert = str_replace("<-LinkUrl->", enbug($link[lweb]), $insert); $insert = str_replace("<-LinkTitle->", enbug($link[ltitle]), $insert); $insert2 .= "$link[ltitle]<1>$link[lweb]<1>$link[ldesc]<1>$link[lclix]<1><3>"; } $insert2 = $insert2.'<4>'; $fh = fopen($fl, 'w'); fwrite($fh, $insert2); fclose($fh); } else{ $fh = fopen($fl, 'r+'); if(filesize($fl)){$cts = fread($fh, filesize($fl));}else{$cts=0;} fclose($fh); $grtz=explode("<4>",$cts); $insert3=$grtz[0]; $insert4=explode("<3>",$insert3); $insert5=0; $insert = ""; while($insert4[$insert5]){ $insert6=explode("<1>",$insert4[$insert5]); $insert .= $links; $insert = str_replace("<-LinkTitle->", enbug($insert6[0]), $insert); $insert = str_replace("<-LinkUrl->", enbug($insert6[1]), $insert); $insert = str_replace("<-LinkDescription->", enbug($insert6[2]), $insert); $insert5++; } $insert = str_replace('blogfa.com"', 'blogfa.com" rel="nofollow"', $insert); $insert = str_replace('blogfa.com/"', 'blogfa.com/" rel="nofollow"', $insert); } $template = str_replace("".$links."", $insert, $template); } if (!$insert){ $linksblock = between("", "", $template); $template = str_replace("". $linksblock."", "", $template); } // ****************************** End Links ****************************** // ****************************** Start Daylly Links ****************************** $links = between("", "", $template); if($links){ $template = preg_replace('//is', '', $template); $cdir="caches/dlinks/"; $fi='.lnk'; $fl=$cdir.$id.$fi; if(!is_file($fl)) {fclose(fopen($fl,"x"));} if(!filesize($fl)){ $fh = fopen($fl, 'w');fwrite($fh,""); fclose($fh); $allinks = mysql_query("SELECT id,weblog,ldesc,lweb,ltitle,lclix FROM dlinks WHERE weblog='$id' order by ord desc , id desc limit $dlnum"); $insert = ""; $insert2 = ""; while($link = mysql_fetch_array($allinks)) { $insert .= $links; $insert = str_replace("<-LinkDescription->", enbug($link[ldesc]), $insert); $insert = str_replace('<-LinkUrl->', 'http://'.$domain.'/gotolink/'.str_replace('http://','',$link[lweb].'" rel="nofollow'), $insert); $insert = str_replace("<-LinkTitle->", enbug($link[ltitle]), $insert); $insert = str_replace("<-LinkClicks->", enbug($link[lclix]), $insert); $insert2 .= "$link[ltitle]<1>http://$domain/gotolink/".str_replace('http://','',$link['lweb'])."<1>$link[ldesc]<1>$link[lclix]<1><3>"; } $insert2 = $insert2.'<4>'; $fh = fopen($fl, 'w'); fwrite($fh, $insert2); fclose($fh); } else{ $fh = fopen($fl, 'r+'); if(filesize($fl)){$cts = fread($fh, filesize($fl));}else{$cts=0;} fclose($fh); $grtz=explode("<4>",$cts); $insert3=$grtz[0]; $insert4=explode("<3>",$insert3); $insert5=0; $insert = ""; while($insert4[$insert5]){ $insert6=explode("<1>",$insert4[$insert5]); $insert .= $links; $insert = str_replace("<-LinkTitle->", enbug($insert6[0]), $insert); $insert = str_replace("<-LinkUrl->", enbug($insert6[1]), $insert); $insert = str_replace("<-LinkDescription->", enbug($insert6[2]), $insert); $insert = str_replace("<-LinkClicks->", enbug($insert6[3]), $insert); $insert5++; } //$insert = str_replace('href', 'rel="nofollow" href="http://',$domain.'"', $insert); } $template = str_replace("".$links."", $insert, $template); } if (!$insert){ $linksblock = between("", "", $template); $template = str_replace("". $linksblock."", "", $template); } // ****************************** End Dally Links ****************************** // ****************************** Start Last Posts ****************************** $insert = ""; $insert2 = ""; $template = preg_replace('//is', '', $template); $template = str_replace("", "", $template); $template = str_replace("", "", $template); $cats = between("", "", $template); if($cats){ $cdir="caches/preitms/"; $fi='.itm'; $fl=$cdir.$id.$fi; if(!is_file($fl)) {fclose(fopen($fl,"x"));} if(!filesize($fl)){ $fh = fopen($fl, 'w');fwrite($fh,""); fclose($fh); $allcats = mysql_query("SELECT id,bid,weblog,ptitle,fdate,status,perma FROM posts$ptnum WHERE weblog='$id' AND fdate <= $fdate AND (status='1' OR status='2') order by id desc limit $lpnum"); while($cat = mysql_fetch_array($allcats)) { if($cat['perma']==''){$urlencodeptitle = urlencode(enbug($cat['ptitle']));} else{$urlencodeptitle = urlencode(enbug($cat['perma']));} if($cat['ptitle']){$cat['ptitle']=$cat['ptitle'];}else{$cat['ptitle']="بدون عنوان";} $insert .= $cats; $insert = str_replace("<-PostTitle->", enbug($cat[ptitle]), $insert); $insert = str_replace("<-PostDate->", enbug($cat[ptitle]), $insert); if($eperma[0]!='2'){ $insert = str_replace("<-PostLink->", "http://$domain/$permalinkname/$cat[bid]", $insert); $insert2 .= $cat['ptitle'] . "<1>http://".$domain."/$permalinkname/".$cat['bid']."<1><3>"; } else{ $insert = str_replace("<-PostLink->", "http://$domain/$permalinkname/$cat[bid]/$urlencodeptitle", $insert); $insert2 .= $cat['ptitle'] . "<1>http://".$domain."/$permalinkname/".$cat['bid']."/".$urlencodeptitle."<1><3>"; } } $insert2 = $insert2.'<4>'; $fh = fopen($fl, 'w'); fwrite($fh, $insert2); fclose($fh); } else{ $fh = fopen($fl, 'r+'); if(filesize($fl)){$cts = fread($fh, filesize($fl));}else{$cts=0;} fclose($fh); $grtz=explode("<4>",$cts); $insert3=$grtz[0]; $insert4=explode("<3>",$insert3); $insert5=0; $insert = ""; while($insert4[$insert5]){ $insert6=explode("<1>",$insert4[$insert5]); $insert .= $cats; $insert = str_replace("<-PostTitle->", enbug($insert6[0]), $insert); $insert = str_replace("<-PostLink->", enbug($insert6[1]), $insert); $insert5++; } } $template = str_replace("".$cats."", $insert, $template); } if (!$insert){ $BlogPreviousblock = between("", "", $template); $template = str_replace("". $BlogPreviousblock."", "", $template); } // ****************************** End Last Posts ****************************** // ****************************** Start Offer Posts ****************************** $insert = ""; $offers = between("", "", $template); if($offers AND $numoffer){ $alloffers = mysql_query("SELECT bid,ptitle,perma FROM posts$ptnum WHERE weblog='$id' AND fdate <= $fdate AND (status='1' OR status='2') AND offer='1' order by id desc limit $numoffer"); while($offer = mysql_fetch_array($alloffers)) { if($offer['perma']==''){$urlencodeptitle = urlencode(enbug($offer['ptitle']));} else{$urlencodeptitle = urlencode(enbug($offer['perma']));} if($offer['ptitle']){$offer['ptitle']=$offer['ptitle'];}else{$offer['ptitle']="بدون عنوان";} $insert .= $offers; $insert = str_replace("<-OfferPostsTitle->", enbug($offer[ptitle]), $insert); if($eperma[0]!='2'){ $insert = str_replace("<-OfferPostsLink->", "http://$domain/$permalinkname/$offer[bid]", $insert); } else{ $insert = str_replace("<-OfferPostsLink->", "http://$domain/$permalinkname/$offer[bid]/$urlencodeptitle", $insert); } } $template = str_replace("".$offers."", $insert, $template); } if (!$insert){ $OfferPostsBlock = between("", "", $template); $template = str_replace("". $OfferPostsBlock."", "", $template); } // ****************************** End Offer Posts ****************************** // ****************************** Start Rand Posts ****************************** $insert = ""; $rands = between("", "", $template); if($rands AND $numrand){ $allrands = mysql_query("SELECT bid,ptitle,perma FROM posts$ptnum WHERE weblog='$id' AND fdate <= $fdate AND (status='1' OR status='2') order by rand() limit $numrand"); while($rand = mysql_fetch_array($allrands)) { if($rand['perma']==''){$urlencodeptitle = urlencode(enbug($rand['ptitle']));} else{$urlencodeptitle = urlencode(enbug($rand['perma']));} if($rand['ptitle']){$rand['ptitle']=$rand['ptitle'];}else{$rand['ptitle']="بدون عنوان";} $insert .= $rands; $insert = str_replace("<-RandPostsTitle->", enbug($rand[ptitle]), $insert); if($eperma[0]!='2'){ $insert = str_replace("<-RandPostsLink->", "http://$domain/$permalinkname/$rand[bid]", $insert); } else{ $insert = str_replace("<-RandPostsLink->", "http://$domain/$permalinkname/$rand[bid]/$urlencodeptitle", $insert); } } $template = str_replace("".$rands."", $insert, $template); } if (!$insert){ $RandPostsBlock = between("", "", $template); $template = str_replace("". $RandPostsBlock."", "", $template); } // ****************************** End Rand Posts ****************************** // ****************************** Start Hit Posts ****************************** $insert = ""; $insert2 = ""; $hites = between("", "", $template); if ($hites AND $numhit){ $cdir="caches/hit/"; $fi='.hit'; $fl=$cdir.$id.$fi; if(!is_file($fl)) {fclose(fopen($fl,"x"));} if(!filesize($fl)){ $fh = fopen($fl, 'w');fwrite($fh,""); fclose($fh); $allhites = mysql_query("SELECT bid,ptitle,phits,perma FROM posts$ptnum WHERE weblog='$id' AND phits>='1' AND fdate <= $fdate AND (status='1' OR status='2') order by phits desc limit $numhit"); while($hit = mysql_fetch_array($allhites)) { if($hit['perma']==''){$urlencodeptitle = urlencode(enbug($hit['ptitle']));} else{$urlencodeptitle = urlencode(enbug($hit['perma']));} if($hite['ptitle']){$hite['ptitle']=$hite['ptitle'];}else{$hite['ptitle']="بدون عنوان";} $insert .= $hites; $insert = str_replace("<-HitPostsTitle->", enbug($hit[ptitle]), $insert); $insert = str_replace("<-HitPostsCount->", "$hit[phits]", $insert); if($eperma[0]!='2'){ $insert = str_replace("<-HitPostsLink->", "http://$domain/$permalinkname/$hit[bid]", $insert); $insert2 .= $hit['ptitle'] . "<1>http://$domain/$permalinkname/$hit[bid]<1>$hit[phits]<1><3>"; } else{ $insert = str_replace("<-HitPostsLink->", "http://$domain/$permalinkname/$hit[bid]/$urlencodeptitle", $insert); $insert2 .= $hit['ptitle'] . "<1>http://$domain/$permalinkname/$hit[bid]/$urlencodeptitle<1>$hit[phits]<1><3>"; } } $insert2 = $insert2.'<4>'; $fh = fopen($fl, 'w'); fwrite($fh, $insert2); fclose($fh); } else{ $fh = fopen($fl, 'r+'); if(filesize($fl)){$cts = fread($fh, filesize($fl));}else{$cts=0;} fclose($fh); $grtz=explode("<4>",$cts); $insert3=$grtz[0]; $insert4=explode("<3>",$insert3); $insert5=0; $insert = ""; while($insert4[$insert5]){ $insert6=explode("<1>",$insert4[$insert5]); $insert .= $hites; $insert = str_replace("<-HitPostsTitle->", enbug($insert6[0]), $insert); $insert = str_replace("<-HitPostsCount->", enbug($insert6[2]), $insert); $insert = str_replace("<-HitPostsLink->", enbug($insert6[1]), $insert); $insert5++; } } $template = str_replace("".$hites."", $insert, $template); } if (!$insert){ $HitPostsBlock = between("", "", $template); $template = str_replace("". $HitPostsBlock."", "", $template); } // ****************************** End Hit Posts ****************************** // ****************************** Start Related Posts ****************************** $insert = ""; $relatedes = between("", "", $template); if($p AND $bonecat AND $relatedes AND $numrelated){ $allrelated = mysql_query("SELECT bid,ptitle,pcat,perma FROM posts$ptnum WHERE weblog='$id' AND bid!='$p' AND FIND_IN_SET('$bonecat', pcat) AND fdate <= $fdate AND (status='1' OR status='2') order by bid desc limit $numrelated"); while($related = mysql_fetch_array($allrelated)) { if($related['perma']==''){$urlencodeptitle = urlencode(enbug($related['ptitle']));} else{$urlencodeptitle = urlencode(enbug($related['perma']));} if($related['ptitle']){$related['ptitle']=$related['ptitle'];}else{$related['ptitle']="بدون عنوان";} $insert .= $relatedes; $insert = str_replace("<-RelatedPostsTitle->", enbug($related[ptitle]), $insert); if($eperma[0]!='2'){ $insert = str_replace("<-RelatedPostsLink->", "http://$domain/$permalinkname/$related[bid]", $insert); } else{ $insert = str_replace("<-RelatedPostsLink->", "http://$domain/$permalinkname/$related[bid]/$urlencodeptitle", $insert); } } $template = str_replace("".$relatedes."", $insert, $template); } if (!$insert){ $RelatedPostsBlock = between("", "", $template); $template = str_replace("". $RelatedPostsBlock."", "", $template); } // ****************************** End Related Posts ****************************** // ****************************** Start Last Comments ****************************** $lastcomm0=$lastcomm[0]; $lastcomm1=$lastcomm[1]; $lastcomm2=$lastcomm[2]; $insert = ""; $insert2 = ""; $comments = between("", "", $template); if($lastcomm0!=on OR !$comments){ $LastCommentsBlock = between("", "", $template); $template = str_replace("".$LastCommentsBlock."", "", $template); } else{ $cdir="caches/lcom/"; $fi='.lc'; $fl=$cdir.$id.$fi; if(!is_file($fl)) {fclose(fopen($fl,"x"));} if(!filesize($fl)){ $fh = fopen($fl, 'w');fwrite($fh,""); fclose($fh); require_once "jdf.php"; $allcomments = mysql_query("SELECT ctitle,ctext,ctime FROM bcomments WHERE weblog='$id' AND status='1' order by id desc limit $lastcomm1"); while($comm = mysql_fetch_array($allcomments)) { $insert .= $comments; $insert = str_replace("<-AuthorComment->", enbug($comm[ctitle]), $insert); $textcomm=enbug($comm[ctext]); $showtextcomm = mb_substr($textcomm,0,$lastcomm2,utf8); $insert = str_replace("<-TextComment->", "$showtextcomm", $insert); $lastcommtime=explode("/",$comm['ctime']); list( $jyear, $jmonth, $jday ) = gregorian_to_jalali($lastcommtime['0'],$lastcommtime['1'],$lastcommtime['2']); $datei = $jyear."/".$jmonth."/".$jday; $insert = str_replace("<-DateComment->", "$datei", $insert); $insert2 .= $comm[ctitle] . "<1>$showtextcomm<1>$datei<1><3>"; } $insert2 = $insert2.'<4>'; $fh = fopen($fl, 'w'); fwrite($fh, $insert2); fclose($fh); } else{ $fh = fopen($fl, 'r+'); if(filesize($fl)){$cts = fread($fh, filesize($fl));}else{$cts=0;} fclose($fh); $grtz=explode("<4>",$cts); $insert3=$grtz[0]; $insert4=explode("<3>",$insert3); $insert5=0; $insert = ""; while($insert4[$insert5]){ $insert6=explode("<1>",$insert4[$insert5]); $insert .= $comments; $insert = str_replace("<-AuthorComment->", enbug($insert6[0]), $insert); $insert = str_replace("<-TextComment->", enbug($insert6[1]), $insert); $insert = str_replace("<-DateComment->", enbug($insert6[2]), $insert); $insert5++; } } $insert = str_replace("!:iFB", "
پاسخ: ", $insert); $insert=str_replace('/:)','',$insert); $insert=str_replace(':(','',$insert); $insert=str_replace(';))','',$insert); $insert=str_replace(':D','',$insert); $insert=str_replace(';)','',$insert); $insert=str_replace(':X','',$insert); $insert=str_replace(':?','',$insert); $insert=str_replace(':P','',$insert); $insert=str_replace(':*','',$insert); $insert=str_replace('=((','',$insert); $insert=str_replace(':O','',$insert); $insert=str_replace('@};-','',$insert); $insert=str_replace(':B','',$insert); $insert=str_replace(':)','',$insert); $insert=str_replace('=D>','',$insert); $insert=str_replace(':S','',$insert); $template = str_replace("".$comments."", $insert, $template); } if (!$insert){ $LastCommentsBlock = between("", "", $template); $template = str_replace("".$LastCommentsBlock."", "", $template); } // ****************************** End Last Comments ****************************** // ****************************** Start Last Pics ****************************** $insert = ""; $insert2 = ""; $showpic0=$showpic[0]; $lastpicitem = between("", "", $template); if(!$showpic OR $showpic0=='0' OR !$lastpicitem){ $lastpicblock = between("", "", $template); $template = str_replace("".$lastpicblock."", "", $template); } else{ $cdir="caches/lpic/"; $fi='.lp'; $fl=$cdir.$id.$fi; if(!is_file($fl)) {fclose(fopen($fl,"x"));} if(!filesize($fl)){ $fh = fopen($fl, 'w');fwrite($fh,""); fclose($fh); $allpics = mysql_query("SELECT bid,ptitle,perma,pphoto FROM posts$ptnum WHERE weblog='$id' AND fdate <= $fdate AND (status='1' OR status='2') AND pphoto!='' order by bid desc limit $showpic0"); while($lastpic = mysql_fetch_array($allpics)) { if($lastpic['perma']==''){$urlencodeptitle = urlencode(enbug($lastpic['ptitle']));} else{$urlencodeptitle = urlencode(enbug($lastpic['perma']));} $insert .= $lastpicitem; $insert = str_replace("<-LastPicTitle->", enbug($lastpic[ptitle]), $insert); $insert = str_replace("<-LastPicUrl->", enbug($lastpic[pphoto]), $insert); if($eperma[0]!='2'){ $insert = str_replace("<-PostUrl->", "http://$domain/$permalinkname/$lastpic[bid]", $insert); $insert2 .= $lastpic['ptitle'] . "<1>http://$domain/$permalinkname/$lastpic[bid]<1>$lastpic[pphoto]<1><3>"; } else{ $insert = str_replace("<-PostUrl->", "http://$domain/$permalinkname/$lastpic[bid]/$urlencodeptitle", $insert); $insert2 .= $lastpic['ptitle'] . "<1>http://$domain/$permalinkname/$lastpic[bid]/$urlencodeptitle<1>$lastpic[pphoto]<1><3>"; } } $insert2 = $insert2.'<4>'; $fh = fopen($fl, 'w'); fwrite($fh, $insert2); fclose($fh); } else{ $fh = fopen($fl, 'r+'); if(filesize($fl)){$cts = fread($fh, filesize($fl));}else{$cts=0;} fclose($fh); $grtz=explode("<4>",$cts); $insert3=$grtz[0]; $insert4=explode("<3>",$insert3); $insert5=0; $insert = ""; while($insert4[$insert5]){ $insert6=explode("<1>",$insert4[$insert5]); $insert .= $lastpicitem; $insert = str_replace("<-LastPicTitle->", enbug($insert6[0]), $insert); $insert = str_replace("<-LastPicUrl->", enbug($insert6[2]), $insert); $insert = str_replace("<-PostUrl->", enbug($insert6[1]), $insert); $insert5++; } } $template = str_replace("".$lastpicitem."", $insert, $template); } if (!$insert){ $lastpicblock = between("", "", $template); $template = str_replace("".$lastpicblock."", "", $template); } // ****************************** End Last Pics ****************************** // ****************************** Start Rand Pics ****************************** $insert = ""; $insert2 = ""; $showpic1=$showpic[1]; $randpicitem = between("", "", $template); if(!$showpic OR $showpic1=='0' OR !$randpicitem){ $randpicblock = between("", "", $template); $template = str_replace("".$randpicblock."", "", $template); } else{ $allpics = mysql_query("SELECT bid,ptitle,perma,pphoto FROM posts$ptnum WHERE weblog='$id' AND fdate <= $fdate AND (status='1' OR status='2') AND pphoto!='' order by rand() limit $showpic1"); while($randpic = @mysql_fetch_array($allpics)) { if($randpic['perma']==''){$urlencodeptitle = urlencode(enbug($randpic['ptitle']));} else{$urlencodeptitle = urlencode(enbug($randpic['perma']));} $insert .= $randpicitem; $insert = str_replace("<-RandPicTitle->", enbug($randpic[ptitle]), $insert); $insert = str_replace("<-RandPicUrl->", enbug($randpic[pphoto]), $insert); if($eperma[0]!='2'){ $insert = str_replace("<-PostUrl->", "http://$domain/$permalinkname/$randpic[bid]", $insert); } else{ $insert = str_replace("<-PostUrl->", "http://$domain/$permalinkname/$randpic[bid]/$urlencodeptitle", $insert); } } $template = str_replace("".$randpicitem."", $insert, $template); } if (!$insert){ $randpicblock = between("", "", $template); $template = str_replace("".$randpicblock."", "", $template); } // ****************************** End Rand Pics ****************************** // ****************************** Start Slider ****************************** $insert = ""; $slideblock = between("", "", $template); $slideitem = between("", "", $slideblock); if ($slideblock AND $slider){ $allslides = mysql_query("SELECT * FROM slider WHERE weblog='$id' order by id desc"); while($slided = mysql_fetch_array($allslides)) { $insert .= $slideitem; $insert = str_replace('<-SlideImg->', enbug($slided[photo]), $insert); if($slided[link]){$insert = str_replace('<-SlideLink->', enbug($slided[link]), $insert);}else{$insert = str_replace('<-SlideLink->', '#', $insert);} if($slided[rell]=='1'){$insert = str_replace('<-SlideRell->', 'rel="nofollow"', $insert);}else{$insert = str_replace('<-SlideRell->', '', $insert);} } $template = str_replace("". $slideitem."", $insert, $template); } if (!$insert){ $template = str_replace("". $slideblock."", "", $template); } // ****************************** Start Slider ****************************** // ****************************** Start Archives ****************************** $insert = ''; $insert2 = ''; $cats=''; $cats = between("", "", $template); $cdir="caches/arch/"; $fi='.ar'; $fl=$cdir.$id.$fi; if(!is_file($fl)) {fclose(fopen($fl,"x"));} if(!filesize($fl)){ $fh = fopen($fl, 'w');fwrite($fh,""); fclose($fh); if($cats){ $allcats = mysql_query("SELECT weblog,pdate as a,count(*) FROM posts$ptnum WHERE weblog='$id' AND fdate <= $fdate AND (status='1' OR status='2') group by a order by id desc"); if($qub['archiveform']=='3'){require_once "jdf.php";} $cdti=array(); $i=0; while($cat = mysql_fetch_array($allcats)) { $week = Array ("يکشنبه", "دوشنبه", "سه شنبه", "چهارشنبه", "پنجشنبه", "جمعه", "شنبه"); $months = Array ("فروردين", "ارديبهشت", "خرداد", "تير", "مرداد", "شهريور", "مهر", "آبان", "آذر", "دی", "بهمن", "اسفند"); $date=explode("|",$cat[1]); $day=$date['3']; $mon=$date['1']; if($qubarchivetype=='3'){ if($qub['archiveform']=='2'){$datei = $date['0']."/".$mon."/".$date['2'];} elseif($qub['archiveform']=='3'){list( $jyear, $jmonth, $jday ) = jalali_to_gregorian($date['0'],$date['1'],$date['2']);$datei = $jyear."/".$jmonth."/".$jday;} else{$datei = $week[$day]." ".$date['2']." ".$months[($mon-1)]." ".$date['0'];} $clnk=$date['0'].'/'.$date['1'].'/'.$date['2']; } elseif($qubarchivetype=='2'){ if($qub['archiveform']=='2'){ if($date['1'] <= '6'){$datei = "31/".$mon."/".$date['0']." - 1/".$mon."/".$date['0'];} elseif($date['1'] == '12'){$datei = "29/".$mon."/".$date['0']." - 1/".$mon."/".$date['0'];} else{$datei = "30/".$mon."/".$date['0']." - 1/".$mon."/".$date['0'];} } elseif($qub['archiveform']=='3'){ if($date['1'] <= '6'){list( $jyear0, $jmonth0, $jday0 ) = jalali_to_gregorian($date['0'],$date['1'],"31");} elseif($date['1'] == '12'){list( $jyear0, $jmonth0, $jday0 ) = jalali_to_gregorian($date['0'],$date['1'],"29");} else{list( $jyear0, $jmonth0, $jday0 ) = jalali_to_gregorian($date['0'],$date['1'],"30");} list( $jyear, $jmonth, $jday ) = jalali_to_gregorian($date['0'],$date['1'],"1"); $datei = $jyear0."/".$jmonth0."/".$jday0." - ".$jyear."/".$jmonth."/".$jday; } else{$datei = $months[($mon-1)]." ".$date['0'];} $clnk = $date['0']."/".$mon; } else{ if($qub['archiveform']=='2'){$datei = ($date['0']+1)." - ".$date['0'];} elseif($qub['archiveform']=='3'){list( $jyear, $jmonth, $jday ) = jalali_to_gregorian($date['0'],$date['1'],$date['2']);$datei = ($jyear+1)." - ".$jyear;} else{$datei = $date['0'];} $clnk = $date['0']; } if(in_array("$clnk", $cdti)){} else{ $insert .= $cats; $insert = str_replace("<-ArchiveTitle->", enbug($datei), $insert); $insert = str_replace("<-ArchiveLink->", "http://$domain/archive/$clnk", $insert); $insert2 .= $datei . "<1>http://$domain/archive/$clnk<1><3>"; $cdti[$i]=$clnk; } $i++; } $insert2 = $insert2.'<4>'; $fh = fopen($fl, 'w'); fwrite($fh, $insert2); fclose($fh); } } else{ $fh = fopen($fl, 'r+'); if(filesize($fl)){$cts = fread($fh, filesize($fl));}else{$cts=0;} fclose($fh); $grtz=explode("<4>",$cts); $insert3=$grtz[0]; $insert4=explode("<3>",$insert3); $insert5=0; $insert = ""; while($insert4[$insert5]){ $insert6=explode("<1>",$insert4[$insert5]); $insert .= $cats; $insert = str_replace("<-ArchiveTitle->", enbug($insert6[0]), $insert); $insert = str_replace("<-ArchiveLink->", enbug($insert6[1]), $insert); $insert5++; } $template = str_replace("".$cats."", $insert, $template); if (!$insert){ $template = str_replace("". $cats."", "", $template);} } // ****************************** End Archives ****************************** // ****************************** Start Counter ****************************** $cdir="caches/cnts/"; $fi='.cnt'; $fl=$cdir.$id.'-comments'.$fi; if(!is_file($fl)) {fclose(fopen($fl,"x"));} if(!filesize($fl)){ $fh = fopen($fl, 'w');fwrite($fh,""); fclose($fh); $blogcomms=(int)mysql_num_rows(mysql_query("select id from bcomments where weblog='$id'")); $fh = fopen($fl, 'w'); fwrite($fh, $blogcomms); fclose($fh); }else{ $fh = fopen($fl, 'r+'); if(filesize($fl)){$blogcomms = fread($fh, filesize($fl));}else{$cts=0;} fclose($fh); } $cdir="caches/cnts/"; $fi='.cnt'; $fl=$cdir.$id.'-posts'.$fi; if(!is_file($fl)) {fclose(fopen($fl,"x"));} if(!filesize($fl)){ $fh = fopen($fl, 'w');fwrite($fh,""); fclose($fh); $blogposts=(int)mysql_num_rows(mysql_query("select id from posts$ptnum where weblog='$id' AND fdate <= $fdate AND (status='1' OR status='2')")); $fh = fopen($fl, 'w'); fwrite($fh, $blogposts); fclose($fh); }else{ $fh = fopen($fl, 'r+'); if(filesize($fl)){$blogposts = fread($fh, filesize($fl));}else{$cts=0;} fclose($fh); } $BlogUpdate=mysql_fetch_array(mysql_query("select pdate from posts$ptnum where weblog='$id' AND fdate <= $fdate AND (status='1' OR status='2') order by id desc limit 0,1")); $BlogUpdate=explode("|",$BlogUpdate[pdate]); $BlogUsers=(int)mysql_num_rows(mysql_query("select id from users where blog='$id'")); $template = str_replace("<-Online->", "$online", $template); $template = str_replace("<-Today->", "$day_value", $template); $template = str_replace("<-Yesterday->", "$yesterday_value", $template); $template = str_replace("<-Week->", "$week_value", $template); $template = str_replace("<-Month->", "$month_value", $template); $template = str_replace("<-Year->", "$year_value", $template); $template = str_replace("<-All->", "$all_value", $template); $template = str_replace("<-TodayGoogleEntrance->", "$tgoogle", $template); $template = str_replace("<-YesterdayGoogleEntrance->", "$ygoogle", $template); $template = str_replace("<-BlogPosts->", "$blogposts", $template); $template = str_replace("<-BlogComments->", "$blogcomms", $template); $template = str_replace("<-BlogUpdate->", "$BlogUpdate[0]/$BlogUpdate[1]/$BlogUpdate[2]", $template); $template = str_replace("<-BlogUsers->", "$BlogUsers", $template); //include("blogfiles/rank.php"); $template = str_replace("<-GoogleRankText->", "0", $template); $template = str_replace("<-GoogleRankGraphic->", "PageRank 0 out of 10", $template); // ****************************** End Counter ****************************** // ****************************** Start Mobile ****************************** $template = str_replace("<-BlogViewMobile->", "http://".$domain."/m", $template); $template = str_replace("<-Mobile->", "http://".$domain."/m", $template); // ****************************** End Mobile ****************************** // ****************************** Start Authors ****************************** $insert = ""; $insert2 = ""; $users = between("", "", $template); if($users){ $allusers = mysql_query("SELECT flname,usern FROM users WHERE blog='$id' and lev='0' order by id"); while($user = mysql_fetch_array($allusers)) { $insert .= $users; $insert = str_replace("<-AuthorName->", enbug($user[flname]), $insert); $insert = str_replace("<-AuthorLink->", "http://$domain/user-$user[usern].php", $insert); $iposts=mysql_query("select id from posts$ptnum where weblog='$id' AND usern='$user[usern]' AND fdate <= $fdate AND (status='1' OR status='2')"); $niposts=mysql_num_rows($iposts); $insert = str_replace("<-AuthorPosts->", "$niposts", $insert); } if($insert){ $insert2 = $users; $insert2 = str_replace("<-AuthorName->", enbug($authorblog), $insert2); $insert2 = str_replace("<-AuthorLink->", "http://$domain/user-admin.php", $insert2); $iposts2=mysql_query("select id from posts$ptnum where weblog='$id' AND usern='$id' AND fdate <= $fdate AND (status='1' OR status='2')"); $niposts2=mysql_num_rows($iposts2); $insert2 = str_replace("<-AuthorPosts->", "$niposts2", $insert2); $insert = $insert2 . $insert; } $template = str_replace("".$users."", $insert, $template); } if(!$insert){ $authorsblock = between("", "", $template); $template = str_replace("". $authorsblock ."", "", $template); } // ****************************** End Authors ****************************** // ****************************** Start BlogLinkAuto ****************************** $cats = between("", "", $template); if($cats AND $tabadol){ $insert = ""; $submt = between("", $cats); $LinkAutoTitle=""; $LinkAutoLink=""; $LinkAutoCap=" \"ریست "; $LinkAutoCapInput=""; $LinkAutoSubmit=""; $BlogLinkAutoForm="
"; $BlogLinkAutoForm2="
"; $insert .= $cats; $insert = str_replace("<-LinkAutoTitle->", "$LinkAutoTitle", $insert); $insert = str_replace("<-LinkAutoLink->", "$LinkAutoLink", $insert); $insert = str_replace("<-LinkAutoCap->", "$LinkAutoCap", $insert); $insert = str_replace("<-LinkAutoCapInput->", "$LinkAutoCapInput", $insert); $insert = str_replace("<-LinkAutoSubmit->", "$LinkAutoSubmit", $insert); $insert = str_replace("", "$BlogLinkAutoForm", $insert); $insert = str_replace("", "$BlogLinkAutoForm2", $insert); $template = str_replace("".$cats."", $insert, $template); $template = preg_replace('//is', '', $template); } else{$template = str_replace("".$cats."", "", $template);} // ****************************** End BlogLinkAuto ****************************** // ****************************** Start Pages ****************************** $users = between("", "", $template); if($pat){$ppasv='/'.$cpermalinkname.'/'.$catz;} else if($tat){ $archivex = str_replace("|","/",$archivex); $archivex = str_replace("/page/$pz","",$archivex); $ppasv='/archive/'.$archivex; }else if($searchz){ $nsearchz = str_replace("/page/$pz","",$nsearchz); $ppasv='/search/'.$nsearchz; } else if($ntag){ $nntag = str_replace("/page/$pz","",$nntag); $ppasv='/tag/'.$nntag; } else if($upz){ $upz=urldecode(substr($rs,6)); $upz=str_replace(".php","",$upz); $upz = explode("/",$upz); $upz = $upz[0]; $ppasv='/user-'.$upz;} elseif($pageposts){ $ppasv='/posts'; } else{$ppasv='';} if ($b OR (!$catslistcomment AND $p) OR $postz OR $register or $Login or $Edit_Profile or $forget){$template = str_replace("". $users ."", "", $template);} else{ $totalinks = @mysql_num_rows($allpostz); if ($pz == 0) $pz = 1; $prev = $pz - 1; $next = $pz + 1; $lastpage = @ ceil($totalinks/$limit); $lpm1 = $lastpage - 1; $pagination = ''; if($lastpage > 1) { $pagination .= ''; } $pages = $pagination; //if (!$pages OR $b OR $p OR $archivez OR $postz OR $profilez){$template = str_replace("". $users ."", "", $template); $template = str_replace("". $users ."", $pages, $template); } $template = str_replace("".$contactt."", "", $template); $template = str_replace("<-Contact_Us->", "/contact", $template); $template=str_replace('','',$template); $template = str_replace('', '', $template); $template = str_replace('', '', $template); $template = str_replace('', '', $template); $template = str_replace('', '', $template); $template = str_replace('', '', $template); $template = str_replace("".$registerr."", "", $template); $template = str_replace("".$loginr."", "", $template); $template = str_replace("".$forgetr."", "", $template); $template = str_replace("".$editr."", "", $template); $template = str_replace("".$newpostr."", "", $template); $template = str_replace('', '', $template); $template = str_replace('', '', $template); $template = str_replace('', '', $template); $template = str_replace('', '', $template); $template = str_replace('', '', $template); $template = str_replace('', '', $template); $template = str_replace('', '', $template); $template = str_replace('', '', $template); $template = str_replace('', '', $template); $template = str_replace('', '', $template); $template = str_replace('', '', $template); $template = str_replace('', '', $template); $template = str_replace('', '', $template); $template = str_replace('', '', $template); $template = str_replace('', '', $template); $template = str_replace('', '', $template); $template = str_replace('', '', $template); $template = str_replace('', '', $template); $template = str_replace('', '', $template); $template = str_replace('', '', $template); $template = str_replace('', '', $template); $template = str_replace('', '', $template); $template = str_replace('', '', $template); $template = str_replace('', '', $template); $template = str_replace('', '', $template); $template = str_replace('', '', $template); $template = str_replace('', '', $template); $template = str_replace('', '', $template); $template = str_replace('', '', $template); $template = str_replace('', '', $template); $template = str_replace('', '', $template); $template = str_replace('', '', $template); $template = str_replace('', '', $template); $template = str_replace('', '', $template); $template = str_replace('', '', $template); $template = str_replace('', '', $template); $template = str_replace('', '', $template); $template = str_replace('', '', $template); $template = str_replace('', '', $template); $template = str_replace('', '', $template); $template = str_replace('', '', $template); $template = str_replace('', '', $template); $template = str_replace('', '', $template); $template = str_replace('', '', $template); $template = str_replace('', '', $template); $template = str_replace('', '', $template); $mobile_agents = '!(tablet|pad|mobile|phone|symbian|android|ipod|ios|blackberry|webos)!i'; if (preg_match($mobile_agents, $_SERVER['HTTP_USER_AGENT'])) { $template = str_replace('', '', $template); } $template = str_replace('www.avablog.ir', 'avablog.ir', $template); $template = str_replace('strUrl="/comments/', 'strUrl="http://avablog.ir/commenting/', $template); /**************** END ***************/ // ADS in WEBLOGz ?> $ckdads[ads]){ $adfdate=$fdate-518400; $classads=rand(10000,90000); $adslist = mysql_query("SELECT address,title FROM adslist WHERE place='blogs' AND fdate>='$adfdate'"); ?>