本文整理汇总了PHP中comment::set_value方法的典型用法代码示例。如果您正苦于以下问题:PHP comment::set_value方法的具体用法?PHP comment::set_value怎么用?PHP comment::set_value使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类comment
的用法示例。
在下文中一共展示了comment::set_value方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: reply_comment
function reply_comment()
{
global $smarty, $lang;
$com_id = post('com_id');
$com_reply = post('com_reply');
$obj = new comment();
$obj->set_value('com_reply', $com_reply);
$obj->set_where("com_id = {$com_id}");
$obj->edit();
$smarty->assign('info_text', '回复评论成功');
$smarty->assign('link_text', $lang['return_list']);
$smarty->assign('link_href', url(array('channel' => 'service', 'mod' => 'comment_sheet')));
}
示例2: add_comment
function add_comment()
{
safe('comment');
global $global, $smarty, $lang;
$channel = post('channel');
$com_page_id = post('page_id');
$com_username = post('username');
$com_email = post('email');
$com_rank = post('rank');
$com_text = post('text');
if ($channel == '' || $com_page_id == '' || $com_username == '' || $com_email == '' || $com_rank == '' || $com_text == '') {
$info_text = $lang['submit_error_info'];
} else {
$com_channel_id = get_id('channel', 'cha_code', $channel);
$com_add_time = time();
$obj = new comment();
$obj->set_value('com_channel_id', $com_channel_id);
$obj->set_value('com_page_id', $com_page_id);
$obj->set_value('com_username', $com_username);
$obj->set_value('com_email', $com_email);
$obj->set_value('com_rank', $com_rank);
$obj->set_value('com_text', $com_text);
$obj->set_value('com_add_time', $com_add_time);
$obj->set_value('com_show', 0);
$obj->set_value('com_lang', S_LANG);
$obj->add();
if (intval(get_varia('sentmail'))) {
$email_title = '您的网站有了新的评论';
$str = get_data($channel, $com_page_id, substr($channel, 0, 3) . '_title');
$email_text = '评论:《' . $str . '》<br />' . $com_text;
call_send_email($email_title, $email_text, $com_username, $com_email);
}
$info_text = $lang['submit_comment'];
}
$smarty->assign('info_text', $info_text);
$smarty->assign('link_text', $lang['go_back']);
$smarty->assign('link_href', url(array('channel' => $channel, 'id' => $com_page_id)));
}
示例3: foreach
function update_mime_parts($commentID, $files)
{
$x = 2;
// mime part 1 will be the message text
foreach ((array) $files as $file) {
$bits = array();
$bits["part"] = $file["part"] or $bits["part"] = $x++;
$bits["name"] = $file["name"];
$bits["size"] = $file["size"];
$mimebits[] = $bits;
}
if ($commentID && $mimebits) {
$comment = new comment($commentID);
$comment->set_value("commentMimeParts", serialize($mimebits));
$comment->skip_modified_fields = true;
$comment->updateSearchIndexLater = true;
$comment->save();
}
}
示例4: import_planner_tasks
function import_planner_tasks($parentNode, $parentTaskId, $depth, $task_allocation, $resource_people, $project_manager_ID)
{
//Recursively imports tasks from GNOME Planner, given the parentNode.
global $projectID;
$current_user =& singleton("current_user");
$result = array();
// our dodgy DOM_NodeList doesn't support foreach....
for ($i = 0; $i < $parentNode->childNodes->length; $i++) {
$taskXML = $parentNode->childNodes->item($i);
if ($taskXML->nodeType == XML_ELEMENT_NODE && $taskXML->tagName == "task") {
$task = new task();
$task->set_value('taskName', trim($taskXML->getAttribute("name")));
$task->set_value('projectID', $projectID);
// We can find the task assignee's id in the $task_allocation array, and that person's Person record in the $resource_people array
$planner_taskid = $taskXML->getAttribute("id");
// Dates we guess at (i.e., set to now)
$task->set_value('dateCreated', date("Y-m-d H:i:s"));
$task->set_value('dateAssigned', date("Y-m-d H:i:s"));
if ($taskXML->hasAttribute("work-start")) {
$task->set_value('dateTargetStart', import_planner_date($taskXML->getAttribute("work-start")));
} else {
$task->set_value('dateTargetStart', import_planner_date($taskXML->getAttribute("start")));
$result[] = "Resorting to work value for " . $task->get_value('taskName');
}
$task->set_value('dateTargetCompletion', import_planner_date($taskXML->getAttribute("end")));
if ($taskXML->hasAttribute("note")) {
$task->set_value('taskDescription', $taskXML->getAttribute("note"));
}
$task->set_value('creatorID', $current_user->get_id());
$task->set_value('managerID', $project_manager_ID);
if ($taskXML->hasAttribute("type") and $taskXML->getAttribute("type") == "milestone") {
$task->set_value('taskTypeID', 'Milestone');
} else {
$task->set_value('taskTypeID', 'Task');
}
$task->set_value('taskStatus', 'open_notstarted');
$task->set_value('priority', '3');
$task->set_value('parentTaskID', $parentTaskId == 0 ? "" : $parentTaskId);
// The following fields we leave at their default values: duplicateTaskID, dateActualCompletion, dateActualStart, closerID, timeExpected, dateClosed, parentTaskID, taskModifiedUser
// Handle task assignment
if (isset($task_allocation[$planner_taskid])) {
if (is_array($task_allocation[$planner_taskid])) {
// This task was assigned to more than one person. Assign it to the project manager and make a comment about it.
$task->set_value('personID', $project_manager_ID);
// Save the task so we have a task ID
$task->save();
// Make a comment about this task
$comment = new comment();
$comment->set_value("commentType", "task");
$comment->set_value("commentLinkID", $task->get_id());
$comment->set_value("commentCreatedTime", date("Y-m-d H:i:s"));
// The user doing the import is (implicitly) the user creating the comment
$comment->set_value("commentCreatedUser", $current_user->get_id());
// Get the relevant usernames
$names = array();
foreach ($task_allocation[$planner_taskid] as $assignee) {
$names[] = person::get_fullname($assignee);
}
$comment->set_value("comment", "Import notice: This task was originally assigned to " . implode($names, ', ') . ".");
$comment->save();
$result[] = sprintf("<li>Note: multiple people were assigned to the task %d %s</li>", $task->get_id(), $task->get_value("taskName"));
} else {
$task->set_value('personID', $resource_people[$task_allocation[$taskXML->getAttribute("id")]]->get_id());
}
} else {
// Task not assigned to anyone, assign the task to the nominated manager
$task->set_value('personID', $project_manager_ID);
}
$task->save();
$result[] = sprintf('<li>%sCreated task <a href="%s">%d %s</a>.</li>', str_repeat(">", $depth), $task->get_url(), $task->get_id(), $task->get_value('taskName'));
// Do child nodes
if ($taskXML->hasChildNodes()) {
$result = array_merge($result, import_planner_tasks($taskXML, $task->get_id(), $depth + 1, $task_allocation, $resource_people, $project_manager_ID));
}
}
}
return $result;
}
示例5: comment
$client->set_value("clientName", $data[0]);
$client->set_value("clientPhoneOne", $data[1]);
$client->set_value("clientFaxOne", $data[2]);
$client->set_value("clientStreetAddressOne", $data[3]);
$client->set_value("clientSuburbOne", $data[4]);
$client->set_value("clientStateOne", $data[5]);
$client->set_value("clientPostcodeOne", $data[6]);
$client->set_value("clientStreetAddressTwo", $data[7]);
$client->set_value("clientSuburbTwo", $data[8]);
$client->set_value("clientStatus", "current");
$client->set_value("clientModifiedUser", $current_user->get_id());
$client->save();
if ($client->get_id()) {
if (rtrim($data[9])) {
$comment = new comment();
$comment->set_value("commentMaster", "client");
$comment->set_value("commentMasterID", $client->get_id());
$comment->set_value("commentType", "client");
$comment->set_value("commentLinkID", $client->get_id());
$comment->set_value("comment", $data[9]);
$comment->save();
$comment_id = $comment->get_id();
}
if ($data[10] || $data[11]) {
$cc = new clientContact();
$cc->set_value("clientID", $client->get_id());
$cc->set_value("primaryContact", 1);
$cc->set_value("clientContactName", $data[10]);
$cc->set_value("clientContactEmail", $data[11]);
$cc->save();
$cc_id = $cc->get_id();
示例6: opendir
ini_set('memory_limit', "256M");
$db = new db_alloc();
// Loop through attachments directory
$dir = ATTACHMENTS_DIR . "comment" . DIRECTORY_SEPARATOR;
if (is_dir($dir)) {
$handle = opendir($dir);
while (false !== ($file = readdir($handle))) {
clearstatcache();
if ($file == "." || $file == ".." || !is_numeric($file) || dir_is_empty($dir . $file) || !is_numeric($file)) {
continue;
}
// Figure out which email created the comment
$comment = new comment();
$comment->set_id($file);
$comment->select();
echo "<br><br><hr>Examining comment " . $file;
// Figure out what the mime parts are for the attachments and update comment.commentMimeParts
list($email, $text, $mimebits) = $comment->find_email(true);
if (!$email) {
echo "<br>Couldn't find email for commentID: " . $file . "<br>";
rename($dir . $file, $dir . "fail_" . $file);
}
if ($mimebits) {
echo "<br>Setting commentMimeParts for comment: " . $comment->get_id();
$comment->set_value("commentMimeParts", serialize($mimebits));
$comment->skip_modified_fields = true;
$comment->save();
rename($dir . $file, $dir . "done_" . $file);
}
}
}