ober
Staff Alumni-
Posts
5,327 -
Joined
-
Last visited
Everything posted by ober
-
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.
-
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.
-
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?
-
Depends... I use $_REQUEST from time to time, but most times I want to know where stuff is coming from.
-
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.
-
haha... and about the background image, I swear it repeats just right of the middle of the screen at 1280x1024. You created that!?!?!
-
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).
-
Seperate them with commas. You could also just grab them from the Submit_form() function.
-
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?
-
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.
-
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.
-
Umm... PS3 is already out in the US... has been for over a month. And what does that have to do with Adobe???
-
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.
-
.... thanks for the definitions, but I think most of us knew that.
-
>Can't figure out how to get the javascript debugging feature to work though Seems I'm not the only one!
-
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.
-
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.
-
Code font size has been fixed. Thanks Ron.
-
If you click the logo at the top, it'll take you to the main site.
-
Correct.
-
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.
-
We will do this... just need a little time.
-
This site no longer seems to like opera (or vice versa)
ober replied to Clarkey_Boy's topic in PHPFreaks.com Website Feedback
Or a "some hack leaching material" kind of issue. I've been using Opera all day and the browser is not the issue.