Jump to content

Daniel0

Staff Alumni
  • Posts

    11,885
  • Joined

  • Last visited

Everything posted by Daniel0

  1. Hmm... looks really good indeed (both in regard to features, performance and the layout). A forum migration is not an easy task though. Especially not when the database is large like ours.
  2. You shouldn't do it this way. The fact that you are having issues manipulating the data is a testimony to this. What you're looking at is a many-to-many relationship which is made by having a third linking table giving you these tables: users - user_id - username tags - tag_id - name tags_users - tag_id - user_id To get user #568's tags you can do this: SELECT t.name FROM tags_users link INNER JOIN users u ON u.user_id = link.user_id INNER JOIN tags t ON t.tag_id = link.tag_id WHERE u.user_id = 568; And as for your problem, adding a tag to a user is a simple INSERT operation (you'd have to insert a new tag into the tags table as well if it's not a new tag).
  3. You could always use the good old observer pattern. It will allow you to step into code execution at specific points.
  4. The PHP manual has this to say about it: Also, please note that $HTTP_SERVER_VARS is deprecated in place of $_SERVER.
  5. You are already receiving help with this issue here: http://www.phpfreaks.com/forums/index.php/topic,220955.0.html
  6. preg_match('#<a href=([^>]+)>([^<]+)</a>#i', $text, $matches); list(, $url, $label) = $matches; Something like this should do it. This requires your anchor tag to always look like the one displayed above though.
  7. It's going to be a bit more difficult with guests. I guess you can store a cookie on the guests' computer storing what they have and haven't read. You can then check against that. It's not completely accurate though.
  8. To further decrease the size of the table you could also delete all rows associated with a specific topic id each time a new reply is added to it. Seeing as it would be unread to everybody then it would make sense to delete everybody's read info for that specific topic.
  9. I'd guess it uses the forums read/unread system to determine whether it should be updated or not. Basically, if this was marked as unread then you update the view count. Otherwise you don't.
  10. Why would you want to store what people haven't read? That doesn't make sense. This means that if you have 1M members then each time a post is made you'll need to insert 1M additional rows (one for each user). You should store what people have read instead... I.e. a table like this: CREATE TABLE read_info ( post_id bigint(20) unsigned NOT NULL, user_id bigint(20) unsigned NOT NULL, read_at datetime NOT NULL, PRIMARY KEY (post_id, user_id) ); Then each time a person reads something you insert the relevant information into the table.
  11. Uhm... if you are a new user then how can you have read the posts? I'd expect posts to be unread when you've first registered. Besides, if you go with the timeout I said above then you would only have 600k entries if there had been that many posts within the last 30 days (or whatever timeout value you choose).
  12. Do SHOW TABLE STATUS LIKE 'xxprofile'; Then use the Auto_increment row. Please note that the auto_increment value is +1 of the last inserted ID.
  13. Well, imagine that you had view_article.php?id=153 People might link to that. Now imagine that I deleted article 153 and later added a new one. Now you would have inconsistency because 153 is now something else.
  14. Rather, reCAPTCHA is dirty...
  15. Just say that after something like 30 days then it's not considered "new" anymore. Then store read info for all people in the database and delete it after 30 days.
  16. To be called an MVC framework then you need to be a framework that uses the MVC design pattern...
  17. You can use strtotime(). You could also split it up using explode() and insert the various values into mktime(). Either of those two will give you a Unix timestamp. Then you just need to format it using date().
  18. What do you mean with "correct ID"? It's standard practice not to reuse IDs because they're supposed to be unique.
  19. You should just do utf8_encode($link); The "string" part is just for specifying datatypes. It means that the $link argument should be a string and that the function will return a string value.
  20. Well, yes. Just do class global { static public function getEnum($string) { return $string; } // etc. } echo global::getEnum($string); I assume this is sort of what you need. If that's the case then you might want to look into PHP 5.3.0's namespaces: http://php.net/namespaces Edit: Wait... global is a reserved keyword so you'll have to find another name. You could just use the plural, i.e. globals.
  21. <input type="checkbox" name="Receipt_Issued" value="1" <?php if ($issued) { echo 'checked="checked"'; } ?>/> Something like this.
  22. Man I completely forgot about this. Anyway, it's been fixed now.
  23. No. I wrote it from scratch.
  24. Just out of curiosity why hasn't PHPFREAKS bridged their forums to the main site, so you only have to login once? Tell me how SMF determines whether you're logged in or not and I'll do it. I tried figuring it out, but the code was so horrible I gave up. You can't just jump into SMF's code and figure something out if you don't already know something about SMF. They use globals all the time and it's really difficult figuring out what it is and where it comes from.
  25. It's called Firefox. I thought you were a diehard Opera user.
×
×
  • 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.