Jump to content
MakeWebGames

Eruondo

Members
  • Posts

    123
  • Joined

  • Last visited

    Never

Eruondo's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Correct me if I'm wrong, but from looking at it, it seems it would work fine with just the regular iteminfo.php...
  2. Thanks. :D
  3. Can be seen working on http://www.thedarkestfate.com/encyclopedia.php Username: Demo1 Password: demo
  4. I did not make this, I found it on the forums somewhere a while ago, and then I edited it to fit my needs, and added a little extra, as the pages function and such. Use it however you want, just don't sell it or anything like that. If you want to change how many displayed items there are per page, just edit the $rowsPerPage variable. Default is 30. Here is the code. Save as encyclopedia.php   <?php include "globals.php"; print " <font color='#FFFFFF'><hr width='95%'><h3>Item Encyclopedia</h3></font><hr width='95%'/>"; $sql1 = $db->query("SELECT * FROM items"); $count = $db->num_rows($sql1); $rowsPerPage = 30; $numrows = $db->num_rows($sql1); $pageNum = 1; if(isset($_GET['page'])) { $pageNum = $_GET['page']; } $offset = ($pageNum - 1) * $rowsPerPage; $maxPage = ceil($numrows/$rowsPerPage); print" <table width='95%' cellspacing='1' border='0'> <tr> <td width='15%'> [b]Item Type[/b] </td> <td width='15%'> [b]Item Name[/b] </td> <td width='40%'> [b]Description[/b] </td> <td> [b]Buy Price[/b] </td> <td> [b]Sell Price[/b] </td> <td> [b]Owned by:[/b] </td> </tr>"; $q=$db->query("SELECT i.*,it.itmtypename FROM items i JOIN itemtypes it ON i.itmtype=it.itmtypeid ORDER BY i.itmtype,i.itmbuyprice ASC LIMIT $offset, $rowsPerPage"); $cn=0; while($p=$db->fetch_row($q)) { $d=$db->query("SELECT inv_userid FROM inventory where inv_itemid={$p['itmid']} GROUP BY inv_userid"); $r=$db->num_rows($d); $cn++; $buy = number_format($p['itmbuyprice']); $sell = number_format($p['itmsellprice']); print" <tr> <td> {$p['itmtypename']} </td> <td> [url='iteminfo.php?ID={$p[']{$p['itmname']}[/url] </td> <td> {$p['itmdesc']} </td> <td> \$$buy </td> <td> \$$sell </td> <td> $r players </td> </tr>"; } print " <tr> <td align='center' colspan='6'> [b]Pages: [/b]"; for($page = 1; $page <= $maxPage; $page++) { $nav .= "[url='encyclopedia.php?page={$page}']$page, [/url]"; } print " $nav </td> </tr> </table>"; print " <hr width='95%'>[url='index.php']Back[/url] <hr width='95%'>"; $h->endpage(); ?>   Enjoy! Might also add what it does: It creates a list of all the items you have on your game, with name, description, buy and sell price, and how many users own it.
  5. I'm trying to make a little upgrade to the forums so that you recieve a notification if someone posts in a thread you've posted in, but I've got no idea on how to do it. I'm not asking you take make it for me, but if someone could be so kind as to point me in the general direction of what I should do to accomplish this, that would be most appreciated. I though about perhaps adding a field to the database called new_posts or something, and then just updating that field every time someone posts in a thread you've posted in, but I'm not quite sure on how to do that last part. Thanks! Eruondo.
  6. Thanks both of you, that worked, :) Sorry, I forgot to answer, :P
  7. I'm trying to write a little snippet of code, and I've encountered a problem. What I'm trying to do, is to put a variable with a value inside the $_GET, e.g:   $b = 1; $c = $_GET['data{$b}'];   And later I use a while loop to auto increment $b + 1 for so and so many times. My problem is, I can't get this to work! It simply doesn't read the variable, no matter what I try. Does anyone have any suggestions on how to fix this? Thank you very much.
  8. This is v2, yes. Do you get an error?
  9. Just put this in the mail_view and outbox function.   $sql2 = $db->query("SELECT * FROM mail WHERE mail_id = {$_GET['ID']}"); $sql1 = $db->fetch_row($sql2); if ($sql1['mail_from'] != $userid && $sql1['mail_to'] != $userid) { die("Error. This is not your mail."); }
  10. Eruondo

    Dectece user OS

    Google analytics FTW?
  11. $m=$db->query("SELECT * FROM users WHERE userid={$r['married']}"); I think that would be where the error lies. Is $r['married'] set?
  12. No, it's get. But that code from jon182 fixed it, so thanks! Case closed, :P
  13. I'm trying to do a form, and in that form, I've put in a little snippet to ensure that my users actually have written something in the fields. I've used these two codes, if ($_GET['header'] == 0) { die( "You did not fill out all forms."); } and if (!isset($_GET['header'])) { print "You did not fill out all forms."; } Bu neither of them works! The first code activates no matter what I write in the header field, and the second one never does... I'm sincerely stuck, and would greately appriciate any help! What am I doing wrong? I'm betting it's something really stupid and easy.
  14. I think he's referring to this bit: mysql_query("INSERT INTO ammunition VALUES('{$add['itmid']}','100')",$c)
  15. Any chance of this mod getting released for free anytime soon? Probably not, but I had to ask, :pinch:
×
×
  • Create New...