Jump to content

ignace

Moderators
  • Posts

    6,457
  • Joined

  • Last visited

  • Days Won

    26

Everything posted by ignace

  1. Don't say it, do it! What will my reply now be? Sure? And you'll have to wait even longer for a response. Efficiency is key
  2. width: (x)px; margin: 0 auto; does just that I would probably create your blue box like: <div id="wrapper"> <div id="content"> <form action="#" method="POST"> <div> <label for="username">Username</label> <input type="text" id="username" name="username"> </div> <div> <label for="password">Password</label> <input type="text" id="password" name="password"> </div> <input type="submit" value="Login"> </form> </div> </div> #wrapper { width: 400px; height: 400px; margin: 0 auto;/*center it in the viewport*/ background: url(path/to/background/image.fig); } #content form { width: 200px; height: 150px; } #content { position: absolute; top: 50%; left: 50%; margin-top: -75px; margin-left: -100px; }
  3. Show us what you have got and we may be able to /unstuck you
  4. Before you perform the below query execute: UPDATE invoices SET paid = 2 WHERE date_due < now() SELECT (CASE paid WHEN 0 THEN 'Outstanding' WHEN 1 THEN 'Paid' WHEN 2 THEN 'Overdue' END) AS paid_status FROM invoices ORDER BY field(paid_status, 'Outstanding', 'Paid', 'Overdue') Loop over it as: $status = ''; while ($row = mysql_fetch_assoc($result)) { if ($status !== $row['paid_status']) { echo '<h2>', $row['paid_status'], '</h2>'; $status = $row['paid_status']; } //echo whatever you want to show below each category } Creates something like: <h2>Outstanding</h2> .. <h2>Paid</h2> .. <h2>Overdue</h2> ..
  5. To center a div you use: margin-left: auto; margin-right: auto; or short: margin: 0 auto; And in order for this to work your div should have a fixed width.
  6. $function = 'add'; if (function_exists($function . 'slashes')) { $value = call_user_func($function . 'slashes', $value); }
  7. The $moduleComposite is an "array" which $menu iterates over and builds the menu. Saying that you may want to take a look at the Builder Pattern. This has ofcourse the disadvantage of building the entire composite tree (instantiating every section and it's containing modules) on the other hand it could aswell write the info to a XML file and read later on by a class that builds the Menu from the XML source. I have no idea of how your application is architect of course, but in order to build your Menu you will have to know all available links for the Sections and their containing Modules or you'll end up with a half menu. You could of course also just add it to a database when the module is installed. Afterwards you read out the database table and build (and Cache, the menu is not that important to query the database on every request) the Menu.
  8. <div id="wrapper"> <div id="content"> <form action="#" method="post"> .. </form> </div> </div> #wrapper { width: 400px; margin: 0 auto; }
  9. 1) You could use the Singleton pattern to create a Menu object, which you would be able to call inside your module to add a navigation element. Although due to it's global nature it is not encouraged. class Menu { private static $instance = null; private function __construct() {} private function __clone() {} public static function getInstance() { if (null === self::$instance) { self::$instance = new self(); } return self::$instance; } } $menu = Menu::getInstance(); Sources: http://en.wikipedia.org/wiki/Singleton_pattern 2) Pass the $module structure to a $menu object. This uses the Composite pattern and is presumably the most encouraged method. $menu = new Menu($moduleComposite); interface MenuInterface {} class Menu { public function __construct(MenuInterface $a) {/*allows other objects to be passed besides the composite*/} } Sources: http://en.wikipedia.org/wiki/Composite_pattern
  10. The best would be to limit this at database level as other applications may in the future write to this database. However MySQL totally ignore's check()'s so your need to verify it at your application-level, like: if ($score > x) { error }
  11. Try: //Store the filename, path other criteria in the database $query = "UPDATE admin(avatar_name, avatar_path) VALUES('$filename', '$filepath') WHERE admin_id = {$_SESSION['admin_id']}";
  12. if ($spot == "Lee") { $SESSION['dir'] = '3'; } elseif ($spot == "Adam") { $SESSION['dir'] = '2'; } Note ==
  13. I really advise you some other mechanism then just enter-it-yourself-and-hope-you-are-honest as you can clearly see in the current table That 2xxxxx.. is the maximum integer value. The person who did that probably entered something like 999999999999999999999 which turned it into a float in PHP and in to an INT in MySQL. Add some logic to prevent to add anything higher then X as I don't imagine your score going anywhere near 100,000 (or 10,000 for that matter)
  14. Or go for something more eccentric, like: inserT InTO uPLOADS (uSeRnAmE) VaLuEs (teST) So you are sure it becomes really hard to read
  15. They don't need to know. Rebooting or restarting is sufficient (as in logging in the next day). However when they see the Register button and click it they'll see they will not be refused to create a third account.
  16. I successfully registered 3 accounts (and I could add more), names: azertyuiop qsdfghjklm ip-change wxcvbnqsd e-mail used: test@test.tes <-- very poor programming
  17. Do you have a static IP or dynamic IP? And where do you register? I can't find it. Nevermind, I had NoScript on. They generate their menu using JS, smart for all those people blocking JS
  18. See, manual intervention is required to prevent people from registering 2-3 accounts. LOL, read these rules: http://lastco.net/index.php?categoryid=77 Why call it vote if you may only vote for yourself? -- indicates competence
  19. Which I'll show you I'll be able to register more then x accounts (I have a dynamic IP).
  20. This is a good thing. Not an error. The manual doesn't mention it, a custom plugin?
  21. No, there just isn't a method to stop people from registering more then 2-3 accounts
  22. <?php foreach($data as $moo)?> Is the same as <?php foreach($data as $moo); ?> Therefor $moo contains the last element (as the loops assigns the last element to $moo) and you echo out the last element. This is not a bug I just didn't see it right.
  23. Nothing, except the number of open- and close-tags
  24. views (thread_id, user_id, date_last_viewed) To select all unread threads SELECT field, field FROM views RIGHT JOIN threads ON views.thread_id = threads.id WHERE threads.date_last_comment > views.date_last_viewed AND (views.user_id IS NULL OR views.user_id = $user_id) When a user views a thread INSERT INTO views (thread_id, user_id, date_last_viewed) VALUES ($thread_id, $user_id, now())
×
×
  • 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.