diff --git a/README.md b/README.md index 9ffe517..3a3c5d4 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,7 @@ Changelog * Added backup function (yoursite.com/backup; set credentials in stikked.php config) * Added pagination to the replies table +* Embeddable pastes * GeSHi updated to version 1.0.8.10 * Codemirror turned off by default * Codemirror: Syntax changes dynamically with selection in language dropdown diff --git a/htdocs/application/config/routes.php b/htdocs/application/config/routes.php index c6a0ada..fcf5667 100644 --- a/htdocs/application/config/routes.php +++ b/htdocs/application/config/routes.php @@ -44,6 +44,7 @@ $route['scaffolding_trigger'] = ""; $route['cron/:any'] = "main/cron"; $route['view/raw/:any'] = 'main/raw'; +$route['view/embed/:any'] = 'main/embed'; $route['view/options'] = 'main/view_options'; $route['view/download/:any'] = 'main/download'; $route['view/:any'] = 'main/view'; diff --git a/htdocs/application/controllers/main.php b/htdocs/application/controllers/main.php index 8bdc1e1..2b1dd16 100755 --- a/htdocs/application/controllers/main.php +++ b/htdocs/application/controllers/main.php @@ -6,6 +6,7 @@ * - _form_prep() * - index() * - raw() + * - embed() * - download() * - lists() * - view() @@ -292,6 +293,22 @@ class Main extends CI_Controller } } + function embed() + { + $this->load->model('pastes'); + $check = $this->pastes->checkPaste(3); + + if ($check) + { + $data = $this->pastes->getPaste(3); + $this->load->view('view/embed', $data); + } + else + { + show_404(); + } + } + function download() { $this->load->model('pastes'); @@ -449,6 +466,6 @@ class Main extends CI_Controller echo file_get_contents('./static/js/' . $js[0]); } } - exit; + exit; } }