[Request] How to retrieve Account Id's ItemMall v2?

This is guide mostly for website tools and code, for example CMS or registration scripts.
There can also be tools.

Moderators: osRose dev team, ospRose dev team, osiRose dev team, Moderators

[Request] How to retrieve Account Id's ItemMall v2?

Postby Mark on Wed Feb 15, 2012 9:12 pm

Hi All,

Just wondering,

Does anybody know how to retrieve account id's in php for DynastyCMS???

Were transferring over to a donation points system on eutopia, we have the cms set up with the item mall v2...However,

Many people have probably experienced this message before "Your account does not exist" when purchasing items from there CMS item malls

Anyways.. Here's a copy of my Itemmall_v2 script and Login Script, kemme know if somethings wrong cuz im seriously pulling my teeth out let alone my hair o.o

An image of the Issue
http://i39.tinypic.com/10ynha0.jpg
Login.php
http://www.mediafire.com/?d44k1ihsc051jx9
ItemMall_v2.php
http://www.mediafire.com/?x6899jxkd44w677
Administrator / Coder for EutopiaRose Online
Image
http://www.eutopiarose.co.uk
User avatar
Mark
Rackie
Rackie
 
Posts: 176
Joined: Tue Dec 13, 2011 8:15 am
Location: Sunny England

Re: [Request] How to retrieve Account Id's ItemMall v2?

Postby hoegarden31 on Wed Feb 15, 2012 9:47 pm

Aha... i can finally help :D

In that itemmall, the account id is get by this code :

  1. $account_id = ( isset($_SESSION['user_account_id']) ) ? $_SESSION['user_account_id'] : 0 ;

So when you login, you must put the id of the user who just logged in into the session.
It's done by this code in your file. So the users have to login before they can use the itemmall.
  1. $_SESSION['account_id'] = $res_array['id'];


i don't want to make any publicity, but take a look at our website :
http://furiarosereborn.com
You can see that when you are not logged in, you can't see much :p
But when u user logs in, the link to the itemmall is shown as well as his vote points and donation points.
If you want any help with websites, just ask, i will help for free ;)
I'm the one and only. In heaven and on earth.
Image
hoegarden31
Rackie
Rackie
 
Posts: 150
Joined: Sun Nov 13, 2011 7:13 pm

Re: [Request] How to retrieve Account Id's ItemMall v2?

Postby Mark on Wed Feb 15, 2012 11:09 pm

hmm very very weird things happening here :(

Ok so I implemented the code in the Itemmall_v2.php:
  1. ########### Account information ##################
  2. $account_id = ( isset($_SESSION['user_account_id']) ) ? $_SESSION['user_account_id'] : 0 ;
  3. include('class.table.inc.php');
  4. $_SESSION['account_id'] = $res_array['id']; //this was added
  5.  
  6. // variables
  7. $i_cid = ( isset($_GET['i_cid']) && is_numeric($_GET['i_cid']) ) ? $_GET['i_cid'] : 0;
  8. $i_par = ( isset($_GET['i_par']) && is_numeric($_GET['i_par']) ) ? $_GET['i_par'] : -1;
  9. $i_pur = ( isset($_GET['i_pur']) && is_numeric($_GET['i_pur']) ) ? $_GET['i_pur'] : 0;
  10.  
  11. $item_mall = new itemmallv2($account_id,true);
  12. // Configuring some data
  13. $item_mall->setlog(true); // enable/disable to create an information stream of who bought what
  14. $item_mall->setaccount_id(1); // set the users account ID
  15. $item_mall->setalevel(100); // set the users access level


And in my login.php:
  1.  
  2. if($count == 1){
  3.  
  4. session_register("User_Name");
  5. session_register("User_Pass");
  6. $res_array = mysql_fetch_assoc($query);         // Added from previous IM_V2 thread
  7.  
  8. $_SESSION['account_id'] = $res_array['id'];         // Added from previous IM_V2 thread
  9. $_SESSION['account'] = $_POST['user'];
  10. echo('Logged in.... Click <a href=?op=user><strong>here</strong></a>');
  11. }
  12. else {
  13. echo "<strong>Try Again</strong>";
  14. }
  15. }
  16. ?>
  17.   <br />
  18. </p>


But still no luck...I must be doing something wrong o.o

And yeah i'll take any help you can offer,( kinda an uber n00b at php lolz, my c++ is ok tho ) that would be brilliant thank you, also, if you need anything feel free to ask, who knows, maybe in the not too distant future we could work on some project's together for our server's.
Administrator / Coder for EutopiaRose Online
Image
http://www.eutopiarose.co.uk
User avatar
Mark
Rackie
Rackie
 
Posts: 176
Joined: Tue Dec 13, 2011 8:15 am
Location: Sunny England

Re: [Request] How to retrieve Account Id's ItemMall v2?

Postby hoegarden31 on Wed Feb 15, 2012 11:18 pm

No you are doing it wrong. Look at your itemmall code, the code i mentionned is already there
(just above the one added, wich is not correct btw).
It should work the way they made it. It worked on our website.
Is your website online ? so i can take a look to it ?
I see that the session_start() is in your file, so it should see your id once you are logged in.

Like i said, you must be logged in before using the itemmall.
I'm the one and only. In heaven and on earth.
Image
hoegarden31
Rackie
Rackie
 
Posts: 150
Joined: Sun Nov 13, 2011 7:13 pm

Re: [Request] How to retrieve Account Id's ItemMall v2?

Postby Mark on Wed Feb 15, 2012 11:26 pm

I'll send you a direct link in PM, the way that it links to our IM is:

Player logs in via the normal user panel, then clicks on ItemMall in the top tab.
Administrator / Coder for EutopiaRose Online
Image
http://www.eutopiarose.co.uk
User avatar
Mark
Rackie
Rackie
 
Posts: 176
Joined: Tue Dec 13, 2011 8:15 am
Location: Sunny England


Return to PHP / Web Guides, Scripts and tools.

Who is online

Users browsing this forum: No registered users and 9 guests

cron