topical media & game development

talk show tell print

student-twitter-admin-home.incl.php / php



          <script>
                  function addEmotion ( ) {
                          if ( newemotion = prompt( "What is the name of the new Emotion?", "" ) ) {
                                  window.location.href = "?sub=addEmotion&&newEmotion=" + newemotion.replace( " ", "_" );
                          }
                  }
                  
                  function removeEmotion ( name ) {
                          if ( confirm( "Are you sure you want to remove '" + name.replace( "_", " " ) + "'?" ) ) {
                                  window.location.href = "?sub=removeEmotion&&name=" + name;
                          }
                  }
                  
                  function renameEmotion ( name ) {
                          if ( newemotion = prompt( "What is the new name for the emotion?", name.replace( "_", " " ) ) ) {
                                  window.location.href = "?sub=renameEmotion&&name=" + name + "&&newName=" + newemotion.replace( " ", "_" );
                          }
                  }
          </script>
          <h1>Emotions</h1><br/>
  <?php if (isset( error )) { echo("<font color=\"red\">error</font><br><br>"); }  ?>
          <table border="0" width="100%" cellpadding="0">
  <?php
          results = getFromXML("../emotions.xml");
          echo("\t\t<tr>");
          echo("\t\t\t<td width=\"60px\">&nbsp;</td><td width=\"400px\">&nbsp;</td><td width=\"72px\"><img src=\"student-twitter-admin-images-empty.jpg\"><img src=\"images/empty.jpg\">");
          echo("<a href=\"javascript: addEmotion();\"><img src=\"student-twitter-admin-images-directory.jpg\" alt=\"Add Emotion\"></a>");
          echo("</td>");                
          echo("\t\t</tr>");                
          foreach (results as result) {
                  name = result[0];
                  color = implode(result[1], ", ");
                  synonyms = implode(result[2], ", ");
                  
                  echo("\t\t<tr>");
                  echo("<td></td>");
                  echo("<td><b>name</b> - color (color) - synonyms [ synonyms ]</td>");
                  echo("<td width=\"66px\">");
                  echo("<a href=\"javascript: removeEmotion( 'name' );\"><img src=\"student-twitter-admin-images-bin.jpg\" alt=\"Remove Emotion\"></a>");
                  echo("<a href=\"javascript: renameEmotion( 'name' );\"><img src=\"student-twitter-admin-images-notepad.jpg\" alt=\"Change Name\"></a>");
                  echo("<a href=\"?pagina=edittext&&name=name\"><img src=\"student-twitter-admin-images-notepad.jpg\" alt=\"Edit\"></a>");
                  echo("</td>");
                  echo("</tr>\n");
          }
  ?>
          </table>
  


(C) Æliens 20/2/2008

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.