当前位置: 首页>>代码示例>>PHP>>正文


PHP Forum::getErrorMessage方法代码示例

本文整理汇总了PHP中Forum::getErrorMessage方法的典型用法代码示例。如果您正苦于以下问题:PHP Forum::getErrorMessage方法的具体用法?PHP Forum::getErrorMessage怎么用?PHP Forum::getErrorMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Forum的用法示例。


在下文中一共展示了Forum::getErrorMessage方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: approve

 /**
  *	approve - Approve pending project.
  *
  *	@param	object	The User object who is doing the updating.
  *	@access public
  */
 function approve(&$user)
 {
     if ($this->getStatus() == 'A') {
         $this->setError(_("Group already active"));
         return false;
     }
     db_begin();
     // Step 1: Activate group and create LDAP entries
     if (!$this->setStatus($user, 'A')) {
         db_rollback();
         return false;
     }
     //
     //
     //	Tracker Integration
     //
     //
     $ats = new ArtifactTypes($this);
     if (!$ats || !is_object($ats)) {
         $this->setError(_('Error creating ArtifactTypes object'));
         db_rollback();
         return false;
     } else {
         if ($ats->isError()) {
             $this->setError(sprintf(_('ATS%d: %s'), 1, $ats->getErrorMessage()));
             db_rollback();
             return false;
         }
     }
     if (!$ats->createTrackers()) {
         $this->setError(sprintf(_('ATS%d: %s'), 2, $ats->getErrorMessage()));
         db_rollback();
         return false;
     }
     //
     //
     //	Forum Integration
     //
     //
     $f = new Forum($this);
     if (!$f->create('Open-Discussion', 'General Discussion', 1, '', 1, 0)) {
         $this->setError(sprintf(_('F%d: %s'), 1, $f->getErrorMessage()));
         db_rollback();
         return false;
     }
     $f = new Forum($this);
     if (!$f->create('Help', 'Get Public Help', 1, '', 1, 0)) {
         $this->setError(sprintf(_('F%d: %s'), 2, $f->getErrorMessage()));
         db_rollback();
         return false;
     }
     $f = new Forum($this);
     if (!$f->create('Developers', 'Project Developer Discussion', 0, '', 1, 0)) {
         $this->setError(sprintf(_('F%d: %s'), 3, $f->getErrorMessage()));
         db_rollback();
         return false;
     }
     //
     //
     //	Doc Mgr Integration
     //
     //
     $dg = new DocumentGroup($this);
     if (!$dg->create('Uncategorized Submissions')) {
         $this->setError(sprintf(_('DG: %s'), $dg->getErrorMessage()));
         db_rollback();
         return false;
     }
     //
     //
     //	FRS integration
     //
     //
     $frs = new FRSPackage($this);
     if (!$frs->create($this->getUnixName())) {
         $this->setError(sprintf(_('FRSP: %s'), $frs->getErrorMessage()));
         db_rollback();
         return false;
     }
     //
     //
     //	PM Integration
     //
     //
     $pg = new ProjectGroup($this);
     if (!$pg->create('To Do', 'Things We Have To Do', 1)) {
         $this->setError(sprintf(_('PG%d: %s'), 1, $pg->getErrorMessage()));
         db_rollback();
         return false;
     }
     $pg = new ProjectGroup($this);
     if (!$pg->create('Next Release', 'Items For Our Next Release', 1)) {
         $this->setError(sprintf(_('PG%d: %s'), 2, $pg->getErrorMessage()));
         db_rollback();
//.........这里部分代码省略.........
开发者ID:neymanna,项目名称:fusionforge,代码行数:101,代码来源:Group.class.php

示例2: getStringFromRequest

 $details = getStringFromRequest('details');
 //check to make sure both fields are there
 if ($summary && $details) {
     /*
     	Insert the row into the db if it's a generic message
     	OR this person is an admin for the group involved
     */
     /*
     	create a new discussion forum without a default msg
     	if one isn't already there
     */
     db_begin();
     $f = new Forum(group_get_object($sys_news_group));
     if (!$f->create(ereg_replace('[^_\\.0-9a-z-]', '-', strtolower($summary)), $details, 1, '', 0, 0)) {
         db_rollback();
         exit_error('Error', $f->getErrorMessage());
     }
     $new_id = $f->getID();
     $sanitizer = new TextSanitizer();
     $details = $sanitizer->SanitizeHtml($details);
     $sql = "INSERT INTO news_bytes (group_id,submitted_by,is_approved,post_date,forum_id,summary,details) " . " VALUES ('{$group_id}','" . user_getid() . "','0','" . time() . "','{$new_id}','" . htmlspecialchars($summary) . "','" . $details . "')";
     $result = db_query($sql);
     if (!$result) {
         db_rollback();
         form_release_key(getStringFromRequest('form_key'));
         $feedback = ' ' . _('ERROR doing insert') . ' ';
     } else {
         db_commit();
         $feedback = ' ' . _('News Added.') . ' ';
     }
 } else {
开发者ID:neymanna,项目名称:fusionforge,代码行数:31,代码来源:submit.php


注:本文中的Forum::getErrorMessage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。