0 "); while($rowcounter=mysql_fetch_array($resultcounter)) { $totpages = $rowcounter[0]; } if ($totpages > $classitemsno) { $pagerem = $totpages % $classitemsno; $pagecount = ($totpages - $pagerem) / $classitemsno; if ($pagerem > 0 ){$pagecount++ ; } $pgfirst=0; $pglast=($pagecount-1)*$classitemsno; $pgnext=$pagect+$classitemsno; $pgprev=$pagect-$classitemsno; $pgct=$pagect/$classitemsno; if ($pgct == 0 ) { $pgprev=0; } if ($pgct == ($pagecount-1) ) { $pgnext=$pglast; } $stlclasscounter=str_replace('#HZGSUBTOT#',$totpages,$stlclasscounter); $stlclasscounter=str_replace('#HZGPG#',$pgct+1,$stlclasscounter); $stlclasscounter=str_replace('#HZGPGFIRST#',"parts.php?id=".$id."&pagect=".$pgfirst,$stlclasscounter); $stlclasscounter=str_replace('#HZGPGPREV#',"parts.php?id=".$id."&pagect=".$pgprev,$stlclasscounter); $stlclasscounter=str_replace('#HZGPGNEXT#',"parts.php?id=".$id."&pagect=".$pgnext,$stlclasscounter); $stlclasscounter=str_replace('#HZGPGLAST#',"parts.php?id=".$id."&pagect=".$pglast,$stlclasscounter); $tmpclass=str_replace('#HZGCOUNTER#',$stlclasscounter,$tmpclass); } else { $tmpclass=str_replace('#HZGCOUNTER#','',$tmpclass); } if ($classfuth != 0 ) { $resultfuth = mysql_query("SELECT * from class where id = $classfuth "); while($rowfuth=mysql_fetch_array($resultfuth )) { $futhname=$rowfuth["ANAME"]; } $tmplnk=str_replace('#HZGLNK#',"parts.php?id=".$classfuth,$stlclassfuth); $tmpclassfuth=str_replace('#HZGCLASSFUTH#',$futhname,$tmplnk); $tmpclass=str_replace('#HZGCLASSFUTH#',$tmpclassfuth,$tmpclass); } else { $tmpclass=str_replace('#HZGCLASSFUTH#',"",$tmpclass); } if ($classpctr != NULL) {$tmpclassbody=$tmpclassbody."

";} if ($classrmrk != NULL) {$tmpclassbody=$tmpclassbody."

".$classrmrk."

";} $tmpclass=str_replace('#HZGCLASSBODY#',$tmpclassbody,$tmpclass); $resultchild = mysql_query("SELECT * from class where futh = $id order by ID ASC "); while($rowchild=mysql_fetch_array($resultchild )) { $childid=$rowchild["ID"]; $childname=$rowchild["ANAME"]; $tmplnk=str_replace('#HZGLNK#',"parts.php?id=".$childid,$stlclasschildobj); $tmpclassobj=$tmpclassobj.str_replace('#HZGCLASSCHILD#',$childname,$tmplnk); } if ($tmpclassobj != NULL) { $tmpclasschild=str_replace('#HZGCLASSCHILDS#',$tmpclassobj ,$stlclasschild); $tmpclass=str_replace('#HZGCLASSCHILDS#',$tmpclasschild,$tmpclass); } else { $tmpclass=str_replace('#HZGCLASSCHILDS#',"",$tmpclass); } if ($pagect == NULL){$pagect = 0;} $itemscontent=$itemscontent.""; $linecount=1; //$tdwidth=round(100/$objinline)."%"; $resultsub = mysql_query("SELECT * from pages where FIND_IN_SET($id,(CLASS))>0 order by ID $classordway limit $pagect,$classitemsno"); while($rowsub=mysql_fetch_array($resultsub )) { $subid=$rowsub["ID"]; $dataname=$rowsub["ANAME"]; $dataintro=$rowsub["AINTRO"]; $pctr=$rowsub["PCTR"]; $thumb=$pctr; $datadt=$rowsub["DT"]; $authid=$rowsub["AUTHID"]; $authname=$rowsub["AAUTHOR"]; $visits=$rowsub["CNTR"]; $tmplnk="article.php?id=".$subid; $tmpdt=date( ' d/m/Y ',$datadt); $pctrpath="images/img/".$pctr; $thumbpath="images/thumb/".$thumb; if ($pctr == NULL) { $pctrpath="images/nopctr.gif"; $thumbpath="images/nothumb.gif"; } if ($linecount > $objinline) { $itemscontent=$itemscontent.""; $linecount=1; } $linecount++; $tmpobjstyle=$objstyle; $itemscontent=$itemscontent.""; if ( ! file_exists($thumbpath)){$thumbpath="images/nothumb.gif";} $vars=array('#HZGNAME#','#HZGPCT#','#HZGSUBLINK#','#HZGSUBNAME#','#HZGSUBDT#','#HZGSUBUSR#','#HZGSUBINTRO#','#HZGSUBIMG#','#HZGSUBTHUMB#','#HZGSUBVISITS#'); $values=array($dataname,$pctrpath,$tmplnk,$dataname,$tmpdt,$authname,$dataintro,$pctrpath,$thumbpath,$visits); $tmpobjstyle=str_replace($vars,$values,$tmpobjstyle); $itemscontent=$itemscontent.$tmpobjstyle; $itemscontent=$itemscontent.""; } $itemscontent=$itemscontent.""; $stlclassitem=str_replace('#HZGCLASSITEMS#',$itemscontent,$stlclassitem); $tmpclass=str_replace('#HZGCLASSITEMS#',$stlclassitem,$tmpclass); $stlclasshtml=$tmpclass; include("datapart.php"); echo("$stlclasshtml"); }} ?>