I am trying to skip profiles from being displayed in the members blocks if they don't have a profile photo. I tried writing a bx_if: but without luck. Can anyone help with this or perhaps have a mod that can do this?
I thought about a bx_if to place in the thumbnail_single.html:
<div class="thumbnail_block __classes_add__" style="float:__sys_thb_float__;">
<div class="thumbnail_image" onmouseover="javascript:startUserInfoTimer(__iProfId__, this)" onmouseout="javascript:stopUserInfoTimer(__iProfId__)"> <a href="__usr_profile_url__" title="__usr_thumb_title0__"> <img src="<bx_image_url:spacer.gif />" style="background-image:url(__usr_thumb_url0__);" class="thumbnail_image_file bx-def-shadow bx-def-round-corners" /> <i class="sys-online-offline sys-icon __sys_status_icon__" title="__sys_status_title__"></i> </a> </div>
<bx_if:profileLink> <div class="thumb_username"> <a class="bx-def-font-large" href="__usr_profile_url__">__user_title__</a> <br /> <i class="bx-def-font-small bx-def-font-grayed">__user_info__</i> </div> </bx_if:profileLink>
<div class="clear_both"></div>
</div>
The bx_if would work off of the profile photo being null skipping adding the typical profile with the sex icons. Since so much of this is depending on one function calling another and another and another the solution is not as easy as one would think. Thus, deciding to try a bx_if on the template.
Geeks, making the world a better place |
Are you talking about the members blocks on the homepage or elsewhere also ? Paypal email is jeromemingo@gmail.com - http://www.boonex.com/market/posts/modzzz |
Did a quick check, as I might be interested to do this for my own site (once i have enough members :p).
Although, I'm using avatars to display on the blocks instead of the profile picture, the place where you would have to do the change is located on "templates/base/scripts/BxBaseIndexPageView.php" (and if possible, i would recommend you to override the file with the function in your own template directory, easier to deal with when you have to upgrade)
The function you are interested in is around line 141:
function getMembers ($sBlockName, $aParams = array(), $iLimit = 16, $sMode = 'last')
You need to add in the where clause of the sql being constructed a "avatar is not null".
Again, the above would work if you are working with avatars on the blocks. For the profile picture you should have to do some inner joins with sys_albumbs and sys_albums_objects.
|
In templates/base/scripts/BxBaseIndexPageView.php
Find :
$sqlCondition = "WHERE `Profiles`.`Status` = 'Active' and (`Profiles`.`Couple` = 0 or `Profiles`.`Couple` > `Profiles`.`ID`)";
Just below, Add :
$sqlCondition .= " AND `Profiles`.`Avatar` <> 0 ";
Paypal email is jeromemingo@gmail.com - http://www.boonex.com/market/posts/modzzz |
I was interested in doing this for the home page block but also when viewing "people" or results in people searches. For the purpose of the site, avatars are not used, and it is necessary that members have a profile photo or they don't show up in member lists or searches. Geeks, making the world a better place |
Also, In templates\base\scripts\BxBaseBrowse.php
Find :
if ( $this -> aAdditionalParameters['photos_only'] ) $aWhereParam[] = '`Profiles`.`Avatar` <> 0';
Replace with :
//if ( $this -> aAdditionalParameters['photos_only'] ) $aWhereParam[] = '`Profiles`.`Avatar` <> 0';
Paypal email is jeromemingo@gmail.com - http://www.boonex.com/market/posts/modzzz |
Your all missing the request.
She is not using the avatar module, yet all of your suggestions are for the avatar. She is referring to accounts that do not have a profile photo.
https://www.deanbassett.com |
I was thinking along the lines of templates.
Now, this does help guide me. However, all profiles don't have an avatar, therefore, all profiles will be rejected. Plus, Dolphin checks and if there is no icon, it then adds the male and female icons; so thumbnails always exists; I really need to check the profile photo album directly of the ID to see if there is a profile photo present and not icons which will always return true.
Geeks, making the world a better place |
All profiles have a profile album. How is this stored in the database? Geeks, making the world a better place |
OK, for the index page I added the bits in red:
while ($aData = mysql_fetch_assoc($rData)) { $ProfileThumb = BxDolService::call('photos', 'profile_photo', array($aData['ID'], 'thumb'), 'Search'); if ($ProfileThumb) { $aOnline['is_online'] = $aData['is_online']; $aTmplVars[] = array( 'thumbnail' => get_member_thumbnail($aData['ID'], 'none', true, 'visitor', $aOnline) ); } }
Edit: You can do the same with the Browse Page; once you get all the profiles, as you step through each one, check to see if they have a profile photo, if not, skip over that profile.
Geeks, making the world a better place |
The thing is, I feel like one should be able to do such things through the template system. I view templates like CSS, the templates control the display. bx_if: is what decides for the template system so why not create a bx_if condition that if no profile photo, then skip over the profile? Geeks, making the world a better place |
It would not be proper to do this through the template. You have to take into consideration stuff like record counts which is used for pagination etc.
The thing is, I feel like one should be able to do such things through the template system. I view templates like CSS, the templates control the display. bx_if: is what decides for the template system so why not create a bx_if condition that if no profile photo, then skip over the profile?
Paypal email is jeromemingo@gmail.com - http://www.boonex.com/market/posts/modzzz |
the templates control the display
Exactly. The templates are for display.
Modzzz is correct. The code is where the change has to occur because counts have to be considered.
https://www.deanbassett.com |
By counts, I am assuming you mean that the pagination is created in the code, if I remove items in the template, then the pagination would be off. I did not think about that. Geeks, making the world a better place |
The count is still going to be off, because the count comes from the query and I operate on the query results. I would need to create a relationship between the profiles table and the table holding the information on profile photos/album to build a query that would skip over any profiles without a profile photo. Any suggestions on building such a query? Geeks, making the world a better place |
Yes, I see now how the count is not accurate and it affects the pagination as well. I will need to figure out the proper query that will check the profiles against the profile photos. Geeks, making the world a better place |
I am trying to get a handle on the profile photo album. Am I correct in assuming the profile photo album is simply the first album in the list of a member's photo albums. If I delete the first album in the list, then the profile photo album will be the next album remaining in the list. How are the albums ID in the database? I am looking at the tables and code to try and understand how Dolphin handles this. I need to be able to create a join between the Profiles table and the sys_albums for the profile photos so that I can do a proper query. Any help on this is appreciated. Geeks, making the world a better place |
For the particular site, a better solution is going to be to replace the generic thumbs that dolphin presents with a "Missing Profile Photo" image. I will do that in the function that handles get user thumbnail; instead of sending back a null value, which is then converted to the default sex images or visitor; it will return a value. Geeks, making the world a better place |
Easy way, just redo the icons. Geeks, making the world a better place |
How add this in search and browse page
|
|
Why don't you start a new thread and be specific about what you want to accomplish?
Geeks, making the world a better place |