Monday, February 19, 2018

Who's Online


First, solve the problem.
Then, write the code.


This is a modified version of the standard Community Builder file: comprofiler.html.php .  It enables the Users Lists to be styled differently than the tables appearing in the profile tabs, and thereby also solves a common problem related to vertical spacing between Users List entries.  

comprofiler.html.php goes in the /components/com_comprofiler/ directory.  The standard file has been modified by Electronic Mother to address the following problem:

The standard CB file applies the CSS classes sectiontableentry1 and sectiontableentry2 to  the <tr> tags in alternating rows of the tables it displays.  These tables appear in the tabs of member profiles (where CB lists a member's forum posts, articles written, blog entries, etc.).  Your template's CSS is probably fine for them, and if not you can use these classes to change their appearance. 

However, CB treats the UsersList the same way.  We often find that users' portraits are vertically butted up against each other unattractively.  Adding CSS statements such as .sectiontableentry1 IMG {margin-bottom:10px;} might appear at first to be a solution, but some users enter enough information about their interests, occupations, or other custom CB fields, that their text in the UsersList is taller than their photo, and is still vertically butted up against the next member's text.  No matter what fields you put in each column of the UserList, some users' will touch other users in some columns.  

Furthermore, from the site visitor's perspective, the UsersList appears as the main content of a page, while profile tabs seem a different environment.  Therefore, we often want the UserList table to be quite different from the tables in the tabs. 

Our modified file applies the new classes em_CB_sectiontableentry1 and em_CB_sectiontableentry2 to the <tr> tags in alternating rows of the UsersList.  It leaves all the tables in profile tabs unchanged.

For example, we might add the following CSS to an Italian template dominated by red and green on a white background.  (The lists in the tabs of the users' profiles would retain their usual alternating gray backgrounds.):

tr.em_CB_sectiontableentry1 td,
tr.em_CB_sectiontableentry2 td {
    padding-top:5px;                     /* to vertically separate the entries */
    border-bottom:2px solid #c00;
    border-top:5px solid #060;     /* red and green stripes between entries */

Suppose you want to use our modified CB file, but you do *not* want the UsersList to be styled differently than the tabs.  If your template already has CSS statements for the tabs, you need to add our new classes to those CSS statements.  The following example shows how.  The original CSS is in gray.  The lines you must add are in yellow.: 


.em_CB_sectiontableentry1 td,
.sectiontableentry1 {
    vertical-align    : top;
    padding            : 3px 5px;
    background        : #f0f0f0;

.em_CB_sectiontableentry2 td,
.sectiontableentry2 {
    vertical-align    : top;
    padding            : 3px 5px;
    background        : #e9e9e9;

That is all.  This minor change to those <td> tags shouldn't interfere with anything else, but it enables you to better control the appearance of Community Builder's users lists. 

The file can be found in our downloads section, under the category: "Joomla! Hacks".



Electronic Mother's favorite pizza topping:

Joomla! Internet Domains for Sale

Are you a Joomla! template designer, website administrator, content provider, extension developer, user group coordinator, hosting provider, or consultant? 
The following Internet domains can give you a professional address for your webstes and e-mailboxes.  They are all available for sale from Electronic Mother:    $399.    $399.  $595.    $399.    $399.   
Sold only as a set:  $1,449.    $399.  $449.    $499.    $549.  $349.    $299.    $95    $195.     $399.     $399.
Sold as a set:  $599.
Sold only as a set:  $1,999.
Available only as a set. 
To purchase any of the above, pay via PayPal to This email address is being protected from spambots. You need JavaScript enabled to view it.;">This email address is being protected from spambots. You need JavaScript enabled to view it..  We will unlock the domain and send you the transfer authorization code.  If you haven't had a domain of your own before, we can guide you through the transfer process. 
If you would like help with developing your website, we can help with that too.  For more information, email This email address is being protected from spambots. You need JavaScript enabled to view it..