Skip to content

Commit

Permalink
투표 결과 테마스킨 적용 오류 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
chicpro committed Aug 4, 2015
1 parent 6beff3a commit 82c12f6
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 14 deletions.
23 changes: 18 additions & 5 deletions bbs/poll_result.php
Expand Up @@ -85,12 +85,25 @@
$list3[$i]['subject'] = cut_str($row2['po_subject'],60,"");
}

if (G5_IS_MOBILE) {
$poll_skin_path = G5_MOBILE_PATH.'/'.G5_SKIN_DIR.'/poll/'.$skin_dir;
$poll_skin_url = G5_MOBILE_URL.'/'.G5_SKIN_DIR.'/poll/'.$skin_dir;
if(preg_match('#^theme/(.+)$#', $skin_dir, $match)) {
if (G5_IS_MOBILE) {
$poll_skin_path = G5_THEME_MOBILE_PATH.'/'.G5_SKIN_DIR.'/poll/'.$match[1];
if(!is_dir($poll_skin_path))
$poll_skin_path = G5_THEME_PATH.'/'.G5_SKIN_DIR.'/poll/'.$match[1];
$poll_skin_url = str_replace(G5_PATH, G5_URL, $poll_skin_path);
} else {
$poll_skin_path = G5_THEME_PATH.'/'.G5_SKIN_DIR.'/poll/'.$match[1];
$poll_skin_url = str_replace(G5_PATH, G5_URL, $poll_skin_path);
}
//$skin_dir = $match[1];
} else {
$poll_skin_path = G5_SKIN_PATH.'/poll/'.$skin_dir;
$poll_skin_url = G5_SKIN_URL.'/poll/'.$skin_dir;
if (G5_IS_MOBILE) {
$poll_skin_path = G5_MOBILE_PATH.'/'.G5_SKIN_DIR.'/poll/'.$skin_dir;
$poll_skin_url = G5_MOBILE_URL.'/'.G5_SKIN_DIR.'/poll/'.$skin_dir;
} else {
$poll_skin_path = G5_SKIN_PATH.'/poll/'.$skin_dir;
$poll_skin_url = G5_SKIN_URL.'/poll/'.$skin_dir;
}
}

include_once(G5_PATH.'/head.sub.php');
Expand Down
2 changes: 1 addition & 1 deletion lib/poll.lib.php
Expand Up @@ -25,7 +25,7 @@ function poll($skin_dir='basic', $po_id=false)
$poll_skin_path = G5_THEME_PATH.'/'.G5_SKIN_DIR.'/poll/'.$match[1];
$poll_skin_url = str_replace(G5_PATH, G5_URL, $poll_skin_path);
}
$skin_dir = $match[1];
//$skin_dir = $match[1];
} else {
if (G5_IS_MOBILE) {
$poll_skin_path = G5_MOBILE_PATH.'/'.G5_SKIN_DIR.'/poll/'.$skin_dir;
Expand Down
4 changes: 2 additions & 2 deletions theme/basic/mobile/skin/poll/basic/poll.skin.php
Expand Up @@ -7,7 +7,7 @@

<form name="fpoll" action="<?php echo G5_BBS_URL ?>/poll_update.php" onsubmit="return fpoll_submit(this);" method="post">
<input type="hidden" name="po_id" value="<?php echo $po_id ?>">
<input type="hidden" name="skin_dir" value="<?php echo $skin_dir ?>">
<input type="hidden" name="skin_dir" value="<?php echo urlencode($skin_dir); ?>">
<aside id="poll">
<header>
<h2>설문조사</h2>
Expand All @@ -21,7 +21,7 @@
</ul>
<footer>
<input type="submit" value="투표하기">
<a href="<?php echo G5_BBS_URL."/poll_result.php?po_id=$po_id&amp;skin_dir=$skin_dir" ?>" target="_blank" onclick="poll_result(this.href); return false;">결과보기</a>
<a href="<?php echo G5_BBS_URL."/poll_result.php?po_id=$po_id&amp;skin_dir=".urlencode($skin_dir); ?>" target="_blank" onclick="poll_result(this.href); return false;">결과보기</a>
</footer>
</aside>
</form>
Expand Down
4 changes: 2 additions & 2 deletions theme/basic/mobile/skin/poll/basic/poll_result.skin.php
Expand Up @@ -56,7 +56,7 @@
<form name="fpollresult" method="post" action="./poll_etc_update.php" onsubmit="return fpollresult_submit(this);" autocomplete="off">
<input type="hidden" name="po_id" value="<?php echo $po_id ?>">
<input type="hidden" name="w" value="">
<input type="hidden" name="skin_dir" value="<?php echo $skin_dir ?>">
<input type="hidden" name="skin_dir" value="<?php echo urlencode($skin_dir); ?>">
<?php if ($is_member) { ?><input type="hidden" name="pc_name" value="<?php echo cut_str($member['mb_nick'],255) ?>"><?php } ?>
<h3><?php echo $po_etc ?></h3>

Expand Down Expand Up @@ -93,7 +93,7 @@
<h2>다른 투표 결과 보기</h2>
<ul>
<?php for ($i=0; $i<count($list3); $i++) { ?>
<li><a href="./poll_result.php?po_id=<?php echo $list3[$i]['po_id'] ?>&amp;skin_dir=<?php echo $skin_dir ?>">[<?php echo $list3[$i]['date'] ?>] <?php echo $list3[$i]['subject'] ?></a></li>
<li><a href="./poll_result.php?po_id=<?php echo $list3[$i]['po_id'] ?>&amp;skin_dir=<?php echo urlencode($skin_dir); ?>">[<?php echo $list3[$i]['date'] ?>] <?php echo $list3[$i]['subject'] ?></a></li>
<?php } ?>
</ul>
</aside>
Expand Down
4 changes: 2 additions & 2 deletions theme/basic/skin/poll/basic/poll.skin.php
Expand Up @@ -8,7 +8,7 @@
<!-- 설문조사 시작 { -->
<form name="fpoll" action="<?php echo G5_BBS_URL ?>/poll_update.php" onsubmit="return fpoll_submit(this);" method="post">
<input type="hidden" name="po_id" value="<?php echo $po_id ?>">
<input type="hidden" name="skin_dir" value="<?php echo $skin_dir ?>">
<input type="hidden" name="skin_dir" value="<?php echo urlencode($skin_dir); ?>">
<section id="poll">
<header>
<h2>설문조사</h2>
Expand All @@ -22,7 +22,7 @@
</ul>
<footer>
<input type="submit" value="투표하기">
<a href="<?php echo G5_BBS_URL."/poll_result.php?po_id=$po_id&amp;skin_dir=$skin_dir" ?>" target="_blank" onclick="poll_result(this.href); return false;">결과보기</a>
<a href="<?php echo G5_BBS_URL."/poll_result.php?po_id=$po_id&amp;skin_dir=".urlencode($skin_dir); ?>" target="_blank" onclick="poll_result(this.href); return false;">결과보기</a>
</footer>
</section>
</form>
Expand Down
4 changes: 2 additions & 2 deletions theme/basic/skin/poll/basic/poll_result.skin.php
Expand Up @@ -60,7 +60,7 @@
<form name="fpollresult" action="./poll_etc_update.php" onsubmit="return fpollresult_submit(this);" method="post" autocomplete="off">
<input type="hidden" name="po_id" value="<?php echo $po_id ?>">
<input type="hidden" name="w" value="">
<input type="hidden" name="skin_dir" value="<?php echo $skin_dir ?>">
<input type="hidden" name="skin_dir" value="<?php echo urlencode($skin_dir); ?>">
<?php if ($is_member) { ?><input type="hidden" name="pc_name" value="<?php echo cut_str($member['mb_nick'],255) ?>"><?php } ?>
<h3><?php echo $po_etc ?></h3>

Expand Down Expand Up @@ -102,7 +102,7 @@
<h2>다른 투표 결과 보기</h2>
<ul>
<?php for ($i=0; $i<count($list3); $i++) { ?>
<li><a href="./poll_result.php?po_id=<?php echo $list3[$i]['po_id'] ?>&amp;skin_dir=<?php echo $skin_dir ?>">[<?php echo $list3[$i]['date'] ?>] <?php echo $list3[$i]['subject'] ?></a></li>
<li><a href="./poll_result.php?po_id=<?php echo $list3[$i]['po_id'] ?>&amp;skin_dir=<?php echo urlencode($skin_dir); ?>">[<?php echo $list3[$i]['date'] ?>] <?php echo $list3[$i]['subject'] ?></a></li>
<?php } ?>
</ul>
</aside>
Expand Down

0 comments on commit 82c12f6

Please sign in to comment.