vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   Force Current Members To Fill Out Required Profile Field (https://vborg.vbsupport.ru/showthread.php?t=82756)

calorie 06-08-2005 10:00 PM

Force Current Members To Fill Out Required Profile Field
 
So you add a new required profile field, and members who join afterwards are forced to fill out the field, but you want your current members to fill out that field too. Well unless your current members go edit their profile, the new field sits and waits for them to take action. This mod will force your current members to fill out the field by prompting them for action before allowing them to return to normal site use. Here are some further details:
  • Install as a vB 3.5.0 product.
  • Thanks to wolfyman for this post.
  • Thanks to KirbyDE for this post.
  • Credit is given to Revan from this post.
  • Credit is given to Locutus2999 from this thread.
  • Related vB 2.2.x from roxics in this thread.
  • Here based off the vB 2.3.x hack by Locutus2999.
  • Cost to install this mod is an additional query.
  • Support only if/as time available, no guarantees.
  • Should you install, say thanks by clicking install.
Remember to set 'Field Required' to 'Yes' and 'Field Editable by User' to 'Yes' for mod to kick in (see profile how-to: http://www.vbulletin.com/docs/html/profile).

Mod Update (03 September 2005):
- changed mod from plugin/hack to product

Mod Update (01 October 2005):
- changed mod to have better output display

Mod Update (10 October 2005):
- changed mod to use required, editable fields

Mod Update (02 February 2006):
- added vB v.3.5.3 force profile update mod

Barakat 06-09-2005 08:37 PM

thanks ....

eXtremeTim 06-09-2005 08:42 PM

You can do this as a plugin. I just looked and should work.

calorie 06-09-2005 09:53 PM

@Barakat: You're welcome.

@eXtremeTim: Thanks for checking, plugin added.

TruckMuddr 06-11-2005 05:26 AM

Umm, is it just me or is there no Phrase Type: Front-End Error Messages???

There is a Front-End Redirect Messages type!

calorie 06-11-2005 07:41 AM

@TruckMuddr: Use "Error Messages" as the Phrase Type.

clearchannel 06-11-2005 11:23 AM

Receiving the following error message. You help is appericated

Code:

print_standard_error(...)
is now redundant. Instead, use
standard_error(fetch_error(...))


Logikos 06-11-2005 01:30 PM

Very usefull hack calorie!

Svenna 06-11-2005 02:01 PM

nice job :squareeyed:

calorie 06-11-2005 07:04 PM

@clearchannel: Download again and reinstall.

@Live Wire and Svenna: Thanks.

clearchannel 06-11-2005 08:39 PM

That worked very nice.

Thank you, this is a much needed addition.

Nukey 06-12-2005 02:33 PM

Hmm. I installed this hack as a plugin, and I dont get the screen looking as you do. It appears out of format on a while screen with black text and a forum jump menu. It also does not allow you to log out until you edit your profile, which you should be able to do.

calorie 06-12-2005 02:55 PM

@Nukey: Make sure you have a fresh download. It should look like this except with the message in the screenshot. If you want to allow logout use:
Code:

$zzz_regex = "(profile|usercp|login)\.php";

Nukey 06-12-2005 02:59 PM

calorie, I just downloaded it a few minutes ago. Im not sure why it looks like it does in the screenshot. Any other ideas? I have the phrase as a "Front End Error Message"

Nukey 06-12-2005 03:00 PM

When I go to the Plugin section and choose edit plugin, this is what I see:

Code:

// #### Force Current Members To Fill Out Required Profile Field ####
if ($vbulletin->userinfo['userid'] > 1)
{
    $zzz_regex = "(profile|usercp).php";
    if (isset($_SERVER['REQUEST_URI']) && !eregi($zzz_regex,$_SERVER['REQUEST_URI']))
    {
        $zzz_reqfields = $db->query_read("SELECT profilefieldid ".
                "FROM ".TABLE_PREFIX."profilefield ".
                "WHERE required = 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")
                {
                    eval(standard_error(fetch_error('zzz_update_profile',$vbulletin->options['bburl'],$vbulletin->session->vars['sessionurl'])));
                }
            }
        }
    }
}
// #### Force Current Members To Fill Out Required Profile Field ####


calorie 06-12-2005 03:17 PM

The plugin you are using looks good, except if you want to add login to the $zzz_regex variable. Try using "Error Messages" not "Front End Error Messages" as the Phrase Type.

Nukey 06-12-2005 03:34 PM

I don't have Error Messages in my list? This is baffling. I want to be able to use the plugin but for some reason its just giving me the white screen instead of the error box.

calorie 06-12-2005 03:54 PM

What does the HTML look like (just around the message)?

Nukey 06-12-2005 03:56 PM

After looking at the HTML of the page that loads, it appears that everything above the three <br /> does not appear. Ie. none of these sections of code that are in the showthread error message are in this plugin's error message.
Code:

<!-- CSS Stylesheet -->
<!-- logo -->
<!-- content table -->
<!-- open content container -->

Is there something I can include to get everything to appear correctly?
Or maybe I missed something...I downloaded the file and uploaded it through the "import plugin" part of the admin cp, and I made the phrase in the phrase manager "Front End Error Messages". There is no "Error Messages". Did I miss something?
Thanks Again!

calorie 06-12-2005 04:24 PM

Try moving the plugin from global_start to global_complete.

Nukey 06-12-2005 04:33 PM

That gives me an error:
Code:

Fatal error: Call to a member function on a non-object in /mydir/httpdocs/forums/includes/functions.php(4118) : eval()'d code on line 7

calorie 06-12-2005 04:44 PM

Sorry I can't test right now. What if you move it from global_start to navbits?

Nukey 06-12-2005 04:47 PM

Same type of error again. Oh well. Thanks for trying. If you come up with anything I'll be watching this thread :)

Nukey 06-12-2005 05:04 PM

Well I use a sort of workaround. I replaced the eval(error message) code and just had it redirect to a page that looks exactly like the error that I made lol :)

calorie 06-12-2005 05:11 PM

I should have a fix soon, if you can give it a test?

calorie 06-12-2005 05:21 PM

Okay, redownload the attached plugin for use at global_start and let me know if you are missing any part of the page like you were before.

evss 07-30-2005 07:52 AM

Thank You, working prefectly on my forum.

calorie 07-31-2005 11:25 PM

Quote:

Originally Posted by evss
Thank You, working prefectly on my forum.

Great, glad it's now working. :)

Andreas 08-01-2005 12:36 PM

Instead of
PHP Code:

$zzz_regex "(profile|usercp)\.php";
if (isset(
$_SERVER['REQUEST_URI']) && !eregi($zzz_regex,$_SERVER['REQUEST_URI']))


why not just
PHP Code:

if (THIS_SCRIPT != 'profile' AND THIS_SCRIPT != 'usercp'

?

Btw: Did you consider releasing this as a Product?
Would make installation and maintenace easier :)

calorie 08-03-2005 07:22 PM

Thanks Kirby, marked for later...

Darth Gill 08-03-2005 08:04 PM

I personally think this is one of the neatest hacks around! Thanks calorie.

ajpritch 08-31-2005 08:19 AM

When I try and do step two and add the phrase the Error message is not an option.

Boofo 08-31-2005 09:36 AM

When this goes product, I will definately be installing it. )

nexialys 09-02-2005 09:50 PM

PHP Code:

if (isset($_SERVER['REQUEST_URI']) && !eregi($zzz_regex,$_SERVER['REQUEST_URI'])) 

can be simply changed to :
PHP Code:

if (THIS_SCRIPT != 'profile' OR THIS_SCRIPT != 'usercp'

and you can then forget about all the $_SERVER['REQUEST_URI'] trash...

calorie 09-03-2005 06:22 PM

@KirbyDE: Thanks, edited and producted.
@Darth Gill: Thanks, glad you like the mod.
@ajpritch: Try the latest XML attachment.
@Boofo: Producted, wink, time to install.
@nexialys: Thanks, but use AND not OR.

Boofo 09-03-2005 06:31 PM

Quote:

Originally Posted by calorie
@KirbyDE: Thanks, edited and producted.
@Darth Gill: Thanks, glad you like the mod.
@ajpritch: Try the latest XML attachment.
@Boofo: Producted, wink, time to install.
@nexialys: Thanks, but use AND not OR.

Ahh, but if you use AND and it is one of those, what will happen? OR is correct. ;)

Andreas 09-03-2005 06:35 PM

Quote:

Originally Posted by nexialys
can be simply changed to :
PHP Code:

if (THIS_SCRIPT != 'profile' OR THIS_SCRIPT != 'usercp'


This can simply be changed to
PHP Code:

if (true

:D

AND is correct.

Boofo 09-03-2005 06:36 PM

Quote:

Originally Posted by KirbyDE
This can simply be changed to
PHP Code:

if (true

:D

AND is correct.

But if it was an both conditions would have to be true, right? With OR, either condition.

calorie 09-03-2005 06:37 PM

Code:

A AND B = result  A OR B = result
----------------  ---------------
F    F    F      F    F    F
F    T    F      F    T    T
T    F    F      T    F    T
T    T    T      T    T    T

You only want to do the IF when you are not on profile and not on usercp, so AND is what you want.

Edit: PS: Note that you cannot be F F F so if you use OR you are trapped. ;)

Boofo 09-03-2005 06:46 PM

You might want to throw some instructions on setting up the profile field in a text file and ZIP it up for those that might have to re-install vb sometime. ;)


All times are GMT. The time now is 09:23 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01426 seconds
  • Memory Usage 1,826KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (6)bbcode_code_printable
  • (7)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete