Bestimme Wörter in bestimmte Farbe anzeigen (wie bei aTTaX) *PHP

Dieses Thema im Forum "Webentwicklung" wurde erstellt von Pliskin, 8. August 2006 .

Status des Themas:
Es sind keine weiteren Antworten möglich.
  1. Diese Seite verwendet Cookies. Wenn du dich weiterhin auf dieser Seite aufhältst, akzeptierst du unseren Einsatz von Cookies. Weitere Informationen
  1. #1 8. August 2006
    Hi,
    weiß einer von euch wie dieser "bestimmter Wort, bestimme Farbe" effekt funktioniert? Ein beispiel sieht man auf der aTTaX HP.
    Damit ist gemeint:

    wenn ich zb. HAHA schreib, dass das dann zb. rot ist? ka ib die Newsleute von aTTaX das immer selber machen.


    Das wollte ich jetzt auch auf meiner HP so machen. Wenns von alleine geht ^^




    10er ist drin.



    MfG: Pliskin
     

  2. Anzeige
  3. #2 8. August 2006
    str_replace
    haha durch <font color="red">haha</font>
    ersetzen lassen,
    zb ;)
     
  4. #3 8. August 2006
    oder verwende bbcodes, falls du besonders halt etwas farblich hervorheben willst^^

    kann ja sein, dass es noch nich vorhanden war (im script) und schon gehts sozusagen nur mit bcode oder html^^

    also benutz einfach BBCodes ;)


    mfg

    cydoc


    ps: google -> PHP BBCodes
     
  5. #4 8. August 2006
    achja - hab vergessen das ich darin ein absoluter noob bin :) könnt ihr vllt schritt für schritt erklären wie es funktioniert? habt aber schon ne 10 bekommen :)
     
  6. #5 9. August 2006
    //edit: noch mit erklärungen^^

    PHP:
    <? php

    $string 
    'Blubb das ist ein Text!. HAHA!' // string definieren

    $string_out  str_replace ( 'HAHA' '<font color="#FF0000">HAHA</font>' $string );  // mit str_replace das HAHA ersetzen

    echo  $string_out // ersetzter string ausgeben

    ?>
    und hier noch mit eingabefeld ...

    PHP:
    <? php

    if(isset( $_POST [ 'Submit' ]))  // checken ob das formular abgeschickt wurde
    {
        if(empty(
    $_POST [ 'Text' ]))  // ist das textfeld leer?
        
    {
            echo 
    'Bitte f&uuml;lle das Feld aus!' // wenn ja das hier ausgeben
        
    }
        else 
    // ansonsten
        
    {
            
    $text  $_POST [ 'Text' ];
            
    $text_out  str_replace ( 'HAHA' '<font color="#FF0000">HAHA</font>' $text );  // eingegebener text wie oben ersetzen
            
    echo  'Dein Text war:<br />' . $text_out // den Text ausgeben
        
    }
    }
    else 
    // nicht abgeschickt
    {
        echo 
    '
            <form name="form" method="post" action="'
    . $_SERVER [ 'PHP_SELF' ]. '"> // formular wird an sich selbst abgeschickt
            <textarea name="Text"></textarea><br /> // textfeld einfügen
            <input type="submit" name="Submit" value="Abschicken" />'
    // submit button
    }

    ?>
     
  7. #6 9. August 2006
    oO also, das muss ICH nu überarbeiten, kopieren und dann wo einfügen?
     
  8. #7 9. August 2006
    kp was willst du denn durchforsten lassen? ne hp, n post oder was?

    //edit:
    also bei ner hp sieht das so aus:
    Code:
    <html>
    <head>
    <title>blubb das ist meine page</title>
    </head>
    <body>
    blablabla willkommen bla HAHA
    </body>
    </html>
    
    da wo der text ist also zwischen <body> und </body> machst du folgendes:
    Code:
    ...
    <body>
    <?php
    
    $string = '
    
    blablabla willkommen bla HAHA // dein seiteninhalt kommt hier rein
    
    '; 
    
    $string_out = str_replace('HAHA', '<font color="#FF0000">HAHA</font>', $string); // mit str_replace das HAHA ersetzen
    
    echo $string_out; // ersetzter string ausgeben
    
    ?>
    </body>
    ...
    
    //edit2: WICHTIG!! natürlich als .php abspeichern !! und der webspace muss natürlich php unterstützen^^

    //edit3: :D bei mehreren ersetzungen am besten als array!
    Code:
    <?php
    $search = array('HAHA', 'blubb', 'dummdidu', 'bla'); // hier halt die zu suchenden wörter rein
    $replace = array('<font color="#FF0000">HAHA</font>', '<font color="#FF0000">blubb</font>', '<font color="#FF0000">dummdidu</font>', '<font color="#FF0000">bla</font>'); // und hier das durch was es ersetzt werden soll
    
    $string = '
    
    blablabla willkommen bla HAHA // dein seiteninhalt kommt hier rein
    
    '; 
    
    $string_out = str_replace($search, $replace, $string); // mit str_replace das HAHA ersetzen
    
    echo $string_out; // ersetzter string ausgeben
    
    ?>
    
    oder gib einfach den code der seite ^^ wenns zu komliziert ist
     
  9. #8 9. August 2006
    :O hab ka xDD ich hab meine index.php ma mit notepad geöffnet. hier ist der inhalt (muss das zeugs eigentlich in index.php ? hab nen free template):


    Code:
    <?php
    include("_mysql.php");
    include("_settings.php");
    include("_functions.php");
    ?>
    <html>
    <head>
    <title><? echo PAGETITLE; ?></title>
    <link href="_stylesheet.css" rel="stylesheet" type="text/css">
    <script src="js/bbcode.js" language="jscript" type="text/javascript"></script>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><style type="text/css">
    <!--
    body {
     background-color: #242323;
    }
    -->
    </style>
    <script language="JavaScript" type="text/JavaScript">
    <!--
    function MM_preloadImages() { //v3.0
     var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
     var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
     if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
    }
    
    function MM_swapImgRestore() { //v3.0
     var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
    }
    
    function MM_findObj(n, d) { //v4.01
     var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
     d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
     if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
     for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
     if(!x && d.getElementById) x=d.getElementById(n); return x;
    }
    
    function MM_swapImage() { //v3.0
     var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
     if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
    }
    //-->
    </script>
    </head><body onLoad="MM_preloadImages('img/navi/2news_ro.gif','img/navi/3ro.gif','img/navi/4ro.gif','img/navi/5ro.gif','img/navi/7ro.gif','img/navi/clanwars_ro.gif','img/navi/9ro.gif','img/navi/10ro.gif','img/navi/11ro.gif','img/navi/12ro.gif','img/navi/13ro.gif','img/navi/14ro.gif','img/navi/16ro.gif','img/navi/17ro.gif','img/navi/19ro.gif','img/navi/20ro.gif','img/navi/21ro.gif','img/navi/22ro.gif','img/navi/24ro.gif','img/navi/25eo.gif','img/navi/26ro.gif','img/navi/27ro.gif','img/navi/28ro.gif','img/navi/29ro.gif','img/navi/18ro.gif')">
    <table width="900" border="0" align="center" cellpadding="0" cellspacing="0">
     <tr>
     <td width="900" align="left" valign="top"><table width="900" border="0" cellspacing="0" cellpadding="0">
     <tr>
     <td width="900" height="14" align="left" valign="top" background="img/header_1.gif"></td>
     </tr>
     <tr>
     <td width="900" height="146" align="left" valign="top" background="img/header2.jpg"></td>
     </tr>
     <tr>
     <td width="900" height="20" align="left" valign="middle" background="img/laufnews.gif"><?
     include("sc_scrolltext.php");
     ?>
     <table width="900" height="52" border="0" cellpadding="0" cellspacing="0" dwcopytype="CopyTableRow">
     <tr>
     <td width="900" height="52" align="left" valign="top" background="img/footback.jpg"><a href="http://212.204.214.69:9000/listen.pls"><img src="img/pureDJspon.jpg" alt="www.pureDJ.com" width="114" height="40" border="0" usemap="#MapMap"></a><a href="http://www.alternate-attax.de/"><img src="img/aTTaX.jpg" alt="ALTERNATE aTTaX" width="114" height="40" border="0" usemap="#MapMapMap"></a><img src="img/spon.jpg" alt="Sponsor 3" width="114" height="40" border="0" usemap="#MapMapMap2"><img src="img/spon.jpg" alt="Sponsor 4" width="114" height="40" border="0" usemap="#MapMapMap3"><img src="img/spon.jpg" alt="Sponsor 5" width="114" height="40" border="0" usemap="#MapMapMap4"><img src="img/spon.jpg" alt="Sponsor 6" width="114" height="40" border="0" usemap="#MapMapMap5"><img src="img/spon.jpg" alt="Sponsor 7" width="114" height="40" border="0" usemap="#MapMapMap6"><img src="img/spon.jpg" alt="Sponsor 8" width="100" height="40" border="0" usemap="#MapMapMap7">
     <map name="MapMapMap7">
     <area shape="rect" coords="97,4,104,19" href="http://www.clan-designs.com/" target="_self" alt="Multi.Pix">
     </map>
     <map name="MapMapMap6">
     <area shape="rect" coords="129,4,139,19" href="http://www.clan-designs.com/" target="_self" alt="Multi.Pix">
     </map>
     <map name="MapMapMap5">
     <area shape="rect" coords="129,4,139,19" href="http://www.clan-designs.com/" target="_self" alt="Multi.Pix">
     </map>
     <map name="MapMapMap4">
     <area shape="rect" coords="129,4,139,19" href="http://www.clan-designs.com/" target="_self" alt="Multi.Pix">
     </map>
     <map name="MapMapMap3">
     <area shape="rect" coords="129,4,139,19" href="http://www.clan-designs.com/" target="_self" alt="Multi.Pix">
     </map>
     <map name="MapMapMap2">
     <area shape="rect" coords="129,4,139,19" href="http://www.clan-designs.com/" target="_self" alt="Multi.Pix">
     </map>
     <map name="MapMapMap">
     <area shape="rect" coords="129,4,139,19" href="http://www.clan-designs.com/" target="_self" alt="Multi.Pix">
     </map></td>
     </tr>
     </table>
     <map name="MapMap">
     <area shape="rect" coords="129,4,139,19" href="http://www.clan-designs.com/" target="_self" alt="Multi.Pix">
     </map> &nbsp;</td>
     </tr>
     </table> 
     <table width="900" border="0" cellspacing="0" cellpadding="0">
     <tr>
     <td width="180" align="left" valign="top" background="img/navi/left_menue_bg.gif"><table width="180" border="0" cellspacing="0" cellpadding="0">
     <tr>
     <td width="180" height="20" align="left" valign="top" background="img/navi/1navi_main.gif"></td>
     </tr>
     <tr>
     <td width="180" height="19" align="left" valign="top"><a href="index.php?site=news" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image2','','img/navi/2news_ro.gif',1)"><img src="img/navi/2news.gif" name="Image2" width="180" height="19" border="0"></a></td>
     </tr>
     <tr>
     <td width="180" height="19" align="left" valign="top"><a href="index.php?site=news&action=archive" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image4','','img/navi/3ro.gif',1)"><img src="img/navi/3nerwsarchiv.gif" name="Image4" width="180" height="19" border="0"></a></td>
     </tr>
     <tr>
     <td width="180" height="19" align="left" valign="top"><a href="index.php?site=articles" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image7','','img/navi/4ro.gif',1)"><img src="img/navi/4articles.gif" alt="a" name="Image7" width="180" height="19" border="0"></a></td>
     </tr>
     <tr>
     <td width="180" height="19" align="left" valign="top"><a href="index.php?site=calendar" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image6','','img/navi/5ro.gif',1)"><img src="img/navi/5calendar.gif" name="Image6" width="180" height="19" border="0"></a></td>
     </tr>
     <tr>
     <td width="180" height="20" align="left" valign="top" background="img/navi/6naviclan.gif"></td>
     </tr>
     <tr>
     <td width="180" height="19" align="left" valign="top"><a href="index.php?site=members" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image8','','img/navi/7ro.gif',1)"><img src="img/navi/7members.gif" name="Image8" width="180" height="19" border="0"></a></td>
     </tr>
     <tr>
     <td width="180" height="19" align="left" valign="top"><a href="index.php?site=clanwars" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image16','','img/navi/clanwars_ro.gif',1)"><img src="img/navi/8clanwars.gif" name="Image16" width="180" height="19" border="0"></a></td>
     </tr>
     <tr>
     <td width="180" height="19" align="left" valign="top"><a href="index.php?site=about" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image10','','img/navi/9ro.gif',1)"><img src="img/navi/9aboutus.gif" name="Image10" width="180" height="19" border="0"></a></td>
     </tr>
     <tr>
     <td width="180" height="19" align="left" valign="top"><a href="index.php?site=awards" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image11','','img/navi/10ro.gif',1)"><img src="img/navi/10awards.gif" name="Image11" width="180" height="19" border="0"></a></td>
     </tr>
     <tr>
     <td width="180" height="19" align="left" valign="top"><a href="index.php?site=sponsors" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image12','','img/navi/11ro.gif',1)"><img src="img/navi/11sponsors.gif" name="Image12" width="180" height="19" border="0"></a></td>
     </tr>
     <tr>
     <td width="180" height="19" align="left" valign="top"><a href="index.php?site=history" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image13','','img/navi/12ro.gif',1)"><img src="img/navi/12history.gif" name="Image13" width="180" height="19" border="0"></a></td>
     </tr>
     <tr>
     <td width="180" height="19" align="left" valign="top"><a href="index.php?site=joinus" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image14','','img/navi/13ro.gif',1)"><img src="img/navi/13joinus.gif" name="Image14" width="180" height="19" border="0"></a></td>
     </tr>
     <tr>
     <td width="180" height="19" align="left" valign="top"><a href="index.php?site=challenge" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image15','','img/navi/14ro.gif',1)"><img src="img/navi/14fightus.gif" name="Image15" width="180" height="19" border="0"></a></td>
     </tr>
     <tr>
     <td width="180" height="20" align="left" valign="top" background="img/navi/15navi_com.gif"></td>
     </tr>
     <tr>
     <td width="180" height="19" align="left" valign="top"><a href="index.php?site=forum" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image17','','img/navi/16ro.gif',1)"><img src="img/navi/16forum.gif" name="Image17" width="180" height="19" border="0"></a></td>
     </tr>
     <tr>
     <td width="180" height="19" align="left" valign="top"><a href="index.php?site=guestbook" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image18','','img/navi/17ro.gif',1)"><img src="img/navi/17guestbook.gif" name="Image18" width="180" height="19" border="0"></a></td>
     </tr>
     <tr>
     <td width="180" height="19" align="left" valign="top"><a href="index.php?site=newsletter" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image30','','img/navi/18ro.gif',1)"><img src="img/navi/18newsletter.gif" name="Image30" width="180" height="19" border="0"></a></td>
     </tr>
     <tr>
     <td width="180" height="19" align="left" valign="top"><a href="index.php?site=awards" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image20','','img/navi/19ro.gif',1)"><img src="img/navi/19awards.gif" name="Image20" width="180" height="19" border="0"></a></td>
     </tr>
     <tr>
     <td width="180" height="19" align="left" valign="top"><a href="index.php?site=whoisonline" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image21','','img/navi/20ro.gif',1)"><img src="img/navi/20whoson.gif" name="Image21" width="180" height="19" border="0"></a></td>
     </tr>
     <tr>
     <td width="180" height="19" align="left" valign="top"><a href="index.php?site=contact" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image22','','img/navi/21ro.gif',1)"><img src="img/navi/21contact.gif" name="Image22" width="180" height="19" border="0"></a></td>
     </tr>
     <tr>
     <td width="180" height="19" align="left" valign="top"><a href="index.php?site=imprint" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image23','','img/navi/22ro.gif',1)"><img src="img/navi/22imprint.gif" name="Image23" width="180" height="19" border="0"></a></td>
     </tr>
     <tr>
     <td width="180" height="20" align="left" valign="top" background="img/navi/navi_meida.gif">&nbsp;</td>
     </tr>
     <tr>
     <td width="180" height="19" align="left" valign="top"><a href="index.php?site=files" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image24','','img/navi/24ro.gif',1)"><img src="img/navi/24files.gif" name="Image24" width="180" height="19" border="0"></a></td>
     </tr>
     <tr>
     <td width="180" height="19" align="left" valign="top"><a href="index.php?site=gallery" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image25','','img/navi/25eo.gif',1)"><img src="img/navi/25gallery.gif" name="Image25" width="180" height="19" border="0"></a></td>
     </tr>
     <tr>
     <td width="180" height="19" align="left" valign="top"><a href="index.php?site=demos" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image26','','img/navi/26ro.gif',1)"><img src="img/navi/26demos.gif" name="Image26" width="180" height="19" border="0"></a></td>
     </tr>
     <tr>
     <td width="180" height="19" align="left" valign="top"><a href="index.php?site=server" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image27','','img/navi/27ro.gif',1)"><img src="img/navi/27srvers.gif" name="Image27" width="180" height="19" border="0"></a></td>
     </tr>
     <tr>
     <td width="180" height="19" align="left" valign="top"><a href="index.php?site=links" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image28','','img/navi/28ro.gif',1)"><img src="img/navi/28links.gif" name="Image28" width="180" height="19" border="0"></a></td>
     </tr>
     <tr>
     <td width="180" height="19" align="left" valign="top"><a href="index.php?site=linkus" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image29','','img/navi/29ro.gif',1)"><img src="img/navi/29linkus.gif" name="Image29" width="180" height="19" border="0"></a></td>
     </tr>
     <tr>
     <td width="180" height="20" align="left" valign="top" background="img/navi/30partners.gif"></td>
     </tr>
     <tr>
     <td width="180" align="left" valign="top" background="img/navi/left_menue_bg.gif"><div align="center">
     <p>
     <?
     include("partners.php");
     ?>
     </p>
     </div></td>
     </tr>
     </table></td>
     <td width="540" align="left" valign="top" background="img/content_filler.gif"><table width="540" border="0" cellspacing="0" cellpadding="0">
     <tr align="left" valign="top" background="img/advertismenttop.gif">
     <td height="20" colspan="3"><img src="img/advertismenttop.gif" width="540" height="20"></td>
     </tr>
     <tr align="left" valign="top">
     <td width="36" height="60" background="img/leftadbg.gif"></td>
     <td width="468" height="60" valign="middle" background="img/ad.gif"><div align="center"><?
     include("sc_bannerrotation.php");
     ?></div></td>
     <td width="36" height="60" background="img/adbgrifght.gif">&nbsp;</td>
     </tr>
     </table>
     <table width="540" border="0" cellspacing="0" cellpadding="0">
     <tr align="left" valign="top" background="img/last_top.gif">
     <td height="23" colspan="3"><p><img src="img/last_top.gif" width="540" height="23"></p> </td>
     </tr>
     <tr align="left" valign="top">
     <td width="179" background="img/lala1.gif"><table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
     <tr>
     <td><? include("sc_headlines.php"); ?></td>
     </tr>
     </table> </td>
     <td width="182" background="img/lala2.gif"><table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
     <tr>
     <td><? include("sc_results.php"); ?></td>
     </tr>
     </table></td>
     <td width="179" background="img/lala3.gif"><table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
     <tr>
     <td><? include("sc_articles.php"); ?></td>
     </tr>
     </table></td>
     </tr>
     </table>
     <table width="540" border="0" cellspacing="0" cellpadding="0">
     <tr>
     <td width="540" height="21" align="left" valign="top" background="img/content_top.gif"></td>
     </tr>
     <tr>
     <td width="540" height="21" align="left" valign="top" background="img/content_filler.gif"><?
     if(!isset($site)) $site="news";
     //Sichheitsl&uuml;cke beheben
     $invalide = array('/','/\/',':','.');
     $site = str_replace($invalide,' ',$site);
     if(!file_exists($site.".php")) $site = "news";
     include($site.".php");
     ?></td>
     </tr>
     </table></td>
     <td align="left" valign="top" background="img/right/bg.gif"><table width="180" border="0" cellspacing="0" cellpadding="0">
     <tr>
     <td width="180" height="20" align="left" valign="top" background="img/right/login.gif"></td>
     </tr>
     <tr>
     <td width="180" align="left" valign="top" background="img/right/bg.gif"><table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
     <tr>
     <td><? include("login.php"); ?>&nbsp;</td>
     </tr>
     </table></td>
     </tr>
     <tr>
     <td width="180" height="20" align="left" valign="top" background="img/right/vote.gif"></td>
     </tr>
     <tr>
     <td width="180" align="left" valign="top" background="img/right/bg.gif"><table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
     <tr>
     <td><? include("poll.php"); ?>&nbsp;</td>
     </tr>
     </table></td>
     </tr>
     <tr>
     <td width="180" height="20" align="left" valign="top" background="img/right/topics.gif"></td>
     </tr>
     <tr>
     <td width="180" align="left" valign="top" background="img/right/bg.gif"><table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
     <tr>
     <td><? include("latesttopics.php"); ?>&nbsp;</td>
     </tr>
     </table></td>
     </tr>
     <tr>
     <td width="180" height="20" align="left" valign="top" background="img/right/stats.gif"></td>
     </tr>
     <tr>
     <td width="180" align="left" valign="top" background="img/right/bg.gif"><table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
     <tr>
     <td><? include("counter.php"); ?>&nbsp;</td>
     </tr>
     </table></td>
     </tr>
     </table></td>
     </tr>
     </table> 
     <table width="900" height="20" border="0" cellpadding="0" cellspacing="0">
     <tr>
     <td width="900" height="20" align="left" valign="top" background="img/footer.gif"><img src="img/footer.gif" alt="Multi.Pix" width="900" height="20" border="0" usemap="#Map"></td>
     </tr>
     </table> </td>
     </tr>
    </table>
    <map name="Map">
     <area shape="rect" coords="173,4,238,16" href="http://www.machgfx.gr-tr.de">
     <area shape="rect" coords="666,4,728,19" href="http://www.clan-designs.com/" target="_self" alt="Multi.Pix">
    </map>
    
    

    kannst du den da reinklatschen? am besten mit zeilen, damit ich seh wo ich was reinkrakeln muss :D
    bsp.:




    sdfsdsdfsdsdfsdfsdf


    scipt oder was auch immer

    asdasdasd rfs ferged
     
  10. #9 9. August 2006
    wenn du das nur in news automatisch ersetzen lassen willst ist es einfacher! da musst du nur in der datei was ändern, die die news speichert ... oder in der, die sie ausgibt vllt postest du die grad mal ... also bei dir müsste das die news.php sein, so wie ich das gesehn hab
     
  11. #10 10. August 2006
    jop, ist natürlich da ;)

    hier ist "news.php":


    Code:
    <?php
    /*
     ########################################################################
    # #
    # Version 4 / / / #
    # -----------__---/__---__------__----__---/---/- #
    # | /| / /___) / ) (_ ` / ) /___) / / #
    # _|/_|/__(___ _(___/_(__)___/___/_(___ _/___/___ #
    # Free Content / Management System #
    # / #
    # #
    # #
    # Copyright 2005-2006 by webspell.org / webspell.info #
    # #
    # visit webSPELL.org, webspell.info to get webSPELL for free #
    # - Script runs under the GNU GENERAL PUBLIC LICENCE #
    # - It's NOT allowed to remove this copyright-tag #
    # -- http://www.fsf.org/licensing/licenses/gpl.html #
    # #
    # Code based on WebSPELL Clanpackage (Michael Gruber - webspell.at), #
    # Far Development by Development Team - webspell.org / webspell.info #
    # #
    # visit webspell.org / webspell.info #
    # #
     ########################################################################
    */
    
    $action = $_GET['action'];
    if($action=="new") {
     include("_mysql.php");
     include("_settings.php");
     include("_functions.php");
     if(!isnewsadmin($userID)) die('No access.');
    
     echo '<html><head>';
     echo'<script src="js/bbcode.js" language="jscript" type="text/javascript"></script>
     <link href="_stylesheet.css" rel="stylesheet" type="text/css"></head><body>';
     
     if(isnewsadmin($userID)) {
     safe_query("DELETE FROM ".PREFIX."news WHERE headline1='' AND lang1='' AND lang2='' AND headline2=''"); 
     safe_query("INSERT INTO ".PREFIX."news (date, poster, saved) VALUES ('".time()."', '$userID', '0')");
     $newsID=mysql_insert_id();
     
     $newsrubrics=safe_query("SELECT rubricID, rubric FROM ".PREFIX."news_rubrics ORDER BY rubric");
     while($dr=mysql_fetch_array($newsrubrics)) {
     $rubrics.='<option value="'.$dr[rubricID].'">'.$dr[rubric].'</option>';
     }
     
     if($_POST['topnews']) safe_query("UPDATE ".PREFIX."settings SET topnewsID='$newsID'");
    
     $lang=safe_query("SELECT lang, language FROM ".PREFIX."news_languages ORDER BY language");
     while($dl=mysql_fetch_array($lang)) {
     if($dl[lang]=="de") $langs1.='<option value="'.$dl[lang].'" selected>'.$dl[language].'</option>';
     else $langs1.='<option value="'.$dl[lang].'">'.$dl[language].'</option>';
     
     if($dl[lang]=="uk") $langs2.='<option value="'.$dl[lang].'" selected>'.$dl[language].'</option>';
     else $langs2.='<option value="'.$dl[lang].'">'.$dl[language].'</option>';
     }
     $url1="http://";
     $url2="http://";
     $url3="http://";
     $url4="http://";
     
     $bg1=BG_1;
     eval ("\$addbbcode = \"".gettemplate("addbbcode")."\";");
     eval ("\$addflags = \"".gettemplate("flags")."\";");
     
     eval ("\$news_post = \"".gettemplate("news_post")."\";");
     echo $news_post; 
     }
     else redirect('index.php?site=news', 'no access!');
    }
    elseif($action=="save") {
     include("_mysql.php");
     include("_settings.php");
     include("_functions.php");
     if(!isnewsadmin($userID)) die('No access.');
    
     $newsID = $_POST['newsID'];
     $save = $_POST['save'];
     $preview = $_POST['preview'];
     
     $rubric = $_POST['rubric'];
    
     $lang1 = $_POST['lang1'];
     $headline1 = $_POST['headline1'];
     $message = $_POST['message'];
    
     $lang2 = $_POST['lang2'];
     $headline2 = $_POST['headline2'];
     $content2 = $_POST['content2'];
    
     $link1 = $_POST['link1'];
     $url1 = $_POST['url1'];
     $window1 = $_POST['window1'];
    
     $link2 = $_POST['link2'];
     $url2 = $_POST['url2'];
     $window2 = $_POST['window2'];
    
     $link3 = $_POST['link3'];
     $url3 = $_POST['url3'];
     $window3 = $_POST['window3'];
    
     $link4 = $_POST['link4'];
     $url4 = $_POST['url4'];
     $window4 = $_POST['window4'];
     
     $intern = $_POST['intern'];
     $comments = $_POST['comments'];
     
     safe_query("UPDATE ".PREFIX."news SET rubric='$rubric',
     lang1='$lang1',
     headline1='".mysql_escape_string($headline1)."',
     content1='".mysql_escape_string($message)."',
     lang2='$lang2',
     headline2='".mysql_escape_string($headline2)."',
     content2='".mysql_escape_string($content2)."',
     link1='$link1',
     url1='$url1',
     window1='$window1',
     link2='$link2',
     url2='$url2',
     window2='$window2',
     link3='$link3',
     url3='$url3',
     window3='$window3',
     link4='$link4',
     url4='$url4',
     window4='$window4',
     saved='1',
     intern='$intern',
     comments='$comments' WHERE newsID='$newsID'");
     
     // löschen der einträge die älter als 1 stunde sind und keinen text enthalten
     $ergebnis=safe_query("SELECT * FROM ".PREFIX."news WHERE headline1='' OR content1=''");
     while($ds=mysql_fetch_array($ergebnis)) {
     if((time()-$ds[date]) > (60*60)) safe_query("DELETE FROM ".PREFIX."news WHERE newsID='$ds[newsID]'");
     }
     
     
     if($_POST['topnews']) safe_query("UPDATE ".PREFIX."settings SET topnewsID='$newsID'");
    
     if($save) echo'<body onLoad="window.close()"></body>';
     if($preview) header("Location: news.php?action=preview&newsID=$newsID");
     
     
    }
    elseif($action=="preview") {
     include("_mysql.php");
     include("_settings.php");
     include("_functions.php");
     if(!isnewsadmin($userID)) die('No access.');
    
    
     $newsID = $_GET['newsID'];
    
     echo'<script src="js/bbcode.js" language="jscript" type="text/javascript"></script>
     <link href="_stylesheet.css" rel="stylesheet" type="text/css">';
    
     $bg1=BG_1;
     
     eval ("\$title_news = \"".gettemplate("title_news")."\";");
     echo $title_news;
    
     $result=safe_query("SELECT * FROM ".PREFIX."news WHERE newsID='$newsID'");
     $ds=mysql_fetch_array($result);
     $bgcolor=BG_1;
     $date = date("d.m.Y", $ds[date]);
     $time = date("H:i", $ds[date]);
     $rubrikname=getrubricname($ds[rubric]);
     $rubricpic='<img src="images/news-rubrics/'.getrubricpic($ds[rubric]).'">';
     if(!file_exists($rubricpic)) $rubricpic = '';
     
     $lang=$ds[lang1];
     $language1="[flag]".$ds[lang1]."[/flag]";
     $language2="[flag]".$ds[lang2]."[/flag]";
     
     if($lang==$ds[lang1]) {
     if($ds[headline1]) $headline = $ds[headline1];
     else $headline = $ds[headline2];
     
     if($ds[content1]) $content = $ds[content1];
     else $content='[b]no version in selected language available![/b].[br][br]'.$ds[content2];
     
     $langs='';
     if($ds[headline2]) {
     $langs='<a href="news.php?action=preview&newsID='.$ds[newsID].'&lang='.$ds[lang2].'">'.flags($language2).'</a>';
     $language=getlanguage($ds[lang2]);
     $langs = eregi_replace ('(alt=")(.*)(")',"\\1 news in $language\\3",$langs);
     } 
     }
     else {
     if($ds[headline2]) $headline = $ds[headline2];
     else $headline = $ds[headline1];
     
     if($ds[content2]) $content = $ds[content2];
     else $content='[b]no version in selected language available![/b].[br][br]'.$ds[content1];
     
     $langs='';
     if($ds[headline1]) {
     $langs='<a href="news.php?action=preview&newsID='.$ds[newsID].'&lang='.$ds[lang1].'">'.flags($language1).'</a>';
     $language=getlanguage($ds[lang1]);
     $langs = eregi_replace ('(alt=")(.*)(")',"\\1 news in $language\\3",$langs);
     } 
     }
     
     $content = htmloutput($content);
     $content = toggle($content, $ds[newsID]);
     $poster='<a href="index.php?site=profile&id='.$ds[poster].'"><b>'.getnickname($ds[poster]).'</b></a>';
     if($ds[link1] && $ds[url1]!="http://" && $ds[window1]) $related.='" <a href="'.$ds[url1].'" target="_blank">'.$ds[link1].'</a> ';
     if($ds[link1] && $ds[url1]!="http://" && !$ds[window1]) $related.='" <a href="'.$ds[url1].'">'.$ds[link1].'</a> ';
     
     if($ds[link2] && $ds[url2]!="http://" && $ds[window2]) $related.='" <a href="'.$ds[url2].'" target="_blank">'.$ds[link2].'</a> ';
     if($ds[link2] && $ds[url2]!="http://" && !$ds[window2]) $related.='" <a href="'.$ds[url2].'">'.$ds[link2].'</a> ';
     
     if($ds[link3] && $ds[url3]!="http://" && $ds[window3]) $related.='" <a href="'.$ds[url3].'" target="_blank">'.$ds[link3].'</a> ';
     if($ds[link3] && $ds[url3]!="http://" && !$ds[window3]) $related.='" <a href="'.$ds[url3].'">'.$ds[link3].'</a> ';
     
     if($ds[link4] && $ds[url4]!="http://" && $ds[window4]) $related.='" <a href="'.$ds[url4].'" target="_blank">'.$ds[link4].'</a> ';
     if($ds[link4] && $ds[url4]!="http://" && !$ds[window4]) $related.='" <a href="'.$ds[url4].'">'.$ds[link4].'</a> ';
     
     eval ("\$news = \"".gettemplate("news")."\";");
     echo $news;
     
     echo'<hr noshade size="1" color="'.BORDER.'">
     <input type="button" class="button" onClick="MM_goToURL(\'parent\',\'news.php?action=edit&newsID='.$newsID.'\');return document.MM_returnValue" value="edit news"> 
     <input type="button" class="button" onClick="javascript:self.close()" value="save news"> 
     <input type="button" class="button" onClick="MM_confirm(\'really delete this entry?\', \'news.php?action=delete&id=$newsID&close=true\')" value="cancel">';
    }
    elseif($_POST['quickactiontype']=="publish" OR $_GET['quickactiontype']=="publish") {
     include("_mysql.php");
     include("_settings.php");
     include("_functions.php");
     if(!isnewsadmin($userID)) die('No access.');
    
     $newsID = $_POST['newsID'];
     
     if(is_array($newsID)) {
     foreach($newsID as $id) {
     safe_query("UPDATE ".PREFIX."news SET published='1' WHERE newsID='$id'");
     }
     }
     header("Location: index.php?site=news");
    }
    elseif($_POST['quickactiontype']=="unpublish" OR $_GET['quickactiontype']=="unpublish") {
     include("_mysql.php");
     include("_settings.php");
     include("_functions.php");
     if(!isnewsadmin($userID)) die('No access.');
    
     $newsID = $_POST['newsID'];
     if(!$newsID) $newsID[] = $_GET['newsID'];
     
     foreach($newsID as $id) {
     safe_query("UPDATE ".PREFIX."news SET published='0' WHERE newsID='$id'");
     }
     header("Location: index.php?site=news");
    }
    elseif($_POST['quickactiontype']=="delete") {
     include("_mysql.php");
     include("_settings.php");
     include("_functions.php");
     if(!isnewsadmin($userID)) die('No access.');
    
     $newsID = $_POST['newsID'];
     
     foreach($newsID as $id) {
     $ds=mysql_fetch_array(safe_query("SELECT screens FROM ".PREFIX."news WHERE newsID='$id'"));
     if($ds[screens]) {
     $screens=explode("|", $ds[screens]);
     if(is_array($screens)) {
     $filepath = "./images/news-pics/";
     foreach($screens as $screen) {
     if(file_exists($filepath.$screen)) @unlink($filepath.$screen);
     }
     }
     } 
     safe_query("DELETE FROM ".PREFIX."news WHERE newsID='$id'");
     safe_query("DELETE FROM ".PREFIX."comments WHERE parentID='$id' AND type='ne'");
     }
     header("Location: index.php?site=news");
    }
    elseif($action=="delete") {
     include("_mysql.php");
     include("_settings.php");
     include("_functions.php");
     if(!isnewsadmin($userID)) die('No access.');
    
     $id = $_GET['id'];
     
     $ds=mysql_fetch_array(safe_query("SELECT screens FROM ".PREFIX."news WHERE newsID='$id'"));
     if($ds[screens]) {
     $screens=explode("|", $ds[screens]);
     if(is_array($screens)) {
     $filepath = "./images/news-pics/";
     foreach($screens as $screen) {
     if(file_exists($filepath.$screen)) @unlink($filepath.$screen);
     }
     }
     }
     
     safe_query("DELETE FROM ".PREFIX."news WHERE newsID='$id'");
     safe_query("DELETE FROM ".PREFIX."comments WHERE parentID='$id' AND type='ne'");
    
     if($close) echo'<body onLoad="window.close()"></body>';
     else header("Location: index.php?site=news");
    }
    elseif($action=="edit") {
     include("_mysql.php");
     include("_settings.php");
     include("_functions.php");
     if(!isnewsadmin($userID)) die('No access.');
     
     $newsID = $_GET['newsID'];
    
     echo'<script src="js/bbcode.js" language="jscript" type="text/javascript"></script>
     <link href="_stylesheet.css" rel="stylesheet" type="text/css">';
     
     $ds=mysql_fetch_array(safe_query("SELECT * FROM ".PREFIX."news WHERE newsID='$newsID'"));
     $lang=safe_query("SELECT lang, language FROM ".PREFIX."news_languages ORDER BY language");
     while($dl=mysql_fetch_array($lang)) {
     if($dl[lang]==$ds[lang1]) $langs1.='<option value="'.$dl[lang].'" selected>'.$dl[language].'</option>';
     else $langs1.='<option value="'.$dl[lang].'">'.$dl[language].'</option>';
     
     if($dl[lang]==$ds[lang2]) $langs2.='<option value="'.$dl[lang].'" selected>'.$dl[language].'</option>';
     else $langs2.='<option value="'.$dl[lang].'">'.$dl[language].'</option>';
     }
     
     $headline1=getinput($ds[headline1]);
     $message=getinput($ds[content1]);
     $headline2=getinput($ds[headline2]);
     $content2=getinput($ds[content2]);
     
     $newsrubrics=safe_query("SELECT * FROM ".PREFIX."news_rubrics ORDER BY rubric");
     while($dr=mysql_fetch_array($newsrubrics)) {
     if($ds[rubric]==$dr[rubricID]) $rubrics.='<option value="'.$dr[rubricID].'" selected>'.$dr[rubric].'</option>';
     else $rubrics.='<option value="'.$dr[rubricID].'">'.$dr[rubric].'</option>';
     }
    
     if($ds[intern]) $intern = '<option value="0">No</option><option value="1" selected>Yes</option>';
     else $intern = '<option value="0" selected>No</option><option value="1">Yes</option>';
    
     $link1=$ds[link1];
     $link2=$ds[link2];
     $link3=$ds[link3];
     $link4=$ds[link4];
     
     $url1="http://";
     $url2="http://";
     $url3="http://";
     $url4="http://";
     
     if($ds[url1]!="http://") $url1=$ds[url1];
     if($ds[url2]!="http://") $url2=$ds[url2];
     if($ds[url3]!="http://") $url3=$ds[url3];
     if($ds[url4]!="http://") $url4=$ds[url4];
     
     if($ds[window1]) $window1='<input class="input" name="window1" type="radio" value="1" checked> new window <input class="input" type="radio" name="window1" value="0"> _self';
     else $window1='<input class="input" name="window1" type="radio" value="1"> new window <input class="input" type="radio" name="window1" value="0" checked> _self';
     
     if($ds[window2]) $window2='<input class="input" name="window2" type="radio" value="1" checked> new window <input class="input" type="radio" name="window2" value="0"> _self';
     else $window2='<input class="input" name="window2" type="radio" value="1"> new window <input class="input" type="radio" name="window2" value="0" checked> _self';
     
     if($ds[window3]) $window3='<input class="input" name="window3" type="radio" value="1" checked> new window <input class="input" type="radio" name="window3" value="0"> _self';
     else $window3='<input class="input" name="window3" type="radio" value="1"> new window <input class="input" type="radio" name="window3" value="0" checked> _self';
     
     if($ds[window4]) $window4='<input class="input" name="window4" type="radio" value="1" checked> new window <input class="input" type="radio" name="window4" value="0"> _self';
     else $window4='<input class="input" name="window4" type="radio" value="1"> new window <input class="input" type="radio" name="window4" value="0" checked> _self';
     
     if($ds[picalign]=="left") $align='<input class="input" type="radio" name="align" value="left" checked> left 
     <input class="input" type="radio" name="align" value="right"> right';
     else $align='<input class="input" type="radio" name="align" value="left"> left 
     <input class="input" type="radio" name="align" value="right" checked> right';
     
     $comments='<option value="0">disable comments</option><option value="1">enable user comments</option><option value="2">enable visitor comments</option>'; 
     $comments=str_replace('value="'.$ds[comments].'"', 'value="'.$ds[comments].'" selected', $comments);
     
     $bg1=BG_1;
     
     eval ("\$addbbcode = \"".gettemplate("addbbcode")."\";");
     eval ("\$addflags = \"".gettemplate("flags")."\";");
     
     eval ("\$news_edit = \"".gettemplate("news_edit")."\";");
     echo $news_edit;
    }
    elseif($action=="unpublished") {
     eval ("\$title_news = \"".gettemplate("title_news")."\";");
     echo $title_news;
    
     if(isnewsadmin($userID)) $post='<input type="button" class="button" onClick="MM_openBrWindow(\'news.php?action=new\',\'News\',\'toolbar=no,status=no,scrollbars=yes,width=800,height=600\')" value="post News">';
    
     echo $post.' <input type="button" class="button" onClick="MM_goToURL(\'parent\',\'index.php?site=news\');return document.MM_returnValue" value="show News"><hr noshade size="1" color="'.BORDER.'">';
     
     // Not published News
     if(isnewsadmin($userID)) {
     $ergebnis=safe_query("SELECT * FROM ".PREFIX."news WHERE published='0' AND saved='1' ORDER BY date ASC");
     if(mysql_num_rows($ergebnis)) {
     echo'<h2>NOT PUBLISHED NEWS:</h2>';
     
     echo'<form method="post" name="form" action="news.php">';
     eval ("\$news_archive_head = \"".gettemplate("news_archive_head")."\";");
     echo $news_archive_head; 
     
     $i=1;
     while($ds=mysql_fetch_array($ergebnis)) {
     if($i%2) {
     $bg1=BG_1;
     $bg2=BG_2;
     }
     else {
     $bg1=BG_3;
     $bg2=BG_4;
     }
     
     $date=date("d.m.Y", $ds[date]);
     $rubric=getrubricname($ds[rubric]);
     $language1="[flag]".$ds[lang1]."[/flag]";
     $language2="[flag]".$ds[lang2]."[/flag]";
     
     if($ds[headline1]) {
     $langs='<a href="index.php?site=news_comments&newsID='.$ds[newsID].'&lang='.$ds[lang1].'">'.flags($language1).'</a>';
     $language=getlanguage($ds[lang1]);
     $langs = eregi_replace ('(alt=")(.*)(")',"\\1 news in $language\\3",$langs);
     $headline='<a href="index.php?site=news_comments&newsID='.$ds[newsID].'&lang='.$ds[lang1].'">'.$ds[headline1].'</a>';
     } 
     if($ds[headline2]) {
     $lang2=' <a href="index.php?site=news_comments&newsID='.$ds[newsID].'&lang='.$ds[lang2].'">'.flags($language2).'</a>';
     $language=getlanguage($ds[lang2]);
     $lang2 = eregi_replace ('(alt=")(.*)(")',"\\1 news in $language\\3",$lang2);
     $langs.=$lang2;
     $headline.=' - <a href="index.php?site=news_comments&newsID='.$ds[newsID].'&lang='.$ds[lang2].'">'.$ds[headline2].'</a>';
     } 
    
     $poster='<a href="index.php?site=profile&id='.$ds[poster].'">'.getnickname($ds[poster]).'</a>';
    
     $multiple='';
     $admdel='';
     if(isnewsadmin($userID)) {
     $multiple='<input class="input" type="checkbox" name="newsID[]" value="'.$ds[newsID].'">';
     $admdel='<table width="100%" border="0" cellspacing="0" cellpadding="4">
     <tr>
     <td><input class="input" type="checkbox" name="ALL" value="ALL" onClick="SelectAll(this.form);"> select all</td>
     <td align="right"><select name="quickactiontype">
     <option value="publish">publish selected</option>
     <option value="delete">delete selected</option>
     </select> 
     <input type="submit" name="quickaction" value="go"></td>
     </tr>
     </table></form>';
    
     }
     eval ("\$news_archive_content = \"".gettemplate("news_archive_content")."\";");
     echo $news_archive_content;
     $i++;
     }
     eval ("\$news_archive_foot = \"".gettemplate("news_archive_foot")."\";");
     echo $news_archive_foot;
    
     unset($ds);
     }
     }
    }
    elseif($action=="archive") {
     eval ("\$title_news = \"".gettemplate("title_news")."\";");
     echo $title_news;
     
     $page=$_GET['page'];
     $sort=$_GET['sort'];
     $type=$_GET['type'];
     $post='';
     $publish='';
     if(isnewsadmin($userID)) {
     $post='<input type="button" class="button" onClick="MM_openBrWindow(\'news.php?action=new\',\'News\',\'toolbar=no,status=no,scrollbars=yes,width=800,height=600\')" value="post News">';
     $unpublished=safe_query("SELECT newsID FROM ".PREFIX."news WHERE published='0' AND saved='1'");
     $unpublished=mysql_num_rows($unpublished);
     if($unpublished) $publish='<input type="button" class="button" onClick="MM_goToURL(\'parent\',\'index.php?site=news&action=unpublished\');return document.MM_returnValue" value="'.$unpublished.' unpublished News"> ';
     }
     echo $post.' '.$publish.' <input type="button" class="button" onClick="MM_goToURL(\'parent\',\'index.php?site=news\');return document.MM_returnValue" value="show News"><hr noshade size="1" color="'.BORDER.'">';
     
     $all=safe_query("SELECT newsID FROM ".PREFIX."news WHERE published='1' AND intern<=".isclanmember($userID));
     $all=mysql_num_rows($all);
     $pages=1;
     if(!isset($page)) $page = 1;
     if(!isset($sort)) $sort = "date";
     if(!isset($type)) $type = "DESC";
     
     $max = empty($maxnewsarchiv) ? 20 : $maxnewsarchiv;
     
    
     for ($n=$max; $n<=$all; $n+=$max) {
     if($all>$n) $pages++;
     }
     
     if($pages>1) $page_link = makepagelink("index.php?site=news&action=archive&sort=$sort&type=$type", $page, $pages);
     
     if ($page == "1") {
     $ergebnis = safe_query("SELECT * FROM ".PREFIX."news WHERE published='1' AND intern<=".isclanmember($userID)." ORDER BY $sort $type LIMIT 0,$max");
     if($type=="DESC") $n=$gesamt;
     else $n=1;
     }
     else {
     $start=$page*$max-$max;
     $ergebnis = safe_query("SELECT * FROM ".PREFIX."news WHERE published='1' AND intern<=".isclanmember($userID)." ORDER BY $sort $type LIMIT $start,$max");
     if($type=="DESC") $n = ($gesamt)-$page*$max+$max;
     else $n = ($gesamt+1)-$page*$max+$max;
     }
     if($all) {
     if($type=="ASC") 
     echo'<a href="index.php?site=news&action=archive&page='.$page.'&sort='.$sort.'&type=DESC">Sort:</a> <img src="images/icons/asc.gif" width="9" height="7" border="0">&nbsp;&nbsp;&nbsp;';
     else 
     echo'<a href="index.php?site=news&action=archive&page='.$page.'&sort='.$sort.'&type=ASC">Sort:</a> <img src="images/icons/desc.gif" width="9" height="7" border="0">&nbsp;&nbsp;&nbsp;';
    
     
     if($pages>1) echo $page_link;
     if(isnewsadmin($userID)) echo'<form method="post" name="form" action="news.php">';
     eval ("\$news_archive_head = \"".gettemplate("news_archive_head")."\";");
     echo $news_archive_head;
     $i=1;
     while($ds=mysql_fetch_array($ergebnis)) {
     if($i%2) {
     $bg1=BG_1;
     $bg2=BG_2;
     }
     else {
     $bg1=BG_3;
     $bg2=BG_4;
     }
     
     $date=date("d.m.Y", $ds[date]);
     $rubric=getrubricname($ds[rubric]);
     $language1="[flag]".$ds[lang1]."[/flag]";
     $language2="[flag]".$ds[lang2]."[/flag]";
     
     $comms = getanzcomments($ds[newsID], 'ne');
     
     if($ds[headline1]) {
     $langs='<a href="index.php?site=news_comments&newsID='.$ds[newsID].'&lang='.$ds[lang1].'">'.flags($language1).'</a>';
     $language=getlanguage($ds[lang1]);
     $langs = eregi_replace ('(alt=")(.*)(")',"\\1 news in $language\\3",$langs);
     
     $headline='<a href="index.php?site=news_comments&newsID='.$ds[newsID].'&lang='.$ds[lang1].'"><b>'.getinput($ds[headline1]).'</b></a>';
     } 
     if($ds[headline2]) {
     $lang2=' <a href="index.php?site=news_comments&newsID='.$ds[newsID].'&lang='.$ds[lang2].'">'.flags($language2).'</a>';
     $language=getlanguage($ds[lang2]);
     $lang2 = eregi_replace ('(alt=")(.*)(")',"\\1 news in $language\\3",$lang2);
     $langs.=$lang2;
     
     $headline.=' - <a href="index.php?site=news_comments&newsID='.$ds[newsID].'&lang='.$ds[lang2].'"><b>'.getinput($ds[headline2]).'</b></a>';
     } 
    
     $poster='<a href="index.php?site=profile&id='.$ds[poster].'">'.getnickname($ds[poster]).'</a>';
     
     $multiple='';
     $admdel='';
     if(isnewsadmin($userID)) $multiple='<input class="input" type="checkbox" name="newsID[]" value="'.$ds[newsID].'">';
     
     eval ("\$news_archive_content = \"".gettemplate("news_archive_content")."\";");
     echo $news_archive_content;
     $i++;
     }
     if(isnewsadmin($userID)) $admdel='<table width="100%" border="0" cellspacing="0" cellpadding="4">
     <tr>
     <td><input class="input" type="checkbox" name="ALL" value="ALL" onClick="SelectAll(this.form);"> select all</td>
     <td align="right"><select name="quickactiontype">
     <option value="delete">delete selected</option>
     <option value="unpublish">unpublish selected</option>
     </select> 
     <input type="submit" name="quickaction" value="go"></td>
     </tr>
     </table></form>';
     
     eval ("\$news_archive_foot = \"".gettemplate("news_archive_foot")."\";");
     echo $news_archive_foot;
     unset($ds);
     
     }
     else echo'no entries';
    }
    else {
     eval ("\$title_news = \"".gettemplate("title_news")."\";");
     echo $title_news;
    
     $post='';
     $publish='';
     if(isnewsadmin($userID)) {
     $post='<input type="button" class="button" onClick="MM_openBrWindow(\'news.php?action=new\',\'News\',\'toolbar=no,status=no,scrollbars=yes,width=800,height=600\')" value="post News">';
     $unpublished=safe_query("SELECT newsID FROM ".PREFIX."news WHERE published='0' AND saved='1'");
     $unpublished=mysql_num_rows($unpublished);
     if($unpublished) $publish='<input type="button" class="button" onClick="MM_goToURL(\'parent\',\'index.php?site=news&action=unpublished\');return document.MM_returnValue" value="'.$unpublished.' unpublished News"> ';
     }
     echo $post.' '.$publish.'<input type="button" class="button" onClick="MM_goToURL(\'parent\',\'index.php?site=news&action=archive\');return document.MM_returnValue" value="News-Archive"><hr noshade size="1" color="'.BORDER.'">';
     
     if($_GET['show']) {
     $result=safe_query("SELECT rubricID FROM ".PREFIX."news_rubrics WHERE rubric='".$_GET['show']."' LIMIT 0,1");
     $dv=mysql_fetch_array($result);
     $showonly = "AND rubric='".$dv[rubricID]."'";
     }
    
     $result=safe_query("SELECT * FROM ".PREFIX."news WHERE published='1' AND intern<=".isclanmember($userID)." $showonly ORDER BY date DESC LIMIT 0,$maxshownnews");
     $i=1;
     while($ds=mysql_fetch_array($result)) {
     if($i%2) $bg1=BG_1;
     else $bg1=BG_2;
     
     $date = date("d.m.Y", $ds[date]);
     $time = date("H:i", $ds[date]);
     $rubrikname=getrubricname($ds[rubric]);
     $rubricpic_path = "images/news-rubrics/".getrubricpic($ds[rubric]);
     $rubricpic='<img src="'.$rubricpic_path.'" border="0">';
     echo $rubripic;
     if(!is_file($rubricpic_path)) $rubricpic='';
     
     $lang=$ds[lang1];
     $language1="[flag]".$ds[lang1]."[/flag]";
     $language2="[flag]".$ds[lang2]."[/flag]";
     
     if($lang==$ds[lang1]) {
     if($ds[headline1]) $headline = $ds[headline1];
     else $headline = $ds[headline2];
     
     if($ds[content1]) $content = $ds[content1];
     else $content='[b]no version in selected language available![/b].[br][br]'.$ds[content2];
     
     if($ds[headline2]) {
     $langs='<a href="index.php?site=news_comments&newsID='.$ds[newsID].'&lang='.$ds[lang2].'">'.flags($language2).'</a>';
     $language=getlanguage($ds[lang2]);
     $langs = eregi_replace ('(alt=")(.*)(")',"\\1 news in $language\\3",$langs);
     } 
     else $langs='';
     }
     else {
     if($ds[headline2]) $headline = $ds[headline2];
     else $headline = $ds[headline1];
     
     if($ds[content2]) $content = $ds[content2];
     else $content='[b]no version in selected language available![/b].[br][br]'.$ds[content1];
     
     if($ds[headline1]) {
     $langs='<a href="index.php?site=news_comments&newsID='.$ds[newsID].'&lang='.$ds[lang1].'">'.flags($language1).'</a>';
     $language=getlanguage($ds[lang1]);
     $langs = eregi_replace ('(alt=")(.*)(")',"\\1 news in $language\\3",$langs);
     } 
     else $langs='';
     }
     
     $content = htmloutput($content);
     $content = toggle($content, $ds[newsID]); 
     $poster='<a href="index.php?site=profile&id='.$ds[poster].'"><b>'.getnickname($ds[poster]).'</b></a>';
     if($ds[link1] && $ds[url1]!="http://" && $ds[window1]) $related.='" <a href="'.$ds[url1].'" target="_blank">'.$ds[link1].'</a> ';
     if($ds[link1] && $ds[url1]!="http://" && !$ds[window1]) $related.='" <a href="'.$ds[url1].'">'.$ds[link1].'</a> ';
     
     if($ds[link2] && $ds[url2]!="http://" && $ds[window2]) $related.='" <a href="'.$ds[url2].'" target="_blank">'.$ds[link2].'</a> ';
     if($ds[link2] && $ds[url2]!="http://" && !$ds[window2]) $related.='" <a href="'.$ds[url2].'">'.$ds[link2].'</a> ';
     
     if($ds[link3] && $ds[url3]!="http://" && $ds[window3]) $related.='" <a href="'.$ds[url3].'" target="_blank">'.$ds[link3].'</a> ';
     if($ds[link3] && $ds[url3]!="http://" && !$ds[window3]) $related.='" <a href="'.$ds[url3].'">'.$ds[link3].'</a> ';
     
     if($ds[link4] && $ds[url4]!="http://" && $ds[window4]) $related.='" <a href="'.$ds[url4].'" target="_blank">'.$ds[link4].'</a> ';
     if($ds[link4] && $ds[url4]!="http://" && !$ds[window4]) $related.='" <a href="'.$ds[url4].'">'.$ds[link4].'</a> ';
     
     if(empty($related)) $related="n/a"; 
     
     if($ds[comments]) {
     if($ds[cwID]) { // CLANWAR-NEWS
     $anzcomments = getanzcomments($ds[cwID], 'cw');
     if($anzcomments) $comments='<a href="index.php?site=clanwars_details&cwID='.$ds[cwID].'">['.$anzcomments.'] comments</a> latest by '.getlastcommentposter($ds[cwID], 'cw').' - '.date("d.m.Y - H:i", getlastcommentdate($ds[cwID], 'cw'));
     else $comments='<a href="index.php?site=clanwars_details&cwID='.$ds[cwID].'">[0] comments</a>';
     }
     else {
     $anzcomments = getanzcomments($ds[newsID], 'ne');
     if($anzcomments) $comments='<a href="index.php?site=news_comments&newsID='.$ds[newsID].'">['.$anzcomments.'] comments</a> latest by '.getlastcommentposter($ds[newsID], 'ne').' - '.date("d.m.Y - H:i", getlastcommentdate($ds[newsID], 'ne'));
     else $comments='<a href="index.php?site=news_comments&newsID='.$ds[newsID].'">[0] comments</a>';
     }
     }
     else $comments=''; 
     
     if(isnewsadmin($userID)) $adminaction='<input type="button" class="button" onClick="MM_goToURL(\'parent\',\'news.php?quickactiontype=unpublish&newsID='.$ds[newsID].'\');return document.MM_returnValue" value="unpublish">
     <input type="button" class="button" onClick="MM_openBrWindow(\'news.php?action=edit&newsID='.$ds[newsID].'\',\'News\',\'toolbar=no,status=no,scrollbars=yes,width=800,height=600\')" value="edit"> 
     <input type="button" class="button" onClick="MM_confirm(\'really delete this entry?\', \'news.php?action=delete&id='.$ds[newsID].'\')" value="delete">';
     else $adminaction='';
    
     eval ("\$news = \"".gettemplate("news")."\";");
     echo $news;
    
     $i++;
     
     unset($related);
     unset($comments);
     unset($lang);
     unset($ds);
     }
    }
    
    ?>
    
     
  12. #11 10. August 2006
    probiers das mal^^

    wenns net geht, weiß ich au erstmal net worans liegt^^ in 10 min kann man sich da net so schnell reinfinden^^

    //edit: achja wichtig! das erste wort korrespondiert mit der ersten farbe, also hier word1 mit black, das zweite mit der zweiten farbe und so weiter...

    PHP:
    <? php


    // Die Funktion ...

    function  replace_word ( $word $color $string )
    {
        if(isset(
    $word ) AND isset( $color ) AND isset( $string ))
        {
            
    $return  str_replace ( $word '<font color="$color">' . $word . '</font>' $string ); 
            return 
    $return ;
        }
        else
        {
            return 
    false ;
        }
    }

    // So hier definieren wir mal welches Wort in welcher Farbe dargestellt werden soll!
    // einfach die Wörter in das Array da unten Schreiben! Die Wörter dabei in '' stellen und mit Komma trennen!

    $words  = array( 'Word1' 'Word2' 'Word3' 'Word4' 'Word5' 'Word6' );

    // Und hier die Farben dazu! Ob Hex oder ausgeschrieben ist egal ...

    $colors  = array( 'black' 'red' '#43EF4H' 'purple' );




    $action  $_GET [ 'action' ];
    if(
    $action == "new" ) {
        include(
    "_mysql.php" );
        include(
    "_settings.php" );
        include(
    "_functions.php" );
        if(!
    isnewsadmin ( $userID )) die( 'No access.' );

      echo 
    '<html><head>' ;
        echo
    '<script src="js/bbcode.js" language="jscript" type="text/javascript"></script>
             <link href="_stylesheet.css" rel="stylesheet" type="text/css"></head><body>'
    ;
        
        if(
    isnewsadmin ( $userID )) {
            
    safe_query ( "DELETE FROM " . PREFIX . "news WHERE headline1='' AND lang1='' AND lang2='' AND headline2=''" );        
            
    safe_query ( "INSERT INTO " . PREFIX . "news (date, poster, saved) VALUES ('" . time (). "', ' $userID ', '0')" );
            
    $newsID = mysql_insert_id ();
            
            
    $newsrubrics = safe_query ( "SELECT rubricID, rubric FROM " . PREFIX . "news_rubrics ORDER BY rubric" );
            while(
    $dr = mysql_fetch_array ( $newsrubrics )) {
                
    $rubrics .= '<option value="' . $dr [ rubricID ]. '">' . $dr [ rubric ]. '</option>' ;
            }
            
          if(
    $_POST [ 'topnews' ])  safe_query ( "UPDATE " . PREFIX . "settings SET topnewsID=' $newsID '" );

            
    $lang = safe_query ( "SELECT lang, language FROM " . PREFIX . "news_languages ORDER BY language" );
            while(
    $dl = mysql_fetch_array ( $lang )) {
                if(
    $dl [ lang ]== "de" $langs1 .= '<option value="' . $dl [ lang ]. '" selected>' . $dl [ language ]. '</option>' ;
                else 
    $langs1 .= '<option value="' . $dl [ lang ]. '">' . $dl [ language ]. '</option>' ;
                
                if(
    $dl [ lang ]== "uk" $langs2 .= '<option value="' . $dl [ lang ]. '" selected>' . $dl [ language ]. '</option>' ;
                else 
    $langs2 .= '<option value="' . $dl [ lang ]. '">' . $dl [ language ]. '</option>' ;
            }
            
    $url1 = "http://" ;
            
    $url2 = "http://" ;
            
    $url3 = "http://" ;
            
    $url4 = "http://" ;
            
            
    $bg1 = BG_1 ;
            eval (
    "\$addbbcode = \"" . gettemplate ( "addbbcode" ). "\";" );
            eval (
    "\$addflags = \"" . gettemplate ( "flags" ). "\";" );
            
            eval (
    "\$news_post = \"" . gettemplate ( "news_post" ). "\";" );
            echo 
    $news_post ;  
        }
        else 
    redirect ( 'index.php?site=news' 'no access!' );
    }
    elseif(
    $action == "save" ) {
         include(
    "_mysql.php" );
        include(
    "_settings.php" );
        include(
    "_functions.php" );
        if(!
    isnewsadmin ( $userID )) die( 'No access.' );

      
    $newsID  $_POST [ 'newsID' ];
      
    $save  $_POST [ 'save' ];
      
    $preview  $_POST [ 'preview' ];
      
      
    $rubric  $_POST [ 'rubric' ];

        
    $lang1  $_POST [ 'lang1' ];
        
    $headline1  $_POST [ 'headline1' ];
        
    $message  $_POST [ 'message' ];

        
    $lang2  $_POST [ 'lang2' ];
        
    $headline2  $_POST [ 'headline2' ];
        
    $content2  $_POST [ 'content2' ];


        
    $link1  $_POST [ 'link1' ];
        
    $url1  $_POST [ 'url1' ];
        
    $window1  $_POST [ 'window1' ];

        
    $link2  $_POST [ 'link2' ];
        
    $url2  $_POST [ 'url2' ];
        
    $window2  $_POST [ 'window2' ];

        
    $link3  $_POST [ 'link3' ];
        
    $url3  $_POST [ 'url3' ];
        
    $window3  $_POST [ 'window3' ];

        
    $link4  $_POST [ 'link4' ];
        
    $url4  $_POST [ 'url4' ];
        
    $window4  $_POST [ 'window4' ];
        
        
    $intern  $_POST [ 'intern' ];
        
    $comments  $_POST [ 'comments' ];
        
        
    safe_query ( "UPDATE " . PREFIX . "news SET rubric=' $rubric ',
                          lang1='
    $lang1 ',
                          headline1='"
    . mysql_escape_string ( $headline1 ). "',
                          content1='"
    . mysql_escape_string ( $message ). "',
                          lang2='
    $lang2 ',
                          headline2='"
    . mysql_escape_string ( $headline2 ). "',
                          content2='"
    . mysql_escape_string ( $content2 ). "',
                          link1='
    $link1 ',
                          url1='
    $url1 ',
                          window1='
    $window1 ',
                          link2='
    $link2 ',
                          url2='
    $url2 ',
                          window2='
    $window2 ',
                          link3='
    $link3 ',
                          url3='
    $url3 ',
                          window3='
    $window3 ',
                          link4='
    $link4 ',
                          url4='
    $url4 ',
                          window4='
    $window4 ',
                          saved='1',
                          intern='
    $intern ',
                          comments='
    $comments ' WHERE newsID=' $newsID '" );
                                 
        
    // löschen der einträge die älter als 1 stunde sind und keinen text enthalten
        
    $ergebnis = safe_query ( "SELECT * FROM " . PREFIX . "news WHERE headline1='' OR content1=''" );
        while(
    $ds = mysql_fetch_array ( $ergebnis )) {
            if((
    time ()- $ds [ date ]) > ( 60 * 60 ))  safe_query ( "DELETE FROM " . PREFIX . "news WHERE newsID=' $ds [ newsID ] '" );
        }
        
        
        if(
    $_POST [ 'topnews' ])  safe_query ( "UPDATE " . PREFIX . "settings SET topnewsID=' $newsID '" );

        if(
    $save ) echo '<body onLoad="window.close()"></body>' ;
        if(
    $preview header ( "Location: news.php?action=preview&newsID= $newsID " );
        
        
    }
    elseif(
    $action == "preview" ) {
        include(
    "_mysql.php" );
        include(
    "_settings.php" );
        include(
    "_functions.php" );
        if(!
    isnewsadmin ( $userID )) die( 'No access.' );


      
    $newsID  $_GET [ 'newsID' ];

        echo
    '<script src="js/bbcode.js" language="jscript" type="text/javascript"></script>
             <link href="_stylesheet.css" rel="stylesheet" type="text/css">'
    ;

        
    $bg1 = BG_1 ;
        
        eval (
    "\$title_news = \"" . gettemplate ( "title_news" ). "\";" );
        echo 
    $title_news ;

        
    $result = safe_query ( "SELECT * FROM " . PREFIX . "news WHERE newsID=' $newsID '" );
        
    $ds = mysql_fetch_array ( $result );
            
    $bgcolor = BG_1 ;
            
    $date  date ( "d.m.Y" $ds [ date ]);
            
    $time  date ( "H:i" $ds [ date ]);
            
    $rubrikname = getrubricname ( $ds [ rubric ]);
            
    $rubricpic = '<img src="images/news-rubrics/' . getrubricpic ( $ds [ rubric ]). '">' ;
            if(!
    file_exists ( $rubricpic ))  $rubricpic  '' ;
                
            
    $lang = $ds [ lang1 ];
            
    $language1 = "[flag]" . $ds [ lang1 ]. "[/flag]" ;
            
    $language2 = "[flag]" . $ds [ lang2 ]. "[/flag]" ;
                
            if(
    $lang == $ds [ lang1 ]) {
                if(
    $ds [ headline1 ])  $headline  $ds [ headline1 ];
                else 
    $headline  $ds [ headline2 ];
                    
                if(
    $ds [ content1 ])  $content  $ds [ content1 ];
                else 
    $content = '[b]no version in selected language available![/b].[br][br]' . $ds [ content2 ];
                    
                
    $langs = '' ;
                if(
    $ds [ headline2 ]) {
                    
    $langs = '<a href="news.php?action=preview&newsID=' . $ds [ newsID ]. '&lang=' . $ds [ lang2 ]. '">' . flags ( $language2 ). '</a>' ;
                    
    $language = getlanguage ( $ds [ lang2 ]);
                    
    $langs  eregi_replace  ( '(alt=")(.*)(")' , "\\1 news in  $language \\3" , $langs );
                }    
            }
            else {
                if(
    $ds [ headline2 ])  $headline  $ds [ headline2 ];
                else 
    $headline  $ds [ headline1 ];
                
                if(
    $ds [ content2 ])  $content  $ds [ content2 ];
                else 
    $content = '[b]no version in selected language available![/b].[br][br]' . $ds [ content1 ];
                        
                
    $langs = '' ;
                if(
    $ds [ headline1 ]) {
                    
    $langs = '<a href="news.php?action=preview&newsID=' . $ds [ newsID ]. '&lang=' . $ds [ lang1 ]. '">' . flags ( $language1 ). '</a>' ;
                    
    $language = getlanguage ( $ds [ lang1 ]);
                    
    $langs  eregi_replace  ( '(alt=")(.*)(")' , "\\1 news in  $language \\3" , $langs );
                }    
            }
        
            
    $content  htmloutput ( $content );
            
    $content  toggle ( $content $ds [ newsID ]);
            
    $poster = '<a href="index.php?site=profile&id=' . $ds [ poster ]. '"><b>' . getnickname ( $ds [ poster ]). '</b></a>' ;
            if(
    $ds [ link1 ] &&  $ds [ url1 ]!= "http://"  &&  $ds [ window1 ])  $related .= '" <a href="' . $ds [ url1 ]. '" target="_blank">' . $ds [ link1 ]. '</a> ' ;
            if(
    $ds [ link1 ] &&  $ds [ url1 ]!= "http://"  && ! $ds [ window1 ])  $related .= '" <a href="' . $ds [ url1 ]. '">' . $ds [ link1 ]. '</a> ' ;
            
            if(
    $ds [ link2 ] &&  $ds [ url2 ]!= "http://"  &&  $ds [ window2 ])  $related .= '" <a href="' . $ds [ url2 ]. '" target="_blank">' . $ds [ link2 ]. '</a> ' ;
            if(
    $ds [ link2 ] &&  $ds [ url2 ]!= "http://"  && ! $ds [ window2 ])  $related .= '" <a href="' . $ds [ url2 ]. '">' . $ds [ link2 ]. '</a> ' ;
                    
            if(
    $ds [ link3 ] &&  $ds [ url3 ]!= "http://"  &&  $ds [ window3 ])  $related .= '" <a href="' . $ds [ url3 ]. '" target="_blank">' . $ds [ link3 ]. '</a> ' ;
            if(
    $ds [ link3 ] &&  $ds [ url3 ]!= "http://"  && ! $ds [ window3 ])  $related .= '" <a href="' . $ds [ url3 ]. '">' . $ds [ link3 ]. '</a> ' ;
                    
            if(
    $ds [ link4 ] &&  $ds [ url4 ]!= "http://"  &&  $ds [ window4 ])  $related .= '" <a href="' . $ds [ url4 ]. '" target="_blank">' . $ds [ link4 ]. '</a> ' ;
            if(
    $ds [ link4 ] &&  $ds [ url4 ]!= "http://"  && ! $ds [ window4 ])  $related .= '" <a href="' . $ds [ url4 ]. '">' . $ds [ link4 ]. '</a> ' ;
                    
            eval (
    "\$news = \"" . gettemplate ( "news" ). "\";" );
            
    $news  replace_word ( $words $colors $news );
            echo 
    $news ;
            
            echo
    '<hr noshade size="1" color="' . BORDER . '">
                 <input type="button" class="button" onClick="MM_goToURL(\'parent\',\'news.php?action=edit&newsID='
    . $newsID . '\');return document.MM_returnValue" value="edit news"> 
                 <input type="button" class="button" onClick="javascript:self.close()" value="save news"> 
                 <input type="button" class="button" onClick="MM_confirm(\'really delete this entry?\', \'news.php?action=delete&id=$newsID&close=true\')" value="cancel">'
    ;
    }
    elseif(
    $_POST [ 'quickactiontype' ]== "publish"  OR  $_GET [ 'quickactiontype' ]== "publish" ) {
        include(
    "_mysql.php" );
        include(
    "_settings.php" );
        include(
    "_functions.php" );
        if(!
    isnewsadmin ( $userID )) die( 'No access.' );

      
    $newsID  $_POST [ 'newsID' ];
        
        if(
    is_array ( $newsID )) {
            foreach(
    $newsID  as  $id ) {
                
    safe_query ( "UPDATE " . PREFIX . "news SET published='1' WHERE newsID=' $id '" );
            }
        }
        
    header ( "Location: index.php?site=news" );
    }
    elseif(
    $_POST [ 'quickactiontype' ]== "unpublish"  OR  $_GET [ 'quickactiontype' ]== "unpublish" ) {
        include(
    "_mysql.php" );
        include(
    "_settings.php" );
        include(
    "_functions.php" );
        if(!
    isnewsadmin ( $userID )) die( 'No access.' );

      
    $newsID  $_POST [ 'newsID' ];
      if(!
    $newsID $newsID [] =  $_GET [ 'newsID' ];
        
        foreach(
    $newsID  as  $id ) {
            
    safe_query ( "UPDATE " . PREFIX . "news SET published='0' WHERE newsID=' $id '" );
        }
        
    header ( "Location: index.php?site=news" );
    }
    elseif(
    $_POST [ 'quickactiontype' ]== "delete" ) {
        include(
    "_mysql.php" );
        include(
    "_settings.php" );
        include(
    "_functions.php" );
        if(!
    isnewsadmin ( $userID )) die( 'No access.' );

      
    $newsID  $_POST [ 'newsID' ];
            
        foreach(
    $newsID  as  $id ) {
            
    $ds = mysql_fetch_array ( safe_query ( "SELECT screens FROM " . PREFIX . "news WHERE newsID=' $id '" ));
            if(
    $ds [ screens ]) {
                
    $screens = explode ( "|" $ds [ screens ]);
                if(
    is_array ( $screens )) {
                    
    $filepath  "./images/news-pics/" ;
                    foreach(
    $screens  as  $screen ) {
                        if(
    file_exists ( $filepath . $screen )) @ unlink ( $filepath . $screen );
                    }
                }
            }    
            
    safe_query ( "DELETE FROM " . PREFIX . "news WHERE newsID=' $id '" );
            
    safe_query ( "DELETE FROM " . PREFIX . "comments WHERE parentID=' $id ' AND type='ne'" );
        }
        
    header ( "Location: index.php?site=news" );
    }
    elseif(
    $action == "delete" ) {
        include(
    "_mysql.php" );
        include(
    "_settings.php" );
        include(
    "_functions.php" );
        if(!
    isnewsadmin ( $userID )) die( 'No access.' );

      
    $id  $_GET [ 'id' ];
        
        
    $ds = mysql_fetch_array ( safe_query ( "SELECT screens FROM " . PREFIX . "news WHERE newsID=' $id '" ));
        if(
    $ds [ screens ]) {
            
    $screens = explode ( "|" $ds [ screens ]);
            if(
    is_array ( $screens )) {
                
    $filepath  "./images/news-pics/" ;
                foreach(
    $screens  as  $screen ) {
                    if(
    file_exists ( $filepath . $screen )) @ unlink ( $filepath . $screen );
                }
            }
        }
           
        
    safe_query ( "DELETE FROM " . PREFIX . "news WHERE newsID=' $id '" );
        
    safe_query ( "DELETE FROM " . PREFIX . "comments WHERE parentID=' $id ' AND type='ne'" );

        if(
    $close ) echo '<body onLoad="window.close()"></body>' ;
        else 
    header ( "Location: index.php?site=news" );
    }
    elseif(
    $action == "edit" ) {
        include(
    "_mysql.php" );
        include(
    "_settings.php" );
        include(
    "_functions.php" );
        if(!
    isnewsadmin ( $userID )) die( 'No access.' );
        
      
    $newsID  $_GET [ 'newsID' ];

        echo
    '<script src="js/bbcode.js" language="jscript" type="text/javascript"></script>
             <link href="_stylesheet.css" rel="stylesheet" type="text/css">'
    ;
            
        
    $ds = mysql_fetch_array ( safe_query ( "SELECT * FROM " . PREFIX . "news WHERE newsID=' $newsID '" ));
        
    $lang = safe_query ( "SELECT lang, language FROM " . PREFIX . "news_languages ORDER BY language" );
        while(
    $dl = mysql_fetch_array ( $lang )) {
            if(
    $dl [ lang ]== $ds [ lang1 ])  $langs1 .= '<option value="' . $dl [ lang ]. '" selected>' . $dl [ language ]. '</option>' ;
            else 
    $langs1 .= '<option value="' . $dl [ lang ]. '">' . $dl [ language ]. '</option>' ;
            
            if(
    $dl [ lang ]== $ds [ lang2 ])  $langs2 .= '<option value="' . $dl [ lang ]. '" selected>' . $dl [ language ]. '</option>' ;
            else 
    $langs2 .= '<option value="' . $dl [ lang ]. '">' . $dl [ language ]. '</option>' ;
        }
            
        
    $headline1 = getinput ( $ds [ headline1 ]);
        
    $message = getinput ( $ds [ content1 ]);
        
    $headline2 = getinput ( $ds [ headline2 ]);
        
    $content2 = getinput ( $ds [ content2 ]);
            
        
    $newsrubrics = safe_query ( "SELECT * FROM " . PREFIX . "news_rubrics ORDER BY rubric" );
        while(
    $dr = mysql_fetch_array ( $newsrubrics )) {
            if(
    $ds [ rubric ]== $dr [ rubricID ])  $rubrics .= '<option value="' . $dr [ rubricID ]. '" selected>' . $dr [ rubric ]. '</option>' ;
            else 
    $rubrics .= '<option value="' . $dr [ rubricID ]. '">' . $dr [ rubric ]. '</option>' ;
        }

      if(
    $ds [ intern ])  $intern  '<option value="0">No</option><option value="1" selected>Yes</option>' ;
      else 
    $intern  '<option value="0" selected>No</option><option value="1">Yes</option>' ;

        
    $link1 = $ds [ link1 ];
        
    $link2 = $ds [ link2 ];
        
    $link3 = $ds [ link3 ];
        
    $link4 = $ds [ link4 ];
        
        
    $url1 = "http://" ;
        
    $url2 = "http://" ;
        
    $url3 = "http://" ;
        
    $url4 = "http://" ;
        
        if(
    $ds [ url1 ]!= "http://" $url1 = $ds [ url1 ];
        if(
    $ds [ url2 ]!= "http://" $url2 = $ds [ url2 ];
        if(
    $ds [ url3 ]!= "http://" $url3 = $ds [ url3 ];
        if(
    $ds [ url4 ]!= "http://" $url4 = $ds [ url4 ];
            
        if(
    $ds [ window1 ])  $window1 = '<input class="input" name="window1" type="radio" value="1" checked> new window <input class="input" type="radio" name="window1" value="0"> _self' ;
        else 
    $window1 = '<input class="input" name="window1" type="radio" value="1"> new window <input class="input" type="radio" name="window1" value="0" checked> _self' ;
            
        if(
    $ds [ window2 ])  $window2 = '<input class="input" name="window2" type="radio" value="1" checked> new window <input class="input" type="radio" name="window2" value="0"> _self' ;
        else 
    $window2 = '<input class="input" name="window2" type="radio" value="1"> new window <input class="input" type="radio" name="window2" value="0" checked> _self' ;
            
        if(
    $ds [ window3 ])  $window3 = '<input class="input" name="window3" type="radio" value="1" checked> new window <input class="input" type="radio" name="window3" value="0"> _self' ;
        else 
    $window3 = '<input class="input" name="window3" type="radio" value="1"> new window <input class="input" type="radio" name="window3" value="0" checked> _self' ;
            
        if(
    $ds [ window4 ])  $window4 = '<input class="input" name="window4" type="radio" value="1" checked> new window <input class="input" type="radio" name="window4" value="0"> _self' ;
        else 
    $window4 = '<input class="input" name="window4" type="radio" value="1"> new window <input class="input" type="radio" name="window4" value="0" checked> _self' ;
            
        if(
    $ds [ picalign ]== "left" $align = '<input class="input" type="radio" name="align" value="left" checked> left 
                                        <input class="input" type="radio" name="align" value="right"> right'
    ;
        else 
    $align = '<input class="input" type="radio" name="align" value="left"> left 
                     <input class="input" type="radio" name="align" value="right" checked> right'
    ;
        
        
    $comments = '<option value="0">disable comments</option><option value="1">enable user comments</option><option value="2">enable visitor comments</option>' ;                                
        
    $comments = str_replace ( 'value="' . $ds [ comments ]. '"' 'value="' . $ds [ comments ]. '" selected' $comments );
            
        
    $bg1 = BG_1 ;
        
        eval (
    "\$addbbcode = \"" . gettemplate ( "addbbcode" ). "\";" );
        eval (
    "\$addflags = \"" . gettemplate ( "flags" ). "\";" );
        
        eval (
    "\$news_edit = \"" . gettemplate ( "news_edit" ). "\";" );
        echo 
    $news_edit ;
    }
    elseif(
    $action == "unpublished" ) {
        eval (
    "\$title_news = \"" . gettemplate ( "title_news" ). "\";" );
        echo 
    $title_news ;

        if(
    isnewsadmin ( $userID ))  $post = '<input type="button" class="button" onClick="MM_openBrWindow(\'news.php?action=new\',\'News\',\'toolbar=no,status=no,scrollbars=yes,width=800,height=600\')" value="post News">' ;

        echo 
    $post . ' <input type="button" class="button" onClick="MM_goToURL(\'parent\',\'index.php?site=news\');return document.MM_returnValue" value="show News"><hr noshade size="1" color="' . BORDER . '">' ;
        
        
    // Not published News
        
    if( isnewsadmin ( $userID )) {
            
    $ergebnis = safe_query ( "SELECT * FROM " . PREFIX . "news WHERE published='0' AND saved='1' ORDER BY date ASC" );
            if(
    mysql_num_rows ( $ergebnis )) {
                echo
    '<h2>NOT PUBLISHED NEWS:</h2>' ;
                
                echo
    '<form method="post" name="form" action="news.php">' ;
                eval (
    "\$news_archive_head = \"" . gettemplate ( "news_archive_head" ). "\";" );
                echo 
    $news_archive_head ;       
                
                
    $i = 1 ;
                while(
    $ds = mysql_fetch_array ( $ergebnis )) {
                    if(
    $i % 2 ) {
                        
    $bg1 = BG_1 ;
                        
    $bg2 = BG_2 ;
                    }
                    else {
                        
    $bg1 = BG_3 ;
                        
    $bg2 = BG_4 ;
                    }
                    
                    
    $date = date ( "d.m.Y" $ds [ date ]);
                    
    $rubric = getrubricname ( $ds [ rubric ]);
                    
    $language1 = "[flag]" . $ds [ lang1 ]. "[/flag]" ;
                    
    $language2 = "[flag]" . $ds [ lang2 ]. "[/flag]" ;
                
                    if(
    $ds [ headline1 ]) {
                        
    $langs = '<a href="index.php?site=news_comments&newsID=' . $ds [ newsID ]. '&lang=' . $ds [ lang1 ]. '">' . flags ( $language1 ). '</a>' ;
                        
    $language = getlanguage ( $ds [ lang1 ]);
                        
    $langs  eregi_replace  ( '(alt=")(.*)(")' , "\\1 news in  $language \\3" , $langs );
                        
    $headline = '<a href="index.php?site=news_comments&newsID=' . $ds [ newsID ]. '&lang=' . $ds [ lang1 ]. '">' . $ds [ headline1 ]. '</a>' ;
                    }  
                    if(
    $ds [ headline2 ]) {
                        
    $lang2 = ' <a href="index.php?site=news_comments&newsID=' . $ds [ newsID ]. '&lang=' . $ds [ lang2 ]. '">' . flags ( $language2 ). '</a>' ;
                        
    $language = getlanguage ( $ds [ lang2 ]);
                        
    $lang2  eregi_replace  ( '(alt=")(.*)(")' , "\\1 news in  $language \\3" , $lang2 );
                        
    $langs .= $lang2 ;
                        
    $headline .= ' - <a href="index.php?site=news_comments&newsID=' . $ds [ newsID ]. '&lang=' . $ds [ lang2 ]. '">' . $ds [ headline2 ]. '</a>' ;
                    }    

                    
    $poster = '<a href="index.php?site=profile&id=' . $ds [ poster ]. '">' . getnickname ( $ds [ poster ]). '</a>' ;

                    
    $multiple = '' ;
                    
    $admdel = '' ;
                    if(
    isnewsadmin ( $userID )) {
                        
    $multiple = '<input class="input" type="checkbox" name="newsID[]" value="' . $ds [ newsID ]. '">' ;
                        
    $admdel = '<table width="100%" border="0" cellspacing="0" cellpadding="4">
                                <tr>
                                <td><input class="input" type="checkbox" name="ALL" value="ALL" onClick="SelectAll(this.form);"> select all</td>
                                    <td align="right"><select name="quickactiontype">
                                    <option value="publish">publish selected</option>
                                    <option value="delete">delete selected</option>
                                    </select> 
                                <input type="submit" name="quickaction" value="go"></td>
                                </tr>
                                </table></form>'
    ;

                    }
                    eval (
    "\$news_archive_content = \"" . gettemplate ( "news_archive_content" ). "\";" );
                    
    $news_archive_content  replace_word ( $words $colors $news_archive_content );
                    echo 
    $news_archive_content ;
                    
    $i ++;
                }
                eval (
    "\$news_archive_foot = \"" . gettemplate ( "news_archive_foot" ). "\";" );
                echo 
    $news_archive_foot ;

                unset(
    $ds );
            }
        }
    }
    elseif(
    $action == "archive" ) {
        eval (
    "\$title_news = \"" . gettemplate ( "title_news" ). "\";" );
        echo 
    $title_news ;
        
      
    $page = $_GET [ 'page' ];
      
    $sort = $_GET [ 'sort' ];
      
    $type = $_GET [ 'type' ];
        
    $post = '' ;
        
    $publish = '' ;
        if(
    isnewsadmin ( $userID )) {
            
    $post = '<input type="button" class="button" onClick="MM_openBrWindow(\'news.php?action=new\',\'News\',\'toolbar=no,status=no,scrollbars=yes,width=800,height=600\')" value="post News">' ;
            
    $unpublished = safe_query ( "SELECT newsID FROM " . PREFIX . "news WHERE published='0' AND saved='1'" );
            
    $unpublished = mysql_num_rows ( $unpublished );
            if(
    $unpublished $publish = '<input type="button" class="button" onClick="MM_goToURL(\'parent\',\'index.php?site=news&action=unpublished\');return document.MM_returnValue" value="' . $unpublished . ' unpublished News"> ' ;
        }
        echo 
    $post . ' ' . $publish . ' <input type="button" class="button" onClick="MM_goToURL(\'parent\',\'index.php?site=news\');return document.MM_returnValue" value="show News"><hr noshade size="1" color="' . BORDER . '">' ;
        
        
    $all = safe_query ( "SELECT newsID FROM " . PREFIX . "news WHERE published='1' AND intern<=" . isclanmember ( $userID ));
        
    $all = mysql_num_rows ( $all );
        
    $pages = 1 ;
        if(!isset(
    $page ))  $page  1 ;
        if(!isset(
    $sort ))  $sort  "date" ;
        if(!isset(
    $type ))  $type  "DESC" ;
        
        
    $max  = empty( $maxnewsarchiv ) ?  20  $maxnewsarchiv ;
        

        for (
    $n = $max $n <= $all $n += $max ) {
            if(
    $all > $n $pages ++;
        }
                 
        if(
    $pages > 1 $page_link  makepagelink ( "index.php?site=news&action=archive&sort= $sort &type= $type " $page $pages );
            
        if (
    $page  ==  "1" ) {
            
    $ergebnis  safe_query ( "SELECT * FROM " . PREFIX . "news WHERE published='1' AND intern<=" . isclanmember ( $userID ). " ORDER BY  $sort   $type  LIMIT 0, $max " );
            if(
    $type == "DESC" $n = $gesamt ;
            else 
    $n = 1 ;
        }
        else {
            
    $start = $page * $max - $max ;
            
    $ergebnis  safe_query ( "SELECT * FROM " . PREFIX . "news WHERE published='1' AND intern<=" . isclanmember ( $userID ). " ORDER BY  $sort   $type  LIMIT  $start , $max " );
            if(
    $type == "DESC" $n  = ( $gesamt )- $page * $max + $max ;
            else 
    $n  = ( $gesamt + 1 )- $page * $max + $max ;
        }
        if(
    $all ) {
            if(
    $type == "ASC"
                    echo
    '<a href="index.php?site=news&action=archive&page=' . $page . '&sort=' . $sort . '&type=DESC">Sort:</a> <img src="images/icons/asc.gif" width="9" height="7" border="0">&nbsp;&nbsp;&nbsp;' ;
                else 
                    echo
    '<a href="index.php?site=news&action=archive&page=' . $page . '&sort=' . $sort . '&type=ASC">Sort:</a> <img src="images/icons/desc.gif" width="9" height="7" border="0">&nbsp;&nbsp;&nbsp;' ;

            
            if(
    $pages > 1 ) echo  $page_link ;
            if(
    isnewsadmin ( $userID )) echo '<form method="post" name="form" action="news.php">' ;
            eval (
    "\$news_archive_head = \"" . gettemplate ( "news_archive_head" ). "\";" );
            echo 
    $news_archive_head ;
            
    $i = 1 ;
            while(
    $ds = mysql_fetch_array ( $ergebnis )) {
                if(
    $i % 2 ) {
                    
    $bg1 = BG_1 ;
                    
    $bg2 = BG_2 ;
                }
                else {
                    
    $bg1 = BG_3 ;
                    
    $bg2 = BG_4 ;
                }
                
                
    $date = date ( "d.m.Y" $ds [ date ]);
                
    $rubric = getrubricname ( $ds [ rubric ]);
                
    $language1 = "[flag]" . $ds [ lang1 ]. "[/flag]" ;
                
    $language2 = "[flag]" . $ds [ lang2 ]. "[/flag]" ;
                
                
    $comms  getanzcomments ( $ds [ newsID ],  'ne' );
                
                if(
    $ds [ headline1 ]) {
                    
    $langs = '<a href="index.php?site=news_comments&newsID=' . $ds [ newsID ]. '&lang=' . $ds [ lang1 ]. '">' . flags ( $language1 ). '</a>' ;
                    
    $language = getlanguage ( $ds [ lang1 ]);
                    
    $langs  eregi_replace  ( '(alt=")(.*)(")' , "\\1 news in  $language \\3" , $langs );
                        
                    
    $headline = '<a href="index.php?site=news_comments&newsID=' . $ds [ newsID ]. '&lang=' . $ds [ lang1 ]. '"><b>' . getinput ( $ds [ headline1 ]). '</b></a>' ;
                }  
                if(
    $ds [ headline2 ]) {
                    
    $lang2 = ' <a href="index.php?site=news_comments&newsID=' . $ds [ newsID ]. '&lang=' . $ds [ lang2 ]. '">' . flags ( $language2 ). '</a>' ;
                    
    $language = getlanguage ( $ds [ lang2 ]);
                    
    $lang2  eregi_replace  ( '(alt=")(.*)(")' , "\\1 news in  $language \\3" , $lang2 );
                    
    $langs .= $lang2 ;
                    
                    
    $headline .= ' - <a href="index.php?site=news_comments&newsID=' . $ds [ newsID ]. '&lang=' . $ds [ lang2 ]. '"><b>' . getinput ( $ds [ headline2 ]). '</b></a>' ;
                }    

                
    $poster = '<a href="index.php?site=profile&id=' . $ds [ poster ]. '">' . getnickname ( $ds [ poster ]). '</a>' ;
                
                
    $multiple = '' ;
                
    $admdel = '' ;
                if(
    isnewsadmin ( $userID ))  $multiple = '<input class="input" type="checkbox" name="newsID[]" value="' . $ds [ newsID ]. '">' ;
                
                eval (
    "\$news_archive_content = \"" . gettemplate ( "news_archive_content" ). "\";" );
                
    $news_archive_content  replace_word ( $words $colors $news_archive_content );
                echo 
    $news_archive_content ;
                
    $i ++;
            }
            if(
    isnewsadmin ( $userID ))  $admdel = '<table width="100%" border="0" cellspacing="0" cellpadding="4">
                                <tr>
                                <td><input class="input" type="checkbox" name="ALL" value="ALL" onClick="SelectAll(this.form);"> select all</td>
                                    <td align="right"><select name="quickactiontype">
                                    <option value="delete">delete selected</option>
                                    <option value="unpublish">unpublish selected</option>
                                    </select> 
                                <input type="submit" name="quickaction" value="go"></td>
                                </tr>
                                </table></form>'
    ;
            
            eval (
    "\$news_archive_foot = \"" . gettemplate ( "news_archive_foot" ). "\";" );
            echo 
    $news_archive_foot ;
            unset(
    $ds );
            
        }
        else echo
    'no entries' ;
    }
    else {
        eval (
    "\$title_news = \"" . gettemplate ( "title_news" ). "\";" );
        echo 
    $title_news ;

        
    $post = '' ;
        
    $publish = '' ;
        if(
    isnewsadmin ( $userID )) {
            
    $post = '<input type="button" class="button" onClick="MM_openBrWindow(\'news.php?action=new\',\'News\',\'toolbar=no,status=no,scrollbars=yes,width=800,height=600\')" value="post News">' ;
            
    $unpublished = safe_query ( "SELECT newsID FROM " . PREFIX . "news WHERE published='0' AND saved='1'" );
            
    $unpublished = mysql_num_rows ( $unpublished );
            if(
    $unpublished $publish = '<input type="button" class="button" onClick="MM_goToURL(\'parent\',\'index.php?site=news&action=unpublished\');return document.MM_returnValue" value="' . $unpublished . ' unpublished News"> ' ;
        }
        echo 
    $post . ' ' . $publish . '<input type="button" class="button" onClick="MM_goToURL(\'parent\',\'index.php?site=news&action=archive\');return document.MM_returnValue" value="News-Archive"><hr noshade size="1" color="' . BORDER . '">' ;
        
        if(
    $_GET [ 'show' ]) {
       
    $result = safe_query ( "SELECT rubricID FROM " . PREFIX . "news_rubrics WHERE rubric='" . $_GET [ 'show' ]. "' LIMIT 0,1" );
       
    $dv = mysql_fetch_array ( $result );
       
    $showonly  "AND rubric='" . $dv [ rubricID ]. "'" ;
      }

        
    $result = safe_query ( "SELECT * FROM " . PREFIX . "news WHERE published='1' AND intern<=" . isclanmember ( $userID ). $showonly  ORDER BY date DESC LIMIT 0, $maxshownnews " );
        
    $i = 1 ;
        while(
    $ds = mysql_fetch_array ( $result )) {
            if(
    $i % 2 $bg1 = BG_1 ;
            else 
    $bg1 = BG_2 ;
            
            
    $date  date ( "d.m.Y" $ds [ date ]);
            
    $time  date ( "H:i" $ds [ date ]);
            
    $rubrikname = getrubricname ( $ds [ rubric ]);
            
    $rubricpic_path  "images/news-rubrics/" . getrubricpic ( $ds [ rubric ]);
            
    $rubricpic = '<img src="' . $rubricpic_path . '" border="0">' ;
            echo 
    $rubripic ;
            if(!
    is_file ( $rubricpic_path ))  $rubricpic = '' ;
                
            
    $lang = $ds [ lang1 ];
            
    $language1 = "[flag]" . $ds [ lang1 ]. "[/flag]" ;
            
    $language2 = "[flag]" . $ds [ lang2 ]. "[/flag]" ;
                
            if(
    $lang == $ds [ lang1 ]) {
                if(
    $ds [ headline1 ])  $headline  $ds [ headline1 ];
                else 
    $headline  $ds [ headline2 ];
                    
                if(
    $ds [ content1 ])  $content  $ds [ content1 ];
                else 
    $content = '[b]no version in selected language available![/b].[br][br]' . $ds [ content2 ];
                    
                if(
    $ds [ headline2 ]) {
                    
    $langs = '<a href="index.php?site=news_comments&newsID=' . $ds [ newsID ]. '&lang=' . $ds [ lang2 ]. '">' . flags ( $language2 ). '</a>' ;
                    
    $language = getlanguage ( $ds [ lang2 ]);
                    
    $langs  eregi_replace  ( '(alt=")(.*)(")' , "\\1 news in  $language \\3" , $langs );
                }    
                else 
    $langs = '' ;
            }
            else {
                if(
    $ds [ headline2 ])  $headline  $ds [ headline2 ];
                else 
    $headline  $ds [ headline1 ];
                
                if(
    $ds [ content2 ])  $content  $ds [ content2 ];
                else 
    $content = '[b]no version in selected language available![/b].[br][br]' . $ds [ content1 ];
                        
                if(
    $ds [ headline1 ]) {
                    
    $langs = '<a href="index.php?site=news_comments&newsID=' . $ds [ newsID ]. '&lang=' . $ds [ lang1 ]. '">' . flags ( $language1 ). '</a>' ;
                    
    $language = getlanguage ( $ds [ lang1 ]);
                    
    $langs  eregi_replace  ( '(alt=")(.*)(")' , "\\1 news in  $language \\3" , $langs );
                }    
                else 
    $langs = '' ;
            }
        
            
    $content  htmloutput ( $content );
            
    $content  toggle ( $content $ds [ newsID ]);        
            
    $poster = '<a href="index.php?site=profile&id=' . $ds [ poster ]. '"><b>' . getnickname ( $ds [ poster ]). '</b></a>' ;
            if(
    $ds [ link1 ] &&  $ds [ url1 ]!= "http://"  &&  $ds [ window1 ])  $related .= '" <a href="' . $ds [ url1 ]. '" target="_blank">' . $ds [ link1 ]. '</a> ' ;
            if(
    $ds [ link1 ] &&  $ds [ url1 ]!= "http://"  && ! $ds [ window1 ])  $related .= '" <a href="' . $ds [ url1 ]. '">' . $ds [ link1 ]. '</a> ' ;
            
            if(
    $ds [ link2 ] &&  $ds [ url2 ]!= "http://"  &&  $ds [ window2 ])  $related .= '" <a href="' . $ds [ url2 ]. '" target="_blank">' . $ds [ link2 ]. '</a> ' ;
            if(
    $ds [ link2 ] &&  $ds [ url2 ]!= "http://"  && ! $ds [ window2 ])  $related .= '" <a href="' . $ds [ url2 ]. '">' . $ds [ link2 ]. '</a> ' ;
                    
            if(
    $ds [ link3 ] &&  $ds [ url3 ]!= "http://"  &&  $ds [ window3 ])  $related .= '" <a href="' . $ds [ url3 ]. '" target="_blank">' . $ds [ link3 ]. '</a> ' ;
            if(
    $ds [ link3 ] &&  $ds [ url3 ]!= "http://"  && ! $ds [ window3 ])  $related .= '" <a href="' . $ds [ url3 ]. '">' . $ds [ link3 ]. '</a> ' ;
                    
            if(
    $ds [ link4 ] &&  $ds [ url4 ]!= "http://"  &&  $ds [ window4 ])  $related .= '" <a href="' . $ds [ url4 ]. '" target="_blank">' . $ds [ link4 ]. '</a> ' ;
            if(
    $ds [ link4 ] &&  $ds [ url4 ]!= "http://"  && ! $ds [ window4 ])  $related .= '" <a href="' . $ds [ url4 ]. '">' . $ds [ link4 ]. '</a> ' ;
                    
            if(empty(
    $related ))  $related = "n/a"
            
            if(
    $ds [ comments ]) {
                if(
    $ds [ cwID ]) {   // CLANWAR-NEWS
                    
    $anzcomments  getanzcomments ( $ds [ cwID ],  'cw' );
                    if(
    $anzcomments $comments = '<a href="index.php?site=clanwars_details&cwID=' . $ds [ cwID ]. '">[' . $anzcomments . '] comments</a> latest by ' . getlastcommentposter ( $ds [ cwID ],  'cw' ). ' - ' . date ( "d.m.Y - H:i" getlastcommentdate ( $ds [ cwID ],  'cw' ));
                    else 
    $comments = '<a href="index.php?site=clanwars_details&cwID=' . $ds [ cwID ]. '">[0] comments</a>' ;
                }
                else {
                    
    $anzcomments  getanzcomments ( $ds [ newsID ],  'ne' );
                    if(
    $anzcomments $comments = '<a href="index.php?site=news_comments&newsID=' . $ds [ newsID ]. '">[' . $anzcomments . '] comments</a> latest by ' . getlastcommentposter ( $ds [ newsID ],  'ne' ). ' - ' . date ( "d.m.Y - H:i" getlastcommentdate ( $ds [ newsID ],  'ne' ));
                    else 
    $comments = '<a href="index.php?site=news_comments&newsID=' . $ds [ newsID ]. '">[0] comments</a>' ;
                }
            }
            else 
    $comments = '' ;    
                    
            if(
    isnewsadmin ( $userID ))  $adminaction = '<input type="button" class="button" onClick="MM_goToURL(\'parent\',\'news.php?quickactiontype=unpublish&newsID=' . $ds [ newsID ]. '\');return document.MM_returnValue" value="unpublish">
                                                                                         <input type="button" class="button" onClick="MM_openBrWindow(\'news.php?action=edit&newsID='
    . $ds [ newsID ]. '\',\'News\',\'toolbar=no,status=no,scrollbars=yes,width=800,height=600\')" value="edit"> 
                                                   <input type="button" class="button" onClick="MM_confirm(\'really delete this entry?\', \'news.php?action=delete&id='
    . $ds [ newsID ]. '\')" value="delete">' ;
            else 
    $adminaction = '' ;

            eval (
    "\$news = \"" . gettemplate ( "news" ). "\";" );
            echo 
    $news ;

            
    $i ++;
            
            unset(
    $related );
            unset(
    $comments );
            unset(
    $lang );
            unset(
    $ds );
        }
    }

    ?>
     
  13. #12 10. August 2006
    hm, scheint nicht zu funktionieren
     
  14. #13 11. August 2006
    hast du wörter eingesetzt? wenn ja hab ich kp, kenn mich mit der programmierung von webspell net aus
     
  15. #14 11. August 2006
    jop. wörter hab ich ersetzt. hm, naja. schade. Aber n 10er haste auf jeden fall für deine Mühe und Geduld mit mir bekommen ^^

    Vllt kann mir ja irgendein anderer helfen?!
     
  16. #15 16. Januar 2007
    AW: Bestimme Wörter in bestimmte Farbe anzeigen (wie bei aTTaX) *PHP

    ich such es nun auch ^^ kann mir da jemand weiterhelfen? die sachen die da oben stehen scheinen nicht zu funktionieren.
     
  17. #16 16. Januar 2007
    AW: Bestimme Wörter in bestimmte Farbe anzeigen (wie bei aTTaX) *PHP

    ich glaube das funktioniert wegen den array's nich
    mein versuch (ohne es getestet zu haben)
    PHP:
    function  replace_word ( $word $color $string )
    {
      if (
    count ( $word ) ==  count ( $color ))
      {
        foreach (
    $word  as  $key => $value ) {
          
    $string  str_replace ( $value '<font color="' . $color [ $key ]. '">' . $value . '</font>'  $string );
        }
        return 
    $string ;
      }
      else
      {
        die (
    "Anzahl der Wörter und Farben muss übereinstimmen!" );
      }
    }
    $words  = array( 'Word1' 'Word2' 'Word3' 'Word4' 'Word5' 'Word6' );
    $colors  = array( 'black' 'red' '#43EF4H' 'purple' );
    und dann halt diese funktion auf deine news etc. anwenden
     
  18. #17 16. Januar 2007
    AW: Bestimme Wörter in bestimmte Farbe anzeigen (wie bei aTTaX) *PHP

    muss das in die "news.php" ?
     
  19. #18 17. Januar 2007
    AW: Bestimme Wörter in bestimmte Farbe anzeigen (wie bei aTTaX) *PHP

    ja genau, einfach ganz oben rein (natürlich nach dem <?php)
    aber noch eine kleine verbesserung:

    und dann ne kleine verbesserung:
    PHP:
    function  replace_word ( $string )
    {
      
    $replace_word_color  = array( 'Word1'  =>  'blue' 'Word2'  =>  'red' );
      foreach (
    $replace_word_color  as  $key => $value ) {
        
    $string  str_replace ( $key '<font color="' . $value . '">' . $key . '</font>'  $string );
      }
      return 
    $string ;
    }
    das array sollte sich von alleine erklären ;) muss natürlich mit deinen wörtern und farben angepasst werden
    und nach der zeile
    $content = toggle($content, $ds[newsID]);
    einfach noch diese zeile einfügen:
    $content = replace_word($content);
    glaube ich zumindest, habs mir nich mit webspell beschäftigt
     
  20. #19 17. Januar 2007
    AW: Bestimme Wörter in bestimmte Farbe anzeigen (wie bei aTTaX) *PHP

    hm, scheint irgendwie nicht zu funktionieren. vielleicht mach ich auch irgendwas falsch.
    hab die datei "news.php" mal hochgeladen. wäre nett wenn du das zeugs da einsetzen könntest =D


    link:
    Download offline!
     
  21. #20 17. Januar 2007
    AW: Bestimme Wörter in bestimmte Farbe anzeigen (wie bei aTTaX) *PHP

    Hier:
    Download offline!/
    aber ich kanns nich testen
    und mit webspell kenn ich mich auch nich so aus
    es ist aber nicht gerade schön programmiert... aber das gehört hier nich hin
     
  22. #21 17. Januar 2007
    AW: Bestimme Wörter in bestimmte Farbe anzeigen (wie bei aTTaX) *PHP

    n kleiner fehler ^^




    Parse error: parse error, unexpected T_VARIABLE in /home/www/web28/html/news.php on line 6
     
  23. #22 18. Januar 2007
    AW: Bestimme Wörter in bestimmte Farbe anzeigen (wie bei aTTaX) *PHP

    suche:
    PHP:
          $string  str_replace ( $value '<font color="' . $color [ $key ]. '">' . $value . '</font>'  $string ); 
    erstetze mit:
    PHP:
          $string  str_replace ( $value '<font color="' . $color [ $key ]. '">' . $value . '</font>' $string ); 
     
  24. #23 18. Januar 2007
    AW: Bestimme Wörter in bestimmte Farbe anzeigen (wie bei aTTaX) *PHP

    RaXXi, du hast das script ja garnich runtergeladen
    ich habe die funktion ein bisschen verändert
    fehler ist zwar der gleiche, aber:
    Suche nach:
    PHP:
    $string  str_replace ( $key '<font color="' . $value . '">' . $key . '</font>'  $string );
    müsste Zeile 6 oder so sein
    Und ersetze mit:
    PHP:
    $string  str_replace ( $key '<font color="' . $value . '">' . $key . '</font>' $string );
     
  25. #24 18. Januar 2007
    AW: Bestimme Wörter in bestimmte Farbe anzeigen (wie bei aTTaX) *PHP

    g0il. funktioniert. kann man das auch noch irgendwie einfügen das bestimmte wörter dick, und andere in farbe & dick geht? das wäre dann alles =D

    bw ist raus
     
  26. #25 18. Januar 2007
    AW: Bestimme Wörter in bestimmte Farbe anzeigen (wie bei aTTaX) *PHP

    wie wärs mit php grundlagen lernen und funktion selber umschreiben?
    bzw. noch eine neue funktion für fett schreiben und die einfach noch vor der farb-funktion ausführen

    EDIT: keine zeit is ne schlechte ausrede
    lerns oder lass dir von jemand anderem helfen
     

  27. Videos zum Thema
Die Seite wird geladen...