안녕하세요. 도움 늘 감사합니다.
현재 Ultimate Member 플러그인을 쓰고 있습니다.
KBoard 게시판 글쓴이를 클릭했을때 유저 페이지로 이동시키고 싶은데 어떤 유저를 클릭하던 무조건 로그인한 계정의 프로필페이지로 이동이 되네요....
아래 링크를 보고 따라 해봤는데, 예전 글이라 그런건지 잘 안되네요.
functions.php파일 수정으로도 해보고, 사용중인 스킨의 list.php가서 변경했는데 두개다 로그인한 계정의 프로필 페이지로 이동되네요 ㅠ
http://www.cosmosfarm.com/threads/document/13203
http://www.cosmosfarm.com/threads/document/16427
아래는 현재 적용한 list.php 입니다.
------------------------------------------------------------------------
<div id="kboard-default-list">
<!-- 게시판 정보 시작 -->
<div class="kboard-list-header">
<?php if(!$board->isPrivate()):?>
<div class="kboard-total-count">
<?php echo __('Total', 'kboard')?> <?php echo number_format($board->getListTotal())?>
</div>
<?php endif?>
<div class="kboard-sort">
<form id="kboard-sort-form-<?php echo $board->id?>" method="get" action="<?php echo $url->toString()?>">
<?php echo $url->set('pageid', '1')->set('category1', '')->set('category2', '')->set('target', '')->set('keyword', '')->set('mod', 'list')->set('kboard_list_sort_remember', $board->id)->toInput()?>
<select name="kboard_list_sort" onchange="jQuery('#kboard-sort-form-<?php echo $board->id?>').submit();">
<option value="newest"<?php if($list->getSorting() == 'newest'):?> selected<?php endif?>><?php echo __('Newest', 'kboard')?></option>
<option value="best"<?php if($list->getSorting() == 'best'):?> selected<?php endif?>><?php echo __('Best', 'kboard')?></option>
<option value="viewed"<?php if($list->getSorting() == 'viewed'):?> selected<?php endif?>><?php echo __('Viewed', 'kboard')?></option>
<option value="updated"<?php if($list->getSorting() == 'updated'):?> selected<?php endif?>><?php echo __('Updated', 'kboard')?></option>
</select>
</form>
</div>
</div>
<!-- 게시판 정보 끝 -->
<?php if($board->use_category == 'yes'):?>
<!-- 카테고리 시작 -->
<div class="kboard-category category-mobile">
<form id="kboard-category-form-<?php echo $board->id?>" method="get" action="<?php echo $url->toString()?>">
<?php echo $url->set('pageid', '1')->set('category1', '')->set('category2', '')->set('target', '')->set('keyword', '')->set('mod', 'list')->toInput()?>
<?php if($board->initCategory1()):?>
<select name="category1" onchange="jQuery('#kboard-category-form-<?php echo $board->id?>').submit();">
<option value=""><?php echo __('All', 'kboard')?></option>
<?php while($board->hasNextCategory()):?>
<option value="<?php echo $board->currentCategory()?>"<?php if(kboard_category1() == $board->currentCategory()):?> selected<?php endif?>><?php echo $board->currentCategory()?></option>
<?php endwhile?>
</select>
<?php endif?>
<?php if($board->initCategory2()):?>
<select name="category2" onchange="jQuery('#kboard-category-form-<?php echo $board->id?>').submit();">
<option value=""><?php echo __('All', 'kboard')?></option>
<?php while($board->hasNextCategory()):?>
<option value="<?php echo $board->currentCategory()?>"<?php if(kboard_category2() == $board->currentCategory()):?> selected<?php endif?>><?php echo $board->currentCategory()?></option>
<?php endwhile?>
</select>
<?php endif?>
</form>
</div>
<div class="kboard-category category-pc">
<?php if($board->initCategory1()):?>
<ul class="kboard-category-list">
<li<?php if(!kboard_category1()):?> class="kboard-category-selected"<?php endif?>><a href="<?php echo $url->set('category1', '')->set('pageid', '1')->set('target', '')->set('keyword', '')->set('mod', 'list')->tostring()?>"><?php echo __('All', 'kboard')?></a></li>
<?php while($board->hasNextCategory()):?>
<li<?php if(kboard_category1() == $board->currentCategory()):?> class="kboard-category-selected"<?php endif?>>
<a href="<?php echo $url->set('category1', $board->currentCategory())->set('pageid', '1')->set('target', '')->set('keyword', '')->set('mod', 'list')->toString()?>"><?php echo $board->currentCategory()?></a>
</li>
<?php endwhile?>
</ul>
<?php endif?>
<?php if($board->initCategory2()):?>
<ul class="kboard-category-list">
<li<?php if(!kboard_category2()):?> class="kboard-category-selected"<?php endif?>><a href="<?php echo $url->set('category2', '')->set('pageid', '1')->set('target', '')->set('keyword', '')->set('mod', 'list')->tostring()?>"><?php echo __('All', 'kboard')?></a></li>
<?php while($board->hasNextCategory()):?>
<li<?php if(kboard_category2() == $board->currentCategory()):?> class="kboard-category-selected"<?php endif?>>
<a href="<?php echo $url->set('category2', $board->currentCategory())->set('pageid', '1')->set('target', '')->set('keyword', '')->set('mod', 'list')->toString()?>"><?php echo $board->currentCategory()?></a>
</li>
<?php endwhile?>
</ul>
<?php endif?>
</div>
<!-- 카테고리 끝 -->
<?php endif?>
<!-- 리스트 시작 -->
<div class="kboard-list">
<table>
<thead>
<tr>
<td class="kboard-list-uid"><?php echo __('Number', 'kboard')?></td>
<!--수정-->
<?php if($board->use_category == 'yes'):?>
<?php if($board->initCategory1()):?>
<td class="kboard-list-category1">카테고리</td>
<?php endif?>
<?php if($board->initCategory2()):?>
<td class="kboard-list-category2">카테고리2</td>
<?php endif?>
<?php endif?>
<!--수정-->
<td class="kboard-list-title"><?php echo __('Title', 'kboard')?></td>
<td class="kboard-list-user"><?php echo __('Author', 'kboard')?></td>
<td class="kboard-list-date"><?php echo __('Date', 'kboard')?></td>
<td class="kboard-list-vote"><?php echo __('Votes', 'kboard')?></td>
<td class="kboard-list-view"><?php echo __('Views', 'kboard')?></td>
</tr>
</thead>
<tbody>
<?php while($content = $list->hasNextNotice()):?>
<tr class="kboard-list-notice<?php if($content->uid == kboard_uid()):?> kboard-list-selected<?php endif?>">
<td class="kboard-list-uid"><?php echo __('Notice', 'kboard')?></td>
<!--수정-->
<?php if($board->use_category == 'yes'):?>
<?php if($board->initCategory1()):?>
<td class="kboard-list-category1"><?php echo $content->category1?></td>
<?php endif?>
<?php if($board->initCategory2()):?>
<td class="kboard-list-category2"><?php echo $content->category2?></td>
<?php endif?>
<?php endif?>
<!--수정끝-->
<td class="kboard-list-title">
<a href="<?php echo $url->set('uid', $content->uid)->set('mod', 'document')->toString()?>">
<div class="kboard-default-cut-strings">
<?php if($content->isNew()):?><span class="kboard-default-new-notify">New</span><?php endif?>
<?php if($content->secret):?><img src="<?php echo $skin_path?>/images/icon-lock.png" alt="<?php echo __('Secret', 'kboard')?>"><?php endif?>
<?php echo $content->title?>
<span class="kboard-comments-count"><?php echo $content->getCommentsCount()?></span>
</div>
</a>
<div class="kboard-mobile-contents">
<span class="contents-item"><a href="http://balchagi.net/user/<?php echo $content->member_uid?>"><?php echo apply_filters('kboard_user_display', $content->member_uid, $content->member_display, 'kboard', $boardBuilder)?></span>
<span class="contents-separator">|</span>
<span class="contents-item"><?php echo $content->getDate()?></span>
<span class="contents-separator">|</span>
<span class="contents-item"><?php echo __('Votes', 'kboard')?> <?php echo $content->vote?></span>
<span class="contents-separator">|</span>
<span class="contents-item"><?php echo __('Views', 'kboard')?> <?php echo $content->view?></span>
</div>
</div>
</td>
<td class="kboard-list-user"><a href="http://balchagi.net/user/<?php echo $content->member_uid?>"><?php echo apply_filters('kboard_user_display', $content->member_display, $content->member_uid, $content->member_display, 'kboard', $boardBuilder)?></td>
<td class="kboard-list-date"><?php echo $content->getDate()?></td>
<td class="kboard-list-vote"><?php echo $content->vote?></td>
<td class="kboard-list-view"><?php echo $content->view?></td>
</tr>
<?php endwhile?>
<?php while($content = $list->hasNext()):?>
<tr class="<?php if($content->uid == kboard_uid()):?>kboard-list-selected<?php endif?>">
<td class="kboard-list-uid"><?php echo $list->index()?></td>
<!--수정-->
<?php if($board->use_category == 'yes'):?>
<?php if($board->initCategory1()):?>
<td class="kboard-list-category1"><?php echo $content->category1?></td>
<?php endif?>
<?php if($board->initCategory2()):?>
<td class="kboard-list-category2"><?php echo $content->category2?></td>
<?php endif?>
<?php endif?>
<!--수정끝-->
<td class="kboard-list-title">
<a href="<?php echo $url->set('uid', $content->uid)->set('mod', 'document')->toString()?>">
<div class="kboard-default-cut-strings">
<?php if($content->isNew()):?><span class="kboard-default-new-notify">New</span><?php endif?>
<?php if($content->secret):?><img src="<?php echo $skin_path?>/images/icon-lock.png" alt="<?php echo __('Secret', 'kboard')?>"><?php endif?>
<?php echo $content->title?>
<span class="kboard-comments-count"><?php echo $content->getCommentsCount()?></span>
</div>
</a>
<div class="kboard-mobile-contents">
<?php if($board->use_category == 'yes'):?>
<?php if($board->initCategory1()):?>
<span class="kboard-list-category1"><?php echo $content->category1?></span>
<span class="contents-separator">|</span>
<?php endif?>
<?php if($board->initCategory2()):?>
<span class="kboard-list-category2"><?php echo $content->category2?></span>
<span class="contents-separator">|</span>
<?php endif?>
<?php endif?>
<span class="contents-item"><a href="http://balchagi.net/user/<?php echo $content->member_uid?>"><?php echo apply_filters('kboard_user_display', $content->member_display, $content->member_uid, $content->member_display, 'kboard', $boardBuilder)?></a></span>
<!--
<span class="contents-separator">|</span>
<span class="contents-item"><?php echo $content->getDate()?></span>
<span class="contents-separator">|</span>
<span class="contents-item"><?php echo __('Votes', 'kboard')?> <?php echo $content->vote?></span>
<span class="contents-separator">|</span>
<span class="contents-item"><?php echo __('Views', 'kboard')?> <?php echo $content->view?></span>
-->
</div>
</td>
<td class="kboard-list-user"><a href="http://balchagi.net/user/<?php echo $content->member_uid?>"><?php echo apply_filters('kboard_user_display', $content->member_display, $content->member_uid, $content->member_display, 'kboard', $boardBuilder)?></a></td>
<td class="kboard-list-date"><?php echo $content->getDate()?></td>
<td class="kboard-list-vote"><?php echo $content->vote?></td>
<td class="kboard-list-view"><?php echo $content->view?></td>
</tr>
<?php $boardBuilder->builderReply($content->uid)?>
<?php endwhile?>
</tbody>
</table>
</div>
<!-- 리스트 끝 -->
<!-- 페이징 시작 -->
<div class="kboard-pagination">
<ul class="kboard-pagination-pages">
<?php echo kboard_pagination($list->page, $list->total, $list->rpp)?>
</ul>
</div>
<!-- 페이징 끝 -->
<!-- 검색폼 시작 -->
<div class="kboard-search">
<form id="kboard-search-form-<?php echo $board->id?>" method="get" action="<?php echo $url->toString()?>">
<?php echo $url->set('pageid', '1')->set('target', '')->set('keyword', '')->set('mod', 'list')->toInput()?>
<select name="target">
<option value=""><?php echo __('All', 'kboard')?></option>
<option value="title"<?php if(kboard_target() == 'title'):?> selected="selected"<?php endif?>><?php echo __('Title', 'kboard')?></option>
<option value="content"<?php if(kboard_target() == 'content'):?> selected="selected"<?php endif?>><?php echo __('Content', 'kboard')?></option>
<option value="member_display"<?php if(kboard_target() == 'member_display'):?> selected="selected"<?php endif?>><?php echo __('Author', 'kboard')?></option>
</select>
<input type="text" name="keyword" value="<?php echo kboard_keyword()?>">
<button type="submit" class="kboard-default-button-small"><?php echo __('Search', 'kboard')?></button>
</form>
</div>
<!-- 검색폼 끝 -->
<?php if($board->isWriter()):?>
<!-- 버튼 시작 -->
<div class="kboard-control">
<a href="<?php echo $url->set('mod', 'editor')->toString()?>" class="kboard-default-button-small"><?php echo __('New', 'kboard')?></a>
</div>
<!-- 버튼 끝 -->
<?php endif?>
</div>
안녕하세요~^^
올려주신 소스코드에 아래와 같이 링크가 되어있습니다.
<a href="http://balchagi.net/user/<?php echo $content->member_uid?>">
이 코드만 보면 특별한 문제는 없거든요.
현재 로그인한 계정이 아니라 글쓴이의 ID값이 출력되는 코드를 정확하게 사용해주셨습니다.
그렇다면 "http://balchagi.net/user/" 이 주소가 정확한지 문제 없는지 확인 해보셔야합니다.
"http://balchagi.net/user/1" 혹은 "http://balchagi.net/user/2" 등 실제로 접근하는데는 문제가 없는지요?
글 올려주실 때 에디터의 "코드 스니펫 삽입" 기능으로 코드를 올려주시는게 더욱 좋습니다.
고맙습니다.
답변 감사합니다.
링크를 확인해보니 "http://balchagi.net/user/유저ID" 로 이동이 되야하네요.
uid의 값이 유저의 ID인가요? 고유넘버인가요?
그리고, 게시판 리스트에서 글쓴이 이름이 ID가 아닌 닉네임으로 표시가 되어있는데,
그때문에 링크를 못찾아서 "http://balchagi.net/user/닉네임"으로 이동이 될 수 있나요?
안녕하세요.
KBoard 게시판 플러그인에서 로그인한 사용자가 게시글을 작성할 때
작성자는 공개적으로 표시할 이름을 활용하고 있습니다.
워드프레스 관리자 -> 사용자 -> 나의 프로필 페이지에서
공개적으로 표시할 이름 설정이 display_name 입니다.
워드프레스는 공개적으로 표시할 이름을 아이디, 닉네임, 이메일 등으로 선택해서 사용할 수 있도록 되어있습니다.
말씀하신 member_uid는 사용자의 고유 넘버입니다.
아래의 코드를 보시면 화면에 표시는 공개적으로 표시할 이름으로 하고 있지만
실제 링크는 member_uid로 적용이 되어있기 때문에 "http://balchagi.net/user/닉네임"으로 이동이 될 수 없습니다.
<a href="http://balchagi.net/user/<?php echo $content->member_uid?>"><?php echo apply_filters('kboard_user_display', $content->member_uid, $content->member_display, 'kboard', $boardBuilder)?></a>
고맙습니다.
원인을 찾았네요.
Ultimate Member Plugin 설정에서
Gneral - Users - Profile Permalink Base - User ID 로 변경하면 되네요!
다른분들도 도움되라고 알려드려요~