Author Topic: Emoticons and Reply in Comments!  (Read 57160 times)

0 Members and 1 Guest are viewing this topic.

drhtm

  • Guest
Emoticons and Reply in Comments!
« 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!

Offline SLL

  • Hero Member
  • *****
  • Posts: 585
    • View Profile
Emoticons and Reply in Comments!
« Reply #1 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

drhtm

  • Guest
Emoticons and Reply in Comments!
« Reply #2 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 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:

drhtm

  • Guest
Emoticons and Reply in Comments!
« Reply #3 on: February 14, 2003, 10:17:28 AM »
Oh and its very funny how your site's design 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:

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Emoticons and Reply in Comments!
« Reply #4 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


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.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

drhtm

  • Guest
Emoticons and Reply in Comments!
« Reply #5 on: February 15, 2003, 06:06:30 AM »
That's great!

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

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Emoticons and Reply in Comments!
« Reply #6 on: February 15, 2003, 06:12:43 AM »
what do u mean 'reply'?
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

drhtm

  • Guest
Emoticons and Reply in Comments!
« Reply #7 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:

drhtm

  • Guest
Emoticons and Reply in Comments!
« Reply #8 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?

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Emoticons and Reply in Comments!
« Reply #9 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:
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

drhtm

  • Guest
Emoticons and Reply in Comments!
« Reply #10 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:

Offline Biggi

  • Jr. Member
  • **
  • Posts: 74
    • View Profile
    • http://www.bibodia.de/
Emoticons and Reply in Comments!
« Reply #11 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!

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Emoticons and Reply in Comments!
« Reply #12 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.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Biggi

  • Jr. Member
  • **
  • Posts: 74
    • View Profile
    • http://www.bibodia.de/
Emoticons and Reply in Comments!
« Reply #13 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!

Offline Biggi

  • Jr. Member
  • **
  • Posts: 74
    • View Profile
    • http://www.bibodia.de/
Emoticons and Reply in Comments!
« Reply #14 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