當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Note::add方法代碼示例

本文整理匯總了PHP中Note::add方法的典型用法代碼示例。如果您正苦於以下問題:PHP Note::add方法的具體用法?PHP Note::add怎麽用?PHP Note::add使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Note的用法示例。


在下文中一共展示了Note::add方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: add_note

 public function add_note()
 {
     if (!Visitor::current()->group->can("add_note")) {
         show_403(__("Access Denied"), __("You do not have sufficient privileges to add notes.", "extend"));
     }
     $version = new Version($_POST['version_id']);
     if (empty($_POST['body'])) {
         Flash::warning(__("Please enter a message.", "extend"), $version->url());
     }
     $note = Note::add($_POST['body'], $_POST['version_id']);
     $files = array();
     foreach ($_FILES['attachment'] as $key => $val) {
         foreach ($val as $file => $attr) {
             $files[$file][$key] = $attr;
         }
     }
     foreach ($files as $attachment) {
         if ($attachment['error'] != 4) {
             $path = upload($attachment, null, "attachments");
             Attachment::add(basename($path), $path, "note", $note->id);
         }
     }
     Flash::notice(__("Note added.", "extend"), $note->url(true));
 }
開發者ID:vito,項目名稱:chyrp-site,代碼行數:24,代碼來源:controller.Extend.php

示例2: retrieve

<?php

define('NO_SESSION_LOCATION', true);
require_once '../kernel/begin.php';
require_once 'media_begin.php';
require_once '../kernel/header_no_display.php';
if (!empty($_GET['note']) && $User->check_level(MEMBER_LEVEL)) {
    $id = retrieve(POST, 'id', 0);
    $note = retrieve(POST, 'note', 0);
    import('content/note');
    $Note = new Note('media', $id, '', $MEDIA_CONFIG['note_max'], '', NOTE_DISPLAY_NOTE);
    if (!empty($note) && !empty($id)) {
        echo $Note->add($note);
    }
}
開發者ID:janus57,項目名稱:PHPBoost_v3c,代碼行數:15,代碼來源:xmlhttprequest.php

示例3: add

 /**
  * Overload the add() method to the contact activity
  */
 function add()
 {
     if (strlen($this->date_added) == 0) {
         $this->date_added = date("Y-m-d");
     }
     $Parsedown = new Parsedown();
     $this->note = $Parsedown->text($this->note);
     parent::add();
     // This below was a try that didn't worked as to global. Created the eventFormatNoteInsert eventaction instead.
     // $this->note = $this->quote(htmlentities($this->note));
     // $this->query("INSERT INTO ".$this->getTable()." (`idcontact`, `note`, `date_added`, `document`, `idcompany`, `iduser`)
     //                 VALUES ('".$this->idcontact."','".$this->note."','".$this->date_added."','".$this->document."','".$this->company."','".$this->iduser."')");
     // $this->setPrimaryKeyValue($this->getInsertId($this->getTable(), $this->getPrimaryKey()));
     if ($this->getPrimaryKeyValue() > 0) {
         $contact = $this->getParentContact();
         $contact->setActivity();
     }
 }
開發者ID:jacquesbagui,項目名稱:ofuz,代碼行數:21,代碼來源:ContactNotes.class.php


注:本文中的Note::add方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。