
ignace
Moderators-
Posts
6,457 -
Joined
-
Last visited
-
Days Won
26
Everything posted by ignace
-
Why not use HTTP_ACCEPT_LANGUAGE?
-
- Drop the Times New Roman font you should always use sans-serif and keep serif only for headings (http://en.wikipedia.org/wiki/Serif) - Your website is about snooker but only partially through it's header. You can do much more: Look for websites that provide (and allow you to use them in your website) RSS feeds for snooker news on upcoming- and passed official games Instead of explaining what your website is about show content that intrests them by for example using the above tip (they will register automatically) Once they like it allow them to share it with friends which in turn increases traffic (you know that little thing you see on blogs that says: "share this") After your explanation in the news section the About us page seems redundant The images have been poorly cut out (try some photoshop tutorials like http://www.photoshopcafe.com/tutorials/cutout/cutout.htm) * Your login form poorly handles errors (I get a white page with red text) * I can provide invalid data to the register form (and also handles error handling poorly) * Invalid HTML Your website contains no content that inspires me to return to your website. What if I were new to snooker, what would you want to tell me (rules, *famous* players, ..)? What if I were a veteran snooker player, what would you want to tell me then? Gather content that will inspire people to return to your website as much as they can and you soon may be holding a serious market share and millions of visitors Just providing an online (printable) version would be sufficient for some players to visit your website. And by printable I mean a print CSS (http://www.alistapart.com/articles/goingtoprint/) In today's age we also don't create web 1.0 websites anymore and your website should be more social (web 2.0). Don't worry if you don't understand what that Web1.0 & 2.0 stuff is. Allow users to comment (for example list passed official games and allow users to comment on them) I like the design but as you admitted it isn't yours. The points marked with * I consider as extremely important and should be addressed ASAP.
-
LOL he changed it. It first was a different kinda background with a klingon lady on the frontpage Besides I like the criminas better maybe try stealing that one
-
http://stackoverflow.com/questions/1223923/advanced-banner-rotation-algorithms
-
Well the OP hasn't clearly stated for what he is using it but in that case a LIMIT 2 would suffice. The first record would be the where id = 3015 because of ORDER BY id ASC, order_num ASC
-
Don't create 2 topics for the same thing: http://www.phpfreaks.com/forums/index.php/topic,284875.msg1351159.html#msg1351159
-
I hadn't noticed the LIMIT 1, this should do it: SELECT title, abstract, body FROM Articles WHERE category_id = 1 AND id >= 3015 ORDER BY id ASC, order_num ASC; Try this one because UNION is IMO overkill
-
User must activate listing using activation link sent to email
ignace replied to Modernvox's topic in PHP Coding Help
Sorry I apologize misunderstood what you meant. -
Enter a session to start a form from an email link URL
ignace replied to hugeness's topic in PHP Coding Help
The best route would be to not use session's at all and more importantingly not allow impersonation. Instead use a db table in which you store the values for the form: friends_forms (id, uniqid, data) Then using PHP: if (submit) { $hash = sha1(uniqid()); $data = serialize($_POST); $sql = "INSERT INTO friends_forms (uniqid, data) VALUES ('$hash', '$data')"; // send an e-mail to the user containing form.php?unique=$hash // when the friend clicks the link, load the data using hash from friends_forms and fill the form (don't forget to unserialize()) } -
User must activate listing using activation link sent to email
ignace replied to Modernvox's topic in PHP Coding Help
Yes. But how does that solve: -
Don't wrap an object around an object either use it or extend it. class FeedManager extends MySQLi { public function getCategoryList() { /* logic, return $categoryList; */ } } class ItemManager extends MySQLi { public function add($config) { /* logic */ } } class DropDownWidget { public function __construct($config = array()) { /* logic */ } public function render() { /* logic, renders the dropdown */ } public function __toString() { return $this->render(); } }
-
if (!empty($_REQUEST)) { $sql = "SELECT * FROM extraq WHERE programid = $programid"; $result = mysql_query($sql); if (0 !== ($row_count = mysql_num_rows($result))) { // LOL, I just thought about this $rows = array_map('mysql_fetch_assoc', array_fill(0, $row_count, $result)); $keys = array_keys($_REQUEST); foreach ($rows as $row) { if (in_array($row['id'], $keys)) { $id = intval($row['id']); $value = $_REQUEST[$row['id']]; $sql = "INSERT INTO $extraqopt (extraqid, value, subid) VALUES ($id, '$value', $subid)"; if (!mysql_query($sql)) { trigger_error("Query failed: $sql", E_USER_WARNING); continue; // does the code after trigger_error() execute? The manual doesn't explicitly say it doesn't? } } } } }
-
Read this: http://www.phpfreaks.com/forums/index.php/topic,268089.msg1264949.html#msg1264949
-
User must activate listing using activation link sent to email
ignace replied to Modernvox's topic in PHP Coding Help
p2grace by all means share -
- Invalid HTML & CSS - In firefox is the click here rounded corner not shown on the left side - The Learn More navigation on the left side highlights but is not clickable (text is however make the entire button clickable) - "Buy Now" but you give no price or estimate - The actual buy now page does not give the customer much confident that he will actually get something as it looks obscure - Which e-mail? sales@..? - To be honest the website looks like a rip-off. Nice design but the content and functionality is seriously flawed. - I laughed at the Refund Policy. Did you write this yourself?
-
or SELECT title, abstract, body FROM Articles WHERE category_id = 1 AND id >= 3015 ORDER BY id ASC, order_num ASC LIMIT 1;
-
Oh yeah that brings back memories
-
WHOOHOO cags, YOU THE MAN!!
-
Darn I wish someone had told me I would have then put them in a text document.
-
So you basically are looking for an ACL (Access-Control List) There are different ways of implementing such behavior if you want to keep the roles or groups known and don't want to allow the end-user to make their own roles you could use something like: class User { const ROLE_GUEST = 'guest'; const ROLE_MEMBER = 'member'; const ROLE_AUTHOR = 'author'; const ROLE_EDITOR = 'editor'; const ROLE_PUBLISHER = 'publisher'; const ROLE_ADMINISTRATOR = 'administrator'; private $role = self::ROLE_GUEST; public function getRole() { return $this->role; } public function setRole($role) { if ($this->getRole() === $role) return; switch ($role) { case self::ROLE_GUEST: case self::ROLE_MEMBER: case self::ROLE_AUTHOR: case self::ROLE_EDITOR: case self::ROLE_PUBLISHER: break; // OK, valid case self::ROLE_ADMINISTRATOR: $this->isAdministrator() or throw new Exception('Only administrators may assign administrator privilege'); break; default: throw new Exception("Invalid role specified '$role'"); break; // break is ignored } $this->role = $role; } public function isGuest() { $this->getRole() === self::ROLE_GUEST; } public function isMember() { $this->getRole() === self::ROLE_MEMBER; } public function isAuthor() { $this->getRole() === self::ROLE_AUTHOR; } public function isEditor() { $this->getRole() === self::ROLE_EDITOR; } public function isPublisher() { $this->getRole() === self::ROLE_PUBLISHER; } public function isAdministrator() { $this->getRole() === self::ROLE_ADMINISTRATOR; } public function save() { /* logic */ } } In your code you would use it like: if ($action === 'edit' && ($u->isEditor() or $u->isAdministrator())) { If you are confused by: $this->isAdministrator() or throw new Exception('Only administrators may assign administrator privilege'); Then the manual says: // The constant false is assigned to $f and then true is ignored // Acts like: (($e = false) or true) $f = false or true; http://www.php.net/manual/en/language.operators.logical.php
-
How would I go about structuring the following scheduler script?
ignace replied to ghurty's topic in PHP Coding Help
I don't understand what you are actually trying to accomplish but I'm guessing that if I would book a conference room I would want all of our staff to be in the same room not spread across many rooms. I also would want to conference for a little longer then 5 minutes usually just discussing the agenda already takes about 20 minutes or so. I would opt for a table structure like: room (id, name, capacity) booking (id, room_id, alias, cost, start, estimated_end, is_paid) Then to tell which conference rooms are available at $time SELECT * FROM room JOIN booking ON room.id = booking.room_id WHERE $time NOT BETWEEN start AND estimated_end+$treshold AND room.capacity >= $capacity -
Where can I find my favourite topics? The old design allowed me to mark topics as favourite or something I kept them as a reference but I can't find them anymore. So, where are they?
-
What CMS will you be using?
-
Your explanation reveals your database has been badly designed. You only need 2 tables: news and news_category. The table news contains any news (sports, politics, ..) and the table news_category contains the categories: sports, politics, .. So if you want all sports related news articles: SELECT * FROM news, news_category WHERE news_category.id = news.category_id AND news_category.name = 'Sports';