コード例 #1
0
ファイル: banners.php プロジェクト: cwcw/cms
/**
/* Function to redirect the clicks to the correct url and add 1 click
*/
function clickbanner($bid)
{
    global $database, $mainframe;
    require_once $mainframe->getPath('class');
    $row = new mosBanner($database);
    $row->load($bid);
    $row->clicks();
    $pat = "http.*://";
    if (!eregi($pat, $row->clickurl)) {
        $clickurl = "http://{$row->clickurl}";
    } else {
        $clickurl = $row->clickurl;
    }
    mosRedirect($clickurl);
}
コード例 #2
0
ファイル: admin.banners.php プロジェクト: jwest00724/mambo
function editBanner($bannerid, $option)
{
    global $database, $my;
    $lists = array();
    $row = new mosBanner($database);
    $row->load($bannerid);
    if ($bannerid) {
        $row->checkout($my->id);
    }
    // Build Client select list
    $sql = "SELECT cid as value, name as text FROM #__bannerclient";
    $database->setQuery($sql);
    if (!$database->query()) {
        echo $database->stderr();
        return;
    }
    $clientlist[] = mosHTML::makeOption('0', 'Select Client');
    $clientlist = array_merge($clientlist, $database->loadObjectList());
    $lists['cid'] = mosHTML::selectList($clientlist, 'cid', 'class="inputbox" size="1"', 'value', 'text', $row->cid);
    // Imagelist
    $javascript = 'onchange="changeDisplayImage();"';
    $directory = '/images/banners';
    $lists['imageurl'] = mosAdminMenus::Images('imageurl', $row->imageurl, $javascript, $directory);
    // make the select list for the image positions
    $yesno[] = mosHTML::makeOption('0', T_('No'));
    $yesno[] = mosHTML::makeOption('1', T_('Yes'));
    $lists['showBanner'] = mosHTML::selectList($yesno, 'showBanner', 'class="inputbox" size="1"', 'value', 'text', $row->showBanner);
    HTML_banners::bannerForm($row, $lists, $option);
}