[分享]新聞站台模組 1.2.1

MODs Released by Other phpbb Sites
非官方認證通過之 MOD ,或許有安全性之疑慮,所有問題由原發表者回覆!

版主: 版主管理群

主題已鎖定
頭像
godbless
竹貓忠實會員
竹貓忠實會員
文章: 647
註冊時間: 2002-05-17 06:02
來自: 台北市南京東路4段
聯繫:

[分享]新聞站台模組 1.2.1

文章 godbless »

NewsMod 1.2.1 繁體中文化版,請按我下載
這個版本以前小竹子殿下發表過了,我只是拿他寫好的部分加以修改並將kevin68x修改的部分一起放了進來
小竹發表的地方在:
http://phpbb-tw.net/phpbb/viewtopic.php?t=6812
kevin68x發表的修改在:
http://phpbb-tw.net/phpbb/viewtopic.php?t=11565
範例在:http://gff.mac.to

[php]<?php

#################################################################
## Mod Title: Language Mod
## Mod Version: 1.0.0
## Author: Samuel Cochran (sj26) < sam@wyvern.com.au >
## http://mods.sj26.cjb.net/lm/
## Description: This mod is a sub-mod I use in many mods. It
## allows mod authors to plug in language packages.
##
## Installation Level: Easy
## Installation Time: 2 Minutes
## Files To Edit: includes/functions.php
## Included Files: INSTALL.txt
#################################################################
## Security Disclaimer: This MOD Cannot Be Posted To Or Added At
## Any Non-Official phpBB Sites
#################################################################
##
## Author Notes:
## ~~~~~~~~~~~~
## o This mod is EasyMod v0.4alpha compatible.
## http://www.phpbb.com/community/viewtopic?t=12345
##
## o This is an original extract from Acyd_burns attachment mod.
## He no longer uses it, but I do. If you get a mod that
## requires this, this has probably been included with it. Only
## install it if you haven't before.
##
## o Questions? Comments? LET ME KNOW! I would love to hear
## how and where you use this script and how useful it is
## to you. Feel free to submit bugs, feature requests and
## suggestions to my email or private message me at
## http://www.phpbb.com/
##
#################################################################
## Before Adding This MOD To Your Forum, You Should Back Up All
## Files Related To This MOD
#################################################################
#
#-----[ NOTE ]---------------------------------------------------
# The first step is to copy the files from the archive into the
# base of your phpBB directory. Leave the directory structure of
# the files intact, and if you are prompted to overwrite, do so.
# This will NOT overwrite any files (unless you have put files
# named the same as the ones in the directories - unlikely).
#----------------------------------------------------------------
#
#-----[ OPEN ]---------------------------------------------------
#
includes/functions.php
#
#-----[ FIND ]---------------------------------------------------
#
//
// Initialise user settings on page load

#
#-----[ BEFORE, ADD ]--------------------------------------------
#
//
// Include language files
//
function language_include($category)
{
global $phpbb_root_path, $board_config, $lang, $faq;

$dirname = $phpbb_root_path . 'language/lang_' . $board_config['default_lang'];

$dir = opendir($dirname);

while($file = readdir($dir))
{
if( ereg("^lang_" . $category, $file) && is_file($dirname . "/" . $file) && !is_link($dirname . "/" . $file) )
{
$incname = str_replace("lang_" . $category, "", $file);
include($dirname . '/lang_' . $category . $incname);
}
}

closedir($dir);
}

#
#-----[ FIND ]---------------------------------------------------
#
include($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_main.' . $phpEx);
#
#-----[ REPLACE WITH ]-------------------------------------------
#
language_include('main');
#
#-----[ FIND ]---------------------------------------------------
#
include($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_admin.' . $phpEx);
#
#-----[ REPLACE WITH ]-------------------------------------------
#
language_include('admin');
#
#-----[ SAVE/CLOSE ALL FILES ]-----------------------------------
#
# EoM
?>[/php]

[php]<?php
#################################################################
## Mod Title: NewsMod
## Mod Version: 1.2.1
## Author: Samuel Cochran (sj26) < sam@wyvern.com.au >
## http://mods.sj26.cjb.net/nm/
## Thanks to: Carl Dornieden < info@nexus-innovations.com >
## ( Original Creator )
## Description: This is a simple mod that allows you to add
## front-page news to your site.
## Installation Level: Easy
## Installation Time: 7 Minutes
## Files To Edit: index.php,
## templates/subSilver/index_body.tpl,
## templates/subSilver/overall_header.tpl
## templates/subSilver/simple_header.tpl
## templates/subSilver/admin/page_header.tpl
## Included Files: INSTALL.txt (this file),
## includes/news.php,
## includes/functions.php,
## language/lang_english/lang_admin_news.php,
## language/lang_english/lang_main_news.php,
## templates/subSilver/index_news.tpl,
## templates/subSilver/news_body.tpl,
## templates/subSilver/admin/news_body.tpl,
## templates/subSilver/images/contract.gif,
## templates/subSilver/images/expand.gif,
## templates/rollout.js,
## admin/admin_news.php
#################################################################
## Security Disclaimer: This MOD Cannot Be Posted To Or Added At
## Any Non-Official phpBB Sites
#################################################################
##
## Author Notes:
## ~~~~~~~~~~~~
## o This mod is EasyMod v0.4alpha compatible.
## http://www.phpbb.com/community/viewtopic?t=12345
##
## o You will need to copy the template files into all your
## templates and edit them accordingly, and the template edits
## will also have to be done in all temlpates, too!
##
## o This code originally came from Carl Dornieden (well,
## actually, the phpBB Group, but originally modified by Carl
## Dornieden ;) ) so thankx!
##
## o Questions? Comments? LET ME KNOW! I would love to hear
## how and where you use this script and how useful it is
## to you. Feel free to submit bugs, feature requests and
## suggestions to my email.
##
## Change Log:
## ~~~~~~~~~~
## o 1.2.1
## - Fixed a bug where an empty news article would be
## displayed if there was an article, but the user doesn't
## have permission to see it.
## - Added 'No News' message
##
## o 1.2.0
## - Updated SQL Queries to include ALTER TABLE statements
## that are compatible with databases other than MySQL.
##
## o 1.1.3
## - Updated a couple of language entries.
## - Updated my email - thought I had done :oops:
## - Moved LANGUAGE.txt into the main file. Sick of users
## with language problems because they didn't read the
## section telling them to install LANGUAGE.txt ;)
##
## o 1.1.2
## - Fixed incontinuity of news_trim_char[acter].
##
## o 1.1.1
## - Fixed error where checkboxes could not be unchecked.
## - Fixed incontinuity of news_trim_char[acter].
## [ Bugs found by monitorlizard - thankyou ]
##
## o 1.1.0
## - Released from dependance on Modulated Configuration Mod
## because News Mod has become to extensive.
## - New admin panel acessible from 'General Admin' category.
## - Updated CROSS-BROWSER javascript code. Tried in IE6 and
## NS6.
## - Added proper news page (seperate) because News Archive
## could no longer point to one forum.
##
## o 1.0.0
## - Initial release
## - EasyMod v0.4alpha compatible.
## - Added voting
## - Added auth checks
## - Added multi-forum grabbing
## - Added specification of announcements, stickies and
## normal posts for each forum
## - Improved HTML in template file
##
## o 1.0.0 beta
## - Beta Trial
##
## Planned Features:
## ~~~~~~~~~~~~~~~~
## o Printable version
## - So you can print out a news summary.
## o Static News Page
## - Allows you to update a .html page within a pair of
## comments automatically
## o RSS News Feed
## - So people can hook into your news with RSS
## o Javascript News Feed
## - So a static webpage can house a javascript news
## 'ticker' - could be useful on a front page.
## o RSS News Display
## - So you can retreive news from other sites
## o Local storage and commenting
## - So you can discuss retreived articles
##
## - The above are in order of likely implementation, most
## likely at the top
## - If you have any suggestions, please email me:
## sam@wyvern.com.au
##
#################################################################
## Before Adding This MOD To Your Forum, You Should Back Up All
## Files Related To This MOD
#################################################################
#
#-----[ NOTE ]---------------------------------------------------
#
# The first step is to copy all the files from the zip file to
# their respective directories (just unzip all files except
# INSTALL.txt to your forum root directory and all will be cool)
# NOTE: If you already have the 'rollout.js' in your 'templates/'
# directory, do not bother to copy this.
#
#-----[ OPEN ]---------------------------------------------------
#
index.php
#
#-----[ FIND ]---------------------------------------------------
#
# ( Around Line 257 )
#
$template->set_filenames(array(
#
#-----[ AFTER, ADD ]---------------------------------------------
#
'news' => 'index_news.tpl',
#
#-----[ FIND ]---------------------------------------------------
#
# ( Around Line 287 )
#
'U_MARK_READ' => append_sid("index.$phpEx?mark=forums"))
);
#
#-----[ AFTER, ADD ]---------------------------------------------
#

if( isset($board_config['news_display']) && $board_config['news_display'] )
{
include($phpbb_root_path . 'includes/news.'.$phpEx);

$template->assign_var_from_handle('NEWS', 'news');
}
#
#-----[ OPEN ]---------------------------------------------------
#
templates/subSilver/overall_header.tpl
#
#-----[ NOTE ]---------------------------------------------------
#
# If you find the following code snippet in place already, don't
# bother adding it again.
#
#-----[ FIND ]---------------------------------------------------
#
-->
</style>
#
#-----[ AFTER, ADD ]---------------------------------------------
#
<script type="text/javascript" src="templates/rollout.js"></script>
#
#-----[ OPEN ]---------------------------------------------------
#
templates/subSilver/simple_header.tpl
#
#-----[ NOTE ]---------------------------------------------------
#
# If you find the following code snippet in place already, don't
# bother adding it again.
#
#-----[ FIND ]---------------------------------------------------
#
-->
</style>
#
#-----[ AFTER, ADD ]---------------------------------------------
#
<script type="text/javascript" src="templates/rollout.js"></script>
#
#-----[ OPEN ]---------------------------------------------------
#
templates/subSilver/admin/page_header.tpl
#
#-----[ NOTE ]---------------------------------------------------
#
# If you find the following code snippet in place already, don't
# bother adding it again.
#
#-----[ FIND ]---------------------------------------------------
#
-->
</style>
#
#-----[ AFTER, ADD ]---------------------------------------------
#
<script type="text/javascript" src="../templates/rollout.js"></script>
#
#-----[ OPEN ]---------------------------------------------------
#
templates/subSilver/index_body.tpl
#
#-----[ FIND ]---------------------------------------------------
#
<table width="100%" cellpadding="2" cellspacing="1" border="0" class="forumline">
<tr>
<th colspan="2" class="thCornerL" height="25" nowrap="nowrap"> {L_FORUM} </th>
#
#-----[ BEFORE, ADD ]--------------------------------------------
#
{NEWS}

#
#-----[ NOTE ]---------------------------------------------------
#
# Open includes/functions.php and look for
# 'function language_include'
# And if you can't find it, you'll have to carry out the
# instructions on the next few lines.
#
#-----[ OPEN ]---------------------------------------------------
#
includes/functions.php
#
#-----[ FIND ]---------------------------------------------------
#
//
// Initialise user settings on page load

#
#-----[ BEFORE, ADD ]--------------------------------------------
#
//
// Include language files
//
function language_include($category)
{
global $phpbb_root_path, $board_config, $lang, $faq;

$dirname = $phpbb_root_path . 'language/lang_' . $board_config['default_lang'];

$dir = opendir($dirname);

while($file = readdir($dir))
{
if( ereg("^lang_" . $category, $file) && is_file($dirname . "/" . $file) && !is_link($dirname . "/" . $file) )
{
$incname = str_replace("lang_" . $category, "", $file);
include($dirname . '/lang_' . $category . $incname);
}
}

closedir($dir);
}

#
#-----[ FIND ]---------------------------------------------------
#
include($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_main.' . $phpEx);
#
#-----[ REPLACE ]------------------------------------------------
#
language_include('main');
#
#-----[ FIND ]---------------------------------------------------
#
include($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_admin.' . $phpEx);
#
#-----[ REPLACE ]------------------------------------------------
#
language_include('admin');
#
#-----[ NOTE ]---------------------------------------------------
#
# This is the end of the section to do if you didn't find the
# coding in functions.php
#
#-----[ NOTE ]---------------------------------------------------
#
# o Make sure you have copied the templates to ALL your template
# directories.
# o Make sure you have copied the two images and (if you like)
# modified them to suit all your templates in each templates
# image directory.
# o Make sure you update the images paths in the templates (look
# for 'templates/subSilver/images/') and make sure this has a
# trailing '/' on the end of it.
# o You now need to go to the administration panel and click on
# 'General Admin' -> 'News Settings' which will install all the
# neccessary stuff. Select the forums you want your news to
# come from, click on 'yes' for 'Display News' and that's it!
#
#-----[ SAVE/CLOSE ALL FILES ]-----------------------------------
#
# EoM
?>[/php]
kevin68x發表修改的部分在:

代碼: 選擇全部

# 
#-----[ OPEN ]--------------------------------------------------- 
# 
includes/news.php

#-----[ FIND ]---------------------------------------------------
# 
		$poster_name = '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&id=" . $news[$i]['user_id']) . "\">$poster</a>";

# 
#-----[ REPLACE ]------------------------------------------------
# 
		$poster_name = '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&u=" . $news[$i]['user_id']) . "\">$poster</a>";
最後由 godbless 於 2003-05-24 17:39 編輯,總共編輯了 2 次。
外掛問題區發問格式就在這裡,請務必一定照著格式來~!
你不照著規則來,就算是也搞不清楚你的問題在哪裡!
新手問問題不是罪惡
罪惡的是自己沒有先做好本分和功課,說話的口氣也不好,再加上態度有好像我們這群人欠你多少似的~~!!
竹貓星球發問規則:
http://phpbb-tw.net/phpbb/viewtopic.php?t=16149
發問比率最高的句子翻譯:
Please ensure both the install/ and contrib/ directories are deleted
請確認install和contrib資料夾已被刪除(奇怪,翻一下英漢字典有這麼困難嗎)

主題已鎖定

回到「非官方認證外掛」