Jump to content

ShadowMage

Members
  • Posts

    3,476
  • Joined

  • Last visited

Everything posted by ShadowMage

  1. mysql_num_rows requires a mysql resource. You are passing it a string. In your code, $req_result would be the resource. mysql_num_rows would be used to check if any data was returned from the query. You are trying to check if a specific field has been filled in, not whether any data matched your query. Your if statement should look something like this: if($r_row['r_imdb_link'] != '') or if(!empty($r_row['r_imdb_link'])) Also, regarding your original question about the if statement, you could use the ternary syntax. It's basically a condensed if statement: echo "<td>".(($r_row['r_imdb_link'] != '')?"Yes":"No")."</td>";
  2. I'm not sure exactly how the system works, but when you get warnings from the mods about objectionable content (or the like) the bar fills up. Or at least I assume that's what it's for. I've never gotten any warnings and my bar has always been empty.
  3. It seems that Ingolme and dsonesuk are both correct. I tested in FF 12 and if I put in dimensions (as attributes of the img tag) without changing the display, the browser will not leave room for the image. As soon as I set the display to inline-block, space is saved. Though, any element set to display inline-block will reserve space if dimensions are set in CSS. EDIT: It seems that FF is the only that does not leave space. IE (8), C, O, and S all reserved space for the image without changing the display.
  4. True, but that is, AFAIK, the most reliable way to set attributes on an element created using document.createElement(). I thought there were some cross browser issues with setAttribute.
  5. Usually, you just do: element.attributeName = ...; where attributeName is the name of the attribute you're trying to set. However, some are a little different. For example, to set the class attribute you'd do: element.className instead of just element.class
  6. preventDefault would be used instead of returning false. It is a way to prevent the form from submitting so that you can use AJAX to submit the form rather than let the form submit itself the normal way. The whole point of all of this is to maximize usability for as many users as possible. If a user has JS enabled, they will use the AJAX interface and have their forms submitted and pages updated without refreshing the page, but if a user has JS disabled, they will have to submit the form normally (and refresh the page), but the form will still function.
  7. Just try it out. I think you'll find the code that CodeName and dsonesuk provided does exactly what you want.
  8. You need to use something called a closure. Basically, what's happening is that by the time the setTimeout expires and the code runs, the loop is done and i is equal to whatever it was after the last iteration of the loop. This is why you are seeing the last element opening in each window. A closure prevents this by passing the state of 'i' into the setTimeout code. It should look something like this if my memory serves: setTimeout( function(win) { return function() { openWindow(win); } }(i), 1000 + (i*100) );
  9. It can be done with only a text editor. In fact you could even say it has to be done with a text editor. As birbal mentioned, Photoshop is only used to design your site. Think of it like building a house. First, you draw the blueprints and design the house in CAD, but you don't actually use CAD to build the house. And as for Dreamweaver....Don't! Don't use it. It never generates valid or well formed code. Use a regular text editor like Sublime Text or Notepad++. Also, like So Called mentioned, start small. Get a small page operational and build from there. Start with just HTML, then start styling it with CSS. Then you can move on to making it do stuff with JavaScript.
  10. That's how this page shows it. Technically, though, the ID selector is #. What CodeName is showing you is an attribute selector. The attribute in this case happens to be the ID.
  11. I thought you were always a ConTEXT advocate? Sublime Text is a very good editor. I love being able to write my own custom macros and snippets. I am also quite fond of the multiple selection feature and the ability to have multiple views of the same file.
  12. I have to agree with wolfkin, though. IMO, if you're going to teach somebody how to do something, you should teach them the right way. In HTML, that means writing well formed, semantic code. I realize it's up to the Refnes people to update the tutorials, but I just wanted to throw in my 2 cents.
  13. Yeah, the only thing you can do is edit the OP and append [solved] or something to the title.
  14. CSS can do it. Have a look at the @media rules.
  15. Clearly, I have much more to learn about OOP... It sounds as if I should have written my current project using a static class, based on some of the replies. Oh well, it works good the way it is and I'm too far along to go back and rewrite it so I'll have to keep this in mind for my next big project. Thanks for the explanations and examples.
  16. Though I must wonder what the benefit of creating static members is. Any time I create a property or method of a class, it is intended to be used on objects created from that class. Static methods must be passed all the data they require, so I wonder why not just create a standalone function instead? Or am I missing something?
  17. This is part of why browser sniffing is so frowned upon. It's very unreliable. Opera can imitate any of the other browsers by changing certain settings. I believe Chrome can also imitate other browsers. And by imitate, I mean altering the user agent strings or whatever else that identify the browser, not the rendering engines they use.So, while your Opera may say that it is Opera, someone else may have theirs configured to say that it is IE (though it still uses Opera's rendering engine).
  18. You could probably remove that line and it will behave the same. input is not a valid value for the type attribute on the button, so the browser will treat it as though the type were set to button. Same as if the type attribute were omitted altogether.
  19. I think you'll need to go into a little deeper explanation. Maybe provide a sample code snippet.
  20. FWIW, Keytone, if you want to simulate the ppt slideshow, you can use JavaScript. Just search Google for "JavaScript slideshow" or something similar and you should get a ton of examples. You could still provide the ppt for users with JS disabled if you wanted to.
  21. scientist, I think this is what you meant: In other words, users would have to have some sort of browser plugin installed to view them in the browser. Otherwise, the browser doesn't know how to handle them, so it just downloads them.
  22. It has to do with the vertical alignment of the buttons. By default, vertical alignment is set to baseline (ie, baseline of text in the button). You'll notice that when you increase the font size, the first button's text increases to two lines. This shifts the baseline of the button, altering the alignment of the other buttons on the same line. To fix this, set the vertical alignment to something else (top seemed to work well for me). .button { ... vertical-align: top;}
  23. ShadowMage

    Frames?

    Yes, frames are deprecated in HTML 4 (Strict) and HTML 5 and should no longer be used.
×
×
  • Create New...