Inheritance: extends Taco\Term
Beispiel #1
0
 /**
  *  Builds Ad group and its contents.
  *
  * @param array $data Initial data
  */
 public function buildVehiclesAdGroup($data = array())
 {
     $this->m_aItemData['l_geo_city'] = "в " . rus_city_pad($data['l_geo_city']);
     $this->gag_l_id = $data['l_id'];
     $this->gag_name = date("Y-m-d") . " " . $data['l_make'] . ' ' . $data['l_model'] . " в " . rus_city_pad($data['l_geo_city']);
     $this->save();
     $this->gag_name .= " " . $this->gag_id . ":" . $this->gag_l_id;
     require_once '../classes/KeywordForger.php';
     include '../config/keyword_forger.php';
     require_once '../classes/Keyword.php';
     $kw = array();
     foreach ($ad_group_by_item['vehicles'] as $key => $val) {
         $kw[] = $data[$key];
     }
     $result = $this->save();
     $keywords = KeywordForger::forgeKeywords($kw);
     $kw = new Keyword($this->db);
     foreach ($keywords as $val) {
         $kw->keyword = $val;
         $kw->save();
         $this->db->executeNoresSQL("INSERT IGNORE INTO m2m_keywords_to_google_ad_groups (gag_id, keyword_id) VALUES ({$this->gag_id}, {$kw->keyword_id})", $rowsAffected);
         $kw->reset();
     }
     return $result;
 }
Beispiel #2
0
 /**
  * @param string $mode
  *
  * @return string
  */
 public function showLinkToSelf($mode = '')
 {
     $url = '?p=keyword&id=';
     $mode_url = '&m=' . $mode;
     if (empty($mode)) {
         return $this->html($url . $this->keyword->getId());
     } else {
         return $this->html($url . $this->keyword->getId() . $mode_url);
     }
 }
Beispiel #3
0
 public function kw()
 {
     $keyword_rank = new Keyword_rank();
     $keyword_rank_ids = $keyword_rank->where('date', date('Y-m-d'))->get()->all_to_single_array('keyword_id');
     if (empty($keyword_rank_ids)) {
         $keyword_rank_ids = array(0);
     }
     $keywords = new Keyword();
     $keywords->where('is_deleted', 0)->where_not_in('id', $keyword_rank_ids)->get();
     foreach ($keywords as $keyword) {
         var_dump($keyword->id);
     }
 }
Beispiel #4
0
 public function executeAddKeyword()
 {
     $val = $this->getRequestParameter('keyword');
     $c = new Criteria();
     $c->add(KeywordPeer::LABEL, $val . "%", Criteria::LIKE);
     $keyword = KeywordPeer::doSelectOne($c);
     if (!$keyword) {
         $keyword = new Keyword();
         $keyword->setLabel($val);
         $keyword->save();
         exit($keyword->getId() . "," . $keyword->getLabel());
     }
     exit;
 }
Beispiel #5
0
 public function findOrCreateOne($keyword_value)
 {
     # Attempt to find keyword
     $keyword = KeywordQuery::create()->filterByValue($keyword_value)->findOne();
     # Handle keyword
     if (!$keyword) {
         # Create keyword
         $keyword = new Keyword();
         $keyword->setValue($keyword_value);
         # Create keyword synonym
         $keyword_synonym = new KeywordSynonym();
         $keyword_synonym->setKeyword($keyword)->setValue($keyword_value)->save();
     }
     # Return keyword
     return $keyword;
 }
 /**
  * called by an ajax form
  * input is $_POST['id'] 
  */
 public function actionAjaxDelete()
 {
     if (isset($_POST['id']) && isset($_POST['passcode']) && $_POST['passcode'] == 'u98u8acja8scja89sjcjGBHJ') {
         Keyword::model()->deleteByPk($_POST['id']);
     }
     Yii::app()->end();
 }
 public function run()
 {
     DB::table('keywords')->delete();
     Keyword::create(array('adGroup' => 'Online Dish', 'Keyword' => 'dish tv online', 'currency' => 'INR', 'avMonthlySearches' => 10, 'competition' => 0.89, 'suggestedBid' => 12.86, 'impressionShare' => 0.0, 'inAccount' => 'N', 'inPlan' => 'N', 'extractedFrom' => ''));
     Keyword::create(array('adGroup' => 'Online Dish', 'keyword' => 'dish tv online recharge', 'currency' => 'INR', 'avMonthlySearches' => 320, 'competition' => 0.23, 'suggestedBid' => 6.8, 'impressionShare' => 0.0, 'inAccount' => 'N', 'inPlan' => 'N', 'extractedFrom' => ''));
     Keyword::create(array('adGroup' => 'Online Dish', 'Keyword' => 'dish tv recharge online', 'currency' => 'INR', 'avMonthlySearches' => 70, 'competition' => 0.51, 'SuggestedBid' => 10.23, 'impressionShare' => 0.0, 'inAccount' => 'N', 'inPlan' => 'N', 'extractedFrom' => ''));
 }
    public function get_keywords($id_in_module)
    {
        $keywords = array();
        $result = $this->db_querier->select('SELECT relation.id_in_module, relation.id_keyword, keyword.*
			FROM ' . DB_TABLE_KEYWORDS_RELATIONS . ' relation
			LEFT JOIN ' . DB_TABLE_KEYWORDS . ' keyword ON keyword.id = relation.id_keyword
			WHERE relation.module_id = :module_id AND relation.id_in_module = :id_in_module
			ORDER BY relation.id_keyword', array('module_id' => $this->module_id, 'id_in_module' => $id_in_module));
        while ($row = $result->fetch()) {
            $keyword = new Keyword();
            $keyword->set_properties($row);
            $keywords[$row['name']] = $keyword;
        }
        $result->dispose();
        return $keywords;
    }
 /**
  * Remove single keyword with all collected rank
  * 
  * @param $keyword_array (array) - keyword model arrayed
  * @throws Exception
  */
 public function remove_deleted($keyword_array)
 {
     try {
         $keyword_id = isset($keyword_array['id']) ? $keyword_array['id'] : NULL;
         $keyword = new Keyword($keyword_id);
         if (!$keyword->exists()) {
             throw new Exception('kwid: ' . $keyword_id . ' doesn\'t exist.');
         }
         $keyword_rank = Keyword_rank::inst()->get_by_keyword_id($keyword_id);
         $keyword_rank->delete_all();
         $keyword->delete();
         log_message('TASK_SUCCESS', __FUNCTION__ . ' > ' . 'Keyword and keyword rank for kwid: ' . $keyword_id . ' deleted');
     } catch (Exception $e) {
         log_message('TASK_ERROR', __FUNCTION__ . ' > ' . $e->getMessage());
         throw $e;
     }
 }
 protected function AddkeywordAction()
 {
     $xpl = explode(',', $this->post_data['keyword']);
     foreach ($xpl as $keyword) {
         Keyword::addKeyword($this->user->user['id'], trim($keyword));
     }
     header('Location:/');
     exit;
 }
Beispiel #11
0
 public function add_keywords($keywords)
 {
     if (!is_array($keywords)) {
         $keywords = array($keywords);
     }
     foreach ($keywords as $keyword) {
         if ($keyword == "") {
             return false;
         }
         $exists = Keywords::get_by_text($keyword);
         if ($exists) {
             $exists->add_to_track($this);
         } else {
             $object = new Keyword();
             $object->set_text($keyword);
             $object->add_to_track($this);
         }
     }
 }
Beispiel #12
0
function find_keyword($keyword_name)
{
    # Attempt to find keyword
    $keyword = KeywordQuery::create()->useKeywordSynonymQuery()->filterByValue($keyword_name)->endUse()->findOne();
    # Handle keyword
    if ($keyword) {
        # Return keyword
        return $keyword;
    } else {
        # Create keyword
        $keyword = new Keyword();
        $keyword->setValue($keyword_name)->save();
        # Create synonym
        $synonym = new Synonym();
        $synonym->setKeyword($keyword)->setValue($keyword_name)->save();
        # Return keyword
        return $keyword;
    }
}
 public function post($resourceVals, $data, $userId)
 {
     global $logger, $warnings_payload;
     $projectId = $resourceVals['project-keywords'];
     if (isset($projectId)) {
         $warnings_payload[] = 'POST call to /project-keywords must not have ' . '/projectID appended i.e. POST /project-keywords';
         throw new UnsupportedResourceMethodException();
     }
     $nowFormat = date('Y-m-d H:i:s');
     $projectKeywordsObj = new Keyword($data['u_p_c_id'], $data['type'], $data['words'], $data['relevence'], $nowFormat);
     $logger->debug("POSTed project keywords Detail: " . $projectKeywordsObj->toString());
     $this->collapDAO->insert($projectKeywordsObj);
     $projectKeywordsDetail = $projectKeywordsObj->toArray();
     if (!isset($projectKeywordsDetail['id'])) {
         return array('code' => '2011');
     }
     $this->keywordsDetail[] = $projectKeywordsDetail;
     return array('code' => '2001', 'data' => array('keywordsDetail' => $this->keywordsDetail));
 }
Beispiel #14
0
 public function index()
 {
     if ($this->c_user->isTrialPlanEnds()) {
         $this->addFlash(lang('subscription_ends_error', [site_url('subscript/plans')]), 'error');
     }
     // UNCOMMENT TO USE
     // get average google rank for all keywords for chart in range
     $keyword_rank = Keyword::average_for_range($this->c_user->id, '-30 days', 'today');
     // average result for all the range
     $keywords_trending = Keyword::average_for_range($this->c_user->id, '-30 days', 'today', FALSE);
     // average for each day in range
     // analytics data
     $google_access_token = Access_token::getByTypeAndUserId('googlea', $this->c_user->id);
     list($ga_visits_chart, $ga_visits_count) = $google_access_token->google_analytics_dashboard_visits();
     $review = new Review();
     $last_reviews_count = $review->last_period_count($this->c_user->id, $this->profile->id);
     $review->clear();
     $social_values = Social_value::inst();
     $social_values->set_values($this->c_user->id, $this->profile->id, array('from' => date('Y-m-d', strtotime('-30 days')), 'to' => date('Y-m-d', time())));
     $all_socials_data = $social_values->get_data();
     $monthly_trending = array('reviews' => $review->last_month_trending($this->c_user->id, $this->profile->id), 'traffic' => $ga_visits_chart, 'keywords' => $keywords_trending, 'twitter_followers' => $all_socials_data['twitter'], 'facebook_likes' => $all_socials_data['facebook']);
     $keywordsForHighlight = Mention_keyword::inst()->get_for_highlight($this->c_user->id, 0);
     CssJs::getInst()->add_js('www.google.com/jsapi', 'external', 'footer');
     CssJs::getInst()->add_js(array('libs/lodash.compat.js', 'libs/highcharts/highcharts.js'))->c_js();
     $opportunities = $this->getOpportunities();
     if (!empty($opportunities['web_radar'])) {
         CssJs::getInst()->add_js('controller/webradar/index.js');
     }
     JsSettings::instance()->add(array('monthly_trending' => $monthly_trending, 'dashboard' => true, 'keywords' => $keywordsForHighlight, 'opportunities' => $opportunities));
     $summary = array('reviews' => (int) $last_reviews_count, 'fb_likes' => (int) $all_socials_data['likes_count'], 'twiter_followers' => (int) $all_socials_data['followers_count'], 'web_traffic' => (int) $ga_visits_count, 'google_rank' => (int) round($keyword_rank, 3));
     $this->isSupportScheduledPosts = $this->getAAC()->isGrantedPlan('scheduled_posts');
     $this->load->helper('my_url_helper');
     $this->template->set('isSupportScheduledPosts', $this->isSupportScheduledPosts);
     $this->template->set('socials', Social_post::getActiveSocials($this->profile->id));
     $this->is_user_set_timezone = User_timezone::is_user_set_timezone($this->c_user->id);
     JsSettings::instance()->add(array('twitterLimits' => array('maxLength' => 140, 'midLength' => 117, 'lowLength' => 94), 'twitterLimitsText' => lang('twitter_error'), 'linkedinLimits' => array('maxLength' => 400), 'linkedinLimitsText' => lang('linkedin_error')));
     CssJs::getInst()->add_css(array('custom/pick-a-color-1.css'));
     CssJs::getInst()->add_js(array('libs/jq.file-uploader/jquery.iframe-transport.js', 'libs/jq.file-uploader/jquery.fileupload.js', 'libs/fabric/fabric.min.js', 'libs/fabric/StackBlur.js', 'libs/color/tinycolor-0.9.15.min.js', 'libs/color/pick-a-color-1.2.3.min.js'));
     CssJs::getInst()->c_js('social/create', 'post_update');
     CssJs::getInst()->c_js('social/create', 'post_cron');
     CssJs::getInst()->c_js('social/create', 'post_attachment');
     CssJs::getInst()->c_js('social/create', 'social_limiter');
     CssJs::getInst()->c_js('social/create', 'schedule_block');
     CssJs::getInst()->c_js('social/create', 'bulk_upload');
     $this->template->set('is_user_set_timezone', User_timezone::is_user_set_timezone($this->c_user->id));
     $user_posts = Social_post::inst()->get_user_scheduled_posts($this->c_user->id, $this->profile->id, 1, 3, 'all');
     $this->template->set('posts', $user_posts);
     $this->load->helper('Image_designer_helper');
     $this->template->set('imageDesignerImages', Image_designer::getImages());
     $this->template->set('summary', $summary);
     $this->template->set('opportunities', $opportunities);
     $this->template->set('need_welcome_notification', User_notification::needShowNotification($this->c_user->id, User_notification::WELCOME));
     $this->template->render();
 }
 protected function ShowAction($id_keyword)
 {
     $keyword = Keyword::getKeyword($id_keyword, $this->user->user['id']);
     if (isset($keyword['keyword'])) {
         $this->data->url = $this->user->user['url'];
         $this->data->keyword = $keyword;
         $this->data->indice = Keyword::getIndice($keyword);
         $this->data->positions = Keyword::getPosition($keyword, $this->user->user['id'], $this->user->user['url']);
         $this->data->concurrents = Keyword::getConcurrents($keyword);
     } else {
         header('Location:/');
     }
 }
 public function saveSegmentMap($dataaccount)
 {
     /* $deleteIds = Word::where('dataaccount', $dataaccount)->get( array('id') );
     			$notDeleteIds = []; $tmp = [];
     		*/
     //return Response::json( count(Input::get('idsToBeDeleted')) );
     if (count(Input::get('idsToBeDeleted')) > 0) {
         Keyword::destroy(Input::get('idsToBeDeleted'));
         // refresh wordcloud only if some keyword is deleted
         Word::where('dataaccount', $dataaccount)->delete();
         Word::createWordCloud($dataaccount);
     }
     foreach (Input::get('segmentMap') as $k => $word) {
         Word::where('dataaccount', $dataaccount)->where('word', $word['word'])->update(array('segment' => $word['segment'], 'brand' => $word['brand'], 'compete' => $word['compete'], 'negativeword' => $word['negativeword'], 'stopword' => $word['stopword']));
         //	'numword'=>$word['numword'],
         //	'dataaccount'=>$word['dataaccount']) );
         //$notDeleteIds[] = $word['id'];
         //Word::find( $word['id'] )->update($word);
     }
     /*
     foreach($deleteIds as $k=>$v)
     {
     	if(in_array($v['id'], $notDeleteIds)) $tmp[] = $v['id'];
     }
     return $tmp; 
     */
     return Response::json(array('success' => true));
     /*
     //return Response::json( count(Input::get('toBeDeleted')) );
     	if( count(Input::get('toBeDeleted')) > 0 ) Keyword::destroy(Input::get('toBeDeleted'));
     	
     	$tempId = [];
     	$tempSeg = [];
     	
     	//return Response::json( count(Input::get('segmentMap')) );
     	
     	if( count(Input::has('segmentMap')) > 0)
     	{ 
     		foreach(Input::get('segmentMap') as $key => $val)
     		{
     			$tempId[] = $val['id'];
     			$tempSeg[] = $val['segment'];
     			Keyword::find($val['id'])->update( array('usersegment' => $val['segment']) );
     		}
     	}
     	//Keyword::find($tempId)->update( array('usersegment' => $tempSeg) )->save();
     	return Response::json( Keyword::find($tempId) );
     	//return Response::json( array('success' => true) );
     	//return Response::json( Input::get('segmentMap') );
     */
 }
 /**
  * Check keywords set for deletion
  * And move them to queue
  * 
  * minutely ?
  */
 public function queue_deleted_keywords()
 {
     $keywords = Keyword::inst()->get_by_is_deleted(1);
     if (!$keywords->exists()) {
         log_message('CRON_ERROR', __FUNCTION__ . ' > ' . 'No keywords for removal');
         return;
     }
     foreach ($keywords as $keyword) {
         $args = $keyword->to_array();
         $this->jobQueue->addJob('tasks/google_rank_task/remove_deleted', $args, array('thread' => self::GOOGLE_RANK_THREAD));
     }
     $ids_str = implode(', ', array_values($keywords->all_to_single_array('id')));
     log_message('CRON_SUCCESS', __FUNCTION__ . ' > ' . 'Keywords for removal ids: ' . $ids_str);
     return;
 }
 public function actionIndex($isForced = false, $isDebug = false)
 {
     $console = Console::getInstance($isForced, $isDebug);
     $console->writeLine('Initializing');
     $criteria = new CDbCriteria();
     $criteria->alias = 'keyword';
     $criteria->addCondition('keyword.period > 0');
     $criteria->addNotInCondition('keyword.status', array(Keyword::STATUS_PENDING, Keyword::STATUS_TAKEN, Keyword::STATUS_IN_PROGRESS));
     $keyword = Keyword::model()->findAll($criteria);
     $console->progressStart('Updating keywords', count($keyword));
     foreach ($keyword as $k) {
         $console->progressStep();
         if (time() > strtotime($k->checked_at) + $k->period) {
             $k->setStatus(Keyword::STATUS_PENDING);
         }
     }
     $console->progressEnd();
 }
Beispiel #19
0
 /**
  * Form with keywords list
  */
 public function index()
 {
     $this->load->config('site_config', TRUE);
     $keywords_config = $this->config->item('keywords', 'site_config');
     $keywords_count = isset($keywords_config['count']) && $keywords_config['count'] ? $keywords_config['count'] : 10;
     // get user additional info (address)
     $user_additional = User_additional::inst()->get_by_user_and_profile($this->c_user->id, $this->profile->id);
     // get available keywords
     $keywords = Keyword::inst()->get_user_keywords($this->c_user->id, $this->profile->id);
     if ($this->input->post()) {
         // validate posted address name
         $new_address_name = $this->input->post('address');
         $adress_error_string = User_additional::validate_address($this->input->post());
         // validate posted keywords
         $new_keywords_names = array_slice($this->input->post('keywords'), 0, $keywords_count);
         $keywords_errors = Keyword::validate_keywords($new_keywords_names);
         // chek for errors
         if (empty($adress_error_string) && empty($keywords_errors)) {
             $user_additional = $user_additional->update_address($this->input->post(), $this->c_user->id, $this->profile->id);
             $keywords = $keywords->update_keywords($new_keywords_names, $this->c_user->id, $this->profile->id);
             $this->addFlash(lang('keywords_saved_success'), 'success');
         } else {
             $address_name = $new_address_name;
             $keywords_names = array_slice(array_values($this->input->post('keywords')), 0, $keywords_count);
             $errors = array('keywords' => $keywords_errors, 'address' => $adress_error_string);
             $this->addFlash($errors);
         }
         redirect('settings/keywords');
     }
     // escape keywords names and website name
     $address_name = isset($address_name) ? HTML::chars($address_name) : HTML::chars($user_additional->address);
     $keywords_names = isset($keywords_names) ? HTML::chars_arr($keywords_names) : HTML::chars_arr(array_values($keywords->all_to_single_array('keyword')));
     JsSettings::instance()->add(array('autocomplete_url' => site_url('settings/keywords/google_autocomplete')));
     CssJs::getInst()->c_js();
     $this->template->set('address_id', $user_additional->address_id);
     $this->template->set('address_name', $address_name);
     $this->template->set('keywords_names', $keywords_names);
     $this->template->set('keywords_count', $keywords_count);
     $this->template->render();
 }
Beispiel #20
0
 public static function createWordCloud2($dataaccountid)
 {
     $tagArray = [];
     $temp = [];
     $temp = Keyword::where('dataAccount', $dataaccountid)->get(array('keyword'));
     foreach ($temp as $key => $keywrd) {
         $temp = explode(" ", $keywrd->keyword);
         if (sizeof($temp) > 1) {
             if (isset($tagArray[$temp[0] . " " . $temp[1]])) {
                 $tagArray[$temp[0] . " " . $temp[1]]++;
             } else {
                 $tagArray[$temp[0] . " " . $temp[1]] = 1;
             }
         }
     }
     arsort($tagArray, SORT_NUMERIC);
     //Sort alphabetically
     $insertData = [];
     foreach ($tagArray as $word => $count) {
         $insertData[] = array('word' => $word, 'freq' => $count, 'numword' => 2, 'dataaccount' => $dataaccountid);
     }
     DB::table('wordcloud')->insert($insertData);
     return Response::json($tagArray);
 }
Beispiel #21
0
 /**
  * @return string|array Array on DB validation errors, else string messages
  */
 private function _saveSerp($keyword, $link)
 {
     $keyword = RequestMethods::post("keyword");
     $link = RequestMethods::post("link");
     $regex = Shared\Markup::websiteRegex();
     if (!preg_match("/^{$regex}\$/", $link)) {
         return "Invalid URL";
     }
     $serp = Keyword::first(array("link = ?" => $link, "user_id = ?" => $this->user->id, "keyword = ?" => $keyword, "serp = ?" => true));
     if ($serp) {
         return "SERP Already Registered";
     }
     $serp = new Keyword(array("link" => $link, "user_id" => $this->user->id, "keyword" => $keyword, "serp" => true));
     if ($serp->validate()) {
         $serp->save();
         return "Serp Action saved succesfully!!";
     } else {
         $errors = $keyword->errors;
         return $errors;
     }
 }
Beispiel #22
0
 public function destroy()
 {
     // poista kommentit
     Comment::delete_all_from_recipe($this->id);
     //poista ainesosat
     Ingredient::delete_from_recipe($this->id);
     Ingredient::delete_unused();
     //poista avainsanat
     Keyword::delete_junctions($this->id);
     Keyword::delete_unused();
     $query = DB::connection()->prepare("DELETE FROM Recipe WHERE id = :id");
     $query->execute(array('id' => $this->id));
 }
foreach ($ad_types as $class) {
    require_once '../classes/' . $class . '.php';
}
require_once '../classes/GoogleCampaign.php';
require_once '../classes/Keyword.php';
$db = new DBAdapter2(array('host' => KWDB_HOST, 'username' => KWDB_USERNAME, 'password' => KWDB_PASSWORD, 'schema' => KWDB_SCHEMA));
$campaign = new GoogleCampaign($db);
$campaign->ga_campaign_name = CAMPAIGN_NAME_BASE . " " . date("Y-m-d H i");
$campaign->save();
$db->executeSQL("SELECT keyword_id, keyword, occurs, word_count, source_keyword_id , c.l_image, c.l_make, c.l_color, c.l_model\n\t\t\t\t\tFROM m2m_keywords_to_niches a \n\t\t\t\t\tleft join keywords b using(keyword_id)\n\t\t\t\t\tLEFT JOIN {$table} c USING(keyword_id)\nWHERE c.l_image!= '' and niche_id = " . NICHE . " and occurs > " . GROUP_SIZE . " and word_count > 2 order by word_count desc, occurs desc", $resultArry, $rowsAffected);
$total = $rowsAffected;
$left = $total;
echo $total . " keywords\r\n";
$start_time = date('U');
$kws = array();
$keyword = new Keyword($db);
$fp = fopen("../output/" . str_replace(" ", "_", $campaign->ga_campaign_name) . ".csv", "w+");
fputs($fp, "Campaign,Daily Budget,Language,Location,Proximity Targets,Ad Schedule,Ad Group,Max CPC,Keyword Type,Keyword,Image,Ad Name,Image Size,Display URL,Destination URL\r\n");
foreach ($resultArry as $val) {
    $adgroup = new GoogleImageAdGroup($db);
    $adgroup->giag_campaign_id = $campaign->ga_campaign_id;
    $adgroup->giag_display_url = DISPLAY_URL;
    $adgroup->buildDestinationUrl($val);
    $adgroup->save();
    $adgroup->giag_name = "Ad " . $adgroup->giag_id . " " . $val['keyword'];
    $adgroup->save();
    $ad = $adgroup->buildAds("http://images.kabel.co.il/photo/?url=" . $val['l_image'] . "&section=realestate");
    fputs($fp, "{$campaign->ga_campaign_name},20,iw,IL,,,{$adgroup}," . MAX_CPC . "\r\n");
    foreach ($adgroup->ads as $add) {
        fputs($fp, "{$campaign->ga_campaign_name},,,,,,{$adgroup},,,," . $add->gia_image . "," . $add->gia_name . "," . $add->gia_size . "," . $adgroup->giag_display_url . ",\"" . $adgroup->giag_destination_url . "\"\r\n");
    }
Beispiel #24
0
    Keyword::add($sessionId);
    header('location:keywords.php?update=true');
} else {
    if (getAction() == "remove") {
        Keyword::remove($sessionId);
        header('location:keywords.php');
    } else {
        if (getAction() == "enlist") {
            $keywords = Keyword::getKeywords($sessionId);
            foreach ($keywords as $keyword) {
                //print "<tr><td>".$keyword["str"]."<td width='80px'><form method='post' action='keywords.php?action=remove' ><input type='hidden' name='_id' value='".$keyword["_id"]."'><button>Remove</button></form>";
                print $keyword["str"] . "\n";
            }
            exit;
        } else {
            $keywords = Keyword::getKeywords($sessionId);
        }
    }
}
require_once "header.php";
?>

<style>

#tableDiv{text-align:center;width:100%;margin-left:auto;margin-right:auto;}
#tableDiv table{text-align:center;width:100%;}
#keyword{width:100%;text-align:center;}

</style>

<script>
Beispiel #25
0
 public function buildLeads()
 {
     $leads = array();
     $keywords = Keyword::model()->findAll('deleted_at IS NULL AND status = \'' . Keyword::STATUS_CHECKED . '\'');
     foreach ($keywords as $k) {
         $domain = '';
         $executorCriteria = new CDbCriteria();
         $executorCriteria->addCondition('keyword_id = :keyword_id');
         $executorCriteria->addCondition('status = :status');
         $executorCriteria->params = array(':keyword_id' => $k->id, ':status' => Executor::STATUS_DONE);
         $executorCriteria->order = 'id DESC';
         $executor = Executor::model()->find($executorCriteria);
         if ($executor) {
             $site = Site::model()->findAll('executor_id = :executor_id', array(':executor_id' => $executor->id));
             $domain .= $site[0]->domain;
         } else {
             $domain = 'This task has never been checked';
         }
         array_push($leads, array('id' => $k->id, 'keyword' => $k->name, 'domain' => strlen($domain) > 0 ? $domain : 'No results ' . $executor->id, 'search_engine' => $k->search_engine, 'updated' => $executor->deleted_at));
     }
     return new CArrayDataProvider($leads, array('sort' => array('attributes' => array('*')), 'pagination' => array('pageSize' => 50)));
 }
Beispiel #26
0
<?php

include '../classes/keyword.php';
$error = Keyword::add_keyword($_POST['Keyword'], $_POST['Element_Type'], $_POST['Element_ID']);
//if error (return nothing)
if ($error != '1') {
    exit;
}
include '../include/element_keywords.php';
 public function __construct($text = null, $matchType = null)
 {
     parent::__construct();
     $this->text = $text;
     $this->matchType = $matchType;
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     Keyword::destroy($id);
     return Response::json(array('success' => true));
 }
Beispiel #29
0
 function testCreate()
 {
     $this->item->keyword = "test kw " . date("U");
     $this->assertTrue($this->item->save());
 }
Beispiel #30
0
<?php

/**
 * update_crontab.php
 *
 * 予約情報をcrontabにおとす
 *
 * simpleReservationが実行された時だけ実行すればよさそうに見えるが、
 * crontabをapacheから書き換える事はできないので、cronから書き換える必要がある
 */
mb_language("ja");
require_once dirname(__FILE__) . '/config.php';
// keywordから予約対象を調べて予約する
Keyword::reserveAll();
// 一旦TMPに出す。
file_put_contents('/tmp/crontab.txt', RecorderService::generateCrontab());
exec('crontab /tmp/crontab.txt');