News - Features - Downloads - Forum - Team - Support - Switch View: Screen
Login - Registrierung - Passwort vergessen

Antworten: 3
Seite [1]
kor_jaw


Rock the board




Beiträge: 67
# Thema - 28.07.2008 um 16:00 Uhr
I want in navlist.tpl (news) ico of category (<img src="uploads/categories/picture-{news:categories_id}.gif>.
Help me and i have one question - it is possible, add navlist (news) to recent ?

 
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
1. / 2. / ... 
<?php
// ClanSphere 2008 - www.clansphere.net
// $Id: navlist.php 196 2006-08-13 00:53:13Z hajo $

$cs_lang cs_translate('news');

$cs_option cs_sql_option(__FILE__,'news');

$select 'ne.news_id AS news_id, ne.news_headline AS news_headline, ne.news_time AS news_time';
$public 'ne.news_public > \'0\' AND cat.categories_access <= \'' $account['access_news'] . '\'';
$order 'ne.news_time DESC';
$tables 'news ne INNER JOIN {pre}_categories cat ON ne.categories_id = cat.categories_id';
$cs_news cs_sql_select(__FILE__,$tables,$select,$public,'ne.news_time DESC',0,$cs_option['max_navlist']);

if(empty(
$cs_news)) {
  echo 
$cs_lang['no_data'];
}
else {
  
$data = array();
  
$run 0;
  foreach (
$cs_news AS $news) {
    
$data['news'][$run]['news_time'] = cs_date('unix',$news['news_time'],1);
    
$short strlen($news['news_headline']) <= 15 $news['news_headline'] : substr($news['news_headline'],0,15) . '...';
    
$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++;

  }


  echo 
cs_subtemplate(__FILE__,$data,'news','navlist');

}

?>


Zuletzt editiert von kor_jaw am 28.07.2008 um 16:02 Uhr (1x Editiert)
Inaktiv
Pred


Poststar




Herkunft: Bischofsmais
Beiträge: 762
# Antwort: 1 - 28.07.2008 um 16:31 Uhr
Add the following Code below Line 29:

 
1.
1. / 2. / ... 
<?php     $data['news'][$run]['categories_id'] = cs_secure($news['categories_id']); ?>


then u can use {news:categories_id}


------------------


Inaktiv
|
kor_jaw
Thread-Ersteller


Rock the board




Beiträge: 67
# Antwort: 2 - 28.07.2008 um 16:42 Uhr
hmm dont work : / In navlist.tpl -> <img src="uploads/categories/picture-{news:categories_id}.gif">
Now my image looked that -> uploads/categories/picture-.gif
script dont see id :/

what is wrong ?
 
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
1. / 2. / ... 
<?php
// ClanSphere 2008 - www.clansphere.net
// $Id: navlist.php 196 2006-08-13 00:53:13Z hajo $

$cs_lang cs_translate('news');

$cs_option cs_sql_option(__FILE__,'news');

$select 'ne.news_id AS news_id, ne.news_headline AS news_headline, ne.news_time AS news_time';
$public 'ne.news_public > \'0\' AND cat.categories_access <= \'' $account['access_news'] . '\'';
$order 'ne.news_time DESC';
$tables 'news ne INNER JOIN {pre}_categories cat ON ne.categories_id = cat.categories_id';
$cs_news cs_sql_select(__FILE__,$tables,$select,$public,'ne.news_time DESC',0,$cs_option['max_navlist']);

if(empty(
$cs_news)) {
  echo 
$cs_lang['no_data'];
}
else {
  
$data = array();
  
$run 0;
  foreach (
$cs_news AS $news) {
    
$data['news'][$run]['news_time'] = cs_date('unix',$news['news_time'],1);
    
$short strlen($news['news_headline']) <= 15 $news['news_headline'] : substr($news['news_headline'],0,15) . '...';
    
$data['news'][$run]['news_url'] = cs_url('news','view','id=' $news['news_id']);
    
$data['news'][$run]['categories_id'] = cs_secure($news['categories_id']);
    
$data['news'][$run]['news_short'] = cs_secure($short);
    
$data['news'][$run]['news_headline'] = cs_secure($news['news_headline']);
    
$run++;

  }


  echo 
cs_subtemplate(__FILE__,$data,'news','navlist');

}

?>


Zuletzt editiert von kor_jaw am 28.07.2008 um 16:49 Uhr (2x Editiert)
Inaktiv
|
Jam2 ClanSphere Team


Highlander





Beiträge: 3291
# Antwort: 3 - 28.07.2008 um 16:45 Uhr
28.07.2008 um 16:31 Uhr - Pred:
Add the following Code below Line 29:

 
1.
1. / 2. / ... 
<?php     $data['news'][$run]['categories_id'] = cs_secure($news['categories_id']); ?>


then u can use {news:categories_id}


28.07.2008 um 16:31 Uhr - Pred:

I think that's right!

 
1.
1. / 2. / ... 
<?php     $data['news'][$run]['categories_id'] = cs_secure($news['cat.categories_id']); ?>




------------------
Gruß/ Best regards
Jam2

Nützliche Forumbeiträge/Codepastes: (Useful comments in our board / codepastes)
Template Switch for index.php
Board Navlist last posts

Edi: könnte man denn auch hier eine erweiterung einfügen?
Jam2: das web ist wie toyota.....
Edi: hö ?
Jam2: nichts ist unmöglich!


Inaktiv
|
Antworten: 3
Seite [1]


Sie müssen sich registrieren, um zu antworten.


ClanSphere Project - Mailus - Imprint - Disclaimer - Scriptinfo