OJS 3.5.0.4升级到3.5.0.5
1、去官网下载最新版本源文件:https://pkp.sfu.ca/software/ojs/download/
2、新建测试网站(含数据库、文件夹),上传最新版本源文件至测试网站,设置好SSL与数据库(config.inc)
3、复制旧文件夹:files、public至测试文件夹
4、最好删除旧plugin,因为不兼容(如plugins/generic/citationStyleLanguage/)
5、在终端升级:
cd /www/wwwroot/文件夹
sudo -u www php tools/upgrade.php upgrade
6、修改config.inc
install=on 为off
7、修改config.inic
display_errors = On
show_stacktrace = On
结合Gemini,可以找出错误并进行修改(如api_key = "",需要补充32位密码)
升级成功后修改
1、进入后台将网页模板设置为default,然后再重新安装模板
2、去掉网址中的index.php
修改restful_urls = On
设置伪静态
# 忽略真实存在的文件、目录和符号链接,其余请求全部重写到 index.php
location / {
if (!-e $request_filename){
rewrite ^(.*)$ /index.php$1 last;
}
}
旧代码:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,L]
</IfModule>
3、关闭错误显示:
display_errors = Off
show_stacktrace = Off
4、修改logo
templates/images
5、好多plugin不见了,从网站下载上传:
https://pkp.github.io/plugin-compatibility/index.html
补充上传插件后,之前的设置还有
6、修改中文页面:期25为No. 25
路径:/locale/zh_Hans/locale.po
msgid "issue.number"
msgstr "No."
msgid "issue.no"
msgstr "No."
7、增加doi链接
路径:plugins/themes/你的主题名/templates/frontend/objects/article_summary.tpl
在 {call_hook name="Templates::Issue::Issue::Article"}
</div>上面添加代码:
{* OJS 3.5 目录页专用:获取当前文章的已激活 DOI 字符串 *}
{assign var=publication value=$article->getCurrentPublication()}
{if $publication && $publication->getData('doiObject')}
{assign var=doiObject value=$publication->getData('doiObject')}
{assign var=doiResolvingUrl value=$doiObject->getResolvingUrl()}
{if $doiResolvingUrl}
<div class="article-summary-doi" style="margin-top: 5px; font-size: 0.9em;">
<span class="label"><strong>DOI:</strong></span>
<a href="{$doiResolvingUrl|escape}" target="_blank">{$doiResolvingUrl|escape}</a>
</div>
{/if}
{/if}
8、文章页两端对齐(需要清除浏览器缓存或主题缓存)
路径:plugins/themes/classic/less/typography.less
p, li, a, blockquote
加入如下代码:
text-align: justify;
9、部分汉化
路径:/locale/zh_Hans/locale.po
msgid "about.onlineSubmissions.submitToSection"
msgstr "向<a href=\"{$url}\"> {$ name} </a> 栏目投稿。"
{$ name} 改成:{$name}
这样投稿页完整显示栏目信息.
msgid "about.submissions"
msgstr "稿件"
改成:投稿
这样栏目显示成:投稿,而非稿件。
11、补充插件:可以将旧文件plugin重新复制
12、复制favicon以及其他网页,修改默认文件
13、修改旧网站:网站目录,设置为测试网站文件夹
14、删除测试站点(不要删除数据库和文件)
15、修改域名
16、修改email设置
[email]
; Default method to send emails
; Available options: sendmail, smtp, log, phpmailer
default = smtp
; Path to the sendmail, -bs argument is for using SMTP protocol
sendmail_path = "/usr/sbin/sendmail -bs"
; Use SMTP for sending mail instead of mail()
smtp = On
; SMTP server settings
smtp_server = smtp.zeptomail.com.cn
smtp_port = 465
; Enable SMTP authentication
; Supported smtp_auth: ssl, tls (see PHPMailer SMTPSecure)
; smtp_auth = ssl
smtp_username = ????
smtp_password = ?????
; Enable suppressing SSL/TLS peer verification by SMTP transports
; Note: this is not recommended for security reasons
; smtp_suppress_cert_check = On
; Allow envelope sender to be specified
; (may not be possible with some server configurations)
allow_envelope_sender = On
; Default envelope sender to use if none is specified elsewhere
default_envelope_sender = noreply@ccspub.cc
; Force the default envelope sender (if present)
; This is useful if setting up a site-wide no-reply address
; The reply-to field will be set with the reply-to or from address.
; force_default_envelope_sender = Off
; Force a DMARC compliant from header (RFC5322.From)
; If any of your users have email addresses in domains not under your control
; you may need to set this to be compliant with DMARC policies published by
; those 3rd party domains.
; Setting this will move the users address into the reply-to field and the
; from field wil be rewritten with the default_envelope_sender.
; To use this you must set force_default_enveloper_sender = On and
; default_envelope_sender must be set to a valid address in a domain you own.
; force_dmarc_compliant_from = Off
; The display name to use with a DMARC compliant from header
; By default the DMARC compliant from will have an empty name but this can
; be changed by adding a text here.
; You can use '%n' to insert the users name from the original from header
; and '%s' to insert the localized sitename.
; dmarc_compliant_from_displayname = '%n via %s'
; If enabled, email addresses must be validated before login is possible.
require_validation = Off
; The number of days a user has to validate their account before their access key expires.
validation_timeout = 14
17、files路径一定要对:files_dir = "/www/wwwroot/test.ccspub.cn/files"
over







