Exemplo n.º 1
0
    if ($page_pg && $page_pg < $item['quantity']) {
        $next_href = sprintf(PICMAN_PICTURE . "i%03dp%03d.html", $page_id, $page_pg + 1);
        $next_name = LoadTemplateFile(PICMAN_TEMPLATE_DIR . $TemplateDir . '/' . 'group_next.html');
    } elseif ($page_pg == $item['quantity']) {
        $next_href = sprintf(PICMAN_PICTURE . "i%03dp%03d.html", $page_id, $page_pg);
    }
    if ($page_pg && $page_pg > 1) {
        $prev_href = sprintf(PICMAN_PICTURE . "i%03dp%03d.html", $page_id, $page_pg - 1);
        $prev_name = LoadTemplateFile(PICMAN_TEMPLATE_DIR . $TemplateDir . '/' . 'group_prev.html');
    }
    $picdir = preg_replace('/[\\/]+/', '/', PICMAN_IMAGE . "{$imgdir}/" . $item['picsubdir'] . "/");
    #	echo "[$item['holes']]<BR>";
    $mov_holes = 0;
    // Dodanie numerów których nie ma
    if (count($picholes)) {
        $iter = 1;
        $nr = $page_pg;
        while ($iter <= $nr) {
            if (in_array($iter + $item['startnum'] - 1, $picholes)) {
                $mov_holes++;
                $nr++;
            }
            $iter++;
        }
    }
    //	echo "<BR>";
    //	echo "$mov_holes - $page_pg -- $item['startnum'] -- ".($page_pg + $mov_holes + ($item['startnum'] - 1))."<BR>\n";
    $content = sprintf($picdir . $item['pictemp'], $page_pg + $mov_holes + $item['startnum'] - 1);
}
echo UpdateTemplate($pic_temp, array('title' => "Picture {$page_pg} of " . $item['quantity'], 'cols' => $item['cols'], 'rows' => $item['rows'], 'quantity' => $item['quantity'], 'picnr' => $page_pg, 'topcat' => GetTopCatsForCollection($page_id, $page_pg), 'prevhref' => $prev_href, 'prevname' => $prev_name, 'nexthref' => $next_href, 'nextname' => $next_name, 'image' => $content, 'imgdir' => PICMAN_TEMPLATE_IMG . $TemplateDir));
Exemplo n.º 2
0
                if (in_array($iter + $img_add, $picholes)) {
                    $mov_holes++;
                    $nr++;
                }
                $iter++;
            }
        }
        for ($r = 1; $r <= $item['rows'] && $inum <= $item['quantity']; $r++) {
            $content .= '<tr valign="middle">';
            for ($c = 1; $c <= $item['cols'] && $inum <= $item['quantity']; $c++) {
                if (count($picholes)) {
                    while (in_array($inum + $img_add + $mov_holes, $picholes)) {
                        $img_add++;
                    }
                }
                $icon_num = $inum + $img_add + $mov_holes;
                $href_num = in_array('LI', $group_options) ? $icon_num : $inum;
                $icon_thumb = sprintf($item['thumbtemp'], $icon_num);
                $content .= UpdateTemplate($icon_temp, array('href' => sprintf($href, $href_num), 'icon' => is_file($absidir . $icon_thumb) ? $icondir . $icon_thumb : DEFAULT_THUMB_ICON));
                $inum++;
            }
            $content .= '</tr>' . "\n";
        }
    } else {
        $content = 'Jesteśmy na stronie index';
    }
}
$catdir = PICMAN_IMAGE . GetDirForCat(0, $page_id);
$grpdir = $catdir . '/' . $item['coldir'] . '/';
echo UpdateTemplate($group_temp, array('prevhref' => $prev_href, 'prevname' => $prev_name, 'nexthref' => $next_href, 'nextname' => $next_name, 'title' => $item['title'], 'header' => $item['header'], 'desc' => $item['description'], 'cols' => $item['cols'], 'rows' => $item['rows'], 'dateupdate' => date('Y-m-d', strtotime($item['date_create'])), 'quantity' => $item['quantity'], 'indeximg' => $indeximg, 'topcat' => GetTopCatsForCollection($page_id, $page_num), 'pagesel' => $pagesel, 'content' => $content, 'imgdir' => PICMAN_TEMPLATE_IMG . $TemplateDir, 'catdir' => $catdir, 'grpdir' => $grpdir));