示例#1
0
 $prio = (int) _post('prio');
 if ($prio < -1) {
     $prio = -1;
 } elseif ($prio > 2) {
     $prio = 2;
 }
 $duedate = parse_duedate(trim(_post('duedate')));
 $t = array();
 $t['total'] = 0;
 if ($title == '') {
     echo json_encode($t);
     exit;
 }
 $tags = trim(_post('tags'));
 $db->ex("BEGIN");
 $tag_ids = prepare_tags($tags, $listId);
 $cur_ids = get_task_tags($id);
 if ($cur_ids) {
     $ids = implode(',', $cur_ids);
     $db->ex("DELETE FROM tag2task WHERE task_id={$id}");
     $db->dq("UPDATE tags SET tags_count=tags_count-1 WHERE id IN ({$ids})");
 }
 if ($tag_ids) {
     update_task_tags($id, $tag_ids);
 }
 if (is_null($duedate)) {
     $duedate = 'NULL';
 } else {
     $duedate = $db->quote($duedate);
 }
 $db->dq("UPDATE todolist SET title=?,note=?,prio=?,tags=?,duedate={$duedate} WHERE id={$id}", array($title, $note, $prio, $tags));
示例#2
0
function update_11_12($db, $dbtype)
{
    if ($dbtype == 'mysql') {
        $db->ex("ALTER TABLE todolist ADD `duedate` DATE default NULL");
    } else {
        $db->ex("ALTER TABLE todolist ADD duedate DATE default NULL");
    }
    # Fixing broken tags
    $db->ex("BEGIN");
    $db->ex("DELETE FROM tags");
    $db->ex("DELETE FROM tag2task");
    $q = $db->dq("SELECT id,tags FROM todolist");
    while ($r = $q->fetch_assoc()) {
        if ($r['tags'] == '') {
            continue;
        }
        $tag_ids = prepare_tags($r['tags']);
        if ($tag_ids) {
            update_task_tags($r['id'], $tag_ids);
        }
    }
    $db->ex("COMMIT");
}
示例#3
0
$licontent = '';
while ($row = mysql_fetch_array($result)) {
    //dimensions
    $width = $row['width'];
    $height = $row['height'];
    $_size_warning = "";
    if ($width < 800 or $height < 800) {
        $_size_warning = "<div style='font-size:1em;'><a style='color:red;' href='" . SITEURL . "?page_id=771'>Внимание! Размеры файла<br />ограничивают применение!</a></div>";
    }
    $_size = $width . "px X " . $height . "px;";
    $_x_sm = round($width / 300 * 2.54, 1);
    $_y_sm = round($height / 300 * 2.54, 1);
    $_sizesm = $_x_sm . " см X " . $_y_sm . " см";
    $sizeout = "<div id='dimensions'><b>Размер:</b><br />" . $_size . "<span style='color:#ACACAC;font-size:0.875em;'><br />при печати 300dpi:<br />" . $_sizesm . $_size_warning . "</div>";
    ///dimensions
    $licontent .= '<li id="' . $row['id'] . '" style="background-image:url(\'http://cartoonbank.ru/wp-content/plugins/wp-shopping-cart/product_images/' . $row['image'] . '\');background-repeat:no-repeat;" title="' . $row['name'] . '"><span class="slideinfo"><b>Номер: </b><span id="cuid_' . $row['id'] . '">' . $row['id'] . '</span><br /><b>Автор:</b><br /><a href="?brand=' . $row['brandid'] . '">' . $row['brand'] . '</a><br /><b>Название:</b><br />' . stripslashes($row['name']) . '<br /><b>Категория:</b><br />' . stripslashes($row['kategoria']) . '<br /><b>Описание:</b><br />' . stripslashes($row['description']) . '<br /><b>Тэги:</b><br />' . prepare_tags($row['additional_description']) . $sizeout . '<div id="star_rating_' . $row['id'] . '"><img src="http://cartoonbank.ru/img/ldng.gif"></div></span></li>';
    //pokazh($row);
}
?>











<!-- main start -->