Support Forums

Replace username with Real Name

This is a discussion on Replace username with Real Name within the Templates, HTML, CSS, and Design Help forums, part of the General category; v4.1.10 Developer Hi, I have read a lot about "{capture name='foo'}" and a few other if/then statements, but I can't ...


Go Back   68 Classifieds Forums > General > Templates, HTML, CSS, and Design Help

Reply
 
Thread Tools Display Modes
Old 01-26-2011, 08:18 PM   #1
Scotty
 
Join Date: Apr 2010
Posts: 29
Rep Power: 6
pickyourownpet.com is on a distinguished road
Default Replace username with Real Name

v4.1.10 Developer

Hi,

I have read a lot about "{capture name='foo'}" and a few other if/then statements, but I can't seem to make this work.

I have an Extra Field fid=13. This field is a simple Yes/No Dropdown. If selected Yes while placing an Ad, I wish for the username to be replaced with the user's real first and last name.

Any simple ideas?

I need this in Viewlistings2.
pickyourownpet.com is offline   Reply With Quote
Old 01-27-2011, 10:35 AM   #2
Staff
 
Join Date: Mar 2006
Posts: 587
Rep Power: 34
Blair will become famous soon enough
Default

The "Get extra field" feature was introduced in 4.1.10. It may help you accomplish what you're describing: Get Extra Field - 68 Classifieds

But, since you're trying to trigger an 'if-else' with the value of an extra field and you have the developer version, my first inclination is to place all the coding (SQL and PHP) in the php files instead of working with Smarty syntax.
__________________
Blair
68C Staff

68C Downloads | Report a Bug | Knowledge Base
If you have a current support subscription, you can Submit a Support Ticket
Blair is offline   Reply With Quote
Old 02-01-2011, 07:58 PM   #3
Scotty
 
Join Date: Apr 2010
Posts: 29
Rep Power: 6
pickyourownpet.com is on a distinguished road
Default

Blair, Thank you for the link. I read more, and found a couple more threads to help me. I am not a genius with SQL,PHP Smarty or anything like that. I am learning though.

I have a dropdown box with options 'Yes' or 'No'. If selected yes, I want the Username replaced with the User's First and Last Name.

I have the following, and I think I just need a second or third pair of eyes to evaluate this. What might I be doing wrong?

Code:
{capture name='firstlast'}
 {get_extra_field id=$entry.id fid=13}
 {/capture}
 {if $smarty.capture.firstlast=="Yes"}
 {if $entry.class<>""} class="{$entry.class}"{/if}><a href="viewmember.php?member={$owner}">{$fname}{$lname}</a>
 {else}
 <a href="viewmember.php?member={$owner}">{$username}</a>
 {/if}
It only returns the 'else' and displays the user name still.

Last edited by pickyourownpet.com; 02-01-2011 at 08:01 PM.
pickyourownpet.com is offline   Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
custom development -> real estate site ctdesign87 Pre Sales Questions 2 09-29-2010 06:46 AM
Real size of the image susawx Templates, HTML, CSS, and Design Help 4 07-29-2010 03:23 PM
Looking To Build A Real-Estate Site For Spain & The U.K. seymourjames Off Topic 0 06-12-2010 12:58 PM
Real Estate Template Mike-N-Tosh Modification Release 0 12-15-2008 04:48 PM


All times are GMT -4. The time now is 11:26 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2011, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0