Bywalec
Postów: 888 Pomógł: 66
Data rejestracji: 19.08.2007 19:49
|
Witam, mam problem z dodaniem nowej emotikony. Zrobiłem tak:
1. Wgrałem emotke o nazwie radocha.gif do folderu images/smiley
2. W pliku maincore.php edytowałem w dwóch miejscach:
// Parse smiley bbcode into HTML images
function parsesmileys($message) {
$smiley = array(
"/\:\)/si" => "<img src='".IMAGES."smiley/smile.gif' alt='smiley'>",
"/\;\)/si" => "<img src='".IMAGES."smiley/wink.gif' alt='smiley'>",
"/\:\(/si" => "<img src='".IMAGES."smiley/sad.gif' alt='smiley'>",
"/\:\|/si" => "<img src='".IMAGES."smiley/frown.gif' alt='smiley'>",
"/\:o/si" => "<img src='".IMAGES."smiley/shock.gif' alt='smiley'>",
"/\:p/si" => "<img src='".IMAGES."smiley/pfft.gif' alt='smiley'>",
"/b\)/si" => "<img src='".IMAGES."smiley/cool.gif' alt='smiley'>",
"/\:d/si" => "<img src='".IMAGES."smiley/grin.gif' alt='smiley'>",
"/\:@/si" => "<img src='".IMAGES."smiley/angry.gif' alt='smiley'>",
"/\:rol:/si" => "<img title='Roll' src='".IMAGES."smiley/roll.gif'>",
"/\:uhoh:/si" => "<img title='Uh-Oh!' src='".IMAGES."smiley/uhoh.gif'>",
"/\:no:/si" => "<img title='No' src='".IMAGES."smiley/no.gif'>",
"/\:shy:/si" => "<img title='Shy' src='".IMAGES."smiley/shy.gif'>",
"/\:lol:/si" => "<img title='Laugh' src='".IMAGES."smiley/laugh.gif'>",
"/\:rip:/si" => "<img title='Dead' src='".IMAGES."smiley/dead.gif'>",
"/\:yes:/si" => "<img title='Yes' src='".IMAGES."smiley/yes.gif'>",
"/\:mad:/si" => "<img title='Mad' src='".IMAGES."smiley/mad.gif'>",
"/\:bigeek:/si" => "<img title='Big Eek' src='".IMAGES."smiley/bigeek.gif'>",
"/\:bigrazz:/si" => "<img title='Big Razz' src='".IMAGES."smiley/bigrazz.gif'>",
"/\:smilewinkgrin:/si" => "<img title='Smile-Wink-Grin' src='".IMAGES."smiley/smilewinkgrin.gif'>",
"/\:sourgrapes:/si" => "<img title='Sour Grapes' src='".IMAGES."smiley/sourgrapes.gif'>",
"/\:confused:/si" => "<img title='Confused' src='".IMAGES."smiley/confused.gif'>",
"/\:upset:/si" => "<img title='Upset' src='".IMAGES."smiley/upset.gif'>",
"/\:sleep:/si" => "<img title='Sleep' src='".IMAGES."smiley/sleep.gif'>",
"/\:jupi:/si" => "<img title='Sleep' src='".IMAGES."smiley/jupi.gif'>"[b][size=20],
"/\:radocha:/si" => "<img title='Radocha' src='".IMAGES."smiley/radocha.gif'>"[/size] [/b]);
foreach($smiley as $key=>$smiley_img) $message = preg_replace($key, $smiley_img, $message);
return $message;
}
// Show smiley icons in comments, forum and other post pages
function displaysmileys($textarea, $shout=0) {
$smiles = "";
$smileys = array (
":)" => "smile.gif",
";)" => "wink.gif",
":|" => "frown.gif",
":(" => "sad.gif",
":o" => "shock.gif",
":p" => "pfft.gif",
"B)" => "cool.gif",
":D" => "grin.gif",
":@" => "angry.gif",
":rol:" => "roll.gif",
":uhoh:" => "uhoh.gif",
":no:" => "no.gif",
":shy:" => "shy.gif",
":lol:" => "laugh.gif",
":rip:" => "dead.gif",
":yes:" => "yes.gif",
":mad:" => "mad.gif",
":bigeek:" => "bigeek.gif",
":bigrazz:" => "bigrazz.gif",
":smilewinkgrin:" => "smilewinkgrin.gif",
":sourgrapes:" => "sourgrapes.gif",
":confused:" => "confused.gif",
":upset:" => "upset.gif",
":shy:" => "shy.gif",
":sleep:" => "sleep.gif"
[b] [size=20] "<radocha>" => "radocha.gif"[/size][/b]
);
if (!$shout) foreach($smileys as $key=>$smiley) $smiles .= "<img src='".IMAGES."smiley/$smiley' alt='' onClick=\"insertText('$textarea', '$key');\">\n";
else foreach($smileys as $key=>$smiley) $smiles .= "<img src='".IMAGES."smiley/$smiley' alt='' onClick=\"insertTextSB('$textarea', '$key');\">\n";
return $smiles;
}
Powiekszyłem w kodzie to co dodałem.
Co zrobiłem źle, bo jak zapisałem ten kod na ftp, to wyskoczyłe mi jak właczyłem żeby napisać temat, że mam w pliku maicore.php bląd w linni 372 ()ale nie pamiętam dokładnie która to była linnia)
PW od moderatora:
- Przeniesienie tematu - bartek124 26.02 - 17:59
|
Weteran
Postów: 3264 Pomógł: 236
v7.02.06 Data rejestracji: 26.05.2007 12:25
|
// Parse smiley bbcode into HTML images
function parsesmileys($message) {
$smiley = array(
"/\:\)/si" => "<img src='".IMAGES."smiley/smile.gif' alt='smiley'>",
"/\;\)/si" => "<img src='".IMAGES."smiley/wink.gif' alt='smiley'>",
"/\:\(/si" => "<img src='".IMAGES."smiley/sad.gif' alt='smiley'>",
"/\:\|/si" => "<img src='".IMAGES."smiley/frown.gif' alt='smiley'>",
"/\:o/si" => "<img src='".IMAGES."smiley/shock.gif' alt='smiley'>",
"/\:p/si" => "<img src='".IMAGES."smiley/pfft.gif' alt='smiley'>",
"/b\)/si" => "<img src='".IMAGES."smiley/cool.gif' alt='smiley'>",
"/\:d/si" => "<img src='".IMAGES."smiley/grin.gif' alt='smiley'>",
"/\:@/si" => "<img src='".IMAGES."smiley/angry.gif' alt='smiley'>",
"/\:rol:/si" => "<img title='Roll' src='".IMAGES."smiley/roll.gif'>",
"/\:uhoh:/si" => "<img title='Uh-Oh!' src='".IMAGES."smiley/uhoh.gif'>",
"/\:no:/si" => "<img title='No' src='".IMAGES."smiley/no.gif'>",
"/\:shy:/si" => "<img title='Shy' src='".IMAGES."smiley/shy.gif'>",
"/\:lol:/si" => "<img title='Laugh' src='".IMAGES."smiley/laugh.gif'>",
"/\:rip:/si" => "<img title='Dead' src='".IMAGES."smiley/dead.gif'>",
"/\:yes:/si" => "<img title='Yes' src='".IMAGES."smiley/yes.gif'>",
"/\:mad:/si" => "<img title='Mad' src='".IMAGES."smiley/mad.gif'>",
"/\:bigeek:/si" => "<img title='Big Eek' src='".IMAGES."smiley/bigeek.gif'>",
"/\:bigrazz:/si" => "<img title='Big Razz' src='".IMAGES."smiley/bigrazz.gif'>",
"/\:smilewinkgrin:/si" => "<img title='Smile-Wink-Grin' src='".IMAGES."smiley/smilewinkgrin.gif'>",
"/\:sourgrapes:/si" => "<img title='Sour Grapes' src='".IMAGES."smiley/sourgrapes.gif'>",
"/\:confused:/si" => "<img title='Confused' src='".IMAGES."smiley/confused.gif'>",
"/\:upset:/si" => "<img title='Upset' src='".IMAGES."smiley/upset.gif'>",
"/\:sleep:/si" => "<img title='Sleep' src='".IMAGES."smiley/sleep.gif'>",
"/\:jupi:/si" => "<img title='Sleep' src='".IMAGES."smiley/jupi.gif'>",
"/\:radocha:/si" => "<img title='Radocha' src='".IMAGES."smiley/radocha.gif'>" );
foreach($smiley as $key=>$smiley_img) $message = preg_replace($key, $smiley_img, $message);
return $message;
}
// Show smiley icons in comments, forum and other post pages
function displaysmileys($textarea, $shout=0) {
$smiles = "";
$smileys = array (
":)" => "smile.gif",
";)" => "wink.gif",
":|" => "frown.gif",
":(" => "sad.gif",
":o" => "shock.gif",
":p" => "pfft.gif",
"b)" => "cool.gif",
":d" => "grin.gif",
":@" => "angry.gif",
":rol:" => "roll.gif",
":uhoh:" => "uhoh.gif",
":no:" => "no.gif",
":shy:" => "shy.gif",
":lol:" => "laugh.gif",
":rip:" => "dead.gif",
":yes:" => "yes.gif",
":mad:" => "mad.gif",
":bigeek:" => "bigeek.gif",
":bigrazz:" => "bigrazz.gif",
":smilewinkgrin:" => "smilewinkgrin.gif",
":sourgrapes:" => "sourgrapes.gif",
":confused:" => "confused.gif",
":upset:" => "upset.gif",
":shy:" => "shy.gif",
[b]":sleep:" => "sleep.gif"[color=red][size=20],[/size][/b][/color]
"<radocha>" => "radocha.gif"
);
if (!$shout) foreach($smileys as $key=>$smiley) $smiles .= "<img src='".IMAGES."smiley/$smiley' alt='' onClick=\"insertText('$textarea', '$key');\">\n";
else foreach($smileys as $key=>$smiley) $smiles .= "<img src='".IMAGES."smiley/$smiley' alt='' onClick=\"insertTextSB('$textarea', '$key');\">\n";
return $smiles;
}
Taki.
Edytowane przez bartek124 dnia 26.02.2008 17:57:44
Nie pomagam na komunikatorach oraz PW!
|