Hello,
on my profile - http://vau37.voiceartistsunited.com/ChrisKendall_VA
you will see it displays in blue "Featured Member" this automatically displays when a members status is upgraded.
Here is the PHP code used for the Block:
global $p_arr; $Memb = (int)$p_arr['ID'];
$arr = db_arr("SELECT `Featured` FROM `Profiles` WHERE `ID` = '$Memb'");
$MemFeatured = $arr['Featured'];
if ( $MemFeatured > 0 ) { echo " <div align="center"> <font color="#0099FF" size="5"><b>Featured Member</b></font><br> </div><br><br> "; }
Is there any way of changing the code so it Displays the Users Name i.e " Chris Kendall " as i would like to remove the very messy General info block?
i hope somebody may be able to suggest a code.
Regards
Chris
All for one and one for all....ah sod it who am i kidding! |
Hello Chris.
I did not test this code, so it may trigger an error, it may not. I think is OK.
Change it to :
global $p_arr; $Memb = (int)$p_arr['ID'];
$arr = db_arr("SELECT `Featured`,`NickName` FROM `Profiles` WHERE `ID` = '$Memb'");
$MemFeatured = $arr['Featured'];
$MemFeatNick = $arr['NickName'];
if ( $MemFeatured > 0 ) { echo " <div align="center"> <font color="#0099FF" size="5"><b>Featured Member $MemFeatNick</b></font><br> </div><br><br> "; }
PMTV FIX IT ! Trouble with Dolphin? Need support ? call me! |
Sometimes names are left blank, so you are aware now.
If you want to display the first and last name then change it to :
global $p_arr; $Memb = (int)$p_arr['ID'];
$arr = db_arr("SELECT `Featured`,Concat( `FirstName` , ' ', `LastName` ) as Name FROM `Profiles` WHERE `ID` = '$Memb'");
$MemFeatured = $arr['Featured'];
$MemFeatNick = $arr['Name'];
if ( $MemFeatured > 0 ) { echo " <div align="center"> <font color="#0099FF" size="5"><b>Featured Member $MemFeatNick</b></font><br> </div><br><br> "; }
PMTV FIX IT ! Trouble with Dolphin? Need support ? call me! |
Hey Pamela
i created the php block and this displays
Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/voiceart/public_html/vau37/inc/classes/BxDolPageView.php(698) : eval()'d code on line 13
All for one and one for all....ah sod it who am i kidding! |
Your original code has a problem on the use of the double quote "", so I change the use of the enclosing " " for ' '
So change it to :
global $p_arr; $Memb = (int)$p_arr['ID'];
$arr = db_arr("SELECT `Featured`,Concat( `FirstName` , ' ', `LastName` ) as Name FROM `Profiles` WHERE `ID` = '$Memb'");
$MemFeatured = $arr['Featured'];
$MemFeatNick = $arr['Name'];
if ( $MemFeatured > 0 ) { echo '<div align="center"><font color="#0099FF" size="5"><b>Featured Member ' . $MemFeatNick . '</b></font><br></div><br><br>'; }
PMTV FIX IT ! Trouble with Dolphin? Need support ? call me! |
So what would the code actually be if I just wanted to display the full name in larger letters from thw database and nothing else ?
as the code I pasted up was just as an example. And still contained the "features member info"
i only want the first and last name to display in a php box In larger letters "similar to the features member one"
All for one and one for all....ah sod it who am i kidding! |
Well that's basic HTML. Just remove the words Featured Member from the html string. The size tag values are between 1 (very small) and 7 (very large)
Like
echo '<div align="center"><font color="#0099FF" size="7"><b>' . $MemFeatNick . '</b></font><br></div><br><br>';
PMTV FIX IT ! Trouble with Dolphin? Need support ? call me! |
That doesn't appear to work :( All for one and one for all....ah sod it who am i kidding! |
You must change that line on the previous php code that worked, just the line inside the program. PMTV FIX IT ! Trouble with Dolphin? Need support ? call me! |
Thats great , it displays!
However i want it to display for ALL members instead of appearing when a member is featured.
Regards
Chris
All for one and one for all....ah sod it who am i kidding! |
Never mind, i figured it out :D
i removed the "if ( $MemFeatured > 0 )"
and now it displays for all!
Thanks so much!!!
All for one and one for all....ah sod it who am i kidding! |