footytips.net Forum Index footytips.net
Get help for Wests, or just talk footy
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Customisations

 
Post new topic   Reply to topic    footytips.net Forum Index -> Wests tipping software
View previous topic :: View next topic  
Author Message
Daniel Wedge
Site Admin


Joined: 06 Mar 2006
Posts: 169

PostPosted: Wed Jun 21, 2006 10:29 am    Post subject: Customisations Reply with quote

Post any custom headers/footers that you think might be useful here! eg authenticating your tipsters to use your website.

Standard disclaimer: any code posted in this thread is owned by the original poster and in using their code you agree that if anything bad happens as a result of using their code, it's not their fault. Having said that, if you find a security hole, please post a patch!


Last edited by Daniel Wedge on Tue Aug 08, 2006 2:48 pm; edited 1 time in total
Back to top
View user's profile Send private message
Daniel Wedge
Site Admin


Joined: 06 Mar 2006
Posts: 169

PostPosted: Mon Jul 03, 2006 9:45 pm    Post subject: Reply with quote

Update: in the newly released version 1.3.1, you can now use the string _TITLE_ to mark the place where you want the page's title to appear in your custom header.

eg if you put <title>_TITLE_</title>, then on the fixtures pages, this will become <title>Round 1</title>, on the teams pages, it will be <title>Fremantle</title>, etc.
Back to top
View user's profile Send private message
Gish



Joined: 09 Mar 2006
Posts: 13
Location: Melbourne, Australia

PostPosted: Fri Jul 28, 2006 12:59 pm    Post subject: Reply with quote

I've included a hit counter, and how many people are online counter.

To get them, they are available at the link below (just customise the text to suit your domain)

Easy Web Stats - Live Visitor Counter
Easy Web Stats - Free Hit Counter

The current bottom of my site looks like the following:
Quote:
Back to main page

Generated by Wests tipping software.

1 person online
10 hits


Hope this gives some ideas to people of things to do.
_________________
Of all the things i've lost, I miss my mind the most
Back to top
View user's profile Send private message AIM Address
themit



Joined: 20 Mar 2006
Posts: 60
Location: Geelong

PostPosted: Sun Aug 06, 2006 9:01 am    Post subject: Get the current round Reply with quote

You can get Wests to make navigation easier with this header.
1) Create a new text file in notepad and call it getround.js (Note: to avoid saving this as getround.js.txt you need to select 'All Files' in the save as dialog box).
2) Copy the following code into it:

Quote:
// Change this variable to change current round
var CurrentRound = 18;
var NextRound = CurrentRound + 1;
// Let's print
document.write("<a href=http://www.mysite.com/fixtures/" + NextRound + ".html \>Put in your tips for next round </a>");
document.write("\&nbsp|\&nbsp");
document.write("<a href=http://www.mysite.com/fixtures/" + CurrentRound + ".html \>This week's results </a>");
document.write("\&nbsp|\&nbsp");
document.write("<a href=http://www.mysite.com/ladder/" + CurrentRound + ".html \>See the current Ladder </a>");
document.write("\&nbsp|\&nbsp");
document.write("<a href=http://www.mysite.com/tipladder/" + CurrentRound + ".html \>See the current Tipping Ladder </a>");

3)Change http://www.mysite.com to your own website.
4)Save this in the same directory as index.html.
5)Copy this header into Wests <script src="../getround.js"></script>.
6)When the round changes change the currentround to the round it it
_________________
Go Geelong, Season 2007 Premiers!
Themit.


Last edited by themit on Thu Aug 10, 2006 5:31 pm; edited 2 times in total
Back to top
View user's profile Send private message
Daniel Wedge
Site Admin


Joined: 06 Mar 2006
Posts: 169

PostPosted: Tue Aug 08, 2006 2:45 pm    Post subject: Reply with quote

Nice one themit.

Here's some code to force users to login to your website. You will need to have PHP installed on your web server.

1) save the users file in Wests, and copy the file to directory on your web server that contains the subdirectories fixtures, teams, tips, etc.

2) Open a text editor and enter the following code, saving it in a file called login.php
Code:

<?php
// returns the email for the given name/password combo.
function getuseremail($name, $password)
{
  $filename = "/path-to-web-directory/users";
  $thedata = file($filename); // reads file into an array.
  // explode each line in the array, check for name, passwd.
  reset($thedata);
  $email = "";
  foreach($thedata as $line)
  {
    $userdetails = explode(":", $line);
    // compare name and password sequentially...
    // passwords are stored as md5s of the actual password.
    if (strcmp($userdetails[0], $name) == 0 && strcmp($userdetails[1], $password                                              ) == 0)
    {
      $email = $userdetails[2];
      break;
    }
  }
  return trim($email);
}

import_request_variables("gP","");

if (isset($passwd)) $passwd = md5($passwd);
if (isset($_COOKIE["uname"])) $uname = $_COOKIE["uname"];
if (isset($_COOKIE["passwd"])) $passwd = $_COOKIE["passwd"];

if (isset($uname) && isset($passwd))
{
  $email = getuseremail($uname,$passwd);
  $loggedin = strlen($email) > 0;
  if ($loggedin)
  {
    setcookie("uname", $uname, time()+900);
    setcookie("passwd", $passwd, time()+900);
  }
} else $loggedin = 0;

if ($loggedin == 0)
{
?>
<html>
<head>
<title>Log in</title>
<link rel="stylesheet" type="text/css" href="/style.css">
</head>

<body>
<h1>Log in</h1>

<form action="/index.php" method="post">
Username:
<select name="uname">
<?
  $filename = "/path-to-web-directory/users";
  $thedata = file($filename); // reads file into an array.
  // explode each line in the array, check for name, passwd.
  reset($thedata);
  foreach($thedata as $line)
  {
    $userdetails = explode(":", $line);
    if (strlen(trim($userdetails[2])) > 0)
      echo "<option value=\"$userdetails[0]\">$userdetails[0]</option>\n";
  }
?>
</select>
<br>Password: <input type="password" name="passwd" size="10">
<br><input type="submit" value="Log in">
</form>
</body>
</html>
<?
exit();
}
?>

where path-to-web-directory is the absolute directory on the web server that your website lives in. It might be something like /home/username/WWW/footy
Also, I am using a file called index.php in that directory as my welcome page. You might need to either replace this with your own index page, or rename your index page. Note: this index page MUST include the following line at the very very top of the file:
Code:

<?php include("/path-to-web-directory/login.php"); ?>


3) Transfer login.php to the web server, saving it in the same directory as the users file in step 1.

4) change the file header in Wests (in advanced file output options) to the following:
Code:

<?php include("/path-to-web-directory/login.php"); ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
<title>_TITLE_</title>
<link rel="stylesheet" type="text/css" href="../style.css">
</head>
<body>

Again, change path-to-web-directory to whatever your directory is.

5) change the file extension in Wests (also in advanced file output options) to php so the files are all named 1.php, 2.php etc. Each of these files will check that the user is logged in before displaying any fixtures, ladders, tips, etc. If they are not logged in, they will be asked to log in, and once they have done so, will be taken back to the index page. Your users will automatically be logged out after 15 minutes (900 seconds) of inactivity - this time can be modified by changing the 900 in login.php to the number of seconds you desire.
Back to top
View user's profile Send private message
chris_212



Joined: 20 Mar 2006
Posts: 16
Location: Melbourne, Australia

PostPosted: Thu Mar 29, 2007 2:21 pm    Post subject: Reply with quote

Thanks for those themit & Daniel... I use both of those scripts and they work great :d
_________________
--
chris!
Back to top
View user's profile Send private message
themit



Joined: 20 Mar 2006
Posts: 60
Location: Geelong

PostPosted: Thu Mar 29, 2007 8:11 pm    Post subject: Breadcrumb Links Reply with quote

This creates a navigation link system to show users where they are in a page. You need PHP and all the files have to be .php (unless you have PHP rendering in other files) files.
Code:

<div align="center"><h1>_TITLE_ - _FILETYPE_</h1></div>
<?php
$type="_FILETYPE";
$bread="";
if($type=="Ladder"){
$bread="Ladder";
}elseif($type=="Tipping Ladder"){
$bread="Tipping Ladder";
}elseif($type=="Fixtures/Results by Ground"){
$bread="Grounds";
}elseif($type=="Tipster Stats"){
$bread="Tipsters";
}elseif($type=="Fixtures and Results"){
$bread="Fixtures/Results";
}elseif($type=="Tips"){
$bread="Tips";
}elseif($type=="Fixtures/Results by Team"){
$bread="Teams";
}
$bread='<a href="../index.php">Home</a> > ' . $bread . " > _TITLE_";
echo "<br>" . $bread;
?>

_________________
Go Geelong, Season 2007 Premiers!
Themit.
Back to top
View user's profile Send private message
Waldschmidt



Joined: 27 May 2017
Posts: 1

PostPosted: Fri Jun 02, 2017 9:58 pm    Post subject: Reply with quote

chris_21e2 wrote:
Thanks for those themit & Daniel... I use this 2 Week Diet book with both of those scripts and they work great :d


Thanks for the code.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    footytips.net Forum Index -> Wests tipping software All times are GMT + 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group