Пример #1
0
// a directory slash ("/"). The script below assumes it.
$imagedir = CUSTOMER_IMAGE_DIR . $GID . '/';
// What are the websites (hostnames) that can use this
// image?
// If your site can be accessed with or without the
// "www" prefix, make sure you put both here. Do not put
// any trailing slashes ("/") nor any "http://" prefixes.
// Follow the example below.
$url_meta = parse_url(load::m('setting_m')->get('SITE_URL'));
$url_meta_no_www = str_replace("www.", "", $url_meta['host']);
$validprefixes = array($url_meta['host'], $url_meta_no_www);
// What is the main page of your website? Visitors will
// be directed here if they type
//   "http://www.example.com/chimage.php"
// in their browser.
$homepage = load::m('setting_m')->get('APP_FANPAGE');
function isreferrerokay($referrer, $validprefixes)
{
    $validreferrer = 0;
    $authreferrer = current($validprefixes);
    while ($authreferrer) {
        if (eregi("^https?://{$authreferrer}/", $referrer)) {
            $validreferrer = 1;
            break;
        }
        $authreferrer = next($validprefixes);
    }
    return $validreferrer;
}
//----------------------- main program -----------------------
$image = $src;
Пример #2
0
<?php

echo "<pre>";
/*
$url_meta = parse_url("http://www.youtube.com/watch?v=B37wW9CGWyY");
$url_meta['host'] = str_replace("www.","",$url_meta['host']);
print_r($url_meta);
parse_str($url_meta['query'],$o);
print_r($o);
*/
/*
$ok = load::l('facebook')->api("/1048572455137/picture");
print_r($ok);
*/
echo load::m('media_m')->showMedia(2, false);