Back-End only Tab

18 years 1 month ago #6003 by mikko
Replied by mikko on topic Re:Back-End only Tab
Can you publish the plugin so that people can test it to see what is not working?

mikko

Please Log in to join the conversation.

18 years 1 month ago #6023 by spacebass5000
Replied by spacebass5000 on topic Re:Back-End only Tab
I am close to getting this to work. I just haven't been able to get back to it yet. Check back in a little while and I will post what I have, working or not.

Post edited by: spacebass5000, at: 2006/02/10 15:53

Please Log in to join the conversation.

18 years 1 month ago #6355 by spacebass5000
Replied by spacebass5000 on topic Re:Back-End only Tab
Ok, not having any luck. I am trying to utilize the onBeforeUserUpdate event and update a single text field that I have added to #_comprofiler.

Mikko had written:

All data is saved in #__comprofiler table, unless the plugin uses it's own sql to do custom inserts.

Easiest way to save data in a custom way is by using the onBeforeUserUpdate and modufy teh row and rowExtras variables that are passed to CBs function that acutally modifys the values in the DB


I was trying to do this but have failed miserably. I have tried so many different ways to do this and it just doesn't work for me. What I am trying to use at present (to simply see if it is working):

[code:1]global $_PLUGINS;
$_PLUGINS->registerFunction( 'onBeforeUserUpdate' , 'beforeUpdateUser' );

function beforeUpdateUser(&$user, &$cbUser)
{
header("Location: www.google.com");
}
[/code:1]

Does not produce the desired effect.

Can someone show me how to update an extra field placed in the#_comprofiler table by utilizing the onBeforeUserUpdate event?

Edit: The color="#007700"> is not in my code. The forum added that to my post for some reason.

Post edited by: spacebass5000, at: 2006/02/15 08:14

Please Log in to join the conversation.

18 years 1 month ago #6357 by mikko
Replied by mikko on topic Re:Back-End only Tab
See how the list tab plugin does this and copy that solution. Unfortunately I do not remember excatly how I did it, and for some reason the downloads does not seem to work.

But I had a similar problem which I solved there.

-mikko

Please Log in to join the conversation.

18 years 1 month ago #6402 by spacebass5000
Replied by spacebass5000 on topic Re:Back-End only Tab
Yeah, I took a look at that. You didn't utilize onBeforeUserUpdate (or any event for that matter), you altered the user's data in saveEditTab(). I took a look at that but it looks to me like it'll be overkill. The code you used looks a lot like that found in userSave().

I noticed the $row and $rowExtras variables used by the onBeforeUserUpdate event. My assumption is that I can use these variables in the function I attach to the event in order to help change my custom data. Thing is, I can't seem to get my attached function to fire off. I can't even get saveEditTab() to fire off either. Here is my code:

[code:1]

$_PLUGINS->registerFunction( 'onBeforeUserUpdate' , 'beforeUpdateUser' );

function beforeUpdateUser(&$user, &$cbUser)
{
echo "<p>".$user->email."</p>";
header("Location: www.google.com/"«»);
return true;
}[/code:1]

[code:1]
class getExampleTab extends cbTabHandler
{
function getExampleTab()
{
$this->cbTabHandler();
}

function saveEditTab($tab, $user, $ui, $postdata)
{
if(intval($user->id) < 1)
{
mosNotAuth();
return false;
}

if ( $ui == 1)
{
return "";
}
elseif ( $ui == 2)
{
echo "<p>".$user->id."</p>";
header("Location: http://www.google.com"«»);
return "working?";
}


}
}[/code:1]
I just can't seem to get this rolling. Any help?

Post edited by: spacebass5000, at: 2006/02/15 17:40

Post edited by: spacebass5000, at: 2006/02/15 17:45

Please Log in to join the conversation.

18 years 1 month ago #6523 by mwep
Replied by mwep on topic Re:Back-End only Tab
We desperately need this feature to work as well. We need to have a tab which is only accessible by admins or via the backend.

Any suggestions ?? PayPal Donations for anyone who can solve.

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.227 seconds

Facebook Twitter LinkedIn