포인트 선물 기능 모바일에서 먹동 현상 도와주세요

2022-07-09 (토) 23:58:21 2,712

안녕하세요

포인트 선물 기능을 하려고 이분 파일을 다운받아서 올리는데, PC버전에서는 정상으로 보이는데,

모바일버전에서는 흰 화면만 나타나는데 어떤 문제인지 알수 있을가요?

https://sir.kr/g5_plugin/5752

고수님들 부탁합니다

============

bbs 파일

point_gift.php

Copy
<?php
include_once('./_common.php');
include_once(G5_CAPTCHA_PATH.'/captcha.lib.php');

if ($is_guest)
    alert_close('회원만 이용하실 수 있습니다.');

$g5['title'] = "포인트 선물";
include_once(G5_PATH.'/head.sub.php');

$point_gift_action_url = G5_HTTPS_BBS_URL."/point_gift_update.php";
include_once($member_skin_path.'/point_gift.skin.php');

include_once(G5_PATH.'/tail.sub.php');
?>

--------------------

point_gift_update.php

Copy
<?php
include_once('./_common.php');
include_once(G5_CAPTCHA_PATH.'/captcha.lib.php');

if ($is_guest)
    alert('회원만 이용하실 수 있습니다.');

if (!chk_captcha()) {
    alert('자동등록방지 숫자가 틀렸습니다.');
}

$mb = get_member($me_recv_mb_id);

if (!$mb['mb_id'])
    alert('존재하지 않는 회원입니다.');

if ($mb['mb_id'] == $member['mb_id'])
    alert('자신한테는 선물할 수 없습니다.');

$max_point = 10000;

if ($point > $max_point)
    alert('최대 선물 포인트는 '.number_format($max_point).'P 입니다.');

if ($member['mb_point'] < $point)
    alert('포인트가 부족합니다.');

insert_point($member['mb_id'], "-".$point, $mb['mb_nick']."님에게 ".number_format($point)."P를 선물했습니다.", '@passive', $member['mb_id'], $member['mb_id'].'-'.uniqid(''));
insert_point($mb['mb_id'], "+".$point, $member['mb_nick']."님한테서 ".number_format($point)."P를 선물받았습니다.", '@passive', $mb['mb_id'], $member['mb_id'].'-'.uniqid(''));

alert_close('포인트를 정상적으로 선물했습니다.');
?>

==========

skin\member\basic

Copy
<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가

// add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨
add_stylesheet('<link rel="stylesheet" href="'.$member_skin_url.'/style.css">', 0);
?>

<div id="point_gift" class="new_win">
    <h1 id="win_title"><i class="fa fa-database" aria-hidden="true"></i> <?php echo $g5['title'] ?></h1>

    <div class="new_win_con">
        <form name="fgiftform" action="<?php echo $point_gift_action_url ?>" onsubmit="return fgiftform_submit(this);" method="post" autocomplete="off">
            <div class="form_01">
                <h2 class="sound_only"><?php echo $g5['title'] ?></h2>
                <ul>
                    <li>
                        <label for="me_recv_mb_id" class="sound_only">받는 회원아이디<strong>필수</strong></label>
                        <input type="text" name="me_recv_mb_id" id="me_recv_mb_id" required class="frm_input full_input required" size="47" placeholder="받는 회원아이디">
                    </li>
                    <li>
                        <label for="point" class="sound_only">받는 회원아이디<strong>필수</strong></label>
                        <input type="text" name="point" id="point" required class="frm_input full_input required" size="20" placeholder="선물할 포인트">
                    </li>
                    <li>
                        <span class="sound_only">자동등록방지</span>

                        <?php echo captcha_html(); ?>

                    </li>
                </ul>
            </div>

            <div class="win_btn">
                <input type="submit" value="보내기" id="btn_submit" class="btn_submit">
                <button type="button" onclick="window.close();" class="btn_close">창닫기</button>
            </div>
        </form>
    </div>

    <button type="button" onclick="javascript:window.close();" class="btn_close">창닫기</button>
</div>

<script>
function fgiftform_submit(f)
{
    <?php echo chk_captcha_js();  ?>

    return true;
}
</script>

==================

답변 3개 / 댓글 6개

흰 화면만 나오는건 오류가 나서 안보이는것이기에 오류를 보여지게 하면서 기능 수정을 조금 보셔야 할듯 합니다.

리오닥터님 , 에러 코드를 넣고 보니  아래 위치로 나오는데 이거 무슨 뜻인가요?

소스가 너무 많아서 일부반 올립니다

/lib/common.lib.php on line 3361

thumb-3076936120_1657381163.7388_730x806.png

Copy
if( $mb_id ){
        if( isset($member_cache[$mb_id]) ){
            $src = $member_cache[$mb_id];
        } else {
            $member_img = G5_DATA_PATH.'/member_image/'.substr($mb_id,0,2).'/'.$mb_id.'.gif';
            if (is_file($member_img)) {
                $member_cache[$mb_id] = $src = str_replace(G5_DATA_PATH, G5_DATA_URL, $member_img);
            }
        }
    }

    if( !$src ){
        if( !empty($no_profile_cache) ){
            $src = $no_profile_cache;
        } else {
            // 프로필 이미지가 없을때 기본 이미지
            $no_profile_img = (defined('G5_THEME_NO_PROFILE_IMG') && G5_THEME_NO_PROFILE_IMG) ? G5_THEME_NO_PROFILE_IMG : G5_NO_PROFILE_IMG;
            $tmp = array();
            preg_match( '/src="([^"]*)"/i', $foo, $tmp );
            $no_profile_cache = $src = isset($tmp[1]) ? $tmp[1] : G5_IMG_URL.'/no_profile.gif';
        }
    }

    if( $src ){
        $attributes = array('src'=>$src, 'width'=>$width, 'height'=>$height, 'alt'=>$alt, 'title'=>$title);

        $output = '<img';
        foreach ($attributes as $name => $value) {
            if (!empty($value)) {
                $output .= sprintf(' %s="%s"', $name, $value);
            }
        }
        $output .= '>';

        return $output;
    }

    return '';
}

답변에 대한 댓글 2개

저거는 정규식 함수이구요 이미지에서 문제가 있는것같은데 프로필 이미지 안쓰신다면 주석 처리 해도 될것같아요
프로필 부분 소스 삭제하니 에러는 없어졌는데 포인트선물 화면은 안나오네요,
아무조록 감사합니다.
2022-07-10 (일) 00:05:00

에러를 오픈해서 확인해서 수정하는수밖에 없어요

에러리포트 이거를 해당 페이지 상위에 넣어서 확인해보세요

error_reporting(E_ALL);
ini_set('display_errors', '1');

답변에 대한 댓글 4개

네 감사합니다 뭐라도 알려주신거 시도해보겠습니다
먹통이 되는 원인은 많아서요
에러를 확인해보시고 구글링으로 검색해서 수정하시던지..
아님 제작 의뢰를 해야되요
일단 누락된게 있지 않을까 예상됩니다
[code]

if( !$src ){
if( !empty($no_profile_cache) ){
$src = $no_profile_cache;
} else {
// 프로필 이미지가 없을때 기본 이미지
$no_profile_img = (defined('G5_THEME_NO_PROFILE_IMG') && G5_THEME_NO_PROFILE_IMG) ? G5_THEME_NO_PROFILE_IMG : G5_NO_PROFILE_IMG;
$tmp = array();


/lib/common.lib.php on line 3361 여기라인 preg_match( '/src="([^"]*)"/i', $foo, $tmp );


$no_profile_cache = $src = isset($tmp[1]) ? $tmp[1] : G5_IMG_URL.'/no_profile.gif';
}
}

[/code]

에로코드 들어가보니 ,여기 소스라인 인데 도저히 무슨 뜻인지 모르겠어요
혹시 이거 버전떄가 몇인가요? 최신꺼 아니면 이전버전이면 최신꺼 다운받아서 해당 일부분을 소스 바꿔놓아서 덮어씌어보세요

답변을 작성하려면 로그인이 필요합니다.