EQRoster v4.3.2 Released (EQPlayersID and EQDump import fix)

Put your EQRoster related questions/feedback/requests in here...
Forum rules
All the forums on this site are meant for either general or game specific discussions/questions/feedback.
This is NOT the place for spam, flames or fighting, and posts that don't follow this simple rule will be removed by the board moderator(s).

Enjoy our games, utils, tools and these forums...
User avatar
GamePlayHeaven
Site Admin
Posts: 562
Joined: Sun Feb 06, 2005 8:50

EQRoster v4.3.2 Released (EQPlayersID and EQDump import fix)

Postby GamePlayHeaven » Mon May 05, 2008 8:03

Version 4.3.2 of the EverQuest roster is on the downloads page.
The following additions/fixes have been made:

Added EQPlayersID to the character modify page (only for administrators).
Some situations occurred (bugged characters) where this is a necessity for admins.

Fixed alignment issues on the character modify page.
The header row and data rows where misaligned in certain spots.

Fixed and optimised the ExtractNameMainFromString() function.
Instead of manually searching for a space, I now use ereg to find the name main.
This avoids most situations where the old version failed, like a ' in the public note.

WARNING!!!
The ExtractNameMainFromString() function in the config.php has changed in this version.
You can easily modify your old one by reading the post below.


Enjoy this new release,
Michaël

User avatar
GamePlayHeaven
Site Admin
Posts: 562
Joined: Sun Feb 06, 2005 8:50

Re: EQRoster v4.3.2 Released (EQPlayersID and EQDump import fix)

Postby GamePlayHeaven » Mon May 05, 2008 8:27

Open the config.php and locate the following line:

Code: Select all

// Check for impossible combination first


Now replace everything up to the end of this function, which is:

Code: Select all

   // Check for impossible combination first
   if( ( ( !$bMainsHaveMains ) && ( !$bAltsHaveMains ) ) ||
      ( strlen( $strSource ) == 0 ) )
   {
      return "";
   }

   // Scan for the Main prefix
   if( ( $bMainsHaveMains ) &&
      ( $strMainPrefix != "" ) )
   {
      // Convert tags to upper, to prevent case mismatching
      $strUpperSource      = strtoupper( $strSource );
      $strUpperPrefix      = strtoupper( $strMainPrefix );

      $nMainPrefixPos   = strpos( $strUpperSource, $strUpperPrefix, 0 );
      if( $nMainPrefixPos !== false )
      {
         $nStartPos   = $nMainPrefixPos + strlen( $strMainPrefix );
      }
      else
      {
         // Nothing found, abort
         return "";
      }
   }
   // Scan for the Alt prefix
   else if( ( $bAltsHaveMains ) &&
          ( $strAltPrefix != "" ) )
   {
      // Convert tags to upper, to prevent case mismatching
      $strUpperSource      = strtoupper( $strSource );
      $strUpperPrefix      = strtoupper( $strAltPrefix );

      $nAltPrefixPos   = strpos( $strUpperSource, $strUpperPrefix, 0 );
      if( $nAltPrefixPos !== false )
      {
         $nStartPos   = $nAltPrefixPos + strlen( $strAltPrefix );
      }
      else
      {
         // Nothing found, abort
         return "";
      }
   }

   // Trim leading spaces by moving the startpositing backwards if it's a space
   while( $strSource[$nStartPos] === " " )
   {
      $nStartPos++;
   }

   // Scan for a space in the string, after our start position+1 (in case there's a space between the prefix and the name)
   $nEndPos   = strpos( $strSource, " ", $nStartPos );
   // If no space found, then use the full string
   if( $nEndPos == false )
   {
      $nEndPos      = strlen( $strSource );
   }
   // Subtract the name
   $strNameMain   = substr( $strSource, $nStartPos, $nEndPos - $nStartPos );

   // Make sure the name does not contain a '
   $nEndPos   = strpos( $strNameMain, "'", 0 );
   // Check if a ' was found
   if( $nEndPos > 0 )
   {
      // Cut everything from the ' of the name
      $strNameMain   = substr( $strSource, 0, $nEndPos );
   }

   // Make sure no weird trailing chars exist
   $strNameMain   = rtrim( $strNameMain, " ,.;:~'`" );

   // Make sure the name of the main is not the main prefix
   if( ( $strMainPrefix != "" ) &&
      ( $strMainPrefix == $strNameMain ) )
   {
      // It's a main after all, Abort
      return "";
   }

   // Return the name
   return $strNameMain;
}


With the following code:

Code: Select all

   // Check for impossible combination first
   if (((!$bMainsHaveMains) && (!$bAltsHaveMains)) ||
      (empty( $strSource )))
   {
      return "";
   }

   // Find the Name of the Main in the string
   // Scan for the Main prefix
   if ($bMainsHaveMains)
   {
      ereg( $strMainPrefix . '( *)([A-Za-z0-9]+)', $strSource, $aResults );
      $strNameMain   = $aResults[2];      // 0 is the full set, 1 is the possible spaces, 2 is the name
   }

   // Scan for the Alt prefix
   if ((empty($strNameMain)) && ($bAltsHaveMains))
   {
      ereg( $strAltPrefix . '( *)([A-Za-z0-9]+)', $strSource, $aResults );
      $strNameMain   = $aResults[2];      // 0 is the full set, 1 is the possible spaces, 2 is the name
   }

   // Make sure the name of the main is not the main prefix
   if (($strMainPrefix != "") && ($strMainPrefix == $strNameMain))
   {
      // It's a main after all, Abort
      return "";
   }

   // Return the name
   return $strNameMain;
}


Return to “EQRoster”

Who is online

Users browsing this forum: No registered users and 1 guest

cron