Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - Sunny C.

Pages: 1 ... 11 12 13 14 [15] 16 17 18 19
211
Chit Chat / Script Probleme
« on: September 21, 2008, 06:13:45 PM »
Hallo zusammen,

ich habe eine Script, welches im root liegt!
Ich rufe es in der home.html so auf:
Code: [Select]
<?php include "umfrage.php";?>
Nun gibt er mir aber folgendes aus:
Code: [Select]
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\xampp\htdocs\2\umfrage.php on line 12
Die Zeile 12 wäre diese:
Code: [Select]
         $data = mysql_fetch_array($sql, MYSQL_ASSOC);
In der Datei sieht es so aus:
Code: [Select]
<?php
require "admin/plugins/umfrage/configs.php";

function 
ip_exists($table,$id) {
         include 
"admin/plugins/umfrage/configs.php";
         
$sql_conf mysql_query("SELECT * from $configs LIMIT 1");
         
$sql_conf mysql_fetch_array($sql_confMYSQL_ASSOC);
         
$einheit $sql_conf['sperreinheit'];
         
$sperrzeit $sql_conf['sperrdauer'];
         
$sekundenanzahl $sperrzeit*$zeiteinheit[$einheit];
         
$sql mysql_query("SELECT * from $table WHERE id = '$id' LIMIT 1");
         
$data mysql_fetch_array($sqlMYSQL_ASSOC);
         if(
ereg($_SERVER['REMOTE_ADDR'], $data['ip']) > 0) {
                  
$doit explode("#"$data['ip']);
                  for(
$x=0;$x<count($doit);$x++) {
                       
$findit explode("%"$doit[$x]);
                       if(
$findit[0]==$_SERVER['REMOTE_ADDR']) {
                          
$zeitabstand time()-$findit[1];
                          if(
$zeitabstand $sekundenanzahl) { return false; break; }
                          else { return 
true; break; }

                       }
                  }

         }
         else {
            return 
false;
            }
}
$ant $_POST['ant'];

if(isset(
$_POST['vote']) && isset($ant) && !ip_exists($umfragen,$_POST['id'])) {
   
$id $_POST['id'];
   
$sql mysql_query("SELECT * from $umfragen WHERE id = '$id' LIMIT 1");
   
$data mysql_fetch_array($sqlMYSQL_ASSOC);
   
$votes explode(","$data['votes']);
   
$votes[$ant]++;
   
$votes implode(","$votes);
   if(!empty(
$data['ip'])) {
      
$ip explode("#"$data['ip']);
      if(
ereg($_SERVER['REMOTE_ADDR'], $data['ip']) > 0) {
         for(
$x=0;$x<count($ip);$x++) {
              
$sameip explode("%"$ip[$x]);
              if(
$sameip[0]==$_SERVER['REMOTE_ADDR']) {
                  
$sameip[1]=time();
                  
$ip[$x]=implode("%"$sameip);
                  break;
              }
         }
         
$ip implode("#"$ip);
      }
      else {
         
$result array_push($ip$_SERVER['REMOTE_ADDR']."%".time());
         
$ip implode("#"$ip);
      }
   }
   else {
         
$ip $_SERVER['REMOTE_ADDR']."%".time();
   }
   
$sql mysql_query("UPDATE $umfragen SET votes = '$votes', ip = '$ip' WHERE id = '$id' LIMIT 1");

   
/* LOGS ANFERTIGEN START */

   
$vote $_POST['ant'];
   
$timestamp time();
   
$date date("d.m.Y, H:i:s",$timestamp);
   
$ip $_SERVER['REMOTE_ADDR'];
   
$dns $_SERVER['REMOTE_HOST'];
   
$uri $_SERVER['REQUEST_URI'];
   
$referrer $_SERVER['HTTP_REFERER'];
   
$agent $_SERVER['HTTP_USER_AGENT'];


   
/* LOGS ANFERTIGEN END */

   
if(!sql) {
      echo 
"Fehler beim Aktualisieren...";
      
mysql_error();
   }


}

         
/* Umfragen-Tabelle auslesem*/
         
$sql mysql_query("SELECT * FROM $umfragen");
         
$counter 0;
         
$umfragen mysql_num_rows($sql);
while (
$data mysql_fetch_array($sqlMYSQL_ASSOC)) {
 if(
$data[status] == 1) {
               if(
$counter>0) echo $abstand;
               
/* Frage */
               
echo "<form style=\"padding:0px;margin:0px;\" action=\"".$_SERVER['REQUEST_URI'];
               echo 
"#ergebnisse\" method=\"POST\">\n";
               echo 
"<div class=\"umfragentext\">";
               echo 
$data['question'];
               echo 
"</div>\n";

               
/* Antwortmoeglichkeiten */
               
$options explode("%%"$data['options']);

         if(!
ip_exists($umfragen,$data[id])) {
               echo 
"<div style=\"padding-left:15px;text-align:left\">";
               for(
$x=0;$x<count($options);$x++) {
                          echo 
"<span class=\"umfrageoption\"><input name=\"ant\" value=\"".$x."\" type=\"radio\"> ";
                          echo 
$options[$x]."</span><br>\n";
               }
               echo 
"</div>";
               echo 
"<br><input type=\"hidden\" name=\"id\" value=\"".$data['id']."\">\n";
               echo 
"<input type=\"submit\" name=\"vote\" value=\"abstimmen\" class=\"vote\"><br>\n";
         }

               if((isset(
$_POST['results']) && $_POST['id'] == $data['id']) || ip_exists($umfragen,$data[id])) {
                      
/* Ergebnisse anzeigen */
                      
$voters 0;
                      
$max_vote 0;
                      
$max_vote_pos 0;
                      
$votes explode(","$data['votes']);
                      for(
$x=0;$x<count($options);$x++) {
                           
$voters=$voters+$votes[$x];
                           if(
$votes[$x] > $max_vote) {
                               
$max_vote $votes[$x];
                               
$max_vote_pos $x;
                           }
                      }
                      
$percentage = array();
                      
$hund 0;
                      
$pc 0;
                      
$end false;
                      while(!
$end) {
                            
$hund 0;
                            for(
$x=0;$x<count($options);$x++) {
                                   if(
$voters==0) {
                                       
$percentage[$x] = 0;
                                   }
                                   else {
                                       
$percentage[$x]=($votes[$x]*100)/$voters;
                                       
$percentage[$x]=round($percentage[$x],$pc);
                                   }
                                       
$hund $hund $percentage[$x];
                            }
                            
/* Nachkommastellenbestimmung */
                            
$pc++;
                            if(
$hund == 100 || $pc == 2) {
                                   
$end true;
                            }
                      }
                      echo 
"<a id=\"ergebnisse\"></a><div style=\"text-align:left;padding-left:15px;padding-right:11px;padding-top:5px;font-size:11px; font-family:tahoma; color:#222221\">";
                      for(
$x=0;$x<count($percentage);$x++) {
                           if(
$max_vote == 0) {
                               
$blau 0;
                               
$grau $maxlaenge;
                               }
                           else {
                               
$blau ceil(($maxlaenge/$max_vote)*$votes[$x]);
                               
$grau $maxlaenge $blau;
                               }
                           
/*
                           if($blau>$maxlaenge) $blau=$maxlaenge;
                           echo $options[$x]."<br>\n";
                           echo "<img src=\"".$pfad."/balken/balken_";
                           if($blau==$maxlaenge) echo "orange";
                           else echo $farbe;
                           */
                           
echo $options[$x]."<br>\n";
                           echo 
"<img src=\"".$pfad."balken/balken_";
                           echo 
$farbe;
                           echo 
".gif\" height=\"12\" width=\"$blau\" border=\"0\" title=\"$votes[$x] Stimmen\" alt=\"$votes[$x] Stimmen\">";
                           echo 
"<img src=\"".$pfad."balken/balken_grau.gif\" height=\"12\" width=\"$grau\" border=\"0\" title=\"$votes[$x] Stimmen\" alt=\"$votes[$x] Stimmen\">\n";
                           echo 
$percentage[$x]."%<br>\n";

                      }
                      echo 
"</div>";
                      echo 
"<div class=\"umfragentext\">insgesamt $voters Stimmen</div>\n";
               }
               else {
                     echo 
"<input type=\"submit\" name=\"results\" value=\"Ergebnisse\" class=\"vote\">\n";
               }

               echo 
"</form>\n";
               
$counter++;
 }
}
if(
$counter == 0) echo "z.Zt. keine Umfrage aktiv";
?>

212
Discussion & Troubleshooting / Details in Popup!
« on: September 12, 2008, 03:44:55 AM »
Wie mache ich das,

von der Index Seite aus wenn ich auf ein Thumbnails klicke, dass sich die detailspage in einem Popup öffnet?

213
Chit Chat / Include in Echo ausgeben
« on: September 06, 2008, 12:21:51 AM »
Wie bekomme ich das hin, dass hier die Include auch ausgegeben wird?

Zeile: 10

Der Pfad ist definitiv richtig!

Code: [Select]
// Show the news fader? (assuming there are things to show...)
if ($settings['show_newsfader'] && !empty($context['fader_news_lines']))
{
echo "<table border=\"0\" width=\"100%\" class=\"tborder\" cellpadding=\"4\" style=\"margin-bottom: 2ex;\">\n";
echo " <tr>\n";
echo " <td class=\"catbg\"> &nbsp;Speedletter</td>\n";
echo " </tr>\n";
echo " <tr>\n";
echo " <td valign=\"middle\" align=\"center\" height=\"60\"><?php
include '../letter.php';
?>
\n";
echo " </td>\n";
echo " </tr>\n";
echo " </table>\n";
}

214
Mods & Plugins (Requests & Discussions) / Klapptext php Problem!
« on: September 05, 2008, 11:52:34 PM »
Hallo zusammen,
ich habe ein kleines Problem mit einem Klapptext- Script, wenn man innerhalb dieses Scriptes Php-Schnipsel verwendet.

So ist der Klapptext-Code Standard (Und Funktioniert tadellos)
 // Is there description?

echo "<script type=\"text/javascript\">\n";
echo 
"function Klappen(Id) {\n";
echo 
"var KlappText = document.getElementById('Lay'+Id);\n";
echo 
"var KlappBild = document.getElementById('Pic'+Id);\n";
echo 
"var jetec_Minus=\"../../../templates/test/images/minus.gif\", jetec_Plus=\"../../../templates/test/images/plus.gif\";\n";
echo 
"if (KlappText.style.display == 'none') {\n";
echo 
"KlappText.style.display = 'block';\n";
echo 
"KlappBild.src = jetec_Minus;\n";
echo 
"} else {\n";
echo 
"KlappText.style.display = 'none';\n";
echo 
"KlappBild.src = jetec_Plus;\n";
echo 
"}}\n";
echo 
"</script>\n";

if (!empty(
$game['description']))
echo 
'
<table width="100%" border="0" cellpadding="4" cellspacing="0">
<tr>
<td valign="top"><a href="javascript:Klappen(1)"><img src="../../../templates/test/images/plus.gif" alt="aus/ein-klappen" name="Pic1" width="9" height="9" border="0" id="Pic1" /><font color ="#FF9900">&nbsp;&nbsp;Spiele Details</font></a></td>
</tr>
</table>
<table width="100%" id="Lay1" style="DISPLAY: none" border="0" cellpadding="4" cellspacing="0">
<tr>
<td class="windowbg4"><div class="smalltext">'
$game['description'], '</div></td>
</tr>
</table>
'
;


Wichtig ist darauf zu achten, dass wenn man den Klapptext mehrfach verwenden möchte, dass sich die Zahlen ändern!

    * "javascript:Klappen(1)"
    * name="Pic1"
    * id="Pic1"
    * id="Lay1"

Damit habe ich ja auch keine Probleme.

Ich wollte nun an Stelle von "1" bzw. einer Zahl dieses verwenden:
', $game['name'], '

Ich habe es einmal so gemacht:


 // Is there description?

echo "<script type=\"text/javascript\">\n";
echo 
"function Klappen(Id) {\n";
echo 
"var KlappText = document.getElementById('Lay'+Id);\n";
echo 
"var KlappBild = document.getElementById('Pic'+Id);\n";
echo 
"var jetec_Minus=\"../../../templates/test/images/minus.gif\", jetec_Plus=\"../../../templates/test/images/plus.gif\";\n";
echo 
"if (KlappText.style.display == 'none') {\n";
echo 
"KlappText.style.display = 'block';\n";
echo 
"KlappBild.src = jetec_Minus;\n";
echo 
"} else {\n";
echo 
"KlappText.style.display = 'none';\n";
echo 
"KlappBild.src = jetec_Plus;\n";
echo 
"}}\n";
echo 
"</script>\n";

if (!empty(
$game['description']))
echo 
'
<table width="100%" border="0" cellpadding="4" cellspacing="0">
<tr>
<td valign="top"><a href="javascript:Klappen('
$game['name'], ')"><img src="../../../templates/test/images/plus.gif" alt="aus/ein-klappen" name="'$game['name'], '" width="9" height="9" border="0" id="'$game['name'], '" /><font color ="#FF9900">&nbsp;&nbsp;Spiele Details</font></a></td>
</tr>
</table>
<table width="100%" id="'
$game['name'], '" style="DISPLAY: none" border="0" cellpadding="4" cellspacing="0">
<tr>
<td class="windowbg4"><div class="smalltext">'
$game['description'], '</div></td>
</tr>
</table>
'
;


Das klappt aber nicht!

Dann habe ich das versucht:
 // Is there description?

echo "<script type=\"text/javascript\">\n";
echo 
"function Klappen(Id) {\n";
echo 
"var KlappText = document.getElementById('Lay'+Id);\n";
echo 
"var KlappBild = document.getElementById('Pic'+Id);\n";
echo 
"var jetec_Minus=\"../../../templates/test/images/minus.gif\", jetec_Plus=\"../../../templates/test/images/plus.gif\";\n";
echo 
"if (KlappText.style.display == 'none') {\n";
echo 
"KlappText.style.display = 'block';\n";
echo 
"KlappBild.src = jetec_Minus;\n";
echo 
"} else {\n";
echo 
"KlappText.style.display = 'none';\n";
echo 
"KlappBild.src = jetec_Plus;\n";
echo 
"}}\n";
echo 
"</script>\n";

if (!empty(
$game['description']))
echo 
'
<table width="100%" border="0" cellpadding="4" cellspacing="0">
<tr>
<td valign="top"><a href="javascript:Klappen('
$game['name'], ')"><img src="../../../templates/test/images/plus.gif" alt="aus/ein-klappen" name="Pic'$game['name'], '" width="9" height="9" border="0" id="Pic'$game['name'], '" /><font color ="#FF9900">&nbsp;&nbsp;Spiele Details</font></a></td>
</tr>
</table>
<table width="100%" id="Lay'
$game['name'], '" style="DISPLAY: none" border="0" cellpadding="4" cellspacing="0">
<tr>
<td class="windowbg4"><div class="smalltext">'
$game['description'], '</div></td>
</tr>
</table>
'
;


Das klappt ebenfalls nicht!
Das sind Experimente von mir, da ich derweil nicht wirklich Ahnung von Php habe!

Kann mir denn da wer weiterhelfen?

215
Discussion & Troubleshooting / Flash Games Category
« on: September 03, 2008, 09:51:23 PM »
Hallo zusammen,

ich wollte eine weitere Kategorie anlegen, in der ich Flashspiele hochlade, welche die User dann spielen können. Meine Frage ist, ob es möglich ist, dass diese Spiele nicht unter "Neue Bilder" - "Random Images" und "Top10" vorkommen?

Also das man die Kategorie von dem eigentlichen Gallery geschehen (ich sag jetzt mal) abschneidet?

Is it, that one can lay out another category in possible the I can upload flash Games? However, Game shall not be listed the flash such as under the Top10

216
Ist es möglich einen Singlelogin, zwischen SMF - Forum und 4images herzustellen? Ohne weitere Funktionen, es soll nur bei einem Single Login bleiben!

Is it possible a single login between SMF - to produce forum and 4 images? Further functions, it only shall remain login at a single!

217
Mods & Plugins (Requests & Discussions) / Tiny Profile Link
« on: August 26, 2008, 01:40:03 AM »
Hallo,

ich habe eine Script gefunden. Dieses Script kürzt lange URLS! Ich habe mir gedacht das ich ein paar Coder von euch frage und dieses Script ein wenig umfunktionieren. So das die Links für User- Profile generiert werden.

So das jeder User Chance hat die Profil- URL: http://www.profil.website.de/member.php?action=showprofile&user_id=1 mit diesem Script in http://profil.website.de/phisker

Das Script läuft auf jeden Fall, nur wenn ich es könnte hätte ich mir das selber schon so angepasst!
Demo: http://cundb.phisker-produkt.de/profilurl/index.php

Hallo,

ich habe eine Script gefunden, mit dem es möglich ist Lange-Urls in kurze-urls zu kürzen. Ich hatte mir da was überlegt, was ich selber aber nicht umsetzen kann.
Ich möchte dieses Script, gerne an 4images anpassen. Die User sollen mit diesem Script die Lange Profiladresse kürzen können.
Die Standard Adresse sieht so aus: http://webseite.de/member.php?action=showprofile&user_id=1 und das ist eindeutig zu lang. Ich möchte das die User ihre Profil- Adressen anderen Usern weiter geben können.
Ich lege zum Beispiel eine neue Domain an: http://profile.webseite.de
Wenn das Script an 4images angepasst wäre, könnte die Kürzung in etwas so aussehen: http://profile.webseite.de/phisker

Eine Demo kann man hier sehen: http://phisker-produkt.de/demo/index.php


[liNGUATEC- TRANSLATE]

Hallo,

I have found one script with which it is possible to shorten for a long time URLs into short URLs. I had thought what over there, however, what I can not convert.
I would like this script, images like to adapt to 4. The users shall be able to shorten the long profile address with this script.

The standard address looks that way: http://webseite.de/member.php?action=showprofile&user_id=1 and this is obviously too long. I would like this the users can further give other users her profile addresses.
I lay out for example a new domain: http://profile.webseite.de
If the script were adapted to 4 images, the cut could look that way in something: http://profile.webseite.de/phisker

One can see a demo here: http://phisker-produkt.de/demo/index.php

[GOOGLE- TRANSLATE]

Hello,

I have found a script with which it is possible Lange Urls urls into short-cut. I had my da was about what I myself but can not implement.
I want this script, like 4images to adapt. Users should this script with the Long profile address cut.

The default address looks like this: http://webseite.de/member.php?action=showprofile&user_id=1 and this is obviously too long. I would like this the users can further give her other users profile addresses.

   
I enclose, for example, a new domain: http://profile.webseite.de

   
If the script 4images would be adjusted, there could be a reduction in something like this: http://profile.webseite.de/phisker

One can see a demo here: http://phisker-produkt.de/demo/index.php


Bitte - Please - Bitte - Please

218
Discussion & Troubleshooting / {if..} {endif...} Tutorial
« on: August 25, 2008, 10:36:56 PM »
Hallo zusammen,

ich wollte mal fragen wie man eigene {if user_feld} {user_feld} {endif user_feld} erstellen kann. Wie man Felder erstellen kann weis ich aber nicht wie man mit dem IF und ENDif spielen kann. Ich möchte das bspw.:

Ich erstelle Felder
Diese versehe ich im Profil mit diesem if und endif
Im Editprofil kann er User  anklicken ob etwas angezeigt werden soll oder nicht!

219
[Original]

Hallo,

ich wollte mal ganz lieb anfragen ob jemand eventuell die Lust und die zeit aufbringen kann eine "Treuepunkte" Modifikation zu erstellen. Ich habe da an was gedacht.

... User erhalten für das einloggen xx Punkte
... Die Punkte sind im Profil einsehbar
... Punkte ausgaben sind ebenfalls im Profil einsehbar
... Im Adminpanel kann man einstellen wie viele Punkte man für eine bestimmte Aktion bekommt
... Punkte sind gegen Prämien eintauschbar
... Prämien kann man im Adminpanel einstellen

Das wäre echt klasse, wenn da jemand etwas Zeit und Lust aufbringen kann.

[linguatec - Translate]

Hello,

I wanted to ask quite kindly whether perhaps somebody can find the desire and the time one " faithful points " to make modification. I have thought of what there.

... Users get log in xx points for this
... The points are understandable in the profile
... Points distributed are also understandable in the profile
... In the admin panel one can adjust how many points one gets for a certain action
... Points are one exchange cash against boni
... One can adjust boni in the admin panel

This would be extremely slap-up if somebody can find the a little time and desire there.

[ Google - Translate]

Hello,
   
I wanted very fond of times someone may inquire whether the desire and the time needed, a "loyalty points" for modification. I thought there was.

... Users receive for the log xx points
... The points are viewed in profile
... Points expenditures are also available in the profile
... In the Admin panel can define how many points you for a particular action gets
... Points are against premiums eintauschbar
... Premiums can be set in the admin panel

That would be really cool if some time because someone up and pleasure.

220
Discussion & Troubleshooting / [HACK] My Profile - Mein Profil
« on: August 22, 2008, 12:48:00 PM »
:flag-de:

Dieser Hack erweitert die Userbox um einen weiteren Link. Dieser Link führt direkt zum eigenen Profil.



:flag-en:
   
This hack Userbox extends for a further link. This link takes you directly to your own profile.


Step 1

Open / Öffne: includes/page_header.php
Search / Suche:
"url_new_images" => $site_sess->url(ROOT_PATH."search.php?search_new_images=1"),
Add after / Füge drunter:
"my_profile" => $site_sess->url(ROOT_PATH."member.php?action=showprofile&amp;".URL_USER_ID."=".$user_info['user_id']),

Step 2

Open / Öffne: templates/YOUR-TEMPLATE/user_logininfo.html
Search / Suche:
Code: [Select]
» <a href="{url_control_panel}">{lang_control_panel}</a><br />Add after / Füge darunter ein:
Code: [Select]
<a href="{my_profile}">My Profile</a>

221
Hallo zusammen,

irgendwie klappt das Senden der Mails nicht...

Ich habe unter: Administrator Email, meine E-Mail angegeben!

Ich gehe z.B Ins Contactformular.. ich fülle alles aus und klicke auf Abschicken... es steht das die Mail versendet wurde... aber folgendes kommt an:

Code: [Select]
Undelivered Mail Returned to Sender
Code: [Select]
This is the mail system at host sydney.webhoster.ag.

I'm sorry to have to inform you that your message could not
be delivered to one or more recipients. It's attached below.

For further assistance, please send mail to <postmaster>

If you do so, please include this problem report. You can
delete your own text from the attached returned message.

                  The mail system

<dein@email.ldt.webhoster.ag>: mail for email.ldt.webhoster.ag loops back to
   myself

Final-Recipient: rfc822; dein@email.ldt.webhoster.ag
Original-Recipient: rfc822;dein@email.ldt.webhoster.ag
Action: failed
Status: 5.4.6
Diagnostic-Code: X-sydney-webhoster-ag; mail for email.ldt.webhoster.ag loops
   back to myself


---------- Weitergeleitete Nachricht ----------
From: Huibui <ben18b@gmx.de>
To: dein@email.ldt.webhoster.ag
Date: Wed, 20 Aug 2008 00:55:27 +0200
Subject: contact: www.verweis_zum_beispiel_an-deine_seite.ldtdd

Dies ist eine Nachricht von Huibui (ben16b@gmx.de) und wurde von "C&B" aus versendet.
Die Betreiber von C&B k&ouml;nnen keine
Verantwortung f&uuml;r den Inhalt dieser Email &uuml;bernehmen.

Dies ist die Nachricht:
-------------------------------------------
ddd

Also die Nachricht kommt wohl an... aber ist das so richtig?

222
Hallo zusammen,

in 4images kann man ja mit
Code: [Select]
{if user_loggedin}Text{endif user_loggedin} bestimmte Bereiche nur für Registrierte User sichtbar machen, dass ist auch echt klasse, aber geht das auch mit bestimmten Benutzergruppen?

Ich mache z.B eine Benutzergruppe "VIP", das man eventuell sowas in der Art
Code: [Select]
{if vip_user}Test{endif vip_user} machen kann? Dies sollte dann nur für VIP zu sehen sein auch nicht für normale Regg User...

223
Mods & Plugins (Requests & Discussions) / Details Reflection
« on: August 08, 2008, 02:52:37 AM »
Ich habe jetzt die ganze Zeit versucht dies zum laufen zu bringen:
http://cow.neondragon.net/stuff/reflection/

bei Icons etc. klappt das aber bei den Bildern nicht!
In meinen Media Ordner sind in den html Files folgender Code versehen:
Code: [Select]
<div id="container" style="position:static; width:{width}px; height:{height}px; border:0px; background: url({media_src}) top left no-repeat; text-align:left;">
Wenn ich dort das class einfüge geschieht nichts!

Dann bin ich mal in die include/functions.php gegangen, dort findet man folgende Codes:
Code: [Select]
    $media_icon = "<img  src=\"".ICON_PATH."/".$file_extension.".gif\" border=\"0\" alt=\"".format_text($image_name, 2)."\" />";und
Code: [Select]
      $media_icon = "<img src=\"".ICON_PATH."/".$file_extension.".gif\" border=\"0\" alt=\"\" />";
Wenn ich dort class=\"reflect\" einbaue:
Code: [Select]
    $media_icon = "<img  class=\"reflect\" src=\"".ICON_PATH."/".$file_extension.".gif\" border=\"0\" alt=\"".format_text($image_name, 2)."\" />";und
Code: [Select]
      $media_icon = "<img class=\"reflect\" src=\"".ICON_PATH."/".$file_extension.".gif\" border=\"0\" alt=\"\" />";
Wo kann man das machen? Oder geht das überhaupt nicht aus welchen Gründen auch immer?

224
Chit Chat / Ajax IM
« on: August 08, 2008, 02:22:25 AM »
Das wäre ja mal was für 4images :P
Wenn man das in 4images integrieren könnte, wegen registration etc.

http://www.ajaxim.com/

225
Ist es möglich in JS Dateien Lang-Tags zu setzen?

z.B für diese Datei?
Code: [Select]
/****
Last Modified: 13/05/07 00:25:28

 GoogieSpell
     Google spell checker for your own web-apps :)
 Copyright Amir Salihefendic 2006
     LICENSE
     GPL (see gpl.txt for more information)
     This basically means that you can't use this script with/in proprietary software!
     There is another license that permits you to use this script with proprietary software. Check out:... for more info.
     AUTHOR
         4mir Salihefendic (http://amix.dk) - amix@amix.dk
 VERSION
     4.0
****/
var GOOGIE_CUR_LANG = null;
var GOOGIE_DEFAULT_LANG = "de";

function GoogieSpell(img_dir, server_url) {
    var cookie_value;
    var lang;
    cookie_value = getCookie('language');

    if(cookie_value != null)
        GOOGIE_CUR_LANG = cookie_value;
    else
        GOOGIE_CUR_LANG = GOOGIE_DEFAULT_LANG;

    this.img_dir = img_dir;
    this.server_url = server_url;

    this.org_lang_to_word = {"da": "Dansk", "de": "Deutsch", "en": "English"};
    this.lang_to_word = this.org_lang_to_word;
    this.langlist_codes = AJS.keys(this.lang_to_word);

    this.show_change_lang_pic = true;
    this.change_lang_pic_placement = "left";

    this.report_state_change = true;

    this.ta_scroll_top = 0;
    this.el_scroll_top = 0;

    this.lang_chck_spell = "Rechtschreibpr&uuml;fung";
    this.lang_revert = "Wechseln zu";
    this.lang_close = "Schlie&szlig;en";
    this.lang_rsm_edt = "<img src=\"spellcheck/img/change_lang.gif\" border=\"0\"> Bearbeitung fortzetzen";
    this.lang_no_error_found = "Keine Rechtschreibfehler gefunden";
    this.lang_no_suggestions = "Keine Vorschl&auml;ge";
   
    this.show_spell_img = false;
    this.decoration = true;
    this.use_close_btn = true;
    this.edit_layer_dbl_click = true;
    this.report_ta_not_found = true;

    //Extensions
    this.custom_ajax_error = null;
    this.custom_no_spelling_error = null;
    this.custom_menu_builder = []; //Should take an eval function and a build menu function
    this.custom_item_evaulator = null; //Should take an eval function and a build menu function
    this.extra_menu_items = [];
    this.custom_spellcheck_starter = null;
    this.main_controller = true;

    //Observers
    this.lang_state_observer = null;
    this.spelling_state_observer = null;
    this.show_menu_observer = null;
    this.all_errors_fixed_observer = null;

    //Focus links - used to give the text box focus
    this.use_focus = false;
    this.focus_link_t = null;
    this.focus_link_b = null;

    //Counters
    this.cnt_errors = 0;
    this.cnt_errors_fixed = 0;

    //Set document on click to hide the language and error menu
    var fn = function(e) {
        var elm = AJS.getEventElm(e);
        if(elm.googie_action_btn != "1" && this.isLangWindowShown())
            this.hideLangWindow();
        if(elm.googie_action_btn != "1" && this.isErrorWindowShown())
            this.hideErrorWindow();
    };
    AJS.AEV(document, "click", AJS.$b(fn, this));
}

GoogieSpell.prototype.decorateTextarea = function(id) {
    if(typeof(id) == "string")
        this.text_area = AJS.$(id);
    else
        this.text_area = id;

    var r_width, r_height;

    if(this.text_area != null) {
        if(!AJS.isDefined(this.spell_container) && this.decoration) {
            var table = AJS.TABLE();
            var tbody = AJS.TBODY();
            var tr = AJS.TR();

            if(AJS.isDefined(this.force_width))
                r_width = this.force_width;
            else
                r_width = "";

            if(AJS.isDefined(this.force_height))
                r_height = this.force_height;
            else
                r_height = "";

            var spell_container = AJS.TD();
            this.spell_container = spell_container;

            tr.appendChild(spell_container);

            tbody.appendChild(tr);
            table.appendChild(tbody);

            AJS.insertBefore(table, this.text_area);

            //Set width
            AJS.setHeight(table, spell_container, r_height);
            AJS.setWidth(table, spell_container, r_width);

            spell_container.style.textAlign = "left";
        }

        this.checkSpellingState();
    }
    else
        if(this.report_ta_not_found)
            alert("Text area not found");
}

//////
// API Functions (the ones that you can call)
/////
GoogieSpell.prototype.setSpellContainer = function(elm) {
    this.spell_container = AJS.$(elm);
}

GoogieSpell.prototype.setLanguages = function(lang_dict) {
    this.lang_to_word = lang_dict;
    this.langlist_codes = AJS.keys(lang_dict);
}

GoogieSpell.prototype.setForceWidthHeight = function(width, height) {
    /***
        Set to null if you want to use one of them
    ***/
    this.force_width = width;
    this.force_height = height;
}

GoogieSpell.prototype.setDecoration = function(bool) {
    this.decoration = bool;
}

GoogieSpell.prototype.dontUseCloseButtons = function() {
    this.use_close_btn = false;
}

GoogieSpell.prototype.appendNewMenuItem = function(name, call_back_fn, checker) {
    this.extra_menu_items.push([name, call_back_fn, checker]);
}

GoogieSpell.prototype.appendCustomMenuBuilder = function(eval, builder) {
    this.custom_menu_builder.push([eval, builder]);
}

GoogieSpell.prototype.setFocus = function() {
    try {
        this.focus_link_b.focus();
        this.focus_link_t.focus();
        return true;
    }
    catch(e) {
        return false;
    }
}

GoogieSpell.prototype.getValue = function(ta) {
    return ta.value;
}

GoogieSpell.prototype.setValue = function(ta, value) {
    ta.value = value;
}


//////
// Set functions (internal)
/////
GoogieSpell.prototype.setStateChanged = function(current_state) {
    this.state = current_state;
    if(this.spelling_state_observer != null && this.report_state_change)
        this.spelling_state_observer(current_state, this);
}

GoogieSpell.prototype.setReportStateChange = function(bool) {
    this.report_state_change = bool;
}


//////
// Request functions
/////
GoogieSpell.prototype.getGoogleUrl = function() {
    return this.server_url + GOOGIE_CUR_LANG;
}

GoogieSpell.escapeSepcial = function(val) {
    return val.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
}

GoogieSpell.createXMLReq = function (text) {
    return '<?xml version="1.0" encoding="utf-8" ?><spellrequest textalreadyclipped="0" ignoredups="0" ignoredigits="1" ignoreallcaps="1"><text>' + text + '</text></spellrequest>';
}

GoogieSpell.prototype.spellCheck = function(ignore) {
    var me = this;

    this.cnt_errors_fixed = 0;
    this.cnt_errors = 0;
    this.setStateChanged("checking_spell");

    if(this.main_controller)
        this.appendIndicator(this.spell_span);

    this.error_links = [];
    this.ta_scroll_top = this.text_area.scrollTop;

    try { this.hideLangWindow(); }
    catch(e) {}

    this.ignore = ignore;

    if(this.getValue(this.text_area) == '' || ignore) {
        if(!me.custom_no_spelling_error)
            me.flashNoSpellingErrorState();
        else
            me.custom_no_spelling_error(me);
        me.removeIndicator();
        return ;
    }
   
    this.createEditLayer(this.text_area.offsetWidth, this.text_area.offsetHeight);

    this.createErrorWindow();
    AJS.getBody().appendChild(this.error_window);

    try { netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead"); }
    catch (e) { }

    if(this.main_controller)
        this.spell_span.onclick = null;

    this.orginal_text = this.getValue(this.text_area);

    //Create request
    var d = AJS.getRequest(this.getGoogleUrl());
    var reqdone = function(res_txt) {
        var r_text = res_txt;
        me.results = me.parseResult(r_text);

        if(r_text.match(/<c.*>/) != null) {
            //Before parsing be sure that errors were found
            me.showErrorsInIframe();
            me.resumeEditingState();
        }
        else {
            if(!me.custom_no_spelling_error)
                me.flashNoSpellingErrorState();
            else
                me.custom_no_spelling_error(me);
        }
        me.removeIndicator();
    };

    d.addCallback(reqdone);
    reqdone = null;

    var reqfailed = function(res_txt, req) {
        if(me.custom_ajax_error)
            me.custom_ajax_error(req);
        else
            alert("An error was encountered on the server. Please try again later.");

        if(me.main_controller) {
            AJS.removeElement(me.spell_span);
            me.removeIndicator();
        }
        me.checkSpellingState();
    };
    d.addErrback(reqfailed);
    reqfailed = null;

    var req_text = GoogieSpell.escapeSepcial(this.orginal_text);
    d.sendReq(GoogieSpell.createXMLReq(req_text));
}


//////
// Spell checking functions
/////
GoogieSpell.prototype.parseResult = function(r_text) {
    /***
     Retunrs an array
     result[item] -> ['attrs'], ['suggestions']
        ***/
    var re_split_attr_c = /\w+="(\d+|true)"/g;
    var re_split_text = /\t/g;

    var matched_c = r_text.match(/<c[^>]*>[^<]*<\/c>/g);
    var results = new Array();

    if(matched_c == null)
        return results;
   
    for(var i=0; i < matched_c.length; i++) {
        var item = new Array();
        this.errorFound();

        //Get attributes
        item['attrs'] = new Array();
        var split_c = matched_c[i].match(re_split_attr_c);
        for(var j=0; j < split_c.length; j++) {
            var c_attr = split_c[j].split(/=/);
            var val = c_attr[1].replace(/"/g, '');
            if(val != "true")
                item['attrs'][c_attr[0]] = parseInt(val);
            else {
                item['attrs'][c_attr[0]] = val;
            }
        }

        //Get suggestions
        item['suggestions'] = new Array();
        var only_text = matched_c[i].replace(/<[^>]*>/g, "");
        var split_t = only_text.split(re_split_text);
        for(var k=0; k < split_t.length; k++) {
        if(split_t[k] != "")
            item['suggestions'].push(split_t[k]);
        }
        results.push(item);
    }
    return results;
}

//////
// Counters
/////
GoogieSpell.prototype.errorFixed = function() {
    this.cnt_errors_fixed++;
    if(this.all_errors_fixed_observer)
        if(this.cnt_errors_fixed == this.cnt_errors) {
            this.hideErrorWindow();
            this.all_errors_fixed_observer();
        }
}
GoogieSpell.prototype.errorFound = function() { this.cnt_errors++; }

//////
// Error menu functions
/////
GoogieSpell.prototype.createErrorWindow = function() {
    this.error_window = AJS.DIV();
    this.error_window.className = "googie_window";
    this.error_window.googie_action_btn = "1";
}

GoogieSpell.prototype.isErrorWindowShown = function() {
    return this.error_window != null && this.error_window.style.visibility == "visible";
}

GoogieSpell.prototype.hideErrorWindow = function() {
    try {
        this.error_window.style.visibility = "hidden";
        if(this.error_window_iframe)
            this.error_window_iframe.style.visibility = "hidden";
    }
    catch(e) {}
}

GoogieSpell.prototype.updateOrginalText = function(offset, old_value, new_value, id) {
    var part_1 = this.orginal_text.substring(0, offset);
    var part_2 = this.orginal_text.substring(offset+old_value.length);
    this.orginal_text = part_1 + new_value + part_2;
    this.setValue(this.text_area, this.orginal_text);
    var add_2_offset = new_value.length - old_value.length;
    for(var j=0; j < this.results.length; j++) {
        //Don't edit the offset of the current item
        if(j != id && j > id){
            this.results[j]['attrs']['o'] += add_2_offset;
        }
    }
}

GoogieSpell.prototype.saveOldValue = function(elm, old_value) {
    elm.is_changed = true;
    elm.old_value = old_value;
}

GoogieSpell.prototype.createListSeparator = function() {
    var e_col = AJS.TD(" ");
    e_col.googie_action_btn = "1";
    e_col.style.cursor = "default";
    e_col.style.fontSize = "3px";
    e_col.style.borderTop = "1px solid #ccc";
    e_col.style.paddingTop = "3px";

    return AJS.TR(e_col);
}

GoogieSpell.prototype.correctError = function(id, elm, l_elm, /*optional*/ rm_pre_space) {
    var old_value = elm.innerHTML;
    var new_value = l_elm.innerHTML;
    var offset = this.results[id]['attrs']['o'];

    if(rm_pre_space) {
        var pre_length = elm.previousSibling.innerHTML;
        elm.previousSibling.innerHTML = pre_length.slice(0, pre_length.length-1);
        old_value = " " + old_value;
        offset--;
    }

    this.hideErrorWindow();

    this.updateOrginalText(offset, old_value, new_value, id);

    elm.innerHTML = new_value;
   
    elm.style.color = "green";
    elm.is_corrected = true;

    this.results[id]['attrs']['l'] = new_value.length;

    if(!AJS.isDefined(elm.old_value))
        this.saveOldValue(elm, old_value);
   
    this.errorFixed();
}

GoogieSpell.prototype.showErrorWindow = function(elm, id) {
    if(this.show_menu_observer)
        this.show_menu_observer(this);
    var me = this;

    var abs_pos = AJS.absolutePosition(elm);
    abs_pos.y -= this.edit_layer.scrollTop;
    this.error_window.style.visibility = "visible";

    AJS.setTop(this.error_window, (abs_pos.y+20));
    AJS.setLeft(this.error_window, (abs_pos.x));

    this.error_window.innerHTML = "";

    var table = AJS.TABLE({'class': 'googie_list'});
    table.googie_action_btn = "1";
    var list = AJS.TBODY();

    //Check if we should use custom menu builder, if not we use the default
    var changed = false;
    if(this.custom_menu_builder != []) {
        for(var k=0; k<this.custom_menu_builder.length; k++) {
            var eb = this.custom_menu_builder[k];
            if(eb[0]((this.results[id]))){
                changed = eb[1](this, list, elm);
                break;
            }
        }
    }
    if(!changed) {
        //Build up the result list
        var suggestions = this.results[id]['suggestions'];
        var offset = this.results[id]['attrs']['o'];
        var len = this.results[id]['attrs']['l'];

        if(suggestions.length == 0) {
            var row = AJS.TR();
            var item = AJS.TD({'style': 'cursor: default;'});
            var dummy = AJS.SPAN();
            dummy.innerHTML = this.lang_no_suggestions;
            AJS.ACN(item, AJS.TN(dummy.innerHTML));
            item.googie_action_btn = "1";
            row.appendChild(item);
            list.appendChild(row);
        }

        for(i=0; i < suggestions.length; i++) {
            var row = AJS.TR();
            var item = AJS.TD();
            var dummy = AJS.SPAN();
            dummy.innerHTML = suggestions[i];
            item.appendChild(AJS.TN(dummy.innerHTML));
           
            var fn = function(e) {
                var l_elm = AJS.getEventElm(e);
                this.correctError(id, elm, l_elm);
            };

            AJS.AEV(item, "click", AJS.$b(fn, this));

            item.onmouseover = GoogieSpell.item_onmouseover;
            item.onmouseout = GoogieSpell.item_onmouseout;
            row.appendChild(item);
            list.appendChild(row);
        }

        //The element is changed, append the revert
        if(elm.is_changed && elm.innerHTML != elm.old_value) {
            var old_value = elm.old_value;
            var revert_row = AJS.TR();
            var revert = AJS.TD();

            revert.onmouseover = GoogieSpell.item_onmouseover;
            revert.onmouseout = GoogieSpell.item_onmouseout;
            var rev_span = AJS.SPAN({'class': 'googie_list_revert'});
            rev_span.innerHTML = this.lang_revert + " " + old_value;
            revert.appendChild(rev_span);

            var fn = function(e) {
                this.updateOrginalText(offset, elm.innerHTML, old_value, id);
                elm.is_corrected = true;
                elm.style.color = "#b91414";
                elm.innerHTML = old_value;
                this.hideErrorWindow();
            };
            AJS.AEV(revert, "click", AJS.$b(fn, this));

            revert_row.appendChild(revert);
            list.appendChild(revert_row);
        }
       
        //Append the edit box
        var edit_row = AJS.TR();
        var edit = AJS.TD({'style': 'cursor: default'});

        var edit_input = AJS.INPUT({'style': 'width: 120px; margin:0; padding:0', 'value': elm.innerHTML});
        edit_input.googie_action_btn = "1";

        var onsub = function () {
            if(edit_input.value != "") {
                if(!AJS.isDefined(elm.old_value))
                    this.saveOldValue(elm, elm.innerHTML);

                this.updateOrginalText(offset, elm.innerHTML, edit_input.value, id);
                elm.style.color = "green"
                elm.is_corrected = true;
                elm.innerHTML = edit_input.value;
               
                this.hideErrorWindow();
            }
            return false;
        };
        onsub = AJS.$b(onsub, this);
       
        var ok_pic = AJS.IMG({'src': this.img_dir + "../img/ok.gif", 'style': 'width: 32px; height: 16px; margin-left: 2px; margin-right: 2px; cursor: pointer;'});
        var edit_form = AJS.FORM({'style': 'margin: 0; padding: 0; cursor: default;'}, edit_input, ok_pic);

        edit_form.googie_action_btn = "1";
        edit.googie_action_btn = "1";

        AJS.AEV(edit_form, "submit", onsub);
        AJS.AEV(ok_pic, "click", onsub);
       
        edit.appendChild(edit_form);
        edit_row.appendChild(edit);
        list.appendChild(edit_row);

        //Append extra menu items
        if(this.extra_menu_items.length > 0)
            AJS.ACN(list, this.createListSeparator());

        var loop = function(i) {
                if(i < me.extra_menu_items.length) {
                    var e_elm = me.extra_menu_items[i];

                    if(!e_elm[2] || e_elm[2](elm, me)) {
                        var e_row = AJS.TR();
                        var e_col = AJS.TD(e_elm[0]);

                        e_col.onmouseover = GoogieSpell.item_onmouseover;
                        e_col.onmouseout = GoogieSpell.item_onmouseout;

                        var fn = function() {
                            return e_elm[1](elm, me);
                        };
                        AJS.AEV(e_col, "click", fn);

                        AJS.ACN(e_row, e_col);
                        AJS.ACN(list, e_row);

                    }
                    loop(i+1);
                }
        }
        loop(0);
        loop = null;

        //Close button
        if(this.use_close_btn) {
            AJS.ACN(list, this.createCloseButton(this.hideErrorWindow));
        }
    }

    table.appendChild(list);
    this.error_window.appendChild(table);

    //Dummy for IE - dropdown bug fix
    if(AJS.isIe() && !this.error_window_iframe) {
        var iframe = AJS.IFRAME({'style': 'position: absolute; z-index: 0;'});
        AJS.ACN(AJS.getBody(), iframe);
        this.error_window_iframe = iframe;
    }
    if(AJS.isIe()) {
        var iframe = this.error_window_iframe;
        AJS.setTop(iframe, this.error_window.offsetTop);
        AJS.setLeft(iframe, this.error_window.offsetLeft);

        AJS.setWidth(iframe, this.error_window.offsetWidth);
        AJS.setHeight(iframe, this.error_window.offsetHeight);

        iframe.style.visibility = "visible";
    }

    //Set focus on the last element
    var link = this.createFocusLink('link');
    list.appendChild(AJS.TR(AJS.TD({'style': 'text-align: right; font-size: 1px; height: 1px; margin: 0; padding: 0;'}, link)));
    link.focus();
}


//////
// Edit layer (the layer where the suggestions are stored)
//////
GoogieSpell.prototype.createEditLayer = function(width, height) {
    this.edit_layer = AJS.DIV({'class': 'googie_edit_layer'});

    //Set the style so it looks like edit areas
    this.edit_layer.className = this.text_area.className;
    this.edit_layer.style.border = "1px solid #999";
    this.edit_layer.style.backgroundColor = "#f7f7f7";
    this.edit_layer.style.padding = "3px";
    this.edit_layer.style.margin = "0px";

    AJS.setWidth(this.edit_layer, (width-8));

    if(AJS.nodeName(this.text_area) != "input" || this.getValue(this.text_area) == "") {
        this.edit_layer.style.overflow = "auto";
        AJS.setHeight(this.edit_layer, (height-6));
    }
    else {
        this.edit_layer.style.overflow = "hidden";
    }

    if(this.edit_layer_dbl_click) {
        var me = this;
        var fn = function(e) {
            if(AJS.getEventElm(e).className != "googie_link" && !me.isErrorWindowShown()) {
                me.resumeEditing();
                var fn1 = function() {
                    me.text_area.focus();
                    fn1 = null;
                };
                AJS.callLater(fn1, 10);
            }
            return false;
        };
        this.edit_layer.ondblclick = fn;
        fn = null;
    }
}

GoogieSpell.prototype.resumeEditing = function() {
    this.setStateChanged("spell_check");
    this.switch_lan_pic.style.display = "inline";

    if(this.edit_layer)
        this.el_scroll_top = this.edit_layer.scrollTop;

    this.hideErrorWindow();

    if(this.main_controller)
        this.spell_span.className = "googie_no_style";

    if(!this.ignore) {
        //Remove the EDIT_LAYER
        try {
            this.edit_layer.parentNode.removeChild(this.edit_layer);
            if(this.use_focus) {
                AJS.removeElement(this.focus_link_t);
                AJS.removeElement(this.focus_link_b);
            }
        }
        catch(e) {
        }

        AJS.showElement(this.text_area);

        if(this.el_scroll_top != undefined)
            this.text_area.scrollTop = this.el_scroll_top;
    }

    this.checkSpellingState(false);
}

GoogieSpell.prototype.createErrorLink = function(text, id) {
    var elm = AJS.SPAN({'class': 'googie_link'});
    var me = this;
    var d = function (e) {
        me.showErrorWindow(elm, id);
        d = null;
        return false;
    };
    AJS.AEV(elm, "click", d);

    elm.googie_action_btn = "1";
    elm.g_id = id;
    elm.is_corrected = false;
    elm.oncontextmenu = d;
    elm.innerHTML = text;
    return elm;
}

GoogieSpell.createPart = function(txt_part) {
    if(txt_part == " ")
        return AJS.TN(" ");
    var result = AJS.SPAN();

    var is_first = true;
    var is_safari = (navigator.userAgent.toLowerCase().indexOf("safari") != -1);

    var part = AJS.SPAN();
    txt_part = GoogieSpell.escapeSepcial(txt_part);
    txt_part = txt_part.replace(/\n/g, "<br>");
    txt_part = txt_part.replace(/    /g, " &nbsp;");
    txt_part = txt_part.replace(/^ /g, "&nbsp;");
    txt_part = txt_part.replace(/ $/g, "&nbsp;");
   
    part.innerHTML = txt_part;

    return part;
}

GoogieSpell.prototype.showErrorsInIframe = function() {
    var output = AJS.DIV();
    output.style.textAlign = "left";
    var pointer = 0;
    var results = this.results;

    if(results.length > 0) {
        for(var i=0; i < results.length; i++) {
            var offset = results[i]['attrs']['o'];
            var len = results[i]['attrs']['l'];
           
            var part_1_text = this.orginal_text.substring(pointer, offset);
            var part_1 = GoogieSpell.createPart(part_1_text);
            output.appendChild(part_1);
            pointer += offset - pointer;
           
            //If the last child was an error, then insert some space
            var err_link = this.createErrorLink(this.orginal_text.substr(offset, len), i);
            this.error_links.push(err_link);
            output.appendChild(err_link);
            pointer += len;
        }
        //Insert the rest of the orginal text
        var part_2_text = this.orginal_text.substr(pointer, this.orginal_text.length);

        var part_2 = GoogieSpell.createPart(part_2_text);
        output.appendChild(part_2);
    }
    else
        output.innerHTML = this.orginal_text;

    var me = this;
    if(this.custom_item_evaulator)
        AJS.map(this.error_links, function(elm){me.custom_item_evaulator(me, elm)});
   
    AJS.ACN(this.edit_layer, output);

    //Hide text area
    this.text_area_bottom = this.text_area.offsetTop + this.text_area.offsetHeight;

    AJS.hideElement(this.text_area);

    AJS.insertBefore(this.edit_layer, this.text_area);

    if(this.use_focus) {
        this.focus_link_t = this.createFocusLink('focus_t');
        this.focus_link_b = this.createFocusLink('focus_b');

        AJS.insertBefore(this.focus_link_t, this.edit_layer);
        AJS.insertAfter(this.focus_link_b, this.edit_layer);
    }

    this.edit_layer.scrollTop = this.ta_scroll_top;
}


//////
// Choose language menu
//////
GoogieSpell.prototype.createLangWindow = function() {
    this.language_window = AJS.DIV({'class': 'googie_window'});
    AJS.setWidth(this.language_window, 100);

    this.language_window.googie_action_btn = "1";

    //Build up the result list
    var table = AJS.TABLE({'class': 'googie_list'});
    AJS.setWidth(table, "100%");
    var list = AJS.TBODY();

    this.lang_elms = new Array();

    for(i=0; i < this.langlist_codes.length; i++) {
        var row = AJS.TR();
        var item = AJS.TD();
        item.googieId = this.langlist_codes[i];
        this.lang_elms.push(item);
        var lang_span = AJS.SPAN();
        lang_span.innerHTML = this.lang_to_word[this.langlist_codes[i]];
        item.appendChild(AJS.TN(lang_span.innerHTML));

        var fn = function(e) {
            var elm = AJS.getEventElm(e);
            this.deHighlightCurSel();

            this.setCurrentLanguage(elm.googieId);

            if(this.lang_state_observer != null) {
                this.lang_state_observer();
            }

            this.highlightCurSel();
            this.hideLangWindow();
        };
        AJS.AEV(item, "click", AJS.$b(fn, this));

        item.onmouseover = function(e) {
            var i_it = AJS.getEventElm(e);
            if(i_it.className != "googie_list_selected")
                i_it.className = "googie_list_onhover";
        };
        item.onmouseout = function(e) {
            var i_it = AJS.getEventElm(e);
            if(i_it.className != "googie_list_selected")
                i_it.className = "googie_list_onout";
        };

        row.appendChild(item);
        list.appendChild(row);
    }

    //Close button
    if(this.use_close_btn) {
        list.appendChild(this.createCloseButton(this.hideLangWindow));
    }

    this.highlightCurSel();

    table.appendChild(list);
    this.language_window.appendChild(table);
}

GoogieSpell.prototype.setCurrentLanguage = function(lan_code) {
    GOOGIE_CUR_LANG = lan_code;

    //Set cookie
    var now = new Date();
    now.setTime(now.getTime() + 365 * 24 * 60 * 60 * 1000);
    setCookie('language', lan_code, now);
}

GoogieSpell.prototype.isLangWindowShown = function() {
    return this.language_window != null && this.language_window.style.visibility == "visible";
}

GoogieSpell.prototype.hideLangWindow = function() {
    try {
        this.language_window.style.visibility = "hidden";
        this.switch_lan_pic.className = "googie_lang_3d_on";
    }
    catch(e) {}
}

GoogieSpell.prototype.deHighlightCurSel = function() {
    this.lang_cur_elm.className = "googie_list_onout";
}

GoogieSpell.prototype.highlightCurSel = function() {
    if(GOOGIE_CUR_LANG == null)
        GOOGIE_CUR_LANG = GOOGIE_DEFAULT_LANG;
    for(var i=0; i < this.lang_elms.length; i++) {
        if(this.lang_elms[i].googieId == GOOGIE_CUR_LANG) {
            this.lang_elms[i].className = "googie_list_selected";
            this.lang_cur_elm = this.lang_elms[i];
        }
        else {
            this.lang_elms[i].className = "googie_list_onout";
        }
    }
}

GoogieSpell.prototype.showLangWindow = function(elm, ofst_top, ofst_left) {
    if(this.show_menu_observer)
        this.show_menu_observer(this);
    if(!AJS.isDefined(ofst_top))
        ofst_top = 20;
    if(!AJS.isDefined(ofst_left))
        ofst_left = 100;

    this.createLangWindow();
    AJS.getBody().appendChild(this.language_window);

    var abs_pos = AJS.absolutePosition(elm);
    AJS.showElement(this.language_window);
    AJS.setTop(this.language_window, (abs_pos.y+ofst_top));
    AJS.setLeft(this.language_window, (abs_pos.x+ofst_left-this.language_window.offsetWidth));

    this.highlightCurSel();
    this.language_window.style.visibility = "visible";
}

GoogieSpell.prototype.createChangeLangPic = function() {
    var img = AJS.IMG({'src': this.img_dir + '../img/change_lang.gif', 'alt': "Change language"});
    img.googie_action_btn = "1";
    var switch_lan = AJS.SPAN({'class': 'googie_lang_3d_on', 'style': 'padding-left: 6px;'}, img);

    var fn = function(e) {
        var elm = AJS.getEventElm(e);
        if(AJS.nodeName(elm) == 'img')
            elm = elm.parentNode;
        if(elm.className == "googie_lang_3d_click") {
            elm.className = "googie_lang_3d_on";
            this.hideLangWindow();
        }
        else {
            elm.className = "googie_lang_3d_click";
            this.showLangWindow(switch_lan);
        }
    }

    AJS.AEV(switch_lan, "click", AJS.$b(fn, this));
    return switch_lan;
}

GoogieSpell.prototype.createSpellDiv = function() {
    var chk_spell = AJS.SPAN({'class': 'googie_check_spelling_link'});

    chk_spell.innerHTML = this.lang_chck_spell;
    var spell_img = null;
    if(this.show_spell_img)
        spell_img = AJS.IMG({'src': this.img_dir + "../img/spellc.gif"});
    return AJS.SPAN(spell_img, " ", chk_spell);
}


//////
// State functions
/////
GoogieSpell.prototype.flashNoSpellingErrorState = function(on_finish) {
    var no_spell_errors;

    if(on_finish) {
        var fn = function() {
            on_finish();
            this.checkSpellingState();
        };
        no_spell_errors = fn;
    }
    else
        no_spell_errors = this.checkSpellingState;

    this.setStateChanged("no_error_found");

    if(this.main_controller) {
        AJS.hideElement(this.switch_lan_pic);

        var dummy = AJS.IMG({'src': this.img_dir + "../img/blank.gif", 'style': 'height: 16px; width: 1px;'});
        var rsm = AJS.SPAN();
        rsm.innerHTML = this.lang_no_error_found;

        AJS.RCN(this.spell_span, AJS.SPAN(dummy, rsm));

        this.spell_span.className = "googie_check_spelling_ok";
        this.spell_span.style.textDecoration = "none";
        this.spell_span.style.cursor = "default";

        AJS.callLater(AJS.$b(no_spell_errors, this), 1200, [false]);
    }
}

GoogieSpell.prototype.resumeEditingState = function() {
    this.setStateChanged("resume_editing");

    //Change link text to resume
    if(this.main_controller) {
        AJS.hideElement(this.switch_lan_pic);
        var dummy = AJS.IMG({'src': this.img_dir + "blank.gif", 'style': 'height: 16px; width: 1px;'});
        var rsm = AJS.SPAN();
        rsm.innerHTML = this.lang_rsm_edt;
        AJS.RCN(this.spell_span, AJS.SPAN(dummy, rsm));
   
        var fn = function(e) {
            this.resumeEditing();
        }
        this.spell_span.onclick = AJS.$b(fn, this);

        this.spell_span.className = "googie_resume_editing";
    }

    try { this.edit_layer.scrollTop = this.ta_scroll_top; }
    catch(e) { }
}

GoogieSpell.prototype.checkSpellingState = function(fire) {
    if(!AJS.isDefined(fire) || fire)
        this.setStateChanged("spell_check");

    if(this.show_change_lang_pic)
        this.switch_lan_pic = this.createChangeLangPic();
    else
        this.switch_lan_pic = AJS.SPAN();

    var span_chck = this.createSpellDiv();
    var fn = function() {
        this.spellCheck();
    };

    if(this.custom_spellcheck_starter)
        span_chck.onclick = this.custom_spellcheck_starter;
    else {
        span_chck.onclick = AJS.$b(fn, this);
    }

    this.spell_span = span_chck;
    if(this.main_controller) {
        if(this.change_lang_pic_placement == "left")
            AJS.RCN(this.spell_container, span_chck, " ", this.switch_lan_pic);
        else
            AJS.RCN(this.spell_container, this.switch_lan_pic, " ", span_chck);
    }
}


//////
// Misc. functions
/////
GoogieSpell.item_onmouseover = function(e) {
    var elm = AJS.getEventElm(e);
    if(elm.className != "googie_list_revert" && elm.className != "googie_list_close")
        elm.className = "googie_list_onhover";
    else
        elm.parentNode.className = "googie_list_onhover";
}
GoogieSpell.item_onmouseout = function(e) {
    var elm = AJS.getEventElm(e);
    if(elm.className != "googie_list_revert" && elm.className != "googie_list_close")
        elm.className = "googie_list_onout";
    else
        elm.parentNode.className = "googie_list_onout";
}

GoogieSpell.prototype.createCloseButton = function(c_fn) {
    return this.createButton(this.lang_close, 'googie_list_close', AJS.$b(c_fn, this));
}

GoogieSpell.prototype.createButton = function(name, css_class, c_fn) {
    var btn_row = AJS.TR();
    var btn = AJS.TD();

    btn.onmouseover = GoogieSpell.item_onmouseover;
    btn.onmouseout = GoogieSpell.item_onmouseout;

    var spn_btn;
    if(css_class != "") {
        spn_btn = AJS.SPAN({'class': css_class});
        spn_btn.innerHTML = name;
    }
    else {
        spn_btn = AJS.TN(name);
    }
    btn.appendChild(spn_btn);
    AJS.AEV(btn, "click", c_fn);
    btn_row.appendChild(btn);

    return btn_row;
}

GoogieSpell.prototype.removeIndicator = function(elm) {
    try { AJS.removeElement(this.indicator); }
    catch(e) {}
}

GoogieSpell.prototype.appendIndicator = function(elm) {
    var img = AJS.IMG({'src': this.img_dir + '../img/indicator.gif', 'style': 'margin-right: 5px;'});
    AJS.setWidth(img, 16);
    AJS.setHeight(img, 16);
    this.indicator = img;
    img.style.textDecoration = "none";
    try {
        AJS.insertBefore(img, elm);
    }
    catch(e) {}
}

GoogieSpell.prototype.createFocusLink = function(name) {
    return AJS.A({'href': 'javascript:;', name: name});
}

Pages: 1 ... 11 12 13 14 [15] 16 17 18 19