2014-02-24 96 views

回答

0

我無法找到一個方法,但這裏是我有我自己的插件中使用的腳本。所有似乎都能正常工作

protected function _addNote($vars) { 

    $now = new JDate(); 
    $now = $now->toSql(); 

    // Create and save the user note 
    $userNote = (object) array(
        'user_id'   => $vars['id'], 
        'catid'    => 0, 
        'subject'   => "User Information Update By Proworx", 
        'body'    => "<p>User ".$vars['name']." has been updated to:</p><p>Name: ".$vars['name']."</p><p>Email: ".$vars['email']."</p><p>Password: Not Telling... check proworx</p>", 
        'state'    => 1, 
        'created_user_id'    => 332, //DONT FORGET TO CHANGE THIS VALUE TO YOUR SITES ADMIN 
        'created_time'     => $now 
    ); 
    $db  = JFactory::getDbo(); 
    $db->insertObject('#__user_notes', $userNote, 'id'); 
} 
相關問題