Script Request

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

Re: Script Request

Postby orlando619 on Fri Jan 20, 2012 11:27 pm

it doesn't give me my Current Donation Points ..

it looks like this:

    welcome: ExiLe
     
    Donation points:


can you give me the exact code for the user.php ??

and i'm using the int field nb_donation from the accounts table.

thnx ..
orlando619
Jelly Bean
Jelly Bean
 
Posts: 19
Joined: Tue Dec 13, 2011 2:34 am

Re: Script Request

Postby hoegarden31 on Sun Jan 22, 2012 4:22 pm

Ok.
Step 1:
Open your file functions.php (you can find it in the map functions

Then you check if you have this code in it :
  1. function user($value) {
  2. $userdata = mysql_query("SELECT * FROM accounts WHERE username='" . $_SESSION['account'] . "'") or die(mysql_error());
  3. $dyncms = mysql_fetch_array($userdata);
  4. echo $dyncms[$value];
  5. }

If you have this code, then you can continue to the next step. If not, then add this function to the file.

Step 2:
Open your index.php (the one you can see in the root)
And check if you see this code
  1. <?php
  2. require ('functions/config.php');
  3. require ('functions/functions.php');


Step 3:
Open your user.php, and add this
  1. <p>Donation points:&nbsp;<?php user(nb_donation); ?></p>

where you want to display the number of donation points.

Here is the user.php like it should be :
  1. <?php
  2. /*
  3. DynastyCMS
  4. Copyrigt (C) 2007 dynastycms
  5.  
  6. This program is free software; you can redistribute it and/or
  7. modify it under the terms of the GNU General Public License
  8. as published by the Free Software Foundation; either version 2
  9. of the License, or (at your option) any later version.
  10.  
  11. This program is distributed in the hope that it will be useful,
  12. but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. GNU General Public License for more details.
  15.  
  16. You should have received a copy of the GNU General Public License
  17. along with this program; if not, write to the Free Software
  18. Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  19. */
  20.  
  21. if(!session_is_registered(User_Name)) {
  22. die('You must log in you noob!');
  23. }
  24.  
  25. if(!session_is_registered(User_Pass)) {
  26. die('You must log in you noob!');
  27. }
  28.  
  29. ?>
  30.  
  31. <form action="?op=edit-char" method="post">
  32.  <p align="center" class="b01">Welcome: <?php echo $_SESSION['account']; ?><br />
  33.     <br />
  34.    <br />
  35. <p>Donation points:&nbsp;<?php user(nb_donation); ?></p>
  36.   <br />
  37.   <em><br />  
  38.     </em><a href="?op=password">Change Password</a><br />
  39.     <a href="?op=cuser-delete">Delete my character</a><br />
  40.     <a href="?op=delete_acc">Delete my account</a><br />
  41.     <a href="?op=change_class">Change my class </a><br />
  42.   <a href="?op=logout">Logout</a></p>
  43. </form>
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

Previous

Return to PHP / Web Guides, Scripts and tools.

Who is online

Users browsing this forum: No registered users and 8 guests

cron