Armenian Knowledge Base  

Go Back   Armenian Knowledge Base > Technical sections > Webmaster Zone > Web Development
Register

Reply
 
LinkBack Thread Tools
Old 31.07.2007, 02:17   #1
Младенец
 
Join Date: 07 2007
Location: Yerevan
Posts: 8
Downloads: 0
Uploads: 0
Reputation: 0 | 0
Default Smaileri anbavararutyun)

Pivet vsem, senc problem ka, petqa vor kataryal dzevov lucvi, mi qani exanak ka, bayc edqan el chi harmarvum gorcis. " :=): :lb: :gd: " ev ayln, sovorakan dzevov preobrazavat en linum grafika (or. <img src="e4.gif">) petqa vor @ndamen@ 1 hat smail preobrazavat @lni, or. ete ":=): :lg: kam :lb: :gd:" senc toxer grelu depqum menak arachin@ pr. lini isk mnacac@ sovorakan texti nman mna.
Reply With Quote
Old 31.07.2007, 05:43   #2
Untouchable misanthrope
 
AvDav's Avatar
 
Join Date: 07 2004
Location: Pure thoughts
Age: 36
Posts: 3,408
Downloads: 22
Uploads: 0
Reputation: 222 | 3
Default

de parsery nenc pti gres vor menak 1 smile convert ani image-i, pseudo-code:

Code:
function put_smile(s) {
 bool is_smile = false;
 switch(s) {
  case "=)": echo "<img src="e1.gif">"; is_smile = true; break;
  case "lg": echo "<img src="e2.gif">"; is_smile = true; break;
  case "kam": echo "<img src="e3.gif">"; is_smile = true; break;
  case "lb": echo "<img src="e4.gif">"; is_smile = true; break;
  case "gd": echo "<img src="e5.gif">"; is_smile = true; break;
 }
 return is_smile;
}

function parse(txt) {
 string s;
 bool got = false;
 for(i = 0; i < size(txt); ++i) {
  if(!got && txt[i] == ':') {
    while(i < size(txt) && txt[i] != ':') s.append(txt[i++]);
    if(put_smile(s)) {got = true; continue;}
  }
  echo txt[i];
 }
}
Reply With Quote
Old 08.08.2007, 04:24   #3
Младенец
 
Join Date: 07 2007
Location: Yerevan
Posts: 8
Downloads: 0
Uploads: 0
Reputation: 0 | 0
Default

Mersi, bajc chi hamapatasxanum, ed chei uzum, ed mas@ "preg_replace - int $limit"-ov em arel bajc eli poxelu em, indz verchnakan masna petq.
Reply With Quote
Sponsored Links
Reply

Thread Tools


На правах рекламы:
реклама

All times are GMT. The time now is 15:46.


Powered by vBulletin® Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.