TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
  • Total Members: 3,963
  • Latest: BiZaJe
Stats
  • Total Posts: 195,917
  • Total Topics: 21,308
  • Online today: 629
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 469
  • Total: 469

SMF Chess Block Code

Started by Lord Anubis, January 08, 2008, 07:29:55 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Jakki

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.

Jakki

OK, redid page and got chess added and working, now just have to find someone to play with...LOL

Lord Anubis

watch how you word that Jakki :P

Well glad you got things back up and running

Jakki

Wow didn't think about that. I ment play chess with..LOL
Yes, it works well.

Lord Anubis

I think that SMFchess is a very cool mod :up:

lurkalot

So do I.   Had three people playing me at once last night.

I must learn to play it properly now. :)

Lord Anubis

#26
Been tweaking around again and came up with this

Screenshot:


CLICK PIC FOR LARGER VIEW


Instructions:

1. Download THIS FILE, 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:

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'];

}
?>


Petee

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)

Lord Anubis

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

pauls_uk

Quote from: Lord Anubis on January 08, 2008, 07:29:55 PM
To use this block code, you must first have the SMFChess Mod 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:



Demo:
Live Demo Check out the right block, and click on chess  ;)

Instructions:

1. Download THIS FILE, 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

This website is proudly hosted on Crocweb Cloud Website Hosting.