[MOD] Easy Sub Forum / Kolay Alt Forum
#
#-----[ ÖNCESİNE EKLE ]------------------------------------------
#
// Added by Easy Sub-Forums MOD
if ($forum_row[attached_forum_id]>0)
{
$parent_lookup=$forum_row[attached_forum_id];
}
// END Added by Easy Sub-Forums MOD
#
#-----[ BUL ]------------------------------------------------
#
//
// Okay, lets dump out the page ...
//
#
#-----[ ARDINA EKLE ]------------------------------------------
#
// Added by Easy Sub-Forums MOD
if ($attachments)
{
//
// Obtain a list of topic ids which contain
// posts made since user last visited
//
if ( $userdata['session_logged_in'] )
{
$sql = "SELECT t.forum_id, t.topic_id, p.post_time
FROM " . TOPICS_TABLE . " t, " . POSTS_TABLE . " p
WHERE p.post_id = t.topic_last_post_id
AND p.post_time > " . $userdata['user_lastvisit'] . "
AND t.topic_moved_id = 0";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not query new topic information', '', __LINE__, __FILE__, $sql);
}
$new_topic_data = array();
while( $topic_data = $db->sql_fetchrow($result) )
{
$new_topic_data[$topic_data['forum_id']][$topic_data['topic_id']] = $topic_data['post_time'];
}
}
$sql2 = "SELECT f.*, p.post_time, p.post_username, u.username, u.user_id, t.topic_id, t.topic_title
FROM ((( " . FORUMS_TABLE . " f
LEFT JOIN " . POSTS_TABLE . " p ON p.post_id = f.forum_last_post_id )
LEFT JOIN " . USERS_TABLE . " u ON u.user_id = p.poster_id )
LEFT JOIN " . TOPICS_TABLE . " t ON t.topic_last_post_id = f.forum_last_post_id)
WHERE attached_forum_id = " . $forum_id . "
GROUP by f.forum_id ORDER BY f.forum_order";
$result2 = $db->sql_query ($sql2);
if (!$result2 )
{
message_die ('Could not gather attached forum info', __LINE__, __FILE__, $sql2);
}
if ($db->sql_numrows ($result2) != 0)
{
while( $row = $db->sql_fetchrow($result2) )
{
$forum_data[] = $row;
}
$is_auth_ary = auth(AUTH_VIEW, AUTH_LIST_ALL, $userdata, $forum_data);
$x=0;
foreach ($forum_data as $row2 => $value)
{
if ($is_auth_ary[$value['forum_id']]['auth_view'])
{
$x++;
if ($x==1)
{
$template->assign_block_vars ('switch_attached_list',
array( 'L_ATTACHED_FORUM' => $lang['Attached_forums'],
'L_ATTACHED_TOPICS' => $lang['Topics'],
'L_ATTACHED_POSTS' => $lang['Posts'],
'L_LAST_POST'=>$lang['Last_Post']
)
);
}
$attach_forum_link = append_sid('forum-.html' . $value['forum_id']);
$attach_forum_name = '<a href="' . append_sid('forum-.html' . $value['forum_id']) . '">' . $value['forum_name'] . '</a>' ;
$attach_forum_desc = $value['forum_desc'];
$attach_forum_topics = $value['forum_topics'];
$attach_forum_posts = $value['forum_posts'];
$last_post_id = $value['forum_last_post_id'];
if ( $value['forum_status'] == FORUM_LOCKED )
{
$folder_image = $images['forum_locked'];
$folder_alt = $lang['Forum_locked'];
}
else
{
$unread_topics = false;
if ( $userdata['session_logged_in'] )
{
$unread_topics=check_unread($value['forum_id']);
}
$folder_image = ( $unread_topics ) ? $images['forum_new'] : $images['forum'];
$folder_alt = ( $unread_topics ) ? $lang['New_posts'] : $lang['No_new_posts'];
}
if ( $value['forum_last_post_id'] )
{
if (strlen($value['topic_title'])>=25)
{
$value['topic_title']=substr($value['topic_title'],0,25). "...";
}
$last_post_time = create_date($board_config['default_dateformat'], $value['post_time'], $board_config['board_timezone']);
$last_post = '' . $last_post_time . '' . '<br />';
$last_post .= ( $value['user_id'] == ANONYMOUS ) ? ( ($value['post_username'] != '' ) ? $value['post_username'] . ' ' : $lang['Guest'] . ' ' ) : '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . '=' . $value['user_id']) . '">' . $value['username'] . '</a> <a href="' . append_sid("viewtopic.$phpEx?" . POST_POST_URL . '=' . $value['forum_last_post_id']) . '#' . $value['forum_last_post_id'] . '"><img src="' . $images['icon_latest_reply'] . '" border="0" alt="' . $lang['View_latest_post'] . '" title="' . $lang['View_latest_post'] . '" /></a>';
}
else
{
$last_post = $lang['No_Posts'];
}
$template->assign_block_vars ('switch_attached_list.switch_attached_present',
array
(
'FORUM_FOLDER_IMG' => $folder_image,
'L_FORUM_FOLDER_ALT' => $folder_alt,
'FORUM_NAME' => $attach_forum_name,
'U_VIEWFORUM' => $attach_forum_link,
'FORUM_DESC' => $attach_forum_desc,
'TOPICS' => $attach_forum_topics,
'POSTS' => $attach_forum_posts,
'LAST_POST_ID' => $last_post,
));
}
}
}
$db->sql_freeresult ($result2);
}
// END Added by Easy Sub-Forums MOD
#
#-----[ AÇ ]------------------------------------------------
#
viewtopic.php
#
#-----[ BUL ]------------------------------------------
#
$sql = "SELECT t.topic_id, t.topic_title, t.topic_status, t.topic_replies, t.topic_time, t.topic_type, t.topic_vote, t.topic_last_post_id, f.forum_name, f.forum_status, f.forum_id, f.auth_view, f.auth_read, f.auth_post, f.auth_reply, f.auth_edit, f.auth_delete, f.auth_sticky, f.auth_announce, f.auth_pollcreate, f.auth_vote, f.auth_attachments" . $count_sql . "
#
#-----[ YOL İÇNDE BUL ]---------------------------------
#
" . $count_sql . "
#
#-----[ ÖNCESİNE EKLE ]------------------------------------------
#
, f.attached_forum_id
#
#-----[ BUL ]------------------------------------------------
#
make_jumpbox('viewforum.'.$phpEx, $forum_id);
#
#-----[ ÖNCESİNE EKLE ]------------------------------------------
#
if (intval($forum_topic_data['attached_forum_id'])>0)
{
$parent_lookup=intval($forum_topic_data['attached_forum_id']);
}
#
#-----[ AÇ ]------------------------------------------------
#
posting.php
#
#-----[ BUL ]------------------------------------------------
#
make_jumpbox('viewforum.'.$phpEx);
#
#-----[ ÖNCESİNE EKLE ]------------------------------------------
#
if ($post_info[attached_forum_id]>0)
{
$parent_lookup=$post_info[attached_forum_id];
}
#
#-----[ AÇ ]------------------------------------------------
#
NOT; ŞU AN TEMA KISMINA GEÇİŞ YAPILMIŞTIR LÜTFEN KENDİ TEMANIZIN İÇİNE GİRİNİZ. BAZI TEMALARDA BULMANIZ GEREKEN KODLAR FARKLI OLABİLİR LÜTFEM DİKKATLİ OLUNUZ
/templates/subSilver/admin/forum_admin_body.tpl
#
#-----[ BUL ]------------------------------------------------
#
<td class="row2"><span class="gen"><a href="{catrow.forumrow.U_VIEWFORUM}" target="_new">{catrow.forumrow.FORUM_NAME}</a></span><br /><span class="gensmall">{catrow.forumrow.FORUM_DESC}</span></td>
#
#-----[ DEĞİŞTİR ]------------------------------------------
#
<td class="row2"><span class="gen">
<!-- BEGIN switch_attached_forum -->
|__
<!-- END switch_attached_forum -->
<!-- BEGIN switch_error -->
ERROR
<!-- END switch_error -->
<a href="{catrow.forumrow.U_VIEWFORUM}" target="_new">{catrow.forumrow.FORUM_NAME}</a></span><br />
<span class="gensmall">
<!-- BEGIN switch_attached_forum -->
<!-- END switch_attached_forum -->
{catrow.forumrow.FORUM_DESC}</span></td>
#
#-----[ AÇ ]------------------------------------------------
#
/templates/subSilver/admin/forum_edit_body.tpl
#
#-----[ BUL ]------------------------------------------------
#
<tr>
<td class="row1">{L_CATEGORY}</td>
<td class="row2"><select name="c">{S_CAT_LIST}</select></td>
</tr>
#
#-----[ ARDINA EKLE ]------------------------------------------
#
<tr>
<td class="row1">{L_ATTACHED_FORUM}</td>
<td class="row2">
<!-- BEGIN switch_attached_yes -->
<select name="attached_forum_id">{S_ATTACHED_FORUM_ID}</select>
<!-- END switch_attached_yes -->
<!-- BEGIN switch_attached_no -->
{L_DETACH_DESC} <input type="checkbox" name="detach_enabled" value="1" {S_DETACH_ENABLED} /><br />
<!-- END switch_attached_no -->
{L_ATTACHED_DESC}
</td>
</tr>
#
#-----[ AÇ ]------------------------------------------------
#
/templates/subSilver/index_body.tpl
#
#-----[ BUL ]------------------------------------------------
#
</span><span class="gensmall">{catrow.forumrow.L_MODERATOR} {catrow.forumrow.MODERATORS}</span></td>
#
#-----[ BUNUNLA DEĞİŞTİR ]------------------------------------------------
#
</span><span class="gensmall">{catrow.forumrow.L_MODERATOR} {catrow.forumrow.MODERATORS}</span>
<!-- BEGIN switch_attached_forums -->
<!-- BEGIN br -->
<br />
<!-- END br -->
<span class="gensmall"><b>{catrow.forumrow.switch_attach ed_forums.L_ATTACHED_FORUMS}:</b>
<!-- BEGIN attached_forums -->
<a class="nav" href="{catrow.forumrow.switch_attached_forums.atta ched_forums.U_VIEWFORUM}"><img alt="{catrow.forumrow.switch_attached_forums.attac hed_forums.L_FORUM_IMAGE}" border="0" src="{catrow.forumrow.switch_attached_forums.attac hed_forums.FORUM_IMAGE}" title="{catrow.forumrow.switch_attached_forums.att ached_forums.L_FORUM_IMAGE}" />{catrow.forumrow.switch_attached_forums.attache d_ forums.FORUM_NAME}</a>
<!-- END attached_forums -->
<span class="genmed">
<!-- END switch_attached_forums -->
</td>
#
#-----[ AÇ ]------------------------------------------------
#
/templates/subSilver/viewforum_body.tpl
#
#-----[ BUL ]------------------------------------------------
#
<td align="left" valign="middle" class="nav" width="100%"><span class="nav"> <a href="{U_INDEX}" class="nav">{L_INDEX}</a> -> <a class="nav" href="{U_VIEW_FORUM}">{FORUM_NAME}</a></span></td>
#
#-----[ BUNUNLA DEĞİŞTİR ]------------------------------------------------
#
<td align="left" valign="middle" class="nav" width="100%"><span class="nav"> <a href="{U_INDEX}" class="nav">{L_INDEX}</a>
<!-- BEGIN switch_parent_link -->
-> <a class="nav" href="{PARENT_URL}">{PARENT_NAME}</a>
<!-- END switch_parent_link -->
-> <a class="nav" href="{U_VIEW_FORUM}">{FORUM_NAME}</a></span></td>
#
#-----[ BUL ]------------------------------------------------
#
<table border="0" cellpadding="4" cellspacing="1" width="100%" class="forumline">
#
#-----[ ÖNCESİNE EKLE ]-----------------------------------------
#
<!-- BEGIN switch_attached_list -->
<br />
<table width="100%" cellpadding="2" cellspacing="1" border="0" class="forumline">
<tr>
<th colspan="2" class="thCornerL" height="15" nowrap="nowrap"> {switch_attached_list.L_ATTA CHED_FORUM} </th>
<th width="50" class="thTop" nowrap="nowrap"> {switch_attached_list.L_ATTA CHED_TOPICS} </th>
<th width="50" class="thTop" nowrap="nowrap"> {switch_attached_list.L_ATTA CHED_POSTS} </th>
<th class="thCornerR" nowrap="nowrap"> {switch_attached_list.L_LAST _POST} </th>
</tr>
<!-- BEGIN switch_attached_present -->
<tr>
<td class="row1" align="center" valign="middle" height="38"><img src="{switch_attached_list.switch_attached_present .FORUM_FOLDER_IMG}" width="46" height="25" alt="{switch_attached_list.switch_attached_present .L_FORUM_FOLDER_ALT}" title="{switch_attached_list.switch_attached_prese nt.L_FORUM_FOLDER_ALT}" /></td>
<td class="row1" width="75%"><span class="forumlink"><a class="forumlink" href="{switch_attached_list.switch_attached_presen t.U_VIEWFORUM}">{switch_attached_list.switch_attac hed_present.FORUM_NAME}</a></span><br /><span class="genmed">{switch_attached_list.switch_attach ed_present.FORUM_DESC}</span></td>
<td class="row2" align="center" valign="middle"><span class="gensmall">{switch_attached_list.switch_atta ched_present.TOPICS}</span></td>
<td class="row2" align="center" valign="middle"><span class="gensmall">{switch_attached_list.switch_atta ched_present.POSTS}</span></td>
<td class="row2" align="center" nowrap="nowrap" valign="middle"><span class="gensmall">{switch_attached_list.switch_atta ched_present.LAST_POST_ID}</span></td>
</tr>
<!-- END switch_attached_present -->
</table>
<br />
<!-- END switch_attached_list -->
#
#-----[ BUL ]------------------------------------------------
#
<td align="left" valign="middle" width="100%"><span class="nav"> <a href="{U_INDEX}" class="nav">{L_INDEX}</a> -> <a class="nav" href="{U_VIEW_FORUM}">{FORUM_NAME}</a></span></td>
#
#-----[ BUNUNLA DEĞİŞTİR ]------------------------------------------------
#
<td align="left" valign="middle" width="100%"><span class="nav"> <a href="{U_INDEX}" class="nav">{L_INDEX}</a>
<!-- BEGIN switch_parent_link -->
-> <a class="nav" href="{PARENT_URL}">{PARENT_NAME}</a>
<!-- END switch_parent_link -->
-> <a class="nav" href="{U_VIEW_FORUM}">{FORUM_NAME}</a></span></td>
#
#-----[ AÇ ]------------------------------------------------
#
/templates/subSilver/viewtopic_body.tpl
#
#-----[ BUL ]------------------------------------------------
#
<td align="left" valign="middle" width="100%"><span class="nav"> <a href="{U_INDEX}" class="nav">{L_INDEX}</a>
-> <a href="{U_VIEW_FORUM}" class="nav">{FORUM_NAME}</a></span></td>
#
#-----[ BUNUNLA DEĞİŞTİR ]------------------------------------------------
#
<td align="left" valign="middle" width="100%"><span class="nav"> <a href="{U_INDEX}" class="nav">{L_INDEX}</a>
<!-- BEGIN switch_parent_link -->
-> <a class="nav" href="{PARENT_URL}">{PARENT_NAME}</a>
<!-- END switch_parent_link -->
-> <a href="{U_VIEW_FORUM}" class="nav">{FORUM_NAME}</a></span></td>
#
#-----[ BUL ]------------------------------------------------
#
<td align="left" valign="middle" width="100%"><span class="nav"> <a href="{U_INDEX}" class="nav">{L_INDEX}</a>
-> <a href="{U_VIEW_FORUM}" class="nav">{FORUM_NAME}</a></span></td>
#
#-----[ BUNUNLA DEĞİŞTİR ]------------------------------------------------
#
<td align="left" valign="middle" width="100%"><span class="nav"> <a href="{U_INDEX}" class="nav">{L_INDEX}</a>
<!-- BEGIN switch_parent_link -->
-> <a class="nav" href="{PARENT_URL}">{PARENT_NAME}</a>
<!-- END switch_parent_link -->
-> <a href="{U_VIEW_FORUM}" class="nav">{FORUM_NAME}</a></span></td>
#
#-----[ AÇ ]------------------------------------------------
#
/templates/subSilver/posting_body.tpl
#
#-----[ BUL ]------------------------------------------------
#
<td align="left"><span class="nav"><a href="{U_INDEX}" class="nav">{L_INDEX}</a>
#
#-----[ ARDINA EKLE ]------------------------------------------------
#
<!-- BEGIN switch_parent_link -->
-> <a class="nav" href="{PARENT_URL}">{PARENT_NAME}</a>
<!-- END switch_parent_link -->
#
#-----[ AÇ ]------------------------------------------------
#
/language/lang_english/lang_admin.php
#
#-----[ BUL ]------------------------------------------------
#
//
// That's all Folks!
#
#-----[ ÖNCESİNE EKLE ]-----------------------------------------
#
// Added by Easy Sub-Forums MOD
$lang['Attached_Field_Title'] = 'Attached to forum';
$lang['Attached_Description'] = "This field has been added by sub-forums mod.
It will display all attachable forums (if available) in this category";
$lang['Detach_Description'] = "Detach all forums";
$lang['Has_attachments'] = 'This forum has other forums attached to it. If you assign new category to this forum it will move all it\'s subforums to new category unless you select detach checkbox';
$lang['No_attach_forums'] = 'No attachable forums in this category';
// End Added by Easy Sub-Forums MOD
#
#-----[ AÇ ]------------------------------------------------
#
/language/lang_english/lang_main.php
#
#-----[ BUL ]------------------------------------------------
#
//
// That's all, Folks!
#
#-----[ ÖNCESİNE EKLE ]-----------------------------------------
#
// Added by Easy Sub-Forums MOD
$lang['Attached_forum'] = 'Sub-Forum';
$lang['Attached_forums'] = 'Sub-Forums';
// End Added by Easy Sub-Forums MOD
#
#-----[ TÜM DOSYALARDAKİ DEĞİŞİKLİKLERİ YAP KAYDET VE KAPAT MOD KURULUMU TAMAMLANMIŞTIR LÜTFEN SQL UNUZU ÇALIŞTIRMAYI UNUTMAYINIZ ]--------------------------------
|