ilch Forum » Ilch Clan 1.1 » Fehlersuche und Probleme » Kompatibilitätsprüfung

Geschlossen
  1. #1
    User Pic
    PlastSpritzer Mitglied
    Registriert seit
    14.11.2015
    Beiträge
    22
    Beitragswertungen
    0 Beitragspunkte
    Es werden mir notwendige Änderungen angezeigt:

    include/admin/ticker.php:

    <?php 
    #   Copyright by Topolino
    defined ('main') or die ( 'no direct access' );
    defined ('admin') or die ( 'only admin access' );
    
    $design = new design ( 'Admins Area', 'Admins Area', 2 );
    $design->header();
    
    function getColor(){
    for ($red=0;$red<=15;$red=$red+3)
    {
    for ($green=0;$green<=15;$green=$green+3)
    {
    for ($blue=0;$blue<=15;$blue=$blue+3)
    {
    $red_value=dechex($red).dechex($red);
    $green_value=dechex($green).dechex($green);
    $blue_value=dechex($blue).dechex($blue);
    @$pointer++;
    $hex_values_table[$pointer]=$red_value.$green_value.$blue_value;
    }
    }
    }
    $pointer=1;
    $rgb = '<table border="0" cellspacing="1" cellpadding="0">';
    for ($x=1;$x<=15;$x++)
    {
    $rgb .= '<tr>';
    for ($y=1;$y<=15;$y++)
    {
    $display_value='#'.@$hex_values_table[$pointer];
    if (!$display_value)$display_value="#ffffff";
    
    $rgb .= "<td bgcolor=$display_value><a href=javascript:setcolor('$display_value') alt=$display_value title=$display_value><img border=0 src=include/images/icons/pix.gif width=10px height=10px alt=$display_value></a></td>";
    $pointer++;
    }
    $rgb .= "</tr>";
    }
    $rgb .= "</table>";
    return ($rgb);
    }
    
    $direction_ar = array (
      'left'  => 'von rechts',
      'right' => 'von links',
    	'down'  => 'von oben',
    	'up'    => 'von unten'
    );
    
    $speed_ar = array (
      '1'  => '&raquo; eins',
      '2'  => '&raquo; zwei',
    	'3'  => '&raquo; drei',
    	'4'  => '&raquo; vier',
      '5'  => '&raquo; f&uuml;nf',
      '6'  => '&raquo; sechs',
    	'7'  => '&raquo; sieben',
    	'8'  => '&raquo; acht',
      '9'  => '&raquo; neun',
    	'10' => '&raquo; zehn',
    );
    
    if ( isset ($_POST['sub'])) {
      $title = escape($_POST['title'], 'string');
      $text  = escape($_POST['text'], 'string');
      $color = escape($_POST['color'], 'string');
      $speed  = escape($_POST['speed'], 'string');
      $direction  = escape($_POST['direction'], 'string');
      $width  = escape($_POST['width'], 'string');
      $height  = escape($_POST['height'], 'string');
      $size  = escape($_POST['size'], 'string');
      $frei  = escape($_POST['frei'], 'string');
      if ( empty ( $_POST['sid']) ) {
    	  $pos = db_count_query("SELECT COUNT(*) as anz FROM prefix_ticker");
    		db_query("INSERT INTO prefix_ticker (pos,title,text,color,speed,direction,width,height,size,frei) VALUES (".$pos.",'".$_POST['title']."','".$_POST['text']."','".$_POST['color']."','".$_POST['speed']."','".$_POST['direction']."','".$_POST['width']."','".$_POST['height']."','".$_POST['size']."','".$_POST['frei']."')");
    	} else {
        $sid  = escape($_POST['sid'], 'integer');
        db_query("UPDATE prefix_ticker SET title = '".$title."', text = '".$text."', color = '".$color."', speed = '".$speed."', direction = '".$direction."', width = '".$width."', height = '".$height."', size = '".$size."', frei = '".$frei."' WHERE id = ".$sid);
    	}
    }
    if ( $menu->get(1) == 'delete' ) {
      $id = $menu->get(2);
      $anz = db_count_query("SELECT COUNT(id) FROM prefix_ticker WHERE id = ".$id."");
    	if ( $anz == 1 ) {
    	  $pos = db_result(db_query("SELECT pos FROM prefix_ticker WHERE id = ".$id ),0);
        db_query("DELETE FROM prefix_ticker WHERE id = ".$id);
    		db_query("UPDATE prefix_ticker SET pos = pos - 1 WHERE pos > ".$pos);
    	}
    }
    if ( $menu->get(1) == 'u' OR $menu->get(1) == 'o' ) {
    	$a = db_count_query("SELECT COUNT(*) as anz FROM prefix_ticker");
      $np = ( $menu->get(1) == 'o' ? $menu->get(3) -1 : $menu->get(3) +1 );
      $np = ( $np >= ( $a -1 ) ? ( $a - 1) : $np );
      $np = ( $np < 0 ? 0 : $np );
      db_query("UPDATE prefix_ticker SET pos = ".$menu->get(3)." WHERE pos = ".$np);
      db_query("UPDATE prefix_ticker SET pos = ".$np." WHERE id = ".$menu->get(2));
    }
    if ( $menu->get(1) == 'c' ) {
      $n = ( $menu->get(3) == 3 ? 4 : 3 );
      db_query("UPDATE prefix_ticker SET text = ".$n." WHERE id = ".$menu->get(2)); 
    }
    $tpl = new tpl ( 'ticker', 1);
    
      if ( $menu->get(1) != 'edit' ) {
    	  $row = array(
    		  'sub'       => 'Eintragen',
    		  'pos'       => '',
    			'title'     => '',
    			'text'      => '',
    			'color'     => '',
    			'speed'     => '',
          'direction' => '',
    			'width'     => '',
    			'height'    => '',
    			'size'      => '',
          'frei'      => '',      
          'sid'       => ''
    	   );
    	} else {
        $sid = $menu->get(2);
    		$abf = 'SELECT title,text,color,speed,direction,width,height,size,frei,id as sid FROM prefix_ticker WHERE id = "'.$sid.'"';
    		$erg = db_query($abf);
    		$row = db_fetch_assoc($erg);
        $row['sub'] = '&Auml;ndern';
    	}
      if ($row['frei'] == 1 ) { 
            $row['frei1'] = 'checked'; 
            $row['frei0'] = ''; 
            } else { 
            $row['frei1'] = ''; 
            $row['frei0'] = 'checked';
            }
    
      if ( $menu->getA(1) == 'f' ) {
      db_query('UPDATE `prefix_ticker` SET `frei` = IF(`frei`>0,0,1) WHERE id = "'.$menu->getE(1).'" LIMIT 1');
      }
    	$row['direction'] = arlistee ( $row['direction'] , $direction_ar );		
    	$row['colorpicker'] = getColor();
      $row['speed'] = arlistee ( $row['speed'] , $speed_ar );
      $tpl->set_ar_out($row,0);
      $class = 'Cnorm';
    
    	$erg = db_query('SELECT * FROM prefix_ticker ORDER BY pos');
    	while ($r = db_fetch_assoc($erg) ) {
        $class = ( $class == 'Cnorm' ? 'Cmite' : 'Cnorm' );
        $text  = substr(preg_replace("/\015\012|\015|\012/", " ", htmlentities(strip_tags(stripslashes($r['text'])))),0,20);
        $sperre = $r['frei'] >= 1 ? 'nop' : 'jep';
        $sperren = $r['frei'] >= 1 ? 'Freischalten' : 'Sperren';
        echo '<tr class="'.$class.'"><td>'.$r['title'].'</td>';
        echo '<td>'.$text.'...</td>';
        echo '<td><a href="?ticker-edit-'.$r['id'].'"><img src="include/images/icons/edit.gif" /></a></td>';
    		echo '<td><a href="javascript:delcheck('.$r['id'].')"><img src="include/images/icons/del.gif"></a></td>';
        echo '<td><a href="?ticker-o-'.$r['id'].'-'.$r['pos'].'"><img src="include/images/icons/pfeilo.gif" border="0"></a></td>';
    		echo '<td><a href="?ticker-u-'.$r['id'].'-'.$r['pos'].'"><img src="include/images/icons/pfeilu.gif" border="0"></a></td>';
    	  echo '<td><a href="?ticker-f'.$r['id'].'"><img src="include/images/icons/'.$sperre.'.gif" alt="'.$sperren.'" title="'.$sperren.'" border="0"></a></td>';
        echo '</tr>';
    	}
    	$tpl->out(1);
      $abf = 'SELECT * FROM prefix_ticker ORDER BY pos LIMIT 0,1';
      $erg = db_query($abf);
    while ($row = db_fetch_object($erg)) { 
      echo '<marquee direction="'.$row->direction.'" scrollamount="'.$row->speed.'" style="height:'.$row->height.'px; width:'.$row->width.'px; color:'.$row->color.'; font-size:'.$row->size.'px;">';
      echo '<b> &raquo;<i>'.$row->title.':</i></b>&nbsp;'.$row->text.'';
      } 
      echo '</marquee>'; 
    	$tpl->out(2);
    $design->footer();
    ?>


    Dort wird mir htmlentities(strip_tags(stripslashes($r['text'])))),0,20) rot angezeigt.


    Zuletzt modifiziert von PlastSpritzer am 09.01.2016 - 14:36:14
    0 Mitglieder finden den Beitrag gut.
  2. #2
    User Pic
    Lord|Schirmer Administrator
    Registriert seit
    21.03.2007
    Beiträge
    7.675
    Beitragswertungen
    1212 Beitragspunkte
    $text = substr(preg_replace("/\015\012|\015|\012/", " ", htmlentities(strip_tags(stripslashes($r['text'])))),0,20);

    zu
    $text = substr(preg_replace("/\015\012|\015|\012/", " ", htmlentities(strip_tags(stripslashes($r['text'])))),0,20, ILCH_ENTITIES_FLAGS, ILCH_CHARSET);
    rules :: doku :: faq :: linkus
    0 Mitglieder finden den Beitrag gut.
  3. #3
    User Pic
    PlastSpritzer Mitglied
    Registriert seit
    14.11.2015
    Beiträge
    22
    Beitragswertungen
    0 Beitragspunkte
    Vielen dank für die schnelle Rückantwort und die Problemlösung, das hätte sich erledigt :]

    Eine notwendige Änderung wird mir noch angezeigt.
    include/includes/class/xajax.inc.php

    Dort wird mir htmlspecialchars($sData,ENT_COMPAT,'UTF-8')!=$sData);if($bSpecialChars) rot markiert angezeigt.

    function absorb($objResponse){$this->loadCommands($objResponse);}
    function addPluginCommand($objPlugin,$aAttributes,$mData){$aAttributes['plg']=$objPlugin->getName();return $this->addCommand($aAttributes,$mData);}
    function addCommand($aAttributes,$mData){$aAttributes['data']=$this->_encodeArray($mData);$this->aCommands[]=$aAttributes;return $this;}
    function _printHeader_XML(){print '<';print '?';print 'xml version="1.0"';$sEncoding=trim($this->sCharacterEncoding);if($this->sCharacterEncoding&&0 < strlen($sEncoding)){print ' encoding="';print $sEncoding;print '"';}
    print ' ?';print '>';}
    function _printResponse_XML(){print '<';print 'xjx>';if(null!==$this->returnValue){print '<';print 'xjxrv>';$this->_printArray_XML($this->returnValue);print '<';print '/xjxrv>';}
    foreach(array_keys($this->aCommands)as $sKey)
    $this->_printCommand_XML($this->aCommands[$sKey]);print '<';print '/xjx>';}
    function _printCommand_XML(&$aAttributes){print '<';print 'cmd';$mData='';foreach(array_keys($aAttributes)as $sKey){if($sKey){if('data'!=$sKey){print ' ';print $sKey;print '="';print $aAttributes[$sKey];print '"';}else
    $mData=&$aAttributes[$sKey];}
    }
    print '>';$this->_printArray_XML($mData);print '<';print '/cmd>';}
    function _printArray_XML(&$mArray){if('object'==gettype($mArray))
    $mArray=get_object_vars($mArray);if(false==is_array($mArray)){$this->_printEscapedString_XML($mArray);return;}
    print '<';print 'xjxobj>';foreach(array_keys($mArray)as $sKey){if(is_array($mArray[$sKey])){print '<';print 'e>';foreach(array_keys($mArray[$sKey])as $sInnerKey){if('k'==$sInnerKey||'v'==$sInnerKey){print '<';print $sInnerKey;print '>';$this->_printArray_XML($mArray[$sKey][$sInnerKey]);print '<';print '/';print $sInnerKey;print '>';}else{}
    }
    print '<';print '/e>';}else{}
    }
    print '<';print '/xjxobj>';}
    function _printEscapedString_XML(&$sData){if(null===$sData){print '';return;}
    if($this->bOutputEntities){print call_user_func_array('mb_convert_encoding',array(&$sData,'HTML-ENTITIES',$this->sCharacterEncoding));return;}
    $nCDATA=0;$bNoOpenCDATA=(false===strpos($sData,'<'.'![CDATA['));if($bNoOpenCDATA){$bNoCloseCDATA=(false===strpos($sData,']]>'));if($bNoCloseCDATA){$bSpecialChars=(htmlspecialchars($sData,ENT_COMPAT,'UTF-8')!=$sData);if($bSpecialChars)
    $nCDATA=1;}else
    $nCDATA=2;}else
    $nCDATA=2;if(0 < $nCDATA){print '<';print '![CDATA[';if(1 < $nCDATA){$aSegments=explode('<'.'![CDATA[',$sData);$aOutput=array();$nOutput=0;foreach(array_keys($aSegments)as $keySegment){$aFragments=explode(']]>',$aSegments[$keySegment]);$aStack=array();$nStack=0;foreach(array_keys($aFragments)as $keyFragment){if(0 < $nStack)
    array_push($aStack,']]]]><','![CDATA[>',$aFragments[$keyFragment]);else
    $aStack[]=$aFragments[$keyFragment];++$nStack;}
    if(0 < $nOutput)
    array_push($aOutput,'<','![]]><','![CDATA[CDATA[',implode('',$aStack));else
    $aOutput[]=implode('',$aStack);++$nOutput;}
    print implode('',$aOutput);}else
    print $sData;print ']]>';}else
    print $sData;}
    function _encodeArray(&$mData){if('object'===gettype($mData))
    $mData=get_object_vars($mData);if(false===is_array($mData))
    return $mData;$aData=array();foreach(array_keys($mData)as $sKey)
    $aData[]=array(
    'k'=>$sKey,
    'v'=>$this->_encodeArray($mData[$sKey])
    );return $aData;}
    }
    class xajaxCustomResponse{var $sOutput;var $sContentType;var $sCharacterEncoding;var $bOutputEntities;function xajaxCustomResponse($sContentType){$this->sOutput='';$this->sContentType=$sContentType;$objResponseManager=&xajaxResponseManager::getInstance();$this->sCharacterEncoding=$objResponseManager->getCharacterEncoding();$this->bOutputEntities=$objResponseManager->getOutputEntities();}
    function setCharacterEncoding($sCharacterEncoding){$this->sCharacterEncoding=$sCharacterEncoding;}
    function setOutputEntities($bOutputEntities){$this->bOutputEntities=$bOutputEntities;}
    function clear(){$this->sOutput='';}
    function append($sOutput){$this->sOutput .=$sOutput;}
    function absorb($objResponse){$this->sOutput .=$objResponse->getOutput();}
    function getContentType(){return $this->sContentType;}
    function getCharacterEncoding(){return $this->sCharacterEncoding;}
    function getOutputEntities(){return $this->bOutputEntities;}
    function getOutput(){return $this->sOutput;}
    function printOutput(){$sContentType=$this->sContentType;$sCharacterSet=$this->sCharacterEncoding;header("content-type: {$sContentType}; charset={$sCharacterSet}");print $this->sOutput;}



    Zuletzt modifiziert von PlastSpritzer am 09.01.2016 - 16:01:46
    0 Mitglieder finden den Beitrag gut.
  4. #4
    User Pic
    Lord|Schirmer Administrator
    Registriert seit
    21.03.2007
    Beiträge
    7.675
    Beitragswertungen
    1212 Beitragspunkte
    Bei Dir wird die alte xajax.inc.php verwendet und/oder nur geprüft.

    In der includes/loader.php muss folgendes stehen:

    # fremde classes laden
    if (version_compare(PHP_VERSION, '5.3') == -1) {
        require_once('include/includes/class/xajax.php4.inc.php');
    } else {
        require_once('include/includes/class/xajax.php5.inc.php');
    }


    Die include/includes/class/xajax.inc.php kann vernachlässigt bzw. entfernt werden.
    rules :: doku :: faq :: linkus
    0 Mitglieder finden den Beitrag gut.
Geschlossen

Zurück zu Fehlersuche und Probleme

Optionen: Bei einer Antwort zu diesem Thema eine eMail erhalten