querying member status (DEANO!!!)

I'm submitting this post hoping Deano will have a quick response, but anyone else feel free if you have the knowledge :)

 

I started utilizing the avatar display php block that you had provided a sound example for, and am using it to put in some additional information from the member's profile (easy enough, just need to know the ID for the information I want). I also want to display the user's membership type, but this is something not tracked in the Profile table. Do you have an easy way to pull this detail, based on the original php block you had provided?

 

This is the php block code I'm using:

$aProfileInfo = getProfileInfo($this -> oProfileGen -> _iProfileID);
$sIcon = get_member_thumbnail($aProfileInfo['ID'], 'none');
$sNick = $aProfileInfo['NickName'];
$sFLName = $aProfileInfo['FirstName'] . " " . $aProfileInfo['LastName'];

$sCode = '
<div style="float: left; width: 132px; border: 1px solid black; background-color: #333; padding: 5px; color: #ff8400; font-weight: bold;">
<div style="text-align: center; padding-bottom: 6px; padding-top: 6px;">' . $sNick . '</div>
<div align="center">' . $sIcon . '</div>
';
echo $sCode;

 

I guess what I'm really looking for is how I'd manipulate the database to get information across tables based on memberID, using the membership type as an example but I have a few others I'd like to pull as well - but I think I could figure those out with a sound example.

 

Any help here is greatly appreciated! I am a php/mysql rookie (dangerous), so please forgive me if it is a simple task :)

Skype: shawn.nelson
Quote · 18 Jan 2011

In this case dolphin has a built in function for that.

You can add this after $sFLName = $aProfileInfo['FirstName'] . " " . $aProfileInfo['LastName'];

$sMemberShipInfo = getMemberMembershipInfo($aProfileInfo['ID']);

This function returns as an array. so $sMemberShipInfo will contain the following information.

$sMemberShipInfo['ID'] will contain membership id
$sMemberShipInfo['Name'] membership name
$sMemberShipInfo['DateStarts'] (UNIX timestamp) date/time purchased
$sMemberShipInfo['DateExpires'] (UNIX timestamp) date/time expires

If there is no built in function to get what you need than you need to query the database. That starts getting more complicated.


https://www.deanbassett.com
Quote · 18 Jan 2011

I knew I was thinking too far outside the box.. that worked beautifully, thank you!

 

I'm going to get into some real trouble with this one, but how difficult would it be to put this same information in an author's forum post? Could I just inject the same php code or from your experience will it not play nice?

 

Sorry to keep pushing with the questions, but i've decided it is time that I start digging into the dolphin system and learn the code any way I can and a community is usually the best resource...

Skype: shawn.nelson
Quote · 18 Jan 2011

On the topic of learning, is there anywhere I can find simple reference to other arrays? Thinking about trying to pull details like forum post count similar to what is shown under the account controls block in the account details page.

 

Tried looking for this data in trac/wiki, but I either don't know what I am looking for or it doesn't exist in there.

Skype: shawn.nelson
Quote · 18 Jan 2011

I do not know of any references you can use. I find this stuff by looking through all the files in the inc folder.

As for the forums. Sorry. You will have to get someone else to assist with that. The forums are not written in PHP. Thus i will not touch them.

https://www.deanbassett.com
Quote · 18 Jan 2011

I used the code below to create a custom PHP block, which will only show relevant information to a user that just registered him/herself.

It works great, but now i am faced with text that is not correctly outlined in the php box. The first letter is half missing, and the last letter (the most right side of the phpblock) is also missing. It just doesnt look neat.

Maybe someone can explain to me how i should echo text in a php box?

Oh by the way, i use Deanos tools to insert a php block.

 

thanks in advance

Quote · 22 Jan 2011

I figured it out;

 

$aProfileInfo = getProfileInfo($this -> oProfileGen -> _iProfileID);
$sIcon = get_member_thumbnail($aProfileInfo['ID'], 'none');
$sNick = $aProfileInfo['NickName'];
$sFLName = $aProfileInfo['FirstName'] . " " . $aProfileInfo['LastName'];


$sFLName = $aProfileInfo['FirstName'] . " " . $aProfileInfo['LastName'];

$sMemberShipInfo = getMemberMembershipInfo($aProfileInfo['ID']);

$number_three = 3;

if ( $sMemberShipInfo['ID'] == 2 ) {

echo '<div id="articles3" class="arl-entry">
<h5>At this moment you have limited access to  <br /> We will review your application as soon as possible.<br />

For this moment you are allowed to view profiles, read most of the materials, watch videos and post comments.

</h5>

</div>';

}

Quote · 23 Jan 2011
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.