当前位置: 首页>>代码示例>>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;未经允许,请勿转载。