Custom Content in Forum Made Simple Problem

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
Trevix
Forum Members
Forum Members
Posts: 19
Joined: Sat May 31, 2008 12:52 am
Location: Iowa

Custom Content in Forum Made Simple Problem

Post 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
Image
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: Custom Content in Forum Made Simple Problem

Post 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.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Elli
Forum Members
Forum Members
Posts: 25
Joined: Thu Mar 27, 2008 3:32 pm

Re: Custom Content in Forum Made Simple Problem

Post 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.
User avatar
ChH
Forum Members
Forum Members
Posts: 18
Joined: Tue Dec 02, 2008 3:56 pm

Re: Custom Content in Forum Made Simple Problem

Post 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.
Last edited by ChH on Sat Feb 13, 2010 6:28 pm, edited 1 time in total.
User avatar
ChH
Forum Members
Forum Members
Posts: 18
Joined: Tue Dec 02, 2008 3:56 pm

Re: Custom Content in Forum Made Simple Problem

Post 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
Last edited by ChH on Sat Feb 13, 2010 9:18 pm, edited 1 time in total.
Post Reply

Return to “Modules/Add-Ons”