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

Antworten: 2
Seite [1]
wendel


Beginner




Beiträge: 1
# Thema - 25.03.2012 um 14:31 Uhr
Hello,

Hope you all ok

At the moment we have a forum navlist box on our website www.houseofconkers.eu (FRESH ON FORUM in top right) It shows if there are any new posts on the forum. If there aren't any, the box is empty. Is there any way to make this box show most recent threads even if they have been read ?

Thank you

Kind Regards

Wendel
www.houseofconkers.eu


Zuletzt editiert von wendel am 25.03.2012 um 14:32 Uhr (1x Editiert)
Inaktiv
Koffein


Going for pro




Beiträge: 536
# Antwort: 1 - 25.03.2012 um 14:38 Uhr
Hey, yes there is.
Jam2 made some code its posted by the codepaste here:
http://csphere.eu/downloads/codepaste/view/id/151

Maybe its easier for you if i tell you what to do:
Create a new data /mods/board/latesttopic.php
put this code in it:
mehr... +-
 
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.
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';
$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    'frm.board_access <= \''.$account['access_board'].'\' AND frm.board_pwd = \'\'';

if(!empty(
$cs_get['catid'])) {
  
$cond .= ' AND frm.categories_id = ' $cs_get['catid'];
}
$order   'thr.threads_id 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');
}


Than open this file /mods/board/access.php and add a new line:
 
1.
1. / 2. / ... 
 $axx_file['latesttopic']       = 0;


Then you can implement it in your index.htm with the following: {board:latesttopic}
Clear your clansphere cache at your homepage and it should work
You can choose an other name for latesttopic its just an example.


Inaktiv
|
wendel
Thread-Ersteller


Beginner




Beiträge: 1
# Antwort: 2 - 25.03.2012 um 17:25 Uhr
Thank you Koffein,

That was a really fast reply I've done that and everything is working fine but is there any modification that makes old topics with new posts to jump up in that list? It seems to be only displaying latest topics by date of creation not by date of last post

Also, is there a way of chaning colour/adding some 'new' icon to the topics on the list that have new posts since last visit?

Thank you in advance

Kind Regards

Wendel
www.houseofconkers.eu


Inaktiv
|
Antworten: 2
Seite [1]


Sie müssen sich registrieren, um zu antworten.


ClanSphere Project - Mailus - Imprint - Disclaimer - Scriptinfo