• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Ad类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中Ad的典型用法代码示例。如果您正苦于以下问题:PHP Ad类的具体用法?PHP Ad怎么用?PHP Ad使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了Ad类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: testCreateAd

 /**
  * @covers Ad::tableName
  * @todo   Implement CreateAd().
  */
 public function testCreateAd()
 {
     $this->object->name = 'test Ad1';
     $this->object->description = 'test Ad1 description';
     $this->object->html = '<p>This is a test Ad</p>';
     $this->assertTrue($this->object->save() === TRUE);
 }
开发者ID:nurielmeni,项目名称:nymedia,代码行数:11,代码来源:AdTest.php


示例2: addAds

 protected function addAds(Ad $ad)
 {
     if (!$this instanceof AdStorage) {
         die("Нельзя использовать этот метод в конструкторе классов.");
     }
     $this->ads[$ad->getId()] = $ad;
 }
开发者ID:nakuzm,项目名称:Ads12,代码行数:7,代码来源:AdStorage.php


示例3: createFakerAd

 protected function createFakerAd()
 {
     $faker = Faker::create();
     $adtype = array("Informal Jam", "Formal Jam/Practice/Rehearsal", "Payed Gig", "Offering Lessons", "Wanting Lessons");
     $level = array("Beginner", "Intermediate", "Semi-Pro", "Professional");
     $original = array("Originals", "Covers", "Both");
     $venuetype = array("House", "Venue", "Recording Studio", "Event");
     $usertype = array("Band", "Musician");
     $genre = array("Acoustic Blues", "Electric Blues", "Bluegrass", "Classical", "Pop Country", "Traditional Country", "House", "Deep House", "Dubstep", "Trap", "Techno", "Downtempo", "Ambient", "Drums & Bass", "Video Game", "Americana", "Acoustic Folk", "Cajun Folk", "Celtic Folk", "Singer/Songwriter Folk", "Combo Jazz", "Dixieland Jazz", "Ensemble Jazz", "Fusion Jazz", "Latin Jazz", "Standards", "Acid Jazz", "Latin", "New Age", "Ambient", "Christian", "Classic Rock", "Dance", "Hard Rock", "Heavy Metal", "Indie Rock", "Latin Rock", "New Wave", "Pop", "Psychedelic", "Punk Rock", "Rock & Roll", "Rockabilly", "Singer/Songwriter", "Ska", "Soft Rock", "Southern Rock", "Top 40", "Hip Hop/Rap", "Classic Soul", "Neo-Soul", "Gospel", "Contemporary R&B", "Reggae", "Soundtrack", "World Music");
     $instrument = array("Full Band, Acoustic Guitar", "Classical Guitar", "Electric Guitar", "Steel Guitar", "Electric Bass", "Double Bass", "Ukelele", "Piano", "Keyboard", "Organ", "Accordion", "Drums", "Lead Rock/Pop Vocals", "Lead Jazz Vocals", "Bass Singer", "Baritone Singer", "Tenor Singer", "Alto Singer", "Mezzo-Soprano Singer", "Soprano Singer", "Cello", "Viola", "Violin", "Fiddle", "Banjo", "Harp", "Mandolin", "Trumpet", "Trombone", "Tuba", "French Horn", "Alto Sax", "Tenor Sax", "Flute", "Oboe", "Clarinet", "Harmonica", "Piccolo", "Bassoon");
     $equipment = array("P/A System", "Guitar Amp", "Bass Amp", "Drum Set", "Keyboard");
     for ($i = 1; $i <= 200; $i++) {
         $ad = new Ad();
         $ad->ad_type = $faker->randomElement($adtype);
         $ad->ad_need = implode(", ", $faker->randomElements($instrument, $count = rand(1, 3)));
         $ad->ad_title = $faker->state . " " . $faker->lastName;
         $ad->level = $faker->randomElement($level);
         $ad->comp = rand(0, 200);
         $ad->genre = implode(", ", $faker->randomElements($genre, $count = rand(1, 3)));
         $ad->date = $faker->dateTimeBetween($startDate = 'now', $endDate = '3 months');
         $ad->start_time = $faker->time($format = 'H:i:s', $min = 'now');
         $ad->description = $faker->realText;
         $ad->equipment = implode(", ", $faker->randomElements($equipment, $count = rand(0, 5)));
         $ad->venue_type = $faker->randomElement($venuetype);
         $ad->venue = "Tycoon Flats";
         $ad->address = "2926 N. St. Marys Street";
         $ad->city = "San Antonio";
         $ad->state = "TX";
         $ad->zip_code = "78212";
         $ad->user_id = User::all()->random(1)->id;
         $ad->ad_img = $faker->imageUrl($width = 640, $height = 480, $category = 'nightlife');
         $ad->save();
     }
 }
开发者ID:jamalots,项目名称:jamalot.dev,代码行数:34,代码来源:AdsTableSeeder.php


示例4: run

 public function run()
 {
     $model = new Ad();
     if (isset($_POST['Ad'])) {
         $model->attributes = $_POST['Ad'];
         //图片
         $model->attach_file = isset($_POST['attach_file']) ? $_POST['attach_file'] : '';
         if ($model->save()) {
             $this->controller->message('success', Yii::t('admin', 'Add Success'), $this->controller->createUrl('index'));
         }
     }
     $this->controller->render('create', array('model' => $model));
 }
开发者ID:jerrylsxu,项目名称:yiifcms,代码行数:13,代码来源:CreateAction.php


示例5: renderGallery

 /**
  * Parser hook handler for {{#articletype}}
  *
  * @param Parser $parser : Parser instance available to render
  *  wikitext into html, or parser methods.
  *
  * @return string: HTML to insert in the page.
  */
 public static function renderGallery($input, array $args, Parser $parser, PPFrame $frame)
 {
     $parser->getOutput()->addModules('ext.promoter.gallery');
     $pageName = $parser->getTitle()->getText();
     try {
         $renderedAds = array();
         $adChooser = new AdChooser($pageName, !$parser->getUser()->isLoggedIn());
         $ads = $adChooser->getAds();
         foreach ($ads as $ad) {
             $renderedAds[] = Ad::fromName($ad['name'])->renderHtml();
         }
     } catch (AdCampaignExistenceException $e) {
         wfDebugLog('Promoter', $e->getMessage());
         //@todo i18n
         return '<span class="error">No campaign for this page</span>';
     } catch (MWException $e) {
         wfDebugLog('Promoter', $e->getMessage());
         return '<span class="error text-danger">An error occurred [' . $e->getMessage() . ']</span>';
     }
     $html = '<div class="promotion-gallery hidden hidden-print">' . '<h5 class="sr-only">זוהי גלריה המקדמת ערכים שונים באתר.</h5>' . '<div class="gallery-controls">' . '<span class="sr-only">בכל רגע מוצגות 3 ידיעות בגלריה. ניתן להציג ידיעה נוספת או לחזור לאחור באמצעות הכפתורים הבאים, או באמצעות מקשי החיצים כאשר הפוקוס הוא על הגלריה</span>' . '<a href="#" class="owl-prev"><span class="fa fa-chevron-right fa-lg" title="הקודם"></span><span class="sr-only">הצגת הידיעה הקודמת</span></a>' . '<a href="#" class="owl-next"><span class="fa fa-chevron-left fa-lg" title="הבא"></span><span class="sr-only">הצגת הידיעה הבאה</span></a>' . '</div>';
     if ($args['title']) {
         $html .= '<div class="header">' . $args['title'] . '</div>';
     }
     $html .= '<div class="owl-carousel clearfix" tabindex="0">' . implode('', $renderedAds) . '</div>' . '</div>';
     return $html;
 }
开发者ID:kolzchut,项目名称:mediawiki-extensions-Promoter,代码行数:34,代码来源:PromoterGallery.php


示例6: campaign

 /**
  * @before _secure
  */
 public function campaign($id)
 {
     $ad = \Ad::first(['_id' => $id, 'org_id' => $this->org->_id]);
     if (!$ad) {
         $this->_404();
     }
     $this->seo(["title" => $ad->title]);
     $view = $this->getActionView();
     if (RM::post("action")) {
         // action value already checked in _postback func
         $this->_postback('add', ['ad' => $ad]);
     }
     if (RM::type() === 'DELETE') {
         $this->_postback('delete');
     }
     $start = RM::get("start", date('Y-m-d', strtotime("-7 day")));
     $end = RM::get("end", date('Y-m-d'));
     $limit = RM::get("limit", 10);
     $page = RM::get("page", 1);
     $query = ['adid' => Db::convertType($id), 'created' => Db::dateQuery($start, $end)];
     $clicks = \Click::all($query, [], 'created', 'desc', $limit, $page);
     $count = \Click::count($query);
     $cf = Utils::getConfig("cf", "cloudflare");
     $view->set("domain", $cf->api->domain)->set("clicks", $clicks)->set("count", $count)->set('advertiser', $this->user);
     $comms = Commission::all(["ad_id = ?" => $id], ['model', 'coverage', 'revenue', 'description']);
     $models = ArrayMethods::arrayKeys($comms, 'model');
     $advertiser = User::first(["id = ?" => $ad->user_id], ['name']);
     $categories = \Category::all(["org_id = ?" => $this->org->_id], ['name', '_id']);
     $this->_postback('show', ['ad' => $ad]);
     $view->set("ad", $ad)->set("comms", $comms)->set("categories", $categories)->set("advertiser", $advertiser)->set('models', $models)->set("start", $start)->set("end", $end);
 }
开发者ID:vNative,项目名称:vnative,代码行数:34,代码来源:advertiser.php


示例7: testInstantArticleAlmostEmpty

 public function testInstantArticleAlmostEmpty()
 {
     $article = InstantArticle::create()->withCanonicalUrl('')->withHeader(Header::create())->addChild(Paragraph::create()->appendText('Some text to be within a paragraph for testing.'))->addChild(Paragraph::create())->addChild(Paragraph::create()->appendText(" \n \t "))->addChild(Image::create())->addChild(Image::create()->withURL(''))->addChild(SlideShow::create()->addImage(Image::create()->withURL('https://jpeg.org/images/jpegls-home.jpg'))->addImage(Image::create()))->addChild(Ad::create())->addChild(Paragraph::create()->appendText('Other text to be within a second paragraph for testing.'))->addChild(Analytics::create())->withFooter(Footer::create());
     $expected = '<!doctype html>' . '<html>' . '<head>' . '<link rel="canonical" href=""/>' . '<meta charset="utf-8"/>' . '<meta property="op:generator" content="facebook-instant-articles-sdk-php"/>' . '<meta property="op:generator:version" content="' . InstantArticle::CURRENT_VERSION . '"/>' . '<meta property="op:markup_version" content="v1.0"/>' . '</head>' . '<body>' . '<article>' . '<p>Some text to be within a paragraph for testing.</p>' . '<figure class="op-slideshow">' . '<figure>' . '<img src="https://jpeg.org/images/jpegls-home.jpg"/>' . '</figure>' . '</figure>' . '<p>Other text to be within a second paragraph for testing.</p>' . '</article>' . '</body>' . '</html>';
     $result = $article->render();
     $this->assertEquals($expected, $result);
 }
开发者ID:facebook,项目名称:facebook-instant-articles-sdk-php,代码行数:7,代码来源:InstantArticleTest.php


示例8: run

 public function run()
 {
     $ids = Yii::app()->request->getParam('id');
     $command = Yii::app()->request->getParam('command');
     empty($ids) && $this->controller->message('error', Yii::t('admin', 'No Select'));
     if (!is_array($ids)) {
         $ids = array($ids);
     }
     $criteria = new CDbCriteria();
     $criteria->addInCondition('id', $ids);
     switch ($command) {
         case 'delete':
             //删除
             Ad::model()->deleteAll($criteria);
             break;
         case 'show':
             //显示
             Ad::model()->updateAll(['status' => Ad::STATUS_SHOW], $criteria);
             break;
         case 'hide':
             //隐藏
             Ad::model()->updateAll(['status' => Ad::STATUS_HIDE], $criteria);
             break;
         default:
             $this->controller->message('error', Yii::t('admin', 'Error Operation'));
     }
     $this->controller->message('success', Yii::t('admin', 'Batch Operate Success'));
 }
开发者ID:jerrylsxu,项目名称:yiifcms,代码行数:28,代码来源:BatchAction.php


示例9: pageController

function pageController()
{
    session_start();
    if (!isset($_SESSION['Loggedinuser'])) {
        $loginstatus = "Members, Log In!";
    } else {
        $loginstatus = $_SESSION['Loggedinuser'] . " is logged in!";
    }
    // Upon arrival at this page, this will load all the ads from the database.
    $adsArray = Ad::all();
    // Upon choosing a category, $clickcategories is set in $_GET. This variable is used to query the database.
    $clickedcategories = Input::has('clickcategory') ? '%' . Input::get('clickcategory') . '%' : '%';
    $adsArray = Ad::findCategories($clickedcategories);
    arsort($adsArray);
    // This portion of code gets all the ads' categories in one array.
    // The categories, which are strings (sometimes with multiple categories in it),
    // are then put into the array by themselves. The array is imploded into a string and then exploded into an
    // array again. This allows us to split the strings with multiple categories in them.
    // The php array_unique removes duplicate category values and sort orders them by first letter.
    $arrayCategories = Ad::showJustCategories();
    $justCategories = [];
    foreach ($arrayCategories as $key => $value) {
        array_push($justCategories, $value['categories']);
    }
    $justCategoriesString = implode(', ', $justCategories);
    $justCategoriesArray = explode(', ', $justCategoriesString);
    $justCategoriesArrayUnique = array_unique($justCategoriesArray);
    sort($justCategoriesArrayUnique);
    // This randomly selects an ad to show in the spotlight spatula box.
    $spotlight = $adsArray[array_rand($adsArray, 1)];
    return array('adsArray' => $adsArray, 'loginstatus' => $loginstatus, 'clickedcategories' => $clickedcategories, 'spotlight' => $spotlight, 'justCategoriesArrayUnique' => $justCategoriesArrayUnique);
}
开发者ID:ztr-adlister,项目名称:adlister,代码行数:32,代码来源:ads.index.php


示例10: pageController

function pageController()
{
    $userArray = Auth::user();
    // returns array of ads by user's id
    $data = ['ads' => Ad::findAds($userArray['user_id'])];
    return $data;
}
开发者ID:Wine-Seller,项目名称:WineSeller,代码行数:7,代码来源:users.show.php


示例11: handleGetQuery

 public static function handleGetQuery(array $sanitized_get_array)
 {
     // The result of the request
     $ajax_result = array('status' => '', 'message' => '', 'data' => '');
     $id = (int) $sanitized_get_array['id'];
     $mode = $sanitized_get_array['mode'];
     if ($mode == 'show') {
         $ad_fields = Ad::find_by_id($id)->getFieldsForTemplate();
         unset($ad_fields['db_fields']);
         $ajax_result['status'] = 'success';
         $ajax_result['data'] = $ad_fields;
     } elseif ($mode == 'delete') {
         $ad_title = Ad::find_by_id($id)->getTitle();
         $sanitized_ad_title = htmlentities($ad_title);
         Ad::delete($id);
         $ajax_result['status'] = 'success';
         if (Ad::count_all()) {
             $ajax_result['message'] = 'Ad "' . $sanitized_ad_title . '" has been deleted successfully';
         } else {
             $ajax_result['message'] = 'There is no more ads in database';
         }
     } else {
         $ajax_result['status'] = 'error';
         $ajax_result['message'] = 'Undefined mode';
     }
     return $ajax_result;
 }
开发者ID:gorvic,项目名称:L17,代码行数:27,代码来源:Ad.php


示例12: run

 public function run()
 {
     //SEO
     $this->controller->_seoTitle = $this->controller->_setting['seo_title'];
     $this->controller->_seoKeywords = $this->controller->_setting['seo_keywords'];
     $this->controller->_seoDescription = $this->controller->_setting['seo_description'];
     //头部banner
     $index_top_banner = Ad::model()->getAdOne(4);
     //中部banner
     $index_mid_banner = Ad::model()->getAdOne(3);
     //底部banner
     $index_bottom_banner = Ad::model()->getAdOne(5);
     //最新资讯
     $news_new = Post::model()->getList(array('limit' => 20));
     //热门资讯
     $news_hot = Post::model()->getList(array('order' => 't.view_count DESC, t.id DESC', 'limit' => 20));
     //最新图集
     $image_new = Image::model()->getList(array('limit' => 10));
     //热门图集
     $image_hot = Image::model()->getList(array('limit' => 10, 'order' => 'view_count DESC, t.id DESC'));
     //最新软件
     $soft_new = Soft::model()->getList(array('limit' => 20));
     //热门软件
     $soft_hot = Soft::model()->getList(array('limit' => 10, 'order' => 'down_count DESC, t.id DESC'));
     //最新视频
     $video_new = Video::model()->findAll("status=:status AND catalog_id = 13 ORDER BY id DESC Limit 20", array(':status' => 'Y'));
     //热门视频
     $video_hot = Video::model()->findAll("status=:status AND catalog_id = 13 ORDER BY view_count DESC, video_score DESC, id DESC Limit 20", array(':status' => 'Y'));
     //友情链接
     $link_logos = Link::model()->findAll("logo !='' AND status='Y'", array('order' => 'sortorder ASC, id DESC'));
     $link_texts = Link::model()->findAll("logo ='' AND status='Y'", array('order' => 'sortorder ASC, id DESC'));
     $this->controller->render('index', array('index_top_banner' => $index_top_banner, 'index_mid_banner' => $index_mid_banner, 'index_bottom_banner' => $index_bottom_banner, 'link_logos' => $link_logos, 'link_texts' => $link_texts, 'news_new' => $news_new, 'news_hot' => $news_hot, 'image_new' => $image_new, 'image_hot' => $image_hot, 'soft_new' => $soft_new, 'soft_hot' => $soft_hot, 'video_new' => $video_new, 'video_hot' => $video_hot));
 }
开发者ID:jerrylsxu,项目名称:yiifcms,代码行数:33,代码来源:IndexAction.php


示例13: testHeaderWithSingleDefaultAd

 public function testHeaderWithSingleDefaultAd()
 {
     $header = Header::create()->addAd(Ad::create()->withSource('http://foo.com')->withWidth(350)->withHeight(50)->enableDefaultForReuse());
     // It should not set op-ad-default
     $expected = '<header>' . '<figure class="op-ad">' . '<iframe src="http://foo.com" width="350" height="50"></iframe>' . '</figure>' . '</header>';
     $rendered = $header->render();
     $this->assertEquals($expected, $rendered);
 }
开发者ID:ActiveWebsite,项目名称:BoojPressPlugins,代码行数:8,代码来源:HeaderTest.php


示例14: getAds

 function getAds()
 {
     $conn =& $this->getConnection();
     $result = mysql_query('SELECT * FROM ' . $this->config['table']['prefix'] . 'zones', $conn);
     $returner = array();
     $this->plugin->import('Ad');
     while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
         $ad = new Ad($this);
         $ad->setName($row['zonename']);
         $ad->setAdId($row['zoneid']);
         $returner[] =& $ad;
         unset($ad);
     }
     mysql_free_result($result);
     mysql_close($conn);
     return $returner;
 }
开发者ID:ramonsodoma,项目名称:ojs,代码行数:17,代码来源:OpenAdsConnection.inc.php


示例15: inUse

 public function inUse()
 {
     $count = Ad::count(['org_id' => $this->org_id, 'category' => ['$elemMatch' => ['$eq' => Utils::mongoObjectId($this->_id)]]]);
     if ($count === 0) {
         return false;
     } else {
         return true;
     }
 }
开发者ID:vNative,项目名称:vnative,代码行数:9,代码来源:category.php


示例16: vDeleteDuplicateUrlAds

 public static function vDeleteDuplicateUrlAds()
 {
     $aAllUrlRows = DirectDB::aSelect('ads_htmls', array(), 'url', 'GROUP BY url');
     $aAllUrls = Utilitu::aExtractFieldFromArray($aAllUrlRows, 'url');
     foreach ($aAllUrls as $sUrl) {
         $aUrlAdIDs = Ad::aGetAdIDsByUrl($sUrl);
         $iPopped = array_pop($aUrlAdIDs);
         DirectDB::bDelete('ads', array('id' => $aUrlAdIDs));
     }
 }
开发者ID:ramanamaharshi,项目名称:wosu,代码行数:10,代码来源:Ad.php


示例17: run

 public function run()
 {
     $model = new Ad();
     //条件
     $criteria = new CDbCriteria();
     $title = trim(Yii::app()->request->getParam('title'));
     $position_id = intval(Yii::app()->request->getParam('position_id'));
     $title && $criteria->addColumnCondition(array('title' => $title));
     $position_id && $criteria->addColumnCondition(array('position_id', $position_id));
     $criteria->order = 't.id ASC';
     $count = $model->count($criteria);
     //分页
     $pages = new CPagination($count);
     $pages->pageSize = 10;
     $pages->applyLimit($criteria);
     //查询
     $result = $model->findAll($criteria);
     $this->controller->render('index', array('model' => $model, 'datalist' => $result, 'pagebar' => $pages));
 }
开发者ID:jerrylsxu,项目名称:yiifcms,代码行数:19,代码来源:IndexAction.php


示例18: saveAdToRt

 public static function saveAdToRt($adID)
 {
     $ad = Ad::model()->findByPk($adID);
     $connection = new CDbConnection(Yii::app()->params['sphinx']['dsn'], Yii::app()->params['sphinx']['user'], Yii::app()->params['sphinx']['pass']);
     $connection->active = true;
     $sphinxIndexes = Yii::app()->params['sphinx']['indexes'];
     $rt = $sphinxIndexes['rt'][0];
     $sql = "INSERT INTO {$rt} (id, title, description, added)\n                VALUES (:id, :title, :description, :added)";
     $command = $connection->createCommand($sql);
     $command->execute(array(':id' => $ad->id, ':title' => $ad->title, ':description' => $ad->description, ':added' => time()));
 }
开发者ID:nsdvw,项目名称:classifieds,代码行数:11,代码来源:SphinxService.php


示例19: loadModel

 /**
  * 判断数据是否存在
  * 
  * return \$this->model
  */
 public function loadModel()
 {
     if ($this->model === null) {
         if (isset($_GET['id'])) {
             $this->model = Ad::model()->findbyPk($_GET['id']);
         }
         if ($this->model === null) {
             throw new CHttpException(404, Yii::t('common', 'The requested page does not exist.'));
         }
     }
     return $this->model;
 }
开发者ID:jerrylsxu,项目名称:yiifcms,代码行数:17,代码来源:AdController.php


示例20: campaign

 /**
  * @before _secure
  * @after setDate
  */
 public function campaign($id = null)
 {
     $this->seo(["title" => "Campaign Insights"]);
     $view = $this->getActionView();
     $org = $this->org;
     $ad = Ad::first(['_id' => $id, 'org_id' => $org->_id]);
     if (!$ad) {
         $this->_404();
     }
     $data = Shared\Services\Campaign::performance($id, ['start' => $this->start, 'end' => $this->end, 'pid' => $this->user_id, 'meta' => true]);
     $view->set('stats', $data['stats'])->set('total', $data['total']);
 }
开发者ID:vNative,项目名称:vnative,代码行数:16,代码来源:insight.php



注:本文中的Ad类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP AdWordsSoapClient类代码示例发布时间:2022-05-23
下一篇:
PHP ActivityModel类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap