PDA

View Full Version : a fix for a ubb conversion utility problem?


08-12-2000, 01:20 AM
Has anyone created some type of hack that will search the post table for all signs of "smile.gif" "biggrin.gif" etc and replace it with the necessary keyboard stroke? I converted from ubb and my images arent in the same directory and I just need an easy way to replace all the [ img ]http://www.extremeforums.com/smile.gif[ /img ] tags with ": )"

Anyone done such a thing?

~Chris

[Edited by TechTalk on 08-11-2000 at 10:21 PM]

08-12-2000, 02:23 AM
Umm... I'm staring at the import code now, and that's part is fine. As a matter of fact, I know it worked for me...

example line:
$htmlcode=str_replace("<IMG SRC=\"$ubbnoncgiurl/smile.gif\">",":)",$htmlcode);

You must've inputted the the NonCGI URL incorrectly...

08-12-2000, 02:59 AM
Umm i can assure you that I inputed the NonCGIURL correctly or vbulletin would have never found all my threads...

Either way I guess im still going to need a fix for this :( Do you have any ideas? I have already narrowed it down and found out how many posts have the incorrect link in there by creating a little page that selects from the database where pagetext contains "smile.gif" ..etc.

Here is is:
http://www.extremeforums.com/include/killsmiles.php

The number is a little off and this is the long way of doing it...thats why I was wondering if anyone has / could create this ?

Thanks
~Chris

08-12-2000, 03:07 AM
Oh and in refrence to your comment above.....

I too am staring at the import code. Check out this line:

// do code tags
$htmlcode=str_replace("<BLOCKQUOTE><font size=\"1\" face=\"arial,helvetica\">code:</font><HR><pre>","[ code ]",$htmlcode);
$htmlcode=str_replace("</pre><HR></BLOCKQUOTE>","[ / code ]",$htmlcode);


In order for that to work on my site it would have had to read:


// do code tags
$htmlcode=str_replace("<BLOCKQUOTE><font size=\"1\" face=\"Verdana, Arial, Helvetica, sans-serif\">code:</font><HR><pre>","[ code ]",$htmlcode);
$htmlcode=str_replace("</pre><HR></BLOCKQUOTE>","[ /code ]",$htmlcode);




Is there any way to get a fix for this too? Now all my pots with code look like this:
http://www.extremeforums.com/forums/showthread.php?threadid=220

~Chris

[Edited by TechTalk on 08-12-2000 at 12:09 AM]

08-12-2000, 05:46 AM
OK i fixed a little something up but I think i goofed it. Could someone please have a look? Its does the find/replace just fine but it fills every row with the same info! Not good.....

Here it is:
http://www.extremeforums.com/include/killsmilie.phps

Ed do you think you could have a look?

Thanks
~Chris

08-16-2000, 05:57 PM
Could someone please let me know if they see anything wrong with the above code? I would hate to destroy my site!

Thanks
~Chris

08-16-2000, 06:23 PM
I just added a redirect code in my .htaccess for the old smilies directory to the new one - works like a charm!

08-16-2000, 07:04 PM
Originally posted by Me2Be
I just added a redirect code in my .htaccess for the old smilies directory to the new one - works like a charm!

Ouch! That's got to be killing your server though :( Each hit for an image is making multiple requests to your web server processes...

-Chris

08-16-2000, 07:38 PM
Hasn't affected it that much (so you've seen). I actually started doing it about a week ago, and I haven't seen any change in performance whatsoever. Since these are only for old posts, it isn't that often.

08-16-2000, 08:11 PM
Oh ok, I guess that's true, it is only the old posts, so that redirect will be less and less as time goes by.

-Chris

08-16-2000, 09:21 PM
If you had a script that changed it automatically, wouldn't it cause just as much stress on the server since it needs to run that program everytime an old smilie comes up?

08-16-2000, 09:31 PM
Originally posted by Me2Be
If you had a script that changed it automatically, wouldn't it cause just as much stress on the server since it needs to run that program everytime an old smilie comes up?

I didn't take a look at the script, but I was under the impression that this was a data cleanup type program that would run once for the entire database, and fix all the links. Once it ran, all would be well.

-Chris

08-16-2000, 09:33 PM
Ah, I guess it would help if I read the entire thread LOL - but no, I like my little solution :D