Ok I did it the way you suggested and I get an error. Honestly I made that back before I knew how to use template hook's.
PHP Code:
$userid = $vbulletin->userinfo['userid'];
if($canaddquote)
{
eval('$template_hook[usercp_navbar_bottom] .= "<tr><td class="thead">Quotes</td></tr><tr><td class="alt2" nowrap="nowrap"><a class="smallfont" href="quote.php?$session[sessionurl]do=addquote&userid=$userid">Add New</a></td></tr>";');
}
Error:
Code:
Parse error: syntax error, unexpected T_STRING in /usercp.php(949) : eval()'d code(4) : eval()'d code on line 1
I tried a few things to change it around but it still wouldn't go away.
Now memberinfo_block_bfc_quote is pulled in another plugin which I will show below.
member_build_blocks_start - BFC-Quote Profile Block
PHP Code:
$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']."' ");
require_once(DIR . '/includes/class_bbcode.php');
$parser =& new vB_BbCodeParser($vbulletin, fetch_tag_list());
while($quotes = $db->fetch_array($quote_sql))
{
$id = $quotes['id'];
$uname = $quotes['username'];
$original = $quotes['original'];
$quote_text = $parser->do_parse($quotes['quote'] ,false, true, true, true, true, false);
eval('$quote .= "' . fetch_template('bfc_quote_memberbit') . '";');
}
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;
}
}
}
If we can figure out the first part of this post then I can probably just use PHP if condition instead of the html if condition to show the delete link.