Page 1 of 1

Problem mit älterem Template und php7

Posted: Sat 2. Feb 2019, 10:11
by lugau45
Hallo, ich verwende ein älteres Template was bis php5.6 ohne Probleme ging. Das Problem ist bei der Umstellung auf php7 lädt das design nicht mehr alles.
Nehme ich diese Zeile raus dann geht es.

Code: Select all

?php echo wbtoc();?
Also habe ich mal geschaut und der Fehler müsste ja dann in der template.htm sein.
Leider komme ich da nicht wirklich klar damit. Es müsste ja im oberen Vereich ein Fehler sein der bei php7 anders ist. Vielleicht hat einer von euch eine Idee.

Code: Select all

<?php
/*
CMSimple version 3.1 - Jun 2008
Small - simple - smart
� 1999-2009 Peter Andreas Harteg - peter@harteg.dk
� 2009 Dotcomwebdesign.com Template Designer - Do not remove our links unless a Remove Link License is purchased here: http://www.dotcomwebdesign.com/?Purchase-A-Licence

This program is free software; you can redistribute it and/or modify it under the terms of the Affero General Public License (AGPL) as published by Affero, Inc. version 1. All files in the CMSimple distribution (except other language files than English and Danish) are covered by this license.

IMPORTANT NOTICE: As covered by the AGPL Section 2(d), the "Powered by CMSimple"-link to cmsimple.dk must under no circumstances be removed from pages generated by this program (except in print facility). If you want to remove or hide this link from your pages, you must purchase CMSimple under a commercial license. This also applies testing purposes and setup at an intranet or internal network.

Please be aware, that the AGPL in Section 2(d) requires, that any modified version of the program runned public (ie. on the Internet) must have an additional download facility for the modified version. This also applies to any modification of the template. Therefore you should purchase a commercial license, if you do not want the design of your internet site to fall under the AGPL license.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the AGPL for more details.

A copy of the Affero General Public License is available at http://www.cmsimple.dk/?License:AGPL, if not, write to Affero, Inc., 510 Third Street, Suite 225, San Francisco, CA 94107 USA.

This copyright note must under no circumstances be removed from this file and any distribution of code covered by this license.

For further information about this license and how to purchase a commercial license, please see http://www.cmsimple.dk/?License

For downloads and information about installation, please see http://www.cmsimple.dk

##################################
#           TOC Script           #
##################################

*/

function wbtoc($start, $end)
    {
    global $h, $hc, $hl, $s, $l;

    $hcmen = array();
    $hcI = 0; 
    for ($i=0; $i < $hl-1; $i++)
    {
	$hcmem[$hcI++] = $hc[$i];
	if ($hc[$i+1] > $hc[$i] +1 )
	{
	    for ($j=$hc[$i]+1; $j <= $hc[$i+1]; $j++)
	    {
		if  (! (strpos( $h[$j] ,   'ruler:'  ) === false ) 
		     ||  !(strpos( $h[$j] , 'category:'  ) === false )
		     ||  !(strpos( $h[$j] , 'link:'  ) === false )
	         ||  !(strpos( $h[$j] , 'link_blank:'  ) === false )			 		 
			 
			 )
		  $hcmem[$hcI++]=$j;
	    }
	}
    }
    $hcmem[$hcI++] = $hc[count($hc)-1];
    $hlmem=count($hcmem);
    $ta=array();

    if (isset($start) && !isset($end))
        $end=$start;

    if (!isset($end))   $end=3;   if (!isset($start))   $start=1;

    for ($i=0; $i < $hlmem; $i++)
        {

        if ($l[$hcmem[$i]] == 1)
            {
            if ($start == 1)
                $ta[]=$hcmem[$i];

            $r1=$r2=$i;
            }

        if ($s == $hcmem[$i])
            {
            $s3=true;

            for ($j=$r1 + 1; $j < $hlmem; $j++)
                {
                if ($l[$hcmem[$j]] == 1)
                    break;

                if ($l[$hcmem[$j]] == 2)
                    {
                    if ($start < 3 && $end > 1)
                        $ta[]=$hcmem[$j];

                    $r2=$j;
                    $s3=false;
                    }

                if ($s == $hcmem[$j])
                    {
                    for ($k=$r2 + 1; $k < $hlmem; $k++)
                        {
                        if ($l[$hcmem[$k]] == 3)
                            {
                            if ($end > 2)
                                $ta[]=$hcmem[$k];
                            }
                        else
                            {
                            $s3=false;
                            break;
                            }
                        }
                    }

                if ($l[$hcmem[$j]] == 3 && $l[$s] == 1 && $s3)
                    if ($end > 2)
                        $ta[]=$hcmem[$j];
                }
            }
        }

    return wbli($ta, $start, $hcmem, $hlmem);
    }

function aWithClass($i, $x, $clsname)
 {
    global $sn, $u;
	$elip = $x;
	$title = '';	   
	if ( (strpos( $x, 'link:'  ) === false ) && (strpos( $x, 'link_blank:'  ) === false ) ) 
    {
	   if (strlen($x) > 30) {
	     $elip = substr($x,0,20) . '...';	
	     $title = ' Title = "'. $x  .'"';    
	   }
        return '<a  class="'.  $clsname.'" href="' . $sn . '?' . $u[$i].'" ' . $title . '>' .$elip. '</a>' ;
	}
	else
	{
	     list ($item,$url)= split('@',$x); 
		 if (strpos( $x, 'link_blank:'  ) === false )  
         {
		    $item =  str_replace('link:','',$item);
	        if (strlen($item) > 21) {
   	          $title = ' Title = "'. $item  .'"';     
	          $item = substr($item,0,20) . '...';	   
	  
	        }
	        return '<a class="'.  $clsname.'" href="' . $url. '" ' . $title . '>' .$item. '</a>' ;
		 }
		 else
		 {
		   $item =  str_replace('link_blank:','',$item);
	       if (strlen($item) > 21) {
	         $title = ' Title = "'. $item  .'"';    
	         $item = substr($item,0,20) . '...';	    

	       }
	       return '<a  class="'. $clsname.'" href="' . $url. '" ' . $title . ' target="_" >' .$item. '</a>' ;
		 } 
	}

}

function wbli($ta, $st, $hc, $hl)

    {

    global $s,  $l, $h;

    if (count($ta) == 0)
        return;

    $t='';
    if ($st == 'submenu' || $st == 'search')
        $t.='<ul class="' . $st . '">';
    $b=0;
    if ($st == 1 || $st == 2 || $st == 3)
        {
        $b=$st - 1;
        $st='menulevel';
        }

    $j    =0;
    $le   =0;
    $lf[0]=$lf[1]=$lf[2]=$lf[3]=false;

    for ($i=0; $i < $hl; $i++)
        {

        if (!isset($ta[$j]))
            break;

        if ($hc[$i] != $ta[$j])
            continue;

        $tf=($s != $ta[$j]);
   
     if ($st == 'menulevel' || $st == 'sitemaplevel')
            {
            for ($k=(isset($ta[$j - 1]) ? $l[$ta[$j - 1]] : $b); $k < $l[$ta[$j]]; $k++)
                $t.='<ul class="' . $st . ($k + 1) . '">';
            }
        $t.='<li class="';

        if (!$tf)
            $t.='s';

        $t.='navitem';

	    $sU = '';

        if (isset($hc[$i + 1]))	
            if ($l[$hc[$i + 1]] > $l[$ta[$j]])  {
                $t.='s';
				$sU='u';
			}

        $t.='">';

  if  (! (strpos( $h[$ta[$j]] ,   'category:'  ) === false )) 
  {
     $t.='<div class="menuspacer">'.str_replace('category:'  , '', $h[$ta[$j]]) .'</div>';
  } 
  else 
  {
    if  (! (strpos( $h[$ta[$j]] ,   'ruler:'  ) === false )) 
    {
        $t.='<div class="menuruler"></div>';
   }
   else
   {	
     $sA = 'ina';
      if ($s == $ta[$j])  $sA =  'a';
 //     if (((isset($ta[$j +1]) ? $l[$ta[$j +1]] : $b) > $l[$ta[$j]]) && ( $l[$s] > $l[$ta[$j]])  )  $sA = 'o';  

      $sN = '' . $l[$ta[$j]];

      $sP = '' ;
      if ((isset($ta[$j -1]) ? $l[$ta[$j -1]] : $b) < $l[$ta[$j]])  $sP = 'b' ;
      if ((isset($ta[$j +1]) ? $l[$ta[$j +1]] : $b) < $l[$ta[$j]]) $sP = 'e' ;

  //    $sStyleName = $sU.$sA.$sN.$sP; 
   $sStyleName = $sA. 'ctiveclass' . $sN;
  	  
      $t.=aWithClass($ta[$j], $h[$ta[$j]] ,$sStyleName );
     }
 }

        if ($st == 'menulevel' || $st == 'sitemaplevel')
            {
            if ((isset($ta[$j + 1]) ? $l[$ta[$j + 1]] : $b) > $l[$ta[$j]])
                $lf[$l[$ta[$j]]]=true;
            else
                {
                $t.='</li>';
                $lf[$l[$ta[$j]]]=false;
                }

            for ($k=$l[$ta[$j]]; $k > (isset($ta[$j + 1]) ? $l[$ta[$j + 1]] : $b); $k--)
                {
                $t.='</ul>';

                if ($lf[$k - 1])
                    {
                    $t.='</li>';
                    $lf[$k - 1]=false;
                    }
                }

            ;
            }
        else
            $t.='</li>';
        $j++;
        }

    if ($st == 'submenu' || $st == 'search')
        $t.='</ul>';
    return $t;
    }
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<!-- Start Cookie Plugin -->
<script type="text/javascript">
  window.cookieconsent_options = {
  message: 'Diese Website nutzt Cookies, um bestmögliche Funktionalität bieten zu können.',
  dismiss: 'Ok, verstanden',
  learnMore: 'Mehr Infos zum Datenschutz',
  link: 'https://blumenhaus-haenisch.de/?Impressum',
  theme: 'dark-top'
 };
</script>
<script type="text/javascript" src="//s3.amazonaws.com/valao-cloud/cookie-hinweis/script.js"></script>
<!-- Ende Cookie Plugin --> 
<head>
<?php echo head();?>
</head>
<body bgcolor="#ffffff" topmargin="0" background="<?php echo $pth['folder']['templateimages']?>blue-bk.jpg" style="background-repeat: repeat-x"<?php echo onload();?>><a name="top"></a>
<!--Fireworks 8 Dreamweaver 8 target.  Created Wed Jun 03 12:46:30 GMT+1000 (AUS Eastern Standard Time) 2009-->
<SCRIPT Language="JavaScript">
<!-- hide from old browsers
  function GetDay(intDay){
    var DayArray = new Array("Sunday", "Monday", "Tuesday", "Wednesday", 
                         "Thursday", "Friday", "Saturday")
    return DayArray[intDay]
    }
  function GetMonth(intMonth){
    var MonthArray = new Array("January", "February", "March",
                               "April", "May", "June",
                               "July", "August", "September",
                               "October", "November", "December") 
    return MonthArray[intMonth] 	  	 
    }
  function getDateStrWithDOW(){
    var today = new Date()
    var year = today.getYear()
    if(year<1000) year+=1900
    var todayStr = GetDay(today.getDay()) + ", "
    todayStr += GetMonth(today.getMonth()) + " " + today.getDate()
    todayStr += ", " + year
    return todayStr
    }
//-->
</SCRIPT>
<div align="center">
<table border="0" cellpadding="0" cellspacing="0" width="895">
<!-- fwtable fwsrc="template.png" fwbase="template.jpg" fwstyle="Dreamweaver" fwdocid = "2123675382" fwnested="0" -->
  <tr>
   <td><img src="<?php echo $pth['folder']['templateimages']?>spacer.gif" width="21" height="1" border="0" alt="" /></td>
   <td><img src="<?php echo $pth['folder']['templateimages']?>spacer.gif" width="398" height="1" border="0" alt="" /></td>
   <td><img src="<?php echo $pth['folder']['templateimages']?>spacer.gif" width="454" height="1" border="0" alt="" /></td>
   <td><img src="<?php echo $pth['folder']['templateimages']?>spacer.gif" width="22" height="1" border="0" alt="" /></td>
   <td><img src="<?php echo $pth['folder']['templateimages']?>spacer.gif" width="1" height="1" border="0" alt="" /></td>
  </tr>

  <tr>
   <td colspan="4" background="<?php echo $pth['folder']['templateimages']?>template_r1_c1.jpg">
	<table border="0" width="100%" cellspacing="0" cellpadding="0">
		<tr>
			<td width="35"> </td>
			<td>
			<table border="0" width="100%" cellspacing="0" cellpadding="0">
				<tr>
					<td>
					<p align="right"><!--webbot bot="HTMLMarkup" startspan --><tr><td valign="top" align="right" class="searchbox">
<?php echo searchbox();?>
</td></tr><!--webbot bot="HTMLMarkup" endspan i-checksum="41611" --></td>
				</tr>
			</table>
			</td>
			<td width="40"> </td>
		</tr>
	</table>
	</td>
   <td><img src="<?php echo $pth['folder']['templateimages']?>spacer.gif" width="1" height="59" border="0" alt="" /></td>
  </tr>
  <tr>
   <td colspan="2" background="<?php echo $pth['folder']['templateimages']?>template_r2_c1.jpg">
	<table border="0" width="100%" cellspacing="0" cellpadding="0">
		<tr>
			<td width="35"> </td>
			<td>
			<table border="0" width="100%" cellspacing="0" cellpadding="0">
				<tr>
					<td><!--webbot bot="HTMLMarkup" startspan --><tr><td valign="top" align="left" class="date"><SCRIPT Language="JavaScript">
<!-- hide from old browsers
    document.write(getDateStrWithDOW())
//-->
</SCRIPT></td></tr><!--webbot bot="HTMLMarkup" endspan i-checksum="33387" --></td>
				</tr>
			</table>
			</td>
		</tr>
	</table>
	</td>
   <td colspan="2" background="<?php echo $pth['folder']['templateimages']?>template_r2_c3.jpg">
	<table border="0" width="100%" cellspacing="0" cellpadding="0">
		<tr>
			<td>
			<table border="0" width="100%" cellspacing="0" cellpadding="0">
				<tr>
					<td>
					<p align="right"><!--webbot bot="HTMLMarkup" startspan --><tr><td valign="top" align="right" class="menu"><?php echo languagemenu();?></td></tr><!--webbot bot="HTMLMarkup" endspan i-checksum="30170" --></td>
				</tr>
			</table>
			</td>
			<td width="40"> </td>
		</tr>
	</table>
	</td>
   <td><img src="<?php echo $pth['folder']['templateimages']?>spacer.gif" width="1" height="35" border="0" alt="" /></td>
  </tr>
  <tr>
   <td colspan="4"><img name="template_r3_c1" src="<?php echo $pth['folder']['templateimages']?>template_r3_c1.jpg" width="895" height="170" border="0" id="template_r3_c1" alt="" /></td>
   <td><img src="<?php echo $pth['folder']['templateimages']?>spacer.gif" width="1" height="170" border="0" alt="" /></td>
  </tr>
  <tr>
   <td colspan="4" background="<?php echo $pth['folder']['templateimages']?>template_r4_c1.jpg">
	<table border="0" width="100%" cellspacing="0" cellpadding="0">
		<tr>
			<td width="42"> </td>
			<td>
			<table border="0" width="100%" cellspacing="0" cellpadding="0">
				<tr>
					<td><!--webbot bot="HTMLMarkup" startspan --><tr><td valign="top" align="left" class="locator"><?php echo locator();?></td></tr><!--webbot bot="HTMLMarkup" endspan i-checksum="10657" --></td>
				</tr>
			</table>
			</td>
			<td width="40"> </td>
		</tr>
	</table>
	</td>
   <td><img src="<?php echo $pth['folder']['templateimages']?>spacer.gif" width="1" height="33" border="0" alt="" /></td>
  </tr>
  <tr>
   <td valign="top" background="<?php echo $pth['folder']['templateimages']?>template_r6_c1.jpg"><img name="template_r5_c1" src="<?php echo $pth['folder']['templateimages']?>template_r5_c1.jpg" width="21" height="173" border="0" id="template_r5_c1" alt="" /></td>
   <td rowspan="2" colspan="2" style="background-image: url('<?php echo $pth['folder']['templateimages']?>template_r5_c2.jpg'); background-repeat: no-repeat; background-position: left top" bgcolor="#FFFFFF" align="left" valign="top">
	<table border="0" width="100%" cellspacing="0" cellpadding="0">
		<tr>
			<td> </td>
		</tr>
		<tr>
			<td align="left" valign="top">
	<table border="0" width="100%" cellspacing="0" cellpadding="0">
		<tr>
			<td width="15"> </td>
			<td width="180" align="left" valign="top">
			<table border="0" width="100%" cellspacing="0" cellpadding="0">
				<tr>
					<td><!--webbot bot="HTMLMarkup" startspan --><tr><td valign="top">
<div id="navcontainer"><?php echo wbtoc();?></div>
	<tr>
		<td> </td>
	</tr>
</td></tr><tr><td valign="top" class="menu"><?php echo sitemaplink();?></td></tr>
<tr><td valign="top" class="menu"><?php echo printlink();?></td></tr>
<tr><td valign="top" class="menu"><?php echo mailformlink();?></td></tr>
<tr><td valign="top" class="menu"><?php echo guestbooklink();?></td></tr>
	<tr>
		<td> </td>
	</tr>
<tr><td valign="top" class="login"><?php echo loginlink();?></td></tr>
	<tr>
		<td> </td>
	</tr>
<tr><td valign="top" class="menu"><?php echo lastupdate();?></td></tr>

<tr><td valign="top">
<?php include("./jax_calendar/modules/calendar.inc.php"); ?>
</td></tr><!--webbot bot="HTMLMarkup" endspan i-checksum="5578" --></td>
				</tr>
				<tr>
					<td> </td>
				</tr>
				<tr>
					<td><!--webbot bot="HTMLMarkup" startspan --><tr><td valign="top" class="menu"><?=newsbox(News)?></td></tr><!--webbot bot="HTMLMarkup" endspan i-checksum="34647" --></td>
				</tr>
				<tr>
					<td> </td>
				</tr>
			</table>
			</td>
			<td width="25"> </td>
			<td align="left" valign="top">
			<table border="0" width="100%" cellspacing="0" cellpadding="0">
				<tr>
					<td><!--webbot bot="HTMLMarkup" startspan --><tr><td valign="top" class="menu"><?=newsbox(News2)?></td></tr><!--webbot bot="HTMLMarkup" endspan i-checksum="37871" --></td>
				</tr>
				<tr>
					<td><!--webbot bot="HTMLMarkup" startspan --><tr><td valign="top">
<?php echo editmenu();?>
<?php echo content();?>
<?php echo submenu();?>
</td></tr><!--webbot bot="HTMLMarkup" endspan i-checksum="9291" --></td>
				</tr>
				<tr>
					<td><!--webbot bot="HTMLMarkup" startspan --><tr><td valign="top" class="menu"><?=newsbox(News3)?></td></tr><!--webbot bot="HTMLMarkup" endspan i-checksum="37873" --></td>
				</tr>
				<tr>
					<td> </td>
				</tr>
				<tr>
							<td>
							<table border="0" width="100%" cellspacing="0" cellpadding="0">
								<tr>
									<td width="33%">
									<table border="0" width="100%" cellspacing="0" cellpadding="0">
										<tr>
											<td>
											<p align="left">
											<!--webbot bot="HTMLMarkup" startspan --><tr><td valign="top" 

align="left" class="navigator">
<?php echo previouspage();?>
</td></tr><!--webbot bot="HTMLMarkup" endspan i-checksum="38092" --></td>
										</tr>
									</table>
									</td>
									<td width="33%">
									<table border="0" width="100%" cellspacing="0" cellpadding="0">
										<tr>
											<td>
											<p align="center">
											<!--webbot bot="HTMLMarkup" startspan --><tr><td align="center" 

class="navigator">
<a href="#top" class="navigator"><?php echo top();?></a>
</td></tr><!--webbot bot="HTMLMarkup" endspan i-checksum="13457" --></td>
										</tr>
									</table>
									</td>
									<td width="33%">
									<table border="0" width="100%" cellspacing="0" cellpadding="0">
										<tr>
											<td>
											<p align="right">
											<!--webbot bot="HTMLMarkup" startspan --><tr><td valign="top" 

align="right" class="navigator">
<?php echo nextpage();?>
</td></tr><!--webbot bot="HTMLMarkup" endspan i-checksum="22484" --></td>
										</tr>
									</table>
									</td>
								</tr>
							</table>
							</td>
						</tr>
				<tr>
					<td> </td>
				</tr>
			</table>
			</td>
			<td width="18"> </td>
		</tr>
	</table>
			</td>
		</tr>
	</table>
	</td>
   <td valign="top" background="<?php echo $pth['folder']['templateimages']?>template_r6_c4.jpg"><img name="template_r5_c4" src="<?php echo $pth['folder']['templateimages']?>template_r5_c4.jpg" width="22" height="173" border="0" id="template_r5_c4" alt="" /></td>
   <td><img src="<?php echo $pth['folder']['templateimages']?>spacer.gif" width="1" height="173" border="0" alt="" /></td>
  </tr>
  <tr>
   <td background="<?php echo $pth['folder']['templateimages']?>template_r6_c1.jpg"><img name="template_r6_c1" src="<?php echo $pth['folder']['templateimages']?>template_r6_c1.jpg" width="21" height="15" border="0" id="template_r6_c1" alt="" /></td>
   <td background="<?php echo $pth['folder']['templateimages']?>template_r6_c4.jpg"><img name="template_r6_c4" src="<?php echo $pth['folder']['templateimages']?>template_r6_c4.jpg" width="22" height="15" border="0" id="template_r6_c4" alt="" /></td>
   <td><img src="<?php echo $pth['folder']['templateimages']?>spacer.gif" width="1" height="15" border="0" alt="" /></td>
  </tr>
  <tr>
   <td colspan="4" background="<?php echo $pth['folder']['templateimages']?>template_r7_c1.jpg">
	<table border="0" width="100%" cellspacing="0" cellpadding="0">
		<tr>
			<td align="center"><!--webbot bot="HTMLMarkup" startspan --><tr><td valign="top" align="center" class="sitename">
<?php echo sitename();?>
</td></tr><!--webbot bot="HTMLMarkup" endspan i-checksum="49042" --></td>
		</tr>
		<tr>
			<td align="center"><!--webbot bot="HTMLMarkup" startspan --><tr>
      <td width="100%">
      <p align="center" class="copyright"><a target="_blank" href="http://www.cmsimple.dk">Powered 
      By CMSimple.dk</a>
      <a target="_blank" href="http://www.dotcomwebdesign.com">| Designed By 
      DotcomWebdesign.com</a></td>
</td>
    </tr><!--webbot bot="HTMLMarkup" endspan i-checksum="1889" --></td>
		</tr>
	</table>
	</td>
   <td><img src="<?php echo $pth['folder']['templateimages']?>spacer.gif" width="1" height="75" border="0" alt="" /></td>
  </tr>
</table>
</div>
</body>
</html>

Re: Problem mit älterem Template und php7

Posted: Sat 2. Feb 2019, 12:03
by Gert
Hallo,

auweia, so etwas habe ich ja schon lange nicht mehr gesehen ;)

Der Autor dieses Templates ist schon lange nicht mehr aktiv, von dieser Seite ist also keine Hilfe zu erwarten.

Willst Du dieses Template wirklich php 7 tauglich machen? Ich glaube, es ist einfacher, ein modernes Template zu verwenden, man kann ja die Hintergrundbilder wieder verwenden und ein aktuelles Template im Design anpassen. Das bissel Inhalt ist auch schnell überarbeitet und für responsive Templates angepasst. Alles weniger Aufwand als dieses Uralt-Template zu überarbeiten.

Diese Website braucht ganz einfach ein grundsätzliches Redesign, alles andere ist verschwendete Zeit,

Gert

Re: Problem mit älterem Template und php7

Posted: Sun 3. Feb 2019, 09:46
by lugau45
Ja dann werde ich es mal versuchen.