1. sayfa
if ($_REQUEST['do'] == 'whatever'){ global $vbulletin, $vboptions, $bbuserinfo, $db, $threadid, $postid; $bbuserinfo = $this->registry->userinfo; $postid = $_REQUEST['p']; $hide_call = $_REQUEST['all']; $hide_read = false; $hide_replied = ''; $hide_thanked = ''; $hide_replied = $db->query("SELECT COUNT(postid) AS count FROM ". TABLE_PREFIX . "post WHERE userid='$bbuserinfo[userid]' AND visible = 1 AND threadid='$post[threadid]'"); $myreplies = 0; if($db->num_rows($hide_replied)){ while ($h_post = $db->fetch_array($hide_replied)){ $myreplies += $h_post['count']; } $myreplies = vb_number_format($myreplies); } if($myreplies > 0){ $hide_read = true; } if(!$bbuserinfo[userid]){ $hide_read = false; } if( $hide_read == true){ $hide_post = $db->query_first("SELECT pagetext as 'message' FROM ". TABLE_PREFIX ."post WHERE postid='$postid'"); $hide_string = "#\[hide\](.*)\[\/hide\]#siU"; require_once(DIR . '/includes/class_bbcode.php'); $parser =& new vB_BbCodeParser($vbulletin, fetch_tag_list()); $hide_post['message'] = $parser->do_parse($hide_post['message'],true); if(preg_match_all($hide_string, $hide_post['message'], $hide_match)) { for($i=0; $i<count($hide_match[0]); $i++) { $hide_replace[$i] ="<fieldset>".$hide_match[1][$i]."</fieldset>"; $hide_post['message']= str_replace($hide_match[0][$i],$hide_replace[$i],$hide_post['message']); } } } $ajax_on = true; $output = $hide_post['message']; echo "$output"; exit; }
if ($_REQUEST['do'] == 'whatever'){
global $vbulletin, $vboptions, $bbuserinfo, $db, $threadid, $postid;
$bbuserinfo = $this->registry->userinfo;
$postid = $_REQUEST['p'];
$hide_call = $_REQUEST['all'];
$hide_read = false;
$hide_replied = '';
$hide_thanked = '';
$hide_replied = $db->query("SELECT COUNT(postid) AS count FROM ". TABLE_PREFIX . "post WHERE userid='$bbuserinfo[userid]' AND visible = 1 AND threadid='$post[threadid]'");
$myreplies = 0;
if($db->num_rows($hide_replied)){
while ($h_post = $db->fetch_array($hide_replied)){
$myreplies += $h_post['count'];
}
$myreplies = vb_number_format($myreplies);
}
if($myreplies > 0){
$hide_read = true;
}
if(!$bbuserinfo[userid]){
$hide_read = false;
}
if( $hide_read == true){
$hide_post = $db->query_first("SELECT pagetext as 'message' FROM ". TABLE_PREFIX ."post WHERE postid='$postid'");
$hide_string = "#\[hide\](.*)\[\/hide\]#siU";
require_once(DIR . '/includes/class_bbcode.php');
$parser =& new vB_BbCodeParser($vbulletin, fetch_tag_list());
$hide_post['message'] = $parser->do_parse($hide_post['message'],true);
if(preg_match_all($hide_string, $hide_post['message'], $hide_match)) {
for($i=0; $i<count($hide_match[0]); $i++) {
$hide_replace[$i] ="<fieldset>".$hide_match[1][$i]."</fieldset>";
$hide_post['message']= str_replace($hide_match[0][$i],$hide_replace[$i],$hide_post['message']);
}
}
}
$ajax_on = true;
$output = $hide_post['message'];
echo "$output";
exit;
}
Umut kesmemek lazım :):)