Page 1 of 1

Custom Content in Forum Made Simple Problem

Posted: Thu Jun 05, 2008 5:06 pm
by Trevix
FrontEndUsers  1.4.2
CustomContent  1.5
FrontEndUserListing  0.4-beta-2
Forum 0.9.1

I am trying to add signatures to the bottom of posts

I created a signature property in FEU and now I'm having problems getting the smarty tag to display the correct members signature.  Here is a big snippit of code i am using starting and ending with foreach smarty tag.  This is from the Template: topic.

Code: Select all

{foreach from=$items item=entry}
		{cycle values="forum_alternate1,forum_alternate2" assign="alt_bgcolor"}
		<tr>
			<td class="forum_info {$alt_bgcolor}">{$entry->poster}
				{if $entry->rank > 0}<br />{repeat string=$starimage times=$entry->rank}{/if}
				{if $entry->postings > 0}<br />{$forum_posts}: {$entry->postings}{/if}
				<br />{$entry->postdate}
				{if isset($entry->poster_ip)}<br />{$entry->poster_ip}{/if}
				{if $entry->avatar}<br /><img src="{$entry->avatar}" alt="avatar" title="avatar" />{/if}<br><br>
{if isset($entry->edit_link)}{$entry->edit_link}{/if}   {if isset($entry->delete_link)}{$entry->delete_link}{/if}
				{if isset($entry->last_edit)}<br />
					{$entry->last_edit}<br />
					{$entry->editor}<br />
					{$entry->editordate}<br />
					{if isset($entry->editor_ip)}{$entry->editor_ip}<br />{/if}
				{/if}
				<br />
			</td>
			<td class="forum_content {$alt_bgcolor}">
				{$entry->body}
{if isset($signature)}<br><hr size="1px"><br>{$signature}{/if}
			</td>
		</tr>
	{/foreach}
now the code thats killing me is the

Code: Select all

{if isset($signature)}<br><hr size="1px"><br>{$signature}{/if}
I used every possible combination of these smarty tags

Code: Select all

$entry.signature
$entry->signature
$entry.signature->data
$signature
and the only code that i got to work is

Code: Select all

{if isset($signature)}<br><hr size="1px"><br>{$signature}{/if}
Any ideas are appreciated



Heres the whole code for the topic template

Code: Select all

<div id='forum'>
<div class="breadcrumbs forum">{$breadcrumbs}</div>
<!-- topic -->

{if isset($message)}<p>{$message}</p>{/if}

<br />

{if $pagecount > 1}
<p class="forum_pagination">
{if $pagenumber > 1}
{$firstpage}  {$prevpage} 
{/if}
{$pagetext} {$pagenumber} {$oftext} {$pagecount}
{if $pagenumber < $pagecount}
 {$nextpage}  {$lastpage}
{/if}
</p>
{/if}



{if $itemcount > 0}
<br />
<table class="forum_pagetable" cellspacing="0">
	<thead>
		<tr>
			<th class="forum_head_table forum_head_topic" colspan="3">{$topic_subject} - {$poster}</th>
		</tr>
		<tr>
			<td class="forum_head_table forum_head_reply" colspan="3">{if isset($topic_reply_link)}{$topic_reply_link}{/if}</td>
		</tr>
	</thead>
	<tbody>
	{foreach from=$items item=entry}
		{cycle values="forum_alternate1,forum_alternate2" assign="alt_bgcolor"}
		<tr>
			<td class="forum_info {$alt_bgcolor}">{$entry->poster}
				{if $entry->rank > 0}<br />{repeat string=$starimage times=$entry->rank}{/if}
				{if $entry->postings > 0}<br />{$forum_posts}: {$entry->postings}{/if}
				<br />{$entry->postdate}
				{if isset($entry->poster_ip)}<br />{$entry->poster_ip}{/if}
				{if $entry->avatar}<br /><img src="{$entry->avatar}" alt="avatar" title="avatar" />{/if}<br><br>
{if isset($entry->edit_link)}{$entry->edit_link}{/if}   {if isset($entry->delete_link)}{$entry->delete_link}{/if}
				{if isset($entry->last_edit)}<br />
					{$entry->last_edit}<br />
					{$entry->editor}<br />
					{$entry->editordate}<br />
					{if isset($entry->editor_ip)}{$entry->editor_ip}<br />{/if}
				{/if}
				<br />
			</td>
			<td class="forum_content {$alt_bgcolor}">
				{$entry->body}
{if isset($signature)}<br><hr size="1px"><br>{$signature}{/if}
			</td>
		</tr>
	{/foreach}
		<tr>
			<td class="forum_head_table forum_head_reply" colspan="3">{if isset($topic_reply_link)}{$topic_reply_link}{/if}</td>
		</tr>
	</tbody>
</table>
{else}
<p>{$topic_empty}</p>
{/if}
</div>

-- 0:) Trevix >:D

Re: Custom Content in Forum Made Simple Problem

Posted: Thu Jun 05, 2008 5:44 pm
by calguy1000
To extract a single FEU property for the currently logged in user, try:

{$ccuser->property('signature')}

there's help for this in the custom content help.

Re: Custom Content in Forum Made Simple Problem

Posted: Wed Jul 23, 2008 4:15 pm
by Elli
I have the same problem or at least similar.

The problem is that the {$entry->signature} doesn't work. It's not the currently logged in user signature that should be shown but all the topic posts from different users, every user has their own signature at the bottom of the post like in this cmsms forum here.

I have created the signature text box in the Front End User module.

Re: Custom Content in Forum Made Simple Problem

Posted: Sat Feb 13, 2010 6:16 pm
by ChH
I have come this far:

Code: Select all

{$feu_smarty->get_user_properties($uid,'userprops')}{$userprops|print_r}
Does anyone know how to get the uid from forum? OR from the login?

I guess I need to explain this a little more:

$entry->poster can return various values: Any of the props or the login name. BUT it can only return one of these. So I need to use one of these in order to identify from which user the prop is to be read.

Re: Custom Content in Forum Made Simple Problem

Posted: Sat Feb 13, 2010 9:15 pm
by ChH
Solved.

I used this UDT: http://wiki.cmsmadesimple.org/index.php ... ers_module

but applied one slight change to the code:

Code: Select all

   if ($params['method'] == "assign") {
      $gCms->smarty->assign($property, $result);
   }
becomes

Code: Select all

   if ($params['method'] == "assign") {
      $gCms->smarty->assign("gfp_".$property, $result);
   }
- this is important, as otherwise it could override some data from the active user.

Took it, and combined it with this template code:

Code: Select all

{foreach from=$items item=entry}

...

			{assign var='gfp_data' value=$entry->poster}
			<strong>{get_feu_properties username=$gfp_data property='full_name'}</strong>
			{get_feu_properties username=$gfp_data property='amt' method='assign'}
			{if $gfp_amt!=''}<br />{$gfp_amt}{/if}
...

			{get_feu_properties username=$gfp_data property='signatur' method='assign'}
			{if $gfp_signatur!=''}<br />
				_________________<br />
				{$gfp_signatur}
			{/if}
	{/foreach}
This one needs the forum's 'view FEU' set to None so that the username is passed through to get_feu_properties.

Have fun!

Chris