View Single Post
  #3076  
Old 12-24-2007, 01:14 AM
nicker nicker is offline
 
Join Date: Nov 2006
Posts: 26
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Replace/edit all of vbshout.php with this for the &quote problem.
Quote:
<?php
/*================================================= =====================*\
|| ################################################## ################## ||
|| # vBShout v2 Created By Zero Tolerance [http://gzevolution.net] ||
|| ################################################## ################## ||
\*================================================ ======================*/

// ---------------------------------------------------
// Start Set PHP Environment
// ---------------------------------------------------

error_reporting(E_ALL & ~E_NOTICE);

// ---------------------------------------------------
// End Set PHP Environment
// ---------------------------------------------------

// ---------------------------------------------------
// Start Define Important Constants
// ---------------------------------------------------

define('NO_REGISTER_GLOBALS', 1);
define('THIS_SCRIPT', 'vbshout');

// ---------------------------------------------------
// End Define Important Constants
// ---------------------------------------------------

// ---------------------------------------------------
// Start Cache Of Any Needed Templates/Phrase's
// ---------------------------------------------------

$phrasegroups = array();

$specialtemplates = array();

$actiontemplates = array(
'archive' => array(
'GENERIC_SHELL',
'forumhome_vbshout_archive_shout',
'forumhome_vbshout_archive',
'forumhome_vbshout_archive_topshouter',
),
);


$globaltemplates = array(
'forumhome_vbshout_shout',
);

// ---------------------------------------------------
// End Cache Of Any Needed Templates/Phrase's
// ---------------------------------------------------



// ---------------------------------------------------
// Start Require Globalized Settings
// ---------------------------------------------------

require_once('./global.php');
require_once(DIR . '/includes/functions_user.php');
require_once(DIR . '/includes/functions_newpost.php');
require_once(DIR . '/includes/class_bbcode.php');


$DB = $db; // What? Its easier to write ^_^;
$vbulletin->vbshout_parse =& new vB_BbCodeParser($vbulletin, fetch_tag_list());

$perpage = $vbulletin->input->clean_gpc('r', 'perpage', TYPE_UINT);
$page = $vbulletin->input->clean_gpc('r', 'pagenumber', TYPE_UINT);

// ---------------------------------------------------
// End Require Globalized Settings
// ---------------------------------------------------

// ---------------------------------------------------
// Start Incorrect Page Navigation Set
// ---------------------------------------------------

// Navigation
$navbits = array();
$navbits[""] = "";

// ---------------------------------------------------
// End Incorrect Page Navigation Set
// ---------------------------------------------------

// ---------------------------------------------------
// Start Does The Page Have An Action Specified?
// ---------------------------------------------------

if ((!$_GET['do'] || $_GET['do'] == '') && !$_POST['do'])
{
$_GET['do'] = 'latest';
}

// ---------------------------------------------------
// End Does The Page Have An Action Specified?
// ---------------------------------------------------


function buildTime($time = TIMENOW)
{
global $vbulletin;

$Time = vbdate($vbulletin->options['dateformat'], $time, $vbulletin->options['yestoday']);
$Time .= ' ';
$Time .= vbdate($vbulletin->options['timeformat'], $time, $vbulletin->options['yestoday']);

return $Time;
}

function bbcodeparser($text = '', $striphtml = true)
{
global $vbulletin;

if ($vbulletin->options['shout_bbcode'])
{
return $vbulletin->vbshout_parse->parse(convert_url_to_bbcode($text), 'nonforum');
}
else
{
return $text;
}

if ($striphtml)
{
$text = htmlspecialchars_uni($text);
}
}

function isBanned($user)
{
return (isBanned_Check($user['userid'], 'shout_banned_users') || isBanned_Check($user['usergroupid'], 'shout_banned_usergroups'));
}

function isBanned_Check($bash, $against)
{
global $vbulletin;
return in_array($bash, iif($vbulletin->options[$against], explode(',', $vbulletin->options[$against]), array()));
}

function canCommand()
{
global $vbulletin;

return $vbulletin->options['shout_can_commnd'] && can_moderate();
}

function execCommand($Command)
{
global $meShout;

if (preg_match_all("#^/pruneshout(.*)$#", $Command, $Matches, PREG_SET_ORDER) && canCommand())
{
return execCommand_pruneshout($Matches);
}
else if (preg_match_all("#^/prune(.*)$#", $Command, $Matches, PREG_SET_ORDER) && canCommand())
{
return execCommand_prune($Matches);
}
else if (preg_match_all("#^/me(.*)$#", $Command, $Matches, PREG_SET_ORDER))
{
$meShout = 1;
return trim($Matches[0][1]);
}

return $Command;
}

function execCommand_pruneshout($Data)
{
global $vbulletin;

$Data = trim($Data[0][1]);

if (!empty($Data))
{
$vbulletin->db->query('delete from '.TABLE_PREFIX.'shout where s_me in(0,1) and s_shout = \''.addslashes($Data).'\' or s_shout = \''.addslashes(fetch_word_wrapped_string($Data)).' \'');
}

return true;
}

function execCommand_prune($Data)
{
global $vbulletin;

$Data = trim($Data[0][1]);

if (empty($Data))
{
$vbulletin->db->query('delete from '.TABLE_PREFIX.'shout');
}
else
{
if ($u = $vbulletin->db->query_first('select userid from '.TABLE_PREFIX.'user where username = \''.addslashes(htmlspecialchars_uni($Data)).'\''))
{
$vbulletin->db->query('delete from '.TABLE_PREFIX.'shout where s_by = \''.intval($u['userid']).'\'');
}
}

return true;
}

// ---------------------------------------------------
// Grab Latest X Shouts
// ---------------------------------------------------

if ($_GET['do'] == 'latest')
{
$Output = array();
$Shouts = $DB->query('
select s.*, u.username, u.usergroupid from '.TABLE_PREFIX.'shout s
left join '.TABLE_PREFIX.'user u on (u.userid = s.s_by)
order by s.sid desc limit ' . $vbulletin->options['shout_display']);

while ($Shout = $DB->fetch_array($Shouts))
{
$Shout['time'] = buildTime($Shout['s_time']);
$Shout['s_shout'] = bbcodeparser($Shout['s_shout']);
$Shout['style'] = '';
$Shout['data'] = unserialize($Shout['s_data']);
$Shout['username'] = fetch_musername($Shout, 'usergroupid');

if ($Shout['data']['color'])
{
$Shout['style'] .= 'color:'.$Shout['data']['color'].';';
}

if ($Shout['data']['font'])
{
$Shout['style'] .= 'font-family:'.$Shout['data']['font'].';';
}

if ($Shout['data']['bold'])
{
$Shout['style'] .= 'font-weight:'.$Shout['data']['bold'].';';
}

if ($Shout['data']['underline'])
{
$Shout['style'] .= 'text-decoration:'.$Shout['data']['underline'].';';
}

if ($Shout['data']['italic'])
{
$Shout['style'] .= 'font-style:'.$Shout['data']['italic'].';';
}

if ($Shout['style'])
{
$Shout['s_shout'] = '<font style="'.$Shout['style'].'">'.$Shout['s_shout'].'</font>';
}

eval('$Output[] .= "' . fetch_template('forumhome_vbshout_shout') . '";');
}

if (isBanned($vbulletin->userinfo) && $vbulletin->options['shout_banned_perms'] > 0)
{
$Output = '';
$Shout = array(
'time' => buildTime(),
'username' => 'System Reponse',
's_shout' => 'You are currently banned from the shoutbox',
);

eval('$Output .= "' . fetch_template('forumhome_vbshout_shout') . '";');
}

if (empty($Output))
{
$Output = '';
$Shout = array(
'time' => buildTime(),
'username' => 'System Reponse',
's_shout' => 'No Current Shouts',
);

eval('$Output .= "' . fetch_template('forumhome_vbshout_shout') . '";');
}
else
{
if ($vbulletin->options['shout_messages_order'])
{
$Output = array_reverse($Output);
}

$Shouts = $Output;
$Output = '';

foreach ($Shouts as $Shout)
{
$Output .= $Shout;
}
}

unset($Shouts, $Shout);

echo $Output;
exit;
}

// ---------------------------------------------------
// End Latest X Shouts
// ---------------------------------------------------

// ---------------------------------------------------
// Shout
// ---------------------------------------------------

if ($_POST['do'] == 'shout')
{
$vbulletin->input->clean_array_gpc('p', array(
'shout' => TYPE_STR,
'color' => TYPE_NOHTML,
'fontFamily' => TYPE_NOHTML,
'fontWeight' => TYPE_NOHTML,
'fontStyle' => TYPE_NOHTML,
'textDecoration' => TYPE_NOHTML,
));

$meShout = 0;

if (!empty($vbulletin->GPC['shout']) && $vbulletin->userinfo['userid'] > 0 && !isBanned($vbulletin->userinfo))
{

$ShoutData = addslashes(serialize(array(
'color' => addslashes(convert_urlencoded_unicode($vbulletin->GPC['color'])),
'font' => addslashes(convert_urlencoded_unicode($vbulletin->GPC['fontFamily'])),
'bold' => addslashes(convert_urlencoded_unicode($vbulletin->GPC['fontWeight'])),
'italic' => addslashes(convert_urlencoded_unicode($vbulletin->GPC['fontStyle'])),
'underline' => addslashes(convert_urlencoded_unicode($vbulletin->GPC['textDecoration'])),
)));

$vbulletin->GPC['shout'] = convert_urlencoded_unicode($vbulletin->GPC['shout']);

if (($vbulletin->GPC['shout'] = execCommand($vbulletin->GPC['shout'])) !== true)
{
$DB->query("
insert into ".TABLE_PREFIX."shout
(s_time, s_by, s_shout, s_data, s_me)
values
(".TIMENOW.", {$vbulletin->userinfo['userid']}, '".addslashes($vbulletin->GPC['shout'])."', '{$ShoutData}', $meShout)
");
}
}

exit;
}

// ---------------------------------------------------
// End Shout
// ---------------------------------------------------

// ---------------------------------------------------
// Display Shout Archive
// ---------------------------------------------------

if ($_GET['do'] == 'archive')
{
$navbits = array("vbshout.php?" . $vbulletin->session->vars['sessionurl'] . "do=archive" => 'Archive');
$navbits[""] = 'Viewing Shoutbox Archive';

$TopTen = '';

$TS = $DB->query_first("select count(*) as `ts` from " . TABLE_PREFIX . "shout");
$TS_D = $TS['ts'];
$TS = vb_number_format($TS['ts']);

$T4 = $DB->query_first("select count(*) as `T4` from " . TABLE_PREFIX . "shout where s_time > " . (TIMENOW - (60 * 60 * 24)));
$T4 = vb_number_format($T4['T4']);

$TY = $DB->query_first("select count(*) as `TY` from " . TABLE_PREFIX . "shout where s_by = '{$vbulletin->userinfo['userid']}'");
$TY = vb_number_format($TY['TY']);

$TT = $DB->query('
select s.*, count(s.sid) as `TS`, u.username, u.usergroupid from '.TABLE_PREFIX.'shout s
left join '.TABLE_PREFIX.'user u on (u.userid = s.s_by)
group by s.s_by having TS > 0
order by TS desc limit 10');

while ($TTS = $DB->fetch_array($TT))
{
$TTS['username'] = fetch_musername($TTS, 'usergroupid');
eval('$TopTen .= "' . fetch_template('forumhome_vbshout_archive_topshout er') . '";');
}

sanitize_pageresults($TS_D, $page, $perpage, 40, 10);

$limitlower = ($page - 1) * $perpage + 1;
if ($limitlower <= 0)
{
$limitlower = 1;
}

$Output = array();
$Shouts = $DB->query('
select s.*, u.username, u.usergroupid from '.TABLE_PREFIX.'shout s
left join '.TABLE_PREFIX.'user u on (u.userid = s.s_by)
order by s.sid desc limit ' . ($limitlower - 1) . ',' . $perpage);

while ($Shout = $DB->fetch_array($Shouts))
{
$Shout['msg_safe'] = $Shout['s_shout'];
$Shout['time'] = buildTime($Shout['s_time']);
$Shout['s_shout'] = bbcodeparser($Shout['s_shout']);
$Shout['style'] = '';
$Shout['data'] = unserialize($Shout['s_data']);
$Shout['username'] = fetch_musername($Shout, 'usergroupid');

if ($Shout['data']['color'])
{
$Shout['style'] .= 'color:'.$Shout['data']['color'].';';
}

if ($Shout['data']['font'])
{
$Shout['style'] .= 'font-family:'.$Shout['data']['font'].';';
}

if ($Shout['data']['bold'])
{
$Shout['style'] .= 'font-weight:'.$Shout['data']['bold'].';';
}

if ($Shout['data']['underline'])
{
$Shout['style'] .= 'text-decoration:'.$Shout['data']['underline'].';';
}

if ($Shout['data']['italic'])
{
$Shout['style'] .= 'font-style:'.$Shout['data']['italic'].';';
}

if ($Shout['style'])
{
$Shout['s_shout'] = '<font style="'.$Shout['style'].'">'.$Shout['s_shout'].'</font>';
}

eval('$Output[] .= "' . fetch_template('forumhome_vbshout_archive_shout') . '";');
}

if (isBanned($vbulletin->userinfo) && $vbulletin->options['shout_banned_perms'] > 0)
{
$Output = '';
$Shout = array(
'time' => buildTime(),
'username' => 'System Reponse',
's_shout' => 'You are currently banned from the shoutbox',
);

eval('$Output .= "' . fetch_template('forumhome_vbshout_archive_shout') . '";');
}

if (empty($Output))
{
$Output = '';
$Shout = array(
'time' => buildTime(),
'username' => 'System Reponse',
's_shout' => 'No Current Shouts',
);

eval('$Output .= "' . fetch_template('forumhome_vbshout_archive_shout') . '";');
}
else
{
$Shouts = $Output;
$Output = '';

foreach ($Shouts as $Shout)
{
$Output .= $Shout;
}
}

unset($Shouts, $Shout);

$pagenav = construct_page_nav($page, $perpage, $TS_D, 'vbshout.php?' . $vbulletin->session->vars['sessionurl'] . 'do=archive', ''
. (!empty($vbulletin->GPC['perpage']) ? "&amp;pp=$perpage" : "")
);

eval('$HTML = "' . fetch_template('forumhome_vbshout_archive') . '";');
}

// ---------------------------------------------------
// Display Shout Archive
// ---------------------------------------------------

// ---------------------------------------------------
// AJAX Edit Shout
// ---------------------------------------------------

if ($_POST['do'] == 'editshout')
{
$vbulletin->input->clean_array_gpc('p', array(
'id' => TYPE_UNIT,
'shout' => TYPE_STR,
));

if (!$Shout = $DB->query_first("select * from " . TABLE_PREFIX . "shout where sid = '{$vbulletin->GPC['id']}'"))
{
echo $vbulletin->GPC['shout'];
exit;
}

if ($Shout['sid'] != $vbulletin->userinfo['userid'] && !can_moderate())
{
echo $vbulletin->GPC['shout'];
exit;
}

$vbulletin->GPC['shout'] = convert_urlencoded_unicode($vbulletin->GPC['shout']);

$DB->query("update " . TABLE_PREFIX . "shout set s_shout = '".addslashes($vbulletin->GPC['shout'])."' where sid = $Shout[sid]");

$Shout = $DB->query_first("select * from " . TABLE_PREFIX . "shout where sid = '{$vbulletin->GPC['id']}'");

$Shout['s_shout'] = bbcodeparser($Shout['s_shout']);
$Shout['style'] = '';
$Shout['data'] = unserialize($Shout['s_data']);

if ($Shout['data']['color'])
{
$Shout['style'] .= 'color:'.$Shout['data']['color'].';';
}

if ($Shout['data']['font'])
{
$Shout['style'] .= 'font-family:'.$Shout['data']['font'].';';
}

if ($Shout['data']['bold'])
{
$Shout['style'] .= 'font-weight:'.$Shout['data']['bold'].';';
}

if ($Shout['data']['underline'])
{
$Shout['style'] .= 'text-decoration:'.$Shout['data']['underline'].';';
}

if ($Shout['data']['italic'])
{
$Shout['style'] .= 'font-style:'.$Shout['data']['italic'].';';
}

if ($Shout['style'])
{
$Shout['s_shout'] = '<font style="'.$Shout['style'].'">'.$Shout['s_shout'].'</font>';
}

echo $Shout['s_shout'];
exit;
}

// ---------------------------------------------------
// AJAX Edit Shout
// ---------------------------------------------------

// ---------------------------------------------------
// AJAX Delete Shout
// ---------------------------------------------------

if ($_POST['do'] == 'deleteshout')
{
$vbulletin->input->clean_array_gpc('p', array(
'id' => TYPE_UNIT,
));

if (!$Shout = $DB->query_first("select * from " . TABLE_PREFIX . "shout where sid = '{$vbulletin->GPC['id']}'"))
{
echo 'false';
exit;
}

if ($Shout['sid'] != $vbulletin->userinfo['userid'] && !can_moderate())
{
echo 'false';
exit;
}

$vbulletin->GPC['shout'] = convert_urlencoded_unicode($vbulletin->GPC['shout']);

$DB->query("delete from " . TABLE_PREFIX . "shout where sid = $Shout[sid]");

echo 'true';
exit;
}

// ---------------------------------------------------
// AJAX Delete Shout
// ---------------------------------------------------

// ---------------------------------------------------
// Start Page Output
// ---------------------------------------------------


$navbits = construct_navbits($navbits);
eval('$navbar = "' . fetch_template('navbar') . '";');
eval('print_output("' . fetch_template('GENERIC_SHELL') . '");');


// ---------------------------------------------------
// End Page Output
// ---------------------------------------------------
?>
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02589 seconds
  • Memory Usage 1,883KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_quote
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete