[SOLVED]How to uninstall a MOD if I cannot fix it...

Started by jossanaijr, November 03, 2007, 02:29:39 PM

Previous topic - Next topic

jossanaijr

Ok, I was told... MOD no approved yet... :-[

But as my forum was working fine and I was thinking to play CHESS  8)

Installed it!

And my site is broken again  :-X

I had already wrote in the specific post (http://www.simplemachines.org/community/index.php?topic=129749.400) but I'm not sure I will have an answer soon.

So can one explain me how can I removed it (if I cannot not loggin because of the error) or should I use my backup via phpAdmin or CPANEL...


Anyway I will wait a little more to see if I can fix the error easily (the message says: "Not unique table/alias: 'chess'")

Time for coffee...

feeble

Im really sorry about this, but I'm at odds with why you got this error thou.

is there anymore information you can give?

jossanaijr

Hi Feeble,
my site is down for 4 hours now... Not a big problem because it is new but I could not restored it until now...

I tried by myself to use a MySQL backup (from yesterday) and it did not work.  The host staff did it once and it did not work either...  I also tried the restore_backup.php and repair.php without any changes...

Still the message "Not unique table/alias: 'chess'".

Any help?  I checked the MsSQL version and it is 5.0.27.  I do not know what is this Not unique table/alias...

Thanks,
Jorge

jossanaijr

Perhaps you can tell me which php files should I look for to delete the CHESS script.

jossanaijr

Ok, I really need some help.
I discovered that my forum is now apparently working (www.round.med.br) with the yesterday's backup BUT the fact is that it works only for guest (and characters are wrong too..., but I think this is easy to fix later).  If I tried to loggin with my username and password or another member tries too there is that error "Not unique table/alias: 'chess'"!  Please, can someone help me? Where / Which php file (?) should I change to loggin?

babjusi

Look, when you install a mod through the package manager, it makes automatically a backup of all the files that that particular mod, that you will install,changes. They look something like this: ''2007-07-20_before_arcade.tar.gz''  What you can do is find the one for the chess mod and upload that file to your pc and unzip it, then upload its contents to the same folder where your smf files are and make sure to choose for the option overwrite.

jossanaijr

Quote from: babjusi on November 03, 2007, 07:40:46 PM
Look, when you install a mod through the package manager, it makes automatically a backup of all the files that that particular mod, that you will install,changes. They look something like this: ''2007-07-20_before_arcade.tar.gz''  What you can do is find the one for the chess mod and upload that file to your pc and unzip it, then upload its contents to the same folder where your smf files are and make sure to choose for the option overwrite.

Thank you!  I will try it!

Feeble: I sent you a PM.

jossanaijr

[SOLVED]
Thank you babjusi! Worked.  Now I have to repair characteres.

babjusi

You are welcome jossanaijr. Glad I could be of help

jossanaijr

BTW I discovered that there are a lot of those automatically backup files in my host.  Can I delete them? At least the old ones?

feeble

im glad its solved

give me a sec and ill send the changes the packages does to your smf files

feeble

this is a direct copy using http://modparser.dev.dansoftaustralia.net/index.php

Modifications to SMF files
In file $boarddir/index.php
Find:


      '.xml' => array('News.php', 'ShowXmlFeed'),




Add after:


      // Begin SMFChess code
      'chess' => array('Chess.php', 'Chess'),
      'chessXml' => array('ChessXml.php', 'ChessXml'),
      'chessChat' => array('ChessChat.php', 'ChessChat'),
      'chess_admin' => array('ChessAdmin.php', 'ChessAdmin'),
      'chess_admin_maint' => array('ChessAdmin.php', 'ChessMaintenance'),
      // End SMFChess code





In file $sourcedir/Load.php
Find:

a.attachmentType
            FROM {$db_prefix}members AS mem



Replace with:

a.attachmentType, IFNULL(chess.ID_CHESS, 0) AS chess_turn
            FROM {$db_prefix}members AS mem




Find:

LEFT JOIN {$db_prefix}attachments AS a ON (a.ID_MEMBER = $ID_MEMBER)



Add after:


               LEFT JOIN {$db_prefix}chess AS chess ON ((chess.status BETWEEN 0 AND 2) AND chess.extra = $ID_MEMBER)




Find:

'total_time_logged_in' => empty($user_settings['totalTimeLoggedIn']) ? 0 : $user_settings['totalTimeLoggedIn'],



Add after:


      // START SMFChess Code
      'chess_turn' => isset($user_settings['chess_turn']) ? $user_settings['chess_turn'] : 0,
      // End SMFChess Code




Find:

'language' => &$user_info['language'],



Add after:


      // Start SMFChess Code
      'chess_turn' => &$user_info['chess_turn'],
      // End SMFChess Code




In file $sourcedir/ManagePermissions.php
Find:


      'profile_remote_avatar',
      'profile_remove_own',




Add after:


      // Begin SMFChess code
      'chess_main',
      // End SMFChess code         





Find:

'pm' => array(



Add before:


         // Begin SMFChess code
         'chess' => array(
            'chess_main' => false,
            'chess_play' => false,
            'chess_admin' => false,
         ),
         // End SMFChess code





In file $sourcedir/Subs.php
Find:


   validateSession();




Add before:


   // Begin SMFChess code
   if (allowedTo('chess_admin'))
   {
      $context['admin_areas']['SMFChess'] = array (
          'title' => $txt['SMFChess_admin'],
          'areas' => array()
       );

      $context['admin_areas']['SMFChess']['areas']['chess_admin'] =  '<a href="' . $scripturl . '?action=chess_admin">' . $txt['settings'] . '</a>';
      $context['admin_areas']['SMFChess']['areas']['chess_admin_maint'] =  '<a href="' . $scripturl . '?action=chess_admin_maint">' . $txt[501] . '</a>';
   }
   // End SMFChess code





Find:


   $context['allow_calendar'] = allowedTo('calendar_view') && !empty($modSettings['cal_enabled']);




Add after:


   $context['allow_chess'] = allowedTo(array('chess_main', 'chess_play'));
   $context['allow_chess_admin'] = allowedTo('chess_admin');





Find:

'admin_forum', 'manage_boards',



Add after:

'chess_admin',




Find:

array(
            'tag' => 'green',



Add before:

array(
            'tag' => 'chess',
            'type' => 'unparsed_content',
            'content' => '$1',
            'validate' => create_function('&$tag, &$data, $disabled', '
               $data = create_SMFChess($data);'),
         ),




Find:

// Creates an image/text button



Add before:


//Create SMFChess Board
function create_SMFChess($board)
{
   global $modSettings, $settings, $options, $db_prefix;
   
   if(!isset($options['SMFChess_light'])){
      $options['SMFChess_default'] = true;
      $options['SMFChess_dark'] = '';
      $options['SMFChess_light'] = '';
      $options['SMFChess_piece'] = '';
      $options['SMFChess_border'] = '';
      $options['SMFChess_text'] = '';
   }
   $BoardSettings['SMFChess_dark'] = $options['SMFChess_default']||empty($options['SMFChess_dark'])? $modSettings['SMFChess_dark'] : $options['SMFChess_dark'];
   $BoardSettings['SMFChess_light'] = $options['SMFChess_default']||empty($options['SMFChess_light'])? $modSettings['SMFChess_light'] : $options['SMFChess_light'];
   $BoardSettings['SMFChess_border'] = $options['SMFChess_default']||empty($options['SMFChess_border'])? $modSettings['SMFChess_border'] : $options['SMFChess_border'];
   $BoardSettings['SMFChess_piece'] = empty($options['SMFChess_piece'])? $modSettings['SMFChess_piece']: $options['SMFChess_piece'];
   $BoardSettings['SMFChess_text'] = $options['SMFChess_default']||empty($options['SMFChess_text'])? $modSettings['SMFChess_text'] : $options['SMFChess_text'];
   
   $boardTop = '<tr><td bgcolor="'.$BoardSettings['SMFChess_border'].'">&nbsp;</td>';
   for($a = 'a'; $a != 'i';$a++){
      $boardTop .= '<td bgcolor="'.$BoardSettings['SMFChess_border'].'" align="center">&nbsp;<font color="'.$BoardSettings['SMFChess_text'].'"><b>'.$a.'</b></font>&nbsp;</td>';
   }
   $boardTop .= '<td bgcolor="'.$BoardSettings['SMFChess_border'].'">&nbsp;</td></tr>';
   
   $boardMiddle = '';

   if($board > 0){
      $board = (int) $board;

      $result = db_query("
         SELECT chess.id_chess, chess.boarddata, chess.move, mw.realName as whiteName, mb.realName as blackName
         FROM {$db_prefix}chess AS chess
         JOIN {$db_prefix}members as mw ON (mw.ID_MEMBER = chess.white)
         JOIN {$db_prefix}members as mb ON (mb.ID_MEMBER = chess.black)
         WHERE chess.id_chess = '{$board}'
         LIMIT 1
         ", __FILE__, __LINE__);
      if(mysql_num_rows($result) == 0){
         mysql_free_result($result);
         return "No match found under id";
      }else{
         list($boardid, $board, $move, $whiteName, $blackName) = mysql_fetch_row($result);
         mysql_free_result($result);
         
         if($move > 0){
            $result = db_query("
            SELECT move_info
            FROM {$db_prefix}chess_move
            WHERE id_chess = '{$boardid}' AND move = '{$move}'
            ORDER BY id_move
            LIMIT 2
            ", __FILE__, __LINE__);
            $moveInfo = $move.'.';
            while ($row = mysql_fetch_assoc($result))
               $moveInfo .= ' '.$row['move_info'];
            mysql_free_result($result);
         }
         $board = explode(' ', $board);
         $board = $board[0];
      }   
   }
   
   $board = explode('/', $board);
   if(count($board) != 8)
      return 'Failed';
      
   $odd = 1;
   $temp = '';
   $colNum = 1;
   $Board = array();
   foreach($board as $row){
   $odd++;
      $board2 = preg_split('//', $row, -1, PREG_SPLIT_NO_EMPTY);
      $boardMiddle .= '<tr><td bgcolor="'.$BoardSettings['SMFChess_border'].'" align="center">&nbsp;<font color="'.$BoardSettings['SMFChess_text'].'"><b>'.$colNum.'</b></font>&nbsp;</td>';
      foreach($board2 as $col){
         $i=0;
         switch ($col) {
                        case "K": $temp = 'white_king'; break;
                        case "Q": $temp = 'white_queen'; break;
                        case "R": $temp = 'white_rook'; break;
                        case "B": $temp = 'white_bishop'; break;
                        case "N": $temp = 'white_knight'; break;
                        case "P": $temp = 'white_pawn'; break;
                        case "k": $temp = 'black_king'; break;
                        case "q": $temp = 'black_queen'; break;
                        case "r": $temp = 'black_rook'; break;
                        case "b": $temp = 'black_bishop'; break;
                        case "n": $temp = 'black_knight'; break;
                        case "p": $temp = 'black_pawn'; break;

                        case "1": $i = 1; break;
                        case "2": $i = 2; break;
                        case "3": $i = 3; break;
                        case "4": $i = 4; break;
                        case "5": $i = 5; break;
                        case "6": $i = 6; break;
                        case "7": $i = 7; break;
                        case "8": $i = 8; break;
                  default : return 'Failed';
         }
         if($i > 0){
            while($i > 0){
               $boardMiddle .= '<td bgcolor="'. ($odd % 2 ? $BoardSettings['SMFChess_dark'] : $BoardSettings['SMFChess_light'] ) .'"><img border="0" src="'.$settings['default_theme_url'].'/SMFChess/pieces/blank.gif" height="33" width="33"/></td>';
               $i--;
               $odd++;
            }
         }else{
            $boardMiddle .= '<td bgcolor="'. ($odd % 2 ? $BoardSettings['SMFChess_dark'] : $BoardSettings['SMFChess_light'] ) .'"><img border="0" src="'.$settings['default_theme_url'].'/SMFChess/pieces/'.$BoardSettings['SMFChess_piece'].'/'.$temp.'.gif" height="33" width="33"/></td>';
            $odd++;
         }
      }
      $boardMiddle .= '<td bgcolor="'.$BoardSettings['SMFChess_border'].'" align="center">&nbsp;<font color="'.$BoardSettings['SMFChess_text'].'"><b>'.$colNum.'</b></font>&nbsp;</td></tr>';
      $colNum++;
   }
   
   if(($odd != 73)||($colNum != 9))
      return 'Failed';

   return '<table border="0" cellpadding="0" cellspacing="0"><tbody>'.(isset($whiteName)?'<tr><td bgcolor="'.$BoardSettings['SMFChess_border'].'" align="center" colspan="10"><font color="'.$BoardSettings['SMFChess_text'].'"><b>'.$whiteName.' vs '.$blackName.'</b></font></td></tr>':'').$boardTop.$boardMiddle.$boardTop.(isset($moveInfo)?'<tr><td bgcolor="'.$BoardSettings['SMFChess_border'].'" align="center" colspan="10"><font color="'.$BoardSettings['SMFChess_text'].'"><b>'.$moveInfo.'</b></font></td></tr>':'').'</tbody></table>';
}






In file $themedir/index.template.php
Find:

'admin', 'ban', 'boardrecount'



Add after:

, 'chess_admin'




Find:


   if ($context['current_action'] == 'theme')
      $current_action = isset($_REQUEST['sa']) && $_REQUEST['sa'] == 'pick' ? 'profile' : 'admin';




Add after:


   // Begin SMFChess code
   if ($context['current_action'] == 'chess')
      $current_action = 'chess';
   // End SMFChess code





Find:


               <a href="', $scripturl, '?action=calendar">' , $txt['calendar24'] , '</a>
            </td>' , $current_action == 'calendar' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';



Add after:


   //Begin SMFChess code
   if($context['allow_chess']){
      echo ($context['current_action'] == 'chess' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
         <td valign="top" class="maintab_' , $context['current_action'] == 'chess' ? 'active_back' : 'back' , '">
            <a href="', $scripturl, '?action=chess">'.$txt['SMFChess'].'', $context['user']['chess_turn'] != 0 ? '[<strong>!</strong>]' : '' , '</a>
         </td>' , $context['current_action'] == 'chess' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';
   }
   //END SMFChess code





In file $languagedir/Errors.english.php
Find:

?>



Add before:


// Begin SMFChess code
$txt['cannot_chess_main'] = 'You do not have access to Chess!';
$txt['cannot_chess_play'] = 'You do not have have permission to Challenge other Forum Members';
$txt['cannot_chess_admin'] = 'You do not have access to Chess Admin area';
// End SMFChess code





In file $languagedir/ManagePermissions.english.php
Find:

?>



Add before:


// Begin SMFChess code
$txt['permissiongroup_chess'] = 'Chess';
$txt['permissionname_chess_main'] = 'Access to Chess';
$txt['permissionname_chess_play'] = 'Allowed to Challenge';
$txt['permissionname_chess_admin'] = 'Admin Access';
// End SMFChess code





In file $languagedir/Who.english.php
Find:

?>



Add before:


//Begin SMFChess
$txt['whoall_chess'] = 'Viewing <a href="'.$scripturl.'?action=chess">Chess</a>.';
$txt['whoall_chessXml'] = 'Viewing <a href="'.$scripturl.'?action=chess">Chess</a>.';
$txt['whoall_chessChat'] = 'Viewing <a href="'.$scripturl.'?action=chess">Chess</a>.';
//End SMFChess





In file $languagedir/index.english.php
Find:

?>



Add before:


//Begin SMFChess
$txt['SMFChess'] = 'Chess';
$txt['SMFChess_admin'] = 'Chess Admin';
//End SMFChess

Advertisement: