Jump to content

trq

Staff Alumni
  • Posts

    30,999
  • Joined

  • Last visited

  • Days Won

    26

Everything posted by trq

  1. Why wouldn't getProduct() already be returning the correct object types?
  2. There's a pretty major floor in the INSERT statements. I forgot, you'll need to put the user_id in there too. INSERT INTO custom_settings (user_id, k, v) VALUES (19232, 'text-color', '#fff'); INSERT INTO custom_settings (user_id, k, v) VALUES (19232, 'background-color', '#666'); INSERT INTO custom_settings (user_id, k, v) VALUES (19232, 'max-post-per-page', '20');
  3. Lots of ways it could be done, probably the simplest though is too simply store key => value pairs against a users id. So... you'd need a table. CREATE TABLE custom_settings ( id INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(id), user_id INT, k VARCHAR(80), v VARCHAR(80) ); Then, for say user 'thorpe' whos id is 19232, we store some settings. INSERT INTO custom_settings (k, v) VALUES ('text-color', '#fff'); INSERT INTO custom_settings (k, v) VALUES ('background-color', '#666'); INSERT INTO custom_settings (k, v) VALUES ('max-post-per-page', '20'); Then, when a user logs in you grab those settings and store them along with there session. // login code goes here. if ($result = mysql_query("SELECT k, v FROM custom_settings WHERE user_id = 19232")) { if (mysql_num_rows($result)) { while ($row = mysql_fetch_assoc($result)) { list($k, $v) = $row; $_SESSION['custom_settings'][$k] = $v; } } } You can now use.... <?php echo $_SESSION['custom_settings']['background-color']; ?> wherever you need it and it will be custom for the logged in user. Of course the top few queries also need to be executed via php but that should be pretty simple to figure out.
  4. Usually those settings are stored within a database, then applied as a user logs in.
  5. You obviously didn't read the rules well enough. Have another look.
  6. Websites need to be downloaded to be viewed so it doesn't matter what browser your users are using they can get your codes source.
  7. The files would either need to be saved with a php extension or you will need to configure your server to parse files with the css extension as php.
  8. That is a very common error and would have nothing to do with Apache not starting. You'll need to check the error logs again.
  9. GTK isn't a compiler so that should remove that from the list.
  10. What error are you getting exactly?
  11. We really don't need all that information. There are many different clients available for subversion. The command line 'svn' being the most popular. Most IDE's (that I've used anyway) simply provide another interface to the 'svn' command.
  12. This is a VERY common request. http://www.crucialwebhost.com/blog/htaccess-apache-and-rewrites-oh-my/#add-www-to-domain
  13. That code does not help us at all.
  14. This wouldn't have anything to do with php. have a look at the produced html (view source) and see what that looks like.
  15. Its pretty hard to tell what is part of your current code and what you want in the file. Just remember that all single quotes within a single quoted string will need to be escaped.
  16. This entire process defeats the purpose of using a language like php to create dynamic websites. Is the reason your doing things this way because you don't have access to a database? What about sqlite which is built into php5?
  17. You need to always do it within your code. At minimum a SELECT query should look something like.... <?php $sql = "SELECT foo FROM bar"; if ($result = mysql_query($sql)) { if (mysql_num_rows($result)) { // within here $result contains a valid result resource // which contains records. $row = mysql_fetch_assoc($result); } else { // no records found, handle error. } } else { // query failed, handle error. } ?>
  18. Make sure you have firebug installed within FF and get a decent editor.
  19. There was a few syntax errors. $(document).ready(function() { $('#slidedown').toggle( function() { $('#form').slideDown("fast"); }, function() { $('#form').slideUp("fast"); } ); });
  20. Those clicks don't belong there. $('#slidedown').toggle( function() { $('#form').slideDown("fast"); }), function() { $('#form').slideUp("fast"); }); );
  21. Copy and Paste your actual code. We need your markup as well.
  22. It appears you are missing the # hashs from the 'form' selectors.
  23. O'Reilly have a great book on these very subjects. Can't remember excactly what its called or what revision it might be up too but just search there site.
×
×
  • 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.