Previous Thread
Next Thread
Print Thread
Rate Thread
#213043 11/26/2001 11:03 PM
Joined: May 1999
Posts: 149
Enthusiast
Enthusiast
Offline
Joined: May 1999
Posts: 149
Here's an adaptation of Gerrit's automatic smileys hack, posted on the Perl board on https://www.ubbdev.com/threads/perl/showthreaded.pl?Cat=&Board=custom&Number=34040

With this hack, smileys are automatically converted to markup, so if you type in :-) , you get []https://www.ubbdev.com/threads/php/images/icons/smile.gif[/] , etc

In ubbt.inc.php, after line 442 which is
$Body = eregi_replace("\[$lang[ICON_WINK]\]","<img src="$config[images]/icons/wink.gif">",$Body);

enter the following section:

// Automatically convert text smileys to graphics ***** Added *****
$Body = eregi_replace("\:-\)","<img src="$config[images]/icons/smile.gif">",$Body);
$Body = eregi_replace("\}\:-\(","<img src="$config[images]/icons/mad.gif">",$Body);
$Body = eregi_replace("\:-\(","<img src="$config[images]/icons/frown.gif">",$Body);
$Body = eregi_replace("\:-o","<img src="$config[images]/icons/blush.gif">",$Body);
$Body = eregi_replace("8-\)","<img src="$config[images]/icons/cool.gif">",$Body);
$Body = eregi_replace("\:-\}","<img src="$config[images]/icons/crazy.gif">",$Body);
$Body = eregi_replace("\:-D","<img src="$config[images]/icons/laugh.gif">",$Body);
$Body = eregi_replace("\:-O","<img src="$config[images]/icons/shocked.gif">",$Body);
$Body = eregi_replace("\:-P","<img src="$config[images]/icons/tongue.gif">",$Body);
$Body = eregi_replace("\;-\)","<img src="$config[images]/icons/wink.gif">",$Body);

That should be it!
Max

Sponsored Links
Entire Thread
Subject Posted By Posted
Automatic Smileys Max Fisch 11/27/2001 6:03 AM
Re: Automatic Smileys AllenAyres 11/27/2001 5:38 PM
Re: Automatic Smileys Max Fisch 11/27/2001 5:51 PM
Re: Automatic Smileys powerlord 11/28/2001 9:33 AM
Re: Automatic Smileys Max Fisch 11/28/2001 5:21 PM
Re: Automatic Smileys AllenAyres 11/28/2001 5:46 PM
Re: Automatic Smileys Rick 11/28/2001 6:11 PM
Re: Automatic Smileys Max Fisch 11/28/2001 6:27 PM
Re: Automatic Smileys Max Fisch 11/28/2001 6:28 PM
Re: Automatic Smileys Rick 11/28/2001 6:57 PM
Re: Automatic Smileys Max Fisch 11/28/2001 10:35 PM
Re: Automatic Smileys powerlord 11/29/2001 12:21 AM
Re: Automatic Smileys Max Fisch 11/29/2001 1:06 AM
Re: Automatic Smileys AllenAyres 12/06/2001 1:00 AM

Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
Ruben Rocha
Ruben Rocha
Lutz,FL,USA
Posts: 254
Joined: January 2000
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20240506)