Exemple #1
0
function Article2007($Title = '', $Legend = 'button', $Bla = '', $short = '', $sup = '', $sup2 = '', $liens = '')
{
    if ($liens) {
        $liens = explode("\n", trim($liens));
        foreach ($liens as $v) {
            $sup2 .= handle_url_tag($v) . ", ";
        }
    }
    $x = sql5("select sql_cache(keyword)from CSF where url='" . addslashes(u) . "' order by hits desc limit 0,30", 'no=1');
    if ($x) {
        foreach ($x as $t) {
            $kw .= blod($t['keyword']) . " ";
        }
    }
    #if(j9)Die("$Title<li>$Legend<li>$Bla<li>$short<li>$sup<li>$sup2<li>$liens");
    $z = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"><html><head><TITLE>{$Title}</TITLE><META name='description' content='{$Title}'><link type='text/css' rel='stylesheet' href='/?css'><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><script src='/js.js'></script><link rel='canonical' href='" . surl . "'></HEAD><BODY>{$GLOBALS['pp']}";
    if (strlen($Bla) > 10) {
        $z .= "<div id=seo5>{$kw}</div><fieldset class=Mk1><LEGEND>{$Legend}</LEGEND><div class=Mk2><textarea id=Mk3>";
        if ($short) {
            $z .= "</textarea><style>#Mk3{display:none}</style><div>{$Bla}</div>{$sup2}</fieldset></div></body></html>";
        } else {
            $z .= "{$Bla}</textarea>{$sup2}</fieldset></div></body></html>";
        }
    }
    return $z . "<script src='http://www.google-analytics.com/ga.js'></script><script>try{var pageTracker=_gat._getTracker('" . $GLOBALS['ga'] . "');pageTracker._initData();pageTracker._trackPageview();}catch(e){}s7x();</script>";
}
Exemple #2
0
function handle_url_tag($url, $link = '', $bbcode = false)
{
    $url = luna_trim($url);
    // Deal with [url][img]http://example.com/test.png[/img][/url]
    if (preg_match('%<img class="img-responsive" src=\\"(.*?)\\"%', $url, $matches)) {
        return handle_url_tag($matches[1], $url, $bbcode);
    }
    $full_url = str_replace(array(' ', '\'', '`', '"'), array('%20', '', '', ''), $url);
    if (strpos($url, 'www.') === 0) {
        // If it starts with www, we add http://
        $full_url = 'http://' . $full_url;
    } elseif (strpos($url, 'ftp.') === 0) {
        // elseif it starts with ftp, we add ftp://
        $full_url = 'ftp://' . $full_url;
    } elseif (strpos($url, '/') === 0) {
        // Allow for relative URLs that start with a slash
        $full_url = get_base_url(true) . $full_url;
    } elseif (!preg_match('#^([a-z0-9]{3,6})://#', $url)) {
        // elseif it doesn't start with abcdef://, we add http://
        $full_url = 'http://' . $full_url;
    }
    // Ok, not very pretty :-)
    if ($bbcode) {
        if ($full_url == $link) {
            return '[url]' . $link . '[/url]';
        } else {
            return '[url=' . $full_url . ']' . $link . '[/url]';
        }
    } else {
        if ($link == '' || $link == $url) {
            $url = luna_htmlspecialchars_decode($url);
            $link = utf8_strlen($url) > 55 ? utf8_substr($url, 0, 39) . ' … ' . utf8_substr($url, -10) : $url;
            $link = luna_htmlspecialchars($link);
        } else {
            $link = stripslashes($link);
        }
        return '<a href="' . $full_url . '" target="_blank" rel="nofollow">' . $link . '</a>';
    }
}
Exemple #3
0
function handle_quote_tag($poster_name, $post_id)
{
    global $showed_post_list, $lang_common;
    $start_quote = '</p><blockquote><div class="incqbox"><h4>';
    $poster_wrote = str_replace(array('[', '\\"'), array('&#91;', '"'), $poster_name) . ' ' . $lang_common['wrote'] . ':';
    if ($post_id == '') {
        $start_quote .= $poster_wrote;
    } elseif (is_numeric($post_id)) {
        $post_id = intval($post_id);
        $post_link = '';
        $rel = '';
        if (!in_array($post_id, $showed_post_list)) {
            $post_link = '/forums/viewtopic.php?pid=' . $post_id;
            $rel = ' rel="nofollow"';
        }
        $post_link .= '#p' . $post_id;
        $start_quote .= '<a href="' . $post_link . '"' . $rel . '>' . $poster_wrote . '</a>';
    } else {
        $start_quote .= handle_url_tag($post_id, $poster_wrote);
    }
    $start_quote .= '</h4><p>';
    return $start_quote;
}
Exemple #4
0
function callback_handle_url_bb($reg)
{
    return handle_url_tag($reg[1], isset($reg[2]) ? $reg[2] : '', true);
}
Exemple #5
0
function _replace_url(array $matches)
{
    return $matches[1] . handle_url_tag($matches[2] . '.' . $matches[3], $matches[2] . '.' . $matches[3]);
}