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)

fyjpm 12-13-2005 12:50 AM

Well if you named your CMPS page that displays all of Vbulletins pages to "forum" then you are ok with this part. You can check by going into Admin Control Panel > vBa CMPS > Edit Pages and look for "forum" if you don't see it then this is your problem and change that to what you do see there and see if that works. IF you do see it, then I'm getting at a loss for why its doing this for you...

-John

Quote:

Originally Posted by cbr929rrerion
I have this

Code:

<?php
define('VBA_PORTAL', true);
define('VBA_PAGE', 'forum');



cbr929rrerion 12-13-2005 01:04 AM

ok... what should be named what?

it was named default, I renamed it to forum, still not work but the identifier is still default...

what where do I need to check?

Kuimera 12-13-2005 01:41 AM

So you have to change it manualy, every time I add a new profile field I go there and change in the text what I added, that a good idea.
Tks a lot, now plz ppl, anwser is questions :P

fyjpm 12-13-2005 03:18 AM

Quote:

Originally Posted by cbr929rrerion
ok... what should be named what?

it was named default, I renamed it to forum, still not work but the identifier is still default...

what where do I need to check?

before we continue on, please make sure you've followed the instructions carefully at:

http://www.vbadvanced.com/membersare...tid=4&pageid=6

Then you just have to make sure that the :

<?php
define('VBA_PORTAL', true);
define('VBA_PAGE', 'include');

is the same as the module's identifier you created.

fyjpm 12-13-2005 04:26 AM

Quote:

Originally Posted by fyjpm
How can I get the members username in the error message like this:

"Dear so-and-so, you need to fill in the required field blah blah blah..."

Anyone?

Thanks,

John

"There's no help like self help" so in case anybody else wants get fancy like me find this line in the hook for this mod:

Code:

                                eval(standard_error(fetch_error('zzz_update_profile',$vbulletin->options['bburl'],$vbulletin->session->vars['sessionurl'])));
change to this:

Code:

                                eval(standard_error(fetch_error('zzz_update_profile',$vbulletin->options['bburl'],$vbulletin->session->vars['sessionurl'],$vbulletin->userinfo['username'])));
Now in your Phrase manager search for : zzz_update_profile

change to

Code:

Dear {3}, there are new required profile field(s) since your last visit: click <a href="{1}/profile.php?{2}do=editprofile">Edit Profile</a> to update.
There. Personalized error message. ;)

-John

EDIT: see next post for combined features: https://vborg.vbsupport.ru/showthrea...554#post847554

fyjpm 12-13-2005 05:29 AM

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 ####


fyjpm 12-13-2005 07:15 AM

Quote:

Originally Posted by fyjpm
You know what I almost cross posted you because I was looking at the code and it does seem that they should keep getting it...I'm thinking its because I'm using CMPS that a blank screen is happening? I'll post back my findings, anyone else have an idea please reply.

Thanks guys!

-John

P.S. Obviously I clicked *INSTALL* and I love this hack. nuff said.

FIXED this issue with vBA CMPS: see my self-answering thread here:
http://www.vbadvanced.com/forum/showthread.php?p=74589

But here's the quick fix:

add:
PHP Code:

            if (defined('VBA_PORTAL') AND !defined('SKIP_OUTPUT') AND !defined('VBA_SCRIPT'))
            {
                
define('SKIP_OUTPUT'true);
            } 

right before:

PHP Code:

            eval('$headinclude = "' fetch_template('headinclude') . '";');
            eval(
'$header = "' fetch_template('header') . '";');
            eval(
'$footer = "' fetch_template('footer') . '";'); 


cbr929rrerion 12-13-2005 09:24 PM

Im sad to say I wish I could get it to work but I cant, I named the part in the index.php file the same as the identifier and all else checks out.. I guess I cant use this

fyjpm 12-13-2005 10:09 PM

Quote:

Originally Posted by cbr929rrerion
Im sad to say I wish I could get it to work but I cant, I named the part in the index.php file the same as the identifier and all else checks out.. I guess I cant use this

PM me with your login info, I'll take a look for you... we can finish this in instant messenger or PM.

ConKien 12-19-2005 08:14 AM

Is there a way to force users to pick their avatar OR upload their profile's picture?

*Click Install*


All times are GMT. The time now is 01:03 AM.

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.01409 seconds
  • Memory Usage 1,774KB
  • 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
  • (2)bbcode_php_printable
  • (6)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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