We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

LG Member Form Customiser 1.1.0 - Remove fields for specific member groups

Development and Programming

Leevi Graham's avatar
Leevi Graham
1,143 posts
16 years ago
Leevi Graham's avatar Leevi Graham

Try change line 747 of the extension file from:

if($this->debug !== FALSE)

to

if($this->debug == TRUE)

I have a new version of this extension ready to be released. I just have to find the time.

Cheers

       
kpow's avatar
kpow
22 posts
16 years ago
kpow's avatar kpow
Try change line 747 of the extension file from:
if($this->debug !== FALSE)
to
if($this->debug == TRUE)
Cheers

Thanks for the info, however, I made the update on the file, and I am still getting:

rray ( [0] => LG Member Form Customiser Checking $SESS [1] => LG Member Form Customiser Checking $SESS: FAIL [2] => LG Member Form Customiser Checking cache [3] => LG Member Form Customiser Checking cache: FAIL [4] => LG Member Form Customiser Checking Site [5] => LG Member Form Customiser Checking Site: FAIL )

thanks for any other input.

       
Leevi Graham's avatar
Leevi Graham
1,143 posts
16 years ago
Leevi Graham's avatar Leevi Graham

Do you have debug anywhere in your url as a query parameter?

       
kpow's avatar
kpow
22 posts
16 years ago
kpow's avatar kpow
Do you have debug anywhere in your url as a query parameter?

honestly, i have no idea/where and how would i find that out to answer you? thanks. sorry for not knowing how to properly responding you in this case…

fyi on ee:

Debug Preference Enables the display of error messages, which are valuable during site development value is set to: 1: php/sq; error messages shown only to super admin.

should i change that to: 0: no php/sql error messages generated?

and if i do, does this impact anything else?

was that the answer to your question?

       
lukemcr's avatar
lukemcr
154 posts
16 years ago
lukemcr's avatar lukemcr

So has anyone found a workaround for the blank admin page bug? I’m still looking for one… :-(

       
lukemcr's avatar
lukemcr
154 posts
16 years ago
lukemcr's avatar lukemcr

Scratch that, I found one:

Install the “Remove ‘My Account’ Tab” extension, available at http://ellislab.com/forums/viewthread/40721/.

Installing that will prevent users from seeing all of the extraneous fields when they log in to the admin.

Then, just modify the default member templates, and strip out the AIM form field, ICQ form field, etc. Users can update their profile by going to {sitename}/member/member_id/.

At least, that’s how I did it.

       
lukemcr's avatar
lukemcr
154 posts
16 years ago
lukemcr's avatar lukemcr

I’m going a different direction, and would still like to use the LG MFC extension, but I’m still getting the blank admin screen when I log in with the extension enabled. I’m using 1.6.6, and have tried turning the extension’s automatic updates off.

Any tips?

       
lukemcr's avatar
lukemcr
154 posts
16 years ago
lukemcr's avatar lukemcr

Sorry again for the quadruple-post. :down: I’ve figured out a fix for the admin-blank page bug. Deactivating automatic updates in the extension’s settings didn’t work for me, so I had to take more drastic measures.

Open up system/extensions/ext.lg_mf_customiser.php in a text editor. We’re going to be removing the update functions from the extension’s code.

Remove the following three functions, in order from top to bottom:

<code>    function update_extension($current = '')
    {
        global $DB;

        if ($current == '' OR $current == $this->version)
            return FALSE;

        $sql[] = "UPDATE exp_extensions SET version = '" . $DB->escape_str($this->version) . "' WHERE class = '" . get_class($this) . "'";

        // run all sql queries
        foreach ($sql as $query)
        {
            $DB->query($query);
        }
    }[/code]

<pre><code>    function control_panel_home_page($home)
    {
        global $EXT;

        // -- Check if we're not the only one using this hook
        if($EXT->last_call !== FALSE)
            $home = $EXT->last_call;

        // check if updates for this extension are available
        if($updates = $this->_check_for_updates())
        {
            // add them to the message
            $home->messages = array_merge($home->messages, $updates);
        }
        // return home object
        return $home;
    }[/code]

and the long one:

<pre><code>    function _check_for_updates()
    {

        global $IN, $LANG, $SESS;

        $page_url         = "http://leevigraham.com/version-check/versions.txt";
        $updates         = FALSE;
        $versions         = FALSE;
        $cache_expired     = FALSE;
        
        $this->log[] = LG_MFC_addon_id . ' Checking $SESS';
        
        // check the $SESS for this version
        if(isset($SESS->cache['lg'][LG_MFC_addon_id]['latest_version']) === FALSE)
        {
            $this->log[] = LG_MFC_addon_id . ' Checking $SESS: FAIL';
            $this->log[] = LG_MFC_addon_id . ' Checking cache';
            // if there is nothing in the cache
            if(($versions = $this->_check_cache($page_url)) === FALSE)
            {
                // cache has expired
                $cache_expired = TRUE;

                $this->log[] = LG_MFC_addon_id . ' Checking cache: FAIL';
                $this->log[] = LG_MFC_addon_id . ' Checking Site';

                $temp = error_reporting(0);

                // try and open the webpage for reading
                if(($fp = fopen( $page_url, "r" )) !== FALSE)
                {
                    // while not the end of the file
                    // loop through every line
                    while ( ($current_line = fgets($fp)) !== FALSE )
                    {
                        // get the file contents
                        $versions = stream_get_contents($fp);
                    }
                    $this->log[] = LG_MFC_addon_id . ' Checking Site: SUCCESS';
                }
                else
                {
                    $this->log[] = LG_MFC_addon_id . ' Checking Site: FAIL';
                }
                // turn back on error reporting
                error_reporting($temp);
            }
            else
            {
                $this->log[] = LG_MFC_addon_id . ' Checking cache: SUCCESS';
            }

            // if everything failed: $SESS, file cache and site
            if($versions === FALSE)
            {
                // send an error
                $updates[] = "<div class='alert'>Addon update check failed for " . LG_MFC_addon_id .".</div>";
                print("<pre>" . print_r($this->log, TRUE) . "

”); return $updates; }

        // explode the string at its eof
        $addons = explode("\n", $versions);

        // for each of the exploded parts
        foreach ($addons as $addon)
        {
            // explode the delimiter
            $tmp = explode(":", $addon);
            // set the cache
            $SESS->cache['lg'][trim($tmp[0])]['latest_version'] = trim($tmp[1]);
        }
    }
    else
    {
        $this->log[] = LG_MFC_addon_id . ' Checking $SESS: SUCCESS';
    }


    // YAY now we have the latest versions for all LG addons!

    // if the most recent version is larger than this version
    if ($SESS->cache['lg'][LG_MFC_addon_id]['latest_version'] > $this->version)
    {
        if(isset($SESS->cache['lg']['updates_available']) === FALSE)
        {
            $SESS->cache['lg']['updates_available'] = TRUE;
            $updates[] = "<div class='alert'>Module / extension / plugin updates available:</div>";
        }
        $updates[] = "<a href="http://">" . LG_MFC_addon_id . " v" . $SESS->cache['lg'][LG_MFC_addon_id]['latest_version'] . "</a>";
    }

    if ($cache_expired === TRUE)
    {
        $this->_write_cache($versions, $page_url);    
    }

    if($this->debug !== TRUE)
    {
        print("<pre>" . print_r($this->log, TRUE) . "</pre>");
    }

    return $updates;

}[/code]

Removing this code let me get the extension to work properly.

Leevi: sorry for giving your beautiful, useful extension a lobotomy. It was just the only way I could get it to work. :-(

       
Leevi Graham's avatar
Leevi Graham
1,143 posts
16 years ago
Leevi Graham's avatar Leevi Graham
Hi Leevi, I re-installed, and everything seems to be working fine, but now I’m getting this at the top of my CP homepage:
Array
(
    [0] => LG Member Form Customiser Checking $SESS
    [1] => LG Member Form Customiser Checking $SESS: FAIL
    [2] => LG Member Form Customiser Checking cache
    [3] => LG Member Form Customiser Checking cache: FAIL
    [4] => LG Member Form Customiser Checking Site
    [5] => LG Member Form Customiser Checking Site: FAIL
)

I know it was a while ago but I just uploaded a hotfix for the issue above. Just download the extension again and you should be good to go.

       
Jules van Schaijik's avatar
Jules van Schaijik
209 posts
16 years ago
Jules van Schaijik's avatar Jules van Schaijik

Hi Leevi,

Thanks a lot for this extension. Just what the doctor ordered! I just downloaded and installed it.

It works as expected in my own control panel (the backend). But it does not work on the website in the member profile templates. Is that a limitation of your extension, or did I do something wrong?

Thanks, Jules

       
Leevi Graham's avatar
Leevi Graham
1,143 posts
16 years ago
Leevi Graham's avatar Leevi Graham

This extension only works in the CP

       
Sam Sullivan's avatar
Sam Sullivan
64 posts
16 years ago
Sam Sullivan's avatar Sam Sullivan

Love this extension, but I lose the CP home too ( v 1.6.7 ) I cut the code as suggested, still had few problems:

Warning: call_user_func_array() [function.call-user-func-array]: First argumented is expected to be a valid callback, ‘lg_mf_customiser::control_panel_home_page’ was given in /home/south/public_html/cms/core/core.extensions.php on line 258

I’ll wait to see if fix as I can’t spend too much time on this, will have to live with the default profile fields sitting on top of my lovely custom fields.

       
HVAP's avatar
HVAP
3 posts
15 years ago
HVAP's avatar HVAP

Hiding the default member profile fields works as expected (so I know the Extension is working) however, hiding custom fields based on member group has no effect.

I have two member groups (with ids 8 and 9) and three custom profile fields (with ids 1,3, and 4).

I’ve entered the following under Member Group Rules:

8:4
9:1|3

When I view profiles for the one test user I have in each member group, all three custom profile fields are displayed.

       
1 2

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.