Seditio ve Ldu hakkında sınırsız arama yapın
 
 
> 1 <

Etiketler: global duyurular forumlara birden başlık açmak core hack

Author Message

emremix

Moderators


Online status

483 posts

Location: Turkey
Occupation: emremix
Age:

#27545   2008-05-23 18:01 GMT      

Bunun sayesinde tüm forumlara birden başlık açabiliyoruz vbulletin tarzı duyuru sistemi oluyor yani.

Hemen başlayalım yapmaya

1.Phpmyadmine girip bunu sorgulatıyoruz
Code:
ALTER TABLE sed_forum_topics ADD COLUMN global smallint(5) unsigned NOT NULL default '0';

2. /system/core/forums/forums.topics.inc.php dosyasını açın
Code:
case 'announcement':

sed_check_xg();
$sql = sed_sql_query("UPDATE $db_forum_topics SET ft_sticky=1, ft_state=1 WHERE ft_id='$q'");
sed_log("Announcement topic #".$q, 'for');
header("Location: forums.php?m=topics&s=$s");
exit;
break;


Altına ekleyin

Code:
case 'global':

sed_check_xg();
$sql = sed_sql_query("UPDATE $db_forum_topics SET global=1, ft_sticky=1, ft_state=1 WHERE ft_id='$q'");
sed_log("Global Announcement topic #".$q, 'for');
header("Location: forums.php?m=topics&s=$s");
exit;
break;


3. /system/core/forums/forums.topics.inc.php dosyasını açın
Bunu Bulun
Code:
$mskin = sed_skinfile(array('forums', 'topics', $fs_category, $s));
$t = new XTemplate($mskin);


Altına ekleyin

Code:
$sql4 = sed_sql_query("SELECT * FROM $db_forum_topics WHERE global='1' $cond
ORDER by global DESC, ft_".$o." ".$w."
LIMIT $d, ".$cfg['maxtopicsperpage']);

while ($row4 = sed_sql_fetcharray($sql4))
{
$row4['ft_icon'] = 'posts';
$row4['ft_postisnew'] = FALSE;
$row4['ft_pages'] = '';
$ft_num++;

if ($row4['ft_mode']==1)
{ $row4['ft_title'] = "# ".$row4['ft_title']; }

if ($row4['ft_movedto']>0)
{
$row4['ft_url'] = "forums.php?m=posts&amp;q=".$row4['ft_movedto'];
$row4['ft_icon'] = "<img src=\"skins/$skin/img/system/posts_moved.gif\" alt=\"\" />";
$row4['ft_title']= $L['Moved'].": ".$row4['ft_title'];
$row4['ft_lastpostername'] = "&nbsp;";
$row4['ft_postcount'] = "&nbsp;";
$row4['ft_replycount'] = "&nbsp;";
$row4['ft_viewcount'] = "&nbsp;";
$row4['ft_lastpostername'] = "&nbsp;";
$row4['ft_lastposturl'] = "<a href=\"forums.php?m=posts&amp;q=".$row4['ft_movedto']."&amp;n=last#bottom\"><img src=\"skins/$skin/img/system/arrow-follow.gif\" alt=\"\" /></a> ".$L['Moved'];
$row4['ft_timago'] = sed_build_timegap($row4['ft_updated'],$sys['now_offset']);
}
else
{
$row4['ft_title']= "Announcement: ".$row4['ft_title'];
$row4['ft_url'] = "forums.php?m=posts&amp;q=".$row4['ft_id'];
$row4['ft_lastposturl'] = ($usr['id']>0 && $row4['ft_updated'] > $usr['lastvisit']) ? "<a href=\"forums.php?m=posts&amp;q=".$row4['ft_id']."&amp;n=unread#unread\"><img src=\"skins/$skin/img/system/arrow-unread.gif\" alt=\"\" /></a>" : "<a href=\"forums.php?m=posts&amp;q=".$row4['ft_id']."&amp;n=last#bottom\"><img src=\"skins/$skin/img/system/arrow-follow.gif\" alt=\"\" /></a>";
$row4['ft_lastposturl'] .= @date($cfg['formatmonthdayhourmin'], $row4['ft_updated'] + $usr['timezone'] * 3600);
$row4['ft_timago'] = sed_build_timegap($row4['ft_updated'],$sys['now_offset']);
$row4['ft_replycount'] = $row4['ft_postcount'] - 1;

if ($row4['ft_updated']>$usr['lastvisit'] && $usr['id']>0)
{
$row4['ft_icon'] .= '_new';
$row4['ft_postisnew'] = TRUE;
}

if ($row4['ft_postcount']>=$cfg['hottopictrigger'] && !$row4['ft_state'] && !$row4['ft_sticky'])
{ $row4['ft_icon'] = ($row4['ft_postisnew']) ? 'posts_new_hot' : 'posts_hot'; }
else
{
if ($row4['ft_sticky'])
{ $row4['ft_icon'] .= '_sticky'; }

if ($row4['ft_state'])
{ $row4['ft_icon'] .= '_locked'; }
}

$row4['ft_icon'] = "<img src=\"skins/$skin/img/system/".$row4['ft_icon'].".gif\" alt=\"\" />";
$row4['ft_lastpostername'] = sed_build_user($row4['ft_lastposterid'], sed_cc($row4['ft_lastpostername']));
}

$row4['ft_firstpostername'] = sed_build_user($row4['ft_firstposterid'], sed_cc($row4['ft_firstpostername']));

if ($row4['ft_poll']>0)
{ $row4['ft_title'] = $L['Poll'].": ".$row4['ft_title']; }

if ($row4['ft_postcount']>$cfg['maxtopicsperpage'])
{
$row4['ft_maxpages'] = ceil($row4['ft_postcount'] / $cfg['maxtopicsperpage']);
$row4['ft_pages'] = $L['Pages'].":";
for ($a = 1; $a <= $row4['ft_maxpages']; $a++)
{
$row4['ft_pages'] .= (is_int($a/5) || $a<10 || $a==$row4['ft_maxpages']) ? " <a href=\"".$row4['ft_url']."&amp;d=".($a-1) * $cfg['maxtopicsperpage']."\">".$a."</a>" : '';
    }
}

$t-> assign(array(
"FORUMS_TOPICS_GLOBAL_ROW_ID" => $row4['ft_id'],
"FORUMS_TOPICS_GLOBAL_ROW_STATE" => $row4['ft_state'],
"FORUMS_TOPICS_GLOBAL_ROW_ICON" => $row4['ft_icon'],
"FORUMS_TOPICS_GLOBAL_ROW_TITLE" => sed_cc($row4['ft_title']),
"FORUMS_TOPICS_GLOBAL_ROW_CREATIONDATE" => @date($cfg['formatmonthdayhourmin'], $row4['ft_creationdate'] + $usr['timezone'] * 3600),
"FORUMS_TOPICS_GLOBAL_ROW_UPDATED" => $row4['ft_lastposturl'],
"FORUMS_TOPICS_GLOBAL_ROW_TIMEAGO" => $row4['ft_timago'],
"FORUMS_TOPICS_GLOBAL_ROW_POSTCOUNT" => $row4['ft_postcount'],
"FORUMS_TOPICS_GLOBAL_ROW_REPLYCOUNT" => $row4['ft_replycount'],
"FORUMS_TOPICS_GLOBAL_ROW_VIEWCOUNT" => $row4['ft_viewcount'],
"FORUMS_TOPICS_GLOBAL_ROW_FIRSTPOSTER" => $row4['ft_firstpostername'],
"FORUMS_TOPICS_GLOBAL_ROW_LASTPOSTER" => $row4['ft_lastpostername'],
"FORUMS_TOPICS_GLOBAL_ROW_URL" => $row4['ft_url'],
"FORUMS_TOPICS_GLOBAL_ROW_PAGES" => $row4['ft_pages'],
"FORUMS_TOPICS_GLOBAL_ROW_MAXPAGES" => $row4['ft_maxpages'],
"FORUMS_TOPICS_GLOBAL_ROW_ODDEVEN" => sed_build_oddeven($ft_num),
"FORUMS_TOPICS_GLOBAL_ROW" => $row,
));


$t->parse("MAIN.FORUMS_GLOBAL.FORUMS_TOPICS_GLOBAL_ROW");
}

$t->parse("MAIN.FORUMS_GLOBAL");


4. /system/core/forums/forums.topics.inc.php dosyasını açın

Bunu bulun
Code:
case 'clear':

sed_check_xg();
sed_log("Resetted topic #".$q, 'for');
$sql = sed_sql_query("UPDATE $db_forum_topics SET ft_sticky=0, ft_state=0, ft_mode=0 WHERE ft_id='$q'");
header("Location: forums.php?m=topics&s=$s");
exit;
break;


Bununla Değiştirin

Code:
case 'clear':

sed_check_xg();
sed_log("Resetted topic #".$q, 'for');
$sql = sed_sql_query("UPDATE $db_forum_topics SET ft_sticky=0, ft_state=0, global=0, ft_mode=0 WHERE ft_id='$q'");
header("Location: forums.php?m=topics&s=$s");
exit;
break;


5. /system/core/forums/forums.posts.inc.php açın (Not: Dosya Değişti Dikkat Edin)

Code:
if ($usr['isadmin'])
{
$adminoptions = "<form id=\"movetopic\" action=\"forums.php?m=topics&amp;a=move&amp;".sed_xg()."&amp;s=".$s."&amp;q=".$q."\" method=\"post\">";
$adminoptions .= $L['Topicoptions']." : <a href=\"forums.php?m=topics&amp;a=bump&amp;".sed_xg()."&amp;q=".$q."&amp;s=".$s."\">".$L['Bump'];
$adminoptions .= "</a> &nbsp; <a href=\"forums.php?m=topics&amp;a=lock&amp;".sed_xg()."&amp;q=".$q."&amp;s=".$s."\">".$L['Lock'];
$adminoptions .= "</a> &nbsp; <a href=\"forums.php?m=topics&amp;a=sticky&amp;".sed_xg()."&amp;q=".$q."&amp;s=".$s."\">".$L['Makesticky'];
$adminoptions .= "</a> &nbsp; <a href=\"forums.php?m=topics&amp;a=announcement&amp;".sed_xg()."&amp;q=".$q."&amp;s=".$s."\">".$L['Announcement'];
$adminoptions .= "</a> &nbsp; <a href=\"forums.php?m=topics&amp;a=private&amp;".sed_xg()."&amp;q=".$q."&amp;s=".$s."\">".$L['Private']." (#)";
$adminoptions .= "</a> &nbsp; <a href=\"forums.php?m=topics&amp;a=clear&amp;".sed_xg()."&amp;q=".$q."&amp;s=".$s."\">".$L['Default'];
$adminoptions .= "</a> &nbsp; ".$L['Delete'].":[<a href=\"forums.php?m=topics&amp;a=delete&amp;".sed_xg()."&amp;s=".$s."&amp;q=".$q."\">x</a>] ".$movebox."</form>";
}


Bununla Değiştirin


Code:
if ($usr['isadmin'])
{
$adminoptions = "<form id=\"movetopic\" action=\"forums.php?m=topics&amp;a=move&amp;".sed_xg()."&amp;s=".$s."&amp;q=".$q."\" method=\"post\">";
$adminoptions .= $L['Topicoptions']." : <a href=\"forums.php?m=topics&amp;a=bump&amp;".sed_xg()."&amp;q=".$q."&amp;s=".$s."\">".$L['Bump'];
$adminoptions .= "</a> &nbsp; <a href=\"forums.php?m=topics&amp;a=lock&amp;".sed_xg()."&amp;q=".$q."&amp;s=".$s."\">".$L['Lock'];
$adminoptions .= "</a> &nbsp; <a href=\"forums.php?m=topics&amp;a=sticky&amp;".sed_xg()."&amp;q=".$q."&amp;s=".$s."\">".$L['Makesticky'];
$adminoptions .= "</a> &nbsp; <a href=\"forums.php?m=topics&amp;a=announcement&amp;".sed_xg()."&amp;q=".$q."&amp;s=".$s."\">".$L['Announcement'];
$adminoptions .= "</a> &nbsp; <a href=\"forums.php?m=topics&amp;a=global&amp;".sed_xg()."&amp;q=".$q."&amp;s=".$s."\">Global Announcement";
$adminoptions .= "</a> &nbsp; <a href=\"forums.php?m=topics&amp;a=private&amp;".sed_xg()."&amp;q=".$q."&amp;s=".$s."\">".$L['Private']." (#)";
$adminoptions .= "</a> &nbsp; <a href=\"forums.php?m=topics&amp;a=clear&amp;".sed_xg()."&amp;q=".$q."&amp;s=".$s."\">".$L['Default'];
$adminoptions .= "</a> &nbsp; ".$L['Delete'].":[<a href=\"forums.php?m=topics&amp;a=delete&amp;".sed_xg()."&amp;s=".$s."&amp;q=".$q."\">x</a>] ".$movebox."</form>";
}


Çekirdek Kodlama Tamamlandı.Şimdi sıra skinimizi düzenlemede;

Son işlemimiz

6. /skins/YOURSKIN/forums.topics.tpl bunu açıyoruz ve uygun bir yere ekliyoruz

Code:
<!-- BEGIN: FORUMS_GLOBAL -->

<table class="cells">

<tr>
<td colspan="2" class="coltop">
{FORUMS_TOPICS_TITLE_TOPICS} / {FORUMS_TOPICS_TITLE_STARTED}</td>
<td class="coltop" style="width:176px;">
{FORUMS_TOPICS_TITLE_LASTPOST}</td>
<td class="coltop" style="width:56px;">
{FORUMS_TOPICS_TITLE_POSTS}</td>
<td class="coltop" style="width:56px;">
{FORUMS_TOPICS_TITLE_VIEWS}</td>

</tr>

<!-- BEGIN: FORUMS_TOPICS_GLOBAL_ROW -->

<tr>
<td style="width:32px;" class="centerall {FORUMS_TOPICS_GLOBAL_ROW_ODDEVEN}">
{FORUMS_TOPICS_GLOBAL_ROW_ICON}
</td>

<td class="{FORUMS_TOPICS_GLOBAL_ROW_ODDEVEN}">
<strong><a href="{FORUMS_TOPICS_GLOBAL_ROW_URL}">{FORUMS_TOPICS_GLOBAL_ROW_TITLE}</a></strong><br />
{FORUMS_TOPICS_GLOBAL_ROW_PAGES} &nbsp; {FORUMS_TOPICS_GLOBAL_ROW_CREATIONDATE} : {FORUMS_TOPICS_GLOBAL_ROW_FIRSTPOSTER}
</td>


<td class="centerall {FORUMS_TOPICS_GLOBAL_ROW_ODDEVEN}">
{FORUMS_TOPICS_GLOBAL_ROW_UPDATED} {FORUMS_TOPICS_GLOBAL_ROW_LASTPOSTER}<br />
{FORUMS_TOPICS_GLOBAL_ROW_TIMEAGO}</span>
</td>

<td class="centerall {FORUMS_TOPICS_GLOBAL_ROW_ODDEVEN}">
{FORUMS_TOPICS_GLOBAL_ROW_POSTCOUNT}
</td>

<td class="centerall {FORUMS_TOPICS_GLOBAL_ROW_ODDEVEN}">
{FORUMS_TOPICS_GLOBAL_ROW_VIEWCOUNT}
</td>

</tr>

<!-- END: FORUMS_TOPICS_GLOBAL_ROW -->

</table>


<!-- END: FORUMS_GLOBAL -->


Bu makale Trustmaster tarafından hazırlanmış olup Emremix yani ben tarafınndan Seditio-tr üyeleri için Türkçe'ye çevrilmiştir.
Kolay Gelsin Biraz uzun bir işlem olsada herkesin kolaylıkla yapabileceğini düşünüyorum.
Orjinal Makale için;
http://www.seditioforge.com/tutorials/core-hacks/global-forums-posts-i112.html
Linkini kullanabilirsiniz.
Sudo apt-get Alcohol
Forever Ubuntu :)

The_PcDelisi

Members


Online status

237 posts
http://TeknoPaylasim.NET
Pagerank: 1

Location: Turkey AnKara
Occupation: Host, Domain, Reseller, VPS :Pp
Age: 23

#27554   2008-05-23 19:49 GMT      
saol emre
> 1 <

Benzer konular (Similar topics) #BETA

Keywords (beta):

Forum Arşiv (beta):

[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] [45] [46] [47] [48] [49] [50] [51] [52] [53] [54] [55] [56] [57] [58] [59] [60] [61] [62] [63] [64] [65] [66] [67] [68] [69] [70] [71] [72] [73] [74] [75] [76] [77] [78] [79] [80] [81] [82] [83] [84] [85] [86] [87] [88] [89] [90] [91] [92] [93] [94] [95] [96] [97] [98] [99] [100] [101] [102] [103] [104] [105] [106] [107] [108] [109] [110] [111] [112] [113] [114] [115] [116] [117] [118] [119] [120] [121] [122] [123] [124] [125] [126] [127] [128] [129] [130] [131] [132] [133] [134] [135] [136] [137] [138] [139] [140] [141] [142] [143] [144] [145] [146] [147] [148] [149] [150] [151] [152] [153] [154] [155] [156] [157] [158] [159] [160] [161] [162] [163] [164] [165] [166] [167] [168] [169] [170] [171] [172] [173] [174] [175] [176] [177] [178] [179] [180] [181] [182] [183] [184] [185] [186] [187] [188] [189] [190] [191] [192] [193] [194] [195] [196] [197] [198] [199] [200] [201] [202] [203] [204] [205] [206] [207] [208] [209] [210] [211] [212] [213] [214] [215] [216] [217] [218] [219] [220] [221] [222] [223] [224] [225] [226] [227] [228] [229]