This mod will display the most recent 8 members as thumbnails in the member's area. It also displays a "new member" icon on their profile as well as in the search result. But, you have to create an icon for this; do not forget to change the file name (newmem.gif) and its path at 8th to do.
NEXT THINGS TO DO:
create a search result from the recent members by join dates, such as:
- show today's new members
- show yesterday's new members
- show last week's new members
- show last month's new members
9 files to edit. Backup your files before doing anything and see this mod in action at: singlesburg.com
My version: v4.002 + CLEAN
My template: ACT
Accepted profile types: single (no couple)
To do:
1) insert this sql statement (last 30 days registred members are considered as new members. If you get a lot of signups, reduce this number from global settings > Other, also I pick 8 members to be shown, you can set this as you want from admin panel: global settings > Other)
PHP Code:
INSERT INTO `GlParams` VALUES ('new_member_period', '30', 3, 'Time period in days for new members', 'digit', '', '');
INSERT INTO `GlParams` VALUES ('num_of_recent_member', '8', 3, 'Number of recent members in member`s area', 'digit', '', '');
2) tmpl_act_page_7.html
find this:
replace with:
PHP Code:
__nick__ __new_member_icon__
3) tmpl_act_searchrow.html
find this:
replace with:
PHP Code:
__nick__ __new_member_icon__
4) tmpl_act_page_6.html
insert this table anywhere you like. you can modify it for your needs:
PHP Code:
<table cellspacing="3" cellpadding="0" border="0" width="100%">
<tr>
<td class="dark" style="border: solid 1px #cccccc"> __recent_members_head__</td>
</tr>
<tr>
<td align="center">__recent_members_info__</td>
</tr>
<tr>
<td height="16" background="templates/tmpl_act/images_act/horiz_bar.gif"><img src="templates/tmpl_act/images_act/spacer.gif" height="16"></td>
</tr>
</table>
5) inc/design.inc.php (also, create a new icon)
after this (last function in my file):
function get_active_color()
{
...blah...
}
inser this:
PHP Code:
function NewMemberIcon()
{
global $p_arr;
$period = GetParam( "new_member_period" );
$registration = db_res( "SELECT LastReg FROM Profiles WHERE ID='{$p_arr['ID']}' AND Status = 'Active' AND (TO_DAYS(NOW()) - TO_DAYS(LastReg)) <= $period" );
$result = mysql_num_rows($registration);
if ($result != "0")
{
return "<img src=\"templates/newmem.gif\" align=\"absmiddle\" border=\"0\" alt=\"New Member\">";
}
}
6) profile.php
after this:
$_page_cont[$_ni]['more_photos2'] = PrintThumbMorePhotos(1);
insert this:
PHP Code:
$_page_cont[$_ni]['new_member_icon'] = NewMemberIcon();
7) search_result.php
after this:
$_page_cont[$_ni]['db_color'] = $search_result_db_color;
insert this:
PHP Code:
$_page_cont[$_ni]['new_member_icon'] = NewMemberIcon();
members.inc.php
before this:
$templ = str_replace ( "__row_title__", $p_arr[Headline], $templ );
insert this:
PHP Code:
$period = GetParam( "new_member_period" );
$registration = db_res( "SELECT LastReg FROM Profiles WHERE ID='{$p_arr['ID']}' AND Status = 'Active' AND (TO_DAYS(NOW()) - TO_DAYS(LastReg)) <= $period" );
$result = mysql_num_rows($registration);
if ($result != "0")
{
$new_member_icon = "<img src=\"templates/newmem.gif\" align=\"absmiddle\" border=\"0\" alt=\"New Member\">";
}
9) members.inc.php
after this:
$templ = str_replace ( "__nick__", $nick, $templ );
insert this:
PHP Code:
$templ = str_replace ( "__new_member_icon__", $new_member_icon, $templ );
10) langs/lang-English.php
after this:
case "_Post date": return "Post date";
insert this:
PHP Code:
case "_recent members": return "recent members";
11) member.php
before this:
/**
* contr panel "contacts"
*/
function contr_panel_contacts ()
insert this:
PHP Code:
### Display recent members starts
/**
* contr panel "just joined info"
*/
function recent_members_info()
{
global $site;
global $p_arr;
global $ID_PIC_DIR;
global $ID_PIC_URL;
$period = GetParam( "new_member_period" );
$numofrecent = GetParam( "num_of_recent_member" );
$numofcols = 4;
if ($p_arr['LookingFor'] == "couple" || $p_arr['LookingFor'] == "both")
{
if ($p_arr['Sex'] == "female")
{
$looking_for = "male";
}
else
{
$looking_for = "female";
}
}
else
{
$looking_for = $p_arr['LookingFor'];
}
if ($numofrecent)
{
// latest joined members
$just_joined = db_res( "SELECT ID,Pic_0_addon FROM Profiles WHERE Sex='{$looking_for}' AND Status='Active' AND (TO_DAYS(NOW()) - TO_DAYS(LastReg)) <= $period AND Pic_0_addon <> '' AND Pic_0_addon <> '0' ORDER BY LastReg DESC LIMIT $numofrecent" );
$out = "<table border=\"0\" cellpadding=\"0\" cellspacing=\"5\">\n";
$out .= "<tr>\n";
$i = 1;
while ( $just_joined_arr = mysql_fetch_array ( $just_joined ) )
{
$src = "$ID_PIC_DIR$just_joined_arr[ID]_0_$just_joined_arr[Pic_0_addon].jpg";
if ( file_exists($src) )
{
$src = "$ID_PIC_URL$just_joined_arr[ID]_0_$just_joined_arr[Pic_0_addon].jpg";
$out .= "<td width=\"138\" height=\"140\" align=\"center\" valign=\"middle\" background=\"templates/thbg.gif\"><a href=\"" . $site[url] . "profile.php?ID=" . $just_joined_arr[ID] . "\"><img src=\"$src\" border=0></a></td>\n";
if ($i % $numofcols == 0) { $out .= "<tr>\n</tr>\n";
$i++;
}
}
$out .= "<tr>\n";
$out .= "</table>";
ob_start();
echo $out;
$ret = ob_get_contents();
ob_end_clean();
return $ret;
}
}
### Display recent members ends
12) member.php
after this:
$_page_cont[$_ni]['member_info'] = contr_panel_member_info();
insert this:
PHP Code:
$_page_cont[$_ni]['recent_members_head'] = _t("_recent members");
$_page_cont[$_ni]['recent_members_info'] = recent_members_info();
Bookmarks