$results[] = array('id' => $row->fl_id, 'name' => $row->fl_name, 'year' => $row->fl_year, 'image' => $row->fl_image, 'url' => Common::cleanUrl($row->fl_name)); } return json_encode($results); }); Route::get('invite', 'UsersController@invite'); Route::post('invite', 'HomeController@inviteSend'); Route::post('invite/add', 'InviteController@add'); Route::get('invite/add', 'InviteController@add'); Route::get('invite/friend', 'InviteController@friend'); Route::post('invite/friend', 'InviteController@friend'); Route::get('myscore', function () { echo $action = DB::table('user_actions')->where('subject_id', Auth::user()->id)->where('object_type', 'film')->where('film.fl_rating', '!=', '0')->join('film', 'film.fl_id', '=', 'user_actions.object_id')->avg('fl_rating'); }); Route::get('feed/global', 'HomeController@globalFeed'); Route::get('change', function () { $name = Movie::whereBetween('fl_id', array(1, 20000))->get(); foreach ($name as $film) { //tag1 without spaces without expressions //tag2 with spaces without expressions //tag3 same as name $tag1 = str_replace(array(' ', "'", ';', ':', '.', '-', ',', '%', '&', '$', '"', '_', ')', '(', '@'), '', $film->fl_name); $tag2 = str_replace(array(';', "'", ':', '.', '-', ',', '%', '&', '$', '"', '_', ')', '(', '@'), '', $film->fl_name); $tags = $tag1 . ', ' . $tag2 . ', ' . $film->fl_name; echo $film->fl_id . '<br/>'; DB::table('film')->where('fl_id', $film->fl_id)->update(array('fl_tags' => $tags)); } }); /* // inserts the review
<?php ob_start(); $time = time(); $actual_date = date('Y-m-d', $time); $movie = Movie::whereBetween('fl_id', array(1, 3501))->get(); header('Content-Type: application/xml'); echo '<?xml version="1.0" encoding="UTF-8"?>' . "\n"; echo "<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">"; foreach ($movie as $movie) { $title_str = Common::cleanUrl($movie->fl_name); $utf8_str = iconv("iso-8859-15", "UTF-8", $title_str); $url_str = str_replace("(", "", $utf8_str); $url_str2 = str_replace("&", "&", $url_str); ?> <url> <loc>http://www.berdict.com/movie/<?php echo $movie->fl_id; ?> /<?php echo $url_str2; ?> /reviews</loc> <lastmod><?php echo $actual_date; ?> </lastmod> <priority>1.0</priority> <changefreq>daily</changefreq> </url>