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,973
  • Latest: NonStop
Stats
  • Total Posts: 196,231
  • Total Topics: 21,353
  • Online today: 606
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 1
  • Guests: 241
  • Total: 242
  • @rjen

Roster Page - modified

Started by tarmer, April 11, 2008, 02:31:16 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

tarmer

Let me start by thanking all of you for the service you guys provide to the community...... It is cool to get stuff figured out by others and be able to share it


Roster Page (modified) - As a direct response to a post, I will start a new topic to see if this is something that may be able to help others as well....

The Roster Page code that is written is really geared towards creating "team pages and positions" from member information


I think the basic premise of it will work, But I am trying to get it geared more towards a Fantasy soccer roster - There are other programs that do this, But I like the idea of incorporating SMF to do this to keep all site material fluid and matching

So that being said here is what it would consist of :

You would need to have a title to define positions (http://www.the-rota.com/?page=30 this example has things like Joint Chiefs of Staff, General, Private, etc..)

They would be Goalkeeper, Defender, Midfielder, Forward

I would need to have a form that you would input information into :

Name :
Position :
Team :
Nationality :
Salary:

And write this to some table so that you could change the team information (in case of trade ) and the player would move to whichever team and show up on that roster

I would need to be able to create as many of these as needed ( I may start with 12 but may need 14 soon)

They would be somehow tied to a "Team Roster" Page (see below)


River Plate Roster <------ Nice Header - Team name is not fixed it would be a variable

Goalkeepers <------  Nice header

Player<----- These could be tables
Player

Defenders   <------  Nice header

Player
PLayer

Midfielders  <------  Nice header

Player
Player

Forwards    <------  Nice header

Player
Player

I would somehow need to be able to link these to a menu or create a block with links to see the links on the front page

Here is my site - I will be using this theme (default)

http://all-time-baseball.com/Final_Whistle/index.php


I hope this is enough to have someone be able to look at it - Let me know if I can offer anymore insight......  Thanks Again

JPDeni

#1
QuoteI would need to be able to create as many of these as needed
I'm not sure what you mean by "these." Are you talking about teams? Or pages? Or something else?

You don't have to have a different script for each team. What you can do is use the URL to determine which team would be printed out. For example, assuming that your roster page is page 15, and you wanted to see the roster of the team called "xyz", your URL could be

http://all-time-baseball.com/Final_Whistle/index.php?page=15;team=xyz

It would then print out all of the information for the team xyz. If, however, you wanted to print out the info for team abc, you would use

http://all-time-baseball.com/Final_Whistle/index.php?page=15;team=abc

Does this make sense? :)

What information is there about the teams themselves, separate from the players? Do they have names? Owners? Home "playing fields"? (Obviously I know absolutely nothing about fantasy sports. :) ) I'm thinking that the best thing to do would be to have two tables -- a "teams" table and a "players" table, with a relationship between them on the team id.




The code is in this post.

tarmer

QuoteI'm not sure what you mean by "these." Are you talking about teams? Or pages? Or something else?

this would be teams / or team pages - As a league expands I would need to add more teams (or pages) to accomodate

QuoteWhat information is there about the teams themselves, separate from the players? Do they have names? Owners? Home "playing fields"? (Obviously I know absolutely nothing about fantasy sports.  ) I'm thinking that the best thing to do would be to have two tables -- a "teams" table and a "players" table, with a relationship between them on the team id.


Teams would have - Owner (maybe a short history "championships won (by year) and cups won (by cup & year)  A name (Liverpool, Chelsea, Real Madrid  etc....) and a Stadium Name

Players would have: Name (needs to be a long field - Some Brazilian players have LOOOOOONG names), Position, Nationality (if a flag could show with this field that would be real awesome)

http://en.wikipedia.org/wiki/Club_Atl%C3%A9tico_River_Plate (see bottom of page) 

and a salary (contract amount)....

I guess I could set this up in pages like you mentioned but would like to be able to move players from roster to roster and have them rebuilt automatically rather than manually changing pages...

Thanks
sec

JPDeni

Oh, no. I don't think you should set it up in pages at all. It's much better to do it with a database. I'm just trying to work out the fields that should be in tables. It's a whole lot easier for me to do these things up front. I've been working with helping folks create databases for over a decade, using several different types of scripts. I've found that it always happens that as soon as I get it done, the person wants to add "just one more thing." :) It seems to the user that this would be something simple, but often it means starting the whole thing over from scratch, so that the first effort I put into it is completely wasted effort.

So.... my point in asking all of these questions in an attempt to get it right the first time. :)

At this point, I've got three tables planned:

Team
----
team_id (key) autoincrement
teamOwner
teamName
teamStadium


Player
------
player_id (key) autoincrement
team_id ---------------------> Team table
playerName
playerPosition
playerNationality
playerSalary


Award
-----
award_id (key) autoincrement
team_id ---------------------> Team table
awardType (championship or type of cup)
year

Is that all of the information you need to have?

tarmer

Well Maybe 3 more fields

Player

Career Goals Scored
Career Assists
Career Clean Sheets

That would be all I would need - And I won't change it, Thanks for the questions upfront and the assistance

Tony

JPDeni

"Clean Sheets"? They do laundry?  :2funny:  ;) (No need to explain. I know it doesn't have anything to do with laundry.)

Okay. I'll work on it a bit and post here when I come up with something.

tarmer


JPDeni

A couple of questions ---

Do you want a drop-down select field for the Nationality? It will ensure that the spelling is correct for each one. If so, which countries do you want to start with? You can add more later, if you need to.

Who can add or edit teams, players and awards? Only admin? Only moderators? Everybody?

tarmer

Drop Down would be great..... Argentina, England, Spain (as long as I can add more this will be fine)

All editing can be done only by admin

JPDeni

Oh, yeah. No problem with adding more countries. Just follow the pattern in the code. You can also use flag images.

I'm getting there. I've got forms for adding teams, players and awards. The rest of it shouldn't be too hard, but I probably won't have it for you until tomorrow or Sunday.

This website is proudly hosted on Crocweb Cloud Website Hosting.