Jump to content

MargateSteve

Members
  • Posts

    240
  • Joined

  • Last visited

Everything posted by MargateSteve

  1. Not sure why but I thought PhpFeaks had shut down! I stumbled across this looking for something else for the same site I am still trying to create! Simply put, every time I get it close to being what I would consider finished, my eyes get attracted to a better way of doing it (MVC instead of a simple php site, discovering bootstrap, learning SASS, moving everything to AJAX then moving 99% of it back to controller queries and so on) plus a change of job that reduced time to play around with this, grandkids etc. I never did as far as I recall. I seem to recall creating the grid as a php array from the db results was looking the best option. As mentioned above, I am still looking into this so will be stumbling across this again soon.
  2. Thanks mxxd. It is working just how I want now. Talking of the prefixes, as I am using less, I was planning to create some mixins to take the pain out of it, but am now considering using -prefix-free, but don't think it works with imported fonts. Thanks again.
  3. I am building an admin area for a site I am working on with a collapsing sidebar. This works fine except that I wanted it to slide in/out smoothly rather than just disappear/reappear. I tried a JS approach by setting it to 'left:-260px' when collapsed and using show/hide but this caused problems with the rest of the layout. I have also tried adding 'transition: all 0.5s ease;' to the sidebar wrapper class but this did nothing either. Can anyone suggest the best way to go for this? I will be setting up a right sidebar (that is hidden by default) at a later date but want to get the concept right before adding that. JsFiddle Regards Steve
  4. Hi all. Can anyone recommend the best forum software to be integrated with an existing site? I have one at the moment on a site that is being developed (margatefans.co.uk) with SMF but it is far from ideal. When showing things like 'Latest Posts' on pages outside the forum (using SSI.php) it is quite difficult to maintain user level rules so people can only see what they are supposed to see. Also, as the navigation will eventually be dynamic, I have not found a way of succesfully querying a database in SSI.php. I have seen plenty of sites in the past where the forum is part of the site but there seems surprisingly few Google results for it so wondered if anyone here has succesfully done this. Regards Steve
  5. I am trying to create a soccer results matrix from an existing database (tables and current query are at the bottom of the post) and am not sure where to start with it. It is a bit hard to explain (unless you are a soccer fan where these results matrix's or grids are very common) but will give it a go! Basically, I need to create a grid where the rows relate to the Home Teams and the columns relate to the Visiting Teams. In the corresponding cell I need to put the score of that game (I will also want to put in the date if the game has not been played but should be able to sort that once I have the basics sorted). For example, if the result of a game was United 2 City 0, the cell of the United row and the City column should show 2-0. An example of what I am trying to achive can be found at http://en.wikipedia.org/wiki/2009%E2%80%9310_Premier_League#Results. As I said, I already have an existing database that I want to use and have an idea how it should work but really need a starting point on how to go about it. My guess is that it would need to loop through the Home Teams (alphabetically is standard for these grids) and for each Home Team then loop through the Away Teams and then place the correct result in that cell for the game where the two teams match. If the Home Team = Away Team then something else needs to be shown (usually an X or preferably a black cell) as a Team cannot play itself. Any suggestions on how I could start this would be greatly appreciated. Thanks in advance Steve The tables and sample data (these are not the full tables, just the relevant fields) CREATE TABLE `all_games` ( `all_games_id` int(11) NOT NULL auto_increment, `date` date default NULL, `time` time default NULL, `home_team` int(11) NOT NULL default NULL, `away_team` int(11) NOT NULL default NULL, `home_goals` int(11) default NULL, `away_goals` int(11) default NULL, PRIMARY KEY (`all_games_id`) ) INSERT INTO `all_games` VALUES (1, '2009-08-15', '15:00:00', 19, 42, 4, 0); INSERT INTO `all_games` VALUES (2, '2009-08-18', '19:45:00', 42, 29, 0, 4); INSERT INTO `all_games` VALUES (3, '2009-08-22', '15:00:00', 42, 30, 2, 1); INSERT INTO `all_games` VALUES (4, '2009-08-24', '19:45:00', 1, 42, 0, 3); INSERT INTO `all_games` VALUES (5, '2009-08-29', '15:00:00', 11, 42, 3, 0); CREATE TABLE `teams` ( `team_id` int(11) NOT NULL auto_increment, `team_name` varchar(45) collate latin1_general_ci default NULL PRIMARY KEY (`team_id`) ) INSERT INTO `teams` VALUES (1, 'Aveley'); INSERT INTO `teams` VALUES (2, 'Billericay Town'); INSERT INTO `teams` VALUES (3, 'Bury Town'); INSERT INTO `teams` VALUES (4, 'Canvey Island'); INSERT INTO `teams` VALUES (5, 'Carshalton Athletic'); The query I currently use to show the result of the game eg (in pseudo code)... showdate ' ' HomeTeam ' ' home_goals ' ' AwayTeam ' ' away_goals would show Monday, 26th December 2011 United 2 City 0 SELECT *, DATE_FORMAT(`time`,'%l:%i%p ') AS showtime, DATE_FORMAT(`date`,'%W, %D %M %Y') AS showdate, HT.team_name as HomeTeam, VT.team_name as AwayTeam, FROM all_games JOIN teams as HT ON all_games.home_team = HT.team_id JOIN teams as VT ON all_games.away_team = VT.team_id WHERE all_games.home_team IS NOT NULL
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.