|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
Pycck Smarty n00b
Joined: 24 Mar 2014 Posts: 4
|
Posted: Mon Mar 24, 2014 12:40 pm Post subject: Why that is not shared? |
|
|
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 »</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 |
|
Pycck Smarty n00b
Joined: 24 Mar 2014 Posts: 4
|
Posted: Mon Mar 24, 2014 7:16 pm Post subject: |
|
|
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 |
|
|
|
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
|