From ddd1a2176cbaa35727c7d064b9806f045a25b25e Mon Sep 17 00:00:00 2001 From: Stefan Becker Date: Wed, 30 Dec 2009 13:59:08 +0000 Subject: [PATCH] "fixes Problem with pagerepead and multipe Adresslabels on one page" --- etemplate/inc/class.bo_merge.inc.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/etemplate/inc/class.bo_merge.inc.php b/etemplate/inc/class.bo_merge.inc.php index f537d7d0ee..476597e010 100644 --- a/etemplate/inc/class.bo_merge.inc.php +++ b/etemplate/inc/class.bo_merge.inc.php @@ -298,7 +298,7 @@ abstract class bo_merge } list($Labelstart,$Labelrepeat,$Labeltend) = preg_split('/\$\$label\$\$/',$contentrepeat,-1, PREG_SPLIT_NO_EMPTY); //get the Lable content preg_match_all('/\$\$labelplacement\$\$/',$contentrepeat,$countlables, PREG_SPLIT_NO_EMPTY); - $countlables = count($countlables[0])+1; + $countlables = count($countlables[0]); preg_replace('/\$\$labelplacement\$\$/','',$Labelrepeat,1); if ($countlables > 1) $lableprint = true; if (count($ids) > 1 && !$contentrepeat) @@ -392,13 +392,13 @@ abstract class bo_merge foreach ($contentrep as $Label) { + $contentrepeatpages[$countpage] = preg_replace('/\$\$labelplacement\$\$/',$Label,$contentrepeatpages[$countpage],1); $count=$count+1; - if ($count % $countlables == 0) + if (($count % $countlables) == 0 && count($contentrep)>$count) //new page { - $countpage=$countpage+1; + $countpage = $countpage+1; $contentrepeatpages[$countpage] = $Labelstart.$Labeltend; } - $contentrepeatpages[$countpage] = preg_replace('/\$\$labelplacement\$\$/',$Label,$contentrepeatpages[$countpage],1); } $contentrepeatpages[$countpage] = preg_replace('/\$\$labelplacement\$\$/','',$contentrepeatpages[$countpage],-1); //clean empty fields