Tips & Tricks

Mambo CMS Tips & Tricks: Part 3

Mamblog link in profile

mambo

Here is a hack to show a link to a member’s Mamblog in their profile.

Step 1) Open up comprofiler.html.php located in the directory “/components/comprofiler/” and find the following lines of code.

<tr>
<td class=sectiontableentry<?php echo $i; ?> width=35% style="font-weight:bold;">
<?php echo _UE_HITS; ?></td>
<td class=sectiontableentry<?php echo $i; ?> ><?php echo $user->hits; ?>
</td>
</tr>

Step 2) Paste the following code above the code in step 1.

<tr><td class=sectiontableentry
<?php echo $i; ?> width=35% style="font-weight:bold;">
<?php echo _UE_BLOG_HEADER; ?></td>
<td  class=sectiontableentry<?php echo $i; ?> >
<a href="
<?php echo sefRelToAbs("index.php?option=com_mamblog&task=
show&action=user&id=".$user->id); ?>">
<?php echo _UE_VIEWBLOG; ?></a>
</td></tr>
<?php $i= ($i==1) ? 2 : 1; ?>

Step 3) In your language file located in the directory “administration/components/comprofiler/language/” add the following lines of code. You can change the words “Read Blog” and “Member Blog” to what you like.

DEFINE('_UE_VIEWBLOG','Read Blog');
DEFINE('_UE_BLOG_HEADER','Member Blog');

Number Of Photos In Profile

Here is a a simple hack to to show how many photos a user has posted to a Zoom gallery in their profile.

Step 1) Open up comprofiler.html.php and find the following lines of code.

<tr>
<td class=sectiontableentry<?php echo $i; ?> width=35% style="font-weight:bold;"><?php echo _UE_HITS; ?></td>
<td class=sectiontableentry<?php echo $i; ?> ><?php echo $user->hits; ?></td>
</tr>

Step 2) Paste the following code above the code in step 1 and save.

<?php
$query = "SELECT count(uid) FROM mos_zoomfiles WHERE
uid='".$user->id."'";
$database->setQuery($query);
$total = $database->loadResult();
?>
<tr>
<td class="sectiontableentry<?php echo $i; ?>" width="35%" style="font-weight:bold;">
<?php echo _UE_PHOTOSNUMBER; ?></td>
<td class="sectiontableentry<?php echo $i; ?>" ><?php echo $total; ?></td>
</tr><?php $i= ($i==1) ? 2 : 1; ?>

Step 3) Open up you language file located in “/administrator/components/com_comprofiler/language” and paste the following line and save. Thats it, enjoy!

DEFINE('_UE_PHOTOSNUMBER', 'Number of Photos');

Online Icon In Profile

Problem: You would like a nice icon to show up next to the ONLINE status in a users profile when they are online, like the one on this site.

Heres a easy solution using a default image that ships with mambo.

Step 1) open up comprofiler.html.php, and find the following lines of code.

<tr>
<td class=sectiontableentry<?php echo $i; ?> width=35% style="font-weight:bold;">
<?php echo _UE_ONLINESTATUS; ?></td>
<td class=sectiontableentry<?php echo $i; ?> >
<?php if($isonline > 0) echo _UE_ISONLINE; 
else echo _UE_ISOFFLINE; ?></td>
</tr>

Step 2) Replace those lines with the following code then save, all done.

<td class="sectiontableentry<?php echo $i; ?>" width="35%" style="font-weight:bold;">
<?php echo _UE_ONLINESTATUS; ?></td>
<td class="sectiontableentry<?php echo $i; ?>">
<?php if($isonline > 0)
echo "<img src=\"/images/M_images/rating_star.png\" alt=\"icon\"> "._UE_ISONLINE;
else echo _UE_ISOFFLINE; ?></td>

Leave a Reply

Your email address will not be published. Required fields are marked *