D
D
Deprimovec2014-07-25 12:17:19
PHP
Deprimovec, 2014-07-25 12:17:19

Where can I find information and lessons on development for Tizen?

I would like to ask people who are in the subject - who will advise what useful information and lessons on developing under Tizen OS? It would be really great if these were lessons and info on creating toys for this axis.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
seriogja, 2016-04-29
@AllDecay

Hello.
It is not entirely clear why you have done so much. You can organize everything like this: everything is broken down by function. No unnecessary gestures :)
Pseudocode:

public function addPost(...параметры...) {
    // добавляем запись о репосте в бд
}

public function post(...параметры...) {
    //постим запись
}

public function run(...параметры...) {
    // в условии сразу смотрите на дату последнего репоста
    $result = $dbh->prepare("SELECT COUNT(*) FROM `reposts` WHERE `id` = :id AND SELECT DATEDIFF (`date`, CURDATE()) > 7");
    $result->execute([
        ':id' => $id
    ]);
    $result = $result->fetchAll();

    //если записей нет - постим
    if (!count($result)) {
        $response = $this->post(...параметры...);
        if ($response->success !== 1) {
            $link = "https://vk.com/wall" . $gid . "_" . $response->post_id;
            $this->addPost(...параметры...);
            echo '<div class="alert alert-success" role="alert">Репост сделан! Проверить его наличие Вы можете по этой ссылке: <a href="' . $link . '" target="_blank">' . $link . '</a></div>';
        } else {
            echo '<div class="alert alert-danger" role="alert">Ошибка! Сервер ВКонтакте вернул ответ с кодом ошибки: ' . $response->error->error_code . '</div>';
        }
    } else {
        echo '<div class="alert alert-danger" role="alert">Сожалеем, но мы уже делали с Вами репост на этой неделе.</div>';
    }

J
JUJULA, 2015-12-24
@Deprime

Intuit.ru

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question