[ABD] World of Warcraft Character List

Any abandoned MODs will be moved to this forum.

WARNING: MODs in this forum are not currently being supported or maintained by the original MOD author. Proceed at your own risk.
Forum rules
IMPORTANT: MOD Development Forum rules

WARNING: MODs in this forum are not currently being supported nor updated by the original MOD author. Proceed at your own risk.
Barbatus
Registered User
Posts: 11
Joined: Thu Aug 21, 2008 8:53 pm

Re: [DEV] World of Warcraft Character List

Post by Barbatus » Sun Aug 24, 2008 2:03 pm

I may've found a bug...

On the server "Dath'Remar" addition it gives MYSQL error.

On the error:

Code: Select all

SQL ERROR [ mysql4 ]

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 'Remar' WHERE ID = '7' LIMIT 1' at line 2 [1064]

SQL

UPDATE phpbb_wow_characters SET name = 'Rakot', lvl = '50', prof1 = 'wdawd', prof1lvl = '21', prof2 = 'dwadaw', prof2lvl = '21', tree1 = '20', tree2 = '20', tree3 = '20', realm = 'Dath'Remar' WHERE ID = '7' LIMIT 1

BACKTRACE

FILE: includes/db/mysql.php
LINE: 158
CALL: dbal_mysql->sql_error()

FILE: wow_characters.php
LINE: 243
CALL: dbal_mysql->sql_query()
It looks like it cuts off Dath' part and gives it as an error.

User avatar
drumgirl67
Registered User
Posts: 145
Joined: Fri Sep 22, 2006 8:08 pm
Location: Dallas, TX
Contact:

Re: [DEV] World of Warcraft Character List

Post by drumgirl67 » Mon Aug 25, 2008 9:12 pm

new version is on original post with the realm apostrophe and other recent bug (having to do with ranks) fixed

User avatar
drumgirl67
Registered User
Posts: 145
Joined: Fri Sep 22, 2006 8:08 pm
Location: Dallas, TX
Contact:

Re: [DEV] World of Warcraft Character List

Post by drumgirl67 » Mon Aug 25, 2008 9:15 pm

Barbatus wrote:Quick question, whenever one of my users forget to type in their skill i.e.: "miner" and level of it "365" it gives them MYSQL Error.

Is there any way to fix that and add like a message "Please fill out all the field" ?
If you can copy and paste the exact error that would be great, as I have not been able to recreate the error.

Barbatus
Registered User
Posts: 11
Joined: Thu Aug 21, 2008 8:53 pm

Re: [DEV] World of Warcraft Character List

Post by Barbatus » Mon Aug 25, 2008 9:46 pm

Drumgirl67,

Code: Select all

SQL ERROR [ mysql4 ]

Incorrect integer value: '' for column 'prof1lvl' at row 1 [1366]

SQL

INSERT INTO phpbb_wow_characters (userid, name, lvl, clss, race, gender, prof1, prof1lvl, prof2, prof2lvl, tree1, tree2, tree3, main, realm) VALUES ( '2', 'Tad', '50', 'Death Knight', 'Blood Elf', 'M', '', '', '', '', '20', '', '20', '0', 'Icecrown')

BACKTRACE


FILE: includes/db/mysql.php
LINE: 158
CALL: dbal_mysql->sql_error()

FILE: wow_characters.php
LINE: 367
CALL: dbal_mysql->sql_query()

This is stupid, but basically this happens when you fill all the fields, but the Professions/Skills section. :)

Heklyps
Registered User
Posts: 8
Joined: Tue Aug 12, 2008 5:47 pm
Location: FR
Contact:

Re: [DEV] World of Warcraft Character List

Post by Heklyps » Wed Aug 27, 2008 5:18 pm

Hi,
any chance to have war version soon ?
I'll be very interested :oops:

User avatar
drumgirl67
Registered User
Posts: 145
Joined: Fri Sep 22, 2006 8:08 pm
Location: Dallas, TX
Contact:

Re: [DEV] World of Warcraft Character List

Post by drumgirl67 » Wed Aug 27, 2008 5:43 pm

Heklyps wrote:Hi,
any chance to have war version soon ?
I'll be very interested :oops:
Soon, don't know how soon as I'm in my first week back in class and I can't work on it when I'm not at home anymore.

It'll be out by the head start at an absolute minimum.

User avatar
drumgirl67
Registered User
Posts: 145
Joined: Fri Sep 22, 2006 8:08 pm
Location: Dallas, TX
Contact:

Re: [DEV] World of Warcraft Character List

Post by drumgirl67 » Fri Aug 29, 2008 1:31 am


User avatar
drumgirl67
Registered User
Posts: 145
Joined: Fri Sep 22, 2006 8:08 pm
Location: Dallas, TX
Contact:

Re: [DEV] World of Warcraft Character List

Post by drumgirl67 » Fri Aug 29, 2008 1:50 am

Barbatus wrote:Drumgirl67,

Code: Select all

SQL ERROR [ mysql4 ]

Incorrect integer value: '' for column 'prof1lvl' at row 1 [1366]

SQL

INSERT INTO phpbb_wow_characters (userid, name, lvl, clss, race, gender, prof1, prof1lvl, prof2, prof2lvl, tree1, tree2, tree3, main, realm) VALUES ( '2', 'Tad', '50', 'Death Knight', 'Blood Elf', 'M', '', '', '', '', '20', '', '20', '0', 'Icecrown')

BACKTRACE


FILE: includes/db/mysql.php
LINE: 158
CALL: dbal_mysql->sql_error()

FILE: wow_characters.php
LINE: 367
CALL: dbal_mysql->sql_query()

This is stupid, but basically this happens when you fill all the fields, but the Professions/Skills section. :)
Well I can't test it since it doesn't happen to me, but try this:

In wow_characters.php
Find:

Code: Select all

		$prof1lvl = request_var('prof1lvl', '');
		$prof2lvl = request_var('prof2lvl', '');
Replace with:

Code: Select all

		$prof1lvl = request_var('prof1lvl', '0');
		$prof2lvl = request_var('prof2lvl', '0');
There's probably multiple instances of that code, do it for each time, see if that helps.

Heklyps
Registered User
Posts: 8
Joined: Tue Aug 12, 2008 5:47 pm
Location: FR
Contact:

Re: [DEV] World of Warcraft Character List

Post by Heklyps » Fri Aug 29, 2008 8:54 am

thx :D

Big_Kahuna
Registered User
Posts: 28
Joined: Wed Mar 09, 2005 8:50 am
Contact:

Re: [DEV] World of Warcraft Character List

Post by Big_Kahuna » Mon Sep 08, 2008 8:52 am

Is it possible to list a members character(s) on their profile page?

User avatar
drumgirl67
Registered User
Posts: 145
Joined: Fri Sep 22, 2006 8:08 pm
Location: Dallas, TX
Contact:

Re: [DEV] World of Warcraft Character List

Post by drumgirl67 » Mon Sep 08, 2008 3:08 pm

Big_Kahuna wrote:Is it possible to list a members character(s) on their profile page?
I haven't tried yet but if you're wanting to do it yourself, then I would imagine the code for the viewtopic part of the mod will be a big help to you.

Big_Kahuna
Registered User
Posts: 28
Joined: Wed Mar 09, 2005 8:50 am
Contact:

Re: [DEV] World of Warcraft Character List

Post by Big_Kahuna » Fri Sep 12, 2008 6:59 pm

drumgirl67 wrote:
Big_Kahuna wrote:Is it possible to list a members character(s) on their profile page?
I haven't tried yet but if you're wanting to do it yourself, then I would imagine the code for the viewtopic part of the mod will be a big help to you.
Ok ,thanks. I'll probably do it myself then :)

User avatar
drumstix42
Registered User
Posts: 1100
Joined: Tue Sep 24, 2002 11:01 pm
Location: NJ
Contact:

Re: [DEV] World of Warcraft Character List

Post by drumstix42 » Fri Sep 12, 2008 9:02 pm

Greetings,

If you haven't already, I was going to try converting the code to be used on an EverQuest 2 guild forum. I dunno if it will be as spiffy, but if I can get it working from what you've supplied already, I'd be glad to share.

-Drum
Need a phpBB update or mod installed? PM me for any questions and pricing!
HostMonster.com (Unlimited Space, Unlimited Transfer, Unlimited Domains, $6.95/month )

Dracula78
Registered User
Posts: 4
Joined: Mon Aug 09, 2004 12:27 am

Re: [DEV] World of Warcraft Character List

Post by Dracula78 » Tue Sep 16, 2008 2:15 pm

Nice mod, I'm trying to link it to my phpRaider database and only use the visualization of this mod, because phpRaider also links phpBB3 forum accounts to WoW characters, and allows users to add/edit their own main/alt characters.
drumgirl67 wrote:new version is on original post with the realm apostrophe and other recent bug (having to do with ranks) fixed
That only fixes apostrophes in realm names, but not in other fields (like character names).
I'd suggest using a wrapper function when you use user input in your mysql query, in order to prevent all kind of SQL injection exploits. The function below escapes all special chars from parameters and surrounds them in quotes.

Taken from PHP: mysql_query comments:

Code: Select all

    // mysql_query() wrapper. takes two arguments. first
    // is the query with '?' placeholders in it. second argument
    // is an array containing the values to substitute in place
    // of the placeholders (in order, of course).
    function mysql_prepare ($query, $phs = array()) {
        foreach ($phs as $ph) {
            $ph = "'" . mysql_real_escape_string($ph) . "'";
            $query = substr_replace(
                $query, $ph, strpos($query, '?'), 1
            );
        }
        return mysql_query($query);
    }
Then you can simply use it as follows:

Code: Select all

	// Example 1
	$sql_template = "INSERT INTO phpbb_wow_characters (userid, name, lvl)
		VALUES ( ?, ?, ? )";
	$query1 = mysql_prepare( $sql_template, array($userid, $name, $lvl) );

	// Example 2
	$query2 = mysql_prepare( "SELECT userid FROM users WHERE userid=? AND passwd=?", 
		array($user, sha1($passwd)) );

User avatar
drumstix42
Registered User
Posts: 1100
Joined: Tue Sep 24, 2002 11:01 pm
Location: NJ
Contact:

Re: [DEV] World of Warcraft Character List

Post by drumstix42 » Wed Sep 17, 2008 5:37 am

drumgirl67 wrote:
Barbatus wrote:Drumgirl67,

Code: Select all

SQL ERROR [ mysql4 ]

Incorrect integer value: '' for column 'prof1lvl' at row 1 [1366]

SQL

INSERT INTO phpbb_wow_characters (userid, name, lvl, clss, race, gender, prof1, prof1lvl, prof2, prof2lvl, tree1, tree2, tree3, main, realm) VALUES ( '2', 'Tad', '50', 'Death Knight', 'Blood Elf', 'M', '', '', '', '', '20', '', '20', '0', 'Icecrown')

BACKTRACE


FILE: includes/db/mysql.php
LINE: 158
CALL: dbal_mysql->sql_error()

FILE: wow_characters.php
LINE: 367
CALL: dbal_mysql->sql_query()

This is stupid, but basically this happens when you fill all the fields, but the Professions/Skills section. :)
Well I can't test it since it doesn't happen to me, but try this:

In wow_characters.php
Find:

Code: Select all

		$prof1lvl = request_var('prof1lvl', '');
		$prof2lvl = request_var('prof2lvl', '');
Replace with:

Code: Select all

		$prof1lvl = request_var('prof1lvl', '0');
		$prof2lvl = request_var('prof2lvl', '0');
There's probably multiple instances of that code, do it for each time, see if that helps.
I had the same problem. Instead of your fixed posted above (which didn't seem to work unfortunately), simple go into your database and change lvl, tree1, tree2, tree3, prof1lvl, and prof2lvl to be char(30) instead of smallint.
This will get around the errors, and the value checking will still work (max level/skill).

Or.... use the SQL code below

SQL code:

Code: Select all

ALTER TABLE `phpbb_wow_characters` CHANGE `lvl` `lvl` CHAR( 30 ) NULL DEFAULT NULL ,
CHANGE `tree1` `tree1` CHAR( 30 ) NULL DEFAULT NULL ,
CHANGE `tree2` `tree2` CHAR( 30 ) NULL DEFAULT NULL ,
CHANGE `tree3` `tree3` CHAR( 30 ) NULL DEFAULT NULL ,
CHANGE `prof1lvl` `prof1lvl` CHAR( 30 ) NULL DEFAULT NULL ,
CHANGE `prof2lvl` `prof2lvl` CHAR( 30 ) NULL DEFAULT NULL
By the way... LOL @ this code:

Code: Select all

			$rofl = "SELECT name, lvl, clss, race, gender
				FROM phpbb_wow_characters
				WHERE userid = $userid AND main = 1 LIMIT 1";
			$lollerskates = $db->sql_query($rofl);
			if($roflcopter = $db->sql_fetchrow($lollerskates))
Need a phpBB update or mod installed? PM me for any questions and pricing!
HostMonster.com (Unlimited Space, Unlimited Transfer, Unlimited Domains, $6.95/month )

Locked

Return to “[3.0.x] Abandoned MODs”