Support ⇒ CPG-BB (forum) ⇒ Adding Profile Link to Postbit ⇒ Community Forums ⇒ CPG Dragonfly™ CMS
Forum Index Modules & Blocks CPG-BB (forum)

Adding Profile Link to Postbit Reply to topic


I've tried many things but could not get the username in the forums postbit to link to the users profile.

My viewtopic_body postbit section:

<!-- BEGIN postrow --> <tr> <td style="width:150px;" align="left" valign="top" class="{postrow.ROW_CLASS}"><span class="name"><a name="{postrow.U_POST_ID}"></a><b>{postrow.POSTER_NAME}</b></span><br /><span class="postdetails">{postrow.POSTER_RANK}<br />{postrow.RANK_IMAGE}{postrow.RANK_IMAGE_S}<!-- IF postrow.S_CLOAK eq 0 -->{postrow.POSTER_AVATAR}<br />{postrow.ONLINE_IMG}<br />{postrow.POSTER_JOINED}<br />{postrow.POSTER_POSTS}<br />{postrow.POSTER_FROM}<!-- ENDIF -->

I need something like this:
<a href="{profile url}"><b>{postrow.POSTER_NAME}</b></a>

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Windows 8 / Apache: 2.2.24 / MySQL: 5.1.71 / PHP: 5.4.17 / Dragonfly: LATEST VERSION


I don't advocate using PHP embedded in a template. But if you think you really need this, then you can see an example here:
github.com/layingback/....html#L242

You only need:
<!-- PHP --> $cpgtpl->assign_var('U_USER_ACCOUNT',getlink('Your_Account&amp;profile='.$this->_tpldata['postrow'][$this->_postrow_i]['POSTER_NAME'])); <!-- ENDPHP --> <a href="{U_USER_ACCOUNT}" ...


maze, nano, phoenix: It would be nicer to add this in future to core php in Dragonfly, though (seems like a reasonable idea to make the username clickable).

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
-


Yeah, instead of having the extra 'profile' icon...

.:: I met php the 03 December 2003 :: Unforgettable day! ::.

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
CloudLinux / Apache 2.4 LSAPI / MySQLi 5.6 / PHP 5.6 / DCVS


This never really answered my question the code you provided does not work I tried:

<?php $cpgtpl->assign_var('U_USER_ACCOUNT',getlink('Your_Account&amp;profile='.$this->_tpldata['postrow'][$this->_postrow_i]['POSTER_NAME'])); ?> <a href="{U_USER_ACCOUNT}">{postrow.POSTER_NAME}</a>

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Windows 8 / Apache: 2.2.24 / MySQL: 5.1.71 / PHP: 5.4.17 / Dragonfly: LATEST VERSION


Yes it does work.

themes/default/template/forums/viewtopic.html

Change: <!-- BEGIN postrow --> <tr> <td style="width:150px;" align="left" valign="top" class="{postrow.ROW_CLASS}"><span class="name"><a name="{postrow.U_POST_ID}"></a><b>{postrow.POSTER_NAME}</b></span><br /><span class="postdetails">{postrow.POSTER_RANK}<br />{postrow.RANK_IMAGE}<!-- IF postrow.S_CLOAK eq 0 -->{postrow.POSTER_AVATAR}<br />{postrow.ONLINE_IMG}<br />{postrow.POSTER_JOINED}<br />{postrow.POSTER_POSTS}<br />{postrow.POSTER_FROM}<!-- ENDIF --><br /></span></td>

To: <!-- BEGIN postrow --> <!-- PHP --> global $cpgtpl; $cpgtpl->assign_var('U_USER_ACCOUNT',getlink('Your_Account&amp;profile='.$this->_tpldata['postrow'][$this->_postrow_i]['POSTER_NAME'])); <!-- ENDPHP --> <tr> <td style="width:150px;" align="left" valign="top" class="{postrow.ROW_CLASS}"><span class="name"><a name="{postrow.U_POST_ID}"></a><a href="{U_USER_ACCOUNT}"><b>{postrow.POSTER_NAME}</b></a></span><br /><span class="postdetails">{postrow.POSTER_RANK}<br />{postrow.RANK_IMAGE}<!-- IF postrow.S_CLOAK eq 0 -->{postrow.POSTER_AVATAR}<br />{postrow.ONLINE_IMG}<br />{postrow.POSTER_JOINED}<br />{postrow.POSTER_POSTS}<br />{postrow.POSTER_FROM}<!-- ENDIF --><br /></span></td>

.:: I met php the 03 December 2003 :: Unforgettable day! ::.

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
CloudLinux / Apache 2.4 LSAPI / MySQLi 5.6 / PHP 5.6 / DCVS

All times are UTC


Jump to: