3.1.x Extensions Database 3.1 / 3.2Ultimate Points Extension

<span class="qte-attr qte_31_32-qte">3.1.x &amp; 3.2.x</span>
Locked Previous topicNext topic
User avatar

testingground
Users
Users
Posts: 24
Joined: 26 Apr 2016, 09:36
    Ubuntu Firefox

Re: Ultimate Points Extension

Post by testingground »

Hi, Can you help me on this please?

I have a webpage that isnt within my phpbb forum.
This webpage is a simple blackjack game.
I have managed to grab the ultimate points balance per user and implement it as a balance in my game.
Problem is how do I get the backjack final balance (when you finished playing etc) back into the ultimate points balance in the forum?

What I mean is:

user has 3000 UP in forum.
Clicks on link in forum to go to website with game and UP balance is copied across, so user has 3000 UP to play with.
After they have finished the game they click a button to exit and that also transfers the new UP balance from the game into the forum UP and updates it, so if the user has won and their balance is now 4000, when they go back to the forum their UP balance is updated from 3000 to 4000

This is what worked on my 3.0 board.

Code: Select all

<?php
/* First, get userpoints passed in URL from JavaScript section of main custom page 'bjack_new_session.php' */
$points=$_GET['newPoints'];

/* Begin Second Custom Page set up */
define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);

/* Start session management */
$user->session_begin();
$auth->acl($user->data);
$user->setup();
$userid = $user->data['user_id'];
$username = $user->data['username'];
$userpoints = $user->data['user_points'];


/* Update DB userpoints for the current user only*/
$sql_arr = array(
    'user_points'    => $points,
);

$sql = 'UPDATE ' . USERS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_arr) . '
    WHERE user_id = ' . (int) $userid;
$db->sql_query($sql);

/* Close the DB connection after every update */
mysql_close();

?>
Thanks

User avatar

Topic Author
dmzx Online
Founder
Founder
Posts: 6466
Joined: 13 Jan 2014, 21:45
    Windows 10 Firefox

Re: Ultimate Points Extension

Post by dmzx »

PM me link and test account, and I can look if I have a spare moment.

User avatar

Emperor1
Users
Users
Posts: 9
Joined: 09 Dec 2015, 14:11
    Windows 8.1 Chrome

Re: Ultimate Points Extension

Post by Emperor1 »

Dmzx, please to play the lottery was canceled when only 1 player involved. :thumbup:

User avatar

testingground
Users
Users
Posts: 24
Joined: 26 Apr 2016, 09:36
    Ubuntu Firefox

Re: Ultimate Points Extension

Post by testingground »

Any chance to have a look dmzx?

User avatar

testingground
Users
Users
Posts: 24
Joined: 26 Apr 2016, 09:36
    Ubuntu Firefox

Re: Ultimate Points Extension

Post by testingground »

Ok I guess you dont have time. :sad:

How about this,

Is there anyway to carry over the points members have got in 3.0 and put them in 3.1?
Would export and importing the database work or are they totally different now?

User avatar

Topic Author
dmzx Online
Founder
Founder
Posts: 6466
Joined: 13 Jan 2014, 21:45
    Windows 10 Firefox

Re: Ultimate Points Extension

Post by dmzx »

testingground wrote: 03 May 2016, 11:52 Ok I guess you dont have time. :sad:

How about this,

Is there anyway to carry over the points members have got in 3.0 and put them in 3.1?
Would export and importing the database work or are they totally different now?
yes time is bit limited lately :sad: will need to check on it..

User avatar

ninouee
Users
Users
Posts: 32
Joined: 01 May 2016, 09:48
    Windows 10 Chrome

Re: Ultimate Points Extension

Post by ninouee »

Hello

This extention s really very interesting .

Is it possible to have a point total by groups automatically?

For intermembre competitions that can be very handy .

thank you

Good night

PS : do you want a french translation?

User avatar

Topic Author
dmzx Online
Founder
Founder
Posts: 6466
Joined: 13 Jan 2014, 21:45
    Windows 10 Firefox

Re: Ultimate Points Extension

Post by dmzx »

ninouee wrote: 18 May 2016, 23:21 Hello

This extention s really very interesting .

Is it possible to have a point total by groups automatically?

For intermembre competitions that can be very handy .

thank you

Good night

PS : do you want a french translation?
Will check on the group option.
French translation is always welcome :wink:

User avatar

ninouee
Users
Users
Posts: 32
Joined: 01 May 2016, 09:48
    Windows 10 Chrome

Re: Ultimate Points Extension

Post by ninouee »

Cool :thumbup:

Il will work on french translation this week. ;-)

User avatar

testingground
Users
Users
Posts: 24
Joined: 26 Apr 2016, 09:36
    Ubuntu Firefox

Re: Ultimate Points Extension

Post by testingground »

Any chance you can have a quick look at that code I posted?
Im sure its just a case of altering it slightly, but its beyond me, youd probably spot it straight away

User avatar

ninouee
Users
Users
Posts: 32
Joined: 01 May 2016, 09:48
    Windows 10 Chrome

Re: Ultimate Points Extension

Post by ninouee »

I want to try the extenstion to test the translation and understand some elements and i have a problem. I cant use the extention but it is activated.

I have a message like that:

You are not authorized to access this part of the forum.

User avatar

Topic Author
dmzx Online
Founder
Founder
Posts: 6466
Joined: 13 Jan 2014, 21:45
    Windows 10 Firefox

Re: Ultimate Points Extension

Post by dmzx »

testingground wrote: 21 May 2016, 10:10 Any chance you can have a quick look at that code I posted?
Im sure its just a case of altering it slightly, but its beyond me, youd probably spot it straight away
Not yet :roll:

User avatar

Topic Author
dmzx Online
Founder
Founder
Posts: 6466
Joined: 13 Jan 2014, 21:45
    Windows 10 Firefox

Re: Ultimate Points Extension

Post by dmzx »

First post updated

User avatar

Topic Author
dmzx Online
Founder
Founder
Posts: 6466
Joined: 13 Jan 2014, 21:45
    Windows 10 Firefox

Re: Ultimate Points Extension

Post by dmzx »

First post updated

User avatar

Scanialady
Users
Users
Posts: 310
Joined: 06 Apr 2015, 18:04
    Windows 10 Chrome

Re: Ultimate Points Extension

Post by Scanialady »

I found a little mistake
up-114.png
My german translation for 1.1.4

:smile:
You do not have the required permissions to view the files attached to this post! Maybe your post count is too low.
-
If you want to get German translations for extensions: ask me.

Locked Previous topicNext topic