}
                $news['row_count'] = 1;
            } else {
                if ($news['total_count'] < $news['entry_count']) {
                    $news['entries']['entry' . $key] = $news['tmpl_entry_space'];
                }
                $news['row_count']++;
            }
            $news['total_count']++;
        }
    }
    $news['tmpl_news'] = render_cnt_template($news['tmpl_news'], 'NEWS_ENTRIES', implode('', $news['entries']));
    $news['tmpl_news'] = render_cnt_template($news['tmpl_news'], 'TITLE', html_specialchars($crow['acontent_title']));
    $news['tmpl_news'] = render_cnt_template($news['tmpl_news'], 'SUBTITLE', html_specialchars($crow['acontent_subtitle']));
    // render news pagination
    if ($news['list_mode']) {
        if ($news['news_paginate'] == 1) {
            $news['tmpl_news'] = render_cnt_template($news['tmpl_news'], 'PAGINATE', true);
            $news['tmpl_news'] = render_cnt_template($news['tmpl_news'], 'PAGE_PREV', $news['page_prev']);
            $news['tmpl_news'] = render_cnt_template($news['tmpl_news'], 'PAGE_NEXT', $news['page_next']);
            $news['tmpl_news'] = str_replace('{PAGE_CURRENT}', $news['current_page'], $news['tmpl_news']);
            $news['tmpl_news'] = str_replace('{PAGE_TOTAL}', $news['total_pages'], $news['tmpl_news']);
        } else {
            $news['tmpl_news'] = render_cnt_template($news['tmpl_news'], 'PAGINATE', '');
        }
    } else {
        $news['tmpl_news'] = replace_cnt_template($news['tmpl_news'], 'PAGINATE', '');
        $news['tmpl_news'] = replace_cnt_template($news['tmpl_news'], 'PAGINATE_ELSE', '');
    }
    $CNT_TMP .= $news['tmpl_news'];
}
 $img_a = render_cnt_template($img_a, 'ROW', $x + 1);
 if ($image['nocaption']) {
     $img_a = render_cnt_template($img_a, 'CAPTION_ELSE', '');
     $img_a = render_cnt_template($img_a, 'CAPTION', '');
 } else {
     $img_a = render_cnt_template($img_a, 'CAPTION', $caption[0]);
 }
 $img_a = render_cnt_template($img_a, 'TITLE', $caption[3]);
 $img_a = render_cnt_template($img_a, 'ALT', $caption[1]);
 $img_a = render_cnt_template($img_a, 'LINK', $img_thumb_link);
 $img_a = render_cnt_template($img_a, 'URL', $caption[2][0]);
 $img_a = render_cnt_template($img_a, 'URL_TARGET', $caption[2][1]);
 if ($img_landscape !== null) {
     if ($img_landscape === false) {
         $img_a = replace_cnt_template($img_a, 'LANDSCAPE', '');
         $img_a = replace_cnt_template($img_a, 'LANDSCAPE_ELSE', '');
     } else {
         $img_a = render_cnt_template($img_a, 'LANDSCAPE', $img_landscape);
     }
 }
 // check if this is the last image in row
 if ($image['col'] == $col || $image['count'] == $total) {
     $img_a = render_cnt_template($img_a, 'LAST', $col);
     $xx = $x;
     $x++;
     $col = 0;
 } else {
     $img_a = render_cnt_template($img_a, 'LAST', '');
     $xx = $x;
 }
 // Get the entry data
Esempio n. 3
0
function getImageCaption($caption = '', $array_index = 'NUM', $short = false)
{
    // splits given image caption and returns an array
    $caption = explode('|', $caption);
    // following is default for the exploded $caption
    // [0] caption text
    // [1] alt text for image
    // [2] link -> array(0 => link, 1 => target)
    // [3] title text -> if empty alt text will be used
    // [4] copyright information
    $caption[0] = trim($caption[0]);
    $caption[1] = isset($caption[1]) ? trim($caption[1]) : '';
    $caption[3] = isset($caption[3]) ? trim($caption[3]) : '';
    // cut here – just return caption and alt text
    if ($short) {
        return array('caption' => $caption[0], 'alt' => $caption[1], 'title' => $caption[3]);
    }
    $caption[2] = isset($caption[2]) ? explode(' ', trim($caption[2])) : array(0 => '', 1 => '');
    $caption[2][0] = trim($caption[2][0]);
    if (empty($caption[2][0]) || empty($caption[2][1])) {
        $caption[2][1] = '';
    } else {
        $caption[2][1] = trim($caption[2][1]);
        $caption[2][1] = empty($caption[2][1]) ? '' : ' target="' . $caption[2][1] . '"';
    }
    $caption[4] = isset($caption[4]) ? trim($caption[4]) : '';
    if ($caption[4] === '') {
        $copyright = returnTagContent($caption[3], 'copyright');
        $caption[3] = $copyright['new'];
        $caption[4] = $copyright['tag'];
    } else {
        $caption[3] = replace_cnt_template($caption[3], 'copyright', '');
    }
    if ($array_index == 'NUM') {
        return $caption;
    } else {
        return $caption + array('caption_text' => $caption[0], 'caption_alt' => $caption[1], 'caption_link' => $caption[2][0], 'caption_target' => $caption[2][1], 'caption_title' => $caption[3], 'caption_copyright' => $caption[4]);
    }
}
Esempio n. 4
0
                        $_files_entries[$fkey] = render_cnt_template($_files_entries[$fkey], 'FILE_IMAGE_CHANNEL', '');
                        $_files_entries[$fkey] = render_cnt_template($_files_entries[$fkey], 'FILE_IMAGE_LANDSCAPE', '');
                        $_files_entries[$fkey] = render_cnt_template($_files_entries[$fkey], 'FILE_IMAGE_PORTRAIT', '');
                    }
                    $_files_image = $_files_image != false ? PHPWCMS_IMAGES . $_files_image[0] : '';
                    $_files_entries[$fkey] = render_cnt_template($_files_entries[$fkey], 'FILE_IMAGE', $_files_image);
                    // now replace a possible icon image
                    $_files_entries[$fkey] = render_cnt_template($_files_entries[$fkey], 'FILE_ICON', str_replace('{FILE_EXT}', $content['files_result'][$_files_x]['f_ext'], $_files_settings['icon_path'] . $_files_settings['icon_name']));
                    break;
                }
            }
        }
        $crow["acontent_template"] = replace_tmpl_section('FILE_ENTRY', $crow["acontent_template"], implode(LF, $_files_entries));
        $crow["acontent_template"] = render_cnt_template($crow["acontent_template"], 'TITLE', html_specialchars($crow['file_cp_title']));
        $crow["acontent_template"] = render_cnt_template($crow["acontent_template"], 'SUBTITLE', html_specialchars($crow['file_cp_subtitle']));
        $crow["acontent_template"] = render_cnt_template($crow["acontent_template"], 'TEXT', $crow["acontent_html"]);
        // cleanup left over FILE_IMAGE sections
        $crow["acontent_template"] = replace_cnt_template($crow["acontent_template"], 'FILE_IMAGE', '');
        // return result
        if (empty($IS_NEWS_CP)) {
            $CNT_TMP .= LF . trim($crow["acontent_template"]) . LF;
        } else {
            $news['files_result'] = trim($crow["acontent_template"]);
        }
        // reset locale settings
        if (!empty($_files_old_locale)) {
            setlocale(LC_ALL, $_files_old_locale);
        }
        unset($_files_count, $_files_entries, $_files_old_locale);
    }
}