function shop_image_tag($img = array(), $counter = 0, $title = '')
{
    $config =& $GLOBALS['_tmpl']['config'];
    // set image values
    $width = $config['image_' . $config['mode'] . '_width'];
    $height = $config['image_' . $config['mode'] . '_height'];
    $crop = $config['image_' . $config['mode'] . '_crop'];
    $caption = empty($img['caption']) ? '' : ' :: ' . $img['caption'];
    $title = empty($title) ? '' : ' title="' . html($title . $caption) . '"';
    $thumb_image = get_cached_image(array("target_ext" => $img['f_ext'], "image_name" => $img['f_hash'] . '.' . $img['f_ext'], "max_width" => $width, "max_height" => $height, "thumb_name" => md5($img['f_hash'] . $width . $height . $GLOBALS['phpwcms']["sharpen_level"] . $crop . $GLOBALS['phpwcms']['colorspace']), 'crop_image' => $crop));
    if ($thumb_image) {
        // now try to build caption and if neccessary add alt to image or set external link for image
        $caption = getImageCaption($img['caption']);
        // set caption and ALT Image Text for imagelist
        $capt_cur = html($caption[0]);
        $caption[3] = empty($caption[3]) ? '' : ' title="' . html($caption[3]) . '"';
        //title
        $caption[1] = html(empty($caption[1]) ? $img['f_name'] : $caption[1]);
        $list_img_temp = '<img src="' . PHPWCMS_IMAGES . $thumb_image[0] . '" ';
        $list_img_temp .= $thumb_image[3] . ' alt="' . $caption[1] . '"' . $caption[3] . $title . ' border="0" />';
        // use lightbox effect
        if ($config['image_' . $config['mode'] . '_lightbox']) {
            $a = '<a href="img/cmsimage.php/';
            $a .= $config['image_zoom_width'] . 'x' . $config['image_zoom_height'] . '/';
            $a .= $img['f_hash'] . '.' . $img['f_ext'] . '" ';
            $a .= 'target="_blank" rel="lightbox' . $config['lightbox_id'] . '"' . $caption[3] . $title . '>';
            $list_img_temp = $a . $list_img_temp . '</a>';
        }
        $class = empty($counter) ? '' : ' img-num-' . $counter;
        return '<span class="shop-article-img' . $class . '">' . $list_img_temp . '</span>';
    }
    return '';
}
function showPollImage($image, $zoom = 0)
{
    $image_border = ' border="' . intval($GLOBALS["template_default"]["article"]["imagelist_border"]) . '"';
    if (empty($GLOBALS["template_default"]["article"]["imagelist_imgclass"])) {
        $image_imgclass = '';
    } else {
        $image_imgclass = ' class="' . $GLOBALS["template_default"]["article"]["imagelist_imgclass"] . '"';
    }
    $thumb_image = get_cached_image(array("target_ext" => $image[3], "image_name" => $image[2] . '.' . $image[3], "max_width" => $image[4], "max_height" => $image[5], "thumb_name" => md5($image[2] . $image[4] . $image[5] . $GLOBALS['phpwcms']["sharpen_level"] . $GLOBALS['phpwcms']['colorspace'])));
    if ($zoom) {
        $zoominfo = get_cached_image(array("target_ext" => $image[3], "image_name" => $image[2] . '.' . $image[3], "max_width" => $GLOBALS['phpwcms']["img_prev_width"], "max_height" => $GLOBALS['phpwcms']["img_prev_height"], "thumb_name" => md5($image[2] . $GLOBALS['phpwcms']["img_prev_width"] . $GLOBALS['phpwcms']["img_prev_height"] . $GLOBALS['phpwcms']["sharpen_level"] . $GLOBALS['phpwcms']['colorspace'])));
    }
    $list_img_temp = '<img src="' . PHPWCMS_IMAGES . $thumb_image[0] . '" ' . $thumb_image[3] . $image_border . $image_imgclass . ' />';
    if ($zoom && !empty($zoominfo)) {
        // if click enlarge the image
        $open_popup_link = 'image_zoom.php?' . getClickZoomImageParameter($zoominfo[0] . '?' . $zoominfo[3]);
        $open_link = $open_popup_link;
        $return_false = 'return false;';
        $html .= "<a href=\"" . $open_link . "\" onclick=\"checkClickZoom();clickZoom('" . $open_popup_link . "','previewpic','width=";
        $html .= $zoominfo[1] . ",height=" . $zoominfo[2] . "');" . $return_false . '">';
        $html .= $list_img_temp . "</a>";
    } else {
        // if not click enlarge
        $html .= $list_img_temp;
    }
    return $html;
}
Exemple #3
0
                    } elseif (!$value["max_height"]) {
                        $value["max_height"] = $value["max_width"];
                    }
                }
                $basis = floor($value["max_width"] / $grid);
                if (!$basis) {
                    $basis = 1;
                }
                $value["max_width"] = $basis * $grid;
                $basis = floor($value["max_height"] / $grid);
                if (!$basis) {
                    $basis = 1;
                }
                $value["max_height"] = $basis * $grid;
            }
            if (($image = get_cached_image($value, false, false)) && !empty($image[0])) {
                // Redirect, the "old" way
                if (!empty($phpwcms['cmsimage_redirect'])) {
                    headerRedirect(PHPWCMS_URL . PHPWCMS_IMAGES . $image[0], 301);
                }
                if (empty($image['type'])) {
                    $image['type'] = get_mimetype_by_extension(which_ext($image[0]));
                }
                header('Content-Type: ' . $image['type']);
                header('Content-Disposition: inline');
                @readfile(PHPWCMS_THUMB . $image[0]);
                exit;
            }
        }
    }
}
//build image/image link
$thumb_image = false;
$thumb_img = '';
$caption[0] = '';
if (!empty($crow["acontent_image"][2])) {
    $caption = getImageCaption(base64_decode($crow["acontent_image"][6]));
    $caption[0] = html_specialchars($caption[0]);
    $caption[3] = empty($caption[3]) ? '' : ' title="' . html_specialchars($caption[3]) . '"';
    //title
    $caption[1] = empty($caption[1]) ? html_specialchars($crow["acontent_image"][1]) : html_specialchars($caption[1]);
    $thumb_image = get_cached_image(array("target_ext" => $crow["acontent_image"][3], "image_name" => $crow["acontent_image"][2] . '.' . $crow["acontent_image"][3], "max_width" => $crow["acontent_image"][4], "max_height" => $crow["acontent_image"][5], "thumb_name" => md5($crow["acontent_image"][2] . $crow["acontent_image"][4] . $crow["acontent_image"][5] . $phpwcms["sharpen_level"] . $phpwcms['colorspace'])));
    if ($thumb_image != false) {
        $thumb_img = '<img src="' . PHPWCMS_IMAGES . $thumb_image[0] . '" ' . $thumb_image[3];
        $thumb_img .= ' alt="' . $caption[1] . '"' . $caption[3] . ' />';
        if ($crow["acontent_image"][8]) {
            $zoominfo = get_cached_image(array("target_ext" => $crow["acontent_image"][3], "image_name" => $crow["acontent_image"][2] . '.' . $crow["acontent_image"][3], "max_width" => $phpwcms["img_prev_width"], "max_height" => $phpwcms["img_prev_height"], "thumb_name" => md5($crow["acontent_image"][2] . $phpwcms["img_prev_width"] . $phpwcms["img_prev_height"] . $phpwcms["sharpen_level"] . $phpwcms['colorspace'])));
            if ($zoominfo != false) {
                $popup_img = 'image_zoom.php?' . getClickZoomImageParameter($zoominfo[0] . '?' . $zoominfo[3]);
                if (!empty($caption[2][0])) {
                    $open_link = $caption[2][0];
                    $return_false = '';
                } else {
                    $open_link = $popup_img;
                    $return_false = 'return false;';
                }
                $thumb_img = '<a href="' . $popup_img . '" onclick="window.open(\'' . $open_link . "','previewpic','width=" . $zoominfo[1] . ",height=" . $zoominfo[2] . "');" . $return_false . '"' . $caption[2][1] . '>' . $thumb_img . '</a>';
            }
        } else {
            if ($caption[2][0]) {
                $thumb_img = '<a href="' . $caption[2][0] . '"' . $caption[2][1] . '>' . $thumb_img . '</a>';
            }
Exemple #5
0
 **/
// ----------------------------------------------------------------
// obligate check for phpwcms constants
if (!defined('PHPWCMS_ROOT')) {
    die("You Cannot Access This Script Directly, Have a Nice Day.");
}
// ----------------------------------------------------------------
// Text with image
$cinfo[1] = cut_string($row["acontent_title"], '&#8230;', 55);
$cinfo[2] = cut_string($row["acontent_subtitle"], '&#8230;', 55);
$cinfo[3] = str_replace("\n", " ", cut_string($row["acontent_text"], '&#8230;', 150));
// 0   :1       :2   :3        :4    :5     :6      :7       :8
// dbid:filename:hash:extension:width:height:caption:position:zoom
$cinfo_image = explode(":", $row["acontent_image"]);
if (isset($cinfo_image[2]) && is_array($cinfo_image) && count($cinfo_image)) {
    $thumb_image = get_cached_image(array("target_ext" => $cinfo_image[3], "image_name" => $cinfo_image[2] . '.' . $cinfo_image[3], "thumb_name" => md5($cinfo_image[2] . $phpwcms["img_list_width"] . $phpwcms["img_list_height"] . $phpwcms["sharpen_level"] . $phpwcms['colorspace'])));
    if ($thumb_image != false) {
        $cinfo_image = '<img src="' . PHPWCMS_IMAGES . $thumb_image[0] . '" border="0" ' . $thumb_image[3] . '>';
    } else {
        $cinfo_image = '';
    }
} else {
    $cinfo_image = '';
}
$cinfo["result"] = '';
foreach ($cinfo as $value) {
    if ($value) {
        $cinfo["result"] .= $value . "\n";
    }
}
$cinfo["result"] = str_replace("\n", " / ", html(trim($cinfo["result"])));
 if ($thumb_image != false) {
     $thumb_img = '<img src="' . PHPWCMS_IMAGES . $thumb_image[0] . '" ' . $thumb_image[3];
     $thumb_img .= ' alt="' . html_specialchars($caption[1]) . '"';
     if ($caption[3]) {
         $thumb_img .= ' title="' . html_specialchars($caption[3]) . '"';
     }
     $thumb_img .= ' class="' . $template_default['classes']['image-thumb'] . '" />';
     $img_thumb_name = $thumb_image[0];
     $img_thumb_rel = PHPWCMS_IMAGES . $thumb_image[0];
     $img_thumb_abs = PHPWCMS_URL . PHPWCMS_IMAGES . $thumb_image[0];
     $img_thumb_width = $thumb_image[1];
     $img_thumb_height = $thumb_image[2];
     $img_thumb_ext = which_ext($thumb_image[0]);
     $content['images']['article'] = array('name' => $row["article_image"]["name"], 'hash' => $row["article_image"]["hash"], 'ext' => $img_thumb_ext, 'image' => array('width' => $img_thumb_width, 'height' => $img_thumb_height, 'src' => $img_thumb_rel));
     if ($row["article_image"]["zoom"]) {
         $zoominfo = get_cached_image(array("target_ext" => $row["article_image"]['ext'], "image_name" => $row["article_image"]['hash'] . '.' . $row["article_image"]['ext'], "max_width" => $phpwcms["img_prev_width"], "max_height" => $phpwcms["img_prev_height"], "thumb_name" => md5($row["article_image"]['hash'] . $phpwcms["img_prev_width"] . $phpwcms["img_prev_height"] . $phpwcms["sharpen_level"] . $phpwcms['colorspace'])));
         if ($zoominfo != false) {
             $img_zoom_name = $zoominfo[0];
             $img_zoom_rel = PHPWCMS_IMAGES . $zoominfo[0];
             $img_zoom_abs = PHPWCMS_URL . PHPWCMS_IMAGES . $zoominfo[0];
             $img_zoom_width = $zoominfo[1];
             $img_zoom_height = $zoominfo[2];
             $content['images']['article']['zoom'] = array('width' => $img_zoom_width, 'height' => $img_zoom_height, 'src' => $img_zoom_rel);
             $popup_img = 'image_zoom.php?' . getClickZoomImageParameter($zoominfo[0] . '?' . $zoominfo[3]);
             if (!empty($caption[2][0])) {
                 $open_link = $caption[2][0];
                 $return_false = '';
             } else {
                 $open_link = $popup_img;
                 $return_false = 'return false;';
             }
 //$sql .= " AND f_public=1";
 $sql .= " ORDER BY f_sort, f_name";
 $data = _dbQuery($sql);
 //phpwcms imagesdata from cp
 $imagesdata = array();
 //only if cp was saved already
 if ($cid != 0) {
     $sql2 = "SELECT acontent_form FROM " . DB_PREPEND . "phpwcms_articlecontent WHERE acontent_id=" . $cid . " AND acontent_aid=" . $aid;
     $data2 = _dbQuery($sql2);
     $data3 = unserialize($data2[0]['acontent_form']);
     $imagesdata = json_decode($data3['jqs_imagedata'], true);
 }
 foreach ($data as $val) {
     //build html img-tag
     //get image
     $thumb_image = get_cached_image(array("target_ext" => $val['f_ext'], "image_name" => $val['f_hash'] . '.' . $val['f_ext'], "max_width" => $phpwcms['img_list_width'], "max_height" => $phpwcms['img_list_height'], "thumb_name" => md5($val['f_hash'] . $phpwcms['img_list_width'] . $phpwcms['img_list_height'] . $phpwcms["sharpen_level"])));
     //add title and descr from DB
     $image_title = '';
     $image_descr = '';
     $image_css = '';
     if ($thumb_image != false) {
         if (isset($imagesdata[$value][$val['f_id']])) {
             if (isset($imagesdata[$value][$val['f_id']][1])) {
                 //allow plain text only
                 $image_title = html_specialchars(strip_tags($imagesdata[$value][$val['f_id']][1]));
             }
             if (isset($imagesdata[$value][$val['f_id']][2])) {
                 //we allow HTML in description
                 //$image_descr = html_specialchars(strip_tags($imagesdata[$value][$val['f_id']][2]));
                 $image_descr = html_specialchars($imagesdata[$value][$val['f_id']][2]);
             }
     $guestbook['c'] = render_cnt_template($guestbook['c'], 'NAME', html_specialchars($guestbook['row']['guestbook_name']));
     $guestbook['c'] = render_cnt_template($guestbook['c'], 'MSG', nl2br($guestbook['row']['guestbook_msg']));
     $guestbook['c'] = preg_replace_callback('/{TIMESTAMP:(.*)}/', 'guestbook_date_callback', $guestbook['c']);
     // do gb image ;-)
     $guestbook['entry_image'] = '';
     if (isset($guestbook['imgdata']) && !empty($guestbook['row']['guestbook_image'])) {
         if (file_exists($guestbook['image_dir'] . '/' . $guestbook['row']['guestbook_image'])) {
             $thumb_image = false;
             $thumb_img = '';
             $thumb_image = get_cached_image(array("target_ext" => which_ext($guestbook['row']['guestbook_image']), "image_name" => $guestbook['row']['guestbook_image'], "image_dir" => $guestbook['image_dir'] . '/', "max_width" => $guestbook['imgdata'][0], "max_height" => $guestbook['imgdata'][1], "thumb_name" => md5($guestbook['row']['guestbook_image'] . $guestbook['imgdata'][0] . $guestbook['imgdata'][1] . $phpwcms["sharpen_level"] . $phpwcms['colorspace'])));
             if ($thumb_image != false) {
                 $guestbook['entry_image'] = '<img src="' . PHPWCMS_IMAGES . $thumb_image[0] . '" ' . $thumb_image[3];
                 $guestbook['entry_image'] .= ' alt="' . html_specialchars($guestbook['row']['guestbook_imagename']) . '" />';
                 //zoom
                 if ($guestbook['imgdata'][2]) {
                     $zoominfo = get_cached_image(array("target_ext" => which_ext($guestbook['row']['guestbook_image']), "image_name" => $guestbook['row']['guestbook_image'], "image_dir" => $guestbook['image_dir'] . '/', "max_width" => $phpwcms["img_prev_width"], "max_height" => $phpwcms["img_prev_height"], "thumb_name" => md5($guestbook['row']['guestbook_image'] . $phpwcms["img_prev_width"] . $phpwcms["img_prev_height"] . $phpwcms["sharpen_level"] . $phpwcms['colorspace'])));
                     if ($zoominfo != false) {
                         $popup_img = 'image_zoom.php?' . getClickZoomImageParameter($zoominfo[0] . '?' . $zoominfo[3]);
                         $guestbook['entry_image'] = '<a href="' . $popup_img . '" onclick="window.open(\'' . $popup_img . "','previewpic','width=" . $zoominfo[1] . ",height=" . $zoominfo[2] . "');return false;" . '">' . $guestbook['entry_image'] . '</a>';
                     }
                 }
             }
         }
     }
     $guestbook['c'] = render_cnt_template($guestbook['c'], 'IMAGE', $guestbook['entry_image']);
     $guestbook['entry_list'] .= $guestbook['c'];
     $guestbook['counter']++;
 }
 mysql_free_result($guestbook['result']);
 // initialize lightbox
 if ($thumb_image != false) {
function list_public($pid, $dbcon, $vor, $zieldatei, $userID, $show_thumb = 1, $phpwcms)
{
    $pid = intval($pid);
    //Folder Listing für Public files
    $sql = "SELECT f_id, f_name FROM " . DB_PREPEND . "phpwcms_file WHERE " . "f_pid=" . intval($pid) . " AND " . "f_public=1 AND f_aktiv=1 AND " . "f_uid=" . intval($userID) . " AND " . "f_kid=0 AND f_trash=0 ORDER BY f_sort, f_name";
    $result = mysql_query($sql, $dbcon);
    while ($row = mysql_fetch_array($result)) {
        $dirname = html($row["f_name"]);
        //Ermitteln des Aufklappwertes
        $klapp_status = empty($_SESSION["pklapp"][$row["f_id"]]) ? 1 : 0;
        //Ermitteln, ob überhaupt abhängige Dateien/Ordner existieren
        $count_sql = "SELECT COUNT(f_id) FROM " . DB_PREPEND . "phpwcms_file WHERE " . "f_pid=" . $row["f_id"] . " AND " . "f_uid=" . intval($userID) . " AND " . "f_public=1 AND f_aktiv=1 AND " . "f_trash=0 LIMIT 1";
        if ($count_result = mysql_query($count_sql, $dbcon)) {
            if ($count_row = mysql_fetch_row($count_result)) {
                $count = "<img src=\"img/leer.gif\" width=\"2\" height=\"1\">" . "<a href=\"" . $zieldatei . "&pklapp=" . $row["f_id"] . "|" . $klapp_status . "\">" . on_off($klapp_status, $dirname, 0) . "</a>";
                $count_wert = $count_row[0];
            }
            mysql_free_result($count_result);
        }
        //Aufbau der Zeile
        echo "<tr bgcolor=\"#EBF2F4\"><td colspan=\"2\"><img src=\"img/leer.gif\" height=\"1\" width=\"1\"></td></tr>\n";
        //Abstand vor
        echo "<tr bgcolor=\"#EBF2F4\">\n";
        //Einleitung Tabellenzeile
        echo "<td width=\"488\" class='msglist'>";
        //Einleiten der Tabellenzelle
        echo $count . "<img src=\"img/leer.gif\" height=\"1\" width=\"" . ($vor + 6) . "\" border=\"0\"><img src=\"img/icons/folder_zu.gif\" border=\"0\">";
        //Zellinhalt 1. Spalte
        echo "<img src=\"img/leer.gif\" height=\"1\" width=\"5\"><strong>" . $dirname;
        //Zellinhalt 1. Spalte Fortsetzung
        echo "</strong></td>\n";
        //Schließen Zelle 1. Spalte
        //Zelle 2. Spalte - vorgesehen für Buttons/Tasten Edit etc.
        echo "<td width=\"50\" align=\"right\" class=\"msglist\">";
        echo "<img src=\"img/leer.gif\" width=\"50\" height=\"1\">";
        //Spacer
        echo "</td>\n";
        echo "</tr>\n";
        //Abschluss Tabellenzeile
        //Aufbau trennende Tabellen-Zeile
        echo "<tr bgcolor=\"#EBF2F4\"><td colspan=\"2\"><img src=\"img/leer.gif\" height=\"1\" width=\"1\"></td></tr>\n";
        //Abstand nach
        echo "<tr><td colspan=\"2\"><img src=\"img/leer.gif\" height=\"1\" width=\"1\"></td></tr>\n";
        //Trennlinie<img src='img/lines/line-lightgrey-dotted-538.gif'>
        //Weiter, wenn Unterstruktur
        if (!$klapp_status && $count_wert) {
            //$vor."<img src='img/leer.gif' height=1 width=18 border=0>"
            list_public($row["f_id"], $dbcon, $vor + 18, $zieldatei, $userID, $show_thumb, $phpwcms);
            //Listing eventuell im Verzeichnis enthaltener Dateien
            $file_sql = "SELECT * FROM " . DB_PREPEND . "phpwcms_file WHERE f_pid=" . $row["f_id"] . " AND f_uid=" . intval($userID) . " AND f_public=1 AND f_aktiv=1 AND f_kid=1 AND f_trash=0 ORDER BY f_sort, f_name";
            if ($file_result = mysql_query($file_sql, $dbcon) or die("error while listing files")) {
                $file_durchlauf = 0;
                while ($file_row = mysql_fetch_array($file_result)) {
                    $filename = html($file_row["f_name"]);
                    if (!$file_durchlauf) {
                        //Aufbau der Zeile zum Einfließen der Filelisten-Tabelle
                        echo "<tr bgcolor=\"#F5F8F9\"><td colspan=\"2\"><table width=\"538\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n";
                    } else {
                        echo "<tr bgcolor=\"#FFFFFF\"><td colspan=\"5\"><img src=\"img/leer.gif\" height=\"1\" width=\"1\"></td></tr>\n";
                    }
                    echo "<tr>\n";
                    echo "<td width=\"" . ($vor + 37) . "\" class=\"msglist\"><img src=\"img/leer.gif\" height=\"1\" width=\"" . ($vor + 37) . "\" border=\"0\"></td>\n";
                    echo "<td width=\"13\" class=\"msglist\">";
                    echo "<img src=\"img/icons/small_" . extimg($file_row["f_ext"]) . "\" border=\"0\"";
                    echo ' onmouseover="Tip(\'ID: ' . $file_row["f_id"] . '&lt;br&gt;Sort: ' . $file_row["f_sort"] . '\');" onmouseout="UnTip()" alt=""';
                    echo "></td>\n";
                    echo "<td width=\"" . (473 - $vor) . "\" class=\"msglist\"><img src=\"img/leer.gif\" height=\"1\" width=\"5\">";
                    //438-$vor
                    echo "<a href=\"fileinfo.php?public&amp;fid=" . $file_row["f_id"];
                    echo "\" target=\"_blank\" onclick=\"flevPopupLink(this.href,'filedetail','scrollbars=yes,resizable=yes,width=500,height=400',1);return document.MM_returnValue;\">";
                    echo $filename . "</a>";
                    echo "</td>\n";
                    echo "<td width=\"15\" align=\"right\" class=\"msglist\">";
                    echo "<a href=\"include/inc_act/act_download.php?pl=1&dl=" . $file_row["f_id"];
                    echo "\" target=\"_blank\" title=\"" . $GLOBALS['BL']['be_fprivfunc_dlfile'] . ": " . $filename . "\">";
                    echo "<img src=\"img/button/download_disc.gif\" border=0></a>";
                    //target='_blank'
                    echo "<img src=\"img/leer.gif\" width=\"2\" height=\"1\">";
                    //Spacer
                    echo "</td>\n";
                    //Ende Aufbau
                    echo "</tr>\n";
                    if ($_SESSION["wcs_user_thumb"]) {
                        $thumb_image = get_cached_image(array("target_ext" => $file_row["f_ext"], "image_name" => $file_row["f_hash"] . '.' . $file_row["f_ext"], "thumb_name" => md5($file_row["f_hash"] . $phpwcms["img_list_width"] . $phpwcms["img_list_height"] . $phpwcms["sharpen_level"] . $phpwcms['colorspace'])));
                        if ($thumb_image != false) {
                            echo "<tr>\n";
                            echo "<td width=\"" . ($vor + 37) . "\"><img src=\"img/leer.gif\" height=\"1\" width=\"" . ($vor + 37) . "\" border=\"0\"></td>\n";
                            echo "<td width=\"13\"><img src=\"img/leer.gif\" height=\"1\" width=\"1\" border=\"0\"></td>\n<td width=\"";
                            echo 473 - $vor . "\"><img src=\"img/leer.gif\" height=\"1\" width=\"6\"><a href=\"fileinfo.php?public&amp;fid=";
                            echo $file_row["f_id"] . "\" target=\"_blank\" onclick=\"flevPopupLink(this.href,'filedetail','scrollbars=";
                            echo "yes,resizable=yes,width=500,height=400',1); return document.MM_returnValue;\">";
                            echo '<img src="' . PHPWCMS_IMAGES . $thumb_image[0] . '" border="0" ' . $thumb_image[3];
                            echo ' onmouseover="Tip(\'ID: ' . $file_row["f_id"] . '\');" onmouseout="UnTip()" alt=""';
                            echo "></a></td>\n";
                            echo "<td width=\"15\"><img src=\"img/leer.gif\" height=\"1\" width=\"1\" border=\"0\"></td>\n</tr>\n";
                            echo "<tr><td colspan=\"4\"><img src=\"img/leer.gif\" height=\"2\" width=\"1\" border=\"0\"></td>\n</tr>\n";
                        }
                    }
                    $file_durchlauf++;
                }
                if ($file_durchlauf) {
                    //Abschluss der Filelisten-Tabelle
                    echo "</table>\n";
                    echo "<tr><td colspan=\"2\"><img src=\"img/leer.gif\" height=\"1\" width=\"1\"></td></tr>\n";
                }
            }
            //Ende Liste Dateien
        }
        //Zaehler mitführen
        $_SESSION["list_zaehler"]++;
    }
    mysql_free_result($result);
    return $vor;
}
	<tr>
		<td valign="top"><select name="shopprod_images[]" size="<?php 
$img_count = isset($plugin['data']['shopprod_images']) && is_array($plugin['data']['shopprod_images']) ? count($plugin['data']['shopprod_images']) : 0;
echo $img_count + 5;
?>
" multiple="multiple" class="f11 width360" id="shopprod_images">
<?php 
$img_thumbs = '';
$imgx = 0;
if ($img_count) {
    // browse images and list available
    // will be visible only when aceessible
    foreach ($plugin['data']['shopprod_images'] as $key => $value) {
        // 0   :1       :2   :3        :4    :5     :6      :7       :8
        // dbid:filename:hash:extension:width:height:caption:position:zoom
        $thumb_image = get_cached_image(array("target_ext" => $plugin['data']['shopprod_images'][$key]['f_ext'], "image_name" => $plugin['data']['shopprod_images'][$key]['f_hash'] . '.' . $plugin['data']['shopprod_images'][$key]['f_ext'], "thumb_name" => md5($plugin['data']['shopprod_images'][$key]['f_hash'] . $phpwcms["img_list_width"] . $phpwcms["img_list_height"] . $phpwcms["sharpen_level"] . $phpwcms['colorspace'])));
        if ($thumb_image != false) {
            // image found
            echo '<option value="' . $plugin['data']['shopprod_images'][$key]['f_id'] . '">';
            $img_name = html_specialchars($plugin['data']['shopprod_images'][$key]['f_name']);
            echo $img_name . '</option>' . LF;
            if ($imgx == 4) {
                $img_thumbs .= '<br /><img src="img/leer.gif" alt="" border="0" width="1" height="2" /><br />';
                $imgx = 0;
            }
            if ($imgx) {
                $img_thumbs .= '<img src="img/leer.gif" alt="" border="0" width="2" height="1" />';
            }
            $img_thumbs .= '<img src="' . PHPWCMS_IMAGES . $thumb_image[0] . '" border="0" ' . $thumb_image[3] . ' alt="' . $img_name . '" title="' . $img_name . '" />';
            $plugin['data']['shopprod_caption'][] = html_specialchars($plugin['data']['shopprod_images'][$key]['caption']);
            $imgx++;
     // do it for jpg, png or gif only
     switch ($content['files_result'][$_files_x]['f_ext']) {
         case 'tif':
         case 'tiff':
         case 'pdf':
         case 'psd':
         case 'eps':
             if ($GLOBALS['phpwcms']['image_library'] == 'gd2' || $GLOBALS['phpwcms']['image_library'] == 'gd') {
                 break;
             }
         case 'bmp':
             $target_ext = 'jpg';
         case 'gif':
         case 'jpg':
         case 'png':
             $_files_image = get_cached_image(array("target_ext" => $target_ext, "image_name" => $content['files_result'][$_files_x]['f_hash'] . '.' . $content['files_result'][$_files_x]['f_ext'], "max_width" => $_file_info[4][0], "max_height" => $_file_info[4][1], "thumb_name" => md5($content['files_result'][$_files_x]['f_hash'] . $_file_info[4][0] . $_file_info[4][1] . $phpwcms["sharpen_level"] . $_file_info[4][2] . $phpwcms['colorspace']), 'crop_image' => $_file_info[4][2]));
             break;
     }
 }
 // render {FILE_IMAGE_%} RT
 if ($_files_get_imagesize) {
     $_files_get_imagesize = @getimagesize(PHPWCMS_ROOT . '/' . PHPWCMS_FILES . $content['files_result'][$_files_x]['f_hash'] . '.' . $content['files_result'][$_files_x]['f_ext']);
     if (isset($_files_get_imagesize[0])) {
         $_files_entries[$fkey] = render_cnt_template($_files_entries[$fkey], 'FILE_IMAGE_WIDTH', $_files_get_imagesize[0]);
         $_files_entries[$fkey] = render_cnt_template($_files_entries[$fkey], 'FILE_IMAGE_HEIGHT', $_files_get_imagesize[1]);
         $_files_entries[$fkey] = render_cnt_template($_files_entries[$fkey], 'FILE_IMAGE_MIME', isset($_files_get_imagesize['mime']) ? $_files_get_imagesize['mime'] : '');
         if (isset($_files_get_imagesize['channels'])) {
             switch ($_files_get_imagesize['channels']) {
                 case 3:
                     $_files_get_imagesize['channels'] = 'RGB';
                     break;
Exemple #12
0
            $sql .= " OR f_uid=" . intval($_SESSION["wcs_user_id"]);
        }
        $sql .= ") LIMIT 1";
    } else {
        //private file
        $sql = "SELECT * FROM " . DB_PREPEND . "phpwcms_file WHERE f_id=" . $file_id . ' AND ';
        $sql .= "f_kid=1 AND f_trash IN (0, 1) ";
        if (empty($_SESSION["wcs_user_admin"])) {
            $sql .= "AND f_uid=" . intval($_SESSION["wcs_user_id"]) . ' ';
        }
        $sql .= "LIMIT 1";
    }
    if ($result = mysql_query($sql, $db) or die("error")) {
        if ($row = mysql_fetch_assoc($result)) {
            $filename = html_specialchars($row["f_name"]);
            $thumb_image = get_cached_image(array("target_ext" => $row["f_ext"], "image_name" => $row["f_hash"] . '.' . $row["f_ext"], "thumb_name" => md5($row["f_hash"] . '538538' . $phpwcms["sharpen_level"] . $phpwcms['colorspace']), "max_width" => 538, "max_height" => 538));
            ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title><?php 
            echo $BL['FILEINFO_TITLE'];
            ?>
: <?php 
            echo $filename;
            ?>
</title>
	<meta http-equiv="Content-Type" content="text/html; charset=<?php 
            echo PHPWCMS_CHARSET;
            ?>
" />
         $content['reference']['ref_list'] .= ' align="right" valign="bottom"';
         break;
 }
 $content['reference']['ref_list'] .= '>';
 if ($content['reference']["zoom"]) {
     // build additional reference popup images
     $zoominfo = get_cached_image(array("target_ext" => $content['reference']["list"][$captkey][3], "image_name" => $content['reference']["list"][$captkey][2] . '.' . $content['reference']["list"][$captkey][3], "max_width" => $phpwcms["img_prev_width"], "max_height" => $phpwcms["img_prev_height"], "thumb_name" => md5($content['reference']["list"][$captkey][2] . $phpwcms["img_prev_width"] . $phpwcms["img_prev_height"] . $phpwcms["sharpen_level"] . $phpwcms['colorspace'])));
     if ($zoominfo != false) {
         $popup_link = 'image_zoom.php?' . getClickZoomImageParameter($zoominfo[0] . '?' . $zoominfo[3]);
         $content['reference']['x5'] = '<a href="' . $popup_link . '" onclick="window.open(\'' . $popup_link . "','previewpic','width=" . $zoominfo[1] . ",height=" . $zoominfo[2] . "');return false;\">";
         $content['reference']['x6'] = '</a>';
     }
 }
 $content['reference']['ref_list'] .= $content['reference']['x5'];
 $over_image = get_cached_image(array("target_ext" => $content['reference']["list"][$captkey][3], "image_name" => $content['reference']["list"][$captkey][2] . '.' . $content['reference']["list"][$captkey][3], "max_width" => $content['reference']["list"][$captkey][4], "max_height" => $content['reference']["list"][$captkey][5], "thumb_name" => md5($content['reference']["list"][$captkey][2] . $content['reference']["list"][$captkey][4] . $content['reference']["list"][$captkey][5] . $phpwcms["sharpen_level"] . $phpwcms['colorspace'])));
 $thumb_image = get_cached_image(array("target_ext" => $content['reference']["list"][$captkey][3], "image_name" => $content['reference']["list"][$captkey][2] . '.' . $content['reference']["list"][$captkey][3], "max_width" => $content['reference']["temp_list_width"], "max_height" => $content['reference']["temp_list_height"], "thumb_name" => md5($content['reference']["list"][$captkey][2] . $content['reference']["temp_list_width"] . $content['reference']["temp_list_height"] . $phpwcms["sharpen_level"] . $phpwcms['colorspace'])));
 if ($thumb_image != false) {
     initFrontendJS();
     if (!empty($content['reference']['caption_list'][$captkey])) {
         $img_name = $content['reference']['caption_list'][$captkey];
     } else {
         $img_name = html_specialchars($content['reference']["list"][$captkey][1]);
     }
     $content['reference']['ref_list'] .= '<img src="' . PHPWCMS_IMAGES . $thumb_image[0];
     $content['reference']['ref_list'] .= '" border="' . $content['reference']['border'] . '" ';
     $content['reference']['ref_list'] .= $thumb_image[3] . ' alt="' . $img_name . '" title="' . $img_name;
     $content['reference']['ref_list'] .= '" id="' . $content['reference']['ref_id'] . 'a' . $captkey;
     $content['reference']['ref_list'] .= '" name="' . $content['reference']['ref_id'] . 'a' . $captkey . '" ';
     // switch large image onmouseover
     $content['reference']['ref_list'] .= 'onmouseover="';
     if ($over_image != false) {
    die("You Cannot Access This Script Directly, Have a Nice Day.");
}
// ----------------------------------------------------------------
// Reference
$cinfo["result"] = $row["acontent_title"] ? cut_string($row["acontent_title"], '&#8230;', 55) : "";
$cinfo["result"] .= $cinfo["result"] && $row["acontent_subtitle"] ? " / " : "";
$cinfo["result"] .= $row["acontent_subtitle"] ? cut_string($row["acontent_subtitle"], '&#8230;', 55) : "";
$reference = unserialize($row["acontent_form"]);
if (is_array($reference["list"]) && count($reference["list"])) {
    $imgx = 0;
    $img_thumbs = '';
    $cinfo_img = '';
    // browse images and list available
    // will be visible only when aceessible
    foreach ($reference["list"] as $key => $value) {
        $thumb_image = get_cached_image(array("target_ext" => $reference["list"][$key][3], "image_name" => $reference["list"][$key][2] . '.' . $reference["list"][$key][3], "thumb_name" => md5($reference["list"][$key][2] . $phpwcms["img_list_width"] . $phpwcms["img_list_height"] . $phpwcms["sharpen_level"] . $phpwcms['colorspace'])));
        if ($thumb_image != false) {
            if ($imgx == 4) {
                $cinfo_img .= '<br><img src="img/leer.gif" alt="" border="0" width="1" height="2"><br>';
                $imgx = 0;
            }
            if ($imgx) {
                $cinfo_img .= '<img src="img/leer.gif" alt="" border="0" width="2" height="1">';
            }
            $cinfo_img .= '<img src="' . PHPWCMS_IMAGES . $thumb_image[0] . '" border="0" ' . $thumb_image[3] . ' alt="' . html($reference["list"][$key][1]) . '">';
            $imgx++;
        }
    }
    if ($imgx) {
        if ($cinfo["result"]) {
            $cinfo["result"] .= '<br>';
function list_private($pid, $dbcon, $vor, $zieldatei, $userID, $cutID = 0, $show_thumb = 1, $phpwcms)
{
    $cutID = intval($cutID);
    $pid = intval($pid);
    $sql = "SELECT * FROM " . DB_PREPEND . "phpwcms_file f ";
    $sql .= "LEFT JOIN " . DB_PREPEND . "phpwcms_user u ON u.usr_id=f.f_uid ";
    $sql .= "WHERE ";
    $sql .= "f.f_pid=" . intval($pid) . " AND ";
    if (empty($_SESSION["wcs_user_admin"])) {
        $sql .= "f.f_uid=" . intval($userID) . " AND ";
    }
    $sql .= "f.f_kid=0 AND f.f_trash=0 ORDER BY f_sort, f_name";
    $result = mysql_query($sql, $dbcon);
    while ($row = mysql_fetch_array($result)) {
        $dirname = html($row["f_name"]);
        if ($_SESSION["wcs_user_id"] != $row["f_uid"]) {
            $dirname .= ' (' . html($row["usr_login"]) . ')';
        }
        //Ermitteln des Aufklappwertes
        $klapp_status = empty($_SESSION["klapp"][$row["f_id"]]) ? 1 : 0;
        //Ermitteln, ob überhaupt abhängige Dateien/Ordner existieren
        $count_sql = "SELECT COUNT(f_id) FROM " . DB_PREPEND . "phpwcms_file WHERE ";
        $count_sql .= "f_pid=" . $row["f_id"] . " AND ";
        if (empty($_SESSION["wcs_user_admin"])) {
            $count_sql .= "f_uid=" . intval($userID) . " AND ";
        }
        $count_sql .= "f_trash=0 LIMIT 1";
        if ($count_result = mysql_query($count_sql, $dbcon)) {
            if ($count_row = mysql_fetch_row($count_result)) {
                $count = '<img src="img/leer.gif" width="2" height="1">' . '<a href="' . $zieldatei . "&amp;klapp=" . $row["f_id"] . '%7C' . $klapp_status . '">' . on_off($klapp_status, $dirname, 0) . "</a>";
                // | = %7C
                $count_wert = $count_row[0];
            }
            mysql_free_result($count_result);
        }
        //Aufbau der Zeile
        echo '<tr bgcolor="#EBF2F4"><td colspan="2"><img src="img/leer.gif" height="1" width="1" alt="" /></td></tr>' . "\n";
        //Abstand vor
        echo "<tr bgcolor=\"#EBF2F4\">\n";
        //Einleitung Tabellenzeile
        echo "<td width=\"438\" class=\"msglist\">";
        //Einleiten der Tabellenzelle
        echo $count . "<img src=\"img/leer.gif\" height=\"1\" width=\"" . ($vor + 6) . "\" border=\"0\">";
        // Gallery status
        switch ($row["f_gallerystatus"]) {
            case 2:
                // gallery root dir
                echo '<img src="img/icons/folder_galleryroot.gif" border="0" alt="' . $GLOBALS['BL']['be_gallery_root'] . '" title="' . $GLOBALS['BL']['be_gallery_root'] . '" />';
                break;
            case 3:
                // gallery subdir
                echo '<img src="img/icons/folder_gallerysub.gif" border="0" alt="' . $GLOBALS['BL']['be_gallery_directory'] . '" title="' . $GLOBALS['BL']['be_gallery_directory'] . '" />';
                break;
            default:
                echo "<img src=\"img/icons/folder_zu.gif\" border=\"0\" alt=\"\" />";
        }
        echo "<img src=\"img/leer.gif\" height=\"1\" width=\"5\"><strong>" . $dirname;
        //Zellinhalt 1. Spalte Fortsetzung
        echo "</strong></td>\n";
        //Schließen Zelle 1. Spalte
        //Zelle 2. Spalte - vorgesehen für Buttons/Tasten Edit etc.
        echo "<td width=\"100\" align=\"right\" class=\"msglist\">";
        //Button zum Uploaden einer Datei in dieses Verzeichnisses
        echo "<a href=\"" . $zieldatei . "&amp;upload=" . $row["f_id"] . "\" title=\"" . $GLOBALS['BL']['be_fprivfunc_upload'] . ": " . $dirname . "\">";
        echo "<img src=\"img/button/upload_13x13.gif\" border=\"0\" alt=\"\" /></a>";
        if (!$cutID) {
            //Button zum Erzeugen eines Neuen Unterverzeichnisses
            echo "<a href=\"" . $zieldatei . "&amp;mkdir=" . $row["f_id"] . "\" title=\"" . $GLOBALS['BL']['be_fprivfunc_makenew'] . ": " . $dirname . "\">";
            echo "<img src=\"img/button/add_13x13.gif\" border=\"0\" alt=\"\" /></a>";
        } else {
            //Button zum Einfügen der Clipboard-Datei in das Verzeichnis
            echo "<a href=\"include/inc_act/act_file.php?paste=" . $cutID . '%7C' . $row["f_id"] . "\" title=\"" . $GLOBALS['BL']['be_fprivfunc_paste'] . ": " . $dirname . "\">";
            echo "<img src=\"img/button/paste_13x13.gif\" border=\"0\" alt=\"\" /></a>";
        }
        //Button zum Bearbeiten des Verzeichnisses
        echo "<a href=\"" . $zieldatei . "&amp;editdir=" . $row["f_id"] . "\" title=\"" . $GLOBALS['BL']['be_fprivfunc_edit'] . ": " . $dirname . "\">";
        echo "<img src=\"img/button/edit_22x13.gif\" border=\"0\" alt=\"\" /></a>";
        //Button zum Umschalten zwischen Aktiv/Inaktiv
        echo "<a href=\"include/inc_act/act_file.php?aktiv=" . $row["f_id"] . '%7C' . true_false($row["f_aktiv"]) . "\" title=\"" . $GLOBALS['BL']['be_fprivfunc_cactive'] . ": " . $dirname . "\">";
        echo "<img src=\"img/button/aktiv_12x13_" . $row["f_aktiv"] . ".gif\" border=\"0\" alt=\"\" /></a>";
        //Button zum Umschalten zwischen Public/Non-Public
        echo "<a href=\"include/inc_act/act_file.php?public=" . $row["f_id"] . '%7C' . true_false($row["f_public"]) . "\" title=\"" . $GLOBALS['BL']['be_fprivfunc_cpublic'] . ": " . $dirname . "\">";
        echo "<img src=\"img/button/public_12x13_" . $row["f_public"] . ".gif\" border=\"0\" alt=\"\" /></a>";
        echo "<img src=\"img/leer.gif\" width=\"5\" height=\"1\">";
        //Spacer
        //Button zum Löschen des Verzeichnisses, wenn leer
        if (!$count_wert) {
            echo "<a href=\"include/inc_act/act_file.php?delete=" . $row["f_id"] . '%7C' . "9" . "\" title=\"" . $GLOBALS['BL']['be_fprivfunc_deldir'] . ": " . $dirname . "\" onclick=\"return confirm('" . $GLOBALS['BL']['be_fprivfunc_jsdeldir'] . " \\n[" . $dirname . "]? ');\">";
            echo "<img src=\"img/button/trash_13x13_1.gif\" border=\"0\" alt=\"\" /></a>";
        } else {
            echo "<img src=\"img/button/trash_13x13_0.gif\" title=\"";
            echo str_replace('{VAL}', $dirname, $GLOBALS['BL']['be_fprivfunc_notempty']) . '" border="0" alt="" />';
        }
        echo "<img src=\"img/leer.gif\" width=\"2\" height=\"1\" border=\"0\" alt=\"\" />";
        //Spacer
        echo "</td>\n";
        echo "</tr>\n";
        //Abschluss Tabellenzeile
        //Aufbau trennende Tabellen-Zeile
        echo "<tr bgcolor=\"#EBF2F4\"><td colspan=\"2\"><img src=\"img/leer.gif\" border=\"0\" alt=\"\" /></td></tr>\n";
        //Abstand nach
        echo "<tr><td colspan=\"2\"><img src=\"img/leer.gif\" border=\"0\" alt=\"\" /></td></tr>\n";
        //Trennlinie<img src='img/lines/line-lightgrey-dotted-538.gif'>
        //Weiter, wenn Unterstruktur
        if (!$klapp_status && $count_wert) {
            //$vor."<img src='img/leer.gif' height=1 width=18 border=0>"
            list_private($row["f_id"], $dbcon, $vor + 18, $zieldatei, $userID, $cutID, $show_thumb, $phpwcms);
            //Listing eventuell im Verzeichnis enthaltener Dateien
            $file_sql = "SELECT * FROM " . DB_PREPEND . "phpwcms_file WHERE f_pid=" . $row["f_id"];
            if (empty($_SESSION["wcs_user_admin"])) {
                $file_sql .= " AND f_uid=" . $userID;
            }
            $file_sql .= " AND f_kid=1 AND f_trash=0 ORDER BY f_sort, f_name";
            if ($file_result = mysql_query($file_sql, $dbcon) or die("error while listing files")) {
                $file_durchlauf = 0;
                while ($file_row = mysql_fetch_array($file_result)) {
                    $filename = html($file_row["f_name"]);
                    $file_row["edit"] = '<a href="' . $zieldatei . "&amp;editfile=" . $file_row["f_id"] . '" title="' . $GLOBALS['BL']['be_fprivfunc_editfile'] . ": " . $filename . '">';
                    if (!$file_durchlauf) {
                        //Aufbau der Zeile zum Einfließen der Filelisten-Tavbelle
                        echo "<tr bgcolor=\"#F5F8F9\"><td colspan=\"2\"><table width=\"538\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n";
                        echo "<!-- start file list: private-functions //-->\n";
                    } else {
                        echo "<tr bgcolor=\"#FFFFFF\"><td colspan=\"5\"><img src=\"img/leer.gif\" border=\"0\" alt=\"\" /></td></tr>\n";
                    }
                    echo "<tr>\n";
                    echo "<td width=\"" . ($vor + 37) . "\" class=\"msglist\"><img src=\"img/leer.gif\" height=\"1\" width=\"" . ($vor + 37) . "\" border=\"0\" alt=\"\" /></td>\n";
                    echo "<td width=\"13\" class=\"msglist\">";
                    echo "<img src=\"img/icons/small_" . extimg($file_row["f_ext"]) . "\" border=\"0\" ";
                    echo 'onmouseover="Tip(\'ID: ' . $file_row["f_id"] . '&lt;br&gt;Sort: ' . $file_row["f_sort"];
                    echo '&lt;br&gt;Name: ' . html($file_row["f_name"]);
                    if ($file_row["f_copyright"]) {
                        echo '&lt;br&gt;&copy;: ' . html($file_row["f_copyright"]);
                    }
                    echo '\');" onmouseout="UnTip()" alt=""';
                    echo " /></td>\n";
                    echo "<td width=\"" . (388 - $vor) . "\" class=\"msglist\"><img src=\"img/leer.gif\" height=\"1\" width=\"5\" border=\"0\" alt=\"\" />";
                    //echo "<a href=\"fileinfo.php?fid=".$file_row["f_id"];
                    //echo "\" target=\"_blank\" onclick=\"flevPopupLink(this.href,'filedetail','scrollbars=yes,resizable=yes,width=500,height=400',1);return document.MM_returnValue;\">";
                    echo $file_row["edit"] . $filename . "</a></td>\n";
                    //Aufbauen Buttonleiste für jeweilige Datei
                    echo "<td width=\"100\" align=\"right\" class=\"msglist\">";
                    //Button zum Downloaden der Datei
                    echo "<a href=\"include/inc_act/act_download.php?dl=" . $file_row["f_id"] . "\"  target=\"_blank\" title=\"" . $GLOBALS['BL']['be_fprivfunc_dlfile'] . ": " . $filename . "\">" . "<img src=\"img/button/download_disc.gif\" border=\"0\" alt=\"\" /></a>";
                    //target='_blank'
                    //Button zum Erzeugen eines Neuen Unterverzeichnisses
                    if ($cutID == $file_row["f_id"]) {
                        echo "<img src=\"img/button/cut_13x13_1.gif\" border=\"0\" title=\"" . $GLOBALS['BL']['be_fprivfunc_clipfile'] . ": " . $filename . "\" alt=\"\" />";
                    } else {
                        echo "<a href=\"" . $zieldatei . "&amp;cut=" . $file_row["f_id"] . "\" title=\"" . $GLOBALS['BL']['be_fprivfunc_cutfile'] . ": " . $filename . "\">";
                        echo "<img src=\"img/button/cut_13x13_0.gif\" border=\"0\" alt=\"\" /></a>";
                    }
                    //Button zum Bearbeiten der Dateiinformationn
                    echo $file_row["edit"];
                    echo "<img src=\"img/button/edit_22x13.gif\" border=\"0\" alt=\"\" /></a>";
                    //Button zum Umschalten zwischen Aktiv/Inaktiv
                    echo "<a href=\"include/inc_act/act_file.php?aktiv=" . $file_row["f_id"] . '%7C' . true_false($file_row["f_aktiv"]) . "\" title=\"" . $GLOBALS['BL']['be_fprivfunc_cactivefile'] . ": " . $filename . "\">";
                    echo "<img src=\"img/button/aktiv_12x13_" . $file_row["f_aktiv"] . ".gif\" border=\"0\" alt=\"\" /></a>";
                    //Button zum Umschalten zwischen Public/Non-Public
                    echo "<a href=\"include/inc_act/act_file.php?public=" . $file_row["f_id"] . '%7C' . true_false($file_row["f_public"]) . "\" title=\"" . $GLOBALS['BL']['be_fprivfunc_cpublicfile'] . ": " . $filename . "\">";
                    echo "<img src=\"img/button/public_12x13_" . $file_row["f_public"] . ".gif\" border=\"0\" alt=\"\" /></a>";
                    echo "<img src=\"img/leer.gif\" width=\"5\" height=\"1\">";
                    //Spacer
                    //Button zum Löschen der Datei
                    if ($file_row["f_uid"] == intval($_SESSION["wcs_user_id"])) {
                        //if user is owner then delete button is active
                        echo "<a href=\"include/inc_act/act_file.php?trash=" . $file_row["f_id"] . '%7C' . "1" . "\" title=\"" . $GLOBALS['BL']['be_fprivfunc_movetrash'] . ": " . $filename . "\" onclick=\"return confirm('" . $GLOBALS['BL']['be_fprivfunc_jsmovetrash1'] . "\\n[" . $filename . "]\\n" . $GLOBALS['BL']['be_fprivfunc_jsmovetrash2'] . "');\">" . "<img src=\"img/button/trash_13x13_1.gif\" border=\"0\" alt=\"\" /></a>";
                    } else {
                        echo "<img src=\"img/button/trash_13x13_0.gif\" border=\"0\">";
                    }
                    echo "<img src=\"img/leer.gif\" width=\"2\" height=\"1\" border=\"0\" alt=\"\" />";
                    //Spacer
                    echo "</td>\n";
                    //Ende Aufbau
                    echo "</tr>\n";
                    if ($_SESSION["wcs_user_thumb"]) {
                        // now try to get existing thumbnails or if not exists
                        // build new based on default thumbnail listing sizes
                        // build thumbnail image name
                        $thumb_image = get_cached_image(array("target_ext" => $file_row["f_ext"], "image_name" => $file_row["f_hash"] . '.' . $file_row["f_ext"], "thumb_name" => md5($file_row["f_hash"] . $phpwcms["img_list_width"] . $phpwcms["img_list_height"] . $phpwcms["sharpen_level"] . $phpwcms['colorspace'])));
                        if ($thumb_image != false) {
                            echo "<tr>\n";
                            echo "<td width=\"" . ($vor + 37) . "\"><img src=\"img/leer.gif\" height=\"1\" width=\"" . ($vor + 37) . "\" border=\"0\" alt=\"\" /></td>\n";
                            echo "<td width=\"13\"><img src=\"img/leer.gif\" height=\"1\" width=\"1\" border=\"0\" alt=\"\" /></td>\n<td width=\"";
                            echo 388 - $vor . "\"><img src=\"img/leer.gif\" height=\"1\" width=\"6\" border=\"0\" alt=\"\" />";
                            //<a href=\"fileinfo.php?fid=";
                            //echo $file_row["f_id"]."\" target=\"_blank\" onclick=\"flevPopupLink(this.href,'filedetail','scrollbars=";
                            //echo "yes,resizable=yes,width=500,height=400',1); return document.MM_returnValue;\">";
                            echo $file_row["edit"];
                            echo '<img src="' . PHPWCMS_IMAGES . $thumb_image[0] . '" border="0" ' . $thumb_image[3] . ' ';
                            echo 'onmouseover="Tip(\'ID: ' . $file_row["f_id"] . '&lt;br&gt;Sort: ' . $file_row["f_sort"];
                            echo '&lt;br&gt;Name: ' . html($file_row["f_name"]);
                            if ($file_row["f_copyright"]) {
                                echo '&lt;br&gt;&copy;: ' . html($file_row["f_copyright"]);
                            }
                            echo '\');" onmouseout="UnTip()" alt=""';
                            echo " /></a></td>\n";
                            echo "<td width=\"100\"><img src=\"img/leer.gif\" border=\"0\" alt=\"\" /></td>\n</tr>\n";
                            echo "<tr><td colspan=\"4\"><img src=\"img/leer.gif\" height=\"2\" width=\"1\" border=\"0\" alt=\"\" /></td>\n</tr>\n";
                        }
                    }
                    $file_durchlauf++;
                }
                if ($file_durchlauf) {
                    //Abschluss der Filelisten-Tabelle
                    echo "</table>\n<!-- end file list: private-functions //-->\n";
                    echo "<tr><td colspan=\"2\"><img src=\"img/leer.gif\" border=\"0\" alt=\"\" /></td></tr>\n";
                }
            }
            //Ende Liste Dateien
        }
        //Zaehler mitführen
        $_SESSION["list_zaehler"]++;
    }
    mysql_free_result($result);
    return $vor;
}
         }
         if (!empty($phpwcms['SMTP_WORKSTATION'])) {
             $ecard["mailer"]->Workstation = $phpwcms['SMTP_WORKSTATION'];
         }
     }
 }
 if (!$ecard['mailer']->setLanguage($phpwcms['default_lang'], PHPWCMS_ROOT . '/include/inc_ext/phpmailer/language/')) {
     $ecard['mailer']->setLanguage('en', PHPWCMS_ROOT . '/include/inc_ext/phpmailer/language/');
 }
 $ecard["mailer"]->From = $ecard["sender_email"];
 if ($ecard["sender_name"]) {
     $ecard["mailer"]->FromName = $ecard["sender_name"];
 }
 $ecard["mailer"]->addAddress($ecard["recipient_email"], $ecard["recipient_name"]);
 $ecard["mailer"]->Subject = $ecard["subject"] ? $ecard["subject"] : 'E-Card: ' . chop($ecard["capt"][$ecard["chooser"]]);
 $thumb_image = get_cached_image(array("target_ext" => $ecard['images'][$ecard["chooser"]][3], "image_name" => $ecard['images'][$ecard["chooser"]][2] . '.' . $ecard['images'][$ecard["chooser"]][3], "max_width" => $phpwcms["img_prev_width"], "max_height" => $phpwcms["img_prev_height"], "thumb_name" => md5($ecard['images'][$ecard["chooser"]][2] . $phpwcms["img_prev_width"] . $phpwcms["img_prev_height"] . $phpwcms["sharpen_level"] . $phpwcms['colorspace'] . 'ecard')));
 $list_img_temp = '<img src="' . PHPWCMS_URL . PHPWCMS_IMAGES . $thumb_image[0] . '" ' . $thumb_image[3] . ' alt="' . html_specialchars($ecard['images'][$ecard["chooser"]][1]) . '" />';
 if ($ecard["mail"]) {
     $ecard["mail"] = str_replace('###ECARD_TITLE###', html_specialchars(chop($ecard["capt"][$ecard["chooser"]])), $ecard["mail"]);
     $ecard["mail"] = str_replace('###ECARD_IMAGE###', $list_img_temp, $ecard["mail"]);
     $ecard["mail"] = str_replace('###RECIPIENT_NAME###', $ecard["recipient_name"] ? html_specialchars($ecard["recipient_name"]) : html_specialchars($ecard["recipient_email"]), $ecard["mail"]);
     $ecard["mail"] = str_replace('###RECIPIENT_EMAIL###', html_specialchars($ecard["recipient_email"]), $ecard["mail"]);
     $ecard["mail"] = str_replace('###SENDER_MESSAGE###', nl2br(html_specialchars($ecard["sender_msg"])), $ecard["mail"]);
     $ecard["mail"] = str_replace('###SENDER_NAME###', $ecard["sender_name"] ? html_specialchars($ecard["sender_name"]) : html_specialchars($ecard["sender_email"]), $ecard["mail"]);
     $ecard["mail"] = str_replace('###SENDER_EMAIL###', html_specialchars($ecard["sender_email"]), $ecard["mail"]);
     $ecard["mail"] = str_replace('###ECARD_SUBJECT###', html_specialchars($ecard["subject"]), $ecard["mail"]);
     $ecard["mailer"]->Body = $ecard["mail"];
 } else {
     $ecard["mailer"]->Body = '<div align="center"><h3>E-Card &quot;' . html_specialchars(chop($ecard["capt"][$ecard["chooser"]])) . '&quot;</h3>' . '<p><strong>sent to you from ' . html_specialchars($ecard["sender_name"] . ($ecard["sender_name"] ? ' (' . $ecard["sender_email"] . ')' : $ecard["sender_email"])) . '</strong></p>' . '<p>' . $list_img_temp . '</p>' . '<p>' . nl2br(html_specialchars($ecard["sender_msg"])) . '</p><hr /><a href="' . $phpwcms["site"] . '" target="_blank">' . $phpwcms["site"] . '</a></div>';
 }
 $ecard["mailer"]->send();
                $file_gallerydownload = $row["f_gallerystatus"];
                $file_sort = $row["f_sort"];
                $file_vars = @unserialize($row['f_vars']);
                if ($file_keys) {
                    $file_keys_temp = explode(":", $file_keys);
                    if (count($file_keys_temp)) {
                        $file_keywords = array();
                        foreach ($file_keys_temp as $value) {
                            list($k1, $k2) = explode("_", $value);
                            $file_keywords[intval($k1)] = intval($k2);
                        }
                    }
                }
            }
            if (isset($row["f_hash"])) {
                $thumb_image = get_cached_image(array('max_width' => 420, 'max_height' => 250, "target_ext" => $row["f_ext"], "image_name" => $row["f_hash"] . '.' . $row["f_ext"], "thumb_name" => md5($row["f_hash"] . '420250' . $phpwcms["sharpen_level"] . $phpwcms['colorspace'])));
                if ($thumb_image != false) {
                    $file_thumb_small = '<img src="' . PHPWCMS_IMAGES . $thumb_image[0] . '" ' . $thumb_image[3] . ' alt="" style="border: 1px solid #9BBECA;background:#F5F8F9;" />';
                }
            }
            $ja = 1;
        }
        mysql_free_result($result);
    }
}
if ($ja) {
    ?>
<form action="phpwcms.php?do=files&f=0" method="post" name="editfileinfo" id="editfileinfo">
<table border="0" cellpadding="0" cellspacing="0" bgcolor='#EBF2F4' summary="">
	<tr>
		<td rowspan="2" valign="top"><a href="phpwcms.php?do=files&f=0"><img src="img/button/close_reiter.gif" alt="" width="45" height="12" border="0"></a></td>
         $image['count'] = $image['limit'];
         $image['images'] = array_slice($image['images'], 0, $image['limit']);
     }
 }
 foreach ($image['images'] as $key => $value) {
     $col++;
     $total++;
     // put spacer content between images
     if ($col > 1) {
         $image['tmpl_images'][$x] .= $image['tmpl_entry_space'];
     } else {
         $image['tmpl_images'][$x] = '';
     }
     $thumb_image = get_cached_image(array("target_ext" => $image['images'][$key][3], "image_name" => $image['images'][$key][2] . '.' . $image['images'][$key][3], "max_width" => $image['width'], "max_height" => $image['height'], "thumb_name" => md5($image['images'][$key][2] . $image['width'] . $image['height'] . $phpwcms["sharpen_level"] . $image['crop'] . $phpwcms['colorspace']), 'crop_image' => $image['crop']));
     if ($image['zoom']) {
         $zoominfo = get_cached_image(array("target_ext" => $image['images'][$key][3], "image_name" => $image['images'][$key][2] . '.' . $image['images'][$key][3], "max_width" => $phpwcms["img_prev_width"], "max_height" => $phpwcms["img_prev_height"], "thumb_name" => md5($image['images'][$key][2] . $phpwcms["img_prev_width"] . $phpwcms["img_prev_height"] . $phpwcms["sharpen_level"] . $phpwcms['colorspace'])));
     }
     $img_landscape = null;
     if (strpos($image['tmpl_entry'], '[LANDSCAPE') !== false) {
         $img_landscape = false;
         if (is_file(PHPWCMS_ROOT . '/' . PHPWCMS_FILES . $image['images'][$key][2] . '.' . $image['images'][$key][3])) {
             $img_landscape = @getimagesize(PHPWCMS_ROOT . '/' . PHPWCMS_FILES . $image['images'][$key][2] . '.' . $image['images'][$key][3]);
             if ($img_landscape) {
                 $img_landscape = $img_landscape[1] > $img_landscape[0] ? '' : 'L';
             } else {
                 $img_landscape = false;
             }
         }
     }
     // now try to build caption and if neccessary add alt to image or set external link for image
     $caption = getImageCaption($image['images'][$key][6]);
			|
			<?php 
echo $BL['be_caption_title'];
?>
			|
			<?php 
echo $BL['be_copyright'];
?>
		</span>
	</td>
	<td valign="top"><img src="img/leer.gif" alt="" width="15" height="1" /></td>
	<td valign="top"><?php 
$_SESSION['image_browser_article'] = 1;
$thumb_image = false;
if (!empty($article["image"]["list_hash"])) {
    $thumb_image = get_cached_image(array("target_ext" => $article['image']['list_ext'], "image_name" => $article['image']['list_hash'] . '.' . $article['image']['list_ext'], "thumb_name" => md5($article['image']['list_hash'] . $phpwcms["img_list_width"] . $phpwcms["img_list_height"] . $phpwcms["sharpen_level"] . $phpwcms['colorspace'])));
}
if ($thumb_image != false) {
    echo '<img src="' . PHPWCMS_IMAGES . $thumb_image[0] . '" border="0" ' . $thumb_image[3] . ' alt="" />';
} else {
    echo '&nbsp;';
}
?>
</td>
	</tr>
	</table></td>
</tr>


			<tr bgcolor="#F3F6F9"><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="5" /></td>
			</tr>
Exemple #20
0
function list_articles_summary($alt = NULL, $topcount = 99999, $template = '')
{
    // returns an article listing only with headline and summary text
    // and with an listing of all other available articles of this category
    global $content;
    global $template_default;
    global $_getVar;
    // alternative way to send article listings
    if (is_array($alt)) {
        // first save default value of $content["articles"]
        $_old_articles = $content["articles"];
        $content["articles"] = $alt;
        $temp_topcount = intval($topcount);
        if ($temp_topcount == 0) {
            $temp_topcount = $content['struct'][$content['cat_id']]['acat_topcount'];
        }
        $template = trim($template);
    } else {
        $temp_topcount = $content['struct'][$content['cat_id']]['acat_topcount'];
    }
    $max_articles = count($content["articles"]);
    if (empty($template_default['article_paginate_show'])) {
        $paginate_show = array('bottom' => 1);
    } else {
        $paginate_show = array();
        foreach (explode(' ', $template_default['article_paginate_show']) as $value) {
            if ($value == 'top') {
                $paginate_show['top'] = 1;
            } elseif ($value == 'bottom') {
                $paginate_show['bottom'] = 1;
            } elseif (strpos($value, 'rt') !== false) {
                $paginate_show['rt'] = str_replace('rt', '', $value);
            }
        }
        if (!count($paginate_show)) {
            $paginate_show = array('bottom' => 1);
        }
    }
    if ($content['struct'][$content['cat_id']]['acat_paginate'] && $content['struct'][$content['cat_id']]['acat_maxlist'] && $max_articles > $content['struct'][$content['cat_id']]['acat_maxlist']) {
        $paginate = true;
        $paginate_navi = empty($template_default['article_paginate_navi']) ? '<div class="' . $template_default['classes']['article-list-paginate'] . '">{PREV:&laquo;} {NEXT:&raquo;}</div>' : $template_default['article_paginate_navi'];
        $max_pages = ceil($max_articles / $content['struct'][$content['cat_id']]['acat_maxlist']);
        // always do full top article listing because of paginating
        $temp_topcount = $max_articles + 1;
        if (isset($_getVar['listpage'])) {
            $page_current = intval($_getVar['listpage']);
            if ($page_current < 1) {
                $page_current = 1;
            } elseif ($page_current > $max_pages) {
                $page_current = $max_pages;
            }
        } else {
            $page_current = 1;
        }
        $page_next = $page_current;
        $page_prev = $page_current;
        if ($page_current < $max_pages) {
            $page_next = $page_current + 1;
        }
        if ($page_current > 1) {
            $page_prev = $page_current - 1;
        }
        // setting pagination navi
        $page_article_max = $content['struct'][$content['cat_id']]['acat_maxlist'] * $page_current;
        $page_article_at = $content['struct'][$content['cat_id']]['acat_maxlist'] * ($page_current - 1);
        $page_article_at = $page_article_at + 1;
        if ($page_article_max > $max_articles) {
            $page_article_max = $max_articles;
        }
        $paginate_navi = str_replace('#####', $max_articles, $paginate_navi);
        $paginate_navi = str_replace('####', $page_article_max, $paginate_navi);
        $paginate_navi = str_replace('###', $page_article_at, $paginate_navi);
        $paginate_navi = str_replace('##', $max_pages, $paginate_navi);
        $paginate_navi = str_replace('#', $page_current, $paginate_navi);
        $GLOBALS['paginate_temp'] = array('next' => '', 'prev' => '', 'navi' => '');
        $paginate_navi = preg_replace_callback('/\\{NEXT:(.*?)\\}/', 'get_PaginateNext', $paginate_navi);
        $paginate_navi = preg_replace_callback('/\\{PREV:(.*?)\\}/', 'get_PaginatePrevious', $paginate_navi);
        $paginate_navi = preg_replace_callback('/\\{NAVI:(.*?)\\}/', 'get_PaginateNavigate', $paginate_navi);
        // next page link
        if ($GLOBALS['paginate_temp']['next'] && $page_current < $max_pages) {
            $_getVar['listpage'] = $page_next;
            $page_next_link = '<a href="' . rel_url() . '">' . $GLOBALS['paginate_temp']['next'] . '</a>';
        } else {
            $page_next_link = $GLOBALS['paginate_temp']['next'];
        }
        // previous page link
        if ($GLOBALS['paginate_temp']['prev'] && $page_current > 1) {
            $_getVar['listpage'] = $page_prev;
            $page_prev_link = '<a href="' . rel_url() . '">' . $GLOBALS['paginate_temp']['prev'] . '</a>';
        } else {
            $page_prev_link = $GLOBALS['paginate_temp']['prev'];
        }
        // set listpage value to current page
        $paginate_navi = str_replace('{NEXT}', $page_next_link, $paginate_navi);
        $paginate_navi = str_replace('{PREV}', $page_prev_link, $paginate_navi);
        // temporary unset GET listpage setting
        unset($_getVar['listpage']);
        if ($GLOBALS['paginate_temp']['navi']) {
            $navi = explode(',', $GLOBALS['paginate_temp']['navi'], 2);
            $navi[0] = trim($navi[0]);
            $navi[1] = empty($navi[1]) ? array(0 => ' ') : explode('|', $navi[1]);
            $navi['spacer'] = empty($navi[1][0]) ? ' ' : $navi[1][0];
            //spacer
            $navi['prefix'] = empty($navi[1][1]) ? '' : $navi[1][1];
            //prefix
            $navi['suffix'] = empty($navi[1][2]) ? '' : $navi[1][2];
            //suffix
            $navi['navi'] = $navi['prefix'];
            if ($navi[0] == '123') {
                for ($i = 1; $i <= $max_pages; $i++) {
                    if ($i > 1) {
                        $navi['navi'] .= $navi['spacer'];
                    }
                    $navi['navi'] .= $i == $page_current ? $i : '<a href="' . rel_url(array('listpage' => $i)) . '">' . $i . '</a>';
                }
            } elseif ($navi[0] == '1-3') {
                for ($i = 0; $i < $max_pages; $i++) {
                    $i_start = $i * $content['struct'][$content['cat_id']]['acat_maxlist'] + 1;
                    $i_end = $i_start - 1 + $content['struct'][$content['cat_id']]['acat_maxlist'];
                    if ($i_end > $max_articles) {
                        $i_end = $max_articles;
                    }
                    if ($i > 0) {
                        $navi['navi'] .= $navi['spacer'];
                    }
                    $i_entry = $i_start . '&ndash;' . $i_end;
                    $i_page = $i + 1;
                    $navi['navi'] .= $i_page == $page_current ? $i_entry : '<a href="' . rel_url(array('listpage' => $i_page)) . '">' . $i_entry . '</a>';
                }
            }
            $navi['navi'] .= $navi['suffix'];
            // replace navi
            $paginate_navi = str_replace('{NAVI}', $navi['navi'], $paginate_navi);
        }
        // reset GET listpage setting
        $_getVar['listpage'] = $page_current;
        unset($GLOBALS['paginate_temp']);
    } else {
        $paginate = false;
        $paginate_navi = '';
    }
    $tmpllist = array();
    //temporary array for storing templates to minimize load
    $temp_counter = 0;
    $space_counter = 0;
    $listing = $template_default["space_top"];
    //start with space at top
    if (isset($paginate_show['top'])) {
        $listing .= str_replace('{POS}', 'top', $paginate_navi);
    }
    foreach ($content["articles"] as $article) {
        if ($paginate && $content['struct'][$content['cat_id']]['acat_maxlist']) {
            // get page number based on current article counter
            $page_article = ceil(($temp_counter + 1) / $content['struct'][$content['cat_id']]['acat_maxlist']);
            if ($page_article > $page_current) {
                //stop listing
                break;
            } elseif ($page_article != $page_current) {
                //no listing - goto next article
                $temp_counter++;
                continue;
            }
        }
        $link_data = get_article_morelink($article);
        $article_link = $link_data[0];
        //add available keywords to page wide keyword field
        $content['all_keywords'] .= $article["article_keyword"] . ',';
        if ($temp_counter < $temp_topcount) {
            // as long as the counter is lower than the default "top_count" value
            // show the complete article summary listing
            $article["article_image"] = setArticleSummaryImageData($article["article_image"]);
            if ($template) {
                $article["article_image"]['tmpllist'] = $template;
            }
            // build image/image link
            $article["article_image"]["poplink"] = '';
            $thumb_image = false;
            $thumb_img = '';
            $img_thumb_name = '';
            $img_thumb_rel = '';
            $img_thumb_abs = '';
            $img_thumb_width = 0;
            $img_thumb_height = 0;
            $img_thumb_ext = 'jpg';
            $img_zoom_name = '';
            $img_zoom_rel = '';
            $img_zoom_abs = '';
            $img_zoom_width = 0;
            $img_zoom_height = 0;
            if (empty($article["article_image"]["list_caption"])) {
                $article["article_image"]["list_caption"] = '';
            }
            $caption = getImageCaption($article["article_image"]["list_caption"]);
            $article["article_image"]["list_caption"] = $caption[0];
            // caption text
            $article["article_image"]["copyright"] = $caption[4];
            // copyright information
            $article["article_image"]["list_alt"] = $caption[1];
            // alt text
            $article["article_image"]["list_title"] = $caption[3];
            // title text
            if (!empty($article["article_image"]["list_hash"])) {
                $thumb_image = get_cached_image(array("target_ext" => $article["article_image"]['list_ext'], "image_name" => $article["article_image"]['list_hash'] . '.' . $article["article_image"]['list_ext'], "max_width" => $article["article_image"]['list_width'], "max_height" => $article["article_image"]['list_height'], "thumb_name" => md5($article["article_image"]['list_hash'] . $article["article_image"]['list_width'] . $article["article_image"]['list_height'] . $GLOBALS['phpwcms']["sharpen_level"] . $GLOBALS['phpwcms']['colorspace'])));
                if ($thumb_image != false) {
                    $img_thumb_name = $thumb_image[0];
                    $img_thumb_rel = PHPWCMS_IMAGES . $thumb_image[0];
                    $img_thumb_abs = PHPWCMS_URL . PHPWCMS_IMAGES . $thumb_image[0];
                    $img_thumb_width = $thumb_image[1];
                    $img_thumb_height = $thumb_image[2];
                    $img_thumb_ext = $article["article_image"]['list_ext'];
                    $caption[3] = empty($caption[3]) ? '' : ' title="' . html_specialchars($caption[3]) . '"';
                    $caption[1] = html_specialchars($caption[1]);
                    $thumb_img = '<img src="' . PHPWCMS_IMAGES . $thumb_image[0] . '" ' . $thumb_image[3] . ' alt="' . $caption[1] . '"' . $caption[3] . ' class="' . $GLOBALS['template_default']['classes']['image-thumb'] . '" />';
                    if ($article["article_image"]["list_zoom"]) {
                        $zoominfo = get_cached_image(array("target_ext" => $article["article_image"]['list_ext'], "image_name" => $article["article_image"]['list_hash'] . '.' . $article["article_image"]['list_ext'], "max_width" => $GLOBALS['phpwcms']["img_prev_width"], "max_height" => $GLOBALS['phpwcms']["img_prev_height"], "thumb_name" => md5($article["article_image"]['list_hash'] . $GLOBALS['phpwcms']["img_prev_width"] . $GLOBALS['phpwcms']["img_prev_height"] . $GLOBALS['phpwcms']["sharpen_level"] . $GLOBALS['phpwcms']['colorspace'])));
                        if ($zoominfo != false) {
                            $img_zoom_name = $zoominfo[0];
                            $img_zoom_rel = PHPWCMS_IMAGES . $zoominfo[0];
                            $img_zoom_abs = PHPWCMS_URL . PHPWCMS_IMAGES . $zoominfo[0];
                            $img_zoom_width = $zoominfo[1];
                            $img_zoom_height = $zoominfo[2];
                            $article["article_image"]["poplink"] = 'image_zoom.php?' . getClickZoomImageParameter($zoominfo[0] . '?' . $zoominfo[3]);
                            if (!empty($caption[2][0])) {
                                $open_link = $caption[2][0];
                                $return_false = '';
                            } else {
                                $open_link = $article["article_image"]["poplink"];
                                $return_false = 'return false;';
                            }
                            if (empty($article["article_image"]["list_lightbox"]) && !empty($caption[2][0])) {
                                initFrontendJS();
                                $article["article_image"]["poplink"] = '<a href="' . $article["article_image"]["poplink"] . '" ';
                                $article["article_image"]["poplink"] .= 'onclick="checkClickZoom();clickZoom(\'' . $open_link;
                                $article["article_image"]["poplink"] .= "','previewpic','width=" . $zoominfo[1];
                                $article["article_image"]["poplink"] .= ",height=" . $zoominfo[2] . "');" . $return_false;
                                $article["article_image"]["poplink"] .= '"' . $caption[2][1] . ' class="' . $GLOBALS['template_default']['classes']['image-zoom'] . '">';
                            } else {
                                // lightbox
                                initSlimbox();
                                $article["article_image"]["poplink"] = '<a href="' . PHPWCMS_IMAGES . $zoominfo[0] . '" rel="lightbox" ';
                                if ($article["article_image"]["list_caption"]) {
                                    $article["article_image"]["poplink"] .= 'title="' . parseLightboxCaption($article["article_image"]["list_caption"]) . '" ';
                                }
                                $article["article_image"]["poplink"] .= 'class="' . $GLOBALS['template_default']['classes']['image-lightbox'] . '">';
                            }
                            $article["article_image"]["poplink"] .= $thumb_img . '</a>';
                        }
                    }
                    unset($caption);
                }
            } else {
                $article["article_image"]["list_id"] = 0;
                $article["article_image"]["list_hash"] = '';
            }
            // set default template
            if (empty($article["article_image"]['tmpllist']) || $article["article_image"]['tmpllist'] == 'default') {
                $article["article_image"]['tmpllist'] = 'default';
                if (empty($tmpllist['default'])) {
                    $tmpllist['default'] = file_get_contents(PHPWCMS_TEMPLATE . 'inc_default/article_summary_list.tmpl');
                }
            }
            // try to read the template files
            // 1. try to check if template was read
            if (!isset($tmpllist[$article["article_image"]['tmpllist']])) {
                $tmpllist[$article["article_image"]['tmpllist']] = @file_get_contents(PHPWCMS_TEMPLATE . 'inc_cntpart/articlesummary/list/' . $article["article_image"]['tmpllist']);
            }
            if ($tmpllist[$article["article_image"]['tmpllist']]) {
                // set frontend edit link
                if (FE_EDIT_LINK && ($_SESSION["wcs_user_admin"] || $_SESSION["wcs_user_id"] == $article["article_uid"])) {
                    $tmpl = getFrontendEditLink('summary', $article['article_id']);
                } else {
                    $tmpl = '';
                }
                //rendering
                $tmpl .= $tmpllist[$article["article_image"]['tmpllist']];
                $tmpl = render_cnt_template($tmpl, 'TITLE', empty($article['article_notitle']) ? html_specialchars($article["article_title"]) : '');
                $tmpl = render_cnt_template($tmpl, 'SUB', html_specialchars($article["article_subtitle"]));
                // replace thumbnail and zoom image information
                $tmpl = str_replace(array('{THUMB_NAME}', '{THUMB_REL}', '{THUMB_ABS}', '{THUMB_WIDTH}', '{THUMB_HEIGHT}', '{IMAGE_NAME}', '{IMAGE_REL}', '{IMAGE_ABS}', '{IMAGE_WIDTH}', '{IMAGE_HEIGHT}', '{IMAGE_ID}', '{IMAGE_HASH}', '{IMAGE_EXT}'), array($img_thumb_name, $img_thumb_rel, $img_thumb_abs, $img_thumb_width, $img_thumb_height, $img_zoom_name, $img_zoom_rel, $img_zoom_abs, $img_zoom_width, $img_zoom_height, $article["article_image"]["list_id"], $article["article_image"]["list_hash"], $img_thumb_ext), $tmpl);
                if (preg_match('/\\{SUMMARY:(\\d+)\\}/', $tmpl, $matches)) {
                    if (empty($article['article_image']['list_maxwords'])) {
                        $article['article_image']['list_maxwords'] = intval($matches[1]);
                    }
                    $tmpl = preg_replace('/\\{SUMMARY:\\d+\\}/', '{SUMMARY}', $tmpl);
                }
                if (strpos($article["article_summary"], '-//-')) {
                    $article["article_summary"] = explode('-//-', $article["article_summary"]);
                    $article['article_image']['list_maxwords_temp'] = count(preg_split("/[\\s,]+/", $article["article_summary"][0], -1, PREG_SPLIT_NO_EMPTY));
                    if (empty($article['article_image']['list_maxwords']) || $article['article_image']['list_maxwords_temp'] < $article['article_image']['list_maxwords']) {
                        $article['article_image']['list_maxwords'] = $article['article_image']['list_maxwords_temp'];
                        $article["article_summary"] = trim($article["article_summary"][0]);
                    } else {
                        $article["article_summary"] = implode(' ', $article["article_summary"]);
                    }
                }
                $tmpl = render_cnt_template($tmpl, 'SUMMARY', empty($article['article_image']['list_maxwords']) ? $article["article_summary"] : getCleanSubString($article["article_summary"], abs($article['article_image']['list_maxwords']), $template_default['ellipse_sign'], $article['article_image']['list_maxwords'] < 0 ? 'char' : 'word', true));
                // Render SYSTEM
                if (strpos($tmpl, '[SYSTEM]') !== false) {
                    // Search for all system related content parts
                    $sql_cnt = 'SELECT * FROM ' . DB_PREPEND . 'phpwcms_articlecontent WHERE acontent_aid=' . $article["article_id"] . ' ';
                    $sql_cnt .= "AND acontent_visible=1 AND acontent_trash=0 AND acontent_block='SYSTEM' AND acontent_tid IN (1, 3) ";
                    // 1 = article list, 3 = article detail OR list
                    if (!FEUSER_LOGIN_STATUS) {
                        $sql_cnt .= 'AND acontent_granted=0 ';
                    }
                    $sql_cnt .= "ORDER BY acontent_sorting, acontent_id";
                    $tmpl = render_cnt_template($tmpl, 'SYSTEM', showSelectedContent('CPC', $sql_cnt, true));
                } else {
                    $tmpl = render_cnt_template($tmpl, 'SYSTEM', '');
                }
                // article class based on keyword *CSS-classname*
                $article['article_class'] = get_css_keywords($article['article_keyword']);
                $article['article_class'] = count($article['article_class']) ? implode(' ', $article['article_class']) : '';
                $tmpl = render_cnt_template($tmpl, 'CLASS', $article['article_class']);
                $tmpl = render_cnt_template($tmpl, 'IMAGE', $thumb_img);
                $tmpl = render_cnt_template($tmpl, 'ZOOMIMAGE', $article["article_image"]["poplink"]);
                $tmpl = render_cnt_template($tmpl, 'CAPTION', nl2br(html_specialchars($article["article_image"]["list_caption"])));
                $tmpl = render_cnt_template($tmpl, 'ALT', html_specialchars($article["article_image"]["list_alt"]));
                $tmpl = render_cnt_template($tmpl, 'IMAGE_TITLE', html_specialchars($article["article_image"]["list_title"]));
                $tmpl = render_cnt_template($tmpl, 'COPYRIGHT', html_specialchars($article["article_image"]["copyright"]));
                $tmpl = render_cnt_template($tmpl, 'ARTICLELINK', $article["article_morelink"] ? $article_link : '');
                $tmpl = render_cnt_template($tmpl, 'EDITOR', html_specialchars($article["article_username"]));
                $tmpl = render_cnt_template($tmpl, 'ARTICLEID', $article["article_id"]);
                $tmpl = render_cnt_template($tmpl, 'MORE', $article["article_morelink"] ? $template_default["top_readmore_link"] : '');
                $tmpl = render_cnt_template($tmpl, 'TARGET', $article["article_morelink"] && $link_data[1] ? ' target="' . $link_data[1] . '"' : '');
                $tmpl = render_cnt_template($tmpl, 'BEFORE', '<!--before//-->');
                $tmpl = render_cnt_template($tmpl, 'AFTER', '<!--after//-->');
                $tmpl = render_cnt_date($tmpl, $article["article_date"], $article["article_livedate"], $article["article_killdate"]);
                $tmpl = render_cnt_template($tmpl, 'SPACE', $space_counter ? '<!--space//-->' : '');
                $listing .= $tmpl;
                $article["article_image"]['tmpllist'] = 1;
            } else {
                $article["article_image"]['tmpllist'] = 0;
            }
        } else {
            // if "top_count" value is equal or larger
            // show only the article headline listing
            if ($temp_counter && $temp_counter == $temp_topcount) {
                $listing .= $template_default["space_aftertop_text"];
            } elseif ($temp_counter) {
                $listing .= $template_default["space_between_list"];
            }
            $listing .= $template_default["list_headline_before"];
            // set frontend edit link
            if (FE_EDIT_LINK && ($_SESSION["wcs_user_admin"] || $_SESSION["wcs_user_id"] == $article["article_uid"])) {
                $listing .= getFrontendEditLink('article', $article['article_id']);
                $listing .= getFrontendEditLink('summary', $article['article_id']);
            }
            $listing .= '<a href="' . $article_link . '" class="' . $GLOBALS['template_default']['classes']['link-article-listing'] . '">';
            $listing .= $template_default["list_startimage"];
            $listing .= html_specialchars($article["article_title"]);
            $listing .= '</a>' . $template_default["list_headline_after"];
        }
        $temp_counter++;
        $space_counter++;
    }
    if (isset($paginate_show['bottom'])) {
        $listing .= str_replace('{POS}', 'bottom', $paginate_navi);
    }
    if (!empty($paginate_show['rt'])) {
        $content['globalRT'][$paginate_show['rt']] = $paginate_navi;
    }
    // restore original articles
    if (isset($_old_articles)) {
        $content["articles"] = $_old_articles;
    }
    $listing .= $template_default["space_bottom"];
    //ends with space at bottom
    return $listing;
}
         $row['article_image']['height'] = $content['alink']['alink_height'];
     }
     // build image/image link
     $row['article_image']['poplink'] = '';
     $row['article_image']['detail'] = false;
     $row['article_image']['img'] = '';
     $row['article_image']['crop'] = empty($content['alink']['alink_crop']) ? 0 : 1;
     if ($row['article_image']['caption']) {
         $row['article_image']['caption'] = getImageCaption($row['article_image']['caption']);
         $row['article_image']['caption'][0] = html_specialchars($row['article_image']['caption'][0]);
         $row['article_image']['caption'][3] = html_specialchars($row['article_image']['caption'][3]);
         $row['article_image']['caption'][1] = html_specialchars($row['article_image']['caption'][1]);
     } else {
         $row['article_image']['caption'] = array(0 => '', 1 => '', 2 => '', 3 => '', 4 => '', 5 => '', 6 => '');
     }
     $row['article_image']['detail'] = get_cached_image(array("target_ext" => $row['article_image']['ext'], "image_name" => $row['article_image']['hash'] . '.' . $row['article_image']['ext'], "max_width" => $row['article_image']['width'], "max_height" => $row['article_image']['height'], "thumb_name" => md5($row['article_image']['hash'] . $row['article_image']['width'] . $row['article_image']['height'] . $phpwcms['sharpen_level'] . $row['article_image']['crop'] . $phpwcms['colorspace']), 'crop_image' => $row['article_image']['crop']));
     if ($row['article_image']['detail'] != false) {
         $row['article_image']['img'] = '<img src="' . PHPWCMS_IMAGES . $row['article_image']['detail'][0] . '" ' . $row['article_image']['detail'][3];
         $row['article_image']['img'] .= ' data-detail-id="' . $row['article_image']['id'] . '" data-detail-hash="' . $row['article_image']['hash'] . '"';
         $row['article_image']['img'] .= ' alt="' . ($row['article_image']['caption'][1] ? $row['article_image']['caption'][1] : $row['article_image']['name']) . '"';
         if ($row['article_image']['caption'][3]) {
             $row['article_image']['img'] .= ' title="' . $row['article_image']['caption'][3] . '"';
         }
         $row['article_image']['img'] .= ' />';
     }
     // replace thumbnail and zoom image information
     $content['alink']['tr'][$key] = str_replace(array('{IMAGE_DETAIL_ID}', '{IMAGE_DETAIL_HASH}', '{IMAGE_DETAIL_EXT}', '{IMAGE_DETAIL_NAME}'), array($row['article_image']['id'], $row['article_image']['hash'], $row['article_image']['ext'], $row['article_image']['name']), $content['alink']['tr'][$key]);
     $content['alink']['tr'][$key] = render_cnt_template($content['alink']['tr'][$key], 'IMAGE_DETAIL', $row['article_image']['img']);
     $content['alink']['tr'][$key] = render_cnt_template($content['alink']['tr'][$key], 'CAPTION_DETAIL', $row['article_image']['caption'][0]);
 } else {
     $content['alink']['tr'][$key] = render_cnt_template($content['alink']['tr'][$key], 'IMAGE_DETAIL', '');
function imagelisttable($imagelist, $rand = "0:0:0:0", $align = 0, $type = 0)
{
    // build imagelist or ecard chooser table
    // image: type = 0
    // ecard: type = 1
    $template_type = $type ? 'ecard' : 'imagelist';
    $usetable = !isset($imagelist['usetable']) || $imagelist['usetable'] ? true : false;
    if (empty($GLOBALS['cnt_image_lightbox'])) {
        $lightbox = 0;
    } else {
        $lightbox = generic_string(5);
    }
    $caption_on = empty($imagelist['nocaption']) ? true : false;
    $crop = empty($imagelist['crop']) ? 0 : 1;
    $image_border = ' border="' . (empty($GLOBALS["template_default"]["article"][$template_type . "_border"]) ? '0' : $GLOBALS["template_default"]["article"][$template_type . "_border"]) . '"';
    if ($usetable) {
        $table_class = $GLOBALS["template_default"]["article"][$template_type . "_table_class"];
        if (empty($align)) {
            $align = '';
        } else {
            $table_class .= ' ' . $GLOBALS['template_default']['classes']['image-list-table'] . $align;
            $align = ' align="' . $align . '"';
        }
        $table_class = ' class="' . trim($table_class) . '"';
        $table_bgcolor = empty($GLOBALS["template_default"]["article"][$template_type . "_table_bgcolor"]) ? '' : ' bgcolor="' . $GLOBALS["template_default"]["article"][$template_type . "_table_bgcolor"] . '"';
        $image_align = empty($GLOBALS["template_default"]["article"][$template_type . "_align"]) ? '' : ' align="' . $GLOBALS["template_default"]["article"][$template_type . "_align"] . '"';
        $image_valign = empty($GLOBALS["template_default"]["article"][$template_type . "_valign"]) ? '' : ' valign="' . $GLOBALS["template_default"]["article"][$template_type . "_valign"] . '"';
        $image_class = empty($GLOBALS["template_default"]["article"][$template_type . "_class"]) ? '' : ' class="' . $GLOBALS["template_default"]["article"][$template_type . "_class"] . '"';
        $image_bgcolor = empty($GLOBALS["template_default"]["article"][$template_type . "_bgcolor"]) ? '' : ' bgcolor="' . $GLOBALS["template_default"]["article"][$template_type . "_bgcolor"] . '"';
        $caption_class = empty($GLOBALS["template_default"]["article"][$template_type . "_caption_class"]) ? '' : ' class="' . $GLOBALS["template_default"]["article"][$template_type . "_caption_class"] . '"';
        $caption_bgcolor = empty($GLOBALS["template_default"]["article"][$template_type . "_caption_bgcolor"]) ? '' : ' bgcolor="' . $GLOBALS["template_default"]["article"][$template_type . "_caption_bgcolor"] . '"';
        $caption_valign = empty($GLOBALS["template_default"]["article"][$template_type . "_caption_valign"]) ? '' : ' valign="' . $GLOBALS["template_default"]["article"][$template_type . "_caption_valign"] . '"';
        $caption_align = empty($GLOBALS["template_default"]["article"][$template_type . "_caption_align"]) ? '' : ' align="' . $GLOBALS["template_default"]["article"][$template_type . "_caption_align"] . '"';
        $image_imgclass = empty($GLOBALS["template_default"]["article"][$template_type . "_imgclass"]) ? '' : ' class="' . $GLOBALS["template_default"]["article"][$template_type . "_imgclass"] . '"';
        $capt_before = $GLOBALS["template_default"]["article"][$template_type . "_caption_before"];
        $capt_after = $GLOBALS["template_default"]["article"][$template_type . "_caption_after"];
    } else {
        $image_imgclass = ' class="' . $imagelist['class_image_thumb'] . '"';
    }
    $rand = explode(":", $rand);
    if (count($rand)) {
        foreach ($rand as $key => $value) {
            $rand[$key] = intval($value);
        }
    } else {
        $rand = array(0, 0, 0, 0);
    }
    $col_rand = $rand[2] && $rand[3] ? 2 : ($rand[2] || $rand[3] ? 1 : 0);
    if ($count_images = count($imagelist['images'])) {
        // randomize image
        if (!empty($imagelist['random'])) {
            shuffle($imagelist['images']);
        }
        if (empty($imagelist['limit'])) {
            $imagelist['limit'] = 0;
        }
        //Tabelle starten
        $table = LF;
        if ($usetable) {
            $table .= '	<table border="0" cellspacing="0" cellpadding="0"' . $align . $table_bgcolor . $table_class . ' summary="">' . LF;
        } else {
            $table .= '	<div class="';
            if (empty($imagelist['class'])) {
                $table .= 'image-table';
            } else {
                $table .= $imagelist['class'];
            }
            $table .= '">' . LF;
        }
        $x = 0;
        $y = 0;
        $z = 0;
        foreach ($imagelist['images'] as $key => $value) {
            if (isset($imagelist['width'])) {
                $imagelist['images'][$key][4] = $imagelist['width'];
                $imagelist['images'][$key][5] = $imagelist['height'];
            }
            $y++;
            if ($usetable && $z && $x == 1) {
                if ($col_space) {
                    $table .= LF . '<tr>' . LF . '	<td';
                    $table .= $col_total > 1 ? " colspan=\"" . $col_total . "\"" : "";
                    if (!empty($GLOBALS["template_default"]['article']['imagelist_spacerrow_class'])) {
                        $table .= ' class="' . $GLOBALS["template_default"]['article']['imagelist_spacerrow_class'] . '">';
                        $table .= spacer(1, 1) . '</td>' . LF . '</tr>' . LF;
                    } else {
                        $table .= '>' . spacer(1, $col_space) . '</td>' . LF . '</tr>' . LF;
                    }
                }
            }
            if ($usetable && !$x) {
                //Some default values
                $col_space = $imagelist['space'];
                //Space between images
                $col_count = $imagelist['col'];
                //columns
                $col_total = $col_count + ($col_space ? $col_count - 1 : 0) + $col_rand;
                //Wenn oberer Rand definiert
                if ($rand[0]) {
                    $table .= '<tr>' . LF . '	<td' . ($col_total > 1 ? ' colspan="' . $col_total . '"' : '') . '>' . spacer(1, $rand[0]) . '</td>' . LF . '</tr>' . LF;
                }
                $x = 1;
            }
            if ($usetable && $x == 1) {
                // if left border
                $table_tmp = $rand[2] ? '	<td width="' . $rand[2] . '">' . spacer($rand[2], 1) . '</td>' . LF : '';
                //Neue Tabellenzeile
                $capt_tmp = '';
                $capt_row = '<tr>' . LF . $table_tmp;
                if ($caption_on) {
                    $table .= $capt_row;
                } else {
                    $table .= '<tr>' . LF;
                }
            }
            //Aktuelle Bildspalte ausgeben
            if ($usetable) {
                $table .= '	<td' . $image_align . $image_valign . $image_bgcolor . $image_class . '>';
            } else {
                if (!$x) {
                    $x = 1;
                }
                $table .= '		<div class="' . $imagelist['class_image_wrapper'];
                if ($x === 1) {
                    $table .= ' first';
                }
                $table .= ' row-' . ($z + 1);
                $table .= '">' . LF . '			';
            }
            $thumb_image = get_cached_image(array("target_ext" => $imagelist['images'][$key][3], "image_name" => $imagelist['images'][$key][2] . '.' . $imagelist['images'][$key][3], "max_width" => $imagelist['images'][$key][4], "max_height" => $imagelist['images'][$key][5], "thumb_name" => md5($imagelist['images'][$key][2] . $imagelist['images'][$key][4] . $imagelist['images'][$key][5] . $GLOBALS['phpwcms']["sharpen_level"] . $crop . $GLOBALS['phpwcms']['colorspace']), 'crop_image' => $crop));
            if ($thumb_image && $imagelist['zoom']) {
                $zoominfo = get_cached_image(array("target_ext" => $imagelist['images'][$key][3], "image_name" => $imagelist['images'][$key][2] . '.' . $imagelist['images'][$key][3], "max_width" => $GLOBALS['phpwcms']["img_prev_width"], "max_height" => $GLOBALS['phpwcms']["img_prev_height"], "thumb_name" => md5($imagelist['images'][$key][2] . $GLOBALS['phpwcms']["img_prev_width"] . $GLOBALS['phpwcms']["img_prev_height"] . $GLOBALS['phpwcms']["sharpen_level"] . $GLOBALS['phpwcms']['colorspace'])));
            }
            // now try to build caption and if neccessary add alt to image or set external link for image
            $caption = getImageCaption($imagelist['images'][$key][6]);
            // set caption and ALT Image Text for imagelist
            $capt_cur = !$type ? html_specialchars($caption[0]) : $caption[0];
            $caption[3] = empty($caption[3]) ? '' : ' title="' . html_specialchars($caption[3]) . '"';
            //title
            $caption[1] = empty($caption[1]) ? html_specialchars($imagelist['images'][$key][1]) : html_specialchars($caption[1]);
            $list_img_temp = '<img src="' . PHPWCMS_IMAGES . $thumb_image[0] . '" ' . $thumb_image[3] . $image_border . $image_imgclass;
            $list_img_temp .= ' data-image-id="' . $imagelist['images'][$key][0] . '" data-image-hash="' . $imagelist['images'][$key][2] . '"';
            $list_img_temp .= ' data-image-ext="' . $imagelist['images'][$key][3] . '"';
            $list_img_temp .= ' alt="' . $caption[1] . '"' . $caption[3] . ' />';
            if ($imagelist['zoom'] && isset($zoominfo) && $zoominfo != false) {
                // if click enlarge the image
                $open_popup_link = 'image_zoom.php?' . getClickZoomImageParameter($zoominfo[0] . '?' . $zoominfo[3]);
                if ($caption[2][0]) {
                    $open_link = $caption[2][0];
                    $return_false = '';
                } else {
                    $open_link = $open_popup_link;
                    $return_false = 'return false;';
                }
                if (!$lightbox || $caption[2][0]) {
                    $table .= "<a href=\"" . $open_link . "\" onclick=\"checkClickZoom();clickZoom('" . $open_popup_link . "','previewpic','width=";
                    $table .= $zoominfo[1] . ",height=" . $zoominfo[2] . "');" . $return_false . '"' . $caption[2][1] . ' class="' . $imagelist['class_image_zoom'] . '">';
                } else {
                    // lightbox
                    $table .= '<a href="' . PHPWCMS_IMAGES . $zoominfo[0] . '" rel="lightbox[' . $lightbox . ']"';
                    if ($capt_cur) {
                        $table .= ' title="' . parseLightboxCaption($capt_cur) . '"';
                    }
                    $table .= ' class="' . $imagelist['class_image_lightbox'] . '">';
                }
                $table .= $list_img_temp . "</a>";
            } else {
                // if not click enlarge
                if ($caption[2][0]) {
                    $table .= '<a href="' . $caption[2][0] . '"' . $caption[2][1] . ' class="' . $imagelist['class_image_link'] . '">' . $list_img_temp . '</a>';
                } else {
                    $table .= $list_img_temp;
                }
            }
            if ($usetable) {
                $table .= '</td>' . LF;
                if ($caption_on && $capt_cur) {
                    $capt_tmp .= $capt_cur;
                    $capt_cur = '<span style="width:' . $thumb_image[1] . 'px">' . $capt_cur . '</span>';
                } else {
                    $capt_cur = '&nbsp;';
                }
                $capt_row .= '	<td' . $caption_valign . $caption_align . $caption_bgcolor . $caption_class . '>' . $capt_before . $capt_cur . $capt_after . '</td>' . LF;
            } else {
                if ($caption_on && $capt_cur) {
                    $caption_class = empty($GLOBALS["template_default"]["article"]["image_caption_class"]) ? 'caption' : $GLOBALS["template_default"]["article"]["image_caption_class"];
                    $table .= LF . '			<p style="width:' . $thumb_image[1] . 'px" class="' . $caption_class . '">' . $GLOBALS["template_default"]["article"]["image_caption_before"];
                    $table .= $capt_cur;
                    if ($caption[4] !== '') {
                        $table .= ' <span class="' . $GLOBALS['template_default']['classes']['copyright'] . '">' . html_specialchars($caption[4]) . '</span>';
                    }
                    $table .= $GLOBALS["template_default"]["article"]["image_caption_after"] . "</p>";
                }
                $table .= LF . '		</div>' . LF;
            }
            //Gegenchecken wieviele Tabellenspalten als Rest bleiben und ergänzen
            if ($usetable) {
                if ($y == $count_images && $col_count > 1) {
                    //wenn eigentlich alle Bilder durchlaufen sind
                    if ($col_space && $x < $col_count) {
                        $xct = '	<td>' . spacer($col_space, 1) . '</td>' . LF;
                        $table .= $xct;
                        $capt_row .= $xct;
                    }
                    $rest_image = ceil($count_images / $col_count) * $col_count - $count_images;
                    for ($i = 1; $i <= $rest_image; $i++) {
                        $table .= '	<td>&nbsp;</td>';
                        $capt_row .= '	<td>&nbsp;</td>';
                        if ($i < $rest_image) {
                            if ($col_space) {
                                $xct = '	<td width="' . $col_space . '">' . spacer($col_space, 1) . '</td>' . LF;
                                $table .= $xct;
                                $capt_row .= $xct;
                            }
                        }
                        $x++;
                    }
                }
                if ($x == $col_count) {
                    //Wenn maximale Anzahl Bildspalten erreicht
                    $xct = $rand[3] ? '<td width="' . $rand[3] . '">' . spacer($rand[3], 1) . '</td>' . LF : '';
                    $table .= $xct;
                    $capt_row .= $xct;
                    $table .= "</tr>" . LF;
                    $capt_row .= "</tr>" . LF;
                    if ($capt_tmp) {
                        if ($caption_on) {
                            $table .= $capt_row;
                        }
                        $capt_row = '';
                        $capt_tmp = '';
                    }
                    $x = 1;
                    $z++;
                } else {
                    $xct = $col_space ? '	<td width="' . $col_space . '">' . spacer($col_space, 1) . '</td>' . LF : '';
                    $table .= $xct;
                    $capt_row .= $xct;
                    $x++;
                }
            } else {
                if ($x == $imagelist['col']) {
                    $x = 0;
                    $z++;
                } else {
                    $x++;
                }
            }
            // end if max image count
            if ($imagelist['limit'] == $y) {
                break;
            }
        }
        if ($usetable) {
            if ($rand[1]) {
                $table .= '<tr>' . LF . '	<td' . ($col_total > 1 ? " colspan=\"" . $col_total . "\"" : "") . ">" . spacer(1, $rand[1]) . '</td>' . LF . '</tr>' . LF;
            }
            $table .= '	</table>' . LF;
        } else {
            $table .= '	</div>' . LF;
        }
    }
    return $table;
}
Exemple #23
0
:&nbsp;</td>
	<td valign="top"><table border="0" cellpadding="0" cellspacing="0" summary="">
	<tr>
		<td valign="top">
		<select name="cimage_list[]" size="<?php 
echo $img_count + 5;
?>
" multiple="multiple" class="width360" id="cimage_list">
<?php 
if ($img_count) {
    // browse images and list available
    // will be visible only when aceessible
    foreach ($content['image_list']['images'] as $key => $value) {
        // 0   :1       :2   :3        :4    :5     :6      :7       :8
        // dbid:filename:hash:extension:width:height:caption:position:zoom
        $thumb_image = get_cached_image(array("target_ext" => $content['image_list']['images'][$key][3], "image_name" => $content['image_list']['images'][$key][2] . '.' . $content['image_list']['images'][$key][3], "thumb_name" => md5($content['image_list']['images'][$key][2] . $phpwcms["img_list_width"] . $phpwcms["img_list_height"] . $phpwcms["sharpen_level"] . $phpwcms['colorspace'])));
        if ($thumb_image != false) {
            // image found
            echo '<option value="' . $content['image_list']['images'][$key][0] . '">';
            $img_name = html($content['image_list']['images'][$key][1]);
            echo $img_name . '</option>' . LF;
            if ($imgx == 4) {
                $img_thumbs .= '<br /><img src="img/leer.gif" alt="" border="0" width="1" height="2" /><br />';
                $imgx = 0;
            }
            if ($imgx) {
                $img_thumbs .= '<img src="img/leer.gif" alt="" border="0" width="2" height="1" />';
            }
            $img_thumbs .= '<img src="' . PHPWCMS_IMAGES . $thumb_image[0] . '" border="0" ' . $thumb_image[3] . ' alt="' . $img_name . '" title="' . $img_name . '" />';
            $caption_box[] = html($content['image_list']['images'][$key][6]);
            $imgx++;
 $img_zoom_name = '';
 $img_zoom_filename = '';
 $img_zoom_rel = '';
 $img_zoom_abs = '';
 $img_zoom_width = '';
 $img_zoom_height = '';
 $col++;
 $total++;
 // put spacer content between images
 if ($col > 1) {
     $image['tmpl_images'][$x] .= $image['tmpl_entry_space'];
 } else {
     $image['tmpl_images'][$x] = '';
 }
 if ($value['zoom_hash'] && $image['zoom']) {
     $zoominfo = get_cached_image(array("target_ext" => $value['zoom_ext'], "image_name" => $value['zoom_hash'] . '.' . $value['zoom_ext'], "max_width" => $image['width_zoom'], "max_height" => $image['height_zoom'], "thumb_name" => md5($value['zoom_hash'] . $image['width_zoom'] . $image['height_zoom'] . $phpwcms["sharpen_level"] . $image['crop_zoom'] . $phpwcms['colorspace']), 'crop_image' => $image['crop_zoom']));
 }
 // set caption and ALT Image Text for imagelist
 $caption = getImageCaption($value['caption']);
 if ($caption[0]) {
     $caption[0] = html_specialchars($caption[0]);
 }
 // no ALT, no TITLE
 if (empty($caption[1])) {
     $capt_cur = $caption[0];
     $caption[1] = html_specialchars($value['thumb_name']);
 } else {
     $caption[1] = html_specialchars($caption[1]);
     $capt_cur = $caption[1];
 }
 if (empty($caption[2])) {
     echo "<a href=\"fileinfo.php?public&amp;fid=" . $file_row["f_id"];
     echo "\" target=\"_blank\" onclick=\"flevPopupLink(this.href,'filedetail','scrollbars=yes,resizable=yes,width=500,height=400',1);return document.MM_returnValue;\">";
     echo $filename . "</a>";
     echo "</td>\n";
     echo "<td width=\"15\" align=\"right\" class=\"msglist\">";
     echo "<a href=\"include/inc_act/act_download.php?pl=1&dl=" . $file_row["f_id"];
     echo "\" target=\"_blank\" title=\"" . $BL['be_fprivfunc_dlfile'] . ": " . $filename . "\">";
     echo "<img src=\"img/button/download_disc.gif\" border=\"0\"></a>";
     //target='_blank'
     echo "<img src=\"img/leer.gif\" width=\"2\" height=\"1\">";
     //Spacer
     echo "</td>\n";
     //Ende Aufbau
     echo "</tr>\n";
     if ($_SESSION["wcs_user_thumb"]) {
         $thumb_image = get_cached_image(array("target_ext" => $file_row["f_ext"], "image_name" => $file_row["f_hash"] . '.' . $file_row["f_ext"], "thumb_name" => md5($file_row["f_hash"] . $phpwcms["img_list_width"] . $phpwcms["img_list_height"] . $phpwcms["sharpen_level"] . $phpwcms['colorspace'])));
         if ($thumb_image != false) {
             echo "<tr>\n";
             echo "<td width=\"37\"><img src=\"img/leer.gif\" height=\"1\" width=\"37\" border=\"0\"></td>\n";
             echo "<td width=\"13\"><img src=\"img/leer.gif\" height=\"1\" width=\"1\" border=\"0\"></td>\n<td width=\"";
             echo "473\"><img src=\"img/leer.gif\" height=\"1\" width=\"6\"><a href=\"fileinfo.php?public&amp;fid=";
             echo $file_row["f_id"] . "\" target=\"_blank\" onclick=\"flevPopupLink(this.href,'filedetail','scrollbars=";
             echo "yes,resizable=yes,width=500,height=400',1); return document.MM_returnValue;\">";
             echo '<img src="' . PHPWCMS_IMAGES . $thumb_image[0] . '" border="0" ' . $thumb_image[3] . "></a></td>\n";
             echo "<td width=\"15\"><img src=\"img/leer.gif\" height=\"1\" width=\"1\" border=\"0\"></td>\n</tr>\n";
             echo "<tr><td colspan=\"4\"><img src=\"img/leer.gif\" height=\"2\" width=\"1\" border=\"0\"></td>\n</tr>\n";
         }
     }
     $file_durchlauf++;
 }
 if ($file_durchlauf) {
                 } else {
                     $mod_sliderjs['br_sliderjs']['img_sql_data'][$k]['jqs_descr'] = '';
                 }
                 //? do we have css-class
                 if (isset($mod_sliderjs['br_sliderjs']['imagesdata'][$val][$v['f_id']][3])) {
                     $mod_sliderjs['br_sliderjs']['img_sql_data'][$k]['jqs_css'] = $mod_sliderjs['br_sliderjs']['imagesdata'][$val][$v['f_id']][3];
                 } else {
                     $mod_sliderjs['br_sliderjs']['img_sql_data'][$k]['jqs_css'] = '';
                 }
             } else {
                 $mod_sliderjs['br_sliderjs']['img_sql_data'][$k]['jqs_title'] = '';
                 $mod_sliderjs['br_sliderjs']['img_sql_data'][$k]['jqs_descr'] = '';
                 $mod_sliderjs['br_sliderjs']['img_sql_data'][$k]['jqs_css'] = '';
             }
             //get image
             $mod_sliderjs['br_sliderjs']['img_sql_data'][$k]['jqs_image'] = get_cached_image(array("target_ext" => $v['f_ext'], "image_name" => $v['f_hash'] . '.' . $v['f_ext'], "max_width" => $mod_sliderjs['br_sliderjs']['jqs_imgwidth'], "max_height" => $mod_sliderjs['br_sliderjs']['jqs_imgheight'], "thumb_name" => md5($v['f_hash'] . $mod_sliderjs['br_sliderjs']['jqs_imgwidth'] . $mod_sliderjs['br_sliderjs']['jqs_imgheight'] . $phpwcms["sharpen_level"] . '1'), "crop_image" => 1));
         }
         //end foreach image
     }
     $mod_sliderjs['br_sliderjs']['data'] = array_merge($mod_sliderjs['br_sliderjs']['data'], $mod_sliderjs['br_sliderjs']['img_sql_data']);
 }
 //end foreach folder
 //only when some images...
 if (count($mod_sliderjs['br_sliderjs']['data'])) {
     //randomize
     if ($content['br_sliderjs'][$content['br_sliderjs']['jqs_sliderpluginAlias']]['jqs_imgrand'] == 1) {
         shuffle($mod_sliderjs['br_sliderjs']['data']);
     }
     //include plugin cnt.article
     include $phpwcms['modules'][$crow["acontent_module"]]['dir'] . 'plugins/' . $content['br_sliderjs']['jqs_sliderpluginAlias'] . '/cnt.article.' . $content['br_sliderjs']['jqs_sliderpluginAlias'] . '.php';
 }