hi,
here is the situation:
There are user profile of type 'brand' and 'store'. Each store may or may not be linked to a 'brand'. The stores of a brand have a common value of a CB field cb_brand. Now I want to setup the brand profile such that when a user of brand profile posts an update, it gets registered with the profilebook and activity plugins of the stores associated with that brand and gets displayed as their brand/activity. For that purpose i create two fields cb_brandupdate and cb_brandupdatetitle for use as the description and title fields of profilebook updates. They are accessible only to brand profile owners during profile update. Now, I am running a code auto action as:
accesslevel:Brands
trigger:onAfterUserUpdate
method:php(eval)
return:silent.
The code is following:
$now = date("Y-m-d H:i:s");
$result = mysql_query("SELECT user_id FROM joomla_comprofiler WHERE cb_brand=[cb_brand]");
while($row = mysql_fetch_array($result))
{
mysql_query("INSERT INTO `backup5aug`.`joomla_comprofiler_plug_profilebook` (`id`, `mode`, `posterid`, `posterip`, `postername`, `posteremail`, `posterlocation`, `posterurl`, `postervote`, `postertitle`, `postercomment`, `date`, `userid`, `feedback`, `editdate`, `editedbyid`, `editedbyname`, `published`, `status`) VALUES (NULL, 'b', '[user_id]', '[user_ip]', '[cb_shopname]', '