Latest articles
Latest articles of category




Article.tpl


There are two files related with articles. Those are article.tpl and authorsArticle.tpl.

article.tpl is related with displaying a full body of the article of the category or category/subcategory selected.

this code block displays a banner with icons, with which the article can be font-increased or decreased, sent via email or printed.
 
{if $smarty.get.action neq 'print' && $smarty.get.action neq 'email'}
<div class="articles">
    <div id="banner">
        {if $smarty.get.subcategory_name eq ''}
        <a href="{$smarty.const.WEBSITE_ROOT}/article.php?action=pdf&lang={$smarty.session.session_lang}&category_name={$smarty.get.category_name}&title={$smarty.get.title}" >
        {else}
            <a href="{$smarty.const.WEBSITE_ROOT}/article.php?action=pdf&lang={$smarty.session.session_lang}&category_name={$smarty.get.category_name}&subcategory_name={$smarty.get.subcategory_name}&title={$smarty.get.title}" >
        {/if}
        {*<img src="{$smarty.const.THEME_ROOT}/themename/images/article_img/pdf-icon.png" align="right" border="none"/>*}</a>
            {if $smarty.get.subcategory_name eq ''}
        <a href="{$smarty.const.WEBSITE_ROOT}/article.php?action=print&lang={$smarty.session.session_lang}&category_name={$smarty.get.category_name}&title={$smarty.get.title}" rel="gb_page_fs[];">
        {else}
            <a href="{$smarty.const.WEBSITE_ROOT}/article.php?action=print&lang={$smarty.session.session_lang}&category_name={$smarty.get.category_name}&subcategory_name={$smarty.get.subcategory_name}&title={$smarty.get.title}" rel="gb_page_fs[];">
        {/if}

            <img src="{$smarty.const.THEME_ROOT}/themename/images/article_img/print.png" align="right" class="print" border="none"/></a>

        {if $smarty.get.subcategory_name eq ''}
            <a href="{$smarty.const.WEBSITE_ROOT}/article.php?action=email&lang={$smarty.session.session_lang}&category_name={$smarty.get.category_name}&title={$smarty.get.title}" rel="gb_page_center[600,400];">
        {else}
            <a href="{$smarty.const.WEBSITE_ROOT}/article.php?action=email&lang={$smarty.session.session_lang}&category_name={$smarty.get.category_name}&subcategory_name={$smarty.get.subcategory_name}&title={$smarty.get.title}" rel="gb_page_center[600,400];">
        {/if}
            <img src="{$smarty.const.THEME_ROOT}/themename/images/article_img/mail.png" align="right" class="mail" border="none"></a>
            <a href="javascript:decreaseFontSize();"><img src="{$smarty.const.THEME_ROOT}/themename/images/article_img/decrease_font_white.png" align="right"border="none"/></a>
            <a href="javascript:increaseFontSize();"><img src="{$smarty.const.THEME_ROOT}/themename/images/article_img/font-increase_white.png" align="right" border="none"/></a>

{/if}

 

using these ajax pop-up windows by fill in the necessary fields the article can be either sent via email or printed
 
{if $smarty.get.action eq 'email'}
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    {literal}<style type="text/css">body{font-family: 'Verdana','courier new', 'Arial', 'Trebuchet MS', 'Sans-Serif' !important;
            font-size:12px !important; margin:0 auto; width: 600px; padding:10px; }</style>{/literal}
    {if isset($smarty.post.send_email)}
        {if $empty_fields neq ''}
              <strong style="color: red;">{$empty_fields}</strong>
        {/if}
         {if $sent}
            <strong style="color: red;">{t}Your email has been sent successfully{/t}!</strong>
          {else}
            error
         {/if}
    {/if}
    <form method="post">

    <strong>{$site_name} EMAIL: <br />{$title|capitalize}</strong><br /><br />
     {t}E-mail address{/t}: *<br /> <input type="text" name="email_recipient" value="" size="30"/> <br />
     {t}Your e-mail address{/t}: * <br /><input type="text" name="email_poster" value="" size="30"/> <br />
     {t}Your name{/t}: * <br /><input type="text" name="name_poster" value="" size="30"/><br />
     <input type="submit" name="send_email" value="{t}Send email{/t}" /><br /><br />
     <input type="hidden" name="email_title" value="{$title}" />
      *: <i>{t}These fields are required{/t}</i>


    </form>

{elseif $smarty.get.action eq 'print'}
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
{literal}<style type="text/css">body{font-family: 'Verdana', 'courier new', 'Arial', 'Trebuchet MS', 'Sans-Serif' !important;
font-size:12px !important; margin:0 auto; width: 600px;  }</style>{/literal}<br /><br />
    <input type="button" class="formButtonSubmit" value="Εκτύπωση" id="imgprint" onclick="printMe();"/><br /><br />
    <h1>{$site_name}</h1>
    {literal}<style type="text/css">.date_border{border-top:1px solid #000; border-bottom:1px solid #000; height:20px;}</style>{/literal}

 

if the user has administrator or Super author rights, the article can be editable
 
{if ($admin==1) or ($userlevel_name eq 'Super Authors') or ($username eq $published_by)}
<div class="article_edit"><a href = "{$smarty.const.WEBSITE_ROOT}/cms/articles/authorsArticle.php?action=edit&id={$id}&category_name={$smarty.get.category_name}" rel="gb_page_fs[]">{t}Edit article{/t}</a></div>
{/if}
Page 2

Posted on: 23/03/2011