PDA

View Full Version : An error in the rpg_install.php


Blootix
03-06-2005, 12:06 AM
There's an error in rpg_install.php.

Parse error: parse error, unexpected ')', expecting ']' in /home/phalanx/public_html/testvb/admincp/rpg_install.php on line 1516

Fresh install on a test board in vB 3.0.7.

Revan
03-06-2005, 12:53 AM
Fixed.
Add the ] it wants after the 'part' to fix it.

Ganon
03-06-2005, 01:00 AM
Is the updated file in the ZIP? If not, exactly where do you add the ] -- my editing program doesn't give me line numbers unfortunately.

Blootix
03-06-2005, 06:05 AM
Is the updated file in the ZIP? If not, exactly where do you add the ] -- my editing program doesn't give me line numbers unfortunately.
Go download Notepad +. It's a free software that works great.

The zip is updated. I checked ;).

Ok, now I got an SQL problem while I was running the installer and it came to the db part. I refreshed once, and got this:


Database error in vBulletin 3.0.7:

Invalid SQL:
ALTER TABLE `vb3_user`
ADD `rpgclass` int(3) NOT NULL,
ADD `rpgrace` int(3) NOT NULL,
ADD `alignment` int(3) NOT NULL,
ADD `rpgtype` int(3) NOT NULL,
ADD `rpggender` int(3) NOT NULL,
ADD `hp` int(6) NOT NULL default '0',
ADD `maxhp` int(6) NOT NULL default '0',
ADD `ma` int(6) NOT NULL default '0',
ADD `maxma` int(6) NOT NULL default '0',
ADD `pp` int(6) NOT NULL default '0',
ADD `maxpp` int(6) NOT NULL default '0',
ADD `ap` int(6) NOT NULL default '0',
ADD `element` int(3) NOT NULL default '0',
ADD `inbattle` int(3) NOT NULL default '0',
ADD `xp` int(11) NOT NULL default '0',
ADD `clan` smallint(5) NOT NULL default '0',
ADD `chalable` tinyint(1) NOT NULL default '1'

mysql error: Duplicate column name 'rpgclass'

mysql error number: 1060

Help! Even though this is just a test board I want to have it running at the real board soon!

Revan
03-06-2005, 10:01 AM
The parse error can safely be ignored, the entire hack was installed successfully.
What was NOT done though, is:
* Rebuild of datastore
* Rebuild of phrases
* Rebuild of styles

To remedy this:
Enter your ACP;
* open any random setting page, save the settings.
* Under Styles and templates, open any random template that you have modified before (important!), and save it instantly
* Under Languages and Phrases, click Language Manager, then Rebuild all languages.

Blootix
03-06-2005, 02:57 PM
The parse error can safely be ignored, the entire hack was installed successfully.
What was NOT done though, is:
* Rebuild of datastore
* Rebuild of phrases
* Rebuild of styles

To remedy this:
Enter your ACP;
* open any random setting page, save the settings.
* Under Styles and templates, open any random template that you have modified before (important!), and save it instantly
* Under Languages and Phrases, click Language Manager, then Rebuild all languages.
Ok, did that.

However, on View Battles, Add Battle Scenes, Edit Battle Scenes, Add Battle Midis, Edit Battle Midis, and Prune Battles pages doesn't have words (In the ACP)

Edit Class Returns with:
Database error in vBulletin 3.0.7:

Invalid SQL: SELECT MAX(id) AS id_types FROM vb3_rpg_type ORDER BY name
mysql error: Table 'phalanx_testboard.vb3_rpg_type' doesn't exist

mysql error number: 1146

Add Classes returns with:
Database error in vBulletin 3.0.7:

Invalid SQL: SELECT * FROM vb3_rpg_type ORDER BY name
mysql error: Table 'phalanx_testboard.vb3_rpg_type' doesn't exist

mysql error number: 1146

Edit Lottery and Pick Winner returns with:
Database error in vBulletin 3.0.7:

Invalid SQL: SELECT * FROM vb3_rpg_lottery ORDER BY dateset asc
mysql error: Table 'phalanx_testboard.vb3_rpg_lottery' doesn't exist

mysql error number: 1146

Trying to do a DB fix comes with:
Database error in vBulletin 3.0.7:

Invalid SQL:
SELECT
vb3_user.userid
FROM vb3_user
LEFT JOIN vb3_rpg_items_user ON vb3_user.userid=vb3_rpg_items_user.userid
WHERE vb3_rpg_items_user.userid IS NULL

mysql error: Table 'phalanx_testboard.vb3_rpg_items_user' doesn't exist

mysql error number: 1146

Also, when I go to any RPG pages such as "forums/battle.php" it comes with a blank page.

What should be done to fix these?

Revan
03-06-2005, 04:19 PM
Weird... I saw the parse error right before the "done" step of the installer.
All I can say is that you have to manually drop the tables/fields created and Uninstall everything not query-related using the installer, then reinstall.
Since its a test board then it doesnt matter much, phew :p
Everything will work great on yer live board ;)

TTG
03-06-2005, 08:33 PM
Everything will work great on yer live board ;)

Except asking headquaters.php produces

Database error in vBulletin 3.0.6:

Invalid SQL: SELECT level1_wins, level2_wins FROM rpg_limit_settings
mysql error: Table 'thetechg_retreat.rpg_limit_settings' doesn't exist

Chief Corn
03-06-2005, 09:31 PM
i remember that headquarters.php error being a beta 1 problem...are you using beta 2?

hXc Radio
03-07-2005, 01:16 AM
I am receiving on admincp/rpg_install.php?step=install&part=queries&all=yes

Created Table: rpg_items
Created Table: rpg_items_cats

There seems to have been a slight problem with the HxC Forums database.
Please try again by pressing the refresh button in your browser.

An E-Mail has been dispatched to our Technical Staff, who you can also contact if the problem persists.

We apologise for any inconvenience.





Database error in vBulletin 3.0.7:

Invalid SQL:
CREATE TABLE `rpg_items_user`
(
`userid` int(10) unsigned NOT NULL default '0',
`item0` char(250) NOT NULL default 'No Item',
`points0` int(5) NOT NULL default '0',
`description0` char(250) NOT NULL default 'No Description Available',
`icon0` char(250) NOT NULL default '',
`itid0` int(11) NOT NULL default '0',
`item1` char(250) NOT NULL default 'No Item',
`points1` int(5) NOT NULL default '0',
`description1` char(250) NOT NULL default 'No Description Available',
`icon1` char(250) NOT NULL default '',
`itid1` int(11) NOT NULL default '0',
`item2` char(250) NOT NULL default 'No Item',
`points2` int(5) NOT NULL default '0',
`description2` char(250) NOT NULL default 'No Description Available',
`icon2` char(250) NOT NULL default '',
`itid2` int(11) NOT NULL default '0',
`item3` char(250) NOT NULL default 'No Item',
`points3` int(5) NOT NULL default '0',
`description3` char(250) NOT NULL default 'No Description Available',
`icon3` char(250) NOT NULL default '',
`itid3` int(11) NOT NULL default '0'
PRIMARY KEY (`userid`)
) TYPE=MyISAM;

mysql error: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '(`userid`)
) TYPE=MyISAM' at line 24

mysql error number: 1064

Revan
03-07-2005, 06:54 AM
It is missing a comma after `itid3` int(11) NOT NULL default '0'
Im uploading a fixed file now.
To remedy this, you have to run uninstall on everything apart from queries, then manually drop every table it has created so far, including the stuff in the user table, then reinstall.
Alternatively, IF the uninstall process is designed like I think, you can TRY to uninstall and see if it does undo the changes.

animedj
03-07-2005, 12:14 PM
found sql 2 errors in today's update:


$RPG_sql['populate']['query']['rpg_element'] = "
INSERT INTO `" . TABLE_PREFIX . "rpg_element`
(`name`, `hp`, `ma`, `pp`, `ap`)
VALUES
('Unknown', '0', '0', '0', '0'),
('Dark', '30', '30', '50', '60', '0', '0', '5', '0'),


I'm guessing it should go like this:


$RPG_sql['populate']['query']['rpg_element'] = "
INSERT INTO `" . TABLE_PREFIX . "rpg_element`
(`name`, `hp`, `ma`, `pp`, `ap`, `str`, `def`, `strength`, `weakness`)
VALUES
('Unknown', '0', '0', '0', '0', '0', '0', '0', '0'),
('Dark', '30', '30', '50', '60', '0', '0', '5', '0'),


also I found:


INSERT INTO " . TABLE_PREFIX . "rpg_items_cats
(`name, `description`, `catorder`, `ownerid`, `sold`, `profit`, `battletype`, `itemonofforder`)
VALUES


ownerid doesn't exist in the new tables created so I removed it.


INSERT INTO " . TABLE_PREFIX . "rpg_items_cats
(`name, `description`, `catorder`, `sold`, `profit`, `battletype`, `itemonofforder`)
VALUES


Also another bug that I just found was creating my character. It said that 'rpgstats' didn't exists in my user table so I had to create it manually.

Revan
03-07-2005, 02:27 PM
I fixed all those problems, and did some tweaking on the installer.
It was falsely letting you select multiple options for Uninstall, when testing has shown this to be impossible to accomplish.
Fix to be uploaded soon, I just need to test some other stuff first

hXc Radio
03-07-2005, 07:20 PM
Fix to be uploaded soon, I just need to test some other stuff first

awesome! thanks for the fast fixes... *clicks install* and awaits the new installer to be uploaded

Blootix
03-08-2005, 11:32 PM
awesome! thanks for the fast fixes... *clicks install* and awaits the new installer to be uploaded
Did everybody actually install successfully? Because I reset the test board (with uShop installed), and tried to install again, but the installer gives me this message:
Database error in vBulletin 3.0.7:

Invalid SQL:
INSERT INTO vb3_`rpg_class`
(`name`, `folder`, `regatt`, `magicatt`, `magicdef`, `regdef`, `speed`, `evade`, `type`, `typename`, `visible`, `gender`)
VALUES
('Unknown', 'mclasses/nonem', 1, 1, 1, 1, 1, 1, '0', 'Generic', 1, 2),
('Amazon', 'fclasses/archerf', 8, 8, 6, 8, 5, 5, '0', 'Generic', 1, 1),
('Archer', 'fclasses/archerf', 9, 7, 6, 8, 5, 5, '0', 'Generic', 1, 1),
('Archmage', 'fclasses/archmagef', 6, 10, 8, 7, 4, 4, '0', 'Generic', 1, 1),
('Assassin', 'fclasses/assassinf', 10, 8, 7, 6, 5, 5, '0', 'Generic', 1, 1),
('Black Mage', 'fclasses/blackmagef', 6, 10, 10, 7, 4, 4, '0', 'Generic', 1, 1),
('Blacksmith', 'fclasses/blacksmithf', 8, 7, 8, 9, 4, 4, '0', 'Generic', 1, 1),
('Calculator', 'fclasses/calculatorf', 7, 7, 8, 8, 5, 5, '0', 'Generic', 1, 1),
('Captain', 'fclasses/captainf', 10, 6, 6, 10, 4, 4, '0', 'Generic', 1, 1),
('Chemist', 'fclasses/chemistf', 7, 8, 8, 9, 5, 5, '0', 'Generic', 1, 1),
('Dark Knight', 'fclasses/darkknightf', 9, 9, 6, 7, 4, 4, '0', 'Generic', 1, 1),
('Dragoon', 'fclasses/dragoonf', 8, 8, 7, 7, 6, 6, '0', 'Generic', 1, 1),
('Ex-Soldier', 'fclasses/ex-soldierf', 10, 6, 7, 9, 5, 5, '0', 'Generic', 1, 1),
('Foot Soldier', 'fclasses/footsoldierf', 9, 7, 6, 10, 4, 4, '0', 'Generic', 1, 1),
('Gambler', 'fclasses/gamblerf', 7, 8, 6, 9, 6, 6, '0', 'Generic', 1, 1),
('Geomancer', 'fclasses/geomancerf', 7, 8, 9, 8, 4, 4, '0', 'Generic', 1, 1),
('Holy Knight', 'fclasses/holyknightf', 9, 8, 7, 7, 5, 5, '0', 'Generic', 1, 1),
('Knight', 'fclasses/knightf', 9, 6, 8, 9, 4, 4, '0', 'Generic', 1, 1),
('Mediator', 'fclasses/mediatorf', 7, 8, 9, 8, 5, 5, '0', 'Generic', 1, 1),
('Mercenary', 'fclasses/mercenaryf', 9, 7, 7, 8, 5, 5, '0', 'Generic', 1, 1),
('Mime', 'fclasses/mimef', 8, 8, 6, 8, 5, 5, '0', 'Generic', 1, 1),
('Monk', 'fclasses/monkf', 9, 7, 6, 8, 5, 5, '0', 'Generic', 1, 1),
('Ninja', 'fclasses/ninjaf', 9, 8, 7, 6, 5, 5, '0', 'Generic', 1, 1),
('Oracle', 'fclasses/oraclef', 9, 7, 6, 9, 6, 5, '0', 'Generic', 1, 1),
('Red Mage', 'fclasses/redmagef', 9, 7, 7, 9, 5, 5, '0', 'Generic', 1, 1),
('Samurai', 'fclasses/samuraif', 9, 7, 6, 8, 5, 5, '0', 'Generic', 1, 1),
('Sniper', 'fclasses/sniperf', 9, 8, 6, 8, 5, 5, '0', 'Generic', 1, 1),
('Squire', 'fclasses/squiref', 8, 6, 7, 9, 5, 5, '0', 'Generic', 1, 1),
('Summoner', 'fclasses/summonerf', 9, 7, 6, 7, 6, 6, '0', 'Generic', 1, 1),
('Thief', 'fclasses/thieff', 8, 7, 6, 7, 6, 6, '0', 'Generic', 1, 1),
('Time Mage', 'fclasses/timemagef', 8, 5, 6, 8, 7, 6, '0', 'Generic', 1, 1),
('Vampire', 'fclasses/vampiref', 8, 8, 7, 7, 5, 5, '0', 'Generic', 1, 1),
('White Mage', 'fclasses/whitemagef', 6, 5, 8, 8, 7, 6, '0', 'Generic', 1, 1),
('Sky Reaper', 'mclasses/skyreaperm', 8, 8, 6, 8, 5, 5, '0', 'Generic', 1, 1),
('Archer', 'mclasses/archerm', 9, 7, 6, 8, 5, 5, '0', 'Generic', 1, 2),
('Archmage', 'mclasses/archmagem', 6, 10, 8, 7, 4, 4, '0', 'Generic', 1, 2),
('Assassin', 'mclasses/assassinm', 10, 8, 7, 6, 5, 5, '0', 'Generic', 1, 2),
('Black Mage', 'mclasses/blackmagem', 6, 10, 10, 7, 4, 4, '0', 'Generic', 1, 2),
('Blacksmith', 'mclasses/blacksmithm', 8, 7, 8, 9, 4, 4, '0', 'Generic', 1, 2),
('Bodyguard', 'mclasses/bodyguardm', 8, 7, 8, 9, 5, 4, '0', 'Generic', 1, 2),
('Calculator', 'mclasses/calculatorm', 7, 7, 8, 8, 5, 5, '0', 'Generic', 1, 2),
('Captain', 'mclasses/captainm', 10, 6, 6, 10, 4, 4, '0', 'Generic', 1, 2),
('Chemist', 'mclasses/chemistm', 7, 8, 8, 9, 5, 5, '0', 'Generic', 1, 2),
('Dark Knight', 'mclasses/darkknightm', 9, 9, 6, 7, 4, 4, '0', 'Generic', 1, 2),
('Dragoon', 'mclasses/dragoonm', 8, 8, 7, 7, 6, 6, '0', 'Generic', 1, 2),
('Ex-Soldier', 'mclasses/ex-soldierm', 10, 6, 7, 9, 5, 5, '0', 'Generic', 1, 2),
('Foot Soldier', 'mclasses/footsoldierm', 9, 7, 6, 10, 4, 4, '0', 'Generic', 1, 2),
('Gambler', 'mclasses/gamblerm', 7, 8, 6, 9, 6, 6, '0', 'Generic', 1, 2),
('Geomancer', 'mclasses/geomancerm', 7, 8, 9, 8, 4, 4, '0', 'Generic', 1, 2),
('Holy Knight', 'mclasses/holyknightm', 9, 8, 7, 7, 5, 5, '0', 'Generic', 1, 2),
('Knight', 'mclasses/knightm', 9, 6, 8, 9, 4, 4, '0', 'Generic', 1, 2),
('Mediator', 'mclasses/mediatorm', 7, 8, 9, 8, 5, 5, '0', 'Generic', 1, 2),
('Mercenary', 'mclasses/mercenarym', 9, 7, 7, 8, 5, 5, '0', 'Generic', 1, 2),
('Mime', 'mclasses/mimem', 8, 8, 6, 8, 5, 5, '0', 'Generic', 1, 2),
('Monk', 'mclasses/monkm', 9, 7, 6, 8, 5, 5, '0', 'Generic', 1, 2),
('Ninja', 'mclasses/ninjam', 9, 8, 7, 6, 5, 5, '0', 'Generic', 1, 2),
('Oracle', 'mclasses/oraclem', 9, 7, 6, 9, 6, 5, '0', 'Generic', 1, 2),
('Red Mage', 'mclasses/redmagem', 9, 7, 7, 9, 5, 5, '0', 'Generic', 1, 2),
('Samurai', 'mclasses/samuraim', 9, 7, 6, 8, 5, 5, '0', 'Generic', 1, 2),
('Sniper', 'mclasses/sniperm', 9, 8, 6, 8, 5, 5, '0', 'Generic', 1, 2),
('Squire', 'mclasses/squirem', 8, 6, 7, 9, 5, 5, '0', 'Generic', 1, 2),
('Summoner', 'mclasses/summonerm', 9, 7, 6, 7, 6, 6, '0', 'Generic', 1, 2),
('Thief', 'mclasses/thiefm', 8, 7, 6, 7, 6, 6, '0', 'Generic', 1, 2),
('Time Mage', 'mclasses/timemagem', 8, 5, 6, 8, 7, 6, '0', 'Generic', 1, 2),
('Vampire', 'mclasses/vampirem', 8, 8, 7, 7, 5, 5, '0', 'Generic', 1, 2),
('White Mage', 'mclasses/whitemagem', 6, 5, 8, 8, 7, 6, '0', 'Generic', 1, 2)

mysql error: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'rpg_class`
(`name`, `folder`, `regatt`, `magicatt`, `magicdef`

mysql error number: 1064

I don't think it'll work on the real board if it doesn't work here... Need a fix >_<

animedj
03-09-2005, 01:03 AM
ahh see the problem, in install/rpg_mysql-schema.php look for


$RPG_sql['populate']['query']['rpg_class'] = "
INSERT INTO " . TABLE_PREFIX . "`rpg_class`


and replace for


$RPG_sql['populate']['query']['rpg_class'] = "
INSERT INTO `" . TABLE_PREFIX . "rpg_class`

Revan
03-09-2005, 01:45 PM
Yeah, I really should setup localhost with a prefix...

Blootix
03-09-2005, 09:45 PM
Yeah, I really should setup localhost with a prefix...
Problem solved. Successfully installed! Yay!

bluesteel
03-11-2005, 03:57 PM
Hi again Revan

When I tried to save changes in Headquarters, I got an SQL error. Complained about field5 not existing in the userfields table. Checked it, and sure enough field5 was missing!
Added it manually using myPHPAdmin and it works ok now.

Revan
03-11-2005, 04:14 PM
That is because the AdminCP setting was set to use field5.
Adding it manually is not recommended as it will not work as expected.
You must update the ACP setting yourself.
*thinks he has to code a fix for this as people can't seem to find that setting....*

bluesteel
03-11-2005, 04:26 PM
Thanks Fillip. I'll look into that later when I have more time.
Might even read the manual lol

PolyMarauder
03-12-2005, 11:43 PM
Well I tried upgrading and I got some errors that were all ready posted so I will not post them here again. I then tried the uninstall and it said it uninstalled successfully my board worked fine you could brows threw but if you click on a thread a SQL error would pop up. So I am guessing the uninstaller uninstalls even the old version not just the updated part?

I don?t normally like to upgrade hacks like this I would rather install fresh copies. Is there anyway to manually remove the old hack so I can try a fresh install? I tried upgrading and then uninstalling and then doing a fresh install but that did not work. These auto installs scare me as I have no idea whats being changed. You think I could do in manually maybe? I just like to know whats being modified and I feel blind with auto installs. I had to revert to a backup copy of the board because I had no idea what was changed.

Only thing I have modified on my board for this hack is the postbit but that should not be causing any problems right? I have also not updated to 3.0.7 im on 3.0.6 cause I don?t have the HTML security problem and Im lazy (lol)?

I can?t wait till this hack gets past beta. I normally don?t fool around with betas but I love this hack. I could contribute to it if I could get that darn thing working so I can test out my templates. ;)

Revan
03-12-2005, 11:53 PM
To uninstall the old hack, you have to run its installer file and delete from there. The new uninstall part does not remove old code, hence why an upgrade is the only possible course of action when an older version is detected.
The reason why uninstall caused SQL errors on showthread was because it calls tables that you have removed.
Also if you could reference to the errors you got at upgrade, the script was throroughly tested and the latest installer version shouldn't contain any more bugs...

This installer is set to echo every last change, so you know EXACTLY whats going on. It modifies the user table, you get a message saying this.
To find to exactly what was changed table wise, you could just pick open the file.
I HAD to make an auto installer because advanced parsing had to be done to convert the rpg_items_options and rpg_battle_options to $vboptions :P
Plus the installer looks good and is cool :p

To manually remove the old hack, you have to wipe all references to it from the dbase, its too late in the night for me to dig these out :P

Gohan
03-13-2005, 09:11 PM
I got error install:

Database error in vBulletin 3.0.6:

Invalid SQL: SELECT `profilefieldid` AS `id` FROM `profilefield` WHERE `varname` = 'RPG Name'
mysql error: Unknown column 'varname' in 'where clause'

mysql error number: 1054

Date: Sunday 13th of March 2005 11:48:35 PM
Script: http://members.lycos.nl/ffthunderfr.../admincp/rpg_install.php?step=install&part=queries&all=yes
Referer:

rpg_install.php (line 680)

$rpgname = $DB_site->query_first("SELECT `profilefieldid` AS `id` FROM `" . TABLE_PREFIX . "profilefield` WHERE `varname` = 'RPG Name'");
$DB_site->query("UPDATE `" . TABLE_PREFIX . "setting` SET `value` = 'field$rpgname[id]' WHERE `varname` = 'rpg_namefield'");


Bug or something?

Revan
03-14-2005, 06:51 AM
Check the release thread, this has been fixed.

I don't send email updates on all stuff I fix, because then people's emails would be spammed XD
Mind you, Im not trying to berate you for not realising this was fixed, I just wanted to explain myself :)