TinyPortal

Development => Block Codes => Topic started by: Lord Anubis on January 08, 2008, 07:29:55 PM

Title: SMF Chess Block Code
Post by: Lord Anubis on January 08, 2008, 07:29:55 PM
To use this block code, you must first have the SMFChess Mod (http://www.simplemachines.org/community/index.php?topic=129749.0) installed
(This mod is made by Feeble, any support for mod should be answered at the SMF site)

Here is an easy way to have all the SMFChess user functions in a block

Screenshot:

(https://www.tinyportal.net/proxy.php?request=http%3A%2F%2Ftinyadminresources.com%2Fextras%2Fimagehost%2Fscript%2Fuploads%2F4533e2cf05.jpg&hash=92fdce02a17bc6854be8b9c943650fa96e40e6aa)

Demo:
Live Demo (http://nextsite.org) Check out the right block, and click on chess  ;)

Instructions:

1. Download THIS FILE (http://tinyadminresources.com/chessblock.zip), and unzip the package
2. Upload the folder "chessblock" to the root of your forum
3. Insert the code below into a PHP block
4. Enjoy!


global $scripturl, $context;
echo '

<img src="/chessblock/chess.png"/> <a href="', $scripturl ,'?action=chess">My Chess Stats</a><br />
<img src="/chessblock/challenge.png"/> <a href="', $scripturl ,'?action=chess;u=', $context['user']['id'] ,';sa=challenge">Challenge</a><br />
<img src="/chessblock/matches.png"/> <a href="', $scripturl ,'?action=chess;u=', $context['user']['id'] ,';sa=current">Current Matches</a><br />
<img src="/chessblock/matches.png"/> <a href="', $scripturl ,'?action=chess;u=', $context['user']['id'] ,';sa=finished">Finished Matches</a><br />
<img src="/chessblock/leader.png"/> <a href="', $scripturl ,'?action=chess;u=', $context['user']['id'] ,';sa=leaderboard">Leaderboard</a><br />
';
Title: Re: SMF Chess Block Code
Post by: Jakki on January 08, 2008, 08:09:20 PM
Btw it is on the left..LOL and guests don't have access..LOL I tried. HEHE
Title: Re: SMF Chess Block Code
Post by: platinumUWE on January 08, 2008, 08:53:55 PM
hi there lord anubis i looked at the post and made the changes to my index template php as the post said and im getin an error on instaltion of mod board index template php and ideas or help be appreciated ty.

this is error im getting at apply mod.

18. Execute Modification ./Themes/default/index.template.php Test failed
Title: Re: SMF Chess Block Code
Post by: Jakki on January 08, 2008, 09:52:24 PM
When I tried to install I got this error
18. Execute Modification ./Themes/default/index.template.php Test failed
Title: Re: SMF Chess Block Code
Post by: Lord Anubis on January 08, 2008, 11:02:39 PM
Use the package parser and make the edits manually

http://www.smfhelper.info/forum/package.php5

I personally had that problem too, but it works without making the edit to the index.template.php

That seems to just make a button at the top of your forum, which you wouldn't need with this block :up:

Oh and yep, no playing Chess at my site without registration  :2funny:
Title: Re: SMF Chess Block Code
Post by: Jakki on January 08, 2008, 11:22:07 PM
Never understood how to use that thing.
Title: Re: SMF Chess Block Code
Post by: Lord Anubis on January 09, 2008, 03:43:02 AM
It is easy, upload a package to it and it tells you which files to edit and what to edit the files with ;)
Title: Re: SMF Chess Block Code
Post by: Jakki on January 09, 2008, 04:01:18 AM
Did all the parsing and now my php's files are messed up and I can't get them back..LOL
Title: Re: SMF Chess Block Code
Post by: Lord Anubis on January 09, 2008, 04:03:37 AM
Huh...Did you save a copy before editing, I always keep a copy...Well what you can do is most files create another with a ~ at the end, you can take off the ~ and restore your files

But whenever installing a mod, especially if you do the code yourself....SAVE AN ORIGINAL COPY

Also, remember to install mods using the default theme...What I am guessing is you only edited the index.template.php

Hopefully this wasn't for the default  ???
Title: Re: SMF Chess Block Code
Post by: Zetan on January 09, 2008, 06:07:52 AM
SMF creates a backup when installing any new mod via the package manager.

/ public_html / Packages / backups / before_newmod.tar.gz

You can download the file, extract and upload the contents back to your server.
Title: Re: SMF Chess Block Code
Post by: platinumUWE on January 09, 2008, 12:46:33 PM
nope i did that and im still getting errors all over the place im doing something wrong what that is im unsure id love the chess be a great addition to site  >:( :uglystupid2: :idiot2: :o
Title: Re: SMF Chess Block Code
Post by: Lord Anubis on January 09, 2008, 01:52:56 PM
This mod is made by Feeble, any support for mod should be answered at the SMF site, support on this board is only for the block code ;)
Title: Re: SMF Chess Block Code
Post by: platinumUWE on January 09, 2008, 03:14:26 PM
lol maybe a simple walk through of how u did it may help the tp community maybe  :o
Title: Re: SMF Chess Block Code
Post by: Jakki on January 09, 2008, 03:23:03 PM
My site is officially down with errors...I give up..
Title: Re: SMF Chess Block Code
Post by: lurkalot on January 09, 2008, 03:30:34 PM
Quote from: Lord Anubis on January 08, 2008, 11:02:39 PM

I personally had that problem too, but it works without making the edit to the index.template.php

That seems to just make a button at the top of your forum, which you wouldn't need with this block :up:

Oh and yep, no playing Chess at my site without registration  :2funny:

I took your advice and carried on with the Chess mod install even with this error.   "18. Execute Modification ./Themes/default/index.template.php Test failed"

I don't need a button in the main menu as I've also added your Chess block.   Works great so far.  Many thanks. ;)


Running SMF 1.1.4 Tinyportal 0.9.8 SMF Arcade 2.0.11 SMF Shop 3. And Coppermine Gallery 1.4.13
Title: Re: SMF Chess Block Code
Post by: Jakki on January 09, 2008, 03:39:14 PM
ZTN, I did that and I"m still getting errors..
Title: Re: SMF Chess Block Code
Post by: Lord Anubis on January 09, 2008, 04:01:34 PM
Quote from: platinumUWE on January 09, 2008, 03:14:26 PM
lol maybe a simple walk through of how u did it may help the tp community maybe  :o

I installed the mod, I had an error with the index.template.php, but installed anyway...

And guess what it worked, lol

Then after a while I thought about creating this block to simplify the controls for chess

Quote from: Jakki on January 09, 2008, 03:23:03 PM
My site is officially down with errors...I give up..

What did you do to crash your site?  I said
Quote from: Lord Anubis on January 08, 2008, 11:02:39 PM
I personally had that problem too, but it works without making the edit to the index.template.php

That seems to just make a button at the top of your forum, which you wouldn't need with this block :up:
Title: Re: SMF Chess Block Code
Post by: platinumUWE on January 09, 2008, 04:08:29 PM
yea i just did same with install and its working fine u coulda said that earlier lmaooooo ty u guys for the advice its a great addittion to the site ty lord anubis  ::)
Title: Re: SMF Chess Block Code
Post by: Zetan on January 09, 2008, 04:09:24 PM
Quote from: Jakki on January 09, 2008, 03:39:14 PM
ZTN, I did that and I"m still getting errors..


My post was only to highlight recovery options if it all goes wrong... Not a solution to the error.
Title: Re: SMF Chess Block Code
Post by: Lord Anubis on January 09, 2008, 04:20:49 PM
I hope everyone enjoys this addition, Chess is my favorite :)
Title: Re: SMF Chess Block Code
Post by: Jakki on January 09, 2008, 04:55:06 PM
Its okay I reloaded my SMF stuff. Errors gone, web working. NO arcade and other stuff yet...at least I didn't lose the important things my memebers.
Title: Re: SMF Chess Block Code
Post by: Jakki on January 10, 2008, 01:28:40 AM
OK, redid page and got chess added and working, now just have to find someone to play with...LOL
Title: Re: SMF Chess Block Code
Post by: Lord Anubis on January 10, 2008, 01:35:48 AM
watch how you word that Jakki :P

Well glad you got things back up and running
Title: Re: SMF Chess Block Code
Post by: Jakki on January 10, 2008, 09:17:53 PM
Wow didn't think about that. I ment play chess with..LOL
Yes, it works well.
Title: Re: SMF Chess Block Code
Post by: Lord Anubis on January 10, 2008, 10:23:52 PM
I think that SMFchess is a very cool mod :up:
Title: Re: SMF Chess Block Code
Post by: lurkalot on January 11, 2008, 12:16:26 AM
So do I.   Had three people playing me at once last night.

I must learn to play it properly now. :)
Title: Re: SMF Chess Block Code
Post by: Lord Anubis on February 14, 2008, 03:38:40 AM
Been tweaking around again and came up with this

Screenshot:

(https://www.tinyportal.net/proxy.php?request=http%3A%2F%2Ftinyadminresources.com%2Fextras%2Fimagehost%2Fscript%2Fuploads%2F7b5c61f2a9.jpg&hash=431304e646560b2e0138855bb77896ca8f07f415) (http://tinyadminresources.com/extras/imagehost/script/uploads/7b5c61f2a9.jpg)
CLICK PIC FOR LARGER VIEW


Instructions:

1. Download THIS FILE (http://tinyadminresources.com/chessblock.zip), and unzip the package
2. Upload the folder "chessblock" to the root of your forum
3. Insert the code below into a PHP block (CENTER)
Recommendations:
* Put it for custom action chess so it isn't shown throughout your forum
* Don't show title/frame
4. Enjoy!


global $scripturl, $context;
echo '
<img src="/chessblock/chess.png"/> <a href="', $scripturl ,'?action=chess"><font size="2">My Chess Stats</font></a> |
<img src="/chessblock/challenge.png"/> <a href="', $scripturl ,'?action=chess;u=', $context['user']['id'] ,';sa=challenge"><font size="2">Challenge</font></a> |
<img src="/chessblock/matches.png"/> <a href="', $scripturl ,'?action=chess;u=', $context['user']['id'] ,';sa=current"><font size="2">Current Matches</font></a> |
<img src="/chessblock/matches.png"/> <a href="', $scripturl ,'?action=chess;u=', $context['user']['id'] ,';sa=finished"><font size="2">Finished Matches</font></a> |
<img src="/chessblock/leader.png"/> <a href="', $scripturl ,'?action=chess;u=', $context['user']['id'] ,';sa=leaderboard"><font size="2">Leaderboard</font></a>
';


Or what I did was used the code below in the ChessCustom.template.php

Screenshot:
(https://www.tinyportal.net/proxy.php?request=http%3A%2F%2Ftinyadminresources.com%2Fextras%2Fimagehost%2Fscript%2Fuploads%2F830d7c61e3.jpg&hash=d8709ef41a1cda6e34f1de0b64fe820cb1027e9d) (http://tinyadminresources.com/extras/imagehost/script/uploads/830d7c61e3.jpg)
CLICK PIC FOR LARGER VIEW

Code:
<?php

//SMFChess CustomBar Template File
//ChessCustom.template.php
//
//General Use is to copy this into your Custom themes
//then edit this file
//that way you can have the bar fit to each of your sites themes


function template_SMFChessBar_custom()
{
global $txt$context$modSettings$scripturl$settings;

echo 
'
<center>
<img src="/chessblock/chess.png"/> <a href="'
$scripturl ,'?action=chess"><font size="2">My Chess Stats</font></a> | 
<img src="/chessblock/challenge.png"/> <a href="'
$scripturl ,'?action=chess;u='$context['user']['id'] ,';sa=challenge"><font size="2">Challenge</font></a> | 
<img src="/chessblock/matches.png"/> <a href="'
$scripturl ,'?action=chess;u='$context['user']['id'] ,';sa=current"><font size="2">Current Matches</font></a> | 
<img src="/chessblock/matches.png"/> <a href="'
$scripturl ,'?action=chess;u='$context['user']['id'] ,';sa=finished"><font size="2">Finished Matches</font></a> | 
<img src="/chessblock/leader.png"/> <a href="'
$scripturl ,'?action=chess;u='$context['user']['id'] ,';sa=leaderboard"><font size="2">Leaderboard</font></a>
</center>
'
.$context['page_index'];

}
?>

Title: Re: SMF Chess Block Code
Post by: Petee on February 18, 2008, 05:48:01 PM
Very cool. I added a "My Settings" (sa=settings) link to mine. Not sure if you left that out on purpose.

Not to stray too far, but how hard would it be to add a challenge block? This would be a block just displaying current challenges. Something along the lines of:

Chess Challengers:
Petee (Classic)
Lord Anubis (Dark Chess)
Feeble (Distinction)
Title: Re: SMF Chess Block Code
Post by: Lord Anubis on February 18, 2008, 07:36:08 PM
I left it out because it was taking too much space on my current theme

hmmm I dunno how hard that would be, I will look into it
Title: Re: SMF Chess Block Code
Post by: pauls_uk on August 14, 2008, 01:36:49 AM
Quote from: Lord Anubis on January 08, 2008, 07:29:55 PM
To use this block code, you must first have the SMFChess Mod (http://www.simplemachines.org/community/index.php?topic=129749.0) installed
(This mod is made by Feeble, any support for mod should be answered at the SMF site)



Here is an easy way to have all the SMFChess user functions in a block

Screenshot:

(https://www.tinyportal.net/proxy.php?request=http%3A%2F%2Ftinyadminresources.com%2Fextras%2Fimagehost%2Fscript%2Fuploads%2F4533e2cf05.jpg&hash=92fdce02a17bc6854be8b9c943650fa96e40e6aa)

Demo:
Live Demo (http://nextsite.org) Check out the right block, and click on chess  ;)

Instructions:

1. Download THIS FILE (http://tinyadminresources.com/chessblock.zip), and unzip the package
2. Upload the folder "chessblock" to the root of your forum
3. Insert the code below into a PHP block
4. Enjoy!


global $scripturl, $context;
echo '

<img src="/chessblock/chess.png"/> <a href="', $scripturl ,'?action=chess">My Chess Stats</a><br />
<img src="/chessblock/challenge.png"/> <a href="', $scripturl ,'?action=chess;u=', $context['user']['id'] ,';sa=challenge">Challenge</a><br />
<img src="/chessblock/matches.png"/> <a href="', $scripturl ,'?action=chess;u=', $context['user']['id'] ,';sa=current">Current Matches</a><br />
<img src="/chessblock/matches.png"/> <a href="', $scripturl ,'?action=chess;u=', $context['user']['id'] ,';sa=finished">Finished Matches</a><br />
<img src="/chessblock/leader.png"/> <a href="', $scripturl ,'?action=chess;u=', $context['user']['id'] ,';sa=leaderboard">Leaderboard</a><br />
';

Forgive me I am new at this how do u mean Upload the folder "chessblock" to the root of your forum could u tell me where i find the route of my forum please
Title: Re: SMF Chess Block Code
Post by: Ken. on August 14, 2008, 01:40:18 AM
Quote from: pauls_uk on August 14, 2008, 01:36:49 AM
Forgive me I am new at this how do u mean Upload the folder "chessblock" to the root of your forum could u tell me where i find the route of my forum please

That would be the same folder you loaded SMF files into when you did your original forum install.
Title: Re: SMF Chess Block Code
Post by: pauls_uk on August 14, 2008, 10:13:00 AM
Hi thanks for the reply I had the forum installed for me as I knew nothing about all this I am still learning thanks