From 4a4bf2759c813e67a453e4b523d936e2d56dd2f9 Mon Sep 17 00:00:00 2001 From: sabotag Date: Wed, 24 Apr 2013 10:58:17 +0300 Subject: [PATCH] little correct url fix --- .gitignore | 3 ++- application/classes/controller/index.php | 2 +- application/classes/model/material.php | 10 +++++----- application/views/material/edit.php | 3 +-- application/views/material/show.php | 2 +- test.php | 15 ++++++++++++++- 6 files changed, 24 insertions(+), 11 deletions(-) diff --git a/.gitignore b/.gitignore index d78eacc..96f2791 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .idea/ application/cache/ application/logs/ -source/ \ No newline at end of file +source/ +test.php \ No newline at end of file diff --git a/application/classes/controller/index.php b/application/classes/controller/index.php index 20780b0..3553422 100755 --- a/application/classes/controller/index.php +++ b/application/classes/controller/index.php @@ -67,7 +67,7 @@ protected function get_novelty () { $comments = $polls = array(); - $materials = Jelly::query ('material')->where('on_index', '=', 1)->order_by('novelty_index', 'DESC')->order_by('date', 'DESC')->limit(16)->select_all(); + $materials = Jelly::query ('material')->where('on_index', '=', 1)->order_by('novelty_index', 'ASC')->order_by('date', 'DESC')->limit(16)->select_all(); $mids = array(); diff --git a/application/classes/model/material.php b/application/classes/model/material.php index b68f7f4..edc0c9d 100644 --- a/application/classes/model/material.php +++ b/application/classes/model/material.php @@ -61,9 +61,9 @@ public static function initialize(Jelly_Meta $meta) 'label' => 'material.field.url' )), - 'fix_url' => Jelly::field('string', array( + 'url_fix' => Jelly::field('string', array( 'default' => false, - 'label' => 'material.field.fix_url' + 'label' => 'material.field.url_fix' )), 'tags' => Jelly::field('manytomany'), @@ -131,7 +131,7 @@ public function file() $url = $this->url; - if( ! $this->fix_url AND $url) + if( ! $this->url_fix AND $url) { $headers = @get_headers($url); @@ -141,7 +141,7 @@ public function file() } } - $this->fix_url = true; + $this->url_fix = true; $this->save(); @@ -360,4 +360,4 @@ public function total_recount() return false; } -} \ No newline at end of file +} diff --git a/application/views/material/edit.php b/application/views/material/edit.php index 8590079..e5685ee 100644 --- a/application/views/material/edit.php +++ b/application/views/material/edit.php @@ -14,8 +14,7 @@ function setLimit(begin, end) video):?>
- file()?> -file()?> +
diff --git a/application/views/material/show.php b/application/views/material/show.php index 7027152..e9537d5 100644 --- a/application/views/material/show.php +++ b/application/views/material/show.php @@ -34,7 +34,7 @@ video):?>
- +
diff --git a/test.php b/test.php index 82a5f68..63cc9a3 100644 --- a/test.php +++ b/test.php @@ -1 +1,14 @@ -adas \ No newline at end of file +111111111111 +111111111111 +111111111111 +111111111111 +111111111111 +111111111111 +111111111111 +111111111111 +111111111111 +111111111111 +111111111111 +111111111111 +111111111111 +111111111111 \ No newline at end of file