Demo

Probiere ClanSphere aus und teste daran herum. Demo


Antworten: 0
Seite [1]
microz


Rock the board




Beiträge: 86
# Thema - 26.01.2014 um 07:30 Uhr
Hello,

Im trying create a special navlist (for new module coupon), similar to news navlist, for that only show news that matching with id stored in a array() with news_id, for example in array() i have stored [1,5,7,8]

The problem is that im very newbie , but be correct to run a if within foreach, with condition example $matriz[$run]==$news['news_id'], similar to this. (
is a short code)

 
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
1. / 2. / ... 
 
$matriz
=array()
if(empty(
$cs_news)){
   echo 
cs_lang['no_data'];
}
else{
$run=0
foreach($cs_news as $news){
    if (
$matriz[$run]==$news['news_id']){
      
$data['news'][$run]['news_time'] = cs_date('unix',$news['news_time'],1,1,0);
      
$short strlen($news['news_headline']) <= $cs_option['max_headline'] ? $news['news_headline'] : cs_substr($news['news_headline'],0,$cs_option['max_headline']) . '...';
      
$data['news'][$run]['news_url'] = cs_url('news','view','id=' $news['news_id']);
      
$data['news'][$run]['news_short'] = cs_secure($short);
      
$data['news'][$run]['news_headline'] = cs_secure($news['news_headline']);
      
$run++;  
}else{
// none
}
)


Any suggestion?
Inaktiv
Antworten: 0
Seite [1]


Sie müssen sich registrieren, um zu antworten.