OpenPNE3 opDiaryPlugin カスタマイズ

OpenPEN設置環境

・OpenPNEのバージョン
[OpenPNE3.8.20]

・Pluginバージョン
[opDiaryPlugin 1.5.1]

・運用環境
[kagoyaレンタル専用サーバー]

Apacheバージョン Apache/2.4.20
MySQLバージョン 5.6.22 (Ver 14.14 Distrib 5.6.22)
PHP 5.6.23

・OpenPNE設置場所
WEBサイト閲覧用ルートディレクトリー(public_html)にサブディレクトリー
(openpne)のフィルダーを作成展開

////////////////////////////////////////////////////////////////////////////////


■【スマートフォンモードにて日記投稿後 FILE_NOT_FOUND】

サブディレクトリにOpenPNEを設置時スマホから日記投稿後遷移先がなくnot foundとなるため修正

[参考URL]
http://sns.openpne.jp/communityTopic/238
https://github.com/amashigeseiji/opDiaryPlugin/commit/22c0410d1d3919488c4326d09e0da4d5a2c15fae

—————————————————————————————————————————–
[修正ディレクトリー]
/public_html/openpne/plugins/opDiaryPlugin/apps/pc_frontend/modules/diary/templates

[修正ファイル]
smtPostSuccess.php

[修正箇所]下記 -:削除  +:追加

オリジナル(変更前)

op_smt_use_javascript('/opDiaryPlugin/js/lightbox.js', 'last');
?>
-
<script type="text/javascript">
$(function(){

カスタマイズ(変更後)

op_smt_use_javascript('/opDiaryPlugin/js/lightbox.js', 'last');
?>
+ <?php $relativeUrl = sfContext::getInstance()->getRequest()->getRelativeUrlRoot() ?> 
+ <input type="hidden" value="<?php echo $relativeUrl ?>" id="relativeUrl" /> 
<script type="text/javascript">
$(function(){

—————————————————————————————————————————–
[修正ディレクトリー]
/public_html/openpne/plugins/opDiaryPlugin/apps/pc_frontend/modules/diary/templates/

[修正ファイル]
smtShowSuccess.php

[修正箇所]下記 -:削除  +:追加

オリジナル(変更前)

op_smt_use_javascript('/opDiaryPlugin/js/lightbox.js', 'last');
?>
-
<script id="diaryEntry" type="text/x-jquery-tmpl">
  <div class="row">

カスタマイズ(変更後)

op_smt_use_javascript('/opDiaryPlugin/js/lightbox.js', 'last');
?>
+ <?php $relativeUrl = sfContext::getInstance()->getRequest()->getRelativeUrlRoot() ?> 
+ <input type="hidden" value="<?php echo $relativeUrl ?>" id="relativeUrl" /> 
<script id="diaryEntry" type="text/x-jquery-tmpl">
  <div class="row">



—————————————————————————————————————————–
[修正ディレクトリー]
/public_html/openpne/plugins/opDiaryPlugin/web/js

[修正ファイル]
smt_diary_functions.js

[修正箇所]下記 -:削除  +:追加

オリジナル(変更前)

function postDiary (params) {
  var success = function (res) {
-   window.location = '/diary/' + res.data.id;
  }

カスタマイズ(変更後)

function postDiary (params) {
  var success = function (res) {
+    window.location = $('#relativeUrl').val() + '/diary/' + res.data.id; 
  }

オリジナル(変更前)

function deleteDiary (params) {
  var success = function (res) {
-   window.location = '/diary/listMember/' + res.data.member.id;
  };

カスタマイズ(変更後)

function deleteDiary (params) {
  var success = function (res) {
+   window.location = $('#relativeUrl').val() + '/diary/listMember' + res.data.member.id; 
   }; 



■【日記コメントの通知がリンクされていない。】

サブディレクトリにOpenPNEを設置時日記コメントの通知センターでの通知のリンクの遷移先が正しくない

[参考URL]
https://gist.github.com/cons3/5473328

—————————————————————————————————————————–
[修正ディレクトリー]
/public_html/openpne/plugins/opDiaryPlugin/lib/util

[修正ファイル]
opDiaryPluginUtil.class.php

[修正箇所]下記 -:削除  +:追加

オリジナル(変更前)

  public static function sendNotification($fromMember, $toMember, $diaryId){
-   $url = '/diary/'.$diaryId;
-    
    sfApplicationConfiguration::getActive()->loadHelpers(array('I18N'));

カスタマイズ(変更後)

  public static function sendNotification($fromMember, $toMember, $diaryId){
+   $rootPath = sfContext::getInstance()->getRequest()->getRelativeUrlRoot();
+   $url = $rootPath.'/diary/'.$diaryId    
    sfApplicationConfiguration::getActive()->loadHelpers(array('I18N'));


スポンサーリンク
広告
広告

シェアする

  • このエントリーをはてなブックマークに追加

フォローする

スポンサーリンク
広告