묻고답하기
파일 첨부합니다 제발좀 고쳐주세요 형님들
2016.08.11 23:03
{@
$ds_category = $ci['category_srl']->display == 'Y';
$ds_status = $ci['custom_status']->display == 'Y';
$ds_readed = $ci['readed_count']->display == 'Y';
$ds_voted = $ci['voted_count']->display == 'Y';
$ds_blamed = $ci['blamed_count']->display == 'Y';
$ds_nick = $ci['nick_name']->display == 'Y';
$ds_user = $ci['user_name']->display == 'Y';
$ds_update = $ci['last_update']->display == 'Y';
$ds_updater = $ci['last_updater']->display == 'Y';
$ds_update && $ds_updater ? $ci['last_update']->display = 'N' : 0;
$ci['content']->display = 'N';
$ci['comment']->display = 'N';
$ci['thumbnail']->display = 'N';
$ci['tag']->display = 'N';
$mi->star_style!='N' ? $ci['blamed_count']->display = 'N' : 0;
$mi->star_style!='N' && $ds_voted ? $ci['readed_count']->display = 'N' : 0;
$colcnt = $sotcnt = 0;
$sclms = $exclms = array();
$ds_foot = array($ds_update?'last_update':'regdate');
$is_notice_widget = !$document_srl && $mi->use_notice_widget=='widget';
$a_lsttp = array('notice'=>&$notice_list,'best'=>&$best_list);
}
<block loop="$ci => $key,$val" cond="$val->display=='Y'">
{@
$colcnt += $val->idx<0?1:0;
$val->idx>0&&strpos($val->eid,'rve_star')!==false?$exclms[]=$key:0;
$sclms[$key] = clone $val;
$_tmp = Context::getLang('short_'.$val->eid);
$_tmp !== 'short_'.$val->eid ? $sclms[$key]->name = $_tmp: 0;
}
</block>
{@ $mi->star_style!='N' ? $sclms['voted_count']->name = $lang->star_column : 0}
<!-- LIST -->
<include cond="$is_notice_widget && (count($notice_list) || count($best_list))" target="_etc.noticewidget.html" />
<table id="siLst" class="webz{$mi->display_list_header=='N'?' noheader':''}" width="100%" border="0" cellspacing="0" summary="List of document">
<thead cond="$mi->display_list_header != 'N'" class="scOneCol">
<tr>
<th scope="row" colspan="{$colcnt}">
<div>
<!--@if($mi->display_document_count!='N')-->
<span class="scHaDCnts">
<em>Today</em> <strong>{$oThis->getDocumentCountByDate(date("Ymd"))}</strong>,
<em>Yesterday</em> <strong>{$oThis->getDocumentCountByDate(date("Ymd",strtotime("-1 day", time())))}</strong>,
<em>Total</em> <strong>{$oThis->getDocumentCountByDate()}</strong>
</span>
<!--@else-->
<span loop="$sclms => $key,$val" cond="$val->sort == 'Y'" class="sort"> {@ $sotcnt++}
<a href="{getUrl('sort_index',$key,'order_type',($order_type!='asc'?'asc':'desc'))}">{$val->name}<em class="asc"|cond="$sort_index==$key&&$order_type=='asc'"> </em></a>
</span>
<!--@endif-->
</div>
</th>
<td cond="$grant->manager" class="scCheck sort"><div><input type="checkbox" onclick="XE.checkboxToggleAll({ doClick:true }); return false;" /></div></td>
</tr>
</thead>
{@ $md_optstr = $us_vmodal?'type="example/modal" data-footer="__PID_MODAL_FOOTER__" data-header="__PID_MODAL_HEADER__"':'type="text/html"'}
<block cond="!$is_notice_widget">
<tbody loop="$a_lsttp => $tlk,$p_list" cond="$tlk && count($p_list)" class="{$tlk}">
<block loop="$p_list => $no,$document">
{@
$is_blind = ($tlk!='notice'&&$us_blind)?$oThis->isBlind($document->document_srl):0;
$is_scrap = $ds_scrap?$oThis->isScrap($document->document_srl):0;
$purl = getUrl('','mid',$mid,'document_srl',$document->document_srl,'category_srl',$category_srl,'sort_index',$sort_index,'order_type',$order_type,'search_target',$search_target,'search_keyword',$search_keyword,'page',$spage);
}
<tr {$us_hottrack?'data-hottrack="list"':''}>
<td loop="$sclms => $key,$val" cond="$val->idx<0" scope="col" class="{$key}" style="color:{$val->color}"|cond="$val->color">
<!--@switch($key)-->
<!--@case('no')-->
{@ $no = $tlk?'<img src="img/common/label_'.$tlk.'.gif" alt="'.$tlk.'" />':$no}
{($document->document_srl==$document_srl)?'<strong class="sCkChr">√</strong>':$no}
<!--@break-->
<!--@case('category_srl')-->
{@ $cate = $is_cts?$cts[$document->get('category_srl')]:0 }
<a cond="$cate" href="{getUrl('','mid',$mid,'category_srl',$cate->category_srl)}" title="{htmlspecialchars($cate->description)}" style="color:{$cate->color}"|cond="$cate->color">{$cate->title}</a>
<span cond="!$cate">{$lang->none_category}</span>
<!--@break-->
<!--@case('title')-->
<div class="scElps" data-active="true"|cond="$is_elips">
<a href="{$purl}" {$md_optstr}>{$is_blind?$lang->msg_is_blind:$document->getTitle($mi->title_length)}</a>
<span>
{$document->printExtraImages($mi->duration_new)}<img cond="$ds_mtlng&&count($un_extra->beluxe->langs)" class="scIcoSet world" src="img/common/blank.gif" alt="multilingual" title="multilingual" /><img cond="$is_scrap" class="scIcoSet scrap" src="img/common/blank.gif" alt="Scrap" title="Scrap" />
{@
$t_cmtn = $document->getCommentCount();
$t_tbkn = $document->getTrackbackCount();
}
<em cond="$t_cmtn" class="reply" title="Replies">+{$t_cmtn}</em><em cond="$t_tbkn" class="trackback" title="Trackbacks">.{$t_tbkn}</em>
</span>
</div>
<!--@break-->
<!--@case('nick_name')-->
<!--@case('user_name')-->
{@
$mbsl = $document->get('member_srl');
$home = $document->get('homepage');
$nick = cut_str((!$mbsl||$key=='nick_name')?$document->getNickName():$document->getUserName(), $mi->nickname_length);
}
<i cond="!$mbsl && !$home">{$nick}</i>
<span cond="$mbsl" class="scHLink member_{$mbsl}">{$nick}</span>
<i cond="!$mbsl && $home" class="scHLink" data-href="{$home}">{$nick}</i>
<!--@break-->
<!--@case('custom_status')-->
<span class="custom_status_{(int)$document->get('is_notice')}"|cond="$tlk!='notice'">{$tlk&&$tlk=='notice'?$lang->notice:$cstus[(int)$document->get('is_notice')]}</span>
<!--@break-->
<!--@case('voted_count')-->
<!--@case('blamed_count')-->
<!--@if($mi->star_style!='N')-->
{@
$votedp = (int)$document->get('voted_count');
$blamedp = (int)$document->get('blamed_count');
$totalp = $votedp?(($votedp / ($votedp + abs($blamedp)) * 100) * 0.5):0;
}
<span cond="$ds_readed" class="scRdStar color{$mi->star_style}" title="{$lang->readed_count}">{$document->get('readed_count')}</span>
<span class="scVtStar color{$mi->star_style}" title="{$lang->voted_count}: {$votedp.' / '.$blamedp}"><em style="width:{$totalp}px"></em></span>
<!--@else-->
{$document->get($key)}
<!--@endif-->
<!--@break-->
<!--@case('regdate')-->
<!--@case('last_update')-->
{($key=='regdate')?$document->getRegdate('Y.m.d'):zdate($document->get('last_update'))}
<!--@break-->
<!--@case('last_updater')-->
<!--@if($ds_update && $ds_updater)-->
<span cond="$document->get('last_updater')" title="{$lang->last_updater}">{zdate($document->get('last_update'),'y-m-d')} : <em>{cut_str($document->get('last_updater'), $mi->nickname_length)}</em></span>
<!--@else-->
{cut_str($document->get($key), $mi->nickname_length)}
<!--@endif-->
<!--@break-->
<!--@default-->
{($ci[$key]->idx > 0)?$document->getExtraValueHTML($ci[$key]->idx):$document->get($key)}
<!--@endswitch-->
</td>
<td cond="$grant->manager" class="scCheck"><input type="checkbox" name="cart" value="{$document->document_srl}" onclick="doAddDocumentCart(this)" checked="checked"|cond="$document->isCarted()" /></td>
</tr>
</block>
</tbody>
</block>
<tbody cond="count($document_list)">
<tr>
<td scope="col" colspan="{$colcnt+2}" class="scBox clearBar">
<!--// 표시안되는거 제거, 순서 변경, 임시컬럼추가 -->
{@
$ds_summary = $mi->summary_length != '-1';
$ds_regdate = $sclms['regdate'];
unset($sclms['no']);
unset($sclms['category_srl']);
unset($sclms['nick_name']);
unset($sclms['user_name']);
unset($sclms['readed_count']);
unset($sclms['voted_count']);
unset($sclms['blamed_count']);
unset($sclms['custom_status']);
unset($sclms['thumbnail']);
unset($sclms['content']);
unset($sclms['regdate']);
unset($sclms['last_update']);
unset($sclms['last_updater']);
$sclms = array_merge(array('title'=>null,'starifo'=>null,'mbAifo'=>null), $sclms);
}
<block loop="$document_list => $no,$document">
{@
$is_grant = $grant->view && (!$document->isSecret() || $document->isGranted());
$is_blind = $us_blind?$oThis->isBlind($document->document_srl):0;
$is_scrap = $ds_scrap?$oThis->isScrap($document->document_srl):0;
$purl = getUrl('','mid',$mid,'document_srl',$document->document_srl,'category_srl',$category_srl,'sort_index',$sort_index,'order_type',$order_type,'search_target',$search_target,'search_keyword',$search_keyword,'page',$spage);
$un_extra = ($pt_vtype!='N'||$pt_dtype!='N'||$ao_ppang||$ds_mtlng)?$document->get('extra_vars'):null;
$un_extra = is_string($un_extra)?unserialize($un_extra):$un_extra;
}
<div class="scItem clearBar" style="margin-right:{(int)$mi->thumbnail_width+25}px;" {$us_hottrack?'data-hottrack="webz"':''}>
<div class="scInfo">
<a href="{$purl}" class="thum" style="width:{(int)$mi->thumbnail_width}px;height:{(int)$mi->thumbnail_height}px;" <!--@if($us_slide)-->data-slide="{$is_grant&&!$is_blind?$document->document_srl:'Not permitted.'}"<!--@else-->{$md_optstr}<!--@endif-->>
<!--@if($is_blind || !$is_grant)-->
<img src="img/common/thum_{$is_blind?'blind':'secret'}.png" alt="{$is_blind?'blind':'secret'}" title="{$is_blind?'blind':'secret'}" height="{$mi->thumbnail_height}" width="{$mi->thumbnail_width}" />
<!--@else-->
<!--@if($document->thumbnailExists($mi->thumbnail_width, $mi->thumbnail_height, $mi->thumbnail_type))-->
<img src="{$document->getThumbnail($mi->thumbnail_width, $mi->thumbnail_height, $mi->thumbnail_type)}" border="0" alt="thumbnail" />
<!--@else-->
<img src="img/common/thum_no.png" alt="no image" title="no image" height="{$mi->thumbnail_height}" width="{$mi->thumbnail_width}" />
<!--@endif-->
<!--@endif-->
</a>
<ul class="scFrm clearBar" style="margin-left:{(int)$mi->thumbnail_width+25}px;">
<li loop="$sclms => $key,$val" cond="$key" class="{$key}" style="color:{$val->color}"|cond="$val->color">
<!--@switch($key)-->
<!--@case('title')-->
<div class="scElps" data-active="true"|cond="$is_elips">
<a href="{$purl}" {$md_optstr} style="margin-right:-{(int)$mi->thumbnail_width+25}px;">
<em cond="$pt_vtype!='N'||$pt_dtype!='N'" class="usept {$un_extra->beluxe->adopt_srl?'colBgBlue':''}" title="Point">
{abs((int)$un_extra->beluxe->use_point)}
</em>{$is_blind?$lang->msg_is_blind:$document->getTitle($mi->title_length)}
</a>
<span>
<block cond="$ao_ppang&&$un_extra->ppang&&$un_extra->ppang->d->p>0">
{@$ao_pppt = sprintf($lang->bonus_pang_pang, $un_extra->ppang->d->p)}
<img class="scIcoSet coin" src="img/common/blank.gif" title="{$ao_pppt}" alt="{$ao_pppt}" />
</block>
{$document->printExtraImages($mi->duration_new)}<img class="scIcoSet world" src="img/common/blank.gif" alt="multilingual" title="multilingual" cond="$ds_mtlng&&count($un_extra->beluxe->langs)" /><img cond="$is_scrap" class="scIcoSet scrap" src="img/common/blank.gif" alt="Scrap" title="Scrap" />
{@
$t_cmtn = $document->getCommentCount();
$t_tbkn = $document->getTrackbackCount();
}
<em cond="$t_cmtn" class="reply" title="Replies">+{$t_cmtn}</em><em cond="$t_tbkn" class="trackback" title="Trackbacks">.{$t_tbkn}</em>
</span>
</div>
<!--@break-->
<!--@case('starifo')-->
<div class="scElps">
<div class="fr">
{@
$votedp = (int)$document->get('voted_count');
$uscnt = $oThis->getDocumentVotedLogCount($document->document_srl);
$totalp = round($votedp / $uscnt, 2) * 10;
$totalp = $totalp > 50 ? 50 : $totalp;
}
<span cond="$ds_readed" class="scRdStar color{$mi->star_style}" title="{$lang->readed_count}">{$document->get('readed_count')}</span>
<span class="scVtStar color{$mi->star_style}" title="{$lang->user_voted_count}: {$votedp} / {$lang->voter_count}: {$uscnt}"><em style="width:{$totalp}px"></em></span>
</div>
</div>
<!--@break-->
<!--@case('mbAifo')-->
<block cond="$ds_nick||$ds_user">
<label>{$lang->author}:</label>
{@
$mbsl = $document->get('member_srl');
$home = $document->get('homepage');
$nick = (!$mbsl||$ds_nick)?cut_str($document->getNickName(), $mi->nickname_length):'';
$nick .= ($mbsl&&$ds_user)?($nick?' (':'').cut_str($document->getUserName(), $mi->nickname_length).($nick?')':''):'';
}
<i cond="!$mbsl && !$home">{$nick}</i>
<span cond="$mbsl" class="scHLink member_{$mbsl}">{$nick}</span>
<i cond="!$mbsl && $home" class="scHLink" data-href="{$home}">{$nick}</i>
</block>
<div cond="$ds_category || $ds_status" class="fr">
<block cond="$ds_category">
{@ $cate = $is_cts?$cts[$document->get('category_srl')]:0 }
[<a cond="$cate" href="{getUrl('','mid',$mid,'category_srl',$cate->category_srl)}" title="{htmlspecialchars($cate->description)}" style="color:{$cate->color}"|cond="$cate->color">{$cate->title}</a><span cond="!$cate">{$lang->none_category}</span>]
</block>
<span cond="$ds_status" class="custom_status_{(int)$document->get('is_notice')}">[{$cstus[(int)$document->get('is_notice')]}]</span>
</div>
<!--@break-->
<!--@default-->
<label>{$val->name}:</label>
<!--@if(in_array($key,$exclms))-->
{@
$votedp = (int)$document->getExtraValue($ci[$key]->idx);
$totalp = $votedp?$votedp*10:0;
}
<span class="scVtStar color{$mi->star_style}"><em style="width:{$totalp}px"></em></span>
<!--@else-->
<span>{($ci[$key]->idx > 0)?$document->getExtraValueHTML($ci[$key]->idx):$document->get($key)}</span>
<!--@endif-->
<!--@endswitch-->
</li>
<li cond="!count($exclms)" class="extra_vars0">{$lang->msg_not_star}</li>
<li cond="$ds_summary" class="content" style="color:{$ci['content']->color}"|cond="$ci['content']->color">
{(!$is_grant||$is_blind)?($is_blind?$lang->msg_is_blind:$lang->msg_not_permitted):$document->getSummary($mi->summary_length)}
</li>
</ul>
<div class="wzdate" style="margin-right:-{(int)$mi->thumbnail_width+25}px;">
<block loop="$ds_foot=>$val">
<span>{zdate($document->get($val), ($val=='regdate'&&$ds_update?'Y.m.d':'Y-m-d H:i:s'))}</span>
<span cond="$val=='last_update'&&$ds_updater&&$document->get('last_updater')">by {cut_str($document->get('last_updater'), $mi->nickname_length)}</span>
</block>
<span cond="$grant->manager" class="scCheck"><input type="checkbox" name="cart" value="{$document->document_srl}" onclick="doAddDocumentCart(this)" checked="checked"|cond="$document->isCarted()" /></span>
</div>
<strong cond="$ds_regdate || $ds_update" class="scRibbon {($document->document_srl==$document_srl)?'active':''}"><span class="caption">{$ds_regdate ? $document->getRegdate('M.d') : zdate($document->get('last_update'),'M.d')}</span></strong>
</div>
</div>
</block>
</td>
</tr>
</tbody>
<tbody cond="!count($document_list)"><tr><td colspan="{$colcnt+2}">{$lang->no_documents}</td></tr></tbody>
</table>
<!-- /LIST -->
문제가 되는 php 파일 전문입니다.
문제는
$votedp = (int)$document->getExtraValue($ci[$key]->idx);
$totalp = $votedp?$votedp*10:0;
이부분입니다.
빨간색 된 변수가 값이 무조건 1로 계산되어 집니다..
어디가 오류인지 좀알려주세요 부탁드립니다.
xe가 업데이트 되면서 뭔가 바뀐부분이 있던거 같습니다.
고수님들의 의견 부탁드립니다.
사랑합니다.
해결해주신분께는 소정의 사례를 드릴 계획이 있습니다.