Code problem with ArmorySynch 1.7.X

Sync Blizzards' Armory data with WoWRoster (addon depreciated no longer works see ApiSync)

Moderators: Ulminia, poetter

Code problem with ArmorySynch 1.7.X

Postby Exylus » Tue Dec 25, 2007 5:58 am

1064: 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 '(players.dateupdatedutc,'%m/%d/%y %h:%i:%s') AS playerLastUpdat


SQL:
SELECT members.name , ISNULL(players.name) AS playerExists , STR_TO_DATE(players.dateupdatedutc,'%m/%d/%y %h:%i:%s') AS playerLastUpdated FROM `roster_members` members LEFT JOIN `roster_players` players ON members.name = players.name WHERE members.level >= 10 AND ( ISNULL(players.name) OR STR_TO_DATE(players.dateupdatedutc,'%m/%d/%y %h:%i:%s') <= DATE_SUB(NOW(), INTERVAL 24 HOUR) OR STR_TO_DATE(players.dateupdatedutc,'%m/%d/%y %h:%i:%s') >= DATE_ADD(NOW(), INTERVAL 1 YEAR) ) ORDER BY members.last_online DESC
File: index.php
Line: 42
Backtrace (most recent call last):

* File: /mnt/web6/10/00/51402500/htdocs/fosdomination/roster/lib/commonfunctions.lib.php
o line 248
o function called: backtrace
* File: /mnt/web6/10/00/51402500/htdocs/fosdomination/roster/addons/ArmorySynch/index.php
o line 42
o function called: die_quietly
o args: 1064: 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 '(players.dateupdatedutc,'%m/%d/%y %h:%i:%s') AS playerLastUpdat, Database Error, index.php, 42, SELECT members.name , ISNULL(players.name) AS playerExists , STR_TO_DATE(players.dateupdatedutc,'%m/%d/%y %h:%i:%s') AS playerLastUpdated FROM `roster_members` members LEFT JOIN `roster_players` players ON members.name = players.name WHERE members.level >= 10 AND ( ISNULL(players.name) OR STR_TO_DATE(players.dateupdatedutc,'%m/%d/%y %h:%i:%s') <= DATE_SUB(NOW(), INTERVAL 24 HOUR) OR STR_TO_DATE(players.dateupdatedutc,'%m/%d/%y %h:%i:%s') >= DATE_ADD(NOW(), INTERVAL 1 YEAR) ) ORDER BY members.last_online DESC
* File: /mnt/web6/10/00/51402500/htdocs/fosdomination/roster/addon.php
o line 77
o function called: include_once
o args: /mnt/web6/10/00/51402500/htdocs/fosdomination/roster/addons/ArmorySynch/index.php




That is what sql error its giving, and im new to php coding so i cant make anything out of this except that the problem appears to be in index.php of the addon. This is the code where i think the problem is.



$query =
"SELECT members.name " .
", ISNULL(players.name) AS playerExists " .
", STR_TO_DATE(players.dateupdatedutc,'". $addon_conf['ArmorySync']['DateUpdatedFormat'] ."') AS playerLastUpdated " .
"FROM `".ROSTER_MEMBERSTABLE."` members " .
"LEFT JOIN `".ROSTER_PLAYERSTABLE."` players " .
"ON members.name = players.name " .
"WHERE members.level >= " . $addon_conf['ArmorySync']['MinLevel'] . " " .
"AND ( ".
"ISNULL(players.name) " .
"OR STR_TO_DATE(players.dateupdatedutc,'". $addon_conf['ArmorySync']['DateUpdatedFormat'] ."') <= DATE_SUB(NOW(), INTERVAL " . $addon_conf['ArmorySync']['SynchCutoffTime'] . " HOUR) " .
"OR STR_TO_DATE(players.dateupdatedutc,'". $addon_conf['ArmorySync']['DateUpdatedFormat'] ."') >= DATE_ADD(NOW(), INTERVAL 1 YEAR) " .
") " .
"ORDER BY " . $addon_conf['ArmorySync']['MemberSorting'];

if ($addon_conf['ArmorySync']['DebugLevel'] >= 1) {
print $query . "<br>";
}



But as i said im new to php coding, here is the config text.




<?php

if (!defined('ROSTER_INSTALLED')) {
exit('Detected invalid access to this file!');
}

//Configuration
$addon_conf['ArmorySync']['Host'] = "armory.worldofwarcraft.com"; //European players use: armory.wow-europe.com
$addon_conf['ArmorySync']['MinLevel'] = 10; //The minimum level to be updated
$addon_conf['ArmorySync']['SynchCutoffTime'] = 24; //Time, in hours. All players who have not updated in the last (24) hours will be updated.
$addon_conf['ArmorySync']['UseCurl'] = true; //Set this to false if you want to use the original FileSocket function.
$addon_conf['ArmorySync']['DebugLevel'] = 0; //0 = no debug messages, 1 = some debug messages, 2 = verbose debug messages
$addon_conf['ArmorySync']['UpdateRoster'] = true; //Wether or not to update Roster. Useful if you're just debugging.
$addon_conf['ArmorySync']['Locale'] = $roster_conf['roster_lang']; //The language used, but default it is the language that roster is configured to.
$addon_conf['ArmorySync']['ArmoryLocale'] = strtolower(substr($addon_conf['ArmorySync']['Locale'], 0, 2)) . "_" . strtolower(substr($addon_conf['ArmorySync']['Locale'], 2, 2)); //The Locale that armory is expecting, in the format of lowercase_lowercase (ie en_us or de_de).
$addon_conf['ArmorySync']['MemberSorting'] = ""members.update_time DESC"; //alternatives are "members.update_time DESC" to use the last time the member was updated
$addon_conf['ArmorySync']['ServerMonth'] = array("January","February","March","April","May","June","July","August","September","October","November","December"); //just a list of the month names for the server. Change this to whatever language necessary.
$addon_conf['ArmorySync']['DateUpdatedFormat'] = "%m/%d/%y %h:%i:%s"; //Europeans change this to "%d/%m/%y %H:%i:%s"
?>



tell me what else you need and ill post it any help would be arreciated.

This is for a EU server by the way.

Thanks Exilus
Exylus
WR.net Apprentice
WR.net Apprentice
 
Posts: 2
Joined: Thu Dec 13, 2007 10:49 pm

Code problem with ArmorySynch 1.7.X

Postby zanix » Tue Dec 25, 2007 7:08 am

Moved to the correct forum
Read the Forum Rules, the WiKi, and Search before posting!
WoWRoster v2.1 - SigGen v0.3.3.523 - WoWRosterDF
User avatar
zanix
Admin
Admin
WoWRoster.net Dev Team
WoWRoster.net Dev Team
UA/UU Developer
UA/UU Developer
 
Posts: 5546
Joined: Mon Jul 03, 2006 8:29 am
Location: Idaho Falls, Idaho
Realm: Doomhammer (PvE) - US

Code problem with ArmorySynch 1.7.X

Postby poetter » Tue Dec 25, 2007 6:01 pm

What version of AS is this?
What is you php version?
What is your mysql version?
Image
User avatar
poetter
Roster AddOn Dev
Roster AddOn Dev
 
Posts: 462
Joined: Sat Jun 30, 2007 9:41 pm
Location: Germany/Hamburg

Code problem with ArmorySynch 1.7.X

Postby PleegWat » Tue Dec 25, 2007 6:40 pm

From the topic, I'd say it's armorysync for roster 1.7.3, which you never maintained.
I <3 /bin/bash
User avatar
PleegWat
WoWRoster.net Dev Team
WoWRoster.net Dev Team
 
Posts: 1636
Joined: Tue Jul 04, 2006 1:43 pm


Return to ArmorySync - Depreciated

Who is online

Users browsing this forum: No registered users and 0 guests

cron