コード例 #1
0
function getXMLData($url)
{
    $content = getPageContent($url);
    if (!$content) {
        return null;
    }
    $content = '<?xml version="1.0" encoding="UTF-8"?>' . $content;
    return new Crawler($content);
}
コード例 #2
0
/**
 * Get Page Field
 *
 * Retrieve and display the requested field from the given page. 
 *
 * @since 3.1
 * @param $page - slug of the page to retrieve content
 * @param $field - the Field to display
 * 
 */
function getPageField($page, $field)
{
    global $pagesArray;
    if ($field == "content") {
        getPageContent($page);
    } else {
        if (array_key_exists($field, $pagesArray[(string) $page])) {
            echo strip_decode($pagesArray[(string) $page][(string) $field]);
        } else {
            getPageContent($page, $field);
        }
    }
}
コード例 #3
0
function parse($content, $url, $path, $filename, $parent)
{
    /* $CSV_PARENT - id родителя, куда заливать */
    $CSV_PARENT = $parent;
    /* $CSV_PRICE - цена */
    $start_str = '<span class="value">';
    $stop_str = '</span>';
    $rule = "!" . $start_str . "(.*?)" . $stop_str . "!si";
    preg_match($rule, $content, $price);
    $price[1] = str_replace(" руб.", "", $price[1]);
    $price[1] = str_replace("`", "", $price[1]);
    $CSV_PRICE = $price[1];
    /* $CSV_CONTENT1 - краткое описание */
    $start_str = '<ul class="tec-char">';
    $stop_str = '</ul>';
    $rule = "!" . $start_str . "(.*?)" . $stop_str . "!si";
    preg_match($rule, $content, $content1);
    $CSV_CONTENT1 = $content1[0];
    // save to csv
    /* $CSV_BRAND - brand */
    $start_str = 'href="http://www.electrovenik.ru/catalog/small/';
    $stop_str = '/a>';
    $rule = "!" . $start_str . "(.*?)" . $stop_str . "!si";
    preg_match($rule, $content1[1], $brand);
    $start_str = '">';
    $stop_str = '<';
    $rule = "!" . $start_str . "(.*?)" . $stop_str . "!si";
    preg_match($rule, $brand[1], $brand);
    $CSV_BRAND = $brand[1];
    /* $CSV_IMAGE_SMALL - малое изображение */
    $start_str_image = '<img src="/gallery/';
    $stop_str_image = '"';
    $rule_image = "!" . $start_str_image . "(.*?)" . $stop_str_image . "!si";
    preg_match($rule_image, $content, $image_small);
    $image_small_name = $image_small[1];
    $CSV_IMAGE_SMALL = $path . $image_small_name;
    // save to csv + path
    /* small_image_save_to_folder - сохранить изображение позиции на сервер */
    $path_to_image_small = "http://www.electrovenik.ru/gallery/" . $image_small_name;
    $image = file_get_contents($path_to_image_small);
    file_put_contents("/var/www/serg-smirnoff/data/www/chicgirls.ru/parser/" . $path . $image_small_name, $image);
    /* $CSV_PAGETITLE - заголовок позиции */
    $start_str = '<p class="cat-header">';
    $stop_str = '</p>';
    $rule = "!" . $start_str . "(.*?)" . $stop_str . "!si";
    preg_match($rule, $content, $pagetitle);
    $start_str = '>';
    $stop_str = '<';
    $rule = "!" . $start_str . "(.*?)" . $stop_str . "!si";
    preg_match($rule, $pagetitle[1], $title);
    $CSV_PAGETITLE = $title[1];
    /* sub_url - ссылка на страницу подробнее */
    $start_str2 = '<a href="';
    $stop_str2 = '">';
    $rule2 = "!" . $start_str2 . "(.*?)" . $stop_str2 . "!si";
    preg_match($rule2, $pagetitle[1], $sub_url);
    $content_sub = getPageContent($sub_url[1]);
    $start_str = '<img src="/gallery/';
    $stop_str = '"';
    $rule = "!" . $start_str . "(.*?)" . $stop_str . "!si";
    preg_match($rule, $content_sub, $image_big);
    $image_big_name = $image_big[1];
    $CSV_IMAGE_BIG = $path . $image_big_name;
    /* small_image_save_to_folder - сохранить изображение позиции на сервер */
    $path_to_image_big = "http://www.electrovenik.ru/gallery/" . $image_big_name;
    $image2 = file_get_contents($path_to_image_big);
    file_put_contents("/var/www/serg-smirnoff/data/www/chicgirls.ru/parser/" . $path . $image_big_name, $image2);
    /* content2 - технические характеристики позиции */
    $start_str = '<table class="item-tec-char" id="tthtable">';
    $stop_str = '</table>';
    $rule = "!" . $start_str . "(.*?)" . $stop_str . "!si";
    preg_match($rule, $content_sub, $content2);
    $CSV_CONTENT2 = $content2[0];
    /*				
    		echo "pagetitle= ".$CSV_PAGETITLE."<br />";
    		echo "price= ".$CSV_PRICE."<br />";
    		echo "content1= ".$CSV_CONTENT1."<br />";
    		echo "content2= ".$CSV_CONTENT2."<br />";
    		echo "image_small= ".$CSV_IMAGE_SMALL."<br />";
    		echo "image_big= ".$CSV_IMAGE_BIG."<br />";
    		echo "brand= ".$CSV_BRAND."<br />";
    */
    /* сохраняем в csv */
    $fp = fopen("/var/www/serg-smirnoff/data/www/chicgirls.ru/parser/export/" . $filename, "a+");
    fwrite($fp, $CSV_PARENT);
    fwrite($fp, ";");
    fwrite($fp, $CSV_PAGETITLE);
    fwrite($fp, ";");
    fwrite($fp, trim(str_replace("\n", "", str_replace("\r", "", $CSV_CONTENT1))));
    fwrite($fp, ";");
    fwrite($fp, trim(str_replace(array("\n", "\r", "&nbsp;", ";"), array("", "", "", ""), $CSV_CONTENT2)));
    fwrite($fp, ";");
    fwrite($fp, $CSV_PRICE);
    fwrite($fp, ";");
    fwrite($fp, $CSV_IMAGE_SMALL);
    fwrite($fp, ";");
    fwrite($fp, $CSV_IMAGE_BIG);
    fwrite($fp, ";");
    fwrite($fp, $CSV_BRAND);
    fwrite($fp, ";");
    fwrite($fp, "\n");
    fclose($fp);
}
コード例 #4
0
ファイル: search.php プロジェクト: ariep/ZenPhoto20-DEV
</small></h5>
					<ul class="searchresults">
						<?php 
        while (next_page()) {
            $c++;
            ?>
							<li<?php 
            printZDToggleClass('pages', $c, $number_to_show);
            ?>
>
								<h6><?php 
            printPageTitlelink();
            ?>
</h6>
								<p class="zenpageexcerpt"><?php 
            echo html_encodeTagged(shortenContent(strip_tags(getPageContent()), 80, getOption("zenpage_textshorten_indicator")));
            ?>
</p>
							</li>
		<?php 
        }
        ?>
					</ul>
					<hr />
	<?php 
    }
    ?>
			</div>
			<div class="eight columns">
				<?php 
    if ($numnews > 0 && $zpskel_usenews) {
コード例 #5
0
ファイル: search.php プロジェクト: Imagenomad/Unsupported
</small></h3>
					<ul class="searchresults">
					<?php 
        while (next_page()) {
            $c++;
            ?>
						<li<?php 
            printZDToggleClass('pages', $c, $number_to_show);
            ?>
>
						<h4><?php 
            printPageTitlelink();
            ?>
</h4>
							<p class="zenpageexcerpt"><?php 
            echo shortenContent(strip_tags(getPageContent()), 80, getOption("zenpage_textshorten_indicator"));
            ?>
</p>
						</li>
						<?php 
        }
        ?>
					</ul>
				<?php 
    }
    if ($numnews > 0) {
        $number_to_show = 3;
        $c = 0;
        $art = 'article';
        if ($numnews > 1) {
            $art .= 's';
コード例 #6
0
ファイル: githubsync_show.php プロジェクト: MikeCoder/mblog
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
    $data = curl_exec($ch);
    @curl_close($ch);
    return $data;
}
$URL = base64_decode($_GET['github-url']);
if (!strstr($URL, 'github')) {
    echo 'NOT GITHUB URL';
    die;
}
preg_match('/github.com\\/(.*?)\\/(.*?)\\//', $URL, $DOC_INFO);
// URL_IMAGE : img src="/MikeCoder/MyStudy/raw/master/MyBlogs/images/2014-04-14-1.png" alt
// URL_REAL : raw.githububusercontent.com/MikeCoder/MyStudy$url = "http://www.php100.com/logo.gif";
$CONTENT = getPageContent($URL);
preg_match('/<article[\\s|\\S]+?>([\\s|\\S]+)<\\/article>/', $CONTENT, $RES);
if ($RES) {
    $CONTENT = $RES[1];
}
$CONTENT = str_replace('\\n', '', $CONTENT);
$CONTENT = str_replace('\\r\\n', '', $CONTENT);
$ANCHOR_OLD = '/<a id="user-content-.*?"[\\s|\\S]+?class="anchor" href="[\\s|\\S]+?<\\/a>/';
$ANCHOR_NEW = '';
$CONTENT = preg_replace($ANCHOR_OLD, $ANCHOR_NEW, $CONTENT);
$IMAGE_URL_OLD = '/img src=(.*?raw)\\//';
$IMAGE_URL_NEW = 'img src="https://raw.githubusercontent.com/' . $DOC_INFO[1] . '/' . $DOC_INFO[2] . '/';
$CONTENT = preg_replace($IMAGE_URL_OLD, $IMAGE_URL_NEW, $CONTENT);
$LINK_URL_OLD = '/a href=(.*?blob)\\//';
$LINK_URL_NEW = 'a href="https://raw.githubusercontent.com/' . $DOC_INFO[1] . '/' . $DOC_INFO[2] . '/';
$CONTENT = preg_replace($LINK_URL_OLD, $LINK_URL_NEW, $CONTENT);
コード例 #7
0
ファイル: inc-header.php プロジェクト: kokyandrei/Unsupported
     if (function_exists('printCommentForm') && getOption('RSS_comments')) {
         printRSSHeaderLink('Comments-image', getBareImageTitle() . ' - ' . gettext('Latest Comments'), $lang = '') . "\n";
     }
     break;
 case 'archive.php':
     $zpfocus_metatitle = gettext("Archive View") . ' | ' . getBareGalleryTitle();
     $zpfocus_metadesc = shortenContent(getBareGalleryDesc(), 150, '...');
     break;
 case 'search.php':
     $zpfocus_metatitle = gettext('Search') . ' | ' . html_encode(getSearchWords()) . ' | ' . getBareGalleryTitle();
     $zpfocus_metadesc = shortenContent(getBareGalleryDesc(), 150, '...');
     $galleryactive = true;
     break;
 case 'pages.php':
     $zpfocus_metatitle = getBarePageTitle() . ' | ' . getBareGalleryTitle();
     $zpfocus_metadesc = strip_tags(shortenContent(getPageContent(), 150, '...'));
     break;
 case 'news.php':
     if (is_NewsArticle()) {
         $zpfocus_metatitle = gettext('News') . ' | ' . getBareNewsTitle() . ' | ' . getBareGalleryTitle();
         $zpfocus_metadesc = strip_tags(shortenContent(getNewsContent(), 150, '...'));
     } else {
         if ($_zp_current_category) {
             $zpfocus_metatitle = gettext('News') . ' | ' . $_zp_current_category->getTitle() . ' | ' . getBareGalleryTitle();
             $zpfocus_metadesc = strip_tags(shortenContent(getNewsCategoryDesc(), 150, '...'));
         } else {
             if (getCurrentNewsArchive()) {
                 $zpfocus_metatitle = gettext('News') . ' | ' . getCurrentNewsArchive() . ' | ' . getBareGalleryTitle();
                 $zpfocus_metadesc = shortenContent(getBareGalleryDesc(), 150, '...');
             } else {
                 $zpfocus_metatitle = gettext('News') . ' | ' . getBareGalleryTitle();
コード例 #8
0
ファイル: rebuild.php プロジェクト: GitHubTianPeng/101worker
define('BASE_PATH', str_replace('jsongenerator', '', dirname(__FILE__)));
require_once BASE_PATH . '/../../libraries/MediaWikiAPI/ApiWrapper.php';
require_once BASE_PATH . '/../../libraries/MediaWikiAPI/Pages.php';
// check for path information
if (count($argv) <= 1) {
    exit("Need output path for XML result\n");
}
$pages = getAllPages();
$pagetitles = array();
$map = array();
echo "Scanning pages...\n";
foreach ($pages as $page) {
    $title = $page['title'];
    array_push($pagetitles, $title);
    if (strstr(getPageContent($title), "<classify/>") !== FALSE) {
        $map[str_replace(" ", "_", $title)] = array("classify" => TRUE);
    }
}
echo "Requesting categories...\n";
$categories = getCategories();
$classifycats = array();
foreach ($categories as $category) {
    if (strstr($category, "<pageheadline/>") !== FALSE) {
        if (!array_key_exists($category, $map)) {
            $map[str_replace(" ", "_", $category)] = array("pageheadline" => TRUE);
        } else {
            $map[str_replace(" ", "_", $category)]["pageheadline"] = TRUE;
        }
    }
}
コード例 #9
0
ファイル: search.php プロジェクト: ckfreeman/libratus
        while (next_page()) {
            ?>
						<div class="one-half column">
							<div class="news-clip">
								<div class="bold-header"><a href="<?php 
            echo html_encode($_zp_current_zenpage_page->getLink());
            ?>
"><?php 
            printPageTitle();
            ?>
</a> <small><em><i title="<?php 
            echo gettext('Page Result');
            ?>
" class="fa fa-copy fa-fw"></i></em></small></div>
								<div class="search-excerpt"><?php 
            echo shortenContent(strip_tags(getPageContent()), 200, getOption('zenpage_textshorten_indicator'));
            ?>
</div>
							</div>
						</div>
					<?php 
            $c++;
            if ($c == 2) {
                echo '</div><div class="row">';
                $c = 0;
            }
        }
    }
    if ($numnews > 0) {
        while (next_news()) {
            ?>
コード例 #10
0
ファイル: index.php プロジェクト: amdad/FisherEvans.com
}
switch ($baseResource) {
    case "admin":
        include "admin.php";
        exit;
        break;
    case "blog":
        include 'blog.php';
        $pageContent = getBlogContent($URI);
        break;
    case "projects":
        include 'projects.php';
        $pageContent = getProjectsContent($URI);
        break;
    default:
        $pageContent = getPageContent($baseResource);
        if ($pageContent == null) {
            $pageContent = get404();
        } else {
            $title = getPageTitle($baseResource) . $title;
        }
        break;
}
?>
<!DOCTYPE html>
<html>
    <head>
        <title><?php 
echo $title;
?>
</title>
コード例 #11
0
?>
</h3>
                    <p><?php 
getPageContent('presentation-legende-personnelle');
?>
</p>
                </article>
                <article>
                <h3><?php 
getPageField('presentation-coaching-relationnel', 'title');
?>
</h3>
                    <p><?php 
getPageContent('presentation-coaching-relationnel');
?>
</p>
                </article>
                <article>
                <h3><?php 
getPageField('presentation-bilan-competence', 'title');
?>
</h3>
                    <p><?php 
getPageContent('presentation-bilan-competence');
?>
</p>
                </article> 
                </div>
        <!--</section>-->
        </div><!-- .content -->
    </div><!--.main -->
コード例 #12
0
function alc_list_posts($atts)
{
    extract(shortcode_atts(array('category' => '', 'type' => '', 'limit' => '5', 'order' => 'DESC', 'orderby' => 'date', 'post_type' => 'post'), $atts));
    $return = '';
    $query = array();
    if ($category != '') {
        $query[] = 'category=' . $category;
    }
    if ($limit) {
        $query[] = 'numberposts=' . $limit;
    }
    if ($order) {
        $query[] = 'order=' . $order;
    }
    if ($orderby) {
        $query[] = 'orderby=' . $orderby;
    }
    if ($post_type) {
        $query[] = 'post_type=' . $post_type;
    }
    $posts_to_show = get_posts(implode('&', $query));
    if ($type == 1) {
        $counter = 1;
        $return .= '
		<h3>' . $title . '</h3>
		<div class="work_slide2">
			<ul id="work_slide2">';
        foreach ($posts_to_show as $ps) {
            $day = get_the_time('d', $ps->ID);
            $month = get_the_time('M', $ps->ID);
            if ($counter == 1) {
                $return .= '<li>';
            }
            $return .= '
						<article class="row collapse"><div class="small-5 columns"><div class="mod_con_img">';
            $thumbnail = get_the_post_thumbnail($ps->ID, 'blog-thumb3');
            $postmeta = get_post_custom($ps->ID);
            if (!empty($thumbnail) && !isset($postmeta['_post_video'])) {
                $return .= '<a href="' . get_permalink($ps->ID) . '" class="post-image">' . $thumbnail . '</a>';
            } elseif (isset($postmeta['_post_video'])) {
                $return .= '<iframe src="http://player.vimeo.com/video/' . $postmeta['_post_video'][0] . '" width="146" height="96" class="post-image"></iframe>';
            } else {
                $return .= '
							<a href="' . get_permalink($ps->ID) . '" class="post-image">
								<img src = "http://placehold.it/155x112" alt="' . __('No image', 'Alcatron') . '" />
							</a>';
            }
            $return .= '<ul class="meta">
								<li>
									<span class="icon-time"></span>
									<time datetime="' . get_the_time('Y-m-d') . '">' . get_the_time('M d, Y') . '</time>
								</li>
							  </ul>
							</div>
						 </div>';
            $return .= '<div class="small-7 columns">
								<div class="mod_con_text">
									<h5>' . $ps->post_title . '</h5>
								<p>' . limit_words(getPageContent($ps->ID), 15) . '</p>
								<a href="' . get_permalink($ps->ID) . '">' . __('Read More', 'Alcatron') . '</a>
							  </div>
						 </div>
					</article>';
        }
        $return .= '</li> </ul>
                        <div class="clearfix"></div>
                        <a class="prev2" id="slide_prev2" href="#"><img src="' . get_template_directory_uri() . '/images/arrow_left.png" alt="' . __('Prev', 'Alcatron') . '"></a>
                        <a class="next2" id="slide_next2" href="#"><img src="' . get_template_directory_uri() . '/images/arrow_right.png" alt="' . __('Next', 'Alcatron') . '"></a>                            
                       </div></div></div>';
        $return .= "<script type=\"text/javascript\">\n\t\t\tjQuery(window).load(function(){\n\t\t\t\tjQuery('#work_slide2').carouFredSel({\n\t\t\t\t\tresponsive: true,\n\t\t\t\t\twidth: '100%',\n\t\t\t\t\tauto: false,\n\t\t\t\t\tcircular\t: true,\n\t\t\t\t\tinfinite\t: true,\n                                        scroll: {items:1, pauseOnHover: true},\n\t\t\t\t\tprev : {button: \"#slide_prev2\", key\t: \"left\"},\n\t\t\t\t\tnext : {button\t: \"#slide_next2\", key : \"right\"},\n\t\t\t\t\tswipe: {onMouse: true, onTouch: true},\n\t\t\t\t\titems: {visible: {min: 1,max: 6}\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\t\t</script>";
    } elseif ($type == "100") {
        $return = '<ul class="large-block-grid-2">';
        foreach ($posts_to_show as $ps) {
            $thumbnail = get_the_post_thumbnail($ps->ID, 'blog-thumb3');
            $return .= '<li class="abs">			
			<a href="' . get_permalink($ps->ID) . '">' . $thumbnail . '<p class="info-clus-p" ><b>' . $ps->post_title . '</b><p></a>
			</li>';
        }
        $return .= '</ul>';
        $link2 = get_post_type_archive_link('tender');
        $return .= '<a href="' . $link2 . '" target="_blank" class="button small normal" style="float:right;margin-top:9px;"><span class="icon-book"></span>More Tender</a>';
    } else {
        $return = '<ul class="no-bullet recent-posts m0 p0">';
        foreach ($posts_to_show as $ps) {
            $day = get_the_time('d', $ps->ID);
            $month = get_the_time('M', $ps->ID);
            $return .= '
			<li>
				<article class="row collapse">
					<div class="small-5 columns">
						<div class="mod_con_img">';
            $thumbnail = get_the_post_thumbnail($ps->ID, 'blog-thumb3');
            $postmeta = get_post_custom($ps->ID);
            if (!empty($thumbnail) && !isset($postmeta['_post_video'])) {
                $return .= '<a href="' . get_permalink($ps->ID) . '" class="post-image">' . $thumbnail . '</a>';
            } elseif (isset($postmeta['_post_video'])) {
                $return .= '<iframe src="http://player.vimeo.com/video/' . $postmeta['_post_video'][0] . '" width="146" height="96" class="post-image"></iframe>';
            } else {
                $return .= '<a href="' . get_permalink($ps->ID) . '" class="post-image">
									<img src = "http://placehold.it/155x112" alt="' . __('No image', 'Alcatron') . '" />
								</a>';
            }
            $return .= '
							<ul class="meta">
								<li>
									<span class="icon-time"></span>
									<time datetime="' . get_the_time('Y-m-d', $ps->ID) . '">' . get_the_time('M d, Y', $ps->ID) . '</time>
								</li>
							</ul>
						</div>
					</div>';
            $return .= '
					<div class="small-7 columns">
						<div class="mod_con_text">
							<h5>' . $ps->post_title . '</h5>
							<p>' . limit_words(getPageContent($ps->ID), 15) . '</p>
							<a href="' . get_permalink($ps->ID) . '">' . __('Read More', 'Alcatron') . '</a>
						</div>
					</div>
				</article>
			</li>';
        }
        $return .= '</ul>';
        $link3 = get_post_type_archive_link('news-item');
        $return .= '<a href="' . $link3 . '" target="_blank" class="button small normal" style="float: right;margin-top: 8px;"><span class="icon-book"></span>More News</a>';
    }
    return $return;
}
$cats = get_post_meta($post->ID, "_page_portfolio_cat", $single = true);
$MyWalker = new PortfolioWalker2();
$args = array('taxonomy' => 'portfolio_category', 'hide_empty' => '0', 'include' => $cats, 'title_li' => '', 'walker' => $MyWalker, 'show_count' => '1');
$categories = wp_list_categories($args);
?>
				<!-- End Portfolio Navigation -->
			</ul>
		</div>
		
		<div class="large-12 columns">
                    <ul class="portfolio-content <?php 
echo $itemsize;
?>
">
			<?php 
echo getPageContent($pageId);
$counter = 1;
if ($wp_query->have_posts()) {
    while ($wp_query->have_posts()) {
        $wp_query->the_post();
        $custom = get_post_custom($post->ID);
        // Get the portfolio item categories
        $cats = wp_get_object_terms($post->ID, 'portfolio_category');
        if ($cats) {
            $cat_slugs = '';
            foreach ($cats as $cat) {
                $cat_slugs .= $cat->slug . " ";
            }
        }
        $link = '';
        $thumbnail = get_the_post_thumbnail($post->ID, $thumbsize);
コード例 #14
0
ファイル: Pages.php プロジェクト: GitHubTianPeng/101worker
 function __construct($title)
 {
     $this->title = $title;
     $this->namespace = "";
     $this->sections = array();
     $this->rawDump = array();
     $this->content = getPageContent($title);
     if ($this->content == NULL) {
         return false;
     }
     $this->lastrev = getRivison($title, 'older');
     $this->creation = getRivison($title, 'newer');
     $this->getSections();
     $this->bibs = extractBibs($this->content);
     $this->intent = extractIntent($this->content);
     $this->discussion = extractContent($this->content, "==Discussion==");
     $this->description = extractContent($this->content, "==Description==");
     $this->technologies = extractContent($this->content, "==Technologies==");
     $this->objective = extractContent($this->objective, "==Objective==");
 }
コード例 #15
0
/**
 * Print page content either of the current page or if requested by titlelink directly. If not both return false
 * Set the titlelink of a page to call a specific even un-published page ($published = false) as a gallery description or on another custom page for example
 *
 * @param string $titlelink the titlelink of the page to print the content from
 * @param bool $published If titlelink is set, set this to false if you want to call an un-published page's content. True is default
 * @return mixed
 */
function printPageContent($titlelink = NULL, $published = true)
{
    echo getPageContent($titlelink, $published);
}
コード例 #16
0
ファイル: build.php プロジェクト: Seb-C/seb-c.github.io
    // Getting date (first <time> datetime attribute)
    preg_match('/<time datetime="([^"]*)">(.*)<\\/time>/', $articleContent, $matches);
    $datetime = isset($matches[1]) ? $matches[1] : '';
    $datetimeFormatted = isset($matches[2]) ? $matches[2] : '';
    $timestamp = empty($datetime) ? 0 : strtotime($datetime);
    $articlesData[] = $articleData = array('datetime' => $datetime, 'datetimeFormatted' => $datetimeFormatted, 'timestamp' => $timestamp, 'title' => $title, 'filename' => $filename, 'content' => $articleContent);
    // Setting article page itself
    $pageContent = getPageContent(array($articleData), 'model.html');
    file_put_contents('../' . $filename, $pageContent);
}
// Sorting articles (last one at first)
usort($articlesData, function ($a, $b) {
    return $b['timestamp'] - $a['timestamp'];
});
// Creating RSS file
$rssContent = getPageContent($articlesData, 'feedModel.xml');
file_put_contents('../feed.xml', $rssContent);
// Creating homepage file
$articlesDataHome = array();
foreach ($articlesData as $i => $articleData) {
    if ($i >= 2) {
        $articleData['content'] = '
			<time datetime="' . $articleData['datetime'] . '">' . $articleData['datetimeFormatted'] . '</time>
			<a href="' . $articleData['filename'] . '"><h1>' . $articleData['title'] . '</h1></a>
		';
    }
    $articlesDataHome[] = $articleData;
}
$homeContent = getPageContent($articlesDataHome, 'model.html');
file_put_contents('../index.html', $homeContent);
echo "DONE\n";
コード例 #17
0
ファイル: template.php プロジェクト: oliver-eifler/olli.php
function PageContent()
{
    $page = Page::getInstance();
    $html = "";
    $html .= "<div class='pageWrapper-content'>";
    $html .= "<div id='pageContent' class='pageContent'>";
    $html .= getPageContent();
    $html .= "</div>";
    $html .= "</div>";
    return $html;
}
コード例 #18
0
ファイル: controller.php プロジェクト: MasterRO94/vizitki
     if (!$page) {
         $page = '';
     }
     $view = 'textPage';
     break;
     //registration
 //registration
 case 'register':
     if (isset($_POST[''])) {
     }
     break;
     //editor
 //editor
 case 'editor':
     $editor = true;
     $page = getPageContent($view);
     if (!$page) {
         $page = '';
     }
     break;
     // uploadImage
 // uploadImage
 case 'uploadImageToEditor':
     if (isset($_POST['uploadImage'])) {
         echo uploadImage();
     } else {
         redirect();
     }
     break;
     //basket
 //basket
コード例 #19
0
 /**
  * Prints html meta data to be used in the <head> section of a page
  *
  */
 static function getHTMLMetaData()
 {
     global $_zp_gallery, $_zp_page, $_zp_current_album, $_zp_current_image, $_zp_current_search, $_zp_current_article, $_zp_current_page, $_zp_gallery_page, $_zp_current_category, $_zp_authority, $_zp_conf_vars, $_myFavorites;
     $host = sanitize("http://" . $_SERVER['HTTP_HOST']);
     $url = $host . getRequestURI();
     // Convert locale shorttag to allowed html meta format
     $locale_ = getUserLocale();
     $locale = zpFunctions::getLanguageText($locale_, '-');
     $canonicalurl = '';
     // generate page title, get date
     $pagetitle = "";
     // for gallery index setup below switch
     $date = strftime(DATE_FORMAT);
     // if we don't have a item date use current date
     $desc = getBareGalleryDesc();
     $thumb = '';
     if (getOption('htmlmeta_sitelogo')) {
         $thumb = getOption('htmlmeta_sitelogo');
     }
     if (getOption('htmlmeta_og-image') || getOption('htmlmeta_twittercard')) {
         $ogimage_width = getOption('htmlmeta_ogimage_width');
         $ogimage_height = getOption('htmlmeta_ogimage_height');
         if (empty($ogimage_width)) {
             $ogimage_width = 1280;
         }
         if (empty($ogimage_height)) {
             $ogimage_height = 900;
         }
         $twittercard_type = 'summary';
     }
     $type = 'article';
     switch ($_zp_gallery_page) {
         case 'index.php':
             $desc = getBareGalleryDesc();
             $canonicalurl = $host . $_zp_gallery->getLink($_zp_page);
             $type = 'website';
             break;
         case 'album.php':
         case 'favorites.php':
             $pagetitle = getBareAlbumTitle() . " - ";
             $date = getAlbumDate();
             $desc = getBareAlbumDesc();
             $canonicalurl = $host . $_zp_current_album->getLink($_zp_page);
             if (getOption('htmlmeta_og-image') || getOption('htmlmeta_twittercard')) {
                 $thumbimg = $_zp_current_album->getAlbumThumbImage();
                 getMaxSpaceContainer($ogimage_width, $ogimage_height, $thumbimg, false);
                 $thumb = $host . html_encode(pathurlencode($thumbimg->getCustomImage(NULL, $ogimage_width, $ogimage_height, NULL, NULL, NULL, NULL, false, NULL)));
                 $twittercard_type = 'summary_large_image';
             }
             break;
         case 'image.php':
             $pagetitle = getBareImageTitle() . " (" . getBareAlbumTitle() . ") - ";
             $date = getImageDate();
             $desc = getBareImageDesc();
             $canonicalurl = $host . $_zp_current_image->getLink();
             if (getOption('htmlmeta_og-image') || getOption('htmlmeta_twittercard')) {
                 $thumb = $host . html_encode(pathurlencode(getCustomSizedImageMaxSpace($ogimage_width, $ogimage_height)));
                 $twittercard_type = 'summary_large_image';
             }
             break;
         case 'news.php':
             if (function_exists("is_NewsArticle")) {
                 if (is_NewsArticle()) {
                     $pagetitle = getBareNewsTitle() . " - ";
                     $date = getNewsDate();
                     $desc = trim(getBare(getNewsContent()));
                     $canonicalurl = $host . $_zp_current_article->getLink();
                 } else {
                     if (is_NewsCategory()) {
                         $pagetitle = $_zp_current_category->getTitlelink() . " - ";
                         $date = strftime(DATE_FORMAT);
                         $desc = trim(getBare($_zp_current_category->getDesc()));
                         $canonicalurl = $host . $_zp_current_category->getLink($_zp_page);
                         $type = 'category';
                     } else {
                         $pagetitle = gettext('News') . " - ";
                         $desc = '';
                         $canonicalurl = $host . getNewsPathNav($_zp_page);
                         $type = 'website';
                     }
                 }
             }
             break;
         case 'pages.php':
             $pagetitle = getBarePageTitle() . " - ";
             $date = getPageDate();
             $desc = trim(getBare(getPageContent()));
             $canonicalurl = $host . $_zp_current_page->getLink();
             break;
         default:
             // for all other possible static custom pages
             $custompage = stripSuffix($_zp_gallery_page);
             $standard = array('contact' => gettext('Contact'), 'register' => gettext('Register'), 'search' => gettext('Search'), 'archive' => gettext('Archive view'), 'password' => gettext('Password required'));
             if (is_object($_myFavorites)) {
                 $standard['favorites'] = gettext('My favorites');
             }
             if (array_key_exists($custompage, $standard)) {
                 $pagetitle = $standard[$custompage] . " - ";
             } else {
                 $pagetitle = $custompage . " - ";
             }
             $desc = '';
             $canonicalurl = $host . getCustomPageURL($custompage);
             break;
     }
     // shorten desc to the allowed 200 characters if necesssary.
     $desc = html_encode(trim(substr(getBare($desc), 0, 160)));
     $pagetitle = $pagetitle . getBareGalleryTitle();
     // get master admin
     $admin = $_zp_authority->getMasterUser();
     $author = $admin->getName();
     $meta = '';
     if (getOption('htmlmeta_http-equiv-cache-control')) {
         $meta .= '<meta http-equiv="Cache-control" content="' . getOption("htmlmeta_cache_control") . '">' . "\n";
     }
     if (getOption('htmlmeta_http-equiv-pragma')) {
         $meta .= '<meta http-equiv="pragma" content="' . getOption("htmlmeta_pragma") . '">' . "\n";
     }
     if (getOption('htmlmeta_name-keywords')) {
         $meta .= '<meta name="keywords" content="' . htmlmetatags::getMetaKeywords() . '">' . "\n";
     }
     if (getOption('htmlmeta_name-description')) {
         $meta .= '<meta name="description" content="' . $desc . '">' . "\n";
     }
     if (getOption('htmlmeta_name-page-topic')) {
         $meta .= '<meta name="page-topic" content="' . $desc . '">' . "\n";
     }
     if (getOption('htmlmeta_name-robots')) {
         $meta .= '<meta name="robots" content="' . getOption("htmlmeta_robots") . '">' . "\n";
     }
     if (getOption('htmlmeta_name-publisher')) {
         $meta .= '<meta name="publisher" content="' . FULLWEBPATH . '">' . "\n";
     }
     if (getOption('htmlmeta_name-creator')) {
         $meta .= '<meta name="creator" content="' . FULLWEBPATH . '">' . "\n";
     }
     if (getOption('htmlmeta_name-author')) {
         $meta .= '<meta name="author" content="' . $author . '">' . "\n";
     }
     if (getOption('htmlmeta_name-copyright')) {
         $meta .= '<meta name="copyright" content=" (c) ' . FULLWEBPATH . ' - ' . $author . '">' . "\n";
     }
     if (getOption('htmlmeta_name-rights')) {
         $meta .= '<meta name="rights" content="' . $author . '">' . "\n";
     }
     if (getOption('htmlmeta_name-generator')) {
         $meta .= '<meta name="generator" content="ZenPhoto20 ' . ZENPHOTO_VERSION . '">' . "\n";
     }
     if (getOption('htmlmeta_name-revisit-after')) {
         $meta .= '<meta name="revisit-after" content="' . getOption("htmlmeta_revisit_after") . ' days">' . "\n";
     }
     if (getOption('htmlmeta_name-expires')) {
         $expires = getOption("htmlmeta_expires");
         if ($expires == (int) $expires) {
             $expires = preg_replace('|\\s\\-\\d+|', '', date('r', time() + $expires)) . ' GMT';
         }
         $meta .= '<meta name="expires" content="' . $expires . '">' . "\n";
     }
     // OpenGraph meta
     if (getOption('htmlmeta_opengraph')) {
         $meta .= '<meta property="og:title" content="' . $pagetitle . '">' . "\n";
         if (!empty($thumb)) {
             $meta .= '<meta property="og:image" content="' . $thumb . '">' . "\n";
         }
         $meta .= '<meta property="og:description" content="' . $desc . '">' . "\n";
         $meta .= '<meta property="og:url" content="' . html_encode($url) . '">' . "\n";
         $meta .= '<meta property="og:type" content="' . $type . '">' . "\n";
     }
     // Social network extras
     if (getOption('htmlmeta_name-pinterest')) {
         $meta .= '<meta name="pinterest" content="nopin">' . "\n";
     }
     // dissalow users to pin images on Pinterest
     // Twitter card
     $twittername = getOption('htmlmeta_twittername');
     if (getOption('htmlmeta_twittercard') || !empty($twittername)) {
         $meta .= '<meta name="twitter:creator" content="' . $twittername . '">' . "\n";
         $meta .= '<meta name="twitter:site" content="' . $twittername . '">' . "\n";
         $meta .= '<meta name="twitter:card" content="' . $twittercard_type . '">' . "\n";
         $meta .= '<meta name="twitter:title" content="' . $pagetitle . '">' . "\n";
         $meta .= '<meta name="twitter:description" content="' . $desc . '">' . "\n";
         if (!empty($thumb)) {
             $meta .= '<meta name="twitter:image" content="' . $thumb . '">' . "\n";
         }
     }
     // Canonical url
     if (getOption('htmlmeta_canonical-url')) {
         $meta .= '<link rel="canonical" href="' . $canonicalurl . '">' . "\n";
         if (METATAG_LOCALE_TYPE) {
             $langs = generateLanguageList();
             if (count($langs) != 1) {
                 if (METATAG_LOCALE_TYPE == 1) {
                     $locallink = seo_locale::localePath(false, $locale_);
                 } else {
                     $locallink = '';
                 }
                 foreach ($langs as $text => $lang) {
                     $langcheck = zpFunctions::getLanguageText($lang, '-');
                     //	for hreflang we need en-US
                     if ($langcheck != $locale) {
                         if (METATAG_LOCALE_TYPE == 1) {
                             $altlink = seo_locale::localePath(true, $lang);
                         } else {
                             $altlink = dynamic_locale::fullHostPath($lang);
                         }
                         switch ($_zp_gallery_page) {
                             case 'index.php':
                                 $altlink .= str_replace($locallink, '', $_zp_gallery->getLink($_zp_page));
                                 break;
                             case 'album.php':
                             case 'favorites.php':
                                 $altlink .= str_replace($locallink, '', $_zp_current_album->getLink($_zp_page));
                                 break;
                             case 'image.php':
                                 $altlink .= str_replace($locallink, '', $_zp_current_image->getLink());
                                 break;
                             case 'news.php':
                                 if (function_exists("is_NewsArticle")) {
                                     if (is_NewsArticle()) {
                                         $altlink .= str_replace($locallink, '', $_zp_current_article->getLink());
                                     } else {
                                         if (is_NewsCategory()) {
                                             $altlink .= str_replace($locallink, '', $_zp_current_category->getLink($_zp_page));
                                         } else {
                                             $altlink .= getNewsPathNav($_zp_page);
                                         }
                                     }
                                 }
                                 break;
                             case 'pages.php':
                                 $altlink .= str_replace($locallink, '', $_zp_current_page->getLink());
                                 break;
                             case 'archive.php':
                                 $altlink .= getCustomPageURL('archive');
                                 break;
                             case 'search.php':
                                 $searchwords = $_zp_current_search->codifySearchString();
                                 $searchdate = $_zp_current_search->getSearchDate();
                                 $searchfields = $_zp_current_search->getSearchFields(true);
                                 $searchpagepath = getSearchURL($searchwords, $searchdate, $searchfields, $_zp_page, array('albums' => $_zp_current_search->getAlbumList()));
                                 $altlink .= $searchpagepath;
                                 break;
                             case 'contact.php':
                                 $altlink .= getCustomPageURL('contact');
                                 break;
                             default:
                                 // for all other possible none standard custom pages
                                 $altlink .= getCustomPageURL($pagetitle);
                                 break;
                         }
                         // switch
                         $meta .= '<link rel="alternate" hreflang="' . $langcheck . '" href="' . html_encode($altlink) . '">' . "\n";
                     }
                     // if lang
                 }
                 // foreach
             }
             // if count
         }
         // if option
     }
     // if canonical
     echo $meta;
 }
コード例 #20
0
ファイル: template.php プロジェクト: Omletina/Red-bor
                <div class="title-main h1">Для детей и их родителей <br>мы предлагаем программыя</div>
                <div class="circles-list cl">
                	<?php 
getPageContent('children');
?>
                </div>
            </div><!-- // wrap-bl : end -->
        </div>
        <!-- children : end -->

        <!-- about-main : start -->
        <div id="reviews" class="about-main">
            <div class="title-main h1">О нас</div>
            <div class="wrap-bl cl">
            	<?php 
getPageContent('reviews');
?>
            </div>
            <a class="more-about btn-submit easing" href="javascript://">Ещё отзывы</a>
        </div>
        <!-- about-main : end -->

        <!-- contacts-main : start -->
        <div id="contacts" class="contacts-main">
            <div class="title-main h1">Контакты</div>
            <div class="map-bl">
                <div class="map-info box-sizing">
                	<?php 
get_custom_field('contact_adress');
?>
                    <a class="сall-back-link btn-submit easing" href="javascript://">Заказать тур</a>
コード例 #21
0
ファイル: inc-header.php プロジェクト: Imagenomad/Unsupported
     $zpmin_metadesc = truncate_string(getBareImageDesc(), 150, '...');
     $galleryactive = true;
     $cbscript = true;
     break;
 case 'archive.php':
     $zpmin_metatitle = gettext("Archive View") . ' | ';
     break;
 case 'search.php':
     $zpmin_metatitle = gettext('Search') . " | " . html_encode(getSearchWords()) . ' | ';
     $galleryactive = true;
     $cbscript = true;
     $zpmin_social = false;
     break;
 case 'pages.php':
     $zpmin_metatitle = getBarePageTitle() . ' | ';
     $zpmin_metadesc = strip_tags(truncate_string(getPageContent(), 150, '...'));
     $cbscript = true;
     break;
 case 'news.php':
     if (is_NewsArticle()) {
         $zpmin_metatitle = gettext('News') . ' | ' . getBareNewsTitle() . ' | ';
         $zpmin_metadesc = strip_tags(truncate_string(getNewsContent(), 150, '...'));
     } else {
         if ($_zp_current_category) {
             $zpmin_metatitle = gettext('News') . ' | ' . $_zp_current_category->getTitle() . ' | ';
             $zpmin_metadesc = strip_tags(truncate_string(getNewsCategoryDesc(), 150, '...'));
         } else {
             if (getCurrentNewsArchive()) {
                 $zpmin_metatitle = gettext('News') . ' | ' . getCurrentNewsArchive() . ' | ';
             } else {
                 $zpmin_metatitle = gettext('News') . ' | ';
コード例 #22
0
function sc_get_component($page)
{
    $content = returnPageContent(return_page_slug(), 'content', false, true);
    $content = strip_decode($content);
    if (!preg_match('#\\[sc_form(.*)\\]#', $content)) {
        getPageContent($page);
    }
}
コード例 #23
0
ファイル: index.php プロジェクト: prosenjit-itobuz/upages
// TODO: Check to see if file exists
$views = array('hit_counter', 'ip_address', 'page_views', 'query_strings', 'search_engine_stats', 'referrer', 'session', 'sessions', 'summary', 'user_agent', 'user_counter', 'options');
if (in_array($view, $views)) {
    require_once dirname(__FILE__) . "/reporter/{$view}.php";
} else {
    echo "You hacker you.";
    exit;
}
?>
<div style="clear:right;">
<?php 
require_once 'navigation.php';
?>
<div id="stcontent">
<?php 
getPageContent();
?>
</div>
<div id="stfooter">
Fresh as of: <?php 
echo date("Y-m-d H:i:s");
?>
<br />
Generated in: <?php 
timer_stop(1);
?>
 seconds
<br />
StatTraq <?php 
echo $stattraq_version;
?>
コード例 #24
0
/**
 * Prints html meta data to be used in the <head> section of a page
 *
 */
function getHTMLMetaData()
{
    global $_zp_gallery, $_zp_current_album, $_zp_current_image, $_zp_current_zenpage_news, $_zp_current_zenpage_page, $_zp_gallery_page, $_zp_current_category, $_zp_authority;
    $url = sanitize("http://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
    // Convert locale shorttag to allowed html meta format
    $locale = getOption("locale");
    $locale = strtr($locale, "_", "-");
    // generate page title, get date
    $pagetitle = "";
    $date = strftime(DATE_FORMAT);
    // if we don't have a item date use current date
    $desc = getBareGalleryDesc();
    if (is_object($_zp_current_image) and is_object($_zp_current_album)) {
        $pagetitle = getBareImageTitle() . " (" . getBareAlbumTitle() . ") - ";
        $date = getImageDate();
        $desc = getBareImageDesc();
    }
    if (is_object($_zp_current_album) and !is_object($_zp_current_image)) {
        $pagetitle = getBareAlbumTitle() . " - ";
        $date = getAlbumDate();
        $desc = getBareAlbumDesc();
    }
    if (function_exists("is_NewsArticle")) {
        if (is_NewsArticle()) {
            $pagetitle = getBareNewsTitle() . " - ";
            $date = getNewsDate();
            $desc = strip_tags(getNewsContent());
        } else {
            if (is_NewsCategory()) {
                $pagetitle = $_zp_current_category->getTitlelink() . " - ";
                $date = strftime(DATE_FORMAT);
                $desc = "";
            } else {
                if (is_Pages()) {
                    $pagetitle = getBarePageTitle() . " - ";
                    $date = getPageDate();
                    $desc = strip_tags(getPageContent());
                }
            }
        }
    }
    // shorten desc to the allowed 200 characters if necesssary.
    if (strlen($desc) > 200) {
        $desc = substr($desc, 0, 200);
    }
    $pagetitle = $pagetitle . getBareGalleryTitle();
    // get master admin
    $admin = $_zp_authority->getAnAdmin(array('`user`=' => $_zp_authority->master_user, '`valid`=' => 1));
    $author = $admin->getName();
    $meta = '';
    if (getOption('htmlmeta_http-equiv-language')) {
        $meta .= '<meta http-equiv="language" content="' . $locale . '" />' . "\n";
    }
    if (getOption('htmlmeta_name-language')) {
        $meta .= '<meta name="language" content="' . $locale . '" />' . "\n";
    }
    if (getOption('htmlmeta_name-content-language')) {
        $meta .= '<meta name="content-language" content="' . $locale . '" />' . "\n";
    }
    if (getOption('htmlmeta_http-equiv-imagetoolbar')) {
        $meta .= '<meta http-equiv="imagetoolbar" content="false" />' . "\n";
    }
    if (getOption('htmlmeta_http-equiv-cache-control')) {
        $meta .= '<meta http-equiv="cache-control" content="' . getOption("htmlmeta_cache_control") . '" />' . "\n";
    }
    if (getOption('htmlmeta_http-equiv-pragma')) {
        $meta .= '<meta http-equiv="pragma" content="' . getOption("htmlmeta_pragma") . '" />' . "\n";
    }
    if (getOption('htmlmeta_http-equiv-content-style-type')) {
        $meta .= '<meta http-equiv="Content-Style-Type" content="text/css" />' . "\n";
    }
    if (getOption('htmlmeta_name-title')) {
        $meta .= '<meta name="title" content="' . $pagetitle . '" />' . "\n";
    }
    if (getOption('htmlmeta_name-keywords')) {
        $meta .= '<meta name="keywords" content="' . getMetaKeywords() . '" />' . "\n";
    }
    if (getOption('htmlmeta_name-description')) {
        $meta .= '<meta name="description" content="' . $desc . '" />' . "\n";
    }
    if (getOption('htmlmeta_name-page-topic')) {
        $meta .= '<meta name="page-topic" content="' . $desc . '" />' . "\n";
    }
    if (getOption('htmlmeta_name-robots')) {
        $meta .= '<meta name="robots" content="' . getOption("htmlmeta_robots") . '" />' . "\n";
    }
    if (getOption('htmlmeta_name-publisher')) {
        $meta .= '<meta name="publisher" content="' . FULLWEBPATH . '" />' . "\n";
    }
    if (getOption('htmlmeta_name-creator')) {
        $meta .= '<meta name="creator" content="' . FULLWEBPATH . '" />' . "\n";
    }
    if (getOption('htmlmeta_name-author')) {
        $meta .= '<meta name="author" content="' . $author . '" />' . "\n";
    }
    if (getOption('htmlmeta_name-copyright')) {
        $meta .= '<meta name="copyright" content=" (c) ' . FULLWEBPATH . ' - ' . $author . '" />' . "\n";
    }
    if (getOption('htmlmeta_name-rights')) {
        $meta .= '<meta name="rights" content="' . $author . '" />' . "\n";
    }
    if (getOption('htmlmeta_name-rights')) {
        $meta .= '<meta name="generator" content="Zenphoto ' . ZENPHOTO_VERSION . ' [' . ZENPHOTO_RELEASE . ']" />' . "\n";
    }
    if (getOption('htmlmeta_name-revisit-after')) {
        $meta .= '<meta name="revisit-after" content="' . getOption("htmlmeta_revisit_after") . '" />' . "\n";
    }
    if (getOption('htmlmeta_name-expires')) {
        $meta .= '<meta name="expires" content="' . getOption("htmlmeta_expires") . '" />' . "\n";
    }
    if (getOption('htmlmeta_name-expires')) {
        $meta .= '<meta name="date" content="' . $date . '" />' . "\n";
    }
    if (getOption('htmlmeta_name-DC.titl')) {
        $meta .= '<meta name="DC.title" content="' . $pagetitle . '" />' . "\n";
    }
    if (getOption('htmlmeta_name-DC.keywords')) {
        $meta .= '<meta name="DC.keywords" content="' . gettMetaKeywords() . '" />' . "\n";
    }
    if (getOption('htmlmeta_name-DC.description')) {
        $meta .= '<meta name="DC.description" content="' . $desc . '" />' . "\n";
    }
    if (getOption('htmlmeta_name-DC.language')) {
        $meta .= '<meta name="DC.language" content="' . $locale . '" />' . "\n";
    }
    if (getOption('htmlmeta_name-DC.subject')) {
        $meta .= '<meta name="DC.subject" content="' . $desc . '" />' . "\n";
    }
    if (getOption('htmlmeta_name-DC.publisher')) {
        $meta .= '<meta name="DC.publisher" content="' . FULLWEBPATH . '" />' . "\n";
    }
    if (getOption('htmlmeta_name-DC.creator')) {
        $meta .= '<meta name="DC.creator" content="' . FULLWEBPATH . '" />' . "\n";
    }
    if (getOption('htmlmeta_name-DC.date')) {
        $meta .= '<meta name="DC.date" content="' . $date . '" />' . "\n";
    }
    if (getOption('htmlmeta_name-DC.type')) {
        $meta .= '<meta name="DC.type" content="Text" /> <!-- ? -->' . "\n";
    }
    if (getOption('htmlmeta_name-DC.format')) {
        $meta .= '<meta name="DC.format" content="text/html" /><!-- What else? -->' . "\n";
    }
    if (getOption('htmlmeta_name-DC.identifier')) {
        $meta .= '<meta name="DC.identifier" content="' . FULLWEBPATH . '" />' . "\n";
    }
    if (getOption('htmlmeta_name-DC.rights')) {
        $meta .= '<meta name="DC.rights" content="' . FULLWEBPATH . '" />' . "\n";
    }
    if (getOption('htmlmeta_name-DC.source')) {
        $meta .= '<meta name="DC.source" content="' . $url . '" />' . "\n";
    }
    if (getOption('htmlmeta_name-DC.relation')) {
        $meta .= '<meta name="DC.relation" content="' . FULLWEBPATH . '" />' . "\n";
    }
    if (getOption('htmlmeta_name-DC.Date.created')) {
        $meta .= '<meta name="DC.Date.created" content="' . $date . '" />' . "\n";
    }
    echo $meta;
}
コード例 #25
0
ファイル: html_meta_tags.php プロジェクト: rb26/zenphoto
    /**
     * Prints html meta data to be used in the <head> section of a page
     *
     */
    static function getHTMLMetaData()
    {
        global $_zp_gallery, $_zp_galley_page, $_zp_current_album, $_zp_current_image, $_zp_current_zenpage_news, $_zp_current_zenpage_page, $_zp_gallery_page, $_zp_current_category, $_zp_authority, $_zp_conf_vars, $_myFavorites, $htmlmetatags_need_cache, $_zp_page;
        zp_register_filter('image_processor_uri', 'htmlmetatags::ipURI');
        $host = sanitize("http://" . $_SERVER['HTTP_HOST']);
        $url = $host . getRequestURI();
        // Convert locale shorttag to allowed html meta format
        $locale = str_replace("_", "-", getUserLocale());
        $canonicalurl = '';
        // generate page title, get date
        $pagetitle = "";
        // for gallery index setup below switch
        $date = strftime(DATE_FORMAT);
        // if we don't have a item date use current date
        $desc = getBareGalleryDesc();
        $thumb = '';
        if (getOption('htmlmeta_sitelogo')) {
            $thumb = getOption('htmlmeta_sitelogo');
        }
        if (getOption('htmlmeta_og-image') || getOption('htmlmeta_twittercard')) {
            $ogimage_width = getOption('htmlmeta_ogimage_width');
            $ogimage_height = getOption('htmlmeta_ogimage_height');
            if (empty($ogimage_width)) {
                $ogimage_width = 1280;
            }
            if (empty($ogimage_height)) {
                $ogimage_height = 900;
            }
        }
        $type = 'article';
        switch ($_zp_gallery_page) {
            case 'index.php':
                $desc = getBareGalleryDesc();
                //$canonicalurl = $host . getGalleryIndexURL();
                $canonicalurl = $host . getPageNumURL($_zp_page);
                $type = 'website';
                break;
            case 'album.php':
                $pagetitle = getBareAlbumTitle() . " - ";
                $date = getAlbumDate();
                $desc = getBareAlbumDesc();
                $canonicalurl = $host . getPageNumURL($_zp_page);
                if (getOption('htmlmeta_og-image') || getOption('htmlmeta_twittercard')) {
                    $thumbimg = $_zp_current_album->getAlbumThumbImage();
                    getMaxSpaceContainer($ogimage_width, $ogimage_height, $thumbimg, false);
                    $thumb = $host . html_encode(pathurlencode($thumbimg->getCustomImage(NULL, $ogimage_width, $ogimage_height, NULL, NULL, NULL, NULL, false, NULL)));
                }
                break;
            case 'image.php':
                $pagetitle = getBareImageTitle() . " (" . getBareAlbumTitle() . ") - ";
                $date = getImageDate();
                $desc = getBareImageDesc();
                $canonicalurl = $host . getImageURL();
                if (getOption('htmlmeta_og-image') || getOption('htmlmeta_twittercard')) {
                    $thumb = $host . html_encode(pathurlencode(getCustomSizedImageMaxSpace($ogimage_width, $ogimage_height)));
                }
                break;
            case 'news.php':
                if (function_exists("is_NewsArticle")) {
                    if (is_NewsArticle()) {
                        $pagetitle = getBareNewsTitle() . " - ";
                        $date = getNewsDate();
                        $desc = trim(getBare(getNewsContent()));
                        $canonicalurl = $host . $_zp_current_zenpage_news->getLink();
                    } else {
                        if (is_NewsCategory()) {
                            $pagetitle = $_zp_current_category->getTitlelink() . " - ";
                            $date = strftime(DATE_FORMAT);
                            $desc = trim(getBare($_zp_current_category->getDesc()));
                            $canonicalurl = $host . $_zp_current_category->getLink();
                            $type = 'category';
                        } else {
                            $pagetitle = gettext('News') . " - ";
                            $desc = '';
                            $canonicalurl = $host . getNewsIndexURL();
                            $type = 'website';
                        }
                    }
                    if ($_zp_page != 1) {
                        $canonicalurl .= '/' . $_zp_page;
                    }
                }
                break;
            case 'pages.php':
                $pagetitle = getBarePageTitle() . " - ";
                $date = getPageDate();
                $desc = trim(getBare(getPageContent()));
                $canonicalurl = $host . $_zp_current_zenpage_page->getLink();
                break;
            default:
                // for all other possible static custom pages
                $custompage = stripSuffix($_zp_gallery_page);
                $standard = array('contact' => gettext('Contact'), 'register' => gettext('Register'), 'search' => gettext('Search'), 'archive' => gettext('Archive view'), 'password' => gettext('Password required'));
                if (is_object($_myFavorites)) {
                    $standard['favorites'] = gettext('My favorites');
                }
                if (array_key_exists($custompage, $standard)) {
                    $pagetitle = $standard[$custompage] . " - ";
                } else {
                    $pagetitle = $custompage . " - ";
                }
                $desc = '';
                $canonicalurl = $host . getCustomPageURL($custompage);
                if ($_zp_page != 1) {
                    $canonicalurl .= '/' . $_zp_page;
                }
                break;
        }
        // shorten desc to the allowed 200 characters if necesssary.
        $desc = html_encode(trim(substr(getBare($desc), 0, 160)));
        $pagetitle = $pagetitle . getBareGalleryTitle();
        // get master admin
        $admin = $_zp_authority->getMasterUser();
        $author = $admin->getName();
        $meta = '';
        if (getOption('htmlmeta_http-equiv-cache-control')) {
            $meta .= '<meta http-equiv="Cache-control" content="' . getOption("htmlmeta_cache_control") . '">' . "\n";
        }
        if (getOption('htmlmeta_http-equiv-pragma')) {
            $meta .= '<meta http-equiv="pragma" content="' . getOption("htmlmeta_pragma") . '">' . "\n";
        }
        if (getOption('htmlmeta_name-keywords')) {
            $meta .= '<meta name="keywords" content="' . htmlmetatags::getMetaKeywords() . '">' . "\n";
        }
        if (getOption('htmlmeta_name-description')) {
            $meta .= '<meta name="description" content="' . $desc . '">' . "\n";
        }
        if (getOption('htmlmeta_name-page-topic')) {
            $meta .= '<meta name="page-topic" content="' . $desc . '">' . "\n";
        }
        if (getOption('htmlmeta_name-robots')) {
            $meta .= '<meta name="robots" content="' . getOption("htmlmeta_robots") . '">' . "\n";
        }
        if (getOption('htmlmeta_name-publisher')) {
            $meta .= '<meta name="publisher" content="' . FULLWEBPATH . '">' . "\n";
        }
        if (getOption('htmlmeta_name-creator')) {
            $meta .= '<meta name="creator" content="' . FULLWEBPATH . '">' . "\n";
        }
        if (getOption('htmlmeta_name-author')) {
            $meta .= '<meta name="author" content="' . $author . '">' . "\n";
        }
        if (getOption('htmlmeta_name-copyright')) {
            $meta .= '<meta name="copyright" content=" (c) ' . FULLWEBPATH . ' - ' . $author . '">' . "\n";
        }
        if (getOption('htmlmeta_name-rights')) {
            $meta .= '<meta name="rights" content="' . $author . '">' . "\n";
        }
        if (getOption('htmlmeta_name-generator')) {
            $meta .= '<meta name="generator" content="Zenphoto ' . ZENPHOTO_VERSION . '">' . "\n";
        }
        if (getOption('htmlmeta_name-revisit-after')) {
            $meta .= '<meta name="revisit-after" content="' . getOption("htmlmeta_revisit_after") . '">' . "\n";
        }
        if (getOption('htmlmeta_name-expires')) {
            $expires = getOption("htmlmeta_expires");
            if ($expires == (int) $expires) {
                $expires = preg_replace('|\\s\\-\\d+|', '', date('r', time() + $expires)) . ' GMT';
            }
            $meta .= '<meta name="expires" content="' . $expires . '">' . "\n";
        }
        // OpenGraph meta
        if (getOption('htmlmeta_og-title')) {
            $meta .= '<meta property="og:title" content="' . $pagetitle . '">' . "\n";
        }
        if (getOption('htmlmeta_og-image') && !empty($thumb)) {
            $meta .= '<meta property="og:image" content="' . $thumb . '">' . "\n";
        }
        if (getOption('htmlmeta_og-description')) {
            $meta .= '<meta property="og:description" content="' . $desc . '">' . "\n";
        }
        if (getOption('htmlmeta_og-url')) {
            $meta .= '<meta property="og:url" content="' . html_encode($url) . '">' . "\n";
        }
        if (getOption('htmlmeta_og-type')) {
            $meta .= '<meta property="og:type" content="' . $type . '">' . "\n";
        }
        // Social network extras
        if (getOption('htmlmeta_name-pinterest')) {
            $meta .= '<meta name="pinterest" content="nopin">' . "\n";
        }
        // dissalow users to pin images on Pinterest
        // Twitter card
        $twittername = getOption('htmlmeta_twittername');
        if (getOption('htmlmeta_twittercard') || !empty($twittername)) {
            $meta .= '<meta property="twitter:creator" content="' . $twittername . '">' . "\n";
            $meta .= '<meta property="twitter:site" content="' . $twittername . '">' . "\n";
            $meta .= '<meta property="twitter:card" content="summary">' . "\n";
            $meta .= '<meta property="twitter:title" content="' . $pagetitle . '">' . "\n";
            $meta .= '<meta property="twitter:description" content="' . $desc . '">' . "\n";
            if (!empty($thumb)) {
                $meta .= '<meta property="twitter:image" content="' . $thumb . '">' . "\n";
            }
        }
        // Canonical url
        if (getOption('htmlmeta_canonical-url')) {
            $meta .= '<link rel="canonical" href="' . $canonicalurl . '">' . "\n";
            if (METATAG_LOCALE_TYPE) {
                $langs = generateLanguageList();
                if (count($langs) != 1) {
                    foreach ($langs as $text => $lang) {
                        $langcheck = zpFunctions::getLanguageText($lang, '-');
                        //	for hreflang we need en-US
                        if ($langcheck != $locale) {
                            switch (METATAG_LOCALE_TYPE) {
                                case 1:
                                    $altlink = seo_locale::localePath(true, $lang);
                                    break;
                                case 2:
                                    $altlink = dynamic_locale::fullHostPath($lang);
                                    break;
                            }
                            switch ($_zp_gallery_page) {
                                case 'index.php':
                                    $altlink .= '/';
                                    break;
                                case 'gallery.php':
                                    $altlink .= '/' . _PAGE_ . '/gallery';
                                    break;
                                case 'album.php':
                                    $altlink .= '/' . html_encode($_zp_current_album->name) . '/';
                                    break;
                                case 'image.php':
                                    $altlink .= '/' . html_encode($_zp_current_album->name) . '/' . html_encode($_zp_current_image->filename) . IM_SUFFIX;
                                    break;
                                case 'news.php':
                                    if (function_exists("is_NewsArticle")) {
                                        if (is_NewsArticle()) {
                                            $altlink .= '/' . _NEWS_ . '/' . html_encode($_zp_current_zenpage_news->getTitlelink());
                                        } else {
                                            if (is_NewsCategory()) {
                                                $altlink .= '/' . _NEWS_ . '/' . html_encode($_zp_current_category->getTitlelink());
                                            } else {
                                                $altlink .= '/' . _NEWS_;
                                            }
                                        }
                                    }
                                    break;
                                case 'pages.php':
                                    $altlink .= '/' . _PAGES_ . '/' . html_encode($_zp_current_zenpage_page->getTitlelink());
                                    break;
                                case 'archive.php':
                                    $altlink .= '/' . _ARCHIVE_;
                                    break;
                                case 'search.php':
                                    $altlink .= '/' . _SEARCH_ . '/';
                                    break;
                                case 'contact.php':
                                    $altlink .= '/' . _CONTACT_ . '/';
                                    break;
                                default:
                                    // for all other possible none standard custom pages
                                    $altlink .= '/' . _PAGE_ . '/' . html_encode($pagetitle);
                                    break;
                            }
                            // switch
                            //append page number if needed
                            switch ($_zp_gallery_page) {
                                case 'index.php':
                                case 'album.php':
                                    if ($_zp_page != 1) {
                                        $altlink .= _PAGE_ . '/' . $_zp_page . '/';
                                    }
                                    break;
                                case 'gallery.php':
                                case 'news.php':
                                    if ($_zp_page != 1) {
                                        $altlink .= '/' . $_zp_page;
                                    }
                                    break;
                            }
                            $meta .= '<link rel="alternate" hreflang="' . $langcheck . '" href="' . $altlink . '">' . "\n";
                        }
                        // if lang
                    }
                    // foreach
                }
                // if count
            }
            // if option
        }
        // if canonical
        if (!empty($htmlmetatags_need_cache)) {
            $meta .= '<script type="text/javascript">' . "\n";
            $meta .= 'var caches = ["' . implode('","', $htmlmetatags_need_cache) . '"];' . "\n";
            $meta .= '
					window.onload = function() {
						var index,value;
						for (index in caches) {
								value = caches[index];
								$.ajax({
									cache: false,
									type: "GET",
									url: value
								});
						}
					}
					';
            $meta .= '</script>' . "\n";
        }
        zp_remove_filter('image_processor_uri', 'htmlmetatags::ipURI');
        echo $meta;
    }
コード例 #26
0
ファイル: search.php プロジェクト: ariep/ZenPhoto20-DEV
        ?>
		<div>
			<ul class="search-item"><li><?php 
        printf(gettext('Pages (%s)'), $numpages);
        ?>
</li></ul>
		<?php 
        while (next_page()) {
            ?>
				<div class="news-truncate clearfix">
					<h3 class="search-title"><?php 
            printPageURL();
            ?>
</h3>
					<div class="search-content clearfix">
			<?php 
            echo html_encodeTagged(shortenContent(getBare(getPageContent()), 100, getOption("zenpage_textshorten_indicator")));
            ?>
					</div>
				</div>
		<?php 
        }
        ?>
		</div>
		<?php 
    }
}
?>

<?php 
include 'inc_footer.php';
コード例 #27
0
/**
 * Print page content either of the current page or if requested by titlelink directly. If not both return false
 * Set the titlelink of a page to call a specific even un-published page ($published = false) as a gallery description or on another custom page for example
 *
 * @param string $titlelink the titlelink of the page to print the content from
 * @param bool $published If titlelink is set, set this to false if you want to call an un-published page's content. True is default
 * @return mixed
 */
function printPageContent($titlelink = NULL, $published = true)
{
    echo html_encodeTagged(getPageContent($titlelink, $published));
}
コード例 #28
0
ファイル: index.php プロジェクト: abouthalf/archies-recipes
 // atom:link
 $xml->writeElement('description', $app['defaultKeywords']);
 $xml->writeElement('link', 'http://' . $_SERVER['SERVER_NAME']);
 $xml->writeElement('pubDate', $now->format(DATE_RSS));
 // get files
 $path = __DIR__ . '/../html/blog';
 $files = scandir($path, 1);
 // ignore dot-files and not-html-files
 $files = array_values(array_filter($files, function ($f) {
     return preg_match('/^.*\\.html$/', $f);
 }));
 $totalFiles = count($files) > $app['postsPerPage'] ? $app['postsPerPage'] : count($files);
 // build items
 for ($i = 0; $i < $totalFiles; $i++) {
     $file = $files[$i];
     $post = getPageContent('blog/' . $file);
     $body = $post->body->asXML();
     $body = str_replace('<body>', '', $body);
     $body = str_replace('</body>', '', $body);
     $description = join(' ', explode(' ', strip_tags($body), 50));
     $url = 'http://' . $_SERVER['SERVER_NAME'] . buildBlogUrlFromFileName($file);
     $xml->startElement('item');
     $xml->writeElement('title', $post->head->title);
     $xml->writeElement('link', $url);
     $xml->startElement('description');
     $xml->writeCdata($description);
     $xml->endElement();
     //description
     $xml->writeElement('pubDate', buildPubDateFromFileName($file, $app));
     $xml->startElementNs('content', 'encoded', null);
     $xml->writeCdata($body);
コード例 #29
0
ファイル: search.php プロジェクト: jmruas/zenphoto
</small></h3>
							<ul class="searchresults">
								<?php 
        while (next_page()) {
            $c++;
            ?>
									<li<?php 
            printZDToggleClass('pages', $c, $number_to_show);
            ?>
>
										<h4><?php 
            printPageURL();
            ?>
</h4>
										<p class="zenpageexcerpt"><?php 
            echo shortenContent(getBare(getPageContent()), 80, getOption("zenpage_textshorten_indicator"));
            ?>
</p>
									</li>
									<?php 
        }
        ?>
							</ul>
							<?php 
    }
    if ($numnews > 0 && ZP_NEWS_ENABLED) {
        $number_to_show = 5;
        $c = 0;
        ?>
							<h3><?php 
        printf(gettext('Articles (%s)'), $numnews);
コード例 #30
0
function templatereplace($line, $replacements = array(), &$redata = array(), $debugSrc = 'Unspecified', $anonymized = false, $questionNum = NULL, $registerdata = array(), $bStaticReplacement = false)
{
    $allowedvars = array('answer', 'assessments', 'captchapath', 'clienttoken', 'completed', 'errormsg', 'groupdescription', 'groupname', 'help', 'imageurl', 'languagechanger', 'loadname', 'move', 'navigator', 'percentcomplete', 'privacy', 'question', 's_lang', 'saved_id', 'showgroupinfo', 'showqnumcode', 'showxquestions', 'sitename', 'surveylist', 'templatedir', 'thissurvey', 'token', 'totalBoilerplatequestions', 'totalquestions');
    $varsPassed = array();
    foreach ($allowedvars as $var) {
        if (isset($redata[$var])) {
            ${$var} = $redata[$var];
            $varsPassed[] = $var;
        }
    }
    if (!isset($showgroupinfo)) {
        $showgroupinfo = Yii::app()->getConfig('showgroupinfo');
    }
    if (!isset($showqnumcode)) {
        $showqnumcode = Yii::app()->getConfig('showqnumcode');
    }
    $_surveyid = Yii::app()->getConfig('surveyID');
    if (!isset($showxquestions)) {
        $showxquestions = Yii::app()->getConfig('showxquestions');
    }
    if (!isset($s_lang)) {
        $s_lang = isset(Yii::app()->session['survey_' . $_surveyid]['s_lang']) ? Yii::app()->session['survey_' . $_surveyid]['s_lang'] : 'en';
    }
    if ($_surveyid && !isset($thissurvey)) {
        $thissurvey = getSurveyInfo($_surveyid, $s_lang);
    }
    if (!isset($captchapath)) {
        $captchapath = '';
    }
    if (!isset($sitename)) {
        $sitename = Yii::app()->getConfig('sitename');
    }
    if (!isset($saved_id) && isset(Yii::app()->session['survey_' . $_surveyid]['srid'])) {
        $saved_id = Yii::app()->session['survey_' . $_surveyid]['srid'];
    }
    $clang = Yii::app()->lang;
    Yii::app()->loadHelper('surveytranslator');
    if (isset($thissurvey['sid'])) {
        $surveyid = $thissurvey['sid'];
    }
    // lets sanitize the survey template
    if (isset($thissurvey['templatedir'])) {
        $templatename = $thissurvey['templatedir'];
    } else {
        $templatename = Yii::app()->getConfig('defaulttemplate');
    }
    if (!isset($templatedir)) {
        $templatedir = getTemplatePath($templatename);
    }
    if (!isset($templateurl)) {
        $templateurl = getTemplateURL($templatename) . "/";
    }
    if (!$anonymized && isset($thissurvey['anonymized'])) {
        $anonymized = $thissurvey['anonymized'] == "Y";
    }
    // TEMPLATECSS
    $_templatecss = "";
    if (stripos($line, "{TEMPLATECSS}")) {
        if (file_exists($templatedir . DIRECTORY_SEPARATOR . 'jquery-ui-custom.css')) {
            Yii::app()->getClientScript()->registerCssFile("{$templateurl}jquery-ui-custom.css");
        } elseif (file_exists($templatedir . DIRECTORY_SEPARATOR . 'jquery-ui.css')) {
            Yii::app()->getClientScript()->registerCssFile("{$templateurl}jquery-ui.css");
        } else {
            Yii::app()->getClientScript()->registerCssFile(Yii::app()->getConfig('publicstyleurl') . "jquery-ui.css");
        }
        Yii::app()->getClientScript()->registerCssFile("{$templateurl}template.css");
        if (getLanguageRTL($clang->langcode)) {
            Yii::app()->getClientScript()->registerCssFile("{$templateurl}template-rtl.css");
        }
    }
    // surveyformat
    if (isset($thissurvey['format'])) {
        $surveyformat = str_replace(array("A", "S", "G"), array("allinone", "questionbyquestion", "groupbygroup"), $thissurvey['format']);
    } else {
        $surveyformat = "";
    }
    if (isset(Yii::app()->session['step']) && Yii::app()->session['step'] % 2 && $surveyformat != "allinone") {
        $surveyformat .= " page-odd";
    }
    if (isset($thissurvey['questionindex']) && $thissurvey['questionindex'] > 0 && $surveyformat != "allinone" && (isset(Yii::app()->session['step']) && Yii::app()->session['step'] > 0)) {
        $surveyformat .= " withindex";
    }
    if (isset($thissurvey['showprogress']) && $thissurvey['showprogress'] == "Y") {
        $surveyformat .= " showprogress";
    }
    if (isset($thissurvey['showqnumcode'])) {
        $surveyformat .= " showqnumcode-" . $thissurvey['showqnumcode'];
    }
    // real survey contact
    if (isset($surveylist) && isset($surveylist['contact'])) {
        $surveycontact = $surveylist['contact'];
    } elseif (isset($surveylist) && isset($thissurvey['admin']) && $thissurvey['admin'] != "") {
        $surveycontact = sprintf($clang->gT("Please contact %s ( %s ) for further assistance."), $thissurvey['admin'], $thissurvey['adminemail']);
    } else {
        $surveycontact = "";
    }
    // If there are non-bracketed replacements to be made do so above this line.
    // Only continue in this routine if there are bracketed items to replace {}
    if (strpos($line, "{") === false) {
        // process string anyway so that it can be pretty-printed
        return LimeExpressionManager::ProcessString($line, $questionNum, NULL, false, 1, 1, true);
    }
    if ($showgroupinfo == 'both' || $showgroupinfo == 'name' || $showgroupinfo == 'choose' && !isset($thissurvey['showgroupinfo']) || $showgroupinfo == 'choose' && $thissurvey['showgroupinfo'] == 'B' || $showgroupinfo == 'choose' && $thissurvey['showgroupinfo'] == 'N') {
        $_groupname = isset($groupname) ? $groupname : '';
    } else {
        $_groupname = '';
    }
    if ($showgroupinfo == 'both' || $showgroupinfo == 'description' || $showgroupinfo == 'choose' && !isset($thissurvey['showgroupinfo']) || $showgroupinfo == 'choose' && $thissurvey['showgroupinfo'] == 'B' || $showgroupinfo == 'choose' && $thissurvey['showgroupinfo'] == 'D') {
        $_groupdescription = isset($groupdescription) ? $groupdescription : '';
    } else {
        $_groupdescription = '';
    }
    if (isset($question) && is_array($question)) {
        $_question = $question['all'];
        $_question_text = $question['text'];
        $_question_help = $question['help'];
        $_question_mandatory = $question['mandatory'];
        $_question_man_message = $question['man_message'];
        $_question_valid_message = $question['valid_message'];
        $_question_file_valid_message = $question['file_valid_message'];
        $question['sgq'] = isset($question['sgq']) ? $question['sgq'] : '';
        $_question_essentials = $question['essentials'];
        $_getQuestionClass = $question['class'];
        $_question_man_class = $question['man_class'];
        $_question_input_error_class = $question['input_error_class'];
        $_question_number = $question['number'];
        $_question_code = $question['code'];
        $_question_type = $question['type'];
        if ($question['sgq']) {
            // Not sure it can happen today ? But if set : allways sXgXq
            list($question['sid'], $question['gid'], $question['qid']) = explode("X", $question['sgq']);
        } else {
            list($question['sid'], $question['gid'], $question['qid']) = array('', '', '');
        }
        $question['aid'] = isset($question['aid']) ? $question['aid'] : '';
    } else {
        $_question = isset($question) ? $question : '';
        $_question_text = '';
        $_question_help = '';
        $_question_mandatory = '';
        $_question_man_message = '';
        $_question_valid_message = '';
        $_question_file_valid_message = '';
        $_question_essentials = '';
        $_getQuestionClass = '';
        $_question_man_class = '';
        $_question_input_error_class = '';
        $_question_number = '';
        $_question_code = '';
        $_question_type = '';
        $question = array_fill_keys(array('sid', 'gid', 'qid', 'aid', 'sgq'), '');
    }
    if ($_question_type == '*') {
        $_question_text = '<div class="em_equation">' . $_question_text . '</div>';
    }
    if (!($showqnumcode == 'both' || $showqnumcode == 'number' || $showqnumcode == 'choose' && !isset($thissurvey['showqnumcode']) || $showqnumcode == 'choose' && $thissurvey['showqnumcode'] == 'B' || $showqnumcode == 'choose' && $thissurvey['showqnumcode'] == 'N')) {
        $_question_number = '';
    }
    if (!($showqnumcode == 'both' || $showqnumcode == 'code' || $showqnumcode == 'choose' && !isset($thissurvey['showqnumcode']) || $showqnumcode == 'choose' && $thissurvey['showqnumcode'] == 'B' || $showqnumcode == 'choose' && $thissurvey['showqnumcode'] == 'C')) {
        $_question_code = '';
    }
    if (!isset($totalquestions)) {
        $totalquestions = 0;
    }
    $_totalquestionsAsked = $totalquestions;
    if ($showxquestions == 'show' || $showxquestions == 'choose' && !isset($thissurvey['showxquestions']) || $showxquestions == 'choose' && $thissurvey['showxquestions'] == 'Y') {
        if ($_totalquestionsAsked < 1) {
            $_therearexquestions = $clang->gT("There are no questions in this survey");
            // Singular
        } elseif ($_totalquestionsAsked == 1) {
            $_therearexquestions = $clang->gT("There is 1 question in this survey");
            //Singular
        } else {
            $_therearexquestions = $clang->gT("There are {NUMBEROFQUESTIONS} questions in this survey.");
            //Note this line MUST be before {NUMBEROFQUESTIONS}
        }
    } else {
        $_therearexquestions = '';
    }
    if (isset($token)) {
        $_token = $token;
    } elseif (isset($clienttoken)) {
        $_token = htmlentities($clienttoken, ENT_QUOTES, 'UTF-8');
        // or should it be URL-encoded?
    } else {
        $_token = '';
    }
    // Expiry
    if (isset($thissurvey['expiry'])) {
        $dateformatdetails = getDateFormatData($thissurvey['surveyls_dateformat']);
        Yii::import('application.libraries.Date_Time_Converter', true);
        $datetimeobj = new Date_Time_Converter($thissurvey['expiry'], "Y-m-d");
        $_dateoutput = $datetimeobj->convert($dateformatdetails['phpdate']);
    } else {
        $_dateoutput = '-';
    }
    $_submitbutton = "<input class='submit' type='submit' value=' " . $clang->gT("Submit") . " ' name='move2' onclick=\"javascript:document.limesurvey.move.value = 'movesubmit';\" />";
    if (isset($thissurvey['surveyls_url']) and $thissurvey['surveyls_url'] != "") {
        if (trim($thissurvey['surveyls_urldescription']) != '') {
            $_linkreplace = "<a href='{$thissurvey['surveyls_url']}'>{$thissurvey['surveyls_urldescription']}</a>";
        } else {
            $_linkreplace = "<a href='{$thissurvey['surveyls_url']}'>{$thissurvey['surveyls_url']}</a>";
        }
    } else {
        $_linkreplace = '';
    }
    if (isset($thissurvey['sid']) && isset($_SESSION['survey_' . $thissurvey['sid']]['srid']) && $thissurvey['active'] == 'Y') {
        $iscompleted = SurveyDynamic::model($surveyid)->isCompleted($_SESSION['survey_' . $thissurvey['sid']]['srid']);
    } else {
        $iscompleted = false;
    }
    if (isset($surveyid) && !$iscompleted) {
        $_clearall = CHtml::htmlButton($clang->gT("Exit and clear survey"), array('type' => 'submit', 'id' => "clearall", 'value' => 'clearall', 'name' => 'clearall', 'class' => 'clearall button', 'data-confirmedby' => 'confirm-clearall', 'title' => $clang->gT("This action need confirmation.")));
        $_clearall .= CHtml::checkBox("confirm-clearall", false, array('id' => 'confirm-clearall', 'value' => 'confirm', 'class' => 'hide jshide'));
        $_clearall .= CHtml::label($clang->gT("Are you sure you want to clear all your responses?"), 'confirm-clearall', array('class' => 'hide jshide'));
    } else {
        $_clearall = "";
    }
    if (isset(Yii::app()->session['datestamp'])) {
        $_datestamp = Yii::app()->session['datestamp'];
    } else {
        $_datestamp = '-';
    }
    if (isset($thissurvey['allowsave']) and $thissurvey['allowsave'] == "Y") {
        $_saveall = doHtmlSaveAll(isset($move) ? $move : NULL);
    } else {
        $_saveall = "";
    }
    if (!isset($help)) {
        $help = "";
    }
    if (flattenText($help, true, true) != '') {
        if (!isset($helpicon)) {
            if (file_exists($templatedir . '/help.gif')) {
                $helpicon = $templateurl . 'help.gif';
            } elseif (file_exists($templatedir . '/help.png')) {
                $helpicon = $templateurl . 'help.png';
            } else {
                $helpicon = Yii::app()->getConfig('imageurl') . "/help.gif";
            }
        }
        $_questionhelp = "<img src='{$helpicon}' alt='Help' align='left' />" . $help;
    } else {
        $_questionhelp = $help;
    }
    if (isset($thissurvey['allowprev']) && $thissurvey['allowprev'] == "N") {
        $_strreview = "";
    } else {
        $_strreview = $clang->gT("If you want to check any of the answers you have made, and/or change them, you can do that now by clicking on the [<< prev] button and browsing through your responses.");
    }
    if (isset($surveyid)) {
        $restartparam = array();
        if ($_token) {
            $restartparam['token'] = sanitize_token($_token);
        }
        // urlencode with needed with sanitize_token
        if (Yii::app()->request->getQuery('lang')) {
            $restartparam['lang'] = sanitize_languagecode(Yii::app()->request->getQuery('lang'));
        } elseif ($s_lang) {
            $restartparam['lang'] = $s_lang;
        }
        $restartparam['newtest'] = "Y";
        $restarturl = Yii::app()->getController()->createUrl("survey/index/sid/{$surveyid}", $restartparam);
        $_restart = "<a href='{$restarturl}'>" . $clang->gT("Restart this Survey") . "</a>";
    } else {
        $_restart = "";
    }
    if (isset($thissurvey['anonymized']) && $thissurvey['anonymized'] == 'Y') {
        $_savealert = $clang->gT("To remain anonymous please use a pseudonym as your username, also an email address is not required.");
    } else {
        $_savealert = "";
    }
    if (isset($surveyid)) {
        if ($_token) {
            $returnlink = Yii::app()->getController()->createUrl("survey/index/sid/{$surveyid}", array('token' => sanitize_token($_token)));
        } else {
            $returnlink = Yii::app()->getController()->createUrl("survey/index/sid/{$surveyid}");
        }
        $_return_to_survey = "<a href='{$returnlink}'>" . $clang->gT("Return to survey") . "</a>";
    } else {
        $_return_to_survey = "";
    }
    // Save Form
    $_saveform = "<table><tr><td align='right'>" . $clang->gT("Name") . ":</td><td><input type='text' name='savename' value='";
    if (isset($_POST['savename'])) {
        $_saveform .= HTMLEscape(autoUnescape($_POST['savename']));
    }
    $_saveform .= "' /></td></tr>\n" . "<tr><td align='right'>" . $clang->gT("Password") . ":</td><td><input type='password' name='savepass' value='";
    if (isset($_POST['savepass'])) {
        $_saveform .= HTMLEscape(autoUnescape($_POST['savepass']));
    }
    $_saveform .= "' /></td></tr>\n" . "<tr><td align='right'>" . $clang->gT("Repeat password") . ":</td><td><input type='password' name='savepass2' value='";
    if (isset($_POST['savepass2'])) {
        $_saveform .= HTMLEscape(autoUnescape($_POST['savepass2']));
    }
    $_saveform .= "' /></td></tr>\n" . "<tr><td align='right'>" . $clang->gT("Your email address") . ":</td><td><input type='text' name='saveemail' value='";
    if (isset($_POST['saveemail'])) {
        $_saveform .= HTMLEscape(autoUnescape($_POST['saveemail']));
    }
    $_saveform .= "' /></td></tr>\n";
    if (isset($thissurvey['usecaptcha']) && function_exists("ImageCreate") && isCaptchaEnabled('saveandloadscreen', $thissurvey['usecaptcha'])) {
        $_saveform .= "<tr><td align='right'>" . $clang->gT("Security question") . ":</td><td><table><tr><td valign='middle'><img src='" . Yii::app()->getController()->createUrl('/verification/image/sid/' . (isset($surveyid) ? $surveyid : '')) . "' alt6='' /></td><td valign='middle' style='text-align:left'><input type='text' size='5' maxlength='3' name='loadsecurity' value='' /></td></tr></table></td></tr>\n";
    }
    $_saveform .= "<tr><td align='right'></td><td></td></tr>\n" . "<tr><td></td><td><input type='submit'  id='savebutton' name='savesubmit' class='button' value='" . $clang->gT("Save Now") . "' /></td></tr>\n" . "</table>";
    // Load Form
    $_loadform = "<table><tr><td align='right'>" . $clang->gT("Saved name") . ":</td><td><input type='text' name='loadname' value='";
    if (isset($loadname)) {
        $_loadform .= HTMLEscape(autoUnescape($loadname));
    }
    $_loadform .= "' /></td></tr>\n" . "<tr><td align='right'>" . $clang->gT("Password") . ":</td><td><input type='password' name='loadpass' value='";
    if (isset($loadpass)) {
        $_loadform .= HTMLEscape(autoUnescape($loadpass));
    }
    $_loadform .= "' /></td></tr>\n";
    if (isset($thissurvey['usecaptcha']) && function_exists("ImageCreate") && isCaptchaEnabled('saveandloadscreen', $thissurvey['usecaptcha'])) {
        $_loadform .= "<tr><td align='right'>" . $clang->gT("Security question") . ":</td><td><table><tr><td valign='middle'><img src='" . Yii::app()->getController()->createUrl('/verification/image/sid/' . (isset($surveyid) ? $surveyid : '')) . "' alt='' /></td><td valign='middle'><input type='text' size='5' maxlength='3' name='loadsecurity' value='' alt=''/></td></tr></table></td></tr>\n";
    }
    $_loadform .= "<tr><td align='right'></td><td></td></tr>\n" . "<tr><td></td><td><input type='submit' id='loadbutton' class='button' value='" . $clang->gT("Load now") . "' /></td></tr></table>\n";
    // Registration Form
    if (isset($surveyid) || isset($registerdata) && $debugSrc == 'register.php') {
        if (isset($surveyid)) {
            $tokensid = $surveyid;
        } else {
            $tokensid = $registerdata['sid'];
        }
        $_registerform = CHtml::form(array("/register/index/surveyid/{$tokensid}"), 'post');
        if (!isset($_REQUEST['lang'])) {
            $_reglang = Survey::model()->findByPk($tokensid)->language;
        } else {
            $_reglang = returnGlobal('lang');
        }
        $_registerform .= "\n<input type='hidden' name='lang' value='" . $_reglang . "' />\n";
        $_registerform .= "<input type='hidden' name='sid' value='{$tokensid}' id='sid' />\n";
        $_registerform .= "<table class='register' summary='Registrationform'>\n" . "<tr><td align='right'>" . $clang->gT("First name") . ":</td>" . "<td align='left'><input class='text' type='text' name='register_firstname'";
        if (isset($_POST['register_firstname'])) {
            $_registerform .= " value='" . htmlentities(returnGlobal('register_firstname'), ENT_QUOTES, 'UTF-8') . "'";
        }
        $_registerform .= " /></td></tr>" . "<tr><td align='right'>" . $clang->gT("Last name") . ":</td>\n" . "<td align='left'><input class='text' type='text' name='register_lastname'";
        if (isset($_POST['register_lastname'])) {
            $_registerform .= " value='" . htmlentities(returnGlobal('register_lastname'), ENT_QUOTES, 'UTF-8') . "'";
        }
        $_registerform .= " /></td></tr>\n" . "<tr><td align='right'>" . $clang->gT("Email address") . ":</td>\n" . "<td align='left'><input class='text' type='text' name='register_email'";
        if (isset($_POST['register_email'])) {
            $_registerform .= " value='" . htmlentities(returnGlobal('register_email'), ENT_QUOTES, 'UTF-8') . "'";
        }
        $_registerform .= " /></td></tr>\n";
        foreach ($thissurvey['attributedescriptions'] as $field => $attribute) {
            if (empty($attribute['show_register']) || $attribute['show_register'] != 'Y') {
                continue;
            }
            $_registerform .= '
            <tr>
            <td align="right">' . $thissurvey['attributecaptions'][$field] . ($attribute['mandatory'] == 'Y' ? '*' : '') . ':</td>
            <td align="left"><input class="text" type="text" name="register_' . $field . '" /></td>
            </tr>';
        }
        if ((count($registerdata) > 1 || isset($thissurvey['usecaptcha'])) && function_exists("ImageCreate") && isCaptchaEnabled('registrationscreen', $thissurvey['usecaptcha'])) {
            $_registerform .= "<tr><td align='right'>" . $clang->gT("Security Question") . ":</td><td><table><tr><td valign='middle'><img src='" . Yii::app()->getController()->createUrl('/verification/image/sid/' . $surveyid) . "' alt='' /></td><td valign='middle'><input type='text' size='5' maxlength='3' name='loadsecurity' value='' /></td></tr></table></td></tr>\n";
        }
        $_registerform .= "<tr><td></td><td><input id='registercontinue' class='submit button' type='submit' value='" . $clang->gT("Continue") . "' />" . "</td></tr>\n" . "</table>\n";
        if (count($registerdata) > 1 && $registerdata['sid'] != NULL && $debugSrc == 'register.php') {
            $_registerform .= "<input name='startdate' type ='hidden' value='" . $registerdata['startdate'] . "' />";
            $_registerform .= "<input name='enddate' type ='hidden' value='" . $registerdata['enddate'] . "' />";
        }
        $_registerform .= "</form>\n";
    } else {
        $_registerform = "";
    }
    // Assessments
    $assessmenthtml = "";
    if (isset($surveyid) && !is_null($surveyid) && function_exists('doAssessment')) {
        $assessmentdata = doAssessment($surveyid, true);
        $_assessment_current_total = $assessmentdata['total'];
        if (stripos($line, "{ASSESSMENTS}")) {
            $assessmenthtml = doAssessment($surveyid, false);
        }
    } else {
        $_assessment_current_total = '';
    }
    if (isset($thissurvey['googleanalyticsapikey']) && trim($thissurvey['googleanalyticsapikey']) != '') {
        $_googleAnalyticsAPIKey = trim($thissurvey['googleanalyticsapikey']);
    } else {
        $_googleAnalyticsAPIKey = trim(getGlobalSetting('googleanalyticsapikey'));
    }
    $_googleAnalyticsStyle = isset($thissurvey['googleanalyticsstyle']) ? $thissurvey['googleanalyticsstyle'] : '0';
    $_googleAnalyticsJavaScript = '';
    if ($_googleAnalyticsStyle != '' && $_googleAnalyticsStyle != 0 && $_googleAnalyticsAPIKey != '') {
        switch ($_googleAnalyticsStyle) {
            case '1':
                // Default Google Tracking
                $_googleAnalyticsJavaScript = <<<EOD
<script type="text/javascript">
  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', '{$_googleAnalyticsAPIKey}']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();
</script>
EOD;
                break;
            case '2':
                // SurveyName-[SID]/[GSEQ]-GroupName - create custom GSEQ based upon page step
                $moveInfo = LimeExpressionManager::GetLastMoveResult();
                if (is_null($moveInfo)) {
                    $gseq = 'welcome';
                } else {
                    if ($moveInfo['finished']) {
                        $gseq = 'finished';
                    } else {
                        if (isset($moveInfo['at_start']) && $moveInfo['at_start']) {
                            $gseq = 'welcome';
                        } else {
                            if (is_null($_groupname)) {
                                $gseq = 'printanswers';
                            } else {
                                $gseq = $moveInfo['gseq'] + 1;
                            }
                        }
                    }
                }
                $_trackURL = htmlspecialchars($thissurvey['name'] . '-[' . $surveyid . ']/[' . $gseq . ']-' . $_groupname);
                $_googleAnalyticsJavaScript = <<<EOD
<script type="text/javascript">
  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', '{$_googleAnalyticsAPIKey}']);
  _gaq.push(['_trackPageview','{$_trackURL}']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();
</script>
EOD;
                break;
        }
    }
    $_endtext = '';
    if (isset($thissurvey['surveyls_endtext']) && trim($thissurvey['surveyls_endtext']) != '') {
        $_endtext = $thissurvey['surveyls_endtext'];
    }
    if (isset($surveyid) && isset($_SESSION['survey_' . $surveyid]) && isset($_SESSION['survey_' . $surveyid]['register_errormsg'])) {
        $register_errormsg = $_SESSION['survey_' . $surveyid]['register_errormsg'];
    }
    // Set the array of replacement variables here - don't include curly braces
    $coreReplacements = array();
    $coreReplacements['ACTIVE'] = isset($thissurvey['active']) && !($thissurvey['active'] != "Y");
    $coreReplacements['AID'] = $question['aid'];
    $coreReplacements['ANSWER'] = isset($answer) ? $answer : '';
    // global
    $coreReplacements['ANSWERSCLEARED'] = $clang->gT("Answers cleared");
    $coreReplacements['ASSESSMENTS'] = $assessmenthtml;
    $coreReplacements['ASSESSMENT_CURRENT_TOTAL'] = $_assessment_current_total;
    $coreReplacements['ASSESSMENT_HEADING'] = $clang->gT("Your assessment");
    $coreReplacements['CHECKJAVASCRIPT'] = "<noscript><span class='warningjs'>" . $clang->gT("Caution: JavaScript execution is disabled in your browser. You may not be able to answer all questions in this survey. Please, verify your browser parameters.") . "</span></noscript>";
    $coreReplacements['CLEARALL'] = $_clearall;
    $coreReplacements['CLOSEWINDOW'] = "<a href='javascript:%20self.close()'>" . $clang->gT("Close this window") . "</a>";
    $coreReplacements['COMPLETED'] = isset($redata['completed']) ? $redata['completed'] : '';
    // global
    $coreReplacements['DATESTAMP'] = $_datestamp;
    $coreReplacements['ENDTEXT'] = $_endtext;
    $coreReplacements['EXPIRY'] = $_dateoutput;
    $coreReplacements['GID'] = $question['gid'] ? $question['gid'] : Yii::app()->getConfig('gid', '');
    // Use the gid of the question, except if we are not in question (Randomization group name)
    $coreReplacements['GOOGLE_ANALYTICS_API_KEY'] = $_googleAnalyticsAPIKey;
    $coreReplacements['GOOGLE_ANALYTICS_JAVASCRIPT'] = $_googleAnalyticsJavaScript;
    $coreReplacements['GROUPDESCRIPTION'] = $_groupdescription;
    $coreReplacements['GROUPNAME'] = $_groupname;
    $coreReplacements['LANG'] = $clang->getlangcode();
    $coreReplacements['LANGUAGECHANGER'] = isset($languagechanger) ? $languagechanger : '';
    // global
    $coreReplacements['LOADERROR'] = isset($errormsg) ? $errormsg : '';
    // global
    $coreReplacements['LOADFORM'] = $_loadform;
    $coreReplacements['LOADHEADING'] = $clang->gT("Load a previously saved survey");
    $coreReplacements['LOADMESSAGE'] = $clang->gT("You can load a survey that you have previously saved from this screen.") . "<br />" . $clang->gT("Type in the 'name' you used to save the survey, and the password.") . "<br />";
    $coreReplacements['NAVIGATOR'] = isset($navigator) ? $navigator : '';
    // global
    $coreReplacements['NOSURVEYID'] = isset($surveylist) ? $surveylist['nosid'] : '';
    $coreReplacements['NUMBEROFQUESTIONS'] = $_totalquestionsAsked;
    $coreReplacements['PERCENTCOMPLETE'] = isset($percentcomplete) ? $percentcomplete : '';
    // global
    $coreReplacements['PRIVACY'] = isset($privacy) ? $privacy : '';
    // global
    $coreReplacements['PRIVACYMESSAGE'] = "<span style='font-weight:bold; font-style: italic;'>" . $clang->gT("A Note On Privacy") . "</span><br />" . $clang->gT("This survey is anonymous.") . "<br />" . $clang->gT("The record of your survey responses does not contain any identifying information about you, unless a specific survey question explicitly asked for it.") . ' ' . $clang->gT("If you used an identifying token to access this survey, please rest assured that this token will not be stored together with your responses. It is managed in a separate database and will only be updated to indicate whether you did (or did not) complete this survey. There is no way of matching identification tokens with survey responses.");
    $coreReplacements['QID'] = $question['qid'];
    $coreReplacements['QUESTION'] = $_question;
    $coreReplacements['QUESTIONHELP'] = $_questionhelp;
    $coreReplacements['QUESTIONHELPPLAINTEXT'] = strip_tags(addslashes($help));
    // global
    $coreReplacements['QUESTION_CLASS'] = $_getQuestionClass;
    $coreReplacements['QUESTION_CODE'] = $_question_code;
    $coreReplacements['QUESTION_ESSENTIALS'] = $_question_essentials;
    $coreReplacements['QUESTION_FILE_VALID_MESSAGE'] = $_question_file_valid_message;
    $coreReplacements['QUESTION_HELP'] = $_question_help;
    $coreReplacements['QUESTION_INPUT_ERROR_CLASS'] = $_question_input_error_class;
    $coreReplacements['QUESTION_MANDATORY'] = $_question_mandatory;
    $coreReplacements['QUESTION_MAN_CLASS'] = $_question_man_class;
    $coreReplacements['QUESTION_MAN_MESSAGE'] = $_question_man_message;
    $coreReplacements['QUESTION_NUMBER'] = $_question_number;
    $coreReplacements['QUESTION_TEXT'] = $_question_text;
    $coreReplacements['QUESTION_VALID_MESSAGE'] = $_question_valid_message;
    $coreReplacements['REGISTERERROR'] = isset($register_errormsg) ? $register_errormsg : '';
    // global
    $coreReplacements['REGISTERFORM'] = $_registerform;
    $coreReplacements['REGISTERMESSAGE1'] = $clang->gT("You must be registered to complete this survey");
    $coreReplacements['REGISTERMESSAGE2'] = $clang->gT("You may register for this survey if you wish to take part.") . "<br />\n" . $clang->gT("Enter your details below, and an email containing the link to participate in this survey will be sent immediately.");
    $coreReplacements['RESTART'] = $_restart;
    $coreReplacements['RETURNTOSURVEY'] = $_return_to_survey;
    $coreReplacements['SAVE'] = $_saveall;
    $coreReplacements['SAVEALERT'] = $_savealert;
    $coreReplacements['SAVEDID'] = isset($saved_id) ? $saved_id : '';
    // global
    $coreReplacements['SAVEERROR'] = isset($errormsg) ? $errormsg : '';
    // global - same as LOADERROR
    $coreReplacements['SAVEFORM'] = $_saveform;
    $coreReplacements['SAVEHEADING'] = $clang->gT("Save your unfinished survey");
    $coreReplacements['SAVEMESSAGE'] = $clang->gT("Enter a name and password for this survey and click save below.") . "<br />\n" . $clang->gT("Your survey will be saved using that name and password, and can be completed later by logging in with the same name and password.") . "<br /><br />\n" . $clang->gT("If you give an email address, an email containing the details will be sent to you.") . "<br /><br />\n" . $clang->gT("After having clicked the save button you can either close this browser window or continue filling out the survey.");
    $coreReplacements['SGQ'] = $question['sgq'];
    $coreReplacements['SID'] = Yii::app()->getConfig('surveyID', '');
    // Allways use surveyID from config
    $coreReplacements['SITENAME'] = isset($sitename) ? $sitename : '';
    // global
    $coreReplacements['SUBMITBUTTON'] = $_submitbutton;
    $coreReplacements['SUBMITCOMPLETE'] = "<strong>" . $clang->gT("Thank you!") . "<br /><br />" . $clang->gT("You have completed answering the questions in this survey.") . "</strong><br /><br />" . $clang->gT("Click on 'Submit' now to complete the process and save your answers.");
    $coreReplacements['SUBMITREVIEW'] = $_strreview;
    $coreReplacements['SURVEYCONTACT'] = $surveycontact;
    $coreReplacements['SURVEYDESCRIPTION'] = isset($thissurvey['description']) ? $thissurvey['description'] : '';
    $coreReplacements['SURVEYFORMAT'] = isset($surveyformat) ? $surveyformat : '';
    // global
    $coreReplacements['SURVEYLANGAGE'] = $clang->langcode;
    $coreReplacements['SURVEYLANGUAGE'] = $clang->langcode;
    $coreReplacements['SURVEYLIST'] = isset($surveylist) ? $surveylist['list'] : '';
    $coreReplacements['SURVEYLISTHEADING'] = isset($surveylist) ? $surveylist['listheading'] : '';
    $coreReplacements['SURVEYNAME'] = isset($thissurvey['name']) ? $thissurvey['name'] : '';
    $coreReplacements['TEMPLATECSS'] = $_templatecss;
    $coreReplacements['TEMPLATEJS'] = CHtml::tag('script', array('type' => 'text/javascript', 'src' => $templateurl . 'template.js'), '');
    $coreReplacements['TEMPLATEURL'] = $templateurl;
    $coreReplacements['THEREAREXQUESTIONS'] = $_therearexquestions;
    $coreReplacements['TOKEN'] = !$anonymized ? $_token : '';
    // Silently replace TOKEN by empty string
    $coreReplacements['URL'] = $_linkreplace;
    $coreReplacements['WELCOME'] = isset($thissurvey['welcome']) ? $thissurvey['welcome'] : '';
    $coreReplacements['PANEL_LIST_ADD_FORM'] = getPanelListAddForm();
    $coreReplacements['menu'] = getMenuList();
    $coreReplacements['content'] = isset($_REQUEST['pagename']) ? getPageContent($_REQUEST['pagename']) : getPageContent('home');
    $coreReplacements['php'] = getphpcode();
    if (!is_null($replacements) && is_array($replacements)) {
        $doTheseReplacements = array_merge($coreReplacements, $replacements);
        // so $replacements overrides core values
    } else {
        $doTheseReplacements = $coreReplacements;
    }
    // Now do all of the replacements - In rare cases, need to do 3 deep recursion, that that is default
    $line = LimeExpressionManager::ProcessString($line, $questionNum, $doTheseReplacements, false, 3, 1, false, true, $bStaticReplacement);
    return $line;
}