Exemplo n.º 1
0
    public static function printSocialButtons()
    {
        if (SessionWrapper::userIsLoggedIn()) {
            echo '<li><a href="' . AppConfig::getBaseUrl() . '/agregar-noticia/" title="Agregar noticia"><span class="add_news"></span></a></li>';
        }
        ?>
    <li><a class="fb-share" href="https://www.linkedin.com/shareArticle?url=<?php 
        echo urlencode(AppConfig::getBaseUrl());
        ?>
&title=<?php 
        echo urlencode('Tierra Baldia | Comunicación y Periodismo Ambiental');
        ?>
"><span class="link94"></span></a></li>
    <li><a class="fb-share" href="https://www.stumbleupon.com/submit?url=<?php 
        echo urlencode(AppConfig::getBaseUrl());
        ?>
&title=<?php 
        echo urlencode('Tierra Baldia | Comunicación y Periodismo Ambiental');
        ?>
"><span class="socialnetwork160"></span></a></li>
    <li><a href="#"><span class="youtube28"></span></a></li>
    <li><a class="fb-share" href="https://www.pinterest.com/pin/create/button/?url=<?php 
        echo urlencode(AppConfig::getBaseUrl());
        ?>
&media=<?php 
        echo urlencode(AppConfig::getBaseUrl() . '/images/logo_face_card.png');
        ?>
&description=<?php 
        echo urlencode('Tierra Baldia | Comunicación y Periodismo Ambiental');
        ?>
"><span class="socialnetwork159"></span></a></li>
    <li><a href="#"><span class="web42"></span></a></li>
    <li><a class="fb-share" href="https://plus.google.com/share?url=<?php 
        echo urlencode(AppConfig::getBaseUrl());
        ?>
"><span class="google116"></span></a></li>
    <li><a class="fb-share" href="https://twitter.com/intent/tweet?url=<?php 
        echo urlencode(AppConfig::getBaseUrl());
        ?>
&hashtags=tierrabaldia"><span class="twitter1"></span></a></li>
    <li><a class="fb-share" href="https://www.facebook.com/share.php?u=<?php 
        echo urlencode(AppConfig::getBaseUrl());
        ?>
"><span class="socialmedia10"></span></a></li>
    <?php 
    }
Exemplo n.º 2
0
<?php

require_once __DIR__ . '/../classes/SessionWrapper.php';
require_once __DIR__ . '/../classes/Tools.php';
$return = new stdClass();
$return->status = 'error';
// validate the user
if (!SessionWrapper::userIsLoggedIn()) {
    $return->message = 'Por favor inicie sesión.';
    echo json_encode($return);
    return;
}
// retrieve the attachment ID
$attId = !empty($_GET['id']) ? intval($_GET['id']) : null;
if (!$attId) {
    $return->message = 'No se encontró el archivo.';
    echo json_encode($return);
    return;
}
// delete attachment
if (!Tools::deleteNewsAttachment($attId)) {
    $return->message = 'El archivo no pudo eliminarse. Por favor intente de nuevo.';
    echo json_encode($return);
    return;
}
$return->status = 'success';
echo json_encode($return);
Exemplo n.º 3
0
<?php

require_once __DIR__ . '/classes/Tools.php';
Tools::startSession();
$success = false;
$loginEmail = '';
if (!empty($_POST)) {
    $success = LoginModel::login($_POST['login_email'], $_POST['login_pass']);
    $loginEmail = trim(htmlspecialchars($_POST['login_email']));
} else {
    $success = SessionWrapper::userIsLoggedIn();
}
if ($success) {
    header("Location: " . Tools::getBaseUrl() . '/');
    exit;
}
$headerMeta = array('title' => 'Iniciar sesión');
$headerResources = '
  <link href="' . Tools::getBaseUrl() . '/css/style-login.css" rel="stylesheet" />';
require_once 'header.php';
?>

    <div class="tittle_categoria"><h1>Iniciar sesión</h1></div>

    <main><form id="login_form" method="post">
      <div class="text-left">
        Email
        <input type="email" name="login_email" id="login_email" value="<?php 
echo $loginEmail;
?>
" />