OJS 3.5.0.4升级到3.5.0.5

XIAO Qinghe
XIAO Qinghe
XIAO Qinghe
管理员
1802
文章
0
粉丝
建站资源评论34字数 2228阅读7分25秒阅读模式

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;参考为参考文献;downloads为下载

路径:/locale/zh_Hans/locale.po

msgid "issue.number"
msgstr "No."

msgid "issue.no"
msgstr "No."

msgid "article.Counts"
msgstr "统计"

msgid "article.Views"
msgstr "浏览"

msgid "article.Downloads"
msgstr "下载"

msgid "article.Downloaded"
msgstr "下载"

msgid "plugins.themes.healthSciences.displayStats.downloads"
msgstr "下载"

msgid "plugins.themes.classic.displayStats.downloads"
msgstr "下载"

msgid "submission.supportingAgencies"
msgstr "基金项目与致谢"

msgid "submission.citations"
msgstr "参考文献"

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"

18、ojs 3.5改了规则,不能像3.4那样显示浏览量和下载量,可以通过插件实现:

viewcounter: https://github.com/OJSBR

但是此插件带有模板文件,导致页面排版错误,可以替换如下:

路径:plugins/generic/viewcounter/templates/frontend/objects/artcile_summary.tpl

 

{**
 * templates/frontend/objects/article_summary.tpl
 * 双主题精确匹配版:
 * 1. Health Sciences (JRCC): 使用 healthSciences 官方原生 structure
 * 2. Classic (JSRH): 100% 使用您提供的原生 article_summary structure
 *}
{assign var="publication" value=$article->getCurrentPublication()}
{* 精确判定当前期刊类型:jrcc 走 Health Sciences,其他(如 jsrh) 走 Classic *}
{assign var="isHealthSciences" value=false}
{if ($currentContext && $currentContext->getPath() == 'jrcc') || $journalPath == 'jrcc'}
{assign var="isHealthSciences" value=true}
{/if}
{if $isHealthSciences}
{* ========================================================= *}
{* 1. Health Sciences 原生结构 (适用于 JRCC 刊)                *}
{* ========================================================= *}
{assign var="articlePath" value=$article->getBestId()}
{if (!$section.hideAuthor && $publication->getData('hideAuthor') == \APP\submission\Submission::AUTHOR_TOC_DEFAULT) || $publication->getData('hideAuthor') == \APP\submission\Submission::AUTHOR_TOC_SHOW}
{assign var="showAuthor" value=true}
{/if}
<div class="article-summary" style="margin-bottom: 2rem; padding-bottom: 1.5rem; border-bottom: 1px solid #eee;">
{assign var="submissionPages" value=$publication->getData('pages')}
{assign var="submissionDatePublished" value=$publication->getData('datePublished')}
{if $showAuthor && $submissionPages}
<div class="row">
<div class="col">
<div class="article-summary-authors">{$publication->getAuthorString($authorUserGroups)|escape}</div>
</div>
<div class="col-3 col-md-2 col-lg-2">
<div class="article-summary-pages text-right">
{$submissionPages|escape}
</div>
</div>
</div>
{elseif $showAuthor}
<div class="article-summary-authors">{$publication->getAuthorString($authorUserGroups)|escape}</div>
{elseif $submissionPages}
<div class="article-summary-pages text-right">
{$submissionPages|escape}
</div>
{/if}
<div class="article-summary-title" style="margin-top: 0.5rem; margin-bottom: 0.5rem; font-size: 1.1rem; line-height: 1.4; font-weight: 600;">
<a {if $journal}href="{url journal=$journal->getPath() page="article" op="view" path=$articlePath}"{else}href="{url page="article" op="view" path=$articlePath}"{/if}>
{$publication->getLocalizedFullTitle(null, 'html')|strip_unsafe_html}
</a>
</div>
{if $showDatePublished && $submissionDatePublished}
<div class="article-summary-date" style="color: #666; font-size: 0.85rem; margin-bottom: 0.5rem;">
{$submissionDatePublished|date_format:$dateFormatLong}
</div>
{/if}
{* OJS 3.5 DOI 展示 *}
{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}
{assign var="galleys" value=$article->getGalleys()}
{if !$hideGalleys && $galleys}
<div class="article-summary-galleys" style="margin-top: 0.5rem;">
{foreach from=$galleys item=galley}
{if $primaryGenreIds}
{assign var="file" value=$galley->getFile()}
{if !$galley->getData('urlRemote') && !($file && in_array($file->getGenreId(), $primaryGenreIds))}
{continue}
{/if}
{/if}
{assign var="hasArticleAccess" value=$hasAccess}
{if $currentContext->getSetting('publishingMode') == \APP\journal\Journal::PUBLISHING_MODE_OPEN || $publication->getData('accessStatus') == \APP\submission\Submission::ARTICLE_ACCESS_OPEN}
{assign var="hasArticleAccess" value=1}
{/if}
{include file="frontend/objects/galley_link.tpl" parent=$article publication=$publication hasAccess=$hasArticleAccess}
{/foreach}
</div>
{/if}
{* viewcounter Stats *}
<div class="viewcounter-wrapper" style="margin-top: 8px;">
{viewcounterStats submission=$article fontSize="13px"}
</div>
{call_hook name="Templates::Issue::Issue::Article"}
</div>
{else}
{* ========================================================= *}
{* 2. Classic 原生结构 (100% 使用您给出的结构,适用 JSRH 刊)   *}
{* ========================================================= *}
{assign var="articlePath" value=$article->getBestId()}
{assign var="publication" value=$article->getCurrentPublication()}
{if $headingLevel}
{assign var="heading" value="h{$headingLevel}"}
{else}
{assign var="heading" value="div"}
{/if}
{if (!$section.hideAuthor && $publication->getData('hideAuthor') == \APP\submission\Submission::AUTHOR_TOC_DEFAULT) || $publication->getData('hideAuthor') == \APP\submission\Submission::AUTHOR_TOC_SHOW}
{assign var="showAuthor" value=true}
{/if}
<article class="article_summary">
<div class="article_summary_body">
<{$heading} class="summary_title_wrapper">
<a class="summary_title" {if $journal}href="{url journal=$journal->getPath() page="article" op="view" path=$articlePath}"{else}href="{url page="article" op="view" path=$articlePath}"{/if}>
{$publication->getLocalizedFullTitle(null, 'html')|strip_unsafe_html}
</a>
</{$heading}>
{assign var=submissionPages value=$publication->getData('pages')}
{assign var=submissionDatePublished value=$publication->getData('datePublished')}
{if $showAuthor || $submissionPages || ($submissionDatePublished && $showDatePublished)}
<div class="summary_meta">
{if $showAuthor}
<div class="authors">
{$publication->getAuthorString($authorUserGroups)|escape}
</div>
{/if}
{* Page numbers for this article *}
{if $submissionPages}
<div class="pages">
{$submissionPages}
</div>
{/if}
{if $showDatePublished && $submissionDatePublished}
<div class="published">
{$submissionDatePublished|date_format:$dateFormatShort}
</div>
{/if}
</div>
{/if}
</div>
{if !$hideGalleys}
<div class="galleys_links">
{foreach from=$publication->getData('galleys') item=galley}
{if $primaryGenreIds}
{assign var="file" value=$galley->getFile()}
{if !$galley->getData('urlRemote') && !($file && in_array($file->getGenreId(), $primaryGenreIds))}
{continue}
{/if}
{/if}
{assign var="hasArticleAccess" value=$hasAccess}
{if $currentContext->getSetting('publishingMode') == \APP\journal\Journal::PUBLISHING_MODE_OPEN || $publication->getData('accessStatus') == \APP\submission\Submission::ARTICLE_ACCESS_OPEN}
{assign var="hasArticleAccess" value=1}
{/if}
{include file="frontend/objects/galley_link.tpl" parent=$article publication=$publication hasAccess=$hasArticleAccess purchaseFee=$currentJournal->getData('purchaseArticleFee') purchaseCurrency=$currentJournal->getData('currency')}
{/foreach}
</div>
{/if}
{* 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}
{* viewcounter: contadores discretos (visualizações | downloads) *}
<div class="viewcounter-wrapper" style="margin-top: 8px;">
{viewcounterStats submission=$article fontSize="13px"}
</div>
{call_hook name="Templates::Issue::Issue::Article"}
</article>
{/if}
19、OJS 3.5需要orcid授权,可以通过插件实现手动输入
插件:https://github.com/OJSBR
需要取消orcid授权设置,在user设置里面,然后就可以手动输入orcid链接。
20、汉化
在plugin/block/makeasubmission
新建locale/zh_Hans
msgid "plugins.block.makeSubmission.linkLabel"
msgstr "提交文章"

继续阅读
 
匿名

发表评论

匿名网友
确定

拖动滑块以完成验证