Item mall 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

Rate this script

0-2
8
28%
3-4
0
No votes
5-6
2
7%
7-8
3
10%
9-10
16
55%
 
Total votes : 29

Re: Item mall V2

Postby Mike567 on Sat Sep 05, 2009 8:53 pm

its work, if i logout my account in user.php
User avatar
Mike567
Antares
Antares
 
Posts: 392
Joined: Wed Mar 19, 2008 4:27 am
Location: Philippines

Re: Item mall V2

Postby vze3z5 on Sun Sep 13, 2009 7:24 pm

Help please?

  1.  
  2.  
  3. Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at C:\xampplite\htdocs\Itemmall\itemmall_v2.php:40) in C:\xampplite\htdocs\Itemmall\itemmall_v2.php on line 41
  4.  
  5. Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at C:\xampplite\htdocs\Itemmall\itemmall_v2.php:40) in C:\xampplite\htdocs\Itemmall\itemmall_v2.php on line 41
  6.  
  7. Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'rose'@'localhost' (using password: YES) in C:\xampplite\htdocs\Itemmall\itemmall_v2.php on line 49
  8.  
  9. Warning: mysql_select_db() [function.mysql-select-db]: Access denied for user 'ODBC'@'localhost' (using password: NO) in C:\xampplite\htdocs\Itemmall\itemmall_v2.php on line 50
  10.  
  11. Warning: mysql_select_db() [function.mysql-select-db]: A link to the server could not be established in C:\xampplite\htdocs\Itemmall\itemmall_v2.php on line 50
  12. Main
  13.  



LOL, got it fixed >< i didn't copy it in modules, but now i did then it was fixed .. thanks for this itemmall!
User avatar
vze3z5
Pomic
Pomic
 
Posts: 88
Joined: Sun Apr 05, 2009 6:49 am
Location: PHILIPPINES!!!!

Re: Item mall V2

Postby Mike567 on Mon Sep 14, 2009 11:44 am

sill not working on update donation points or add

  1. <?php if(!session_is_registered(Admin)) {
  2. die('Access Denied');
  3. }
  4. ?>
  5. <form id="form1" name="form1" method="post" action="?op=ban">
  6. <table width="275" border="0" align="center">
  7.   <tr>
  8.     <td width="98">Account Name or id: </td>
  9.     <td width="167"><label>
  10.       <input type="text" name="textfield1">
  11.     </label></td>
  12.   </tr>
  13.   <tr>
  14.     <td width="98">Donation PT:</td>
  15.     <td width="167"><label>
  16.       <input type="text" name="textfield2">
  17.     </label></td>
  18.   </tr>
  19.   <tr>
  20.     <td>Are you sure? </td>
  21.     <td><label>
  22.       <input name="sure" type="checkbox" id="sure" value="checkbox">
  23.     </label></td>
  24.   </tr>
  25. </table>
  26.  
  27. <p align="center">
  28.   <input name="submit" type="submit" id="submit" />
  29.   <br />
  30.   <br />
  31. <?php
  32. if( ($_SERVER['REQUEST_METHOD'] == 'POST') && isset($_POST['sure']) ) {
  33.     if ( isset($_POST['account_name']) &&n ctype_digit($_POST['donation_points'])) {
  34.         mysql_query("UPDATE accounts SET donation = '".$_POST['textfield2']."' WHERE username = '".$_POST['textfield1']."'");
  35.         if ( ctype_digit($_POST['account_name')) {      
  36.             $sql = "UPDATE accounts SET donation = donation + %d WHERE id=%d;";
  37.         } else {
  38.             $sql = "UPDATE accounts SET donation = donation + %d WHERE username='%s';";
  39.         }
  40.         $sql = sprintf($sql, $_POST['donation_points'], $_POST['account_name']);
  41.         $res = @mysql_query($sql);
  42.         if ( $res === false ) {
  43.             echo 'Adding donation points to <strong>'.$_POST['account_name'].'</strong> has failed! Reason: '. mysql_error(). '<br />';
  44.         } elseif ( mysql_affected_rows() == 0 ) {
  45.             echo 'Appearently <strong>'.$_POST['account_name'].'</strong> does not exist. Please check your parameters! <br />';
  46.         } else {
  47.             echo 'Donation points are added to <strong>'.$_POST['account_name'].'</strong>.<br />';
  48.         }
  49.     } else {
  50.         echo 'Please fill in all the fields.';
  51.     }
  52. } else {
  53.     echo 'If you want to add the donation points, then click the box!';
  54. }
  55. ?></p>
  56.  
  57. </form>
  58.  


i already put my acceslevel into 300 and 400 but nothing happend
User avatar
Mike567
Antares
Antares
 
Posts: 392
Joined: Wed Mar 19, 2008 4:27 am
Location: Philippines

Re: Item mall V2

Postby Rifke on Mon Sep 14, 2009 12:17 pm

viewtopic.php?f=28&t=3179&start=20#p36544

Make a new file like it says and use that one, don't use an existing one because you'll get in trouble.
Rifke
Pero pero
Pero pero
 
Posts: 719
Joined: Thu Aug 09, 2007 3:01 pm
Location: Belgium

Re: Item mall V2

Postby Mike567 on Mon Sep 14, 2009 12:23 pm

i already put

  1.  
  2.  <?php if(!session_is_registered(Admin)) {
  3. die('Access Denied');
  4. }
  5.  
  6. if( ($_SERVER['REQUEST_METHOD'] == 'POST') && isset($_POST['sure']) ) {
  7.     if ( isset($_POST['account_name']) &&n ctype_digit($_POST['donation_points'])) {
  8.         #mysql_query("UPDATE accounts SET donation = '".$_POST['textfield2']."' WHERE username = '".$_POST['textfield1']."'");
  9.         if ( ctype_digit($_POST['account_name')) {      
  10.             $sql = "UPDATE accounts SET donation = donation + %d WHERE id=%d;";
  11.         } else {
  12.             $sql = "UPDATE accounts SET donation = donation + %d WHERE username='%s';";
  13.         }
  14.         $sql = sprintf($sql, $_POST['donation_points'], $_POST['account_name']);
  15.         $res = @mysql_query($sql);
  16.         if ( $res === false ) {
  17.             echo 'Adding donation points to <strong>'.$_POST['account_name'].'</strong> has failed! Reason: '. mysql_error(). '<br />';
  18.         } elseif ( mysql_affected_rows() == 0 ) {
  19.             echo 'Appearently <strong>'.$_POST['account_name'].'</strong> does not exist. Please check your parameters! <br />';
  20.         } else {
  21.             echo 'Donation points are added to <strong>'.$_POST['account_name'].'</strong>.<br />';
  22.         }
  23.     } else {
  24.         echo 'Please fill in all the fields.';
  25.     }
  26. } else {
  27.     echo 'If you want to add the donation points, then click the box!';
  28. }
  29. ?>
  30. <form id="form1" name="form1" method="post" action="?op=add_dpts">
  31. <table width="275" border="0" align="center">
  32.   <tr>
  33.     <td width="98">Account Name or id: </td>
  34.     <td width="167"><label>
  35.       <input type="text" name="account_name">
  36.     </label></td>
  37.   </tr>
  38.   <tr>
  39.     <td width="98"> Donation PT: </td>
  40.     <td width="167"><label>
  41.       <input type="text" name="donation_points">
  42.     </label></td>
  43.   </tr>
  44.   <tr>
  45.     <td>Are you sure? </td>
  46.     <td><label>
  47.       <input name="sure" type="checkbox" id="sure" value="checkbox">
  48.     </label></td>
  49.   </tr>
  50. </table>
  51.  
  52. <p align="center">
  53.   <input name="submit" type="submit" id="submit" />
  54.   <br />
  55.   <br />
  56. </p>
  57.  
  58. </form>
  59.  


but still not working, i see blank only
User avatar
Mike567
Antares
Antares
 
Posts: 392
Joined: Wed Mar 19, 2008 4:27 am
Location: Philippines

Re: Item mall V2

Postby Rifke on Mon Sep 14, 2009 12:30 pm

I have forgotten a bracket

viewtopic.php?f=28&t=3179&p=36544#p36544 script updated


Main post has now the Dynasty CMS plugin
viewtopic.php?f=28&t=3179&p=36031#p36031
Rifke
Pero pero
Pero pero
 
Posts: 719
Joined: Thu Aug 09, 2007 3:01 pm
Location: Belgium

Re: Item mall V2

Postby Mike567 on Mon Sep 14, 2009 12:52 pm

its worked, thnx :D
User avatar
Mike567
Antares
Antares
 
Posts: 392
Joined: Wed Mar 19, 2008 4:27 am
Location: Philippines

Re: Item mall V2

Postby Rifke on Mon Sep 14, 2009 12:55 pm

Good :D
Rifke
Pero pero
Pero pero
 
Posts: 719
Joined: Thu Aug 09, 2007 3:01 pm
Location: Belgium

Re: Item mall V2

Postby bladefinor on Sun Sep 20, 2009 10:58 am

I got this to work (wasn't hard at all) :D

But thing is, when I buy something (while I'm online) it tells me that I need to log out. So I thought that I remove the part that says "... AND online=0". I did, and it works, but it seems that you need to relog to see the item you bought. In naROSE, you don't need to. I guess this is an "error" in the source of the server, and not this Item Mall script. However, I wanted to share you this experience, and maybe lmame has a solution?
User avatar
bladefinor
Pomic
Pomic
 
Posts: 90
Joined: Wed Dec 31, 2008 8:22 am

Re: Item mall V2

Postby Rifke on Sun Sep 20, 2009 11:09 am

I'm not femiliure with the server code itself, but mainly that's why the AND online=0 stands for. So the user has to logout to buy his items. So basicly it is the same, if you're ingame and buy the items, but you need to relog afterwards anyway.

I'm not sure on the following theory:
But I think the clue for this problem is when you login the server retrieves everything and makes an output for it. If you copy that code for when you visit the storage that it retrieves it refreshes to the new content everytime you visit the storage... It would cause a little bit more thread, but it would rule out the logging off while purchasing an item.



Thanks, the itemmall is basicly self explaining, but you still need that little bit of background.
Rifke
Pero pero
Pero pero
 
Posts: 719
Joined: Thu Aug 09, 2007 3:01 pm
Location: Belgium

PreviousNext

Return to PHP / Web Guides, Scripts and tools.

Who is online

Users browsing this forum: No registered users and 10 guests