View Single Post
  #117  
Old 12-13-2005, 05:29 AM
fyjpm's Avatar
fyjpm fyjpm is offline
 
Join Date: Oct 2005
Location: Buffalo, NY
Posts: 31
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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 ####
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03208 seconds
  • Memory Usage 1,782KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete