View Single Post
  #68  
Old 03-20-2008, 12:12 AM
Eviserator Eviserator is offline
 
Join Date: Feb 2008
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If you are receiving the following error:

PHP Fatal error:

Cannot use string offset as an array in /XXX/XXX/XXX/forum/includes/cron/cron.gwowevents.charinfo.php on line 50

I have rewritten the CRON process and it is working fine for me now.

Try replacing ALL of the code in your cron.gwowevents.charinfo.php file with the following:

Code:
<?php
	// ########################################################################
	//
	// gWoWEvents, Copyright ? 2006, Ryan Snook (www.gryphonllc.com )
	//
	// If you have fixes, improvements or other additions to make to
	// gWoWEvents, please contact me at rsnook@gmail.com for collaboration.
	// I appreciate your kind consideration.
	//
	// This work is licensed under the Creative Commons
	// Attribution-Noncommercial-No Derivative Works 3.0 United States License.
	// To view a copy of this license, visit
	// http://creativecommons.org/licenses/by-nc-nd/3.0/us/ or send a letter to
	// Creative Commons, 171 Second Street, Suite 300,
	// San Francisco, California, 94105, USA.
	//
	// ########################### SVN info ###################################
	// $Id: cron.gwowevents.charinfo.php 830 2008-01-23 20:18:51Z gryphon $
	// $Rev: 830 $
	// $LastChangedBy: gryphon $
	// $Date: 2008-01-23 12:18:51 -0800 (Wed, 23 Jan 2008) $

	// ######################## SET PHP ENVIRONMENT ###########################
	error_reporting(E_ALL & ~E_NOTICE);
	if (!is_object($vbulletin->db))
	{
		exit;
	}
	// ########################## REQUIRE BACK-END ############################
	require_once('./includes/functions_gwowevents.php');
                // Following line provided by LostPhoenix  
	$res = $vbulletin->db->query("SELECT * FROM " . TABLE_PREFIX . "gwowevents WHERE `armorydata` != '1' GROUP BY `realmchar` ORDER BY `armorydata` ASC");

	while ($char = $vbulletin->db->fetch_array($res))
	{
		require_once('./includes/class_gwowarmory.php');
		$x = new gWoWArmory;
		$x->SetLocale($char['locale']);
		$x->SetRealmName($char['realm']);
		$x->SetCharName($char['character']);

		sleep(5);
		$character['sheet'] = $x->FetchCharacterSheet();
		sleep(5);
		$character['skills'] = $x->FetchCharacterSkills();

		if ($character['characterInfo']['errCode'] != 'noCharacter')
		{
                   $charinfo_query = "
                   `charurl` = '" . $character['sheet']['characterInfo']['character']['charUrl'] . "',
		   `level` = '" . $character['sheet']['characterInfo']['character']['level'] . "',
	   	   `title` = '" . $character['sheet']['characterInfo']['character']['prefix'] . "',
		   `faction` = '" . $character['sheet']['characterInfo']['character']['faction'] . "',
		   `factionid` = '" . $character['sheet']['characterInfo']['character']['factionId'] . "',
		   `gender` = '" . $character['sheet']['characterInfo']['character']['gender'] . "',
		   `genderid` = '" . $character['sheet']['characterInfo']['character']['genderId'] . "',
		   `race` = '" . $character['sheet']['characterInfo']['character']['race'] . "',
		   `raceid` = '" . $character['sheet']['characterInfo']['character']['raceId'] . "',
		   `class` = '" . $character['sheet']['characterInfo']['character']['class'] . "',
		   `classid` = '" . $character['sheet']['characterInfo']['character']['classId'] . "',
		   `talentspec` = '" . 
                     $character['sheet']['characterInfo']['characterTab']['talentSpec']['treeOne'] . "," . 
                     $character['sheet']['characterInfo']['characterTab']['talentSpec']['treeTwo'] . "," . 
                     $character['sheet']['characterInfo']['characterTab']['talentSpec']['treeThree'] . "',
		   `talent1` = '" . $character['sheet']['characterInfo']['characterTab']['talentSpec']['treeOne'] . "',
		   `talent2` = '" . $character['sheet']['characterInfo']['characterTab']['talentSpec']['treeTwo'] . "',
		   `talent3` = '" . $character['sheet']['characterInfo']['characterTab']['talentSpec']['treeThree'] . 

"',
		   `guild` = '" . $character['sheet']['characterInfo']['character']['guildName'] . "',
		   `guildurl` = '" . $character['sheet']['characterInfo']['character']['guildUrl'] . "',
		   `hp` = '" . 

$character['sheet']['characterInfo']['characterTab']['characterBars']['health']['effective'] . "',
		   `mp` = '" . 

$character['sheet']['characterInfo']['characterTab']['characterBars']['secondBar']['effective'] . "',
		   `str` = '" . 

$character['sheet']['characterInfo']['characterTab']['baseStats']['strength']['effective'] . "',
		   `agi` = '" . 

$character['sheet']['characterInfo']['characterTab']['baseStats']['agility']['effective'] . "',
		   `sta` = '" . 

$character['sheet']['characterInfo']['characterTab']['baseStats']['stamina']['effective'] . "',
		   `int` = '" . 

$character['sheet']['characterInfo']['characterTab']['baseStats']['intellect']['effective'] . "',
		   `spi` = '" . 

$character['sheet']['characterInfo']['characterTab']['baseStats']['spirit']['effective'] . "',
		   `arm` = '" . $character['sheet']['characterInfo']['characterTab']['baseStats']['armor']['effective'] 

. "',
		   `strbase` = '" . 

$character['sheet']['characterInfo']['characterTab']['baseStats']['strength']['base'] . "',
		   `agibase` = '" . 

$character['sheet']['characterInfo']['characterTab']['baseStats']['agility']['base'] . "',
		   `stabase` = '" . 

$character['sheet']['characterInfo']['characterTab']['baseStats']['stamina']['base'] . "',
		   `intbase` = '" . 

$character['sheet']['characterInfo']['characterTab']['baseStats']['intellect']['base'] . "',
		   `spibase` = '" . $character['sheet']['characterInfo']['characterTab']['baseStats']['spirit']['base'] 

. "',
		   `armbase` = '" . $character['sheet']['characterInfo']['characterTab']['baseStats']['armor']['base'] 

. "',
		   `prof1` = '" . 

$character['sheet']['characterInfo']['characterTab']['professions']['skill']['0']['name'] . "',
		   `skill1` = '" . 

$character['sheet']['characterInfo']['characterTab']['professions']['skill']['0']['value']['0'] . "',
		   `prof2` = '" . 

$character['sheet']['characterInfo']['characterTab']['professions']['skill']['1']['name'] . "',
		   `skill2` = '" . 

$character['sheet']['characterInfo']['characterTab']['professions']['skill']['1']['value']['0'] . "',
                   `cooking` = '" . 

$character['skills']['characterInfo']['skillTab']['skillCategory']['1']['skill']['0']['value']['0'] . "',
                   `firstaid` = '" . 

$character['skills']['characterInfo']['skillTab']['skillCategory']['1']['skill']['1']['value']['0'] . "',
                   `fishing` = '" . 

$character['skills']['characterInfo']['skillTab']['skillCategory']['1']['skill']['2']['value']['0'] . "',
                   `riding` = '" . 

$character['skills']['characterInfo']['skillTab']['skillCategory']['1']['skill']['3']['value']['0'] . "',
		   ";
		   $char['realmchar'] = addslashes($char['realm'] . "." . $char['character']);
		   if ($character['sheet']['characterInfo'] && 

$character['sheet']['characterInfo']['characterTab']['characterBars']['health']['effective'])
		   {
			$vbulletin->db->query("UPDATE " . TABLE_PREFIX . "gwowevents SET " . $charinfo_query . " 

`armorydata` = '1' WHERE `realmchar` = '" . $char['realmchar'] . "'");
		   }
		   else
		   {
			$vbulletin->db->query("UPDATE " . TABLE_PREFIX . "gwowevents SET `armorydata` = '2' WHERE 

`realmchar` = '" . $char['realmchar'] . "'");
    		   }
                }

		if (VB_AREA == 'AdminCP')
		{
		    echo $char['character'] . '<pre>';
                    print_r($character['skills']);
		    echo '<pre><hr />';
		}
		$char_updated .= $char['character'] . ", ";
	}
	echo $char_updated;
?>
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01208 seconds
  • Memory Usage 1,812KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete