smileys url issue

Dr. GBooky is here to help you with your guestbook problems ...
Post Reply
Seraphic
Posts: 4
Joined: Fri May 05, 2006 7:55 am

smileys url issue

Post by Seraphic »

Script URL: Will PM it to admin if needed
Version of script: 1.35
Version of PHP: Not Needed
Hosting company: Not Needed
Have you searched THIS FORUM for your problem: Yes

The smileys show up fine in the pop-up window, but in posts they don't show up. I can't get the location to be correct.

Coming up as "/layout/images/rotflol.gif"
Should be "/content/guestbook/rotflol.gif

I edited these in gbook.php with the new url but it didn't help.

Code: Select all

$text = str_replace(':)','<img src="images/icon_smile.gif" border="0" alt="">',$text);
$text = str_replace(':(','<img src="images/icon_frown.gif" border="0" alt="">',$text);
$text = str_replace(':D','<img src="images/icon_biggrin.gif" border="0" alt="">',$text);
$text = str_replace(';)','<img src="images/icon_wink.gif" border="0" alt="">',$text);
$text = preg_replace("/\:o/i",'<img src="images/icon_redface.gif" border="0" alt="">',$text);
$text = preg_replace("/\:p/i",'<img src="images/icon_razz.gif" border="0" alt="">',$text);
$text = str_replace(':cool:','<img src="images/icon_cool.gif" border="0" alt="">',$text);
$text = str_replace(':rolleyes:','<img src="images/icon_rolleyes.gif" border="0" alt="">',$text);
$text = str_replace(':mad:','<img src="images/icon_mad.gif" border="0" alt="">',$text);
$text = str_replace(':eek:','<img src="images/icon_eek.gif" border="0" alt="">',$text);
$text = str_replace(':clap:','<img src="images/yelclap.gif" border="0" alt="">',$text);
$text = str_replace(':bonk:','<img src="images/bonk.gif" border="0" alt="">',$text);
$text = str_replace(':chased:','<img src="images/chased.gif" border="0" alt="">',$text);
$text = str_replace(':crazy:','<img src="images/crazy.gif" border="0" alt="">',$text);
$text = str_replace(':cry:','<img src="images/cry.gif" border="0" alt="">',$text);
$text = str_replace(':curse:','<img src="images/curse.gif" border="0" alt="">',$text);
$text = str_replace(':err:','<img src="images/errr.gif" border="0" alt="">',$text);
$text = str_replace(':livid:','<img src="images/livid.gif" border="0" alt="">',$text);
$text = str_replace(':rotflol:','<img src="images/rotflol.gif" border="0" alt="">',$text);
$text = str_replace(':love:','<img src="images/love.gif" border="0" alt="">',$text);
$text = str_replace(':nerd:','<img src="images/nerd.gif" border="0" alt="">',$text);
$text = str_replace(':nono:','<img src="images/nono.gif" border="0" alt="">',$text);
$text = str_replace(':smash:','<img src="images/smash.gif" border="0" alt="">',$text);
$text = str_replace(':thumbsup:','<img src="images/thumbup.gif" border="0" alt="">',$text);
$text = str_replace(':toast:','<img src="images/toast.gif" border="0" alt="">',$text);
$text = str_replace(':welcome:','<img src="images/welcome.gif" border="0" alt="">',$text);
$text = str_replace(':ylsuper:','<img src="images/ylsuper.gif" border="0" alt="">',$text);
This is the only issue i'm having. Any help would be great. Thanks
Last edited by Seraphic on Fri May 05, 2006 9:57 am, edited 1 time in total.
Klemen
Site Admin
Posts: 10116
Joined: Fri Feb 11, 2005 4:04 pm

Post by Klemen »

All your smileys should be inside "images" folder (when extracting gbook.zip file make sure you have "Use folder names" checked!).

For example the demo GBook is located at
www.phpjunkyard.com/gbook/gbook.php
yet images are in the
www.phpjunkyard.com/gbook/images/rotflol.gif

PM me the gbook URL if that isn't the problem.

Regards
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
Seraphic
Posts: 4
Joined: Fri May 05, 2006 7:55 am

Post by Seraphic »

Hi,

Everything is on the server. But for some reason it won't get the right url for emoticons in posts. PM Sent.

Thanks
Klemen
Site Admin
Posts: 10116
Joined: Fri Feb 11, 2005 4:04 pm

Post by Klemen »

It's because of the paths and calling from your own main.php with query string you use.

For example simleys work if you open GBook directly:
http://YOURDOMAIN.COM/content/guestbook/gbook.php

You can try changing image URLs to

Code: Select all

$text = str_replace(':)','<img src="../images/icon_smile.gif" border="0" alt="">',$text); 
(note ../ added before images) or use the full URL for images. for example:
http://YOURDOMAIN.COM/content/guestbook ... otflol.gif

Regards
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
Seraphic
Posts: 4
Joined: Fri May 05, 2006 7:55 am

Post by Seraphic »

Hi,

That also didn't work and and adding the full URL doesn't work as well. :?

Either way it's still thinking the images are at "/layout/images/livid.gif"

Anything else I could try?

Thanks
Klemen
Site Admin
Posts: 10116
Joined: Fri Feb 11, 2005 4:04 pm

Post by Klemen »

Your images are currently pointing to
http://YOURDOMAIN.COM/layout/images/icon_eek.gif
and that of course doesn't work.

Use the FULL URL, like this one:
http://YOURDOMAIN.COM/content/guestbook ... on_eek.gif

It must work 100%, it also works if you open that URL in your browsers.

IMPORTANT NOTE
Your old post will still have broken images, delete it and post a NEW POST to test the correct URL!
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
Seraphic
Posts: 4
Joined: Fri May 05, 2006 7:55 am

Post by Seraphic »

Well, damn. All those URL changes I did would have worked.

I guess I thought the old post would auto update the image address. It didn't and that was why nothing was working.

Thank for the help
Post Reply