Zum Inhalt springen

CHC Forum: Emoticons

Erstellt am 25. Mai 2005 · 2 Antworten · letzte Antwort am 6. Juni 2005

Tags: Frage

blue_wok ·

In den Plugin-Optionen zum CHC-Forum gibt es Eingabefelder für eigene Emoticons, und zwar eine Pfadangabe und ein großes Eingabefeld "eigene Emoticons". Leider erschließt sich mir die Funktionsweise nicht und ich konnte auch im Forum/Anleitung nichts dazu finden. Ich habe einige eigene Emoticons in einem Verzeichnis abgelegt, das ich im Pfad benenne. Es passiert aber nichts. In das Eingabefeld lässt sich zwar Klartext schreiben, aber was hat das mit Emoticons zu tun? Irgendwie scheine ich auf dem falschen Dampfer zu sein. Eine Idee?

thanny ·

Das hab ich bisher auch noch nicht gecheckt...

Hab deshalb "per Hand" die Emoticons in den Code geschrieben in der pi1/class.tx_chcforum_form.php :

// Set up the emoticons
 			// Check if emoticons are disabled
 			if ($this->fconf['emoticons_disable'] == false) {
 				$emoticons = array();
 				// Load default emoticons if individual icons are empty or should be added to default icons
 				if (empty($this->fconf['emoticons_type']) || $this->fconf['emoticons_add']) {
 					// Define images and search codes
 					$emoticons = array(':arrow:' => 'arrow.gif',
  								     ':badgrin:' => 'badgrin.gif',
 										 	 ':D' => 'biggrin.gif',
 											 ':?' => 'confused.gif',
 											 '8-)' => 'cool.gif',
 											 ':(' => 'cry.gif',
 											 ':doubt:' => 'doubt.gif',
 											 '#evil#' => 'evil.gif',
 											 ':!:' => 'exclaim.gif',
 											 ':idea:' => 'idea.gif',
 											 '#giggle#' => 'lol.gif',
 											 ':mad:' => 'mad.gif',
 											 ':neutral:' => 'neutral.gif',
 											 ':question:' => 'question.gif',
 											 ':razz:' => 'razz.gif',
 											 ':o' => 'redface.gif',
 											 '#paralyzed#' => 'rolleyes.gif',
 											 ':(' => 'sad.gif',
 											 ':shock:' => 'shock.gif',
 											 ':)' => 'smile.gif',
 											 ':o' => 'surprised.gif',
 											 ';)' => 'wink.gif',
											 ':carrot:' => 'carrot.gif',
											 ':banana:' => 'banana.gif');
 				}

Die letzten beiden "carrot" und "banana" sind dazu gekommen. Die Grafiken müssen dann im /pi1/templates/img/emoticons vorhanden sein.

Interessant ist der folgende PHP Abschnitt:

	// Parse individual emoticons
 				if (!empty($this->fconf['emoticons_type'])) {
 					// Split fconf value in lines
 					$emicoValues = explode("\n", $this->fconf['emoticons_type']);
 					// Split lines in emoticon code and image name
 					reset($emicoValues);
 					while (list(, $emicoLine) = each($emicoValues)) {
 						$emicoTemp = explode(',', $emicoLine);
 						$emoticons[trim($emicoTemp[0])] = trim($emicoTemp[1]);
 					}

Kann das ein erfahrener PHP User richtig interpretieren?

thanny ·

Ach da hab ich jetzt doch glatt noch eine bessere Methode gefunden:

1. eigene Emoticons in den Ordner pi1/templates/img/emoticons/ der Extension legen
2. Bei den Plugin Options den Emoticons path leer lassen (!) und bei Custom emoticons für jedes neue Emoticon folgende Syntax verwenden:
:frown:,frown.gif
3. Merge default and custom emoticons Häckchen setzen, damit die normalen Emoticons auch angezeigt werden

Denke das ist deutlich komfortabler als im php Code rumzuschreiben! 😃