本文整理汇总了PHP中getCurrentDateTimeInMySQL函数 的典型用法代码示例。如果您正苦于以下问题:PHP getCurrentDateTimeInMySQL函数的具体用法?PHP getCurrentDateTimeInMySQL怎么用?PHP getCurrentDateTimeInMySQL使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getCurrentDateTimeInMySQL函数 的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: _getSecondFolder
function _getSecondFolder($second_folder)
{
$second_folder = (string) $second_folder;
if (!empty($second_folder)) {
$array = array();
$retour = '';
for ($i = 0; $i < strlen($second_folder); $i++) {
if ($i > 0 and $i % 4 == 0) {
$retour .= '/';
}
$retour .= $second_folder[$i];
}
$retour .= '_';
} else {
include_once 'functions/date_functions.php';
$retour = md5(getCurrentDateTimeInMySQL());
}
return $retour;
}
开发者ID:a2call, 项目名称:commsy, 代码行数:19, 代码来源:cs_disc_manager.php
示例2: array
$params = array();
$params['focus_element_onload'] = 'new_buzzword';
redirect($environment->getCurrentContextID(), 'buzzwords', 'edit', $params);
}
}elseif (!empty($command) and isOption($command, $translator->getMessage('BUZZWORDS_COMBINE_BUTTON'))){
if ( (isset($_POST['sel1']) and !empty($_POST['sel1'])) and
(isset($_POST['sel2']) and !empty($_POST['sel2'])) and
(isset($_POST['sel1']) and isset($_POST['sel2']) and $_POST['sel1'] !=$_POST['sel2'])
){
$link_manager = $environment->getLinkManager();
$link_manager->combineBuzzwords($_POST['sel1'],$_POST['sel2']);
$buzzword_manager = $environment->getLabelManager();
$buzzword_item1 = $buzzword_manager->getItem($_POST['sel1']);
$buzzword_item2 = $buzzword_manager->getItem($_POST['sel2']);
$buzzword_item1->setName($buzzword_item1->getName().'/'.$buzzword_item2->getName());
$buzzword_item1->setModificationDate(getCurrentDateTimeInMySQL());
$buzzword_item1->save();
$buzzword_item2->delete();
$params = array();
$params['focus_element_onload'] = 'sel1';
redirect($environment->getCurrentContextID(), 'buzzwords', 'edit', $params);
}
}
// Display form
$params = array();
$params['environment'] = $environment;
$params['with_modifying_actions'] = true;
$form_view = $class_factory->getClass(FORM_VIEW,$params);
unset($params);
开发者ID:a2call, 项目名称:commsy, 代码行数:31, 代码来源:buzzwords_edit.php
示例3: save
public function save($form_data, $additional = array())
{
$environment = $this->_environment;
$text_converter = $this->_environment->getTextConverter();
if ($additional["contextId"]) {
$itemManager = $this->_environment->getItemManager();
$type = $itemManager->getItemType($additional["contextId"]);
$manager = $this->_environment->getManager($type);
$current_context = $manager->getItem($additional["contextId"]);
if ($type === CS_PRIVATEROOM_TYPE) {
$this->_environment->changeContextToPrivateRoom($current_context->getItemID());
}
}
$current_user = $this->_environment->getCurrentUserItem();
$current_context = $this->_environment->getCurrentContextItem();
$current_iid = $form_data['iid'];
if (isset($form_data['editType'])) {
$this->_edit_type = $form_data['editType'];
}
$translator = $this->_environment->getTranslationObject();
if ($current_iid === 'NEW') {
$item = null;
} else {
$manager = $this->_environment->getMaterialManager();
if (isset($additional['version_id']) and $additional['part'] != 'version') {
$item = $manager->getItemByVersion($current_iid, $additional['version_id']);
} else {
$item = $manager->getItem($current_iid);
}
}
$this->_popup_controller->performChecks($item, $form_data, $additional);
// TODO: check rights */
/****************************/
if ($current_iid != 'NEW' and !isset($item)) {
} elseif (!($current_iid == 'NEW' and $current_user->isUser() or $current_iid != 'NEW' and isset($item) and $item->mayEdit($current_user))) {
/****************************/
} elseif ($this->_edit_type != 'normal') {
$this->cleanup_session($current_iid);
// Set modificator and modification date
$current_user = $environment->getCurrentUserItem();
$item->setModificatorItem($current_user);
if ($this->_edit_type == 'buzzwords') {
$new_buzzword = '';
$buzzwords = array();
$buzzword_manager = $this->_environment->getLabelManager();
$buzzword_manager->resetLimits();
$buzzword_manager->setContextLimit($environment->getCurrentContextID());
$buzzword_manager->setTypeLimit('buzzword');
$buzzword_manager->select();
$buzzword_list = $buzzword_manager->get();
$buzzword_ids = $buzzword_manager->getIDArray();
if (isset($form_data['buzzwords'])) {
foreach ($form_data['buzzwords'] as $buzzword) {
if (!in_array($buzzword, $buzzword_ids)) {
$new_buzzword = $buzzword;
} else {
$buzzwords[] = $buzzword;
}
}
}
// buzzwords
$item->setBuzzwordListByID($buzzwords);
}
if ($this->_edit_type == 'tags') {
// buzzwords
$item->setTagListByID($form_data['tags']);
}
$item->save();
// save session
$session = $this->_environment->getSessionItem();
$this->_environment->getSessionManager()->save($session);
// Add modifier to all users who ever edited this item
$manager = $environment->getLinkModifierItemManager();
$manager->markEdited($item->getItemID());
// set return
$this->_popup_controller->setSuccessfullItemIDReturn($item->getItemID(), CS_MATERIAL_TYPE);
} else {
//Acces granted
$this->cleanup_session($current_iid);
$check_passed = $this->_popup_controller->checkFormData('general');
if ($check_passed === true && $form_data['bib_kind'] !== 'none') {
$check_passed = $this->_popup_controller->checkFormData($form_data['bib_kind']);
}
// save item
if ($check_passed === true) {
$session = $this->_environment->getSessionItem();
$item_is_new = false;
// Create new item
if (!isset($item)) {
$manager = $environment->getMaterialManager();
$item = $manager->getNewItem();
$item->setContextID($current_context->getItemID());
$item->setCreatorItem($current_user);
$item->setCreationDate(getCurrentDateTimeInMySQL());
$item_is_new = true;
}
// Create new version button pressed
if ($additional['part'] == 'version') {
$new_version_id = $item->getVersionID() + 1;
$new_version = true;
//.........这里部分代码省略.........
开发者ID:a2call, 项目名称:commsy, 代码行数:101, 代码来源:cs_popup_material_controller.php
示例4: isOption
$values = $_POST;
$form->setFormPost($values);
}
$form->prepareForm();
$form->loadValues();
if ( !empty($command) and
isOption($command, $translator->getMessage('DATES_SELECTION_BUTTON')) ) {
$date_manager = $environment->getDateManager();
foreach($date_array as $dates_data){
$dates_item = $date_manager->getNewItem();
$dates_item->setContextID($environment->getCurrentContextID());
$user = $environment->getCurrentUserItem();
$dates_item->setCreatorItem($user);
$dates_item->setCreationDate(getCurrentDateTimeInMySQL());
if (isset($dates_data[$_POST['title']])){
$dates_item->setTitle($dates_data[$_POST['title']]);
}else{
$dates_item->setTitle($translator->getMessage('COMMON_TITLE'));
}
if (isset($dates_data[$_POST['description']])){
$dates_item->setDescription($dates_data[$_POST['description']]);
}
if (isset($_POST['mode'])){
$dates_item->setDateMode('1');
}else{
$dates_item->setDateMode('0');
}
$dates_item->setPublic('1');
if (isset($dates_data[$_POST['starttime']])){
开发者ID:a2call, 项目名称:commsy, 代码行数:31, 代码来源:date_import.php
示例5: elseif
$email_addresses[$environment->getSelectedLanguage()][] = $moderator_item->getEmail();
} elseif ($language == 'user' and $moderator_item->getLanguage() != 'browser') {
$email_addresses[$moderator_item->getLanguage()][] = $moderator_item->getEmail();
} else {
$email_addresses[$room_item->getLanguage()][] = $moderator_item->getEmail();
}
$recipients .= $moderator_item->getFullname().LF;
}
$moderator_item = $user_list->getNext();
}
foreach ($email_addresses as $language => $email_array) {
if (count($email_array) > 0) {
$old_lang = $translator->getSelectedLanguage();
$translator->setSelectedLanguage($language);
$subject = $translator->getMessage('USER_JOIN_CONTEXT_MAIL_SUBJECT',$user_item->getFullname(),$room_item->getTitle());
$body = $translator->getMessage('MAIL_AUTO',$translator->getDateInLang(getCurrentDateTimeInMySQL()),getTimeInLang(getCurrentDateTimeInMySQL()));
$body .= LF.LF;
if ( $room_item->isCommunityRoom() ) {
$portal = $environment->getCurrentContextItem();
if($portal->getHideAccountname()){
// Hide useraccountname
$user_id = $translator->getMessage('USER_ACCOUNT_NOT_VISIBLE');
$body .= $translator->getMessage('USER_JOIN_COMMUNITY_MAIL_BODY_BY_MODERATOR',$user_item->getFullname(),$user_id,$user_item->getEmail(),$room_item->getTitle(),$current_user->getFullname());
} else {
$body .= $translator->getMessage('USER_JOIN_COMMUNITY_MAIL_BODY_BY_MODERATOR',$user_item->getFullname(),$user_item->getUserID(),$user_item->getEmail(),$room_item->getTitle(),$current_user->getFullname());
}
} else {
$portal = $environment->getCurrentContextItem();
if($portal->getHideAccountname()){
// Hide useraccountname
$user_id = $translator->getMessage('USER_ACCOUNT_NOT_VISIBLE');
开发者ID:a2call, 项目名称:commsy, 代码行数:31, 代码来源:account_assignroom.php
示例6: getCountUserPasswordExpiredByContextID
public function getCountUserPasswordExpiredByContextID($cid)
{
$retour = 0;
$date = getCurrentDateTimeInMySQL();
$query = "SELECT count(DISTINCT " . $this->addDatabasePrefix("user") . ".item_id) as number FROM " . $this->addDatabasePrefix("user") . " WHERE " . $this->addDatabasePrefix("user") . ".expire_date IS NOT NULL AND " . $this->addDatabasePrefix("user") . ".context_id = '" . encode(AS_DB, $cid) . "' AND " . $this->addDatabasePrefix("user") . ".expire_date <= '" . encode(AS_DB, $date) . "'";
$query .= " and deletion_date IS NULL";
$result = $this->_db_connector->performQuery($query);
if (!isset($result)) {
include_once 'functions/error_functions.php';
trigger_error('Problems counting open accounts.', E_USER_WARNING);
} else {
foreach ($result as $rs) {
$retour = $rs['number'];
}
unset($result);
}
return $retour;
}
开发者ID:a2call, 项目名称:commsy, 代码行数:18, 代码来源:cs_user_manager.php
示例7: update
/** save session item -- TBD: needed any more?
* this method saves a session item into the database table "session"
*
* @param object cs_session_item the session item
*/
function update($item)
{
// cookie management
if (!$item->issetValue('cookie') or $item->getValue('cookie') == 2) {
$this->_saveSessionIDInCookie($item->getSessionID(), $item->getToolName());
if ($item->getValue('cookie') == 2) {
$item->setValue('cookie', 1);
}
}
include_once 'functions/date_functions.php';
$current_date_time = getCurrentDateTimeInMySQL();
$session_data = serialize($item->_data);
include_once 'functions/text_functions.php';
$query = "UPDATE session SET session_value='" . encode(AS_DB, $session_data) . "',\n created='" . $current_date_time . "'\n WHERE session_id='" . encode(AS_DB, $item->getSessionID()) . "';";
$this->_last_query = $query;
$result = $this->_db_conntector->performQuery($query);
if (!isset($result) or !$result) {
include_once 'functions/error_functions.php';
trigger_error('Problems saving session values for: ' . $item->getSessionID() . '.', E_USER_WARNING);
}
unset($item);
}
开发者ID:a2call, 项目名称:commsy, 代码行数:27, 代码来源:cs_session_manager.php
示例8: actionEdit
public function actionEdit()
{
$session = $this->_environment->getSessionItem();
$translator = $this->_environment->getTranslationObject();
// get the current user and room
$current_user = $this->_environment->getCurrentUserItem();
$current_context = $this->_environment->getCurrentContextItem();
// get post data
$this->getPostData();
// check access rights
if ($current_context->isProjectRoom() && $current_context->isClosed()) {
/*
* $params = array();
$params['environment'] = $environment;
$params['with_modifying_actions'] = true;
$errorbox = $class_factory->getClass(ERRORBOX_VIEW,$params);
unset($params);
$errorbox->setText($translator->getMessage('PROJECT_ROOM_IS_CLOSED', $context_item->getTitle()));
$page->add($errorbox);
*/
} elseif ($this->_item_id !== "NEW" && !isset($this->_item)) {
/*
* $params = array();
$params['environment'] = $environment;
$params['with_modifying_actions'] = true;
$errorbox = $class_factory->getClass(ERRORBOX_VIEW,$params);
unset($params);
$errorbox->setText($translator->getMessage('ITEM_DOES_NOT_EXIST', $current_iid));
$page->add($errorbox);
*/
} elseif (!($this->_item_id === "NEW" && $current_user->isUser() || $this->_item_id !== "NEW" && isset($this->_item) && $this->_item->mayEdit($current_user))) {
/*
* $params = array();
$params['environment'] = $environment;
$params['with_modifying_actions'] = true;
$errorbox = $class_factory->getClass(ERRORBOX_VIEW,$params);
unset($params);
$errorbox->setText($translator->getMessage('LOGIN_NOT_ALLOWED'));
$page->add($errorbox);
*/
} else {
if ($this->_command !== null && (isOption($this->_command, CS_OPTION_SAVE) || isOption($this->_command, CS_OPTION_CHANGE) || isOption($this->_command, CS_OPTION_NEW))) {
if ($this->checkFormData()) {
if (!isset($step_item)) {
$step_manager = $this->_environment->getStepManager();
$step_item = $step_manager->getNewItem();
$step_item->setContextID($this->_environment->getCurrentContextID());
$user = $this->_environment->getCurrentUserItem();
$step_item->setCreatorItem($user);
$step_item->setCreationDAte(getCurrentDateTimeInMySQL());
$step_item->setTodoID($_POST["todo_id"]);
}
$todo_manager = $this->_environment->getTodoManager();
$todo_item = $todo_manager->getItem($_POST["todo_id"]);
// set modificator and modification date
$user = $this->_environment->getCurrentUserItem();
$step_item->setModificatorItem($user);
$step_item->setModificationDate(getCurrentDateTimeInMySQL());
// set attributes
if (isset($_POST["form_data"]["title"])) {
$step_item->setTitle($_POST["form_data"]["title"]);
}
if (isset($_POST["form_data"]["ckeditor_step"])) {
$step_item->setDescription($_POST["form_data"]["ckeditor_step"]);
}
if (isset($_POST["form_data"]["minutes"])) {
$minutes = $_POST["form_data"]["minutes"];
$minutes = str_replace(",", ".", $minutes);
if (isset($_POST["form_data"]["time_type"])) {
$step_item->setTimeType($_POST["form_data"]["time_type"]);
switch ($_POST["form_data"]["time_type"]) {
case 2:
$minutes = $minutes * 60;
break;
case 3:
$minutes = $minutes * 60 * 8;
break;
}
}
$step_item->setMinutes($minutes);
}
// save
$step_item->save();
$status = $todo_item->getStatus();
if ($status == $translator->getMessage("TODO_NOT_STARTED")) {
$todo_item->setStatus(2);
}
$todo_item->setModificationDate(getCurrentDateTimeInMySQL());
$todo_item->save();
/*
// Set links to connected rubrics
if ( isset($_POST[CS_MATERIAL_TYPE]) ) {
$step_item->setMaterialListByID($_POST[CS_MATERIAL_TYPE]);
} else {
$step_item->setMaterialListByID(array());
}
$item_files_upload_to = $step_item;
include_once('include/inc_fileupload_edit_page_save_item.php');
*/
//.........这里部分代码省略.........
开发者ID:a2call, 项目名称:commsy, 代码行数:101, 代码来源:cs_step_edit_controller.php
示例9: delete
/** delete a task
* this method deletes a new task
*
* @param integer item_id item id of the task
*/
function delete($item_id)
{
$current_datetime = getCurrentDateTimeInMySQL();
$current_user = $this->_environment->getCurrentUserItem();
$user_id = $current_user->getItemID();
unset($current_user);
$query = 'UPDATE ' . $this->addDatabasePrefix('tasks') . ' SET ' . 'deletion_date="' . $current_datetime . '",' . 'deleter_id="' . encode(AS_DB, $user_id) . '",' . 'status="CLOSED"' . ' WHERE item_id="' . encode(AS_DB, $item_id) . '"';
$result = $this->_db_connector->performQuery($query);
if (!isset($result) or !$result) {
include_once 'functions/error_functions.php';
trigger_error('Problems deleting tasks from query: "' . $query . '"', E_USER_WARNING);
} else {
parent::delete($item_id);
}
}
开发者ID:a2call, 项目名称:commsy, 代码行数:20, 代码来源:cs_tasks_manager.php
示例10: deleteByFileID
/** delete link , but it is just an update
* this method deletes all links from an item, but only as an update to restore it later and for evaluation
*
* @param integer file_id id of the file item
*/
function deleteByFileID($file_id)
{
$query = 'UPDATE ' . $this->addDatabasePrefix($this->_db_table) . ' SET ' . 'deletion_date="' . getCurrentDateTimeInMySQL() . '",' . 'deleter_id="' . encode(AS_DB, $this->_current_user->getItemID()) . '"' . ' WHERE file_id="' . encode(AS_DB, $file_id) . '";';
$result = $this->_db_connector->performQuery($query);
if (!isset($result) or !$result) {
include_once 'functions/error_functions.php';
trigger_error('Problems deleting (updating) links of an item from query: "' . $query . '". - ' . __FILE__ . ' - ' . __LINE__, E_USER_WARNING);
}
}
开发者ID:a2call, 项目名称:commsy, 代码行数:14, 代码来源:cs_link_item_file_manager.php
示例11: _update
/** update a room - internal, do not use -> use method save
* this method updates a room
*
* @param object cs_context_item a commsy room
*/
public function _update($item)
{
if ($this->_update_with_changing_modification_information) {
parent::_update($item);
}
$query = 'UPDATE ' . $this->addDatabasePrefix($this->_db_table) . ' SET ';
if ($this->_update_with_changing_modification_information) {
$query .= 'modification_date="' . getCurrentDateTimeInMySQL() . '",';
$modifier_id = $this->_current_user->getItemID();
if (!empty($modifier_id)) {
$query .= 'modifier_id="' . encode(AS_DB, $modifier_id) . '",';
}
}
if ($item->isOpenForGuests()) {
$open_for_guests = 1;
} else {
$open_for_guests = 0;
}
if ($item->isContinuous()) {
$continuous = 1;
} else {
$continuous = -1;
}
if ($item->isTemplate()) {
$template = 1;
} else {
$template = -1;
}
if ($item->getActivityPoints()) {
$activity = $item->getActivityPoints();
} else {
$activity = '0';
}
if ($item->getPublic()) {
$public = '1';
} else {
$public = '0';
}
if ($item->isTemplate()) {
$title = $item->getTitlePure();
} else {
$title = $item->getTitle();
}
$query .= 'title="' . encode(AS_DB, $title) . '",' . "extras='" . encode(AS_DB, serialize($item->getExtraInformation())) . "'," . "status='" . encode(AS_DB, $item->getStatus()) . "'," . "activity='" . encode(AS_DB, $activity) . "'," . "public='" . encode(AS_DB, $public) . "'," . "continuous='" . $continuous . "'," . "template='" . $template . "'," . "is_open_for_guests='" . $open_for_guests . "'" . ' WHERE item_id="' . encode(AS_DB, $item->getItemID()) . '"';
$result = $this->_db_connector->performQuery($query);
if (!isset($result) or !$result) {
include_once 'functions/error_functions.php';
trigger_error('Problems updating ' . $this->_db_table . ' item from query: "' . $query . '"', E_USER_WARNING);
}
}
开发者ID:a2call, 项目名称:commsy, 代码行数:55, 代码来源:cs_privateroom_manager.php
示例12: save
//.........这里部分代码省略.........
case '1':
$im = imagecreatefromgif($srcfile);
break;
case '2':
$im = imagecreatefromjpeg($srcfile);
break;
case '3':
$im = imagecreatefrompng($srcfile);
break;
}
$newimg = imagecreatetruecolor($max_width, $max_width * $ratio);
imagecopyresampled($newimg, $im, 0, 0, $source_x, $source_y, $max_width, ceil($max_width * $ratio), $source_width, $source_height);
imagepng($newimg, $targetfile);
// clean up
imagedestroy($im);
imagedestroy($newimg);
// determ new file name
$filename_info = pathinfo($additional["fileInfo"]["name"]);
$filename = 'cid' . $this->_environment->getCurrentContextID() . '_' . $currentUser->getItemID() . '.' . $filename_info['extension'];
// copy file and set picture
$disc_manager = $this->_environment->getDiscManager();
$disc_manager->copyFile($targetfile, $filename, true);
$currentUser->setPicture($filename);
$modifier = $this->_environment->getCurrentUserItem();
if (isset($portalUser)) {
if ($disc_manager->copyImageFromRoomToRoom($filename, $portalUser->getContextID())) {
$value_array = explode('_', $filename);
$old_room_id = $value_array[0];
$old_room_id = str_replace('cid', '', $old_room_id);
$valu_array[0] = 'cid' . $portalUser->getContextID();
$new_picture_name = implode('_', $value_array);
$portalUser->setPicture($new_picture_name);
$portalUser->setModificatorItem($modifier);
$portalUser->setModificationDate(getCurrentDateTimeInMySQL());
$portalUser->save();
}
}
// save
$currentUser->setModificatorItem($modifier);
$currentUser->setModificationDate(getCurrentDateTimeInMySQL());
$currentUser->save();
}
// set return
$this->_popup_controller->setSuccessfullDataReturn($filename);
}
break;
/**** USER ****/
/**** USER ****/
case 'user':
$currentUser = $this->_environment->getCurrentUserItem();
$portalUser = $currentUser->getRelatedCommSyUserItem();
$text_converter = $this->_environment->getTextConverter();
$currentContext = $this->_environment->getCurrentContextItem();
if ($this->_popup_controller->checkFormData('user')) {
function setValue($currentUser, $portalUser_item, $method, $value)
{
if (isset($value)) {
// set for user
call_user_func_array(array($currentUser, $method), array($value));
if (isset($portalUser_item)) {
// set for portal user
call_user_func_array(array($portalUser_item, $method), array($value));
}
}
}
setValue($currentUser, $portalUser, 'setTitle', $text_converter->sanitizeHTML($form_data['title']));
开发者ID:a2call, 项目名称:commsy, 代码行数:67, 代码来源:cs_popup_profile_controller.php
示例13: include_once
// Uebersetzungstabelle commsy -> mediabird
$current_user_item = $environment->getCurrentUserItem();
$portal_user_item = $current_user_item->getRelatedCommSyUserItem();
// last login
include_once('functions/date_functions.php');
$current_user_item->setLastLoginPlugin(getCurrentDateTimeInMySQL(),$system);
$current_user_item->setChangeModificationOnSave(false);
$current_user_item->save();
if ( !$environment->inPortal()
and !$environment->inServer()
) {
if ( isset($portal_user_item) ) {
$portal_user_item->setLastLoginPlugin(getCurrentDateTimeInMySQL(),$system);
$portal_user_item->setChangeModificationOnSave(false);
$portal_user_item->save();
}
}
$commsy_user_id = $portal_user_item->getItemID();
$fullname = $portal_user_item->getFullname();
$pic_url = $portal_user_item->getPictureUrl(true,false);
unset($portal_user_item);
unset($current_user_item);
$mbuser = $external_id_manager->getExternalId($system,$commsy_user_id);
if ( !empty($mbuser) ) {
开发者ID:a2call, 项目名称:commsy, 代码行数:30, 代码来源:commsy_index.php
示例14: undeleteLinks
function undeleteLinks($item)
{
$query = 'UPDATE ' . $this->addDatabasePrefix('link_items') . ' SET ' . 'modification_date="' . getCurrentDateTimeInMySQL() . '",' . 'deletion_date=NULL,' . 'deleter_id=NULL' . ' WHERE deletion_date>="' . encode(AS_DB, $item->getDeletionDate()) . '"' . ' AND (first_item_id="' . encode(AS_DB, $item->getItemID()) . '"' . ' OR second_item_id="' . encode(AS_DB, $item->getItemID()) . '")';
$result = $this->_db_connector->performQuery($query);
if (!isset($result) or !$result) {
include_once 'functions/error_functions.php';
trigger_error('Problems deleting (updating) links of an item from query: "' . $query . '"', E_USER_WARNING);
}
// reset cache
$this->_resetCache();
}
开发者ID:a2call, 项目名称:commsy, 代码行数:11, 代码来源:cs_link_manager.php
示例15: copyDataFromRoomToRoom
function copyDataFromRoomToRoom($old_id, $new_id, $user_id = '', $id_array = '')
{
$retour = array();
$current_date = getCurrentDateTimeInMySQL();
$current_data_array = array();
$query = '';
$query .= 'SELECT * FROM ' . $this->addDatabasePrefix($this->_db_table) . ' WHERE context_id="' . encode(AS_DB, $old_id) . '" AND deleter_id IS NULL AND deletion_date IS NULL';
$result = $this->_db_connector->performQuery($query);
if (!isset($result)) {
include_once 'functions/error_functions.php';
trigger_error('Problems getting data "' . $this->_db_table . '" from query: "' . $query . '"', E_USER_WARNING);
} else {
$item_id = 'files_id';
$modification_date = 'creation_date';
$sql = 'SELECT ' . $item_id . ',' . $modification_date . ',extras FROM ' . $this->addDatabasePrefix($this->_db_table) . ' WHERE context_id="' . encode(AS_DB, $new_id) . '"';
$sql .= ' AND extras LIKE "%s:4:\\"COPY\\";a:2:{s:7:\\"ITEM_ID\\";%"';
$sql .= ' AND deleter_id IS NULL AND deletion_date IS NULL;';
$sql_result = $this->_db_connector->performQuery($sql);
if (!isset($sql_result)) {
include_once 'functions/error_functions.php';
trigger_error('Problems getting data "' . $this->_db_table . '".', E_USER_WARNING);
} else {
foreach ($sql_result as $sql_row) {
include_once 'functions/text_functions.php';
$extra_array = mb_unserialize($sql_row['extras']);
$current_data_array[$extra_array['COPY']['ITEM_ID']] = $sql_row[$item_id];
#$current_copy_date_array[$extra_array['COPY']['ITEM_ID']] = $extra_array['COPY']['DATETIME'];
#$current_mod_date_array[$extra_array['COPY']['ITEM_ID']] = $sql_row[$modification_date];
}
}
foreach ($result as $query_result) {
$do_it = true;
if (array_key_exists($query_result['files_id'], $current_data_array)) {
$retour[CS_FILE_TYPE . $query_result['files_id']] = $current_data_array[$query_result['files_id']];
$do_it = false;
}
if ($do_it) {
$insert_query = '';
$insert_query .= 'INSERT INTO ' . $this->addDatabasePrefix($this->_db_table) . ' SET';
$first = true;
$old_item_id = '';
foreach ($query_result as $key => $value) {
$value = encode(FROM_DB, $value);
if ($key == 'files_id') {
$old_item_id = $value;
} elseif ($key == 'context_id') {
$after = $key . '="' . $new_id . '"';
} elseif ($key == 'modification_date' or $key == 'creation_date') {
$after = $key . '="' . $current_date . '"';
} elseif (!empty($user_id) and ($key == 'creator_id' or $key == 'modifier_id')) {
$after = $key . '="' . $user_id . '"';
} elseif ($key == 'deletion_date' or $key == 'deleter_id' or $key == 'material_id' or $key == 'material_vid') {
// do nothing
} elseif ($key == 'has_html' and empty($value)) {
// do nothing
} elseif ($key == 'extras' and !empty($old_item_id)) {
include_once 'functions/text_functions.php';
$extra_array = mb_unserialize($value);
$extra_array['COPY']['ITEM_ID'] = $old_item_id;
$extra_array['COPY']['COPYING_DATE'] = $current_date;
$value = serialize($extra_array);
$after = $key . '="' . encode(AS_DB, $value) . '"';
} else {
$after = $key . '="' . encode(AS_DB, $value) . '"';
}
if (!empty($after)) {
if ($first) {
$first = false;
$before = ' ';
} else {
$before = ',';
}
$insert_query .= $before . $after;
unset($after);
}
}
$result_insert = $this->_db_connector->performQuery($insert_query);
if (!isset($result_insert)) {
include_once 'functions/error_functions.php';
trigger_error('Problem creating item from query: "' . $insert_query . '"', E_USER_ERROR);
} else {
$new_item_id = $result_insert;
if (!empty($old_item_id)) {
$retour[CS_FILE_TYPE . $old_item_id] = $new_item_id;
// copy file
$disc_manager = $this->_environment->getDiscManager();
$disc_manager->setPortalID($this->_environment->getCurrentPortalID());
$file_item = $this->getItem($old_item_id);
if (!empty($file_item)) {
$result = $disc_manager->copyFileFromRoomToRoom($old_id, $old_item_id, $file_item->getFileName(), $new_id, $new_item_id);
if (!$result) {
//include_once('functions/error_functions.php');
//trigger_error('can not copy file on disc',E_USER_ERROR);
}
} else {
include_once 'functions/error_functions.php';
trigger_error('can not get old file item', E_USER_ERROR);
}
unset($file_item);
unset($disc_manager);
//.........这里部分代码省略.........
开发者ID:a2call, 项目名称:commsy, 代码行数:101, 代码来源:cs_file_manager.php
示例16: sendMailDeleteInfoToModeration
public function sendMailDeleteInfoToModeration()
{
$translator = $this->_environment->getTranslationObject();
$default_language = 'de';
$toggle_archive = false;
if ($this->_environment->isArchiveMode()) {
$toggle_archive = true;
$this->_environment->toggleArchiveMode();
}
$server_item = $this->_environment->getServerItem();
$default_sender_address = $server_item->getDefaultSenderAddress();
if (empty($default_sender_address)) {
$default_sender_address = '@';
}
$current_portal = $this->getContextItem();
$current_user = $this->_environment->getCurrentUserItem();
$fullname = $current_user->getFullname();
if (empty($fullname)) {
$mod_list = $current_portal->getContactModeratorList();
if (empty($mod_list) or $mod_list->isNotEmpty()) {
$mod_list = $current_portal->getContactModeratorList();
}
if (!empty($mod_list) and $mod_list->isNotEmpty()) {
$current_user = $mod_list->getFirst();
}
unset($mod_list);
}
if ($toggle_archive) {
$this->_environment->toggleArchiveMode();
}
unset($toggle_archive);
$moderator_list = $this->getModeratorList();
// get moderators
$receiver_array = array();
$moderator_name_array = array();
if ($moderator_list->isNotEmpty()) {
$mod_item = $moderator_list->getFirst();
while ($mod_item) {
if ($mod_item->getOpenRoomWantMail() == 'yes') {
$language = $this->getLanguage();
if ($language == 'user') {
$language = $mod_item->getLanguage();
if ($language == 'browser') {
$language = $default_language;
}
}
$receiver_array[$language][] = $mod_item->getEmail();
$moderator_name_array[] = $mod_item->getFullname();
}
$mod_item = $moderator_list->getNext();
}
}
// now email information
foreach ($receiver_array as $key => $value) {
$save_language = $translator->getSelectedLanguage();
$translator->setSelectedLanguage($key);
$subject = '';
$subject .= $translator->getMessage('PROJECT_MAIL_SUBJECT_DELETE_INFO', str_ireplace('&', '&', $this->getTitle()), $current_portal->getDaysSendMailBeforeDeletingRooms());
$body = $translator->getMessage('MAIL_AUTO', $translator->getDateInLang(getCurrentDateTimeInMySQL()), $translator->getTimeInLang(getCurrentDateTimeInMySQL()));
$body .= LF . LF;
if ($this->isCommunityRoom()) {
$body .= $translator->getMessage('COMMUNITY_MAIL_BODY_DELETE_INFO', $this->getTitle(), $current_portal->getDaysSendMailBeforeDeletingRooms(), $current_portal->getDaysUnusedBeforeDeletingRooms() - $current_portal->getDaysSendMailBeforeDeletingRooms());
} else {
$body .= $translator->getMessage('PROJECT_MAIL_BODY_DELETE_INFO', $this->getTitle(), $current_portal->getDaysSendMailBeforeDeletingRooms(), $current_portal->getDaysUnusedBeforeDeletingRooms() - $current_portal->getDaysSendMailBeforeDeletingRooms());
}
$room_change_action = $translator->getMessage('PROJECT_MAIL_BODY_ACTION_DELETE_INFO');
$body .= LF . LF;
$body .= $translator->getMessage('PROJECT_MAIL_BODY_INFORMATION', str_ireplace('&', '&', $this->getTitle()), $current_user->getFullname(), $room_change_action);
$url_to_portal = '';
if (!empty($current_portal)) {
$url_to_portal = $current_portal->getURL();
}
$c_commsy_cron_path = $this->_environment->getConfiguration('c_commsy_cron_path');
if (isset($c_commsy_cron_path)) {
$url = $c_commsy_cron_path . 'commsy.php?cid=';
} elseif (!empty($url_to_portal)) {
$c_commsy_domain = $this->_environment->getConfiguration('c_commsy_domain');
if (stristr($c_commsy_domain, 'https://')) {
$url = 'https://';
} else {
$url = 'http://';
}
$url .= $url_to_portal;
$file = 'commsy.php';
$c_single_entry_point = $this->_environment->getConfiguration('c_single_entry_point');
if (!empty($c_single_entry_point)) {
$file = $c_single_entry_point;
}
$url .= '/' . $file . '?cid=';
} else {
$file = $_SERVER['PHP_SELF'];
$file = str_replace('cron', 'commsy', $file);
$url = 'http://' . $_SERVER['HTTP_HOST'] . $file . '?cid=';
}
$url .= $this->getItemID();
$body .= LF . $url;
if ($this->isProjectRoom()) {
$community_name_array = array();
$community_list = $this->getCommunityList();
if ($community_list->isNotEmpty()) {
//.........这里部分代码省略.........
开发者ID:a2call, 项目名称:commsy, 代码行数:101, 代码来源:cs_room_item.php
Shinmera/tooter: A Common Lisp client library for Mastodon instances.
阅读:615| 2022-08-17
中文大写金额数字前应标明人民币字样,大写金额数字应紧接人民币字样填写,不得留有空
阅读:494| 2022-07-30
级的笔顺是什么?级的笔顺笔画顺序怎么写?还有级的拼音及意思是什么,好多初学练字者
阅读:736| 2022-11-06
amezin/vscode-linux-kernel: Visual Studio Code project/compile_commands.json gen
阅读:355| 2022-08-15
amp;amp;lt;viewclass=amp;quot;containeramp;quot;amp;amp;gt;amp;amp;lt;viewclass=
阅读:692| 2022-07-18
zlotus/notes-LSJU-machine-learning: 机器学习笔记
阅读:393| 2022-08-18
havit/Havit.Blazor: Free Bootstrap 5 components for ASP.NET Blazor + optional en
阅读:830| 2022-08-16
stanhebben/MineTweaker3: Tweak your minecraft experience
阅读:327| 2022-08-16
与增加几乎陷入停滞的智能手机相比,平板电脑的境遇更加惨淡,2017年第一季度,全球平
阅读:198| 2022-11-06
bingyue/easy-springmvc-maven: A simple demo about how to use maven combine sprin
阅读:471| 2022-08-17
请发表评论