$requestName, 'appid' => $appId, 'type' => $type, 'fromuid' => $uId, 'dateline' => $now ); foreach($recipientIds as $key => $val) { $hash = crc32($appId . $val . $now . rand(0, 1000)); $hash = sprintf('%u', $hash); $fields['touid'] = intval($val); $fields['hash'] = $hash; $fields['myml'] = str_replace('{{MyReqHash}}', $hash, $myml); $result[] = C::t('common_myinvite')->insert($fields, true); $note = array( 'from_id' => $fields['touid'], 'from_idtype' => 'myappquery' ); notification_add($fields['touid'], 'myapp', 'myinvite_request', $note); } return $result; } }