Ahh ! good. Now tawk my language.
// Step 1
In includes/functions.php file,
add top ?>:
function show_last_registered_users() {
global $site_db, $lang, $site_sess, $site_template, $additional_user_fields, $user_table_fields;
$additional_sql = "";
if (isset($additional_user_fields) && is_array($additional_user_fields) && !empty($additional_user_fields)) {
foreach ($additional_user_fields as $key => $val) {
$additional_sql .= ", " . $key;
}
}
$sql = "
SELECT " . get_user_table_field("", "user_id") . get_user_table_field(", ", "user_name") . $additional_sql . "
FROM " . USERS_TABLE . "
WHERE " . get_user_table_field("", "user_level") . " >= '" . USER . "'
ORDER BY " . get_user_table_field("", "user_joindate") . " DESC
";
$row = $site_db->query_firstrow($sql);
$last_user_id = (isset($row[$user_table_fields['user_id']])) ? $row[$user_table_fields['user_id']] : "";
$last_user_name = (isset($row[$user_table_fields['user_name']])) ? $row[$user_table_fields['user_name']] : "";
$site_template->register_vars("show_last_user_name", str_replace(array("{last_user_name}", "{last_user_name_link}"), array(format_text(trim($last_user_name), 2), $site_sess->url(ROOT_PATH . "member.php?action=showprofile&" . URL_USER_ID . "=" . (int)$last_user_id)), $lang['last_user_name']));
$last_user_name_template = $site_template->parse_template("last_user_name_registered");
$site_template->register_vars("last_user_name_template", trim($last_user_name_template));
}
// Step 2
In lang/english/main.php file,
add top ?>:
$lang['last_user_name'] = "Last member: <a href=\"{last_user_name_link}\" class=\"link\" /><b>{last_user_name}</b></a>";
// Step 3
In includes/page_header.php file,
find:
//-----------------------------------------------------
//--- Random Image ------------------------------------
//-----------------------------------------------------
add before:
//-----------------------------------------------------
//--- Show last registered user -----------------------
//-----------------------------------------------------
if (function_exists('show_last_registered_users')) {
show_last_registered_users();
}
// Step 4
In templates/your_template, create file:
last_user_name_registered.html .
Add:
{if show_last_user_name}{show_last_user_name}{endif show_last_user_name}
// Step 5
Add any HTML you want (1 template of choice) have {header} to {footer} - this tag:
{if last_user_name_template}{last_user_name_template}{endif last_user_name_template}
Should work.