[CH 2.1.6d] Staré Sudoku 1.0.7 - CH edice

Seznam modifikací nainstalovaných na tomto fóru.
Odpovědět Téma
Avatar uživatele
leschek
Administrátor
Reakce:
Příspěvky: 724
Registrován: 23 Říj 2005 23:22
Tykání: Ano
Kontaktovat uživatele:

[CH 2.1.6d] Staré Sudoku 1.0.7 - CH edice

Nepřečtený příspěvek od leschek »

Sudoku Mod umožňuje hrát zaregistrovaným uživatelům v současnosti velmi oblíbenou hru Sudoku.

Důležité - podařilo se mi nainstalovat tento mod na forum s CH 2.1.6e, ale dostal jsem varování:

Kód: Vybrat vše

http://vfalcone.pikenet.ru/forum/viewtopic.php?t=380&postdays=0&postorder=asc&start=0
Při jeho odstraňování jsem narazil na nový Sudoku Mod, který sice vychází z verze 1.0.6, ale má tolik novinek, že jsem tomu nevěřil. Dělá ho i nový autor a proto mu založím nové téma, které najdete tady.

Myslel jsem si, že instalace bude bez problémů, ale musel jsem udělat nějaké úpravy, aby se dal mod nainstalovat. Tak přidávám i install.txt

Kód: Vybrat vše

############################################################## 
## MOD Title: Sudoku
## 
## MOD Author: majorflam < majorflam@majormod.com > (Garry Hughes) http://www.majormod.com
##             noworyz < noworyz@egriz.com > Chris Lynn http://www.egriz.com
##	       tsaadmin < jtness@thundersoftonline.biz > Jake Ness http://www.thundersoftonline.biz
## 
## MOD Description: This is a version of the popular numbers puzzle for your phpbb forum. 
##                  Each user plays their own grids, and a points system is involved. 
##                  Users gain more points if they make less mistakes. 
##                  A leaderboard is kept, showing who is the best at the puzzle.
## 
## MOD Version: 1.0.7 - CH
## 
## Installation Level: Easy
## 
## Installation Time: 10 Minutes
##       
## Files To Edit:  includes/constants.php 
##                 includes/page_header.php
##                 includes/class_stats_online.php
##                 language/lang_english/lang_main.php
##                 templates/subSilver/overall_header.tpl
##                 
## 
## Included Files: includes/functions_sudoku.php
##		   images/sudoku.gif
##                 language/lang_english/lang_sudoku.php
##		   templates/subSilver/sudoku.tpl
##		   templates/subSilver/sudokuleaders.tpl
##     	    	   sudoku.php
##      	   db_update_from_106.php
## 
############################################################## 
## For Security Purposes, Please Check: http://www.majormod.com/viewtopic.php?t=170 for the 
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code 
## to enter into your phpBB Forum.
############################################################## 
## Author Notes: 
## 
############################################################## 
## MOD History:
##	version 1.0.7: Tested on phpbb 2.0.20
##	version 1.0.7: Added Full leaderboard addon, average score and replaced number images with text
##	version 1.0.6: Tested on phpbb 2.0.19
##	version 1.0.6: Compatibilty with multiple solution Sudoku's added
##	version 1.0.5: Free version now feature frozen - a premium version will follow, which will incur a small cost
##	version 1.0.5: Admin can now reset the game
##	version 1.0.4: Players can now "buy" a number if they are stuck in the game
##	version 1.0.4: Added Admin Tools - Resynchronisation of user stats
##	version 1.0.4: Added online stats for game players
##	version 1.0.3: Game count bug resolved
##	version 1.0.3: Game Pack bug resolved
##	version 1.0.3: Stats system re-written to ease load on Database.
##	version 1.0.2: Javascript number selection added ( Javascript by DTTBV - mechakoopa@gmail.com )
##	version 1.0.2: Leaderboard now displaying properly.
##	version 1.0.1: Tested on phpbb 2.0.18  
##    Version 1.0.0: Initial Release 
## 
############################################################## 
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
############################################################## 

# 
#-----[ COPY ]------------------------------------------ 
# 

	root/includes/functions_sudoku.php
	root/images/sudoku.gif
	root/language/lang_english/lang_sudoku.php
	root/templates/subSilver/sudoku.tpl
	root/templates/subSilver/sudokuleaders.tpl
	root/sudoku.php
	db_update_from_106.php

############################################################## 
## Author Notes: The update script db_update.php should be called from a browser by
##		 a site administrator in order to make the database changes automatically.
##		 The script should then be deleted.
##############################################################

# 
#-----[ OPEN ]------------------------------------------ 
# 

includes/class_stats_online.php

# 
#-----[ FIND ]------------------------------------------ 
# 

PAGE_FAQ => array('txt' => 'Viewing_FAQ', 'url' => $this->mode == 'in_admin' ? 'admin/index' : 'faq', 'parms' => $this->mode == 'in_admin' ? array ('pane' => 'right') : array()),

# 
#-----[ AFTER, ADD ]------------------------------------------ 
#

PAGE_SUDOKU => array('txt' => 'Viewing_Sudoku', 'url' => $this->mode == 'in_admin' ? 'admin/index' : 'sodoku', 'parms' => $this->mode == 'in_admin' ? array('pane' => 'right') : array()),

# 
#-----[ OPEN ]------------------------------------------ 
# 

includes/constants.php

# 
#-----[ FIND ]------------------------------------------ 
# 

define('PAGE_GROUPCP', -11);

# 
#-----[ AFTER, ADD ]------------------------------------------ 
#

// sudoku mod
define('PAGE_SUDOKU', -1700);
// end sudoku mod

# 
#-----[ FIND ]------------------------------------------ 
# 

?>

# 
#-----[ BEFORE, ADD ]------------------------------------------ 
#

// sudoku mod
define('SUDOKU_STARTS',  $table_prefix.'sudoku_starts');
define('SUDOKU_SOLUTIONS',  $table_prefix.'sudoku_solutions');
define('SUDOKU_USERS',  $table_prefix.'sudoku_users');
define('SUDOKU_STATS',  $table_prefix.'sudoku_stats');
define('SUDOKU_SESSIONS',  $table_prefix.'sudoku_sessions');
// end sudoku mod

# 
#-----[ OPEN ]------------------------------------------ 
# 

includes/page_header.php

# 
#-----[ FIND ]------------------------------------------ 
# 

	'U_GROUP_CP' => append_sid('groupcp.'.$phpEx),

# 
#-----[ AFTER, ADD ]------------------------------------------ 
#

	// sudoku mod
	'L_SUDOKU' => $lang['Sudoku'],
	'U_SUDOKU' => append_sid('sudoku.'.$phpEx),
	// end sudoku mod

# 
#-----[ OPEN ]------------------------------------------ 
# 

language/lang_english/lang_main.php

#
#-----[ FIND ]------------------------------------------ 
#

//
// That's all Folks!
// 

#
#-----[ BEFORE, ADD ]------------------------------------------ 
# 

// sudoku Mod
$lang['Sudoku'] = 'Sudoku';
// End sudoku Mod

# 
#-----[ OPEN ]------------------------------------------ 
# 

templates/subSilver/overall_header.tpl

#
#-----[ FIND ]------------------------------------------ 
# 

<td height="25" align="center" valign="top" nowrap="nowrap"><span class="mainmenu"> <a href="{U_PROFILE}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_profile.gif" width="12" height="13" border="0" alt="{L_PROFILE}" hspace="3" />{L_PROFILE}</a>  

#
#-----[ AFTER, ADD ]------------------------------------------ 
# 

<a href="{U_SUDOKU}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_profile.gif" width="12" height="13" border="0" alt="{L_SUDOKU}" hspace="3" />{L_SUDOKU}</a>   

# 
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ 
# 
# EoM 
Po instalaci nezapomeňte otevřít v prohlížeči soubor db_update_from_106.php. Ten ale aktualizuje databázi jen z verze 1.0.6. Proto budete potřebovat nahrát na váš server ještě soubor db_update.php, který byl distribuován s verzí 1.0.6 a který tady najdete v příloze. Ten spusťte jako první.

Mod můžete stáhnout tady.

Service Pack SP1 pro verzi 1.0.7, který přidá průměrný počet bodů :

Kód: Vybrat vše

##############################################################
## MOD Title: Sudoku Mod 1.0.7 Service Pack 1
##
## MOD Author: noworyz <  > Chris Lynn http://www.egriz.com
##             And Rorek
##
## MOD Description: This extension of Sudoku 1.0.7 adds the average score info
##                  to the users personal stats.  This feature was left out of
##                  Sudoku 1.0.7 by mistake and is now added.
##
## MOD Version: 1.0.7 SP1
##
## Installation Level: Easy
##
## Installation Time: 2 Minutes
##       
## Files To Edit:  sudoku.php
##                 language/lang_english/lang_sudoku.php
##                 templates/subSilver/sudoku.tpl
##                 templates/subSilver/sudokuleaders.tpl
##
##
##############################################################
## For Security Purposes, Please Check: http://www.thundersoftonline.biz for the
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code
## to enter into your phpBB Forum.
##############################################################
## Author Notes: This file contains the code changes to add the average score
## column in the user's individual stats.
##############################################################
## MOD History:
##   version 1.0.7 SP1 added user average score
##                        added playing sudoku block to full leaderboard
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################

#
#-----[ OPEN ]------------------------------------------
#
sudoku.php
#
#-----[ FIND ]------------------------------------------
#
'LEAD_AVERAGE'=>$lang['sudoku_lead_average'],
#
#-----[ AFTER, ADD ]------------------------------------------
#
'USER_AVERAGE'=>$lang['sudoku_user_average'],
#
#-----[ FIND ]------------------------------------------
#
$this_userid=$userdata['user_id'];
#
#-----[ AFTER, ADD ]------------------------------------------
#
$user_avg = !$games[$this_userid] || !$points[$this_userid] ? 0 : round($points[$this_userid] / $games[$this_userid]);
#
#-----[ FIND ]------------------------------------------
#
'POINTS_VALUE'=>number_format($points[$this_userid]),

#
#-----[ AFTER, ADD ]------------------------------------------
#
'AVERAGE_POINTS'=>number_format($user_avg),
#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_sudoku.php
#
#-----[ FIND ]------------------------------------------
#
$lang['sudoku_lead_average']='Average';
#
#-----[ AFTER, ADD ]------------------------------------------
#
$lang['sudoku_user_average']='Average Points Scored';
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/sudoku.tpl
#
#-----[ FIND ]------------------------------------------
#
                     <tr>
                        <td width="50%" class="row1" align="right"><span class="gen"><b>{POINTS}:</b></span></td>
                        <td width="50%" class="row2" align="left"><span class="gen">{POINTS_VALUE}</span></td>
                     </tr>
#
#-----[ AFTER, ADD ]------------------------------------------
#
                     <tr>
                        <td width="50%" class="row1" align="right"><span class="gen"><b>{USER_AVERAGE}:</b></span></td>
                        <td width="50%" class="row2" align="left"><span class="gen">{AVERAGE_POINTS}</span></td>
                     </tr>
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/sudokuleaders.tpl
#
#-----[ AT THE END, ADD ]------------------------------------------
#
<br />
<table width="100%" cellpadding="3" cellspacing="1" border="0" class="forumline">
  <tr>
   <td class="catHead" colspan="2" height="28"><span class="cattitle">{WHO_IS_ONLINE}</span></td>
  </tr>
  <tr>
   <td class="row1" align="center" valign="middle" rowspan="3"><img src="images/sudoku.gif" alt="{WHO_IS_ONLINE}" /></td>
   <td class="row1"><span class="gensmall">{SUDOKU_GAME_STATS}</span></td>
  </tr>
  <tr>
   <td class="row1" align="left"><span class="gensmall">{TOTAL_USERS_ONLINE}   <br />{TODAY_USER_LIST}</span></td>
  </tr>
  <tr>
   <td class="row1" align="left"><span class="gensmall">{LOGGED_IN_USER_LIST} {ACTIVE_USER_LIST}</span></td>
  </tr>
</table>
<table width="100%" cellpadding="1" cellspacing="1" border="0">
<tr>
   <td align="left" valign="top"><span class="gensmall">{ONLINE_EXPLAIN}</span></td>
</tr>
</table>
<br />
<div align="center"><span class="copyright">{SUDOKU_VERSION}</span></div>
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
Pokud používáte tmavý styl, tak vám pravděpodobně nepůjdou zobrazit čísla na tmavém pozadí. Autor ale napsal, že v další verzi nebo SP to napraví. Zatím si můžete nastavit barvy tak, že otevřete includes/functions_sudoku.php a najdete nasledujici:

Cisla vlozena uzivatelem

Kód: Vybrat vše

               $tile_object='<p align="center"><a href="' . $tile_url . '" onClick="' . $on_click . '; return false;" style="text-decoration: none"><font size="5" color="black">' . $tile[$tile_key] . '</font></a></p>';
Koupena cisla

Kód: Vybrat vše

               $tile_object='<p align="center"><b><font size="5" color="orange">' . $tile[$tile_key] . '</font></b></p>';

Startovaci cisla

Kód: Vybrat vše

                    $tile_object='<p align="center"><b><font size="5">' . $tile[$tile_key] . '</font></b></p>';
tady muzete vlozit za: font size="5" tohle: color="#nejaky_kod_barvy"

vice naleznete tady.

Na fóru Thundersoftonline se objevil důležitej fix, kterej řeší problém s Resynchronizací hry. Více najdete tady nebo jen aplikujte tento fix:

Kód: Vybrat vše

##############################################################
## MOD Title: Sudoku Mod 1.0.7 Security fix
##
## MOD Author: Major Flam
##
## MOD Description: Important Fix for Resync Error
##
## MOD Version: 1.0.7
##
## Installation Level: Easy
##
## Installation Time: 2 Minutes
##       
## Files To Edit:  includes/functions_sudoku.php
##
##
##############################################################
#
#-----[ OPEN ]------------------------------------------
#

includes/functions_sudoku.php

#
#-----[ FIND ]------------------------------------------
#

function sudoku_grid_success($pack, $num, $curr_points, $redirect)
{
   global $db, $userdata, $lang, $lrow, $line;
   // update the user stats
      $sql=" UPDATE " . SUDOKU_STATS . "
      SET played=played+1, points=points+'$curr_points'
      WHERE user_id=" . $userdata['user_id'];
      if (!$db->sql_query($sql) )
      {
         message_die(GENERAL_ERROR, 'Error inserting Sudoku userdata to database', '', __LINE__, __FILE__, $sql);
      }
      
      $line='';
      sudoku_starting_data($pack, ($num+1), SUDOKU_STARTS, '');
      if ( !$line )
      {
         sudoku_starting_data(($pack+1),1, SUDOKU_STARTS, '');   
      }
      if ( !$line )
      {
         $message=$lang['sudoku_nomore_grids'];
         message_die(GENERAL_MESSAGE, $message);
      }
      // ok, so let's update the users game and tell them the good news
      $sql=" INSERT INTO " . SUDOKU_USERS . "
      (user_id,game_pack,game_num,game_level,line_1,line_2,line_3,line_4,line_5,line_6,line_7,line_8,line_9)
      VALUES
      (" . $userdata['user_id'] . "," . $lrow['game_pack'] . "," . $lrow['game_num'] . "," . $lrow['game_level'] . ",'" . $lrow['line_1'] . "','" . $lrow['line_2'] . "','" . $lrow['line_3'] . "','" . $lrow['line_4'] . "','" . $lrow['line_5'] . "','" . $lrow['line_6'] . "','" . $lrow['line_7'] . "','" . $lrow['line_8'] . "','" . $lrow['line_9'] . "')
      ";
      if (!$db->sql_query($sql) )
      {
         message_die(GENERAL_ERROR, 'Error inserting Sudoku userdata to database', '', __LINE__, __FILE__, $sql);
      }
      
      $message=$lang['sudoku_load_new'] . $redirect;
      message_die(GENERAL_MESSAGE, $message);
      
      return;
}


#
#-----[REPLACE WITH]------------------------------------------
#

function sudoku_grid_success($pack, $num, $curr_points, $redirect)
{
   global $db, $userdata, $lang, $lrow, $line;
   // has this current game been processed before?
   $sql=" SELECT done FROM " . SUDOKU_USERS . "
   WHERE user_id=" . $userdata['user_id'] . "
   AND game_pack=$pack
   AND game_num=$num
   ";
   if ( !($result = $db->sql_query($sql)) )
   {
      message_die(GENERAL_ERROR, 'Error in synchronisation', '', __LINE__, __FILE__, $sql);
   }
   $row=$db->sql_fetchrow($result);
   if ( !$row['done'] )
   {
      // update the user stats
      $sql=" UPDATE " . SUDOKU_STATS . "
      SET played=played+1, points=points+'$curr_points'
      WHERE user_id=" . $userdata['user_id'];
      if (!$db->sql_query($sql) )
      {
         message_die(GENERAL_ERROR, 'Error inserting Sudoku userdata to database', '', __LINE__, __FILE__, $sql);
      }
      
      // update the current game to show it is done
      $sql=" UPDATE " . SUDOKU_USERS . "
      SET done=1
      WHERE user_id=" . $userdata['user_id'] . "
      AND game_pack=$pack
      AND game_num=$num
      ";
      if (!$db->sql_query($sql) )
      {
         message_die(GENERAL_ERROR, 'Error inserting Sudoku userdata to database', '', __LINE__, __FILE__, $sql);
      }
   }      
   $line='';
   sudoku_starting_data($pack, ($num+1), SUDOKU_STARTS, '');
   if ( !$line )
   {
      sudoku_starting_data(($pack+1),1, SUDOKU_STARTS, '');   
   }
   if ( !$line )
   {
      $message=$lang['sudoku_nomore_grids'];
      message_die(GENERAL_MESSAGE, $message);
   }
   // ok, so let's update the users game and tell them the good news
   $sql=" INSERT INTO " . SUDOKU_USERS . "
   (user_id,game_pack,game_num,game_level,line_1,line_2,line_3,line_4,line_5,line_6,line_7,line_8,line_9)
   VALUES
   (" . $userdata['user_id'] . "," . $lrow['game_pack'] . "," . $lrow['game_num'] . "," . $lrow['game_level'] . ",'" . $lrow['line_1'] . "','" . $lrow['line_2'] . "','" . $lrow['line_3'] . "','" . $lrow['line_4'] . "','" . $lrow['line_5'] . "','" . $lrow['line_6'] . "','" . $lrow['line_7'] . "','" . $lrow['line_8'] . "','" . $lrow['line_9'] . "')
   ";
   if (!$db->sql_query($sql) )
   {
      message_die(GENERAL_ERROR, 'Error inserting Sudoku userdata to database', '', __LINE__, __FILE__, $sql);
   }
      
   $message=$lang['sudoku_load_new'] . $redirect;
   message_die(GENERAL_MESSAGE, $message);
      
   return;
} 
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
Češtinu i se Service Packem SP1 najdete tady. Není třeba dělat změny v lang_czech/lang_sudoku nalezené v instalačce SP1.
Přílohy
db_update.rar
db_update.php 1.0.6
(4.06 KiB) Staženo 375 x
Naposledy upravil(a) leschek dne 22 Říj 2007 18:50, celkem upraveno 4 x.
Avatar uživatele
leschek
Administrátor
Reakce:
Příspěvky: 724
Registrován: 23 Říj 2005 23:22
Tykání: Ano
Kontaktovat uživatele:

Nepřečtený příspěvek od leschek »

Pokud má někdo problém najít další Game Packy, tak přidávám původní Packy 2-7 do přílohy, kde si je můžete stáhnout.
Další Sudoku Packy najdete tady. Protože původní autor modu dělal 2 verze packů, tak rary obsahují 2 soubory (je to obsaženo i v názvu). Kdo měl Premium packy, tak použijte soubor s vyšším číslem. Kdo ne tak samozřejmě nižší. Oba soubory obsahují stejné hry, jen číslování je jiné.
Instalace: Uploadnout do fora, otevřít v prohlížeči a smazat.
Přílohy
Sudoku_Game_Packs_2-7.rar
Sudoku Game Packy 2-7
(35.06 KiB) Staženo 336 x
Avatar uživatele
leschek
Administrátor
Reakce:
Příspěvky: 724
Registrován: 23 Říj 2005 23:22
Tykání: Ano
Kontaktovat uživatele:

Nepřečtený příspěvek od leschek »

Na fóru Thundersoft se objevil program na tvorbu GamePacků pro Sudoku, který by měl vygenerovat celý GamePack (php soubor).

Odkaz na stažení najdete tady nebo, protože je to na Rapidsharu, i jako přílohu v tomto příspěvku.

K programu budete potřebovat NET Framework 1.1 a Sudoku Generator/Solver, který jsem našel dokonce v češtině tady.
Sám jsem programy ještě nezkoušel, ale mělo by to pracovat. Pokud někdo vytvoří nějaké GamePacky, tak se o ně můžete podělit buď tady nebo můžete napsat na Thundersoft fórum.
Přílohy
Sudoku_Gamepack_Maker_English.zip
Tvořič Sudoku GamePacků
(73.27 KiB) Staženo 383 x
Avatar uživatele
leschek
Administrátor
Reakce:
Příspěvky: 724
Registrován: 23 Říj 2005 23:22
Tykání: Ano
Kontaktovat uživatele:

Nepřečtený příspěvek od leschek »

Pár dalších balíčků her můžete najít na vfalcone.pikenet.ru fóru.
Glaster
Reakce:

Nepřečtený příspěvek od Glaster »

V té tvé instalaci uvádíš že se má editovat soubor

Kód: Vybrat vše

includes/class_stats_online.php
mám phpBB 2.0.22 a ten soubor nikde nemám?? není to chyba na tvé straně?? nemá se jednat o soubor viewonline.php ????

Díky Glaster
Avatar uživatele
leschek
Administrátor
Reakce:
Příspěvky: 724
Registrován: 23 Říj 2005 23:22
Tykání: Ano
Kontaktovat uživatele:

Nepřečtený příspěvek od leschek »

Tohle je instalace pro fóra s nainstalovaným CH módem. Instalaci pro normální (vanilla) phpBB najdeš tady.
Satanas
Reakce:
Příspěvky: 1
Registrován: 18 Kvě 2007 16:58

Nepřečtený příspěvek od Satanas »

Hello,
Thank you very much for the MOD sudoku and of the pack,
good continuation
Odpovědět