Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> emotiony w księdze gości
noid
post
Post #1





Grupa: Zarejestrowani
Postów: 27
Pomógł: 0
Dołączył: 8.11.2003

Ostrzeżenie: (0%)
-----


elo!! robię księgę gości i chcę zeby przy dodawaniu wpisu mozna było kliknąć na n emotionkę i do pola wpisu doda sie znak adekwatny do danej ikonki, wiem ze jest to kod w javie ale ja wogole nie znam javy i czy kto mogl by mi w tym pomoc?? (IMG:http://forum.php.pl/style_emoticons/default/biggrin.gif)


p.sp chodzi mi dokladnie o cos takiego jak na tym forum przy dodawaniu wpisu
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
.dragonfly
post
Post #2





Grupa: Zarejestrowani
Postów: 217
Pomógł: 0
Dołączył: 5.10.2003
Skąd: Londyn / UK

Ostrzeżenie: (0%)
-----


Cytat
__________________________________________
http://webpomocnik.net/index.php?id=101&ktory_art=154
a co do wstawienia to java script ale tego niewiem :D


Jesli nie wiesz to po co piszesz ?

Kod
<script language="JavaScript" type="text/javascript">

function emoticon(text) {

    var txtarea = document.post.message;

    text = ' ' + text + ' ';

    if (txtarea.createTextRange && txtarea.caretPos) {

  var caretPos = txtarea.caretPos;

  caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? caretPos.text + text + ' ' : caretPos.text + text;

  txtarea.focus();

    } else {

  txtarea.value  += text;

  txtarea.focus();

    }

}



</script>


[xml:1:cb088e88bd] <table width="100" border="0" cellspacing="0" cellpadding="5">
<tr align="center">
<td colspan="4" class="gensmall"><b>Ikony Emocji</b></td>
</tr>
<tr align="center" valign="middle">
<td><a href="java script:emoticon(':D')"><img src="images/smiles/icon_biggrin.gif" border="0" alt="Very Happy" title="Very Happy" /></a></td>
<td><a href="java script:emoticon(':)')"><img src="images/smiles/icon_smile.gif" border="0" alt="Smile" title="Smile" /></a></td>
<td><a href="java script:emoticon(':(')"><img src="images/smiles/icon_sad.gif" border="0" alt="Sad" title="Sad" /></a></td>
<td><a href="java script:emoticon(':o')"><img src="images/smiles/icon_surprised.gif" border="0" alt="Surprised" title="Surprised" /></a></td>
</tr>
<tr align="center" valign="middle">
<td><a href="java script:emoticon('8O')"><img src="images/smiles/icon_eek.gif" border="0" alt="Shocked" title="Shocked" /></a></td>
<td><a href="java script:emoticon(':?')"><img src="images/smiles/icon_confused.gif" border="0" alt="Confused" title="Confused" /></a></td>
<td><a href="java script:emoticon('8)')"><img src="images/smiles/icon_cool.gif" border="0" alt="Cool" title="Cool" /></a></td>
<td><a href="java script:emoticon(':lol:')"><img src="images/smiles/icon_lol.gif" border="0" alt="Laughing" title="Laughing" /></a></td>
</tr>
<tr align="center" valign="middle">
<td><a href="java script:emoticon(':x')"><img src="images/smiles/icon_mad.gif" border="0" alt="Mad" title="Mad" /></a></td>
<td><a href="java script:emoticon(':P')"><img src="images/smiles/icon_razz.gif" border="0" alt="Razz" title="Razz" /></a></td>
<td><a href="java script:emoticon(':oops:')"><img src="images/smiles/icon_redface.gif" border="0" alt="Embarassed" title="Embarassed" /></a></td>
<td><a href="java script:emoticon(':cry:')"><img src="images/smiles/icon_cry.gif" border="0" alt="Crying or Very sad" title="Crying or Very sad" /></a></td>
</tr>
<tr align="center" valign="middle">
<td><a href="java script:emoticon(':evil:')"><img src="images/smiles/icon_evil.gif" border="0" alt="Evil or Very Mad" title="Evil or Very Mad" /></a></td>
<td><a href="java script:emoticon(':twisted:')"><img src="images/smiles/icon_twisted.gif" border="0" alt="Twisted Evil" title="Twisted Evil" /></a></td>
<td><a href="java script:emoticon(':roll:')"><img src="images/smiles/icon_rolleyes.gif" border="0" alt="Rolling Eyes" title="Rolling Eyes" /></a></td>
<td><a href="java script:emoticon(':wink:')"><img src="images/smiles/icon_wink.gif" border="0" alt="Wink" title="Wink" /></a></td>
</tr>
<tr align="center" valign="middle">
<td><a href="java script:emoticon(':!:')"><img src="images/smiles/icon_exclaim.gif" border="0" alt="Exclamation" title="Exclamation" /></a></td>
<td><a href="java script:emoticon(':?:')"><img src="images/smiles/icon_question.gif" border="0" alt="Question" title="Question" /></a></td>
<td><a href="java script:emoticon(':idea:')"><img src="images/smiles/icon_idea.gif" border="0" alt="Idea" title="Idea" /></a></td>
<td><a href="java script:emoticon(':arrow:')"><img src="images/smiles/icon_arrow.gif" border="0" alt="Arrow" title="Arrow" /></a></td>[/xml:1:cb088e88bd]

Tworzysz katalog images, a w nim smiles i tam wrzucasz odpowiednio ponazywane obrazki. Jesli nie chcesz klikac na obrazki utworz sobie z nich zwykly text co bedzie dziecinnie proste.

Dodatkowo jesli chcesz aby we wpisach zamiast znakow np. :) pojawialy sie ikonki przyda ci sie ten kod:

[php:1:cb088e88bd]<?php

$plik = fopen ("plik.txt", "r");
$wiersz = fgets ($plik, 240);
$wiersz = str_replace (":)", "<img src='smile.gif' border='0'>", $wiersz);
print "$wiersz";
fclose ($plik);

?>[/php:1:cb088e88bd]

Rozwiazanie na podstawie phpBB
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 6.10.2025 - 02:59