Jump to content

spambadger

New Members
  • Posts

    8
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

spambadger's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Rather than having separate pages for each languages, you're better off storing the translations in an include (or many depending on the size of your site), and calling these from the index page. So for example, you could have the following files: /lang/en/index.php <?php define('WELCOME_MESSAGE', 'Hello!'); ?> /lang/fr/index.php <?php define('WELCOME_MESSAGE', 'Bonjour!'); ?> Then your index.php in the root would look something like this (well, it'll look a bit more texty than this, but you should get the idea): <?php include '/lang/' . $language . '/index.php'; ?> <html> <body> <div><?php echo( WELCOME_MESSAGE ); ?></div> </body> </html> The reason to do it like this is to keep your structure and data separate - if you have multiple files for each language, then if you change the html you have to maintain the files for every language. This method is far easier to maintain, and more reliable.
  2. By the way, if you have jQuery (and I would since it makes DOM manipulation trivial, and it was originally written by one of the authors of that addDOMLoadEvent), you could do something like this: $(document).ready( function(){ $('.class').hide(); } ); with class being a css class. I'm sure most other javascript libraries make this simple too, but if I'm perfectly honest I haven't experimented with any others...
  3. Heh, that's quite a broad question. At the very simplest level, you could use a session to store that the person has logged in, so in page1.php where you check the username and password <?php session_start(); if( authenticate_user() ){ $_SESSION['LOGGED_IN'] = true; header( 'Location: page2.php' ); } ?> and on page2.php <?php session_start(); if( !isset($_SESSION['LOGGED_IN']) || !$_SESSION['LOGGED_IN'] ){ header( 'Location: page1.php' ); } ?> You'll probably want to go a bit deeper than that though, I'd google 'php authentication' to find out more.
  4. I've not done this before, but apparently you can use a format file to achieve what you require, there's some help here: http://msdn.microsoft.com/en-us/library/ms178129(SQL.105).aspx
  5. Hey, maybe it's a bit late now, but you could use a union - something like this: SELECT t.shirtcolor, p.pshirt shirtsize, COUNT(t.shirtcolor) as shirt_count FROM team t JOIN player p ON t.t_id = p.team WHERE t.locked = 1 UNION SELECT t.shirtcolor, c.shirtsize, COUNT(t.shirtcolor) as shirt_count FROM team t JOIN captain c ON t.t_id = c.team WHERE t.locked = 1 GROUP BY shirtcolor, shirtsize ORDER BY shirtcolor, shirtsize
  6. I have no doubt it can be done, but there's more code involved than that - that's just functions for event hooks. You'd also need to provide the html that has the evaluate image, and the javascript that attaches those functions to the events (if that's done in js rather than html).
  7. Can you do something like var tmp = 0; $('.meta span').each( function(){ tmp += parseInt($(this).text()); } ); alert(tmp); I've not used greasemonkey though, so I've no idea if that will work as is...
  8. You should definitely develop using separate files, but when you deploy, as salathe said, it depends on the situation. If you have a number of files that appear on every page on your site, and don't change much independently of each other, then there's no harm in compiling them together for deployment. Even better if you use something like Google's closure compiler, or YUI Compressor
  9. Hello fellow freaks! It's nice to find your friendly community. I've been coding for many years (since I was at school), and have gone through a wide array of languages and technologies - from logo to basic, through lisp, c, prolog, and many more besides to now where I'm writing web apps in c# for my day job, and php for my hobbies. Looking forward to contributing!
×
×
  • 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.