News:

Wondering if this will always be free?  See why free is better.

Main Menu

PaypalDonations

Started by snork13, February 06, 2006, 11:36:58 PM

Previous topic - Next topic

Tanks

hey snork. great mod.. if i could just get it to save the settings lol  :D

Is there any solution to that bug ?

snork13

Quote from: Knat on December 16, 2006, 02:45:48 AM
hey snork. great mod.. if i could just get it to save the settings lol  :D

Is there any solution to that bug ?

are you using 1.1 final?
Mods
Please DO NOT PM me with requests for individual support, but post your questions and concerns in the appropriate section of the forum where other users can benefit from them as well. Thank you.
I have been super busy as of late. Working on updates to all my modifications for 2.0.1

Tanks

Quote from: snork13 on December 18, 2006, 08:43:48 AM
Quote from: Knat on December 16, 2006, 02:45:48 AM
hey snork. great mod.. if i could just get it to save the settings lol  :D

Is there any solution to that bug ?

are you using 1.1 final?

No actually im using RC3 ! Please dont tell me thats a problem because im unable to upgrade  :o

snork13

#143
Quote from: Knat on December 18, 2006, 12:27:44 PM
Quote from: snork13 on December 18, 2006, 08:43:48 AM
Quote from: Knat on December 16, 2006, 02:45:48 AM
hey snork. great mod.. if i could just get it to save the settings lol  :D

Is there any solution to that bug ?

are you using 1.1 final?

No actually im using RC3 ! Please dont tell me thats a problem because im unable to upgrade  :o

so, it would seem the problem is:
In sources/ModSettings.php

find:

'karma' => 'ModifyKarmaSettings',

add after;

'paypal' => 'ModifypayPalSettings',

-snork13
Mods
Please DO NOT PM me with requests for individual support, but post your questions and concerns in the appropriate section of the forum where other users can benefit from them as well. Thank you.
I have been super busy as of late. Working on updates to all my modifications for 2.0.1

Tanks

But thats already in there  :o

$subActions = array(
'basic' => 'ModifyBasicSettings',
'paypal' => 'ModifypayPalSettings',
'layout' => 'ModifyLayoutSettings',
'MemberColorLinks' => 'ModifyMemberColorLinksSettings',
'ThankYou' => 'ModifyThankYouSettings',
'karma' => 'ModifyKarmaSettings',
);


Do you have any idea what else can cause SMF to not save the settings ?

snork13

Quote from: Knat on December 19, 2006, 01:33:59 AM
But thats already in there  :o

$subActions = array(
'basic' => 'ModifyBasicSettings',
'paypal' => 'ModifypayPalSettings',
'layout' => 'ModifyLayoutSettings',
'MemberColorLinks' => 'ModifyMemberColorLinksSettings',
'ThankYou' => 'ModifyThankYouSettings',
'karma' => 'ModifyKarmaSettings',
);


Do you have any idea what else can cause SMF to not save the settings ?

are you looking in the correct area? Search for ''karma' => 'ModifyKarmaSettings'," there is more then one...
Mods
Please DO NOT PM me with requests for individual support, but post your questions and concerns in the appropriate section of the forum where other users can benefit from them as well. Thank you.
I have been super busy as of late. Working on updates to all my modifications for 2.0.1

Tanks

* Knat feels like a complete jerk for not searching for that second one. it works now. Thanks alot  ;)

swampy

I am getting this response with I try to install it on 1.1.1  Any suggestings?

1. Execute Modification ./index.php Test successful
2. Execute Modification ./Sources/ManagePermissions.php Test successful
3. Execute Modification ./Sources/ModSettings.php Test failed
4. Execute Modification ./Themes/default/index.template.php Test successful
5. Execute Modification ./Themes/default/languages/Modifications.english.php Test successful
6. Execute Modification ./Themes/default/languages/ModSettings.english.php Test successful
7. Execute Modification ./Themes/default/languages/Who.english.php Test successful
8. Extract File ./Themes/default/Paypal.template.php 
9. Extract File ./Sources/Paypal.php 
10. Execute Code add_settings.php

snork13

Quote from: swampy on December 19, 2006, 08:24:48 PM
I am getting this response with I try to install it on 1.1.1  Any suggestings?

1. Execute Modification ./index.php Test successful
2. Execute Modification ./Sources/ManagePermissions.php Test successful
3. Execute Modification ./Sources/ModSettings.php Test failed
4. Execute Modification ./Themes/default/index.template.php Test successful
5. Execute Modification ./Themes/default/languages/Modifications.english.php Test successful
6. Execute Modification ./Themes/default/languages/ModSettings.english.php Test successful
7. Execute Modification ./Themes/default/languages/Who.english.php Test successful
8. Extract File ./Themes/default/Paypal.template.php 
9. Extract File ./Sources/Paypal.php 
10. Execute Code add_settings.php


I'm guessing it from another mod you have installed? If you view the modification .xml file it will tell you what to change in Sources/ModSettings.php.
Mods
Please DO NOT PM me with requests for individual support, but post your questions and concerns in the appropriate section of the forum where other users can benefit from them as well. Thank you.
I have been super busy as of late. Working on updates to all my modifications for 2.0.1

swampy

#149
modification .xml file <?xml version="1.0"?>
<!DOCTYPE modification SYSTEM "http://www.simplemachines.org/xml/modification">
<modification xmlns="http://www.simplemachines.org/xml/modification" xmlns:smf="http://www.simplemachines.org/">
   <id>snork13:PaypalDonations</id>
   <version>1.7</version>

   <file name="$boarddir/index.php">
      <operation>
         <search position="before"><![CDATA[
      'membergroups' => array('ManageMembergroups.php', 'ModifyMembergroups'),]]></search>
         <add><![CDATA[
      'paypal' => array('Paypal.php', 'Paypal'),]]></add>
      </operation>

   </file>

   

   <file name="$sourcedir/ManagePermissions.php">
      <operation>
         <search position="before"><![CDATA[
            'view_mlist' => false,
            'who_view' => false,
            'search_posts' => false,
            'karma_edit' => false,]]></search>
         <add><![CDATA[
            'payPal_view' => false,]]></add>
      </operation>

      <operation>
         <search position="before"><![CDATA[
      'profile_server_avatar',
      'profile_upload_avatar',
      'profile_remote_avatar',
      'profile_remove_own',]]></search>
         <add><![CDATA[
      'payPal_view',]]></add>
      </operation>
   </file>

   <file name="$sourcedir/ModSettings.php">
   
   <operation>
         <search position="replace"><![CDATA[require_once($sourcedir . '/ManageServer.php');

   $context['page_title'] = $txt['modSettings_title'];
   $context['sub_template'] = 'show_settings';

   $subActions = array(
      'basic' => 'ModifyBasicSettings',
      'layout' => 'ModifyLayoutSettings',
      'karma' => 'ModifyKarmaSettings',
   );]]></search>
         <add><![CDATA[require_once($sourcedir . '/ManageServer.php');

   $context['page_title'] = $txt['modSettings_title'];
   $context['sub_template'] = 'show_settings';

   $subActions = array(
      'basic' => 'ModifyBasicSettings',
      'layout' => 'ModifyLayoutSettings',
      'karma' => 'ModifyKarmaSettings',
      'paypal' => 'ModifypayPalSettings',
   );]]></add>
      </operation>
      
      <operation>
         <search position="replace"><![CDATA[function ModifyFeatureSettings2()
{
   global $context, $txt, $scripturl, $modSettings, $sourcedir;

   isAllowedTo('admin_forum');
   loadLanguage('ModSettings');

   // Quick session check...
   checkSession();

   require_once($sourcedir . '/ManageServer.php');

   $subActions = array(
      'basic' => 'ModifyBasicSettings',
      'layout' => 'ModifyLayoutSettings',
      'karma' => 'ModifyKarmaSettings',
   );

   // Default to core (I assume)
   $_REQUEST['sa'] = isset($_REQUEST['sa']) && isset($subActions[$_REQUEST['sa']]) ? $_REQUEST['sa'] : 'basic';

   // Actually call the saving function.
   $subActions[$_REQUEST['sa']]();
}]]></search>
         <add><![CDATA[function ModifyFeatureSettings2()
{
   global $context, $txt, $scripturl, $modSettings, $sourcedir;

   isAllowedTo('admin_forum');
   loadLanguage('ModSettings');

   // Quick session check...
   checkSession();

   require_once($sourcedir . '/ManageServer.php');

   $subActions = array(
      'basic' => 'ModifyBasicSettings',
      'layout' => 'ModifyLayoutSettings',
      'karma' => 'ModifyKarmaSettings',
      'paypal' => 'ModifypayPalSettings',
   );

   // Default to core (I assume)
   $_REQUEST['sa'] = isset($_REQUEST['sa']) && isset($subActions[$_REQUEST['sa']]) ? $_REQUEST['sa'] : 'basic';

   // Actually call the saving function.
   $subActions[$_REQUEST['sa']]();
}]]></add>
      </operation>

      <operation>
         <search position="replace"><![CDATA[
         'karma' => array(
            'title' => $txt['smf293'],
            'href' => $scripturl . '?action=featuresettings;sa=karma;sesc=' . $context['session_id'],
            'is_last' => true,
         ),]]></search>
         <add><![CDATA[
         'karma' => array(
            'title' => $txt['smf293'],
            'href' => $scripturl . '?action=featuresettings;sa=karma;sesc=' . $context['session_id'],
         ),
         'paypal' => array(
            'title' => $txt['payPalFO'],
            'href' => $scripturl . '?action=featuresettings;sa=paypal;sesc=' . $context['session_id'],
            'is_last' => true,
         ),]]></add>
      </operation>

      <operation>
         <search position="before"><![CDATA[
   $context['post_url'] = $scripturl . '?action=featuresettings2;save;sa=karma';
   $context['settings_title'] = $txt['smf293'];

   prepareDBSettingContext($config_vars);
}
]]></search>
         <add><![CDATA[
function ModifypayPalSettings()
{
   global $txt, $scripturl, $context, $settings, $sc;

   $config_vars = array(
         // Paypal Donations - On or off?
         array('check', 'payPalEnable'),
      '',
         // Paypal key and Reason
         array('large_text', 'payPalReason','10'),
         array('large_text', 'payPalKey','8'),
           
   );

   // Saving?
   if (isset($_GET['save']))
   {
      saveDBSettings($config_vars);
      redirectexit('action=featuresettings;sa=paypal');
   }

   $context['post_url'] = $scripturl . '?action=featuresettings2;save;sa=paypal';
   $context['settings_title'] = $txt['payPalFO'];

   prepareDBSettingContext($config_vars);
}
]]></add>
      </operation>
   </file>

   
   <file name="$themedir/index.template.php">
      <operation>
         <search position="replace"><![CDATA[
function template_menu()
{
   global $context, $settings, $options, $scripturl, $txt;
]]></search>
         <add><![CDATA[
function template_menu()
{
   global $context, $settings, $options, $scripturl, $txt, $modSettings;
]]></add>
      </operation>

      <operation>
         <search position="before"><![CDATA[
   if ($context['current_action'] == 'search2')
      $current_action = 'search';
]]></search>
         <add><![CDATA[
   if ($context['current_action'] == 'paypal')
      $current_action = 'paypal';
]]></add>
      </operation>

      <operation>
         <search position="before"><![CDATA[
   // The [calendar]!
   if ($context['allow_calendar'])
      echo ($current_action == 'calendar' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
            <td valign="top" class="maintab_' , $current_action == 'calendar' ? 'active_back' : 'back' , '">
               <a href="', $scripturl, '?action=calendar">' , $txt['calendar24'] , '</a>
            </td>' , $current_action == 'calendar' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';
]]></search>
         <add><![CDATA[
   // Paypal Mod
   if (($modSettings['payPalEnable']) && (allowedTo('payPal_view')))
      echo ($current_action == 'paypal' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
            <td valign="top" class="maintab_' , $current_action == 'paypal' ? 'active_back' : 'back' , '">
               <a href="', $scripturl, '?action=paypal">' , $txt['payPal'] , '</a>
            </td>' , $current_action == 'paypal' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';
]]></add>
      </operation>
   </file>


   <file name="$themedir/languages/Modifications.english.php">
      <operation>
         <search position="after"><![CDATA[?>]]></search>
         <add><![CDATA[
$txt['payPal'] = 'Donations';
$txt['cannot_payPal_view'] = 'Sorry, you\'re not allowed to view the Donation Page.';
$txt['permissionname_payPal_view'] = 'View Donation Page';
$txt['permissionhelp_payPal_view'] = 'Allow the people to view the Donation Page.  If not set, the people will not see the page.';
]]></add>
      </operation>
   </file>

   <file name="$themedir/languages/ModSettings.english.php">
      <operation>
         <search position="before"><![CDATA[
$txt['karmaLabel'] = 'Karma label';
$txt['karmaApplaudLabel'] = 'Karma applaud label';
$txt['karmaSmiteLabel'] = 'Karma smite label';
]]></search>
         <add><![CDATA[
$txt['payPalEnable'] = 'Enable the Donation';
$txt['payPalKey'] = 'Paypal Form (html)';
$txt['payPalReason'] = 'Reason For Donation';
$txt['payPalFO'] = 'Donations';
]]></add>
      </operation>
   </file>

   <file name="$themedir/languages/Who.english.php">
      <operation>
         <search position="before"><![CDATA[
$txt['whoall_.xml'] = 'Viewing an XML feed.';
]]></search>
         <add><![CDATA[
$txt['whoall_paypal'] = 'Viewing the <a href="' . $scripturl . '?action=paypal">Donations</a>.';
]]></add>
      </operation>
   </file>

</modification>

swampy

?? Snork I am not much of a code reader, could you please have a look at the above and let me know what is needed please.

Much thanks and Merry Christmas.

snork13

#151
in file sources/ModSettings.php
   
  find:

   require_once($sourcedir . '/ManageServer.php');

   $context['page_title'] = $txt['modSettings_title'];
   $context['sub_template'] = 'show_settings';

   $subActions = array(
      'basic' => 'ModifyBasicSettings',
      'layout' => 'ModifyLayoutSettings',
      'karma' => 'ModifyKarmaSettings',


  replace with:


require_once($sourcedir . '/ManageServer.php');

   $context['page_title'] = $txt['modSettings_title'];
   $context['sub_template'] = 'show_settings';

   $subActions = array(
      'basic' => 'ModifyBasicSettings',
      'layout' => 'ModifyLayoutSettings',
      'karma' => 'ModifyKarmaSettings',
      'paypal' => 'ModifypayPalSettings',

 

find:

function ModifyFeatureSettings2()
{
   global $context, $txt, $scripturl, $modSettings, $sourcedir;

   isAllowedTo('admin_forum');
   loadLanguage('ModSettings');

   // Quick session check...
   checkSession();

   require_once($sourcedir . '/ManageServer.php');

   $subActions = array(
      'basic' => 'ModifyBasicSettings',
      'layout' => 'ModifyLayoutSettings',
      'karma' => 'ModifyKarmaSettings',
   );

   // Default to core (I assume)
   $_REQUEST['sa'] = isset($_REQUEST['sa']) && isset($subActions[$_REQUEST['sa']]) ? $_REQUEST['sa'] : 'basic';
   // Actually call the saving function.
   $subActions[$_REQUEST['sa']]();
}


   replace with:

function ModifyFeatureSettings2()
{
   global $context, $txt, $scripturl, $modSettings, $sourcedir;

   isAllowedTo('admin_forum');
   loadLanguage('ModSettings');

   // Quick session check...
   checkSession();

   require_once($sourcedir . '/ManageServer.php');

   $subActions = array(
      'basic' => 'ModifyBasicSettings',
      'layout' => 'ModifyLayoutSettings',
      'karma' => 'ModifyKarmaSettings',
      'paypal' => 'ModifypayPalSettings',
   );

   // Default to core (I assume)
   $_REQUEST['sa'] = isset($_REQUEST['sa']) && isset($subActions[$_REQUEST['sa']]) ? $_REQUEST['sa'] : 'basic';

   // Actually call the saving function.
   $subActions[$_REQUEST['sa']]();
}

find:


         'karma' => array(
            'title' => $txt['smf293'],
            'href' => $scripturl . '?action=featuresettings;sa=karma;sesc=' . $context['session_id'],
            'is_last' => true,
         ),


replace with:


         'karma' => array(
            'title' => $txt['smf293'],
            'href' => $scripturl . '?action=featuresettings;sa=karma;sesc=' . $context['session_id'],
         ),
         'paypal' => array(
            'title' => $txt['payPalFO'],
            'href' => $scripturl . '?action=featuresettings;sa=paypal;sesc=' . $context['session_id'],
            'is_last' => true,
         ),

find:

   $context['post_url'] = $scripturl . '?action=featuresettings2;save;sa=karma';
   $context['settings_title'] = $txt['smf293'];

   prepareDBSettingContext($config_vars);
}


add after:


function ModifypayPalSettings()
{
   global $txt, $scripturl, $context, $settings, $sc;

   $config_vars = array(
         // Paypal Donations - On or off?
         array('check', 'payPalEnable'),
      '',
         // Paypal key and Reason
         array('large_text', 'payPalReason','10'),
         array('large_text', 'payPalKey','8'),
           
   );

   // Saving?
   if (isset($_GET['save']))
   {
      saveDBSettings($config_vars);
      redirectexit('action=featuresettings;sa=paypal');
   }

   $context['post_url'] = $scripturl . '?action=featuresettings2;save;sa=paypal';
   $context['settings_title'] = $txt['payPalFO'];

   prepareDBSettingContext($config_vars);
}


-snork13
Mods
Please DO NOT PM me with requests for individual support, but post your questions and concerns in the appropriate section of the forum where other users can benefit from them as well. Thank you.
I have been super busy as of late. Working on updates to all my modifications for 2.0.1


Poppet

I've done all the above edits to the ModsSettings.php but it's still coming up with Test Failed when I apply the mod, am I safe to proceed?

Bigguy

If you have done all the edits to the ModSettings.php file and uploaded it (After making a backup of the file of course) All you should have to do is ignore the error and install the mod through the package manager.

albsat

@snork

Hi. thnx for your Paypal donation mod. i tried to install it but after the modificatioan and running the script add_settings.php and trying to change the settings in Paypal I get this error:
Fatal error: Call to undefined function: modifypaypalsettings() in /home/httpd/vhosts/????"/httpdocs/tingulli/Sources/ModSettings.php on line 157

any help man?
Regards
P.s. By the way this is my first post and my first install of SMF. Hello to everyone.

HEB XI 1

I seem to have found some kind of incompatibility between Simple Blog and PayPal donations mod.  Each mod will install fine by itself, but neither will install WITH the other as they both edit ./Sources/ModSettings.php and installing one seems to throw things off.  I've also posted on the Simple Blog thread to see if there is something either author can do to make them play nice together.

I'd rather avoid editing things by hand a that tends to get me into trouble.  The blog mod is less important to me so I'm willing to wait and see.

FWIW, I'm running 1.1.1 on the default theme.

http://www.raven-flight.com/community

fasterthanyours

I download this and attempted to install it.

It will not install because I have The Google Maps Mod install.

Nor will the Google Maps install if I have your mod installed.

It Fails on ModSettings.php and sometimes on Modifications.english.php

Bigguy

It does install. I have all of those mods installed and did not have to do any manual editing. Maybe it is another mod that is conflicting. Those edits aren't very hard to do manually though if you need to.

LooseCannon17

Hi there,

Uninstalled and deleted the previous version of Paypal Donations, and installed version 1.7 on SMF 1.1.1.  This is the error message that I receive when I go to my Features and Options via the Admin:

Fatal error: Cannot redeclare modifypaypalsettings() (previously declared in /home/mltdownl/public_html/home/Sources/ModSettings.php:406) in /home/mltdownl/public_html/home/Sources/ModSettings.php on line 708

From what I can tell - both the entries into the modsettings/php are exactly the same on both the old (backup file) and the new install, just on different lines.

My forums are heavily modified, and will continue to run even with this error, although members mention that there is no donations tab at the top of the screen anymore.

Any help would be greatly appreciated,

Advertisement: