|
|
phpBB2 by Przemo
Support forów phpBB2 modified by Przemo
|
|
Przesunięty przez: Boltex 01-11-2013, 23:22 |
Latest active topics on index |
Autor |
Wiadomość |
Matti123
Pomógł: 12 razy Posty: 324
|
Wysłany: 18-03-2007, 11:58 Latest active topics on index
|
|
|
Kod: | ##############################################################
## MOD Title: Latest active topics on index
## MOD Author: zparta < zparta@upnorth.se > (Jens Holmqvist) http://www.upnorth.se
## MOD Adapted, translated, modyfied by: Matti http://www.eMuza.biz
## MOD Description: Pokazuje ostatnie aktywne tematy w index.php możliwość zarządzania w ACP
## MOD Version: 1.1.4
##
## Installation Level: Easy
## Installation Time: ~5 Minutes
## Files To Edit: index.php,
templates/subSilver/index_body.tpl,
language/lang_polish/lang_main.php,
language/lang_polish/lang_admin.php,
admin/admin_board.php,
templates/subSilver/admin/board_config_body.tpl
## Included Files: n/a
##############################################################
## Przed instalacją modyfikacji upewnij się że zrobiłeś kopię zapasową plików
############################################################## |
Demo: KLIK
#
#-----[ SQL ]------------------------------------------
#
Kod: | INSERT INTO phpbb_config ( config_name, config_value ) VALUES ('topics_on_index', '10');
|
#
#-----[ OTWÓRZ ]------------------------------------------
#
language/lang_polish/lang_main.php
#
#-----[ ZNAJDŹ ]------------------------------------------
#
Kod: | //
// That's all Folks!
// ------------------------------------------------- |
#
#-----[ DODAJ PO ]------------------------------------------
#
Kod: | $lang['marquee_topic'] = 'Ostatnie %s aktywnych tematów'; |
#
#-----[ OPEN ]------------------------------------------
#
language/lang_polish/lang_admin.php
#
#-----[ ZNAJDŹ ]------------------------------------------
#
Kod: | //
// That's all Folks!
// -------------------------------------------------
|
#
#-----[ DODAJ PO ]------------------------------------------
#
Kod: | $lang['Topics_on_index'] = 'Ile tematów pokazywać ?'; |
#
#-----[ OTWÓRZ ]------------------------------------------
#
admin/admin_board.php
#
#-----[ ZNAJDŹ ]------------------------------------------
#
Kod: | 'L_ANONYMOUS_SIMPLE_E' => $lang['anonymous_simple_e'] |
#
#-----[ DODAJ PO ]------------------------------------------
#
Kod: | 'L_TOPICS_ON_INDEX' => $lang['Topics_on_index'], |
#
#-----[ ZNAJDŹ ]------------------------------------------
#
Kod: | 'DAY_TO_PRUNE' => $new['day_to_prune'], |
#
#-----[ DODAJ PO ]------------------------------------------
#
Kod: | 'TOPICS_ON_INDEX' => $new['topics_on_index'], |
#
#-----[ OTWÓRZ ]------------------------------------------
#
index.php
#
#-----[ ZNAJDŹ ]------------------------------------------
#
Kod: | //
// Start output of page
//
|
#
#-----[ DODAJ PRZED ]------------------------------------------
#
Kod: | //
// Obtain new post information for marquee
// of new posts
//
//
// Get Viewable Forums
//
if ( function_exists('get_auth_keys') ) {
$keys = array();
$keys = get_auth_keys('Root');
$auth_view_forum_sql = '';
for ($i=0; $i < count($keys['id']); $i++)
{
if ($tree['type'][ $keys['idx'][$i] ] == POST_FORUM_URL)
{
$auth_view_forum_sql .= (($auth_view_forum_sql != '') ? ', ' : '') . $tree['id'][ $keys['idx'][$i] ];
}
}
$auth_view_forum_sql = ($auth_view_forum_sql == '' ? '(0)' : '(' . $auth_view_forum_sql . ')');
}
else
{
$is_auth_ary = array();
$is_auth_ary = auth(AUTH_READ, AUTH_LIST_ALL, $userdata, $forum_data);
$auth_view_forum_sql = '';
for($i = 0; $i < $total_categories; $i++)
{
$cat_id = $category_rows[$i]['cat_id'];
$display_forums = false;
for($j = 0; $j < $total_forums; $j++)
{
if ( $is_auth_ary[$forum_data[$j]['forum_id']]['auth_view'] && $forum_data[$j]['cat_id'] == $cat_id )
{
$display_forums = true;
$auth_view_forum_sql .= ($auth_view_forum_sql == '' ? '' : ', ' ) . $forum_data[$j]['forum_id'];
}
}
}
$auth_view_forum_sql = ($auth_view_forum_sql == '' ? '(0)' : '(' . $auth_view_forum_sql . ')');
}
//
// Get The Data
//
$template->assign_vars(array(
'MARQUEE_TOPIC' => str_replace("%s",$board_config['topics_on_index'],$lang['marquee_topic']) )
);
$sql = "SELECT t.topic_id, t.topic_title, t.topic_last_post_id, t.forum_id, t.topic_type, t.topic_status, p.post_id, p.poster_id,
p.post_time, u.user_id, u.username, u.user_lastvisit
FROM " . TOPICS_TABLE . " t, " . FORUMS_TABLE . " f, " . POSTS_TABLE . " p, " . USERS_TABLE . " u
WHERE t.forum_id IN " . $auth_view_forum_sql . " AND t.topic_id = p.topic_id
AND f.forum_id = t.forum_id
AND t.topic_status <> 2
AND p.post_id = t.topic_last_post_id
AND p.poster_id = u.user_id
ORDER BY t.topic_last_post_id DESC";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not query recent posts marquee information', '', __LINE__, __FILE__, $sql);
}
if ($row = $db->sql_fetchrowset($result))
{
$db->sql_freeresult($result);
}
if( count($row) <= $board_config['topics_on_index'] )
{
$topics = count($row);
}
else
{
$topics = $board_config['topics_on_index'];
}
for($i = 0; $i < $topics; $i++)
{
$mar_title = $row[$i]["topic_title"];
$mar_url = $phpbb_root_path . 'viewtopic.'.$phpEx.'?t='.$row[$i]["topic_id"];
$mar_user = $row[$i]["username"];
if ( $row[$i]["topic_status"] == TOPIC_LOCKED )
{
if ( $row[$i]["post_time"] > $row[$i]["user_lastvisit"] )
{
$pic = $images['folder_locked_new'];
}
else
{
$pic = $images['folder_locked'];
}
}
else
{
if ( $row[$i]["topic_type"] == POST_GLOBAL_ANNOUNCE )
{
if ( $row[$i]["post_time"] > $row[$i]["user_lastvisit"] )
{
$pic = $images['folder_global_announce_new'];
}
else
{
$pic = $images['folder_global_announce'];
}
}
else if ( $row[$i]["topic_type"] == POST_ANNOUNCE )
{
if ( $row[$i]["post_time"] > $row[$i]["user_lastvisit"] )
{
$pic = $images['folder_announce_new'];
}
else
{
$pic = $images['folder_announce'];
}
}
else if ( $row[$i]["topic_type"] == POST_STICKY )
{
if ( $row[$i]["post_time"] > $row[$i]["user_lastvisit"] )
{
$pic = $images['folder_sticky_new'];
}
else
{
$pic = $images['folder_sticky'];
}
}
else { if ( $row[$i]["post_time"] > $userdata['user_lastvisit'] )
{
$pic = $images['folder_new']; }else{ $pic = $images['folder'];
}
}
}
$template->assign_block_vars('marqueerow', array(
'FOLD_URL' => $pic,
'TOPIC_TITLE' => $row[$i]["topic_title"],
'TOPIC_URL' => append_sid($phpbb_root_path . 'viewtopic.'.$phpEx.'?t='.$row[$i]["topic_id"]),
'USERNAME' => $row[$i]["username"],
'USER_PROF' => append_sid($phpbb_root_path . 'profile.'.$phpEx.'?mode=viewprofile&u='.$row[$i]["user_id"]),
'POST_DATE' => create_date($board_config['default_dateformat'], $row[$i]["post_time"], $board_config['board_timezone']))
);
}
|
#
#-----[ OTWÓRZ ]------------------------------------------
#
templates/subSilver/index_body.tpl
#
#-----[ ZNAJDŹ ]------------------------------------------
#
Kod: | <!-- END switch_user_logged_out -->
|
#
#-----[ DODAJ PO ]------------------------------------------
#
Kod: | <table width="100%" cellpadding="3" cellspacing="1" border="0" class="forumline" height="100%">
<tr>
<td class="catHead" height="28"><a name="login"></a><span class="cattitle">{MARQUEE_TOPIC}</span></td>
</tr>
<tr>
<td class="row1" valign="top"><span class="gen">
<marquee id="recent_topics" behavior="scroll" direction="up" height="100" scrolldelay="100" scrollamount="2">
<table cellpadding="4" cellSpacing="1" width="100%">
<!-- BEGIN marqueerow -->
<tr valign="top">
<td class="row2" vAlign="center" align="middle" width="20">
<img src="{marqueerow.FOLD_URL}">
</td>
<td class="row2" width="352">
<span class="forumlink"><a href="{marqueerow.TOPIC_URL}" onMouseOver="document.all.recent_topics.stop()" onMouseOut="document.all.recent_topics.start()">{marqueerow.TOPIC_TITLE}</a></span>
<span class="gensmall"><br></span>
</td>
<td class="row2" vAlign="center" align="middle" width="78">
<span class="gensmall"><a href="{marqueerow.USER_PROF}" onMouseOver="document.all.recent_topics.stop()" onMouseOut="document.all.recent_topics.start()">{marqueerow.USERNAME}</a></span>
</td>
<td class="row2" vAlign="center" noWrap align="middle" width="100">
<span class="gensmall">{marqueerow.POST_DATE}</span>
</td>
</tr>
<!-- END marqueerow -->
</table>
</marquee>
</td>
</tr>
</table> |
#
#-----[ OTWÓRZ ]------------------------------------------
#
templates/subSilver/admin/board_config_body.tpl
#
#-----[ ZNAJDŹ ]------------------------------------------
#
Kod: | <tr>
<td class="row1">{L_DEFAULT_STYLE}</td>
<td class="row2" width="50%">{STYLE_SELECT}</td>
</tr> |
#
#-----[ DODAJ PO ]------------------------------------------
#
Kod: | <tr>
<td class="row1">{L_TOPICS_ON_INDEX}</td>
<td class="row2"><input class="post" type="text" name="topics_on_index" size="3" maxlength="2" value="{TOPICS_ON_INDEX}" /></td>
</tr> |
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM |
|
|
|
|
Gadatliwa Kasia
|
|
|
|
|
Nie możesz pisać nowych tematów Nie możesz odpowiadać w tematach Nie możesz zmieniać swoich postów Nie możesz usuwać swoich postów Nie możesz głosować w ankietach Nie możesz załączać plików na tym forum Możesz ściągać załączniki na tym forum
|
Dodaj temat do Ulubionych Wersja do druku
|
Kopiowanie wszelkich treści zawartych na forum, modyfikacji oraz instrukcji bez zgody administracji i autorów tematów/postów zabronione!
Powered by phpBB modified by Przemo © 2003 phpBB
| Strona wygenerowana w 0,09 sekundy. Zapytań do SQL: 12 | |
|
|