Example #1
0
 public function attemptDetails($id)
 {
     $attempt = Attempt::find($id);
     $category = Category::find($attempt->category_id) ? Category::find($attempt->category_id)->name : 'N/A';
     $similar_domains = Domain::where('url', 'LIKE', '%' . $attempt->url . '%')->get();
     return View::make('admin.attempt_details')->with(compact('attempt', 'category', 'similar_domains'));
 }
Example #2
0
    public function searchAjax()
    {
        $response = '';
        $search_term = trim(e(Input::get('search_term')));
        $domains = Domain::where('status', 1)->where('name', 'LIKE', '%' . $search_term . '%')->orWhere('url', 'LIKE', '%' . $search_term . '%')->orWhere('description', 'LIKE', '%' . $search_term . '%')->take(5)->get(['id', 'name', 'thumb']);
        if (count($domains)) {
            foreach ($domains as $domain) {
                $domain_name = strlen($domain->name) > 30 ? substr($domain->name, 0, 30) . '...' : $domain->name;
                $response .= '<div class="search-box">
					<a class="search-result-row" href="' . Domain::seoURL($domain->id) . '">
						<div class="col-lg-5 col-md-5 col-sm-5 col-xs-5">
							<img class="img img-responsive thumbnail" 
								src="' . URL::asset('assets/thumbs/' . $domain->thumb) . '" alt="site preview" />
						</div>			
						<div class="col-lg-7 col-md-7 col-sm-7 col-xs-7">
							' . $domain_name . '	
						</div>	
						<div class="clearfix"></div>
					</a>	
					</div>';
            }
        } else {
            $response .= '<p>' . Lang::get('general.no_results', ['serch_term' => $search_term]) . '</p>';
        }
        print $response;
    }
Example #3
0
 public static function insertSkipDupes($domains)
 {
     $query = sprintf('INSERT INTO domains (name) VALUES ("%s") ON DUPLICATE KEY UPDATE name=name', implode('"),("', $domains));
     $status = DB::statement($query);
     Domain::where('created_at', '0000-00-00 00:00:00')->update(['created_at' => DB::raw('NOW()')]);
     Domain::where('created_at', '0000-00-00 00:00:00')->update(['updated_at' => DB::raw('NOW()')]);
     return $status;
 }
Example #4
0
 /**
  * Show the form for creating a new resource.
  *
  * @return Response
  */
 public function getAdd()
 {
     $users = array();
     if (Auth::user()->status == 2) {
         foreach (User::whereStatus(3)->get() as $user) {
             $users[$user['id']] = $user['username'];
         }
     }
     foreach (explode(",", str_replace(" ", "", Config::get('settings.available_css'))) as $css) {
         $available_css[$css] = $css;
     }
     if (Domain::where('user_id', Auth::user()->id)->count() >= Config::get('settings.domain_limit')) {
         return Output::push(array('path' => 'domain', 'messages' => array('fail' => _('You have reached limit domain'))));
     }
     return View::make('domain.create')->with('users', $users)->with('available_css', $available_css);
 }
Example #5
0
 public function action_query($domain)
 {
     $domain = strtolower($domain);
     $index_alpha = Sitemap::get_filters();
     Log::write('check', 'whois: ' . $domain);
     //Cache::forget('whois.'.$domain);
     $whois = Cache::remember('whois.' . $domain, function () use($domain) {
         return new Whois\Whois($domain);
     }, 60 * 24);
     $data = $whois->get_all_data();
     if ($data === 0) {
         $valid = 0;
     } else {
         $valid = $data[0]->valid();
     }
     if (!$valid) {
         return View::make('whois.index')->with('valid', 0)->with('type', 'whois')->with('title', 'WHOIS Search')->with('index_alpha', $index_alpha);
     }
     $data = $whois->email_mask($data);
     $available = $whois->available();
     $domain = $data[sizeof($data) - 1];
     $domain = $domain->get_query_domain();
     $meta = array('title' => '', 'ip' => '');
     if ($valid && !$available) {
         if (!Domain::where('name', '=', $domain)->first()) {
             @Domain::create(array('name' => $domain));
         }
         $meta['title'] = Domain::get_domain_title($domain);
         $ip = gethostbyname($domain);
         if ($ip != $domain) {
             $meta['ip'] = $ip;
         }
     }
     $expires_on = $whois->expires_on();
     $created_on = $whois->created_on();
     $updated_on = $whois->updated_on();
     if (is_numeric(end($data)->get_body())) {
         Cache::forget('whois.' . $domain);
     }
     return View::make('whois.query', array('i' => 1, 'data' => $data, 'meta' => $meta, 'type' => 'whois', 'valid' => $valid, 'domain' => $domain, 'available' => $available, 'expires_on' => $expires_on, 'created_on' => $created_on, 'updated_on' => $updated_on, 'index_alpha' => $index_alpha, 'title' => $domain . '\'s whois info'));
 }
 public function approveHandle($id)
 {
     $domain = Domain::find($id);
     $domain->status = 1;
     $domain->save();
     $next_domain = Domain::where('status', 0)->first();
     if ($next_domain) {
         $name = Domain::seoURL($next_domain->id);
         return $this->details($name, $next_domain->id);
     }
     return Redirect::route('home')->with('success', 'Yoohoo you\'re done!');
 }
Example #7
0
<?php

echo '<?xml version="1.0" encoding="UTF-8"?>';
?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
  xmlns:xhtml="http://www.w3.org/1999/xhtml">
<?php 
$domains = Domain::where('status', 1)->orderBy('updated_at', 'DESC')->get(['id', 'updated_at']);
if ($domains) {
    foreach ($domains as $domain) {
        $ro_url = LaravelLocalization::getLocalizedURL('ro', Domain::seoURL($domain->id), 'ro');
        $en_url = LaravelLocalization::getLocalizedURL('en', Domain::seoURL($domain->id), 'en');
        ?>
			<url>
				<loc><?php 
        echo $ro_url;
        ?>
</loc>
				<xhtml:link rel="alternate" hreflang="ro" href="<?php 
        echo $ro_url;
        ?>
" />
				<xhtml:link rel="alternate" hreflang="en" href="<?php 
        echo $en_url;
        ?>
" />
				<priority>1</priority>
				<lastmod><?php 
        echo date('c', strtotime($domain->updated_at));
        ?>
</lastmod>
Example #8
0
				{{ $format_anchor($last_visited->name) }}
			</a>
		</p>	
		<p>{{ trans('directory.domains_statistics_all') }}: {{ count(Domain::all()) }}</p>		
		<p>{{ trans('directory.pending_domains') }}: {{ count(Domain::where('status', 0)->get()) }}</p>
		<p>{{ trans('directory.categories') }}: {{ count(Category::all()) }}</p>
	</div>
	<div class="col-lg-4 col-md-4 col-sm-4 col-xs-12">
		<?php 
$prefered_domain = Domain::where('status', 1)->where('created_at', '>', \Carbon\Carbon::today())->orderBy('created_at')->first();
//		if('5.2.200.90' == $_SERVER['REMOTE_ADDR'])
//		{
//			var_dump($prefered_domain->name);
//		}
if (!$prefered_domain) {
    $prefered_domain = Domain::where('status', 1)->orderBy('created_at', 'DESC')->first();
}
?>
		<h4>Promovat</h4>
		<a class="a-no-dec" href="{{ Domain::seoURL($prefered_domain->id) }}">
			<div class="weekly-promoted">	
				<p>{{ $prefered_domain->name }}</p>
				<p class="grey">{{ substr($prefered_domain->description, 0, 150) }} {{ trans('general.more') }}</p>
			</div>	
		</a>	
	</div>	
	<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 text-center">
		Copyright &copy; {{ date('Y'), '&nbsp;', Lang::get('general.main-url') }}		
	</div>	
	<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 text-center">
		<a href="{{ URL::route('terms') }}">{{ trans('general.terms') }}</a>
Example #9
0
<?php

include __DIR__ . '/../start.php';
use Illuminate\Database\Capsule\Manager as DB;
$total = Domain::count();
$totalCompleted = Domain::where('status', 'finished')->count();
$page = isset($_GET['page']) == true ? $_GET['page'] : 1;
$perPage = 100;
$totalPages = floor($total / $perPage);
$sortBy = isset($_GET['sortBy']) == true ? $_GET['sortBy'] : 'tf';
$sortType = isset($_GET['sortType']) == true ? $_GET['sortType'] : 'desc';
$domains = Domain::take($perPage)->skip($perPage * ($page - 1))->orderBy($sortBy, $sortType)->get();
$newSortType = $sortType == 'desc' ? 'asc' : 'desc';
?>

<!DOCTYPE html>
<html>
	<head>
		<title>Domain Metrics Checker</title>
		<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
		<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css">
		<link rel="stylesheet" href="assets/style.css">
	</head>
	<body>
		<?php 
include __DIR__ . '/menu.php';
?>
		<div class='container'>
			<div class='clearfix'>
				<h2 class='pull-left'>Total <?php 
echo _e($total);
Example #10
0
        Route::get('domains/pending', ['as' => 'domains-pending', 'uses' => 'AdminController@getPendingDomains']);
        Route::get('domains/attempts', ['as' => 'domains-attempts', 'uses' => 'AdminController@getAttempts']);
        Route::get('attempt/{id}', ['as' => 'attempt.details', 'uses' => 'AdminController@attemptDetails']);
        Route::get('attempt-add/{id}', ['as' => 'attempt.add', 'uses' => 'AdminController@attemptAdd']);
        Route::get('attempt/delete/{id}', ['as' => 'attempt.delete', 'uses' => 'AdminController@attemptDelete']);
        Route::get('comments-all', ['before' => 'auth', 'uses' => 'AdminController@allComments', 'as' => 'comments-all']);
    });
});
Route::post('vote', ['as' => 'vote.site', 'uses' => 'DomainsController@vote']);
Route::get('get/site/votes/{type}/{id}', ['as' => 'get.site.votes', function ($type, $id) {
    return Domain::find($id)->{$type};
}]);
Route::post('search', ['as' => 'search.post', 'uses' => 'HomeController@searchAjax']);
Route::get('generate-sitemap', function () {
    ini_set('memory_limit', '2048M');
    $domains = Domain::where('status', 1)->get(['id', 'updated_at']);
    $categories = Category::where('status', 1)->get(['path', 'updated_at']);
    $langs = LaravelLocalization::getSupportedLocales();
    // create new sitemap object
    $sitemap = App::make("sitemap");
    // set cache (key (string), duration in minutes
    // (Carbon|Datetime|int), turn on/off (boolean))
    // by default cache is disabled
    //$sitemap->setCache('laravel.sitemap', 3600);
    $i = 0;
    $ci = 0;
    foreach ($domains as $domain) {
        $translations = array(array('url' => LaravelLocalization::getLocalizedURL('ro', Domain::seoURL($domain->id), 'ro'), 'language' => 'ro'), array('url' => LaravelLocalization::getLocalizedURL('en', Domain::seoURL($domain->id), 'en'), 'language' => 'en'));
        foreach ($langs as $lang_code => $lang_details) {
            $sitemap->add(LaravelLocalization::getLocalizedURL($lang_code, Domain::seoURL($domain->id)), date('c', strtotime($domain->updated_at)), 1.0, 'daily', null, null, $translations);
        }
Example #11
0
<?php

include __DIR__ . '/../../start.php';
use Illuminate\Database\Capsule\Manager as DB;
$config = (include __DIR__ . '/../../config/bots.php');
$bot = new Bot($config['majestic']['cookie']);
if (!isset($argv[1]) or !($domainList = json_decode($argv[1]))) {
    die('Invalid argument!' . PHP_EOL);
}
$domains = [];
foreach ($domainList as $key => $domain) {
    $domains[$domain->name] = $domain->id;
    $domainList[$key] = $domain->name;
}
$results = $bot->check($domainList);
foreach ($results as $name => $metrics) {
    if (isset($domains[$name]) && isset($metrics['tf']) && isset($metrics['cf']) && $metrics['tf'] >= 0 && $metrics['cf'] >= 0) {
        if ($metrics['niche'] == '') {
            $metrics['niche'] = 'N/A';
        }
        Domain::where('id', $domains[$name])->update(['tf' => $metrics['tf'], 'cf' => $metrics['cf'], 'rd' => $metrics['rd'], 'tf' => $metrics['tf'], 'topical' => $metrics['niche'], 'status' => 'finished']);
    }
}
echo PHP_EOL . PHP_EOL . PHP_EOL . PHP_EOL . PHP_EOL . 'Finish' . PHP_EOL;
Example #12
0
 private function _getUserId($email)
 {
     $domain = Domain::where('domain', Request::getHttpHost())->first();
     $user = User::where('email', $email)->where('domain_id', $domain['id'])->first();
     return $user['id'];
 }
 public function getFilterori()
 {
     if (Request::segment(2) == 'filter') {
         $input = Session::get('search') && !Input::get('search_category') ? Session::get('search') : Input::only(array('search_category', 'search_keyword'));
         switch ($input['search_category']) {
             case '0':
                 return Redirect::to('domain');
                 break;
             case 'owner':
                 $domains = Domain::whereHas('user', function ($q) {
                     $q->where('username', 'LIKE', '%' . Input::get('search_keyword') . '%');
                 })->get();
                 break;
             default:
                 if (Auth::user()->status == 2) {
                     $domains = Domain::where($input['search_category'], 'LIKE', '%' . $input['search_keyword'] . '%')->get();
                 } else {
                     $domains = Domain::where('user_id', Auth::user()->id)->where($input['search_category'], 'LIKE', '%' . $input['search_keyword'] . '%')->get();
                 }
                 break;
         }
         Session::set('search', $input);
     } else {
         Session::remove('search');
         $input = array('search_category' => '', 'search_keyword' => '');
         $domains = Auth::user()->status == 2 ? Domain::all() : Domain::where('user_id', Auth::user()->id)->get();
     }
     return View::make('domain.index')->with('domains', $domains)->with('selected', $input);
 }
Example #14
0
 private function _getDomainsId($user_id)
 {
     if (Domain::where('user_id', $user_id)->exists()) {
         $domains = Domain::where('user_id', $user_id)->get(['id']);
         $domains_temp = $domains->toArray();
         $domainids = [];
         foreach ($domains_temp as $doms) {
             array_push($domainids, $doms['id']);
         }
         return $domainids;
     } else {
         return false;
     }
 }