Chce zedytowaæ pewien skrypt RPG. Nawet dobrze mi idzie, ale napotka³em problem.
To jest oryginalny kod:
<?php /* MCCodes Lite itemuse.php Rev 1.0.0 Copyright (C) 2006 Dabomstew This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ require "global_func.php"; $userid=$_SESSION['userid']; require "header.php"; $h = new headers; $h->startheaders(); include "mysql.php"; $is=mysql_query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid W
HERE u.userid=$userid",$c) or die(mysql_error()); check_level(); $fm=money_formatter($ir['money']); $h->userdata($ir,$lv,$fm); $h->menuarea(); //Medical if(!$_GET['ID']) { } else { $i=mysql_query("SELECT iv.*,i.*,it.* FROM inventory iv LEFT JOIN items i ON iv.inv_itemid=i
.itmid LEFT JOIN itemtypes it ON i.itmtype=it.itmtypeid WHERE iv.inv_id={$_GET['ID']} AND iv.inv_userid=$userid",$c); { } else { if($r['itmtypename'] == 'Medical') { } else { } } } $h->endpage(); ?>
Tutaj chodzi o regeneracje hp przez medicine. I dodam, ze tutaj wszystko dziala bez problemów. Ja chcia³bym dodaæ regenracje energii przez jedzenie (food). Na podstawie urywku tego kodu stworzy³em cos takiego:
<?php //Food if(!$_GET['ID']) { } else { $i=mysql_query("SELECT iv.*,i.*,it.* FROM inventory iv LEFT JOIN items i ON iv.inv_itemid=i
.itmid LEFT JOIN itemtypes it ON i.itmtype=it.itmtypeid WHERE iv.inv_id={$_GET['ID']} AND iv.inv_userid=$userid",$c); { } else { if($r['itmtypename'] == 'Food') { } ?>
Po prostu wszystkie Medical pozmienia³em na food i wszystkie hp na energy. To równiez dzia³a jezeli zamienie ten urywek z tamtym. Ale jezeli po³±cze ten drugi pod ten pierwszy w jedym kodzie nie dzia³a. Tak to wyglada po moim po³aczeniu:
<?php /* MCCodes Lite itemuse.php Rev 1.0.0 Copyright (C) 2006 Dabomstew This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ require "global_func.php"; $userid=$_SESSION['userid']; require "header.php"; $h = new headers; $h->startheaders(); include "mysql.php"; $is=mysql_query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid W
HERE u.userid=$userid",$c) or die(mysql_error()); check_level(); $fm=money_formatter($ir['money']); $h->userdata($ir,$lv,$fm); $h->menuarea(); //Medical if(!$_GET['ID']) { } else { $i=mysql_query("SELECT iv.*,i.*,it.* FROM inventory iv LEFT JOIN items i ON iv.inv_itemid=i
.itmid LEFT JOIN itemtypes it ON i.itmtype=it.itmtypeid WHERE iv.inv_id={$_GET['ID']} AND iv.inv_userid=$userid",$c); { } else { if($r['itmtypename'] == 'Medical') { } //Food if(!$_GET['ID']) { } else { $i=mysql_query("SELECT iv.*,i.*,it.* FROM inventory iv LEFT JOIN items i ON iv.inv_itemid=i
.itmid LEFT JOIN itemtypes it ON i.itmtype=it.itmtypeid WHERE iv.inv_id={$_GET['ID']} AND iv.inv_userid=$userid",$c); { } else { if($r['itmtypename'] == 'Food') { } else { } } } $h->endpage(); ?>
Wyskakuje cos tam z unexpected $end. Moze mi ktos pomóc to dobrze po³±czyc?