Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.6 > vBulletin 3.6 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Chess Details »»
Chess
Version: 1.1.0b, by Carnage Carnage is offline
Developer Last Online: Sep 2014 Show Printable Version Email this Page

Category: Major Additions - Version: 3.6.7 Rating:
Released: 07-27-2007 Last Update: 09-05-2009 Installs: 117
Uses Plugins Template Edits
Additional Files Translations Is in Beta Stage  
No support by the author.

Chess for vbulletin.

This mod turns an existing forum into a forum for playing chess in. Members can then play games against each other as easilly as posting a new post in a regular forum.

NB: the beta version of this dosn't enforce the rules of chess so illegal moves are possible - this does have the advantage of allowing handicap matches and variations on standard chess rules.

beta

This mod is a beta mod, this means that i have all the functions working on my board however there may be unforseen problems and conflicts on different vb setups. I'm 95% confidant that there are no major isseus left in the core code, the only issues that may arrise are from the new ajax features. If this is a problem for you, you can disable the ajax features in the admin cp.

Demo

A live demo can be seen here: http://www.giveupalready.com/forumdisplay.php?f=349 (running v1.0.1 till i've time to upgrade it)

Screenshots

Screen shot shows new UI

Version History

1.1b (beta): current version
- improved user interface (if you've changed the chess template you will need to revert/apply the changes manually)
- back/forward buttons for local moves (unsaved. Full backward/forward movement will be added in a later version)
- highlight for currently selected square.

1.0.1b (beta):
- fixed a couple of misisng TABLE_PREFIX's
- fixed table spacing issue

1.0b (beta):
- forced quick reply to be enabled.
- added reset board link + javascript to reset the board without reloading.
- ajax posting of moves.
- board updates itself every 10 secs via ajax.
- added option to flip layout of board.

0.2b (beta):
- added some javascript to update piece replacments instantly.
- templates are now fully phrased.

0.1b (beta):
- added faq entries to product file
- (hopefully) improved compatablity with vbseo
- modified instal instructions to avoid potential javascript problems.
- changed version numbering scheme.

beta:
- re-exported product file to contain all the settings fields.

alpha:
- changed image paths to allow for customised images.

Known Issues

- Table sizes are inconsistant
- If min post length is greater than 7 moves wont post without a comment.

Compatability

This mod was written on vb 3.6.0 and has been tested on 3.6.7 compatablity with other versions is unknown. Reported working on 3.6.8

Instalation
  1. Backup your Database
  2. Upload images into your images directory.
  3. new for v1.0b Upload Chess.php to your main forum directory.
  4. Turn your board off.
  5. Create a new forum, browse to it and make a note of its forum id.
  6. Disable Html, bb code,smilies,[img] code and post icons in this new forum
  7. Import the chess product
  8. In the vbulletin settings change the forumid to the new forum you created. You can also change the piece colour to better match your forums style.
  9. (Optional) Create a link forum to point to the chess faq which explains how to play.
  10. Turn your board back on
  11. Click installed.

Upgrade from < 1.0b
  1. Backup your Database
  2. Upload Chess.php to your main forum directory.
  3. Import the chess product (allow overwrite must be set to yes)
  4. Check the new settings are set to your liking.

Upgrade from 1.0b
  1. Import the chess product (allow overwrite must be set to yes)

Support

As all of my boards have been upgraded to vbulletin 4, I am no longer actively maintaining any of my vb3.x mods. Free support for all of my 3.x mods is being removed from the 31st of March 2010 after this date, I will only be offering paid support for 3.x mods; downloading and usage of the mods will remain free but unsupported.

For support of 3.x mods, please pm me as I won't be checking the threads very often.

Liscense
THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

You may modify this software to suit your own purposes but may only distribute said modifications within this thread and with my approval.

Credits

Images were modified from icon files downloaded from http://www.enpassant.dk/chess/grafeng.htm

Checkers

Untill i get arround to coding and releasing a checkers game you can play checkers using this mod using the following instructions provided by one of my forum members:

Quote:
Code:
(b8,b8)(d8,d8)(f8,f8)(h8,h8)(a7,a7)(c7,c7)(e7,e7)(g7,g7)(a1,a1)(c1,c1)(e1,e1)(g1,g1)(b2,b2)(d2,d2)(f2,f2)(h2,h2)(c8,bR)(e8,bR)(g8,bR)(b7,bR)(d7,bR)(f7,bR)(h7,bR)(a6,bR)(c6,bR)(e6,bR)(g6,bR)(b1,wR)(d1,wR)(f1,wR)(a2,wR)(c2,wR)(e2,wR)(g2,wR)(b3,wR)(d3,wR)(f3,wR)(h3,wR)
Just copy the code when you are making the first post. Simple as that.

Notes:
1. When you jump a piece, you must also double-click on the piece that you jump to get rid of it. If you write out the code manually, just write the code twice. [ex: (f4,f4)]

2. To get a king piece, use the same code as you would to promote a pawn.
[ex: (a1,bK)]

3. If you double jump, please put in the full syntax and not just the finishing move. This will help your opponent see all the jumps that you made.
Custom Images

You can add image sets by uploading a gfx for each piece identified by its initial into a new directory within the /images/chess/ directory and then changing the image settings in the admincp.

If anyone has any custom image sets that they can legally distribute pm me a link and i'll link to them in this post.

Feature requests
- Leader board
- Other games (checkers, monopoly,risk, go)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #142  
Old 08-25-2007, 06:05 PM
Ransack Ransack is offline
 
Join Date: Jul 2007
Posts: 26
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Ransack View Post
2. When a piece is replaced e.g. pawn promotion, the ajax update on the opponent's board shows the move, but not the changed piece. (It works if the entire page is refreshed though.) How do I fix that?
Ignore this one, sorry. This is not a bug. Works for me now.
Reply With Quote
  #143  
Old 08-25-2007, 07:03 PM
Carnage Carnage is offline
 
Join Date: Jan 2005
Location: uk
Posts: 760
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by michael5472 View Post
Got a problem - The pieces can move ANYWHERE

Basicly i was playing normally and someone moved their king 2spaces.........

I then proceded in selecting everypiece on the board and selecting queen and i had a board full of queen's.

Has this been fixed in the update ? it doesn't say.............
if you have a chessboard and play a friend at home the pieces can move anywhere. This mod was made to be as realistic as possible. That wouldn't be true if pieces had limited movement


Quote:
Originally Posted by Ransack View Post
1. Why does the ajax not update the board state after moves for spectators? It seems to work for players, but people who are just watching the thread do not see the updates, though they see the chesschat text area get updated. Where do I fix that?
Theres no reason spectators shouldn't see new moves... i'll look into it.

Quote:
Originally Posted by Ransack View Post
Also, why does the "moveno" tag in the AJAX xml reply not reflect the actual move number and what is the purpose of this tag?
It was orriginally the move number but invalid moves messed up the counter so it now represents the number of posts made in the thread - i should probably change the variable name but its a fairly minor issue.
Reply With Quote
  #144  
Old 08-25-2007, 07:27 PM
Ransack Ransack is offline
 
Join Date: Jul 2007
Posts: 26
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Carnage- View Post

Theres no reason spectators shouldn't see new moves... i'll look into it.
This seems to be working for me again too now. Odd. I wonder if this is intermittent.
Reply With Quote
  #145  
Old 08-25-2007, 07:59 PM
Ransack Ransack is offline
 
Join Date: Jul 2007
Posts: 26
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by michael5472 View Post
oh well no point in installing it then - Thanks.

Whats the point in going in to making a mod like this if you are not going to do it properly ?
I am working on tweaking this mod to enforce valid moves and such. Hopefully Carnage can integrate this and offer different configurable modes of play, or they can stand alone as two separate products. Still I'm hoping for his help with some of my tweaks as some of the ajax code is a bit confusing to me
Reply With Quote
  #146  
Old 08-26-2007, 04:04 AM
Our House Our House is offline
 
Join Date: Apr 2007
Posts: 44
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by ramchip View Post
My forum has a fixed width of 1000px but the forum with the chess games seems to be full width. Is there a way to restrict the chess forum to 1000px?

Thanks this is a great mod.
I'm having the same problem. My forum is 900px fixed width, but the chess template is stretching to the outside edge of my left/right margins instead of being inside of them.
Reply With Quote
  #147  
Old 08-28-2007, 12:39 AM
Ransack Ransack is offline
 
Join Date: Jul 2007
Posts: 26
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Our House View Post
I'm having the same problem. My forum is 900px fixed width, but the chess template is stretching to the outside edge of my left/right margins instead of being inside of them.
In the chess template, you can change the outermost element (either table or div I forget) to 95% and then wrap the entire thing in a <center> tag. That fixed this issue for me.
Reply With Quote
  #148  
Old 08-28-2007, 02:13 AM
Tulsa Tulsa is offline
 
Join Date: Jul 2005
Location: Broken Arrow, Oklahoma
Posts: 475
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I had to change mine to 94% to get it to line up properly. Maybe that's just the way it lines up using firefox?

Anyway at the very top line of the chess template change the 100% to 94% or 95% or whatever works for your site.

Code:
<table class="tborder" id="post$post[postid]" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="94%" align="center">
It's already aligned center.
Reply With Quote
  #149  
Old 08-28-2007, 04:44 AM
Our House Our House is offline
 
Join Date: Apr 2007
Posts: 44
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi guys,

Thanks for the replies. Unfortunately, that doesn't fix it for me.

The problem is that the Chess plugin is missing the (forum's) page background. I have 3 skins and this disrupts two of them. We have a 10px border on both fixed-width sides of all forum pages. Chess is missing the CSS for that.

Hopefully I didn't butcher that explanation.
Reply With Quote
  #150  
Old 08-29-2007, 03:20 AM
Fearlessninja's Avatar
Fearlessninja Fearlessninja is offline
 
Join Date: Jan 2006
Posts: 47
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

When will the official version which supports the rules be out?
Reply With Quote
  #151  
Old 08-31-2007, 11:46 PM
abdulla1 abdulla1 is offline
 
Join Date: Sep 2006
Posts: 87
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by aranthorn View Post
I have a couple really nit-picky users complained about white/black, flipped board, etc. Because this mod uses style CSS definitions of alt1 and alt2 for the board (which I think was the right way to go in coding it, btw) some users of mine complained that the Queen's not on her color. She is, but my some of styles are defined with light and dark tones reversed from vB's default. So here's what I did:

I added this bit into every style's "Additional CSS Definitions" area in style manger
Code:
/** START Chess Board **/
		.chess1 {
		   background-color : #FFFFFF;
		}
		
		.chess2 {
		   background-color : #000000;
		}
/** END Chess Board **/
The I changed the plugin "showthread_complete" for the product "chess" to this:
Code:
if($forumid == $vbulletin->options['chess_forumid'])
{
$empty = array('a'=>'','b'=>'','c'=>'','d'=>'','e'=>'','f'=>'','g'=>'','h'=>'');
$board = array(1=>array('a'=>'wR','b'=>'wN','c'=>'wB','d'=>'wQ','e'=>'wK',f=>'wB','g'=>'wN','h'=>'wR'),
	       2=>array('a'=>'wP','b'=>'wP','c'=>'wP','d'=>'wP','e'=>'wP','f'=>'wP','g'=>'wP','h'=>'wP'),
	       3=>$empty,
	       4=>$empty,
	       5=>$empty,
	       6=>$empty,
	       7=>array('a'=>'bP','b'=>'bP','c'=>'bP','d'=>'bP','e'=>'bP','f'=>'bP','g'=>'bP',h=>'bP'),
	       8=>array('a'=>'bR','b'=>'bN','c'=>'bB','d'=>'bQ','e'=>'bK','f'=>'bB','g'=>'bN','h'=>'bR'));

if(preg_match_all("#player\(1,([^)]+)\)#",$data[0][1],$matches,PREG_SET_ORDER))
{
	$player1 = $matches[0][1];
}
else
{
	$player1 = $data[0][0];
}
if(preg_match_all("#player\(2,([^)]+)\)#",$data[0][1],$matches,PREG_SET_ORDER))
{
	$player2 = $matches[0][1];
}

$moveno = 1;
$taken = array();
foreach($data AS $move)
{
	if(!$player2)
	{
		if($move[0] != $player1)
		{
			$player2 = $move[0];
		}
	}
	$postcnt++;
	
	if( (($moveno % 2) && $move[0] == $player1) || (!($moveno % 2) && $move[0] == $player2))
	{  	
		if(preg_match_all("#\(([a-h])([1-8]),([a-h])([1-8])\)#",$move[1],$matches,PREG_SET_ORDER))
		{
			$moveno++;
		}
		foreach($matches AS $match)
		{
			if($board[$match[4]][$match[3]] != '')
			{
				$taken[] = $board[$match[4]][$match[3]];
			}
			$board[$match[4]][$match[3]] = $board[$match[2]][$match[1]];
			$board[$match[2]][$match[1]] = '';
		}
		preg_match_all("#\(([a-h])([1-8]),(w|b)(Q|R|N|B|K|P)\)#",$move[1],$matches,PREG_SET_ORDER);
		foreach($matches AS $match)
		{
			$board[$match[2]][$match[1]] = $match[3].$match[4];
		}
	}

	$movestext[] =  implode($move,": ");

}

$post['signature'] =  "<div id=\"chesschat\" style=\"max-height:200px;overflow:auto;\">" . implode(array_reverse($movestext),"<br />") . "</div>";
if($vbulletin->userinfo['userid'] == 100000000)
{
print_r($vbulletin->options);
die($vbulletin->options['chess_rotation']);
}
if($vbulletin->options['chess_rotation'])
{
	$board = array_reverse($board,true);
}
foreach($board AS $row =>$rowdata)
{
	$output .= "<tr height=\"40px\"><td>$row</td>";
	foreach($rowdata AS $col => $coldata)
	{
		$class = ($class == 'chess1') ? 'chess2':'chess1';
		$imgstr = (($coldata == '') ? ('&nbsp;') : ('<img width="40px" height="40px" src="' . $vbulletin->options['bburl'] . '/images/chess/' . (($coldata[0] == 'b') ? ($vbulletin->options['chess_black']) : ($vbulletin->options['chess_white'])) . "/" . $coldata[1] . ".gif\" />"));
		$output .= "<td id=\"".$col.$row."\"width=\"40px\" onclick=\"move(event,'".$col.$row."')\" class=\"$class\">$imgstr</td>";
	}
	$output .= "</tr>";
	$class = ($class == 'chess1') ? 'chess2':'chess1';
}

foreach($taken AS $piece)
{
	if(substr($piece,0,1) == "w")
	{
		if(!$white)
		{
			$white = "<tr>";
			$whitecnt = 0;
		}
		
		$white .= "<td><img src=\"".$vbulletin->options['bburl']."/images/chess/".$vbulletin->options['chess_white']."/".$piece[1].".gif\" /></td>";
		$whitecnt ++;
		
		if(!($whitecnt % 6))
		{
			$white .= "</tr><tr>";
		}
	}
	else
	{
		if(!$black)
		{
			$black = "<tr>";
			$blackcnt = 0;
		}

		$black .= "<td><img src=\"".$vbulletin->options['bburl']."/images/chess/".$vbulletin->options['chess_black']."/".$piece[1].".gif\" /></td>";
		$blackcnt ++;
		
		if(!($blackcnt % 6))
		{
			$black .= "</tr><tr>";
		}
	}
}

$game_text = $player1 . " vs " . $player2;
$moveplr = (($moveno % 2) ? $player1 : $player2);
$move_text = "Move: $moveno <br /> " . $moveplr . " to move next."; 

eval('$postbits = "' . fetch_template('chess') . '";');
}
All I did was replace the alt1 and alt2 references in the original product plugin with chess1 and chess2 which was defined with white and black backgrounds in the "Additional CSS Definitions" that I added. The part that has the tweaks is in bold / red.

I am going to start looking into making a marble chessboard, wood chessboard, etc.

I'm facing the same problem, they complains about not to flip for black.

what can i do? can u please modify it so it flips automaticaly for the other player.
it cant that one play from down to up, and the other from up to down. causes confusion
for black.

great mod though.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:53 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04987 seconds
  • Memory Usage 2,353KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (4)bbcode_code
  • (10)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • 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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete