Utolsó hozzászólás - téma megjelenítése a főoldalon
Szerző
Üzenet
Olyan MOD kellene amelynek segítségével a főoldalon látszódna hogy az utolsó hozzászólás pontosan melyik témában történt.
Sziasztok!
Kipróbáltam ezt a modot:
, nagyon jó, nagyon tetszik, egy kis változtatásban kérném a segítséget:
A fórumom zárt, csak bejelentkezés után látszanak a témák, ezért a mod is csak a bejelentkezés után látszik, viszont azt szeretném hogy bejelentkezés nélkül is működne. Átbogarásztam a hivatalos topikot, de nem találtam erre vonatkozó megoldást.
Íme az index.php-hez tartozó kódja, ha jól látom valahol itt lesz a trükk:
Előre is köszi!
Kipróbáltam ezt a modot:
Marcee írta:
A fórumom zárt, csak bejelentkezés után látszanak a témák, ezért a mod is csak a bejelentkezés után látszik, viszont azt szeretném hogy bejelentkezés nélkül is működne. Átbogarásztam a hivatalos topikot, de nem találtam erre vonatkozó megoldást.
Íme az index.php-hez tartozó kódja, ha jól látom valahol itt lesz a trükk:
Kód:
#-----[ OPEN ]-----
#
index.php
#
#-----[ FIND ]-----
#
//
// Start output of page
//
#
#-----[ BEFORE, ADD ]-----
#
//BEGIN-MOD:Last post info
// Get Viewable Forums - made by zparta
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
{
$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 . ')');
}
$sql = "SELECT p.post_id, p.post_username, pt.post_subject, p.post_time, u.user_id, u.username, t.topic_title
FROM " . POSTS_TABLE . " p, " . USERS_TABLE . " u, " . POSTS_TEXT_TABLE . " pt, " . TOPICS_TABLE . " t
WHERE p.forum_id IN " . $auth_view_forum_sql . " AND p.poster_id = u.user_id
AND pt.post_id = p.post_id AND t.topic_id = p.topic_id
ORDER BY p.post_time DESC LIMIT 1";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not query last post informations', '', __LINE__, __FILE__, $sql);
}
if ($row = $db->sql_fetchrowset($result))
{
$db->sql_freeresult($result);
$append_sid = ( !empty($SID) && !preg_match('#sid=#', $url) ) ? $SID . '&' : '';
if ($row[0]['user_id']>-1)
{
$last_post_info = sprintf($lang['last_post_info'], '<a href="profile.'.$phpEx.'?'.$append_sid.'mode=viewprofile&' . POST_USERS_URL . '=' . $row[0]['user_id'] . '">', $row[0]['username'], '</a>', create_date($board_config['default_dateformat'], $row[0]['post_time'], $board_config['board_timezone']), '<a href="viewtopic.'.$phpEx.'?'.$append_sid. POST_POST_URL . '=' . $row[0]['post_id'] . '#' . $row[0]['post_id'] . '">', ( (empty($row[0]['post_subject'])) ? 'Re: ' . $row[0]['topic_title'] : $row[0]['post_subject'] ), '</a>');
}
else
{
$last_post_info = sprintf($lang['last_post_info'], '', ( (empty($row[0]['post_username'])) ? $row[0]['username'] : $row[0]['post_username'] ), '', create_date($board_config['default_dateformat'], $row[0]['post_time'], $board_config['board_timezone']), '<a href="viewtopic.'.$phpEx.'?'.$append_sid . POST_POST_URL . '=' . $row[0]['post_id'] . '#' . $row[0]['post_id'] . '">', ( (empty($row[0]['post_subject'])) ? 'Re: ' . $row[0]['topic_title'] : $row[0]['post_subject'] ), '</a>');
}
}
else
{
$last_post_info = '';
}
//END-MOD:Last post info
#
Előre is köszi!
Az
sort (kb. 290. sor) módosítsd erre:
Kód:
if ( $is_auth_ary[$forum_data[$j]['forum_id']]['auth_view'] && $forum_data[$j]['cat_id'] == $cat_id )
Kód:
if ( $forum_data[$j]['cat_id'] == $cat_id )
Nem készíthetsz új témákat ebben a fórumban.
Nem válaszolhatsz egy témára ebben a fórumban.
Nem módosíthatod a hozzászólásaidat a fórumban.
Nem törölheted a hozzászólásaidat a fórumban.
Nem szavazhatsz ebben fórumban.
Nem válaszolhatsz egy témára ebben a fórumban.
Nem módosíthatod a hozzászólásaidat a fórumban.
Nem törölheted a hozzászólásaidat a fórumban.
Nem szavazhatsz ebben fórumban.