Profile Pictures IQA

I have a client who would like to display a list of committee members via IQA and use their "Profile Picture", along with their name, title, etc. I have found the Name_Picture table, a good start I suppose - but how would I get the actual profile picture to force into an '<img src="{{path/to/profile/photo.jpg}}"/>' in the IQA? I was hoping that the Query Profile Picture List iPart would be a little more useful, but that just shows the profile images and none of the other elements in the IQA query.

Has anyone attempted to use the Profile Picture anywhere besides the Profile Picture iParts?

Thanks

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Group List Editor

Hi Eric,

Your question is interesting - I'd really like to know if that's possible. I'll ask around, but in the mean time, can you use the Group List Editor iPart instead?

GLE

Oh, I'm full of interesting questions! :)

The Group List Editor iPart wouldn't display the committee members for a particular committee, would it? Maybe I don't understand the purpose of that iPart... I do think that the iPart reference area of the documentation is severely lacking and should include some form of a description of the iPart and its intended purpose or why would I want to consider using this on my site... not just a list of the configuration settings and their purpose.

The other option I see here is to upload the photos to a folder on the server and use the customer ID to reference - I don't like that route as much, because that means staff would need to maintain the photos. I'm really hoping to be able to pull the profile photo.

The Group List Editor

The Group List Editor configuration and documentation have been improved recently, and that should go out in an upcoming release. For now though, I know that I have been able to display a list of committee members in it before, though I can't remember how I did it off the top of my head. I'll do a little research and see if I can come up with an answer for you.

Okay, here's what you need

Okay, here's what you need to do to get the Group List Editor to display a committee:
Config:
    Select "Display Profile Picture"
    For "URL parameter for parent ID" enter the name of the URL parameter that identifies the committee whose members you want to display. eg. if your URL parameter is ?CommitteId=COMMITTEE/AWARDS you would enter 'CommitteeId' (no quotes).
    Under "Display a list of" select "Groups owned by the parent ID and their members"
    Under "Choose the group types to include" select "Committee"

 

The result should be a list of the committee members with their profile picture, name and title displaying. Clicking on any of the results will bring up a pop-up of more information about their membership in that committee.

Hope that helps!

If Standard iParts won't work

Hi Eric,
If this were my project I would explore an out of the box solution however I thought I would share some sample code on how to generate an image file on your server based on the data in name_picture in case the current standard iParts do not work for you. This is based heavily on code written by Dmitry E. at ASI a few years ago.

Regards,
Joe John
John Consulting

public void CreateImageFile(string iMISID, Asi.iBO.IiMISUser iMISUser, string FileName, string FilePath)
{
// First of all we need to get byte array with file content
string _sql = "";
byte[] _tmp = null;
string _fileinfo = "";
string _fileext = "";

try
{
_sql = "SELECT ID, cast(Time_Stamp as int) as Stamp, Picture_logo FROM NAME_PICTURE WITH (NOLOCK) WHERE ID='" + iMISID + "'";
Asi.iBO.DataServer _db = new Asi.iBO.DataServer(iMISUser);
System.Data.SqlClient.SqlDataReader _reader = _db.ExecuteReader(System.Data.CommandType.Text, _sql.ToString());
if (_reader.HasRows)
{
while (_reader.Read())
{
if (_reader["Picture_logo"] != null && _reader["Picture_logo"] != DBNull.Value)
_tmp = (byte[])_reader["Picture_logo"];
break;
}
}
// Now We Need to read Binary Array and save it to the file
if (_tmp != null & _tmp.Length != 0)
{
System.IO.FileStream _filestream = new System.IO.FileStream(FilePath + "//" + FileName, System.IO.FileMode.Create);
System.IO.BinaryWriter _writer = new System.IO.BinaryWriter(_filestream);
_writer.Write(_tmp);
_writer.Flush();
_writer.Close();
_filestream.Close();
// Now we need to Get file Type (Extension) - usually it is
// What we want we need to get first 10 nytes form the file an dread them
System.IO.FileStream _read = new System.IO.FileStream(FilePath + "//" + FileName, System.IO.FileMode.Open);
System.IO.BinaryReader _Breader = new System.IO.BinaryReader(_read);
if (_read.Length >= 10)
{
char[] _FileType = null;
_FileType = _Breader.ReadChars(10);
_Breader.Close();
_read.Close();
// Now convert char array to string
foreach (char _char in _FileType)
{
_fileinfo += _char.ToString();
}

}
// Check if we have Extension:
if (_fileinfo != "")
{
if (_fileinfo.StartsWith("GIF"))
_fileext = "GIF";
if (_fileinfo.StartsWith("BM"))
_fileext = "BMP";
if (_fileinfo.StartsWith("II"))
_fileext = "TIFF";
// If w ehave no EXT then set it to the JPEG
if (_fileext == "")
_fileext = "JPEG";
}

// Now Check if we have Extension
if (_fileext != "")
{
// rename the file
if (System.IO.File.Exists(FilePath + "\\" + FileName + "." + _fileext))
{
System.IO.File.Delete(FilePath + "\\" + FileName + "." + _fileext);
}
System.IO.File.Move(FilePath + "\\" + FileName, FilePath + "\\" + FileName + "." + _fileext);

// Call Speacil Maintenance method - Clean up all old images
CleanUpImages(iMISID, FilePath, FilePath.ToUpper() + "\\" + FileName.ToUpper() + "." + _fileext.ToUpper());

}

}
}
catch {
// Do Nothing
}

}