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


PHP messages::portfolioDeletedNotification方法代碼示例

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


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

示例1: DelPortf

 /**
  * Удаляет работу из портфолио.
  *
  * @param integer $fid			UID юзера, который удаляет работу
  * @param integer $prj_id		id проекта
  * @param integer $force		1 - удаление админом (забивает на UID), 0 - обычный юзер
  *
  * @return string				сообщение об ошибке
  */
 public function DelPortf($fid, $prj_id, $force = 0)
 {
     global $DB;
     $dir = get_login($fid);
     $l_dir = substr($dir, 0, 2) . '/' . $dir;
     if ($force == 0) {
         $addit = "AND user_id='{$fid}'";
     }
     $sql = "SELECT pict, prev_pict, user_id FROM portfolio WHERE (id=?i {$addit})";
     $res = $DB->row($sql, $prj_id);
     $fname = $res['pict'];
     $pname = $res['prev_pict'];
     $uid = $res['user_id'];
     if ($uid != $fid && $force) {
         require_once ABS_PATH . '/classes/users.php';
         $user = new users();
         $user->GetUserByUID($uid);
         $l_dir = substr($user->login, 0, 2) . '/' . $user->login;
         // уведомление об удалении
         require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/messages.php';
         messages::portfolioDeletedNotification($user->uname, $user->usurname, $user->login);
     } else {
         if ($uid != $fid && !$force) {
             return 'Вы не можете удалять чужие работы!';
         }
     }
     if ($fname) {
         $cfile = new CFile();
         $cfile->Delete(0, "users/{$l_dir}/upload/", $fname);
         $cfile->Delete(0, "users/{$l_dir}/upload/", 'tn_' . $fname);
     }
     if ($pname) {
         if (!$cfile) {
             $cfile = new CFile();
         }
         $cfile->Delete(0, "users/{$l_dir}/upload/", $pname);
     }
     $sql = "DELETE FROM portfolio WHERE id=?i {$addit}";
     $DB->query($sql, $prj_id);
     $error = $DB->error;
     if (!$error && $fid == $uid) {
         require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/user_content.php';
         $sql .= $DB->parse('DELETE FROM moderation WHERE rec_id = ?i AND rec_type = ?i;', $prj_id, user_content::MODER_PORTFOLIO);
     }
     return $error;
 }
開發者ID:kapai69,項目名稱:fl-ru-damp,代碼行數:55,代碼來源:portfolio.php


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