Demo

Probiere ClanSphere aus und teste daran herum. Demo

Codepaste - Details
Weitere Infos zum Codepaste

Name Last Topics
Autor de deleted1395
CMS-Version ClanSphere 2007
Datei board/navlist.php
Datum 30.11.2007 um 12:34 Uhr
Beschreibung Das Modul schiebt das Topic mit dem neuesten Post nach oben.
Besonderheit: Nach dem Anschauen des Threads wird das Topic nicht aus der Navlist entfernt.
Das fang ich bisher immer nervig/gewöhnungsbedürftig an Clansphere, weil es bei jedem anderen CMS nicht so ist. Ich hoffe manche können was damit anfangen, hinterlasst einfach mal nen Comment.
Alter Code Alter Code +-
 
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.
38.
39.
1. / 2. / ... 
<?php
// ClanSphere 2007 - www.clansphere.net
// $Id: navlist.php 143 2006-08-01 05:05:45Z hajo $

$cs_lang cs_translate('board');

$cs_usertime cs_sql_select(__FILE__,'users','users_readtime',"users_id = '" $account["users_id"] . "'");
$cs_readtime cs_time() - $cs_usertime['users_readtime'];

$data = array();
$figures 20;

$tables  'threads thr INNER JOIN {pre}_board frm ON frm.board_id = thr.board_id ';
$tables .= 'LEFT JOIN {pre}_read red ON thr.threads_id = red.threads_id AND red.users_id = \''.$account['users_id'].'\'';
$cells   'thr.threads_headline AS threads_headline, thr.threads_id AS threads_id, ';
$cells  .= 'thr.threads_last_time AS threads_last_time';
$cond    'frm.board_access <= \''.$account['access_board'].'\' AND board_pwd = \'\'';
if(!empty(
$account['users_id'])) {
  
$cond   .= ' AND thr.threads_last_time > \'' $cs_readtime '\' AND (thr.threads_last_time > red.read_since OR red.threads_id IS NULL)';
}
$order   'thr.threads_last_time DESC'
$data['threads'] = cs_sql_select(__FILE__,$tables,$cells,$cond,$order,0,8);

if(empty(
$data['threads'])) {
    echo 
$cs_lang['no_new_posts'];
}
else {
  
$count_threads count($data['threads']);
  
  for (
$run 0$run $count_threads$run++) {
    
$data['threads'][$run]['threads_date'] = cs_date('unix',$data['threads'][$run]['threads_last_time'],1);
    
$data['threads'][$run]['threads_headline'] = cs_secure($data['threads'][$run]['threads_headline']);
    
$data['threads'][$run]['threads_headline_short'] = strlen($data['threads'][$run]['threads_headline']) <= $figures ?
      
$data['threads'][$run]['threads_headline'] : substr($data['threads'][$run]['threads_headline'],0,$figures-2) . '..';
  }
  echo 
cs_subtemplate(__FILE__,$data,'board','navlist');
}

?>
Neuer Code Neuer Code +-
 
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 2007 - www.clansphere.net
// $Id: navlist.php 143 2006-08-01 05:05:45Z hajo $

$cs_lang cs_translate('board');

$data = array();
$figures 20;

$tables  'threads thr INNER JOIN {pre}_board frm ON frm.board_id = thr.board_id ';
$tables .= 'LEFT JOIN {pre}_read red ON thr.threads_id = red.threads_id AND red.users_id = \''.$account['users_id'].'\'';
$cells   'thr.threads_headline AS threads_headline, thr.threads_id AS threads_id, ';
$cells  .= 'thr.threads_last_time AS threads_last_time';
$cond    'frm.board_access <= \''.$account['access_board'].'\' AND board_pwd = \'\'';
if(!empty(
$account['users_id'])) {

}
$order   'thr.threads_last_time DESC'
$data['threads'] = cs_sql_select(__FILE__,$tables,$cells,$cond,$order,0,8);

if(empty(
$data['threads'])) {
    echo 
$cs_lang['no_new_posts'];
}
else {
  
$count_threads count($data['threads']);
  
  for (
$run 0$run $count_threads$run++) {
    
$data['threads'][$run]['threads_date'] = cs_date('unix',$data['threads'][$run]['threads_last_time'],1);
    
$data['threads'][$run]['threads_headline'] = cs_secure($data['threads'][$run]['threads_headline']);
    
$data['threads'][$run]['threads_headline_short'] = strlen($data['threads'][$run]['threads_headline']) <= $figures ?
    
$data['threads'][$run]['threads_headline'] : substr($data['threads'][$run]['threads_headline'],0,$figures-2) . '..';
  }
  echo 
cs_subtemplate(__FILE__,$data,'board','navlist');
}

?>
Zurück - Übersicht

Kommentare: 8
Seite [1]
bantami

14.08.2008

Ort: -
Beiträge: 12
# 1 - 01.12.2007 um 09:16 Uhr

Find ich supi !
Zu erwähnen wäre noch, das man in Zeile 24

 
1.
1. / 2. / ... 
<?php $data['threads'] = cs_sql_select(__FILE__,$tables,$cells,$cond,$order,0,8); ?>


bei der letzen Ziffer (hier die 8) die Anzahl der Topics ändern kann, die sichtbar sein sollen.
Mahoo

03.09.2009

Ort: -
Beiträge: 319
# 2 - 02.12.2007 um 10:56 Uhr

Cool!! Kann man das dann auch gleich sehen welches von denen der neue Beitrag ist? z.B. nem Zeichen oder Dicke Schrift?
bantami

14.08.2008

Ort: -
Beiträge: 12
# 3 - 03.12.2007 um 10:39 Uhr

Der neuste Beitrag steht immer oben
Fredd<y

13.12.2009

Ort: -
Beiträge: 901
# 4 - 03.12.2007 um 14:32 Uhr

kommt natürlich drauf an, was das für ne seite ist! Wenn da net viel gepostet wird dann ist der codepaste hilfreich, wenn aber viel gepostet wird, dann net
Mahoo

03.09.2009

Ort: -
Beiträge: 319
# 5 - 03.12.2007 um 14:53 Uhr

Genau das sehe ich auch so!!
LesK

09.02.2008

Ort: -
Beiträge: 24
# 6 - 03.01.2008 um 14:46 Uhr

Super vielen Danke, genau das wollte ich grade auch schon verändern
simone

18.07.2008

Ort: -
Beiträge: 34
# 7 - 20.02.2008 um 14:08 Uhr

Geneu das was ich brauche!

Danke sehr!

ev0lution

29.06.2022

Ort: -
Beiträge: 1137
# 8 - 05.11.2011 um 01:38 Uhr

für 2011.1.X

alt

 
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.
38.
39.
40.
41.
42.
43.
44.
1. / 2. / ... 
<?php
// ClanSphere 2010 - www.clansphere.net
// $Id$

$cs_lang cs_translate('board');
$cs_get cs_get('catid');
$cs_option cs_sql_option(__FILE__,'board');
require_once 
'mods/board/functions.php';

$cs_usertime cs_sql_select(__FILE__,'users','users_readtime',"users_id = '" $account["users_id"] . "'");
$cs_readtime cs_time() - $cs_usertime['users_readtime'];

$data = array();

$tables  'threads thr INNER JOIN {pre}_board frm ON frm.board_id = thr.board_id ';
$tables .= 'LEFT JOIN {pre}_read red ON thr.threads_id = red.threads_id AND red.users_id = \''.$account['users_id'].'\'';
$cells   'thr.threads_headline AS threads_headline, thr.threads_id AS threads_id, ';
$cells  .= 'thr.threads_last_time AS threads_last_time, frm.board_name AS board_name, frm.board_id AS board_id';
$cond    'thr.threads_ghost = 0 AND frm.board_access <= \''.$account['access_board'].'\' AND frm.board_pwd = \'\'';
if(!empty(
$account['users_id'])) {
  
$cond   .= ' AND thr.threads_last_time > \'' $cs_readtime '\' AND (thr.threads_last_time > red.read_since OR red.threads_id IS NULL)';
}
if(!empty(
$cs_get['catid'])) {
  
$cond .= ' AND frm.categories_id = ' $cs_get['catid'];
}
$order   'thr.threads_last_time DESC'
$data['threads'] = cs_sql_select(__FILE__,$tables,$cells,$cond,$order,0,$cs_option['max_navlist']);

if(empty(
$data['threads'])) {
  echo 
$cs_lang['no_new_posts'];
}
else {
  
$count_threads count($data['threads']);
  
  for (
$run 0$run $count_threads$run++) {
    
$data['threads'][$run]['threads_date'] = cs_date('unix',$data['threads'][$run]['threads_last_time'],1);
    
$data['threads'][$run]['threads_headline_short'] = strlen($data['threads'][$run]['threads_headline']) <= $cs_option['max_headline'] ? $data['threads'][$run]['threads_headline'] : cs_substr($data['threads'][$run]['threads_headline'],0,$cs_option['max_headline']-2) . '..';
    
$data['threads'][$run]['threads_headline_short'] = cs_secure($data['threads'][$run]['threads_headline_short']);
    
$data['threads'][$run]['threads_headline'] = cs_secure($data['threads'][$run]['threads_headline']);
    
$data['threads'][$run]['new_posts'] = last_comment($data['threads'][$run]['threads_id'], $account["users_id"], $account['users_limit']);
  }
  echo 
cs_subtemplate(__FILE__,$data,'board','navlist');
}


neu

 
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 2010 - www.clansphere.net
// $Id$

$cs_lang cs_translate('board');
$cs_get cs_get('catid');
$cs_option cs_sql_option(__FILE__,'board');
require_once 
'mods/board/functions.php';

$data = array();

$tables  'threads thr INNER JOIN {pre}_board frm ON frm.board_id = thr.board_id ';
$tables .= 'LEFT JOIN {pre}_read red ON thr.threads_id = red.threads_id AND red.users_id = \''.$account['users_id'].'\'';
$cells   'thr.threads_headline AS threads_headline, thr.threads_id AS threads_id, ';
$cells  .= 'thr.threads_last_time AS threads_last_time, frm.board_name AS board_name, frm.board_id AS board_id';
$cond    'thr.threads_ghost = 0 AND frm.board_access <= \''.$account['access_board'].'\' AND frm.board_pwd = \'\'';
if(!empty(
$account['users_id'])) {
}
$order   'thr.threads_last_time DESC'
$data['threads'] = cs_sql_select(__FILE__,$tables,$cells,$cond,$order,0,$cs_option['max_navlist']);

if(empty(
$data['threads'])) {
  echo 
$cs_lang['no_new_posts'];
}
else {
  
$count_threads count($data['threads']);
  
  for (
$run 0$run $count_threads$run++) {
    
$data['threads'][$run]['threads_date'] = cs_date('unix',$data['threads'][$run]['threads_last_time'],1);
    
$data['threads'][$run]['threads_headline_short'] = strlen($data['threads'][$run]['threads_headline']) <= $cs_option['max_headline'] ? $data['threads'][$run]['threads_headline'] : cs_substr($data['threads'][$run]['threads_headline'],0,$cs_option['max_headline']-2) . '..';
    
$data['threads'][$run]['threads_headline_short'] = cs_secure($data['threads'][$run]['threads_headline_short']);
    
$data['threads'][$run]['threads_headline'] = cs_secure($data['threads'][$run]['threads_headline']);
    
$data['threads'][$run]['new_posts'] = last_comment($data['threads'][$run]['threads_id'], $account["users_id"], $account['users_limit']);
  }
  echo 
cs_subtemplate(__FILE__,$data,'board','navlist');
}


Bitte Login benutzen, um Kommentare zu schreiben.