Sure, why not? It is more of a work around than a solution though. It may not be the most efficient or ingenius way but here is how I did it.
In comprofiler.php, look for the main switch statement at the beginning of the file. It will start off with something like [code:1]
switch( $task ) {
case "userDetails":
case "userdetails":
userEdit( $option, $my->id, _UE_UPDATE );
break;
[/code:1]
All you need to do is a add case statement. Name it whatever you want. For this example let's call it 'updateQuery' so you would add a case statement that will call a function you will soon write.
[code:1]
case "updateQuery":
updateQuery($my->id);
break;
[/code:1]
Now write the function. Notice how I am able to pass a parameter in the url:
[code:1]
function updateQuery($uid) {
global $database;
$params = urldecode(mosGetParam($_GET, "params"«»));
$database->setQuery("UPDATE #__comprofiler_tabs SET enabled='0' WHERE userid=".$uid." AND params='".$params."'"«»);
$database->query();
}
[/code:1]
That's it. If you now call the link
www.domain.com/index.php?option=com_comprofiler&task=updateQuery¶ms=parameters, your updateQuery function will be called. If you haven't realized it yet, you can set this link to any menu item thereby calling a database update.
I hope that's clear, let me know if you are confused.
Post edited by: eisnerj, at: 2006/07/10 22:26