by
KK » Sun Oct 09, 2011 4:41 am
Sorry I should have been more explicit about the PHP syntax. The PHP curly braces need to be closed properly the following way -
- Code: Select all
<cms:if k_is_page >
<?php if( $_SERVER['HTTP_REFERER']=='http://revlimitmag.com/mobile/index.php' ){ ?>
---- output your simpler content here ----
<?php } else{ ?>
---- output your original (normal) content here ----
<?php } ?>
<cms:else />
<cms:embed 'news_list.php' />
</cms:if>
or using the more legible syntax -
- Code: Select all
<cms:if k_is_page >
<?php if( $_SERVER['HTTP_REFERER']=='http://revlimitmag.com/mobile/index.php' ): ?>
---- output your simpler content here ----
<?php else: ?>
---- output your original (normal) content here ----
<?php endif; ?>
<cms:else />
<cms:embed 'news_list.php' />
</cms:if>
Your code should now become -
<?php require_once( '../couch/cms.php' ); ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<cms:template title='News' clonable='1' commentable='1' >
<cms:editable name='news_content' type='richtext' />
<cms:editable name='news_image'
crop='1'
width='118'
height='72'
type='image'
/>
<cms:editable
name='written_by'
label='written_by'
desc='You need to enter written by e.g (admin)'
type='text'></cms:editable>
</cms:template>
<cms:if k_is_page >
<?php if( $_SERVER['HTTP_REFERER']=='http://revlimitmag.com/mobile/index.php' ): ?>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title><cms:show k_page_title /> | Revlimit Magazine</title>
<link href="../css/all_pages.css" rel="stylesheet" type="text/css" />
<link href="../css/links.css" rel="stylesheet" type="text/css" />
<link href="../css/nav.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
a:link { font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px; color:#4F4F4F; font-weight:bold; }
a:hover { font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px; color: #999999; font-weight:bold; }
a:visted { { font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px; color:#4F4F4F; font-weight:bold; }
-->
</style>
</head>
<body>
<div class="text-title-pages"><cms:show k_page_title /></div>
<div class="text-area-pages"><cms:show news_content /></div>
</body>
<html>
<?php else: ?>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title><cms:show k_page_title /> | Revlimit Magazine</title>
<link href="../css/all_pages.css" rel="stylesheet" type="text/css" />
<link href="../css/links.css" rel="stylesheet" type="text/css" />
<link href="../css/nav.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
a:link { font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px; color:#4F4F4F; font-weight:bold; }
a:hover { font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px; color: #999999; font-weight:bold; }
a:visted { { font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px; color:#4F4F4F; font-weight:bold; }
-->
</style>
</head>
<body>
<?php include("../includes/banner-nav.html"); ?>
<div id="main">
<div class="main-area-new">
<div class="main-area-inside">
<div class="left-area">
<br /><br /><br />
<div class="text-title-pages"><cms:show k_page_title /></div>
<div class="text-area-pages1">
Date Posted | <strong>
<cms:date k_page_date format='%B %d, %Y' locale='English' /></strong>
</div>
<div class="text-area-pages1"> Posted by | <strong>
<cms:show written_by />
</strong> </div>
<div class="text-area-pages1"><br><br></div>
<div class="text-area-pages"><cms:show news_content />
</div>
<div class="text-area-pages1">
<div class="comments-area">
<strong>Comments</strong><br>
<br>
<div class="hr dotted clearfix"> </div>
<cms:if k_comments_count >
<ol class="commentlist">
<cms:comments page_id=k_page_id order='asc' limit='20' paginate='1' >
<li class="comment">
<div class="comment_content">
<div class="clearfix">
<cite class="author_name"><strong><cms:show k_comment_author /></strong></cite>
<div class="comment-meta commentmetadata"><span class="comments-text-date"><cms:date k_comment_date format='F j, Y'/> at <cms:date k_comment_date format='h:ia'/></a></span></div>
</div>
<div class="comment_text">
<p><cms:show k_comment /></p>
</div>
</div>
</li>
<cms:paginator />
</cms:comments>
</ol>
<cms:else />
No comments.
</cms:if>
<div class="hr clearfix"> </div>
<!-- Comment Form -->
<cms:embed 'comments_form.html' />
</div>
<br>
</div></div>
<!-- Right side bar -->
<div class="right-area">
<?php include("../includes/side.html"); ?>
</div>
<!-- End div -->
<div class="space"><br /><br /><br /><br /><br /></div>
</div>
</div>
</div></div>
<?php include("../includes/footer.html"); ?>
<!-- Main Div end -->
</div>
</body>
</html>
<?php endif; ?>
<cms:else />
<cms:embed 'news_list.php' />
</cms:if>
<?php COUCH::invoke(); ?>