Jump to content

ober

Staff Alumni
  • Posts

    5,327
  • Joined

  • Last visited

Everything posted by ober

  1. Yet a better version: [code] <?php $lookfor = array(" :)", " :) ", ":) "); $data = str_replace($lookfor, ' <img src="Smileys/default/smile.gif" /> ', $data); $lookfor = array(" :(", " :( ", ":( "); $data = str_replace($lookfor, ' <img src="Smileys/default/cry.gif" /> ', $data); ?> [/code] And taith, he didn't forget the $i's... the code he showed would go outside the for loop after it's been imploded again.
  2. Well, I guess I'll use that with one modification: [code] <?php   $mod_data =str_replace(" :) ", ' <img src="Smileys/default/smile.gif" /> ', $mod_data);   //... etc ?> [/code] To avoid instances where that string is not alone. I still don't understand why it wasn't working otherwise.
  3. So I have a chat feature on another SMF board and I'm trying to parse smiley's into it.  The display portion is a div, so I just need to replace certain collections of characters with <img tags.  Here is my code: [code]<?php function parse_data($data) { $mod_data = explode(' ', $data); for($i=0;$i<count($mod_data);$i++) { if(strpos($mod_data[$i], 'http://') === 0 && strlen($mod_data[$i]) > 10) $mod_data[$i] = substr($mod_data[$i], 7); if(strpos($mod_data[$i], 'www') === 0 || strpos($mod_data[$i], '.com') > 0 || strpos($mod_data[$i], '.net') > 0) $mod_data[$i] = '<a href="http://' . $mod_data[$i] . '" target="_blank">' . $mod_data[$i] . '</a>'; if(trim($mod_data[i]) == ":)") $mod_data[$i] = '<img src="Smileys/default/smile.gif" />'; if(trim($mod_data[i]) == ":(") $mod_data[$i] = '<img src="Smileys/default/cry.gif" />'; } $data = implode($mod_data, ' '); return $data; } ?>[/code] I basically store 20 responses in a DB and as I display them, I send the output to this function.  For whatever reason, it's not reading the :) and replacing it with the img tag.  Can someone spot what I'm doing wrong?
  4. Depends... I use $_REQUEST from time to time, but most times I want to know where stuff is coming from.
  5. Just looked at the image... that's a hell of a job if you actually made that. EDIT: Interesting design technique... I've rarely seen anyone center and then repeat.
  6. haha... and about the background image, I swear it repeats just right of the middle of the screen at 1280x1024.  You created that!?!?!
  7. Love love love the new design.  That looks fantastic!  I'm curious about where you get your background/header graphics.. probably some photo repository like sxc.hu, but I still want to know.  And how do you always find these backgrounds that repeat well?  That's my biggest problem with designing full-width sites. My only complaints have already been covered (the main being the text location vs. the box location for the search in Opera).
  8. Seperate them with commas.  You could also just grab them from the Submit_form() function.
  9. You should really use something other than "PS3" to describe photoshop since that's the name of a gaming console. Also.... would it kill YOU to search the Adobe site?
  10. I'm not sure I understand the problem.  You would just use the same method!? Also, YOU CANNOT USE GETELEMENTBYID UNLESS YOU USE THE ID ATTRIBUTE! It may work in one browser, but it is NOT cross-browser capable.
  11. Submitting alone can be done strictly with JS.  No AJAX needed.  Keep in mind however, that if they are keying this in, you probably don't want to auto-submit in case they screw up the code. And if you're not using a keyboard, there isn't really a way to do this unless you're using an ActiveX control because there is no way to take input from the PC and stuff it into a website.  And even then, if you're not using a keyboard, there is no way to trigger an event to check the length of the string. EDIT:... I guess you could use onChange... but I'm not sure that would work correctly or not.
  12. Umm... PS3 is already out in the US... has been for over a month.  And what does that have to do with Adobe???
  13. If you need to correct something, just post the corrections, not the entire thing. Questions like this are very hard to answer.  As with anything else, the only way to get better is to practice and learn the material better.  If your logic and problem solving skills are decent, things should naturally get easier.
  14. .... thanks for the definitions, but I think most of us knew that.
  15. >Can't figure out how to get the javascript debugging feature to work though Seems I'm not the only one!
  16. You cannot access the class on the starting page from the backend page.  You'll need to initialize the class in the backend page.  You're getting everything mixed up.
  17. The font size appears fine to me.  What do you suggest?  Also, the edit time will remain.  There is a lot of reasoning behind this, but the biggest is avoiding confusion within posts.  If you need to change something, make a new post after 2 min.
  18. Code font size has been fixed. Thanks Ron.
  19. If you click the logo at the top, it'll take you to the main site.
  20. A lot of thought has gone into the timing of that feature.  If you need to make an edit more than 2 minutes after the initial post, please make a new post.  It will avoid a LOT of confusion for a lot of instances.
  21. We will do this... just need a little time.
  22. Or a "some hack leaching material" kind of issue.  I've been using Opera all day and the browser is not the issue.
×
×
  • 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.