Ejemplo n.º 1
0
        break;
    case 'xl':
        $width = 190;
        $height = 150;
        $avatar = 40;
        $text_length = 210;
        break;
    case 'medium':
    default:
        $width = 140;
        $height = 120;
        $avatar = 40;
        $text_length = 150;
}
if (!empty($_GET['border'])) {
    $border = get_hex_color($_GET['border'], '#');
} else {
    $border = '#bbb';
}
$id = $db->get_var($sql);
if (!$id > 0) {
    die;
}
$post = new Post();
$post->id = $id;
$post->read();
if (!$post->read) {
    die;
}
echo 'document.write(\'';
echo '<a href="http://' . get_server_name() . post_get_base_url($post->username) . '" style="text-decoration: none; border: none">';
Ejemplo n.º 2
0
// AFFERO GENERAL PUBLIC LICENSE is also included in the file called "COPYING".
include '../config.php';
header('Content-Type: text/html; charset=UTF-8');
header('Pragma: no-cache');
header('Cache-Control: max-age=10, must-revalidate');
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">';
$width = intval($_GET['width']);
if ($globals['mobile']) {
    $width = min(400, $width);
}
$height = intval($_GET['height']);
$format = clean_input_string($_GET['format']);
$color_border = get_hex_color($_GET['color_border']);
$color_bg = get_hex_color($_GET['color_bg']);
$color_link = get_hex_color($_GET['color_link']);
$color_text = get_hex_color($_GET['color_text']);
$font_pt = is_numeric($_GET['font_pt']) ? floatval($_GET['font_pt']) : 10;
echo '<html><head><title>banner</title></head><body>';
$res = $db->get_row("select link_id, link_title, count(*) as votes from links, votes where vote_type='links' and vote_date > date_sub(now(), interval 10 minute) and vote_value > 0 and link_id = vote_link_id group by link_id order by votes desc limit 1");
if ($res) {
    $votes_hour = $res->votes * 6;
    $title['most'] = text_to_summary($res->link_title, 70) . ' <span style="font-size: 90%;">[' . $votes_hour . "&nbsp;" . _('votos/hora') . "]</span>";
    $url['most'] = "http://" . get_server_name() . "/story.php?id={$res->link_id}";
}
$res = $db->get_row("select link_id, link_title, link_votes, link_anonymous from links where link_status = 'published' order by link_date desc limit 1");
if ($res) {
    $title['published'] = text_to_summary($res->link_title, 70) . ' <span style="font-size: 90%;">[' . ($res->link_votes + $res->link_anonymous) . "&nbsp;" . _('votos') . "]</span>";
    $url['published'] = "http://" . get_server_name() . "/story.php?id={$res->link_id}";
}
$res = $db->get_row("select link_id, link_title, link_votes, link_anonymous from links where link_status = 'queued' order by link_date desc limit 1");
if ($res) {