Jump to content

Recommended Posts

Posted (edited)

Don't use mysql (deprecated) / mysqli! There is PDO and nothing else. :lol:

 

Also, you can build something like a template engine...

For example:

 

index.php

<?php

function render($tplFile, array $data) {
    ob_start();
    extract($data, EXTR_SKIP);
    require "template/{$tplFile}";
    echo ob_get_clean();
}

$someData = [
    'title' => 'Cool Page Title',
    'text' => 'Some cool text'
];

render('home.php', $someData);
template/home.php

<!DOCTYPE html>
<html>
    <head>
        <title><?= $data['title']; ?></title>
    </head>
    <body>
        <div><?= $data['text']; ?></div>
    </body>
</html>
Edited by Tessa
Posted

I know pdo is used on the updated version.

First adding more donation options and debugging the system as best i can.

i will try to keep this in mind when i'm going to worry about templates ^^

Posted

It's not about templates. When you separate the HTML (also known as 'view') from the programming logic, your code becomes more readable. You can also separate the database logic and your application will be even easier to debug. :)

Posted

It's not about templates. When you separate the HTML (also known as 'view') from the programming logic, your code becomes more readable. You can also separate the database logic and your application will be even easier to debug. :)

 

I still prefer the good clean jsp and servlets

Posted

I still prefer the good clean jsp and servlets

PHP can be clean too, there are a lot of frameworks you can use to do that.

 

For a web apps I prefer Python + Django. Python is sweet, Django is powerful. :lol:

Posted

I'm not that good at coding. if something comes out, its mostly chaotic.

But yea i'm trying my best to give a free tool to the l2j community.

I'm mostly working alone at it so some help is welcome.

Maby giving ideas to better handle the code.

With example would be very usefull :)

  • 3 weeks later...
Posted (edited)

Yes i will explain it a bit on how to test.

 

Login: https://developer.paypal.com/webapps/developer/applications/ipn_simulator

Step1: choose your ipn file and select web accept:

8546e594-d0f2-11e5-9338-b30f01f1b338.png

 

Step2: check if its instant, confirmed and verified:

e00a54fe-d0f0-11e5-8946-cc45eae5b663.png

 

step3: you can select every donation option just change mc_gross and custom field:

66eaeb78-d0f1-11e5-842e-f07d08eb4f25.png

 

Options for custom field:

 

// Note for selecting the correct option (coins karma pk) use the correct mc_gross amount same as your config.
Charactername|Coins
Charactername|Karma
Charactername|Pkpoints

 

// These ones are for the enchant option.

charname|Enchitems|Shirt
charname|Enchitems|Helmet
charname|Enchitems|Necklace
charname|Enchitems|Weapon
charname|Enchitems|FullarmorBreastplate
charname|Enchitems|Shield
charname|Enchitems|Ring1
charname|Enchitems|Ring2
charname|Enchitems|Earring1
charname|Enchitems|Earring2
charname|Enchitems|Gloves
charname|Enchitems|Leggings
charname|Enchitems|Boots
charname|Enchitems|Belt

 

Change  MC_gross = donation amount. Same as your config otherwise the donations wont work.

It will get logged into admin/donationoverview because the donation amount is not correct.

 

And turn sandbox mode on in config if you are testing trough the ipn simulator. Otherwise it will also fail.

 

Edit: Also good to know this system is not tested good yet, and maby it could burn your server in the near future :P.

 

Still working on it i just dont have so mutch time lately to learn and code.

When i have more time i will try to make it better.

Edited by dasoldier
  • 2 months later...
Posted (edited)

Hey all,

 

I have shared a donation system.

Still improving it and try to solve problems i have encountered.

Note: Spanish is not in there yet.

https://github.com/Dasoldier1/Donation_Center

 

* register form

* Now players connect their character to their donation center account

 

5aaeba7c-29bd-11e6-903e-53b355093e91.jpg

 

5ad06a00-29bd-11e6-9bd6-46b5c4090123.jpg

 

It is exerimental so if you encounter some problems with the system inform us and we will look for a solution.

 

Greetings,

Dasoldier

Edited by dasoldier
  • 3 years later...
Posted (edited)

When you donate with a sandbox personal account to a sandbox business account, payment status is set to Pending for some reason and not Completed. So be aware guys

Edited by Zake

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...