Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Why that is not shared?

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
Pycck
Smarty n00b


Joined: 24 Mar 2014
Posts: 4

PostPosted: Mon Mar 24, 2014 12:40 pm    Post subject: Why that is not shared? Reply with quote

Hey community,
I would like to know why the individual news are not in a category. The show this to me at intervals. Screen:
http://screencloud.net/v/9t85

Code:
Code:
            <div class="content">
                        <span class='small-news-header'>
                        {foreach from=$array item=arr}
                         {$arr.published|date_format:"%d.%m.%y"}                                                   </span>
                        <hr style='border-style:dashed;margin:0;margin-bottom:10px;border-color:#bbb;' />
                                                    <span class="small-news">{$arr.title}</span> <a href="articles.php?id={$arr.id}">Read &raquo;</a><br />
                                                                                                <br />
                       {/foreach}

Code for Array:
Code:
$result = mysql_query("SELECT * FROM cms_news ORDER BY published") OR die(mysql_error());
   $array = array();
   while($row = mysql_fetch_assoc($result))
   {
      $array[] = $row;
   } 
   $Smarty->assign('array', $array);
Back to top
View user's profile Send private message Send e-mail
Pycck
Smarty n00b


Joined: 24 Mar 2014
Posts: 4

PostPosted: Mon Mar 24, 2014 7:16 pm    Post subject: Reply with quote

What should I do here exactly in Smarty to the issue up there?
Code:
$i=1;
while($row=mysql_fetch_array($result)){
$jahr[$i]=substr($row['datumein'],0,4);
if($jahr[$i] != $jahr[$i-1]){   
echo $jahr[$i]." ".$i.'<br>';
}
$i++;
}
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP