2836
Chit Chat / Re: the most intelligent feature in 4images - Check New Images
« on: July 28, 2007, 12:13:22 AM »
Mine is auto-resizer. Not in every scripts we see this feature.
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
if ($user_row = get_user_info($user_id)) {
$user_homepage = (isset($user_row['user_homepage'])) ? format_url($user_row['user_homepage']) : REPLACE_EMPTY;
if ($user_row = get_user_info($user_id)) {
// Profile invisible.
if ($user_row['user_id'] != $user_info['user_id'] && $user_info['user_level'] != ADMIN && defined('PROFILE_INVISIBLE') && PROFILE_INVISIBLE == 1 && $user_row['profile_invisible'] == 1) {
if (function_exists('get_profile_visible') && $visible_row = get_profile_visible($user_id)) {
redirect("member.php?action=showprofile&" . URL_USER_ID . "=" . $visible_row['user_id']);
} else {
redirect($url);
}
unset ($user_id);
}
// End of profile invisible.
$user_homepage = (isset($user_row['user_homepage'])) ? format_url($user_row['user_homepage']) : REPLACE_EMPTY;
function get_profile_visible($user_id = 0) {
global $site_db, $user_table_fields, $user_row;
$user_info = 0;
if ($user_id != 0 && $user_id != GUEST) {
if (isset($user_row[$user_id]) && !isset($user_row['profile_invisible'])) {
$sql_alter = "ALTER TABLE " . USERS_TABLE . " ADD profile_invisible TINYINT(1) DEFAULT 0 NOT NULL";
$result = $site_db->query($sql_alter);
if (isset($result) && isset($user_row['profile_invisible'])) {
if (is_object($site_email) && !empty($site_email)) {
unset ($site_email);
}
if (defined('PROFILE_INVISIBLE_EMAIL_ANNOUNCEMENT') && PROFILE_INVISIBLE_EMAIL_ANNOUNCEMENT == 1) {
@include_once(ROOT_PATH.'includes/email.php');
$site_email = new Email();
$sql_email_all_wanted_email_users = "
SELECT " . get_user_table_field("", "user_name"). get_user_table_field(", ", "user_email") . "
FROM " . USERS_TABLE . "
WHERE " . get_user_table_field("", "user_level") . " >= " . USER . " AND " . get_user_table_field("", "user_allowemails") . " = 1
";
$result1 = $site_db->query($sql_email_all_wanted_email_users);
if (isset($result1) && $site_db->get_numrows($result1) > 0) {
while ($user_email_info = $site_db->fetch_array($result1)) {
$user_name = $user_email_info[$user_table_fields['user_name']];
$user_email = $user_email_info[$user_table_fields['user_email']];
}
if (isset($user_name) && isset($user_email)) {
$site_email->set_to(stripslashes($user_email));
$site_email->set_from(stripslashes($config['site_email'])); // Change this line with the email address of your choice IF ONLY it does not work from your admin settings (make sure to change BEFORE executing this MOD for the first time and to set the activation value from your constant file).
$site_email->set_subject($lang['profile_invisible_email_subject']);
$site_email->register_vars(array(
"user_name" => trim($user_name),
"site_name" => trim($config['site_name']),
"site_email" => trim($config['site_email']),
"site_url" => format_url($script_url . "/index.php")
));
$site_email->set_body("profile_invisible_announcement", $config['language_dir_default']);
$site_email->send_email();
}
}
}
}
}
$sql = "
SELECT DISTINCT " . get_user_table_field("", "user_id") . "
FROM " . USERS_TABLE . "
WHERE " . get_user_table_field("", "user_level") . " >= " . USER . " AND profile_invisible = 0
ORDER BY rand()
LIMIT 1
";
if ($user_info = $site_db->query_firstrow($sql)) {
foreach ($user_table_fields as $key => $val) {
if (isset($user_info[$val])) {
$user_info[$key] = $user_info[$val];
}
elseif (!isset($user_info[$key])) {
$user_info[$key] = "";
}
}
}
}
return $user_info;
}
$additional_user_fields['profile_invisible'] = array($lang['profile_invisible'], "radio", 1);
// Profile invisible.
define('PROFILE_INVISIBLE', 1); // 0 to deactivate and 1 to activate.
define('PROFILE_INVISIBLE_EMAIL_ANNOUNCEMENT', 1); // 0 to deactivate and 1 to activate the email announcement for this feature to ALL users who has set their emails for allowance (once per install only).
//-----------------------------------------------------
//--- Profile invisible -------------------------------
//-----------------------------------------------------
$lang['profile_invisible'] = "Make my profile invisible to others:<br /><span class=\"smalltext\"><b>(Note: This option disregards the administrators.)</span>";
$lang['profile_invisible_email_subject'] = "Profile invisible feature - added on your profile.";
Dear {user_name},
{site_name} gallery has intergrated a new feature called:
- Profile invisible.
This will allow you to hide your profile from other users.
Note: This feature disregards the ADMIN level since they
can still see your profile even when restricted.
Now, other users who will try to see your profile will
be forwarded 'randomly' to other accounts where other
users will NOT consider this new option.
Visit our URL: {site_url} and modify your profile setting
if needed.
If you have any questions regarding this feature, please
send an email to us at: {site_email} .
Your suggestions are important to us. We will reply as
soon as possible.
Regards.
{site_name} .
<tr>
<td class="row1"><b>{lang_invisible}</b></td>
<td class="row1">
<input type="radio" name="user_invisible" value="1"{user_invisible_yes} />
{lang_yes}
<input type="radio" name="user_invisible" value="0"{user_invisible_no} />
{lang_no}
</td>
</tr>
<tr>
<td class="row2"><b>{lang_profile_invisible}</b></td>
<td class="row2">
<input type="radio" name="profile_invisible" value="1"{profile_invisible_yes} />
{lang_yes}
<input type="radio" name="profile_invisible" value="0"{profile_invisible_no} />
{lang_no}
</td>
</tr>
ALTER TABLE 4images_users ADD profile_invisible tinyint(1) NOT NULL default '0';