4images Forum & Community

4images Modifications / Modifikationen => Mods & Plugins (Requests & Discussions) => Topic started by: drhtm on February 14, 2003, 04:58:36 AM

Title: Emoticons and Reply in Comments!
Post by: drhtm on February 14, 2003, 04:58:36 AM
Is it possible to add Emoticons like here in the forum to our comments forms?  if so, i have a grip of wonderful emoticons to share!

In addition, how bout adding a reply button to the comments, so visitors could reply to another comment similar to this forum


Quote
here is an example of what i'm talking about



peace! and thanks in advance!
Title: Emoticons and Reply in Comments!
Post by: SLL on February 14, 2003, 08:36:19 AM
4images is not a forum system, and I belive there's no need to make if full of forum features
Title: Emoticons and Reply in Comments!
Post by: drhtm on February 14, 2003, 09:51:42 AM
Quote from: SLL
4images is not a forum system, and I belive there's no need to make if full of forum features


Okay i'm not saying to convert the 4images script into a forum (  8O  )...
I think its rediculous...besides that's why we have so many mods already for integration with different forums, right?  but What if a site doesn't have a forum, and is only based on the 4images script, like mine!?!  :lol:

The fact that the comments system is so plain worries me.(  :?  )..don't you think (wait you don't like this idea   8O ) doesn't anyone else think that this is a good idea just to make the 4images more interactive and colorful...the site i've created is a very personal photo album (family and friends only) and we would like to reply to each other's comments and add silly emoticons to our messages and so forth...I've integrated the shoutbox from W E B F R O O T (http://www.webfroot.co.nz/) and so far its a great hit among my visitors.

Its just a suggestion nothing more!  I'm only trying to help come up with more fun interactive mods for all of us to enjoy.  If its not duable then fine, but if someone can, I think it would be very popular among our visitors!


 :wink:  :wink:  :roll:  :wink:  :wink:
Title: Emoticons and Reply in Comments!
Post by: drhtm on February 14, 2003, 10:17:28 AM
Oh and its very funny how your site's design  (http://faces.dalnet.ru/details.php?image_id=390&sessionid=2e0d27af2fab0f80c6760e7f2ef254b7&l=english)is strickingly similar to phpBB.  I mean even your comments buttons are similar...I'm shocked you would say what you did!?! i would have guessed you would be the first person on top of this!

Oh well, life is strange like that i guess.   :wink:
Title: Emoticons and Reply in Comments!
Post by: V@no on February 15, 2003, 01:23:10 AM
Here is the simplest way to show emoticons, without separate control from admin control panel. Its just replace special codes like " : ) ; ) " with image.
-------------------------------------------------------------------
example:
http://come.no-ip.com/details.php?image_id=7570&page=2#comments
-------------------------------------------------------------------

Step 1.
Open /includes/functions.php

Find:
Code: [Select]
   $text = preg_replace("/(\[)(u)(])(\r\n)*([^\"]*)(\[\/u\])/siU", "<u>\\5</u>", $text);


Add right after it ( before " } "):
Code: [Select]
$text = smilies($text);



1.2
Add at the end of the file, just before ?> :
Code: [Select]
//--------------------------
//--------Smiles------------
//--------------------------
function smilies($text,$enablesmilies = 1) {
  global $smileyfromcache, $smileytocache;
  $imagesdir = TEMPLATE_PATH."/smiles";
  if(gettype($smileyfromcache) != "array") {
$smilesfrom = array(
":)" => "smiley",
";)" => "wink",
":D" => "cheesy",
";D" => "grin",
":(" => "sad",
":o" => "shocked",
":O" => "shocked",
"8)" => "cool",
":P" => "tongue",
":p" => "tongue",
"???" => "huh",
":-[" => "embarassed",
":-X" => "lipsrsealed",
":-x" => "lipsrsealed",
":-'(" => "cry",
":-\\" => "undecided",
"::)" => "rolleyes"
  );
foreach ($smilesfrom as $key => $val) {
 $smileyfromcache[] ='/(((>[^<]*)|(^[^<]*))([\s\n\r]|^|<br( \/)?[>]))('.str_replace('|','\|', quotemeta(str_replace("<", "&lt;", str_replace(">", "&gt;", str_replace("\/", "\\\/", $key))))).')/s';
 $smileytocache[] = "\\1<img src=\"$imagesdir/$val.gif\" alt=\"\" border=\"0\">";
}
  }
  if ($enablesmilies) {
$text = parsesmilies($text);
  }
  return $text;
}
function parsesmilies($text) {
  global $smileyfromcache, $smileytocache;
  $oldtext = "";
  while($oldtext != $text) {
$oldtext = $text;
$text = preg_replace($smileyfromcache, $smileytocache, $text);
  }
  return $text;
}
//------End Smiles-------




Step 2.
Create new folder: /templates/<yourtemplate>/smiles/. Upload your smiles.
U can download "sample" :roll: smiles pack from here (http://home.attbi.com/~vanowm/smiles.zip)


2.2.
Edit $smilesfrom array with this format:
"CODE" => "FILENAME"

* CODE is a code for your emoticon, e.i ; ) or : D
* FILENAME is name of the file u want use for that emoticon, WITHOUT extension.


NOTE:
1. All images must be .gif
2. All items in the array, MUST have comma at the end (e.i "CODE" => "FILENAME", And ONLY last item in the array MUST NOT have the comma.
Title: Emoticons and Reply in Comments!
Post by: drhtm on February 15, 2003, 06:06:30 AM
That's great!

Thanks...do you think a 'reply' is possible? :oops:
Title: Emoticons and Reply in Comments!
Post by: V@no on February 15, 2003, 06:12:43 AM
what do u mean 'reply'?
Title: Emoticons and Reply in Comments!
Post by: drhtm on February 15, 2003, 06:14:37 AM
I mean...for example someone posts a comment on a image...then for example the owner likes to reply to a particular user's comments.  Just like here in the forum...is it possible so that it shows up like this...


Quote
I'm replying to someone's comment


 :roll:
Title: Emoticons and Reply in Comments!
Post by: drhtm on February 18, 2003, 10:15:24 PM
I installed the mod with no problem but I think i'm having trouble with it

I realized for some reason i can't add more than one emoticon.  

any ideas?

What do you think about the reply feature? is that possible as well?
Title: Emoticons and Reply in Comments!
Post by: V@no on February 19, 2003, 12:31:51 AM
Quote from: drhtm
I installed the mod with no problem but I think i'm having trouble with it

I realized for some reason i can't add more than one emoticon.  

any ideas?


Add where?
u must use spaces between each emotion, but must not use spaces between caracters of emotion.
btw, it has a problem using < and > .  :cry:
Title: Emoticons and Reply in Comments!
Post by: drhtm on February 20, 2003, 08:08:37 AM
well i'm not sure why I can't add more than one emoticon...

I also realized if i hit return while im typing my message and then add a emoticon, it don't display it...very wierd..

BTW - do you know if its possible to add a reply feature to our comments? I think this would be great for personal websites like mine. :oops:
Title: Emoticons and Reply in Comments!
Post by: Biggi on March 03, 2003, 01:10:31 AM
Dear V@no,

first of all I want to thank you for all of your effort and help for everyone at this place. Thanks a lot. I use a lot of your mods and I'm really glad with it.

(sorry for my english, it isn't the best anymore since I left school  :wink:)

I just added this smiley-mod and I realized, that I have the same problem as the member before:

there is only ONE smiley at a time that I can use in one comment. If I want to use and show more than one, it is only the code like ": )" which is shown.

Could you help and share an idea how this could be corrected?
I'd be very, very thankful!
Title: Emoticons and Reply in Comments!
Post by: V@no on March 03, 2003, 01:22:52 AM
I dont know what to tell u, because it works just fine for me, I even install this mod on fresh, 4images installation.
make sure u use smile cods like this:
:)
:D
;)
:/

but not like this:
: )
: D
; )
: /

See the difference? - no spaces between caractes of smile code.
Title: Emoticons and Reply in Comments!
Post by: Biggi on March 03, 2003, 01:32:10 AM
Oh, your answer was very fast  :D

Yes, I proved it and it's okay. There are no spaces in the codes of funktion.php and there are no spaces when I write the code into a comment.

Do you use 4images Version 1.7? Could it be possible, that there is a difference from one version to another?

I'd really love to find out where's the mistake...

Thx!
Title: Emoticons and Reply in Comments!
Post by: Biggi on March 03, 2003, 01:41:10 AM
Well, now I found out, that it sometimes works, sometimes not...

Please have a look:
http://www.hilfebullet.de/bibodia/4images/details.php?image_id=837

I tested it in the comments
Title: Emoticons and Reply in Comments!
Post by: V@no on March 03, 2003, 01:43:35 AM
yes, I use v1.7, and I think it's not really good/smart idea use out of date software :lol:

can u send me a link to your gallery?

so far, I have no idea what could be wrong.
Title: Emoticons and Reply in Comments!
Post by: Biggi on March 03, 2003, 01:59:38 AM
I use 1.7 too  :D

Here's the link where I tested the smilies:
 http://www.hilfebullet.de/bibodia/4images/details.php?image_id=837

Have a look  :wink:
Title: Emoticons and Reply in Comments!
Post by: Biggi on March 03, 2003, 02:02:42 AM
I think I go to bed... It is 2 in the night and maybe I find the mistake with a fresh head at the morning  :wink:

Good night so far...

And thanks a lot!
Title: Emoticons and Reply in Comments!
Post by: V@no on March 03, 2003, 02:50:33 AM
that was a bug...
the script didnt show smiles, when smile code is first caracter in the line.
here is the fix:
in the code u added in /includes/functions.php find:
Code: [Select]
$smileyfromcache[] ='/(((>[^<]*)|(^[^<]*))([\s\n\r]|^))('.str_replace('|','\|', quotemeta(str_replace("<", "&lt;", str_replace(">", "&gt;", str_replace("\/", "\\\/", $key))))).')/s';
Replace with:
Code: [Select]
$smileyfromcache[] ='/(((>[^<]*)|(^[^<]*))([\s\n\r]|^|<br( \/)?[>]))('.str_replace('|','\|', quotemeta(str_replace("<", "&lt;", str_replace(">", "&gt;", str_replace("\/", "\\\/", $key))))).')/s';

I just edited the original code, so if u install this mod now, then, ignore this fix.
Title: Emoticons and Reply in Comments!
Post by: Biggi on March 03, 2003, 08:41:42 AM
Yippeeeeeeeee! That's it!

Thank you very much!!!
Title: Emoticons and Reply in Comments!
Post by: Tutych on March 08, 2003, 12:49:30 AM
I dont now why but i have this error :

Parse error: parse error, unexpected T_DOUBLE_ARROW, expecting ')' in /home/uniscree/public_html/gallery/includes/functions.php on line 1233

Warning: Cannot add header information - headers already sent by (output started at /home/uniscree/public_html/gallery/includes/functions.php:1233) in /home/uniscree/public_html/gallery/includes/sessions.php on line 107

Warning: Cannot add header information - headers already sent by (output started at /home/uniscree/public_html/gallery/includes/functions.php:1233) in /home/uniscree/public_html/gallery/includes/sessions.php on line 107

Warning: Cannot add header information - headers already sent by (output started at /home/uniscree/public_html/gallery/includes/functions.php:1233) in /home/uniscree/public_html/gallery/includes/sessions.php on line 107

Warning: Cannot add header information - headers already sent by (output started at /home/uniscree/public_html/gallery/includes/functions.php:1233) in /home/uniscree/public_html/gallery/includes/sessions.php on line 107

Fatal error: Call to undefined function: smilies() in /home/uniscree/public_html/gallery/includes/functions.php on line 659
Title: Emoticons and Reply in Comments!
Post by: V@no on March 20, 2003, 08:51:25 AM
Quote from: Tutych
I dont now why but i have this error :

Parse error: parse error, unexpected T_DOUBLE_ARROW, expecting ')' in /home/uniscree/public_html/gallery/includes/functions.php on line 1233

Warning: Cannot add header information - headers already sent by (output started at /home/uniscree/public_html/gallery/includes/functions.php:1233) in /home/uniscree/public_html/gallery/includes/sessions.php on line 107

Warning: Cannot add header information - headers already sent by (output started at /home/uniscree/public_html/gallery/includes/functions.php:1233) in /home/uniscree/public_html/gallery/includes/sessions.php on line 107

Warning: Cannot add header information - headers already sent by (output started at /home/uniscree/public_html/gallery/includes/functions.php:1233) in /home/uniscree/public_html/gallery/includes/sessions.php on line 107

Warning: Cannot add header information - headers already sent by (output started at /home/uniscree/public_html/gallery/includes/functions.php:1233) in /home/uniscree/public_html/gallery/includes/sessions.php on line 107

Fatal error: Call to undefined function: smilies() in /home/uniscree/public_html/gallery/includes/functions.php on line 659

u did something wrong when inserted the code in functions.php.
check all closing brackets }
or "
Title: Emoticons and Reply in Comments!
Post by: V@no on March 20, 2003, 08:57:02 AM
Quote from: drhtm

Thanks...do you think a 'reply' is possible? :oops:

I think it is ;) :D :
http://come.no-ip.com/details.php?image_id=7570&page=3#comment56
it's mostly deppence on BBCode.
will try make tutorial for it. (no deadline though ;) )
Title: Emoticons and Reply in Comments!
Post by: PREACHER on March 20, 2003, 07:22:59 PM
HI V@no!

I have visited your page and i find your  intigration of the smilies for the users more simply.

Can you make an toutorial for it??  :oops:
Title: Emoticons and Reply in Comments!
Post by: V@no on March 20, 2003, 09:54:15 PM
Quote from: PREACHER
HI V@no!

I have visited your page and i find your  intigration of the smilies for the users more simply.

Can you make an toutorial for it??  :oops:

do u mean just the smiles?
I did on previouse page...didnt I? :?
Title: Emoticons and Reply in Comments!
Post by: PREACHER on March 21, 2003, 11:44:21 AM
Hi, i mean the intigration of the BB code what you use on your page.

The users have only to push the smilie to take him to the post and not use this code sighns like this: : )



You can take a look on my page  example (http://www.desktopart.de/details.php?image_id=300) and now on yours http://come.no-ip.com/details.php?image_id=7570&page=3#comment56

My english is bad but i hope you understand me what i mean  :)
Title: Emoticons and Reply in Comments!
Post by: V@no on March 24, 2003, 08:12:39 PM
Quote from: PREACHER
Hi, i mean the intigration of the BB code what you use on your page.

you got it ;):
http://4homepages.de/forum/viewtopic.php?p=20105#20105
just follow the replays, to get compleate version :D
Title: Emoticons and Reply in Comments!
Post by: itme on May 02, 2003, 04:14:24 AM
hello V@no can u give code smile in your file includes/functions.php thank's :)
Title: Emoticons and Reply in Comments!
Post by: V@no on May 02, 2003, 09:22:34 AM
Quote from: itme
hello V@no can u give code smile in your file includes/functions.php thank's :)


I use smiles from Yahoo messanger ( u can find it on innet )
Code: [Select]
//--------------------------
//--------Smiles------------
//--------------------------
function smilies($text,$enablesmilies = 1) {
  global $smileyfromcache, $smileytocache;
  $imagesdir = TEMPLATE_PATH."/smiles";
  if(gettype($smileyfromcache) != "array") {
$smilesfrom = get_smiles();
foreach ($smilesfrom as $key => $val) {
 $smileyfromcache[] ='/(((>[^<]*)|(^[^<]*))([\s\n\r]|^|<br( \/)?[>]))('.str_replace('|','\|', quotemeta(str_replace("<", "&lt;", str_replace(">", "&gt;", str_replace("\/", "\\\/", $key))))).')/s';
 $smileytocache[] = "\\1<img src=\"$imagesdir/$val.gif\" alt=\"\" border=\"0\">";
}
  }
  if ($enablesmilies) {
$text = parsesmilies($text);
  }
  return $text;
}
function parsesmilies($text) {
  global $smileyfromcache, $smileytocache;
  $oldtext = "";
  while($oldtext != $text) {
$oldtext = $text;
$text = preg_replace($smileyfromcache, $smileytocache, $text);
  }
  return $text;
}
function get_smiles(){
$smilesfrom = array(
":)" => "happy",
"(:" => "happy",
":-))" => "very_happy",
":lol:" => "very_happy",
":D" => "big_smile",
":O" => "surprised",
":o" => "surprised",
";)" => "wink",
":wink:" => "wink",
":(" => "sad",
":*(" => "very_sad",
":cry:" => "very_sad",
":confused:" => "confused",
":shy:" => "embarrassed",
":vicious:" => "vicious",
":|" => "undecided",
":pig:" => "pig",
":P" => "tongue",
":p" => "tongue",
"B)" => "cool",
":B" => "nerd",
"X(" => "angry",
":X" => "in_love",
"|)" => "asleep",
"=;" => "talk_to_hand",
"@};-" => "rose",
"):)" => "cowboy",
"8X" => "skull",
"=:)" => "alien",
"0:)" => "angel",
":devil:" => "devil",
":clown:" => "clown",
"3:O" => "cow",
"3:o" => "cow",
":monkey:" => "monkey",
"(~~)" => "pumpkin",
"[-(" => "huff",
"*:)" => "bulb",
":$" => "shhh",
":chicken:" => "chicken",
"~o)" => "cup",
"%%-" => "clover",
"b(" => "beat_up",
":E:" => "peace",
":&" => "sick",
"=*" => "kiss",
";;)" => "flirt",
":?)" => "what",
"(%)" => "ying",
"o-+" => "april",
":billy:" => "billy",
":hiro:" => "hiro",
":mad:" => "mad",
":R:" => "praying",
"[-x" => "nono",
"[:D]" => "hugging",
":dance:" => "dancing",
"=D" => "applause",
"(?)" => "thinking",
":^o" => "liar",
"@)" => "hypnotized",
"8|" => "rolleyes",
"8}" => "crazy",
"?|" => "tired",
"=p~" => "drooling",
"$)" => "money",
":whistle:" => "whistling",
"#o" => "doh",
":alien:" => "alien2",
":S" => "scared"
  );

return $smilesfrom;
}
function get_smiles_text() {
  $smilesfrom = get_smiles();
  $val_old = "";
  $i = 0;
  $val_old = array();
  foreach ($smilesfrom as $key => $val) {
  if (!in_array($val, $val_old)) {
  $smiles_text .= "<a href=\"javascript:emoticon('$key')\"><img src=\"".TEMPLATE_PATH."/smiles/$val.gif\" alt=\"$key\" border=\"0\"></a> ";
}
$val_old[] = $val;
$i++;
if ($i > 18) {
$smiles_text .= "<a href=\"smiles.php\" onclick=\"window.open('smiles.php', '_4imagessmilies', 'HEIGHT=310,resizable=yes,scrollbars=yes,WIDTH=225');return false;\" target=\"_4imagessmilies\">&nbsp;&nbsp;&nbsp;All Emoticons</a>";
return $smiles_text;
}
}
return $smiles_text;
}
//------End Smiles-------
Title: Emoticons and Reply in Comments!
Post by: itme on May 02, 2003, 12:50:44 PM
thank's u give me the code but i can't text if use smile i don't know why , and i want code aim in comment and online offline too can u help me  ???? http://www.vietbolsa.com/Gallery/details.php?image_id=59
Title: Emoticons and Reply in Comments!
Post by: V@no on May 02, 2003, 12:54:30 PM
Quote from: itme
thank's u give me the code but i can't text if use smile i don't know why , and i want code aim in comment and online offline too can u help me  ????
sorry, I dont understand...code for what?
Title: ... and in description?
Post by: Sheep707 on May 07, 2003, 01:44:27 PM
@Vano:
thank's for this code!!!
Is it possible to enable emoticons in image description?
Title: Re: ... and in description?
Post by: V@no on May 07, 2003, 01:47:30 PM
Quote from: Sheep707
Is it possible to enable emoticons in image description?

sure, open /includes/functions.php
find:
Code: [Select]
 $description = (!empty($image_row['image_description'])) ? $image_row['image_description'] : REPLACE_EMPTY;
replace with:
Code: [Select]
 $description = (!empty($image_row['image_description'])) ? format_text($image_row['image_description'], 1) : REPLACE_EMPTY;
this will also add ability use BBCode in the description.
Title: Emoticons and Reply in Comments!
Post by: HelpMeNow on May 07, 2003, 08:27:47 PM
V@no,
is the WYSIWYG you have in your own site (Under the emotions icons) for the comments area, a hack from here? I tried to search for it but didn't find it. It's just so cool.

p.s. if this doesn't fit here, plz forgive me.
Title: Emoticons and Reply in Comments!
Post by: PuCK on May 08, 2003, 12:48:45 AM
Quote from: HelpMeNow
V@no,
is the WYSIWYG you have in your own site (Under the emotions icons) for the comments area, a hack from here? I tried to search for it but didn't find it. It's just so cool.

p.s. if this doesn't fit here, plz forgive me.


Just below this topic :P

http://www.4homepages.de/forum/viewtopic.php?t=4745
Title: That looks really good
Post by: wolfgang2025 on May 15, 2003, 02:32:47 AM
Looks great but is there a complete package with all the modified files that are needed to make it work  :?:
Title: Emoticons and Reply in Comments!
Post by: Xwoman on June 10, 2003, 03:56:59 PM
hi! how can i use this in comment_form.html :

Quote
<!-- BEGIN SMILIES -->
<br>
<script language="JavaScript">
function PopUp(aaa,zz,xx,scrb){

var wsss = eval (screen.width/2 - zz/2);
var hsss = eval(screen.height/2 - xx/2);

helpWin = window.open(aaa,"imageWin","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars="+scrb+",resizable=0,width="+ zz +",height="+ xx +",left="+ wsss +",top="+ hsss +"");

}
</script>
<a href="JavaScript:paste_strinL(':)',0)"><img src="./img/smilies/grin.gif" border=0></a>
<a href="JavaScript:paste_strinL(';)',0)"><img src="./img/smilies/wink.gif" border=0></a>
<a href="JavaScript:paste_strinL(':up:',0)"><img src="./img/smilies/up.gif" border=0></a>
<a href="JavaScript:paste_strinL(':down:',0)"><img src="./img/smilies/down.gif" border=0></a>
<a href="JavaScript:paste_strinL(':biglol:',0)"><img src="./img/smilies/biglol.gif" border=0></a>
<a href="JavaScript:paste_strinL(':confused:',0)"><img src="./img/smilies/confused.gif" border=0></a>
<a href="JavaScript:paste_strinL(':cool:',0)"><img src="./img/smilies/cool.gif" border=0></a>
<a href="JavaScript:paste_strinL(':mad:',0)"><img src="./img/smilies/mad.gif" border=0></a>
<a href="JavaScript:paste_strinL(':sad:',0)"><img src="./img/smilies/sad.gif" border=0></a>
<a href="JavaScript:paste_strinL(':shame:',0)"><img src="./img/smilies/shame.gif" border=0></a>
<a href="JavaScript:paste_strinL(':smirk:',0)"><img src="./img/smilies/smirk.gif" border=0></a>
<a href="JavaScript:paste_strinL(':tongue:',0)"><img src="./img/smilies/tongue.gif" border=0></a>
<small><a href="javascript:PopUp('hack_smilies.php?p=display',150,400,1)">...</a></small>

<!-- END SMILIES -->
Title: Emoticons and Reply in Comments!
Post by: V@no on June 10, 2003, 04:13:09 PM
try this:
http://4homepages.de/forum/viewtopic.php?t=4745

P.S. u might need read through all replys to get the compleat "package"
Title: Emoticons and Reply in Comments!
Post by: Xwoman on June 10, 2003, 06:13:01 PM
oki :-) thx  i have  change the


 //--------------------------
//--------Smiles------------
//--------------------------
function smilies($text,$enablesmilies = 1) ..........

Now i can click my smileys .  i missing only 1 thing .....  i can´t see the  ALL smiles button ....  :oops:
Title: Emoticons and Reply in Comments!
Post by: brandkanne on June 15, 2003, 08:47:13 PM
need smilies?

go here:
http://home.t-online.de/home/herr.kaleu/Smileys/smileys.htm
Title: Re: Emoticons and Reply in Comments!
Post by: HaKkE on June 16, 2005, 07:00:39 PM
Sorry aber so richtig bekomme ich es immer noch nicht mit den Smilies hin. Habe alles so gemacht wie es V@no beschrieben hat. Habe z.B. ein smilie das heißt arrow. Habe in den arry also geschrieben: "arrow" => "arrow". Damit müßte er doch dann das arrow.gif smilie einfügen. Er zeigt es zwar an, aber wenn ich drauf klicke, dann passiert nichts. Der jeweilige Code dafür sieht so aus:

<a href="javascript:setsmile('arrow')"><img border="0" src="{template_url}/smilies/arrow.gif" width="15" height="15"></a>

Was ist daran falsch?

thx
HaKkE
Title: Re: Emoticons and Reply in Comments!
Post by: shilor on January 31, 2009, 11:43:11 PM
Great job! Thanks a lot.
I wish it would be a list of smileys next to the comment box and the users would easily choose a smiley from the list instead of writing the codes.
Isn't it possible?
Title: Re: Emoticons and Reply in Comments!
Post by: diehard on February 24, 2010, 01:12:31 PM
Here is my Skype emoticons  :wink:

Code: [Select]
//--------------------------
//--------Smiles------------
//--------------------------
function smilies($text,$enablesmilies = 1) {
  global $smileyfromcache, $smileytocache;
  $imagesdir = TEMPLATE_PATH."/smiles";
  if(gettype($smileyfromcache) != "array") {
$smilesfrom = array(
      ":)" => "smile",
";)" => "wink",
":(" => "sad",
":D" => "laugh",
"8-)" => "calm",
":o" => "surprised",
                                   ";(" => "sob",
"(sweat)" => "sweat",
":|" => "silence",
":*" => "kiss",
":P" => "tonque",
":$" => "blush",
"(blush)" => "blush",
":^)" => "wondering",
"|-)" => "sleepy",
"|-(" => "dull",
"|(" => "dull",
"(inlove)" => "inlove",
"]:)" => "evil-grin",
"(talk)" => "talking",
"(yawn)" => "yawn",
"(puke)" => "puke",
"(doh)" => "doh",
":@" => "angry",
"(wasntme)" => "wasntme",
"(party)" => "party",
":S" => "worried",
"(mm)" => "mm",
"8-|" => "nerdy",
":x" => "lips",
":X" => "lips",
"(wave)" => "hi",
"(devil)" => "devil",
"(angel)" => "angel",
"(makeup)" => "makeup",
"(chuckle)" => "chuckle",
"(rofl)" => "rofl",
"(whew)" => "whew",
"(happy)" => "happy",
"(smirk)" => "smirk",
"(nod)" => "nod",
"(shake)" => "shake",
"(punch)" => "punch",
"(emo)" => "emo",
"(y)" => "y",
"(n)" => "n",
"(handshake)" => "handshake",
"(h)" => "heart",
"(u)" => "brocken",
"(e)" => "mail",
"(F)" => "flower",
"(rain)" => "rain",
"(sun)" => "sun",
"(o)" => "time",
"(music)" => "music",
"(~)" => "movie",
"(mp)" => "phone",
"(coffee)" => "coffee",
"(pi)" => "pizza",
                                   "(pizza)" => "pizza",
"(l)" => "heart",
"(L)" => "heart",
"(muscle)" => "muscle",
"(flex)" => "muscle",
"(cash)" => "cash",
"(^)" => "cake",
"(beer)" => "beer",
"(d)" => "drink",
"(dance)" => "dance",
"(ninja)" => "ninja",
"(*)" => "star",
"(bandit)" => "bandit",
"(bug)" => "bug",
"(drunk)" => "drunk",
"(evilgrin)" => "evilgrin",
"(finger)" => "finger",
"(flagbg)" => "flagbg",
"(fubar)" => "fubar",
"(hi)" => "hi",
"(call)" => "call",
"(envy)" => "envy",
"(wait)" => "wait",
"(clap)" => "clap",
"(think)" => "think",
"(hug)" => "bear",
"(skype)" => "skype",
"(ss)" => "skype",
"(bow)" => "bow",
"(headbang)" => "headbang",
"(mooning)" => "mooning",
"(poolparty)" => "poolparty",
"(rock)" => "rock",
"(smoke)" => "smoke",
"(tmi)" => "tmi",
"(toivo)" => "toivo",
"(yawn1)" => "yawn1",
"(swear)" => "swear"
     );
foreach ($smilesfrom as $key => $val) {
  $smileyfromcache[] ='/(((>[^<]*)|(^[^<]*))([\s\n\r]|^|<br( \/)?[>]))('.str_replace('|','\|', quotemeta(str_replace("<", "&lt;", str_replace(">", "&gt;", str_replace("\/", "\\\/", $key))))).')/s';
  $smileytocache[] = "\\1<img src=\"$imagesdir/$val.gif\" alt=\"\" border=\"0\">";
}
  }
  if ($enablesmilies) {
$text = parsesmilies($text);
  }
  return $text;
}
function parsesmilies($text) {
  global $smileyfromcache, $smileytocache;
  $oldtext = "";
  while($oldtext != $text) {
$oldtext = $text;
$text = preg_replace($smileyfromcache, $smileytocache, $text);
  }
  return $text;
}
//------End Smiles-------


 and emoticons archive ....
Title: Re: Emoticons and Reply in Comments!
Post by: azndeb888 on February 26, 2010, 07:30:33 AM
that's an impressive list of emoticons!  need to find one with $$ eyes...haha