Q&A

 

<?php
if(!defined("__ZBXE__")) exit();

if($called_position!="before_display_content") return;

// applying to only board module 
$oBoardView = &getView('board');
if(Context::getResponseMethod() == "XMLRPC" || Context::getRequestMethod() == 'XMLRPC' || ($oBoardView->act != 'dispBoardContent' )) return;

if(!$addon_info->display) Context::addCssFile('./addons/exif/css/exif.css');
if($addon_info->display=='2') Context::addCssFile('./addons/exif/css/exif2.css');
if($addon_info->display=='3'){
   Context::addCssFile('./addons/exif/css/exif3.css');
} else {
   Context::addJsFile('./addons/exif/js/exif.js', false ,'', null, 'body');
};

require_once("exif.lib.php");

// call getImageExif() with retrieved image path
$pattern_image_tag = "/<img(.*?)(src=\"[^\040]*)(files\/attach\/images\/[^\"]+)+([^>]*?)(>)+/i";
$pattern_documents_area = '/<!--BeforeDocument\([0-9]+,[0-9]+\)-->.+<!--AfterDocument\([0-9]+,[0-9]+\)-->/is';
$output = preg_replace_callback($pattern_documents_area,create_function('$matches',"return preg_replace_callback('$pattern_image_tag', 'getExifData', \$matches[0]);"),
   $output);

?>

 

exif.addons.php 파일입니다.

$output=...;

이 부분을

 

if($is_logged){

이 안으로

}

 

이렇게 넣어줘봤는데 동작을 안하네요 -_-;

이 글을 보면

https://xe1.xpressengine.com/qna/22654548

그렇게 하는게 맞는거 같은데 잘 모르겠습니다. ;ㅁ;

 

애드온 이거 로그인한 회원만 실행해주게 하고 싶은데 다른 방법이 혹시 있을까요?;

이온디 Lv. 13
# 라이믹스 스킨 제작은 어디? >>>> XE 레이아웃, 라이믹스 스킨제작은 이온디에서 커스터마이징해드립니다.
# 빠른 라이믹스 커뮤니티용 호스팅을 찾고 계신가요? >>>> 이온디호스팅 서비스는 PHP8 & Redis 서버 캐시를 활용하여 라이믹스에 최적화된 호스팅 서비스를 제공해드립니다. (서버세팅시 웹패널, 내도메인메일서비스도 함께 구축해드립니다.)
https://eond.com

댓글 2

  • exif.lib.php 파일을 수정했습니다.

    $is_logged = Context::get(is_logged);
       if($is_logged){
          $return_exif = ($exif_info)?
             '<span class="exif_addon2">
    <button onclick="jQuery(this).parent().toggleClass(\'on\')" class="blind"><b title="사진의 정보를 봅니다">EXIF</b><span>X</span></button>
    <strong>EXIF Viewer</strong>'
             .implode($exif_info).
             '</span>'
             :NULL;
          return $return_exif;
       }

    $is_logged 변수를 애드온에서 다시 정의해줘야 했군요.

     

    출처 : https://dev.jdssem.com/addon-that-fetching-document-and-users-data-after-publishing/?

  • 엄지척!