Quote:
Originally Posted by Kuimera
I know this should be kind of hard request, but sometimes we get that kind of dumb users who dont know the hell what is a profile, and when that message shows, they tend to go to the profile and leave without changing anything...
Is there a way to show in the msg what are the new profile fields or something?
|
I modified the code to expose 2 additional parameters you can use in the zzz_update_profile phrase "{3}" (username) and "{4}" (list of required fields needing attention). So one could do something like this:
Code:
Dear {3} there are new required profile field(s) since your last visit: {4}. Click <a href="{1}/profile.php?{2}do=editprofile">Edit Profile</a> to update.
Here's the modified "Force Profile Update" hook code: ( Plugin System > Plugin Manager > Hook Location: global_start )
Code:
// #### Force Current Members To Fill Out Required Profile Field ####
$zzz_showmessage = false;
$zzz_multiplefields = false;
if ($vbulletin->userinfo['userid'] > 1)
{
if (THIS_SCRIPT != 'profile' AND THIS_SCRIPT != 'usercp')
{
$zzz_reqfields = $db->query_read("SELECT profilefieldid, title ".
"FROM ".TABLE_PREFIX."profilefield ".
"WHERE required = 1 AND editable = 1");
if ($db->num_rows($zzz_reqfields))
{
while ($zzz_reqfield = $db->fetch_array($zzz_reqfields))
{
$zzz_fieldname = "field".$zzz_reqfield['profilefieldid'];
$zzz_userfield = $vbulletin->userinfo["$zzz_fieldname"];
if (empty($zzz_userfield) && $zzz_userfield != "0")
{
$zzz_multiplefields ? $zzz_fieldnamelist .= ", " . $zzz_reqfield['title'] : $zzz_fieldnamelist .= $zzz_reqfield['title'] ;
$zzz_multiplefields = true;
$zzz_showmessage = true;
}
}
}
if ($zzz_showmessage)
{
eval('$gobutton = "' . fetch_template('gobutton') . '";');
eval('$spacer_open = "' . fetch_template('spacer_open') . '";');
eval('$spacer_close = "' . fetch_template('spacer_close') . '";');
$show['pmstats'] = true;
if ($vbulletin->options['usepopups'] != 0)
{
$show['popups'] = true;
}
$show['member'] = true;
$show['searchbuttons'] = true;
$pmbox['lastvisitdate'] = vbdate($vbulletin->options['dateformat'], $vbulletin->userinfo['lastvisit'], 1);
$pmbox['lastvisittime'] = vbdate($vbulletin->options['timeformat'], $vbulletin->userinfo['lastvisit']);
$pmunread_html = iif($vbulletin->userinfo['pmunread'], '<strong>' . $vbulletin->userinfo['pmunread'] . '</strong>', $vbulletin->userinfo['pmunread']);
$vbphrase['unread_x_nav_compiled'] = construct_phrase($vbphrase['unread_x_nav'], $pmunread_html);
$vbphrase['total_x_nav_compiled'] = construct_phrase($vbphrase['total_x_nav'], $vbulletin->userinfo['pmtotal']);
eval('$headinclude = "' . fetch_template('headinclude') . '";');
eval('$header = "' . fetch_template('header') . '";');
eval('$footer = "' . fetch_template('footer') . '";');
eval(standard_error(fetch_error('zzz_update_profile',$vbulletin->options['bburl'],$vbulletin->session->vars['sessionurl'],$vbulletin->userinfo['username'],$zzz_fieldnamelist)));
}
}
}
// #### Force Current Members To Fill Out Required Profile Field ####