森林之原
五月 23, 2012, 02:53:22 pm *
歡迎光臨, 訪客. 請先 登入註冊一個帳號.

請輸入帳號, 密碼以及預計登入時間
新聞: 森林之原歡迎您的蒞臨!
森林之原提供自由軟體的支援,包括繁體中文的翻譯。
 
   首頁   說明 搜尋 日曆 登入 註冊  
頁: [1]   向下
  寄送主題  |  列印  
作者 主題: 幾個CPG 去/改版權方法  (閱讀 3331 次)
0 會員 以及 1 訪客 正在閱讀本篇主題.
bitbob
初學者
*
離線 離線

文章: 5


« 於: 十二月 18, 2006, 02:53:41 pm »

原则上不建议修改原作者的Copyright,以示尊重作者. 但确实有特殊要求,可以参考下面几个Tipps

引用
如何脩改footer 页脚 的"powered by coppermine gallery"字样并加上自己的信息呢,特别是对大陆简体用户来说的"备案信息"呢.根据经验介绍三种方法: 以下在 CPG 1.4.10 下测试使用,其他版本请自行对比参考,大同小异.

1.修改/include/themes.inc.php
查找
程式碼:
// Function for writing a pagefooter
if (!function_exists('pagefooter')) {  //{THEMES}
function pagefooter()
{
    //global $HTTP_GET_VARS, $HTTP_POST_VARS, $HTTP_SERVER_VARS;
    global $USER, $USER_DATA, $ALBUM_SET, $CONFIG, $time_start, $query_stats, $queries;;
    global $template_footer;

    $custom_footer = cpg_get_custom_include($CONFIG['custom_footer_path']);

    if ($CONFIG['debug_mode']==1 || ($CONFIG['debug_mode']==2 && GALLERY_ADMIN_MODE)) {
    cpg_debug_output();
    }

    $template_vars = array(
        '{CUSTOM_FOOTER}' => $custom_footer,
        '{VANITY}' => (defined('THEME_IS_XHTML10_TRANSITIONAL') && $CONFIG['vanity_block']) ? theme_vanity() : '',
    );

    echo template_eval($template_footer, $template_vars);
}
}  //{THEMES}
程式碼:
echo template_eval($template_footer, $template_vars);
注释掉比如
程式碼:
# echo template_eval($template_footer, $template_vars);

然后在 anycontent.php 里加入自己定义的版权信息,不要忘了在Admin Control Panel管理控制面板启用anycontent.php------设定---相册目录显示---主页的内容--增加
程式碼:
/anycontent

2. 修改
程式碼:
"/include/themes.inc.php"

找到
程式碼:
//Function for writing a pagefooter
if (!function_exists('pagefooter')) {  //{THEMES}
function pagefooter()
{
    //global $HTTP_GET_VARS, $HTTP_POST_VARS, $HTTP_SERVER_VARS;
    global $USER, $USER_DATA, $ALBUM_SET, $CONFIG, $time_start, $query_stats, $queries;;
    global $template_footer;

    $custom_footer = cpg_get_custom_include($CONFIG['custom_footer_path']);

    if ($CONFIG['debug_mode']==1 || ($CONFIG['debug_mode']==2 && GALLERY_ADMIN_MODE)) {
    cpg_debug_output();
    }

    $template_vars = array(
        '{CUSTOM_FOOTER}' => $custom_footer,
        '{VANITY}' => (defined('THEME_IS_XHTML10_TRANSITIONAL') && $CONFIG['vanity_block']) ? theme_vanity() : '',
    );

    echo template_eval($template_footer, $template_vars);
}
}  //{THEMES}

替换成:
程式碼:
// Function for writing a pagefooter
if (!function_exists('pagefooter'))  //{THEMES}
{
function pagefooter()
{
global $template_footer;
$template_footer = '<div class="footer" style="padding-top: 5px;" align="center">Powered by <a href="http://phpforce.cn">php源动力</a></div><div class="footer" style="padding-top: 5px;" align="center">This program is free software under the terms of the <a href="http://www.gnu.org"> GNU/GPL</a></div>';
echo $template_footer;
}
}

上面的链接和说明等变量请根据自己需要修改.

3. 修改
程式碼:
"/include/functions.inc.php"
查找
程式碼:
function load_template()
bis
$template_footer = ereg_replace("</body[^>]*>",$add_version_info,$template_footer);

在后面添加(在符号"}"之前)
程式碼:
$meinfooter = '<a href="http://phpforce.cn/" title=" '.$lang_copyright_php['copyright_poweredby'].' phpforce.cn " rel="external">Powered by phpforce.cn</a>
<br>一起打造我们共同的目标---
Chart ours common Purpose
<br>
This program is free software under the terms of the <a href="http://www.gnu.org"> GNU/GPL</a></div>';
$strfnd = 'Powered by <a href="http://coppermine.sourceforge.net/" title="Coppermine Photo Gallery" rel="external">Coppermine Photo Gallery</a></div>';     
$template_footer = str_replace($strfnd,$meinfooter.'</div>',$template_footer);

以上相关信息可以修改成自己需要的. 这样做的目的是以自己的变量替换所有
程式碼:
http://coppermine.sourceforge.net
之类的信息. 只需修改一行代码,简单高效.推荐.
« 最後編輯時間: 十二月 18, 2006, 02:56:02 pm 由 bitbob » 向版主檢舉   已記錄
bitbob
初學者
*
離線 離線

文章: 5


« 回覆文章 #1 於: 十二月 24, 2006, 08:06:34 am »

演示請見: http://chhd.cn/album
向版主檢舉   已記錄
頁: [1]   向上
  寄送主題  |  列印  
 
前往:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006, Simple Machines LLC Valid XHTML 1.0! Valid CSS!