Mythotical
11-22-2009, 04:37 AM
Don't know how to keep from coming here. LOL
Here goes, I am trying to get my quote portion to work on the profile block but it won't. It shows the Quotes tab then when you click it you see 2 things, only one should show and I have items in the database that are registered to the account so I'm not sure why its not showing up.
member_build_blocks_start:
$blocklist = array_merge($blocklist, array(
'mybfc_quote' => array(
'class' => 'BFC_Quote',
'title' => 'Quotes',
'hook_location' => 'profile_left_last'
)
));
class vB_ProfileBlock_BFC_Quote extends vB_ProfileBlock
{
var $template_name = 'memberinfo_block_bfc_quote';
function confirm_empty_wrap()
{
return false;
}
function confirm_display()
{
return ($this->block_data['bfc_quote'] != '');
}
function prepare_output($id = '', $options = array())
{
global $vbulletin, $db, $prepared;
$quote_sql = $vbulletin->db->query_read("SELECT * FROM " . TABLE_PREFIX . "bfc_quotes WHERE username = '".$prepared['username']."' ");
$total = $vbulletin->db->num_rows($quote_sql);
require_once(DIR . '/includes/class_bbcode.php');
$parser =& new vB_BbCodeParser($vbulletin, fetch_tag_list());
while($quotes = $vbulletin->db->fetch_array($quote_sql))
{
$uname = $quotes['username'];
$quote_text = $parser->do_parse($quotes['quote'] ,false, true, true, true, true, false);
$quotet = vB_Template::create('bfc_quote_memberbit');
$quotet->register('uname', $uname);
$quotet->register('quote_text', $quote_text);
$templatevalues['quote'] .= $quotet->render();
vB_Template::preRegister('MEMBERINFO', $templatevalues);
}
if (empty($quote))
{
$show = 0;
$this->block_data['bfc_quote'] = 'This user has no submitted quotes.';
}
else
{
$show = 1;
$this->block_data['bfc_quote'] = $quote;
}
}
}
Template bfc_quote_memberbit:
<tr>
<td class="alt1">{vb:var uname}</td>
<td class="alt1">{vb:raw quote_text}</td>
</tr>
Right now I don't want to do anything real technical, I want to get my if condition working in the php form then I will convert to template when the time comes or use a more code friendly means.
Cheers and thanks
Steve
Here goes, I am trying to get my quote portion to work on the profile block but it won't. It shows the Quotes tab then when you click it you see 2 things, only one should show and I have items in the database that are registered to the account so I'm not sure why its not showing up.
member_build_blocks_start:
$blocklist = array_merge($blocklist, array(
'mybfc_quote' => array(
'class' => 'BFC_Quote',
'title' => 'Quotes',
'hook_location' => 'profile_left_last'
)
));
class vB_ProfileBlock_BFC_Quote extends vB_ProfileBlock
{
var $template_name = 'memberinfo_block_bfc_quote';
function confirm_empty_wrap()
{
return false;
}
function confirm_display()
{
return ($this->block_data['bfc_quote'] != '');
}
function prepare_output($id = '', $options = array())
{
global $vbulletin, $db, $prepared;
$quote_sql = $vbulletin->db->query_read("SELECT * FROM " . TABLE_PREFIX . "bfc_quotes WHERE username = '".$prepared['username']."' ");
$total = $vbulletin->db->num_rows($quote_sql);
require_once(DIR . '/includes/class_bbcode.php');
$parser =& new vB_BbCodeParser($vbulletin, fetch_tag_list());
while($quotes = $vbulletin->db->fetch_array($quote_sql))
{
$uname = $quotes['username'];
$quote_text = $parser->do_parse($quotes['quote'] ,false, true, true, true, true, false);
$quotet = vB_Template::create('bfc_quote_memberbit');
$quotet->register('uname', $uname);
$quotet->register('quote_text', $quote_text);
$templatevalues['quote'] .= $quotet->render();
vB_Template::preRegister('MEMBERINFO', $templatevalues);
}
if (empty($quote))
{
$show = 0;
$this->block_data['bfc_quote'] = 'This user has no submitted quotes.';
}
else
{
$show = 1;
$this->block_data['bfc_quote'] = $quote;
}
}
}
Template bfc_quote_memberbit:
<tr>
<td class="alt1">{vb:var uname}</td>
<td class="alt1">{vb:raw quote_text}</td>
</tr>
Right now I don't want to do anything real technical, I want to get my if condition working in the php form then I will convert to template when the time comes or use a more code friendly means.
Cheers and thanks
Steve