function createVCard($array)
{
    $return = 'BEGIN:VCARD' . PHP_EOL;
    $return .= 'VERSION:2.1' . PHP_EOL;
    $return .= getName($array) . PHP_EOL;
    $return .= getFormatedName($array) . PHP_EOL;
    $return .= getPhoto($array);
    $return .= getTelephonePrivate($array);
    $return .= getMobilePrivate($array);
    //$return .= 'TEL;WORK;VOICE:(0221) 9999123' . PHP_EOL;
    //$return .= 'TEL;HOME;VOICE:(0221) 1234567' . PHP_EOL;
    $return .= getAddress($array);
    $return .= getEmail($array);
    $return .= date('Y-m-d H:i:s') . PHP_EOL;
    $return .= 'END:VCARD' . PHP_EOL;
    return $return;
}
Exemple #2
0
function getPhotoHTML($photo_id, $nb = 0, $size = 'small')
{
    $photo = getPhoto($photo_id);
    if (!is_array($photo)) {
        if ($photo == 'removed') {
            $str = '<li><img src="/img/photo_gone.gif" width="75" height="75" alt="Removed" /></li>';
        } else {
            $str = '<li><img src="/img/photo_error.gif" width="75" height="75" alt="Error" title="' . $photo . '" /></li>';
        }
    } else {
        $str = '<li>';
        $str .= '<a href="' . $photo['url'] . '" title="' . $photo['title'] . ', by ' . $photo['owner']['username'] . '"><img src="' . $photo['small'] . '" /></a>';
        if ($nb != 0) {
            $str .= '<p>Faved by <strong>' . $nb . '</strong> neighbours';
            $str .= ' - <a href="/ignore.php?photo_id=' . $photo_id . '" class="ignore">ignore</a>';
            //          $str .= ' - <a href="/favor.php?photo_id='.$photo_id.'" class="favor">favor</a></p>';
        }
        $str .= '</li>';
    }
    return $str;
}
Exemple #3
0
	<link rel="stylesheet" href="includes/css/style.css">
	<script src="includes/js/jquery-1.11.3.min.js"></script>
	<script src="includes/js/script.js"></script>
	<link rel="icon" type="image/png" href="files/favicon.png" />
</head>
<body>

<?php 
require_once 'fonctions.php';
echo '<nav>
		<ul>
		<li><a href="/"><span class="icon-home"></span> Accueil</a></li>';
if (isset($_SESSION['user'])) {
    $th = new TouitosHandler($bd);
    $usr = $th->getByAttr("pseudo", $_SESSION['user'], PDO::PARAM_STR);
    echo '<li><a href="profile.php?user='******'user']) . '">' . getPhoto($usr, "profile_picture_nav") . '</a></li>';
    echo '<li><button id="touiter" type="button"><span class="icon-bubble"></span> Publier un touite</button></li>';
}
if (!isset($_SESSION['user'])) {
    echo '<li><button id="inscription" type="button"><span class="icon-user-plus"></span> S\'inscrire</button>
					<button id="connexion" type="button">Se connecter</button></li>';
} else {
    $nb = getNumberOfNotRead($bd);
    echo '<li><a href="discussion.php"><button type="button"><span class="icon-bubbles2"></span> Message privé';
    echo '<span id="notViewedCounter">';
    if ($nb != 0) {
        echo " ({$nb})";
    }
    echo '</span></button>';
    echo '</a></li>';
    echo '<li id="connectLink">';
Exemple #4
0
<?php

define("CONFIG_PATH", "/var/www/josephj/lab/modev/conf/php/");
// Load model files
require_once CONFIG_PATH . "constant.php";
require_once LIBRARY_PATH . "Function.php";
require_once LIBRARY_PATH . "StaticFile.php";
//  controller
$data = array();
$data["title"] = "Modular Development (Raw) @ webrebuild.org";
$data["site_name"] = "josephj.com";
$static = new StaticFile(CONFIG_PATH . "static.php", "raw");
$static_html["top"] = $static->get_top_files();
$static_html["bottom"] = $static->get_bottom_files();
$feed = getPhoto();
$feed = $feed["items"];
$photos = array();
foreach ($feed as $item) {
    if (preg_match("/(http:\\/\\/.+static.flickr.com\\/\\d+\\/\\d+_[0-9a-z]+)_m\\.jpg/", $item["media"]["m"], $result)) {
        $cache = array();
        $cache["src"] = "{$result[1]}_s.jpg";
        $cache["link"] = $item["link"];
        $cache["title"] = $item["title"];
        $photos[] = $cache;
        unset($cache);
    }
}
// view
require_once VIEW_PATH . "index.php";
Exemple #5
0
    <?php 
ActiveForm::end();
NavBar::end();
?>
</div>
<div class="row">
    <div class="col-sm-12">
        <?php 
$i = 1;
$endTag = 0;
foreach ($freeObj as $model) {
    if ($i == 1) {
        echo Html::beginTag('div', ['class' => 'row row-flex row-flex-wrap']);
        $endTag = 1;
    }
    echo Html::tag('div', Html::tag('div', Html::tag('div', Html::tag('div', Html::tag('h2', Html::a($model->name, Url::to(['/tour/view', 'id' => $model->id, 'datebegin' => $dateBegin]), []), []) . Html::img(getPhoto($model), ['class' => 'main-tour-image']), ['class' => 'col-sm-12']), ['class' => 'row']) . Html::tag('div', Html::tag('div', Html::tag('div', Html::tag('p', 'Продолжительность ' . $model->duration . ' часов', ['class' => 'duration']) . Html::tag('p', 'Цена от ' . getPrice($model) . ' руб.', ['class' => 'duration']) . Html::a('Подробнее', Url::to(['/tour/view', 'id' => $model->id, 'datebegin' => $dateBegin]), ['class' => 'btn btn-success bottom-preview']), ['class' => 'flex-description-tour']), ['class' => 'col-sm-12']), ['class' => 'row']), ['class' => 'item-card']), ['class' => 'col-sm-4']);
    if ($i == 3) {
        echo Html::endTag('div');
        $endTag = 2;
        $i = 0;
    }
    $i++;
}
if ($endTag == 1) {
    echo Html::tag('div', '', ['class' => 'col-sm-6']);
    echo Html::endTag('div');
}
?>
    </div><!-- /.col-sm-12 -->
</div><!-- /.row -->
Exemple #6
0
                    }
                } else {
                    $oublierror = 'Mauvaise adresse email ou bien vous n\'avez pas de compte chez nous';
                }
            } else {
                $oublierror = 'Veuillez rentrer une adresse e-mail !';
            }
        }
    } else {
        header('Location: ./?page=deconnect');
    }
}
if (isset($_SESSION['user']) && $_SESSION['sid'] == session_id()) {
    if (isset($_GET['id']) && ctype_digit($_GET['id'])) {
        $action_photo = $_GET['id'];
        $photo = getPhoto($action_photo);
        if ($photo['utilisateur_id'] == $_SESSION['user']['id']) {
            // action
            if (isset($_GET['action'])) {
                $action = secure($_GET['action']);
                $autorized_actions = array('edit', 'delete', 'treatedit');
                if (in_array($action, $autorized_actions)) {
                    // do nothing for edit and delete
                    // but treat treatedit and treatdelete
                    if ($action == 'treatedit') {
                        if (isset($_POST['letitre']) && isset($_POST['ladesc'])) {
                            $letitre = secure($_POST['letitre']);
                            $ladesc = secure($_POST['ladesc']);
                            unbindPhotoCategory($photo['id']);
                            if (isset($_POST['category']) && is_array($_POST['category'])) {
                                $category = $_POST['category'];
Exemple #7
0
function gettouitosVignette($bd, touitos $touitos)
{
    echo '<div class="touitosDiv"><a href="profile.php?user='******'">';
    echo '<div class="result_photo">' . getPhoto($touitos, "search_result_profile_pic") . '</div>';
    echo '<div class="result_details">';
    echo '<div class="result_name">' . htmlentities($touitos->getNom()) . '</div>';
    echo '<div class="result_pseudo">@' . htmlentities($touitos->getPseudo()) . '</div>';
    echo '<div class="result_statut">' . htmlentities($touitos->getStatut()) . '</div>';
    echo '</div>';
    echo '</a>';
    if (isset($_SESSION['user'])) {
        $th = new touitosHandler($bd);
        $connectedUSer = $th->getByAttr("pseudo", $_SESSION['user'], PDO::PARAM_STR);
        echo '<div class="subscribeDiv">' . getFollowButton($th, $connectedUSer, $touitos) . '</div>';
    }
    echo '</div>';
}
if ($command == '/start ') {
    $hash = safeString(substr($text, 7));
    $search_hash = mysql_result(mysql_query("SELECT COUNT(*) FROM `tokens` WHERE `hash`='" . $hash . "'"), 0);
    if ($search_hash != 1) {
        exit;
    }
    // Записываем информацию о пользователе в БД
    $chat_id = $response['message']['chat']['id'];
    // Telegram ID пользователя
    $first_name = safeString($response['message']['chat']['first_name']);
    // Имя пользователя
    $last_name = safeString($response['message']['chat']['last_name']);
    // Фамилия пользователя
    $username = $response['message']['chat']['username'];
    // @username пользователя
    getPhoto($chat_id);
    // получаем аватарку пользователя
    $search_user = mysql_result(mysql_query("SELECT COUNT(*) FROM `users` WHERE `telegram_id`='" . $chat_id . "'"), 0);
    mysql_query("UPDATE `tokens` SET `telegram_id`='" . $chat_id . "' WHERE `hash`='" . $hash . "'");
    if ($search_user == 0) {
        mysql_query("INSERT INTO `users` (`telegram_id`, `first_name`, `last_name`, `username`) VALUES ('" . $chat_id . "', '" . $first_name . "', '" . $last_name . "', '" . $username . "')");
    } else {
        mysql_query("UPDATE `users` SET `first_name`='" . $first_name . "', `last_name`='" . $last_name . "', `username`='" . $username . "' WHERE `telegram_id`='" . $chat_id . "'");
    }
    $message = 'Вы успешно авторизовались с помощью Telegram на сайте ' . $_SERVER['HTTP_HOST'] . '!
Можете вернуться в браузер и обновить страницу.';
    sendMessage($chat_id, $message);
} else {
    if ($text == '/info') {
        $chat_id = $response['message']['chat']['id'];
        // Telegram ID пользователя
Exemple #9
0
function actionGetPhoto($mysqli)
{
    return getPhoto($mysqli);
}
Exemple #10
0
require_once 'inc/init.inc.php';
require_once 'inc/layout_page_top.inc.php';
require_once 'inc/photo.inc.php';
require_once 'inc/favorites.inc.php';
$nb_favs = defined('BROWSE_MIN_NEIGHBOURS') ? BROWSE_MIN_NEIGHBOURS : 5;
?>

<h2>Quick Review</h2>

<?php 
$myFavs = implode(', ', $db->getCol("SELECT photo_id FROM favorites WHERE user_nsid = '" . FLICKR_USER_NSID . "'"));
$total = $db->getOne("SELECT COUNT(DISTINCT photo_id) FROM favorites WHERE nb >= " . $nb_favs . " AND photo_id NOT IN (" . $myFavs . ")");
$num = rand(0, $total - 1);
$data = $db->getRow("SELECT DISTINCT photo_id, nb FROM favorites WHERE nb >= " . $nb_favs . " AND photo_id NOT IN (" . $myFavs . ") LIMIT " . $num . ",1");
$photo_id = $data['photo_id'];
$nb = $data['nb'];
$photo = getPhoto($photo_id);
if (!is_array($photo)) {
    if ($photo == 'removed') {
        echo '<img src="/img/photo_gone.gif" width="75" height="75" alt="Removed" />';
    } else {
        echo '<img src="/img/photo_error.gif" width="75" height="75" alt="Error" title="' . $photo . '" />';
    }
} else {
    echo '<a href="' . $photo['url'] . '"><img src="' . $photo['medium'] . '" style="float: right;" /></a>';
    echo '<h3><a href="' . $photo['url'] . '">' . (trim($photo['title']) != '' ? htmlspecialchars_decode(trim($photo['title'])) : 'untitled') . '</a></h3>';
    echo '<p>By ' . $photo['owner']['username'] . '</p>';
    echo '<p>Faved by <strong>' . $nb . '</strong> neighbours</p>';
    echo '<p><a href="/ignore.php?photo_id=' . $photo_id . '">ignore</a></p>';
}
require_once 'inc/layout_page_bottom.inc.php';