MyBB Community Forums

Full Version: Paypal plugin rebuild
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,

I know that there is a nice plug-in for 1.6 for Paypal, but I want to fix this older plug-in from Mybb 1.2 that I have been using.

I have everything working accept this one part:

if($mybb->settings['mypaypal_verified'] == "yes")
{
$verified = "<a href=\"https://www.paypal.com/us/verified/pal={$mybb->settings['mypaypal_mail']}\" target=\"_blank\">Verified?</a>";
}
else
{
$verified = "";
}


It has a yes/no radio button in the admin panel. However, it doesn't work correctly. If I click yes it will not display the link. I checked the database table and it's switching correctly from 0 to a 1. The only way that I can get it to display the verify link is to have the code like this:

if($mybb->settings['mypaypal_verified'] == "yes")
{
$verified = "<a href=\"https://www.paypal.com/us/verified/pal={$mybb->settings['mypaypal_mail']}\" target=\"_blank\">Verified?</a>";
}
else
{
$verified = "<a href=\"https://www.paypal.com/us/verified/pal={$mybb->settings['mypaypal_mail']}\" target=\"_blank\">Verified?</a>";
}

Does anyone know what the problem could be?

I'm assuming it's something with the template part in the code.

This is the array that applies:

$db->insert_query("settings", $new_setting4);

$new_setting6 = array(
'name' => 'mypaypal_verified',
'title' => 'MyPayPal__ Verified',
'description' => 'Show Button So Users Can Check If You Are A Verified PayPal Member.',
'optionscode' => 'yesno',
'value' => 'yes',
'disporder' => '6',
'gid' => intval($gid),
);
Do you want to run this on MyBB 1.6 ?

The code looks fine to me. It would be good if you attach the plugin or paste the entire code here.