Added a very old Code Igniter 3 based cms implementation aswell. It's model code should be a lot more useful that the laravel based one's.

This commit is contained in:
Relintai 2021-10-30 18:35:25 +02:00
parent bfac419706
commit 35eb2e0478
41 changed files with 3835 additions and 0 deletions

4
ci_scms/.gitignore vendored Normal file
View File

@ -0,0 +1,4 @@
img/upload/**
img/gallery/mid/**
img/gallery/orig/**
img/gallery/thumb/**

View File

@ -0,0 +1,6 @@
<IfModule authz_core_module>
Require all denied
</IfModule>
<IfModule !authz_core_module>
Deny from all
</IfModule>

View File

@ -0,0 +1,83 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Mgallery extends V_Controller {
public function index($page = "")
{
$this->load->helper("url");
redirect('gallery/view/');
}
public function view($gallery = "", $folder = "", $picture = "")
{
if (!$gallery || !$folder) {
$this->load->helper("url");
redirect("main/index");
}
$this->load->model("multi_gallery_model");
$data["is_admin"] = $this->is_admin;
$p = $this->multi_gallery_model->get_page_and_id_from_gallery_name($gallery);
if (!$p) {
$this->load->helper("url");
redirect("main/index");
}
$page = $p["page"];
$pageid = $p["pageid"];
$data["pageid"] = $pageid;
$data["page"] = $page;
$data["gallery_info"] = $this->multi_gallery_model->get_multi_gallery_folder($gallery, $folder);
$data["gallery_data"] = $this->multi_gallery_model->get_multi_gallery_folder_images($data["gallery_info"]["id"]);
$picdata = null;
if ($data["gallery_data"]) {
$found = false;
foreach ($data["gallery_data"] as $d) {
if ($d["link"] == strval($picture)) {
$picdata = $d;
$found = true;
break;
}
/*
if (is_numeric($picture)) {
if ($d["id"] == intval($picture)) {
$picdata = $d;
$found = true;
break;
}
} else {
if ($d["name"] == $picture) {
$picdata = $d;
$found = true;
break;
}
}*/
}
if (!$found) {
if ($data["gallery_data"]) {
$picdata = $data["gallery_data"][0];
}
}
}
$data["curr_pic"] = $picdata;
$data["galleryname"] = $gallery;
$data["currpic"] = $picture;
$this->_send_headers($page, "gallery");
$this->load->view("multigallery", $data);
$this->_send_footer();
}
}

View File

@ -0,0 +1,795 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Admin extends V_Controller {
function __construct()
{
parent::__construct();
$this->_manage_admin_session();
$this->load->model("admin_model");
}
public function index()
{
$this->load->helper("url");
redirect("admin/login");
}
public function login()
{
$this->load->helper("url");
$data["reg_enabled"] = $this->admin_model->is_registration_enabled();
$this->load->view("admin/login", $data);
}
public function dologin()
{
$username = $this->input->post("user");
$password = $this->input->post("pass");
$password = $this->salt_md5($password);
if ($this->admin_model->check_user($username, $password))
{
//let's generate the session data
$sessionid = $this->admin_model->get_or_create_session_id($username);
if ($sessionid == -1) {
//echo "sessid -1";
$this->load->helper('url');
redirect("admin/login");
}
$cookie_session_id = $this->admin_model->create_cookie_session_id($username);
if ($cookie_session_id == -1) {
$this->load->helper('url');
redirect("admin/login");
}
if (!$this->admin_model->register_session($sessionid, $cookie_session_id)) {
$this->load->helper('url');
redirect("admin/login");
}
$this->session->set_userdata('sid', $cookie_session_id);
$this->load->helper('url');
redirect("main/index");
} else {
$this->load->helper('url');
redirect("admin/login");
}
}
public function register()
{
$this->load->helper("url");
$data["reg_enabled"] = $this->admin_model->is_registration_enabled();
if ($data["reg_enabled"] == false) {
show_404();
}
$this->load->view("admin/register", $data);
}
public function doregister()
{
$username = $this->input->post('user');
$password = $this->input->post('pass');
$password2 = $this->input->post('pass2');
$email = $this->input->post('email');
if (!$username || !$password || !$password2 || !$email || !($password == $password2)) {
$this->load->helper('url');
redirect("admin/register");
}
$password = $this->salt_md5($password);
$this->admin_model->register_user($username, $password, $email);
$this->load->helper('url');
redirect("admin/login");
}
public function addcontent($page = -1, $elementid = -1)
{
if (!$this->is_admin)
show_404();
$this->load->helper("url");
if ($page == -1) {
redirect("main/index");
}
$this->load->model("content_model");
if ($elementid == -1) {
redirect("main/index");
}
$data["pageid"] = $page;
$data["mode"] = "add";
switch ($elementid) {
case 1:
$this->load->view("admin/text", $data);
break;
case 3:
$this->load->view("admin/add_gallery", $data);
break;
case 4:
$this->load->view("admin/add_multi_gallery", $data);
break;
default:
redirect("main/index");
}
}
public function editcontent($page = -1, $elementid = -1, $contentid = -1)
{
if (!$this->is_admin)
show_404();
$this->load->helper("url");
if ($page == -1 || $elementid == -1 || $contentid == -1) {
redirect("main/index");
}
$this->load->model("content_model");
$data["pageid"] = $page;
$data["contentid"] = $contentid;
$data["mode"] = "edit";
$s = $this->content_model->get_content_text($contentid);
$data["text"] = $s["text_noformat"];
switch ($elementid) {
case 1:
$this->load->view("admin/text", $data);
break;
default:
redirect("main/index");
}
}
public function addtext($pageid = -1)
{
if (!$this->is_admin)
show_404();
$this->load->helper("url");
$message = $this->input->post("message");
$this->load->model("content_model");
$this->content_model->add_page_text($pageid, $message);
redirect("main/index");
}
public function edittext($textid = -1)
{
if (!$this->is_admin)
show_404();
$this->load->helper("url");
$message = $this->input->post("message");
$this->load->model("content_model");
$this->content_model->edit_page_text($textid, $message);
redirect("main/index");
}
public function contentdown($pageid = -1, $contentid = -1) {
if (!$this->is_admin)
show_404();
$this->load->helper("url");
if ($pageid == -1 && $contentid == -1)
redirect("main/index");
$this->load->model("content_model");
$this->content_model->content_down($pageid, $contentid);
redirect("main/index");
}
public function contentup($pageid = -1, $contentid = -1) {
if (!$this->is_admin)
show_404();
$this->load->helper("url");
if ($pageid == -1 && $contentid == -1)
redirect("main/index");
$this->load->model("content_model");
$this->content_model->content_up($pageid, $contentid);
redirect("main/index");
}
public function deletecontent($pageid = -1, $id = -1) {
if (!$this->is_admin)
show_404();
$this->load->helper("url");
if ($pageid == -1 && $id == -1)
redirect("main/index");
$this->load->model("content_model");
$this->content_model->content_delete($pageid, $id);
redirect("main/index");
}
public function logout() {
if (!$this->is_admin)
show_404();
$this->load->helper("url");
$this->admin_model->logout($_SESSION["sid"]);
unset($_SESSION['sid']);
redirect("main/index");
}
public function logoutall() {
if (!$this->is_admin)
show_404();
$this->load->helper("url");
$this->admin_model->logout_all($_SESSION["sid"]);
unset($_SESSION['sid']);
redirect("main/index");
}
public function addgallery($page = -1) {
if (!$this->is_admin)
show_404();
$this->load->helper("url");
if ($page == -1)
redirect("main/index");
$name = $this->input->post("name");
$description = $this->input->post("description");
$this->load->model("content_model");
$this->content_model->add_gallery($page, $name, $description);
redirect("main/index");
}
public function addgalleryimage($galleryid = -1) {
if (!$this->is_admin)
show_404();
$this->load->helper("url");
if ($galleryid == -1)
redirect("main/index");
$this->load->helper('form');
$data["id"] = $galleryid;
$data["mode"] = 'add';
$this->load->view("admin/add_gallery_img", $data);
//redirect("main/index");
}
public function doaddgalleryimage($galleryid = -1) {
if (!$this->is_admin)
show_404();
$this->load->helper("url");
if ($galleryid == -1)
redirect("main/index");
$name = $this->input->post("name");
$description = $this->input->post("description");
//$img = $this->input->post("img");
//$this->load->model("content_model");
//$this->content_model->add_gallery_image($galleryid, $name, $description);
$config['upload_path'] = './img/upload/';
$config['allowed_types'] = 'gif|jpg|png';
$config['max_size'] = 80000;
$config['max_width'] = 90000;
$config['max_height'] = 90000;
$this->load->library('upload', $config);
if ($this->upload->do_upload("img"))
{
//$data = array('upload_data' => $this->upload->data());
//$this->load->view('upload_success', $data);
$data = $this->upload->data();
/*
$data = array(
'file_name' => $this->file_name,
'file_type' => $this->file_type,
'file_path' => $this->upload_path,
'full_path' => $this->upload_path.$this->file_name,
'raw_name' => str_replace($this->file_ext, '', $this->file_name),
'orig_name' => $this->orig_name,
'client_name' => $this->client_name,
'file_ext' => $this->file_ext,
'file_size' => $this->file_size,
'is_image' => $this->is_image(),
'image_width' => $this->image_width,
'image_height' => $this->image_height,
'image_type' => $this->image_type,
'image_size_str' => $this->image_size_str,
);
*/
//var_dump($data);
//var_dump(gd_info());
//var_dump(getimagesize($data["full_path"]));
//first let's make a thumbnail
$res = null;
if ($data["file_type"] == "image/jpeg") {
$res = imagecreatefromjpeg($data["full_path"]);
} elseif ($data["file_type"] == "image/gif") {
$res = imagecreatefromgif($data["full_path"]);
} elseif ($data["file_type"] == "image/png") {
$res = imagecreatefrompng($data["full_path"]);
} else {
die("Nem támogatott kép formátum!");
}
//first let's crop out a rectangle from the middle
$size = getimagesize($data["full_path"]);
$width = $size[0];
$height = $size[1];
$rect = null;
$cropped = imagecreatetruecolor(155, 155);
if ($width > $height) {
$x = intval(($width - $height) / 2);
$y = 0;
$w = $height;
$h = $height;
imagecopyresampled($cropped, $res, 0, 0, $x, $y, 155, 155, $w, $h);
//imagecopyresized($cropped, $res, 0, 0, $rect["x"], $rect["y"], 155, 155, $rect["width"], $rect["height"]);
} elseif($height > $width) {
$x = 0;
$y = intval(($height - $width) / 2);
$w = $width;
$h = $width;
imagecopyresampled($cropped, $res, 0, 0, $x, $y, 155, 155, $w, $h);
//imagecopyresized($cropped, $res, 0, 0, $rect["x"], $rect["y"], 155, 155, $rect["width"], $rect["height"]);
//$cropped = imagecrop ($res, $rect);
} else {
imagecopyresampled($cropped, $res, 0, 0, 0, 0, 155, 155, $width, $height);
}
//bool
imagejpeg($cropped, $data["file_path"] . "thumb.jpg", 100);
//Now let's make a big version
//470 width
$imgsize = getimagesize($data["full_path"]);
$widthrat = 470 / $imgsize[0];
$h = $imgsize[1] * $widthrat;
$h = intval($h);
$big = imagecreatetruecolor(470, $h);
imagecopyresampled($big, $res, 0, 0, 0, 0, 470, $h, $imgsize[0], $imgsize[1]);
//var_dump($imgsize);
//imagecopyresized($big, $res, 0, 0, 0, 0, 470, $h, $imgsize[0], $imgsize[1]);
imagejpeg($big, $data["file_path"] . "mid.jpg", 100);
//Now let's make a big version
//1200 width
$imgsize = getimagesize($data["full_path"]);
$widthrat = 1200 / $imgsize[0];
$h = $imgsize[1] * $widthrat;
$h = intval($h);
$big = imagecreatetruecolor(1200, $h);
imagecopyresampled($big, $res, 0, 0, 0, 0, 1200, $h, $imgsize[0], $imgsize[1]);
imagejpeg($big, $data["file_path"] . "big.jpg", 100);
//now let's put hem into the img directory
$this->load->helper('file');
$finalfilename = $this->_get_unique_file_name(str_replace('\\', '/', realpath('') . '/img/gallery/orig/'), $name);
$f = read_file($data["file_path"] . "big.jpg");
$werfull = str_replace('\\', '/', realpath('') . '/img/gallery/orig/');
$werfull = $werfull . $finalfilename . ".jpg";
write_file($werfull, $f);
$f = read_file($data["file_path"] . "thumb.jpg");
$werthumb = str_replace('\\', '/', realpath('') . '/img/gallery/thumb/');
$werthumb = $werthumb . $finalfilename . ".jpg";
write_file($werthumb, $f);
$f = read_file($data["file_path"] . "mid.jpg");
$wermid = str_replace('\\', '/', realpath('') . '/img/gallery/mid/');
$wermid = $wermid . $finalfilename . ".jpg";
write_file($wermid, $f);
$this->load->model("content_model");
$this->content_model->add_gallery_image($galleryid, $name, $description, $finalfilename . ".jpg", $finalfilename . ".jpg", $finalfilename . ".jpg");
//$d = str_replace('\\', '/', realpath('') . '/img/upload/');
delete_files('./img/upload/');
}
else
{
//echo $this->upload->display_errors();
//$error = array('error' => $this->upload->display_errors());
//var_dump($error);
//$this->load->view('upload_form', $error);
}
$this->load->model("gallery_model");
$url = $this->gallery_model->get_gallery_link($galleryid);
redirect("gallery/view/" . $url);
}
function delgalleryimage($galleryid = -1, $imageid = -1) {
if (!$this->is_admin)
show_404();
$this->load->helper("url");
if ($galleryid == -1)
redirect("main/index");
if ($imageid == -1)
redirect("gallery/view/" . $galleryid);
$this->load->model("gallery_model");
$data = $this->gallery_model->del_gallery_image_from_db($imageid);
if ($data) {
$this->load->helper('file');
$werfull = str_replace('\\', '/', realpath('') . '/img/gallery/orig/');
$werfull = $werfull . $data["orig_img"];
if (get_file_info($werfull)) {
unlink($werfull);
}
$werthumb = str_replace('\\', '/', realpath('') . '/img/gallery/thumb/');
$werthumb = $werthumb . $data["thumb"];
if (get_file_info($werthumb)) {
unlink($werthumb);
}
$wermid = str_replace('\\', '/', realpath('') . '/img/gallery/mid/');
$wermid = $wermid . $data["img"];
if (get_file_info($wermid)) {
unlink($wermid);
}
}
//$url = $this->gallery_model->get_gallery_name($galleryid);
redirect("gallery/view/" . $galleryid);
}
public function addmultigallery($page = -1) {
if (!$this->is_admin)
show_404();
$this->load->helper("url");
if ($page == -1)
redirect("main/index");
$name = $this->input->post("name");
$description = $this->input->post("description");
$this->load->model("content_model");
$this->content_model->add_multi_gallery($page, $name, $description);
$this->redirect_to_pageid($page);
//redirect("main/index");
}
public function addmultigalleryfolder($galleryid = -1) {
if (!$this->is_admin)
show_404();
$this->load->helper("url");
if ($galleryid == -1)
redirect("main/index");
if (!$this->input->post()) {
$this->load->helper('form');
$data["id"] = $galleryid;
$data["mode"] = 'add';
$this->load->view("admin/add_multi_gallery_folder", $data);
return;
}
$name = $this->input->post("name");
$description = $this->input->post("description");
$config['upload_path'] = './img/upload/';
$config['allowed_types'] = 'gif|jpg|png';
$config['max_size'] = 80000;
$config['max_width'] = 90000;
$config['max_height'] = 90000;
$this->load->library('upload', $config);
if ($this->upload->do_upload("img"))
{
$data = $this->upload->data();
//let's make a thumbnail
$res = null;
if ($data["file_type"] == "image/jpeg") {
$res = imagecreatefromjpeg($data["full_path"]);
} elseif ($data["file_type"] == "image/gif") {
$res = imagecreatefromgif($data["full_path"]);
} elseif ($data["file_type"] == "image/png") {
$res = imagecreatefrompng($data["full_path"]);
} else {
die("Nem támogatott kép formátum!");
}
//first let's crop out a rectangle from the middle
$size = getimagesize($data["full_path"]);
$width = $size[0];
$height = $size[1];
$rect = null;
$cropped = imagecreatetruecolor(202, 202);
if ($width > $height) {
$x = intval(($width - $height) / 2);
$y = 0;
$w = $height;
$h = $height;
imagecopyresampled($cropped, $res, 0, 0, $x, $y, 202, 202, $w, $h);
} elseif($height > $width) {
$x = 0;
$y = intval(($height - $width) / 2);
$w = $width;
$h = $width;
imagecopyresampled($cropped, $res, 0, 0, $x, $y, 202, 202, $w, $h);
} else {
imagecopyresampled($cropped, $res, 0, 0, 0, 0, 202, 202, $width, $height);
}
//bool
imagejpeg($cropped, $data["file_path"] . "thumb.jpg", 100);
//now let's put hem into the img directory
$this->load->helper('file');
$finalfilename = $this->_get_unique_file_name(str_replace('\\', '/', realpath('') . '/img/mgallery/folder/'), $name);
$f = read_file($data["file_path"] . "thumb.jpg");
$werthumb = str_replace('\\', '/', realpath('') . '/img/mgallery/folder/');
$werthumb = $werthumb . $finalfilename . ".jpg";
write_file($werthumb, $f);
$this->load->model("multi_gallery_model");
$this->multi_gallery_model->add_multi_gallery_folder($galleryid, $name, $description, $finalfilename . ".jpg");
delete_files('./img/upload/');
}
else
{
//echo $this->upload->display_errors();
//$error = array('error' => $this->upload->display_errors());
//var_dump($error);
//$this->load->view('upload_form', $error);
}
$this->load->model("multi_gallery_model");
$url = $this->multi_gallery_model->get_page_name_from_gallery_id($galleryid);
redirect("main/index/" . $url);
}
public function addmultigalleryimage($galleryid = -1, $folderid = -1) {
if (!$this->is_admin)
show_404();
$this->load->helper("url");
if ($galleryid == -1 || $folderid == -1)
redirect("main/index");
if (!$this->input->post()) {
$this->load->helper('form');
$data["id"] = $galleryid;
$data["folderid"] = $folderid;
$data["mode"] = 'add';
$this->load->view("admin/add_multi_gallery_img", $data);
return;
}
$name = $this->input->post("name");
$description = $this->input->post("description");
$config['upload_path'] = './img/upload/';
$config['allowed_types'] = 'gif|jpg|png';
$config['max_size'] = 80000;
$config['max_width'] = 90000;
$config['max_height'] = 90000;
$this->load->library('upload', $config);
if ($this->upload->do_upload("img"))
{
$data = $this->upload->data();
$res = null;
if ($data["file_type"] == "image/jpeg") {
$res = imagecreatefromjpeg($data["full_path"]);
} elseif ($data["file_type"] == "image/gif") {
$res = imagecreatefromgif($data["full_path"]);
} elseif ($data["file_type"] == "image/png") {
$res = imagecreatefrompng($data["full_path"]);
} else {
die("Nem támogatott kép formátum!");
}
//first let's make a thumbnail
//let's crop out a rectangle from the middle
$size = getimagesize($data["full_path"]);
$width = $size[0];
$height = $size[1];
$rect = null;
$cropped = imagecreatetruecolor(155, 155);
if ($width > $height) {
$x = intval(($width - $height) / 2);
$y = 0;
$w = $height;
$h = $height;
imagecopyresampled($cropped, $res, 0, 0, $x, $y, 155, 155, $w, $h);
} elseif($height > $width) {
$x = 0;
$y = intval(($height - $width) / 2);
$w = $width;
$h = $width;
imagecopyresampled($cropped, $res, 0, 0, $x, $y, 155, 155, $w, $h);
} else {
imagecopyresampled($cropped, $res, 0, 0, 0, 0, 155, 155, $width, $height);
}
//bool
imagejpeg($cropped, $data["file_path"] . "thumb.jpg", 100);
//Now let's make a mid version
//470 width
$imgsize = getimagesize($data["full_path"]);
$widthrat = 470 / $imgsize[0];
$h = $imgsize[1] * $widthrat;
$h = intval($h);
$mid = imagecreatetruecolor(470, $h);
imagecopyresampled($mid, $res, 0, 0, 0, 0, 470, $h, $imgsize[0], $imgsize[1]);
imagejpeg($mid, $data["file_path"] . "mid.jpg", 100);
//Now let's make a big version
//1200 width
$imgsize = getimagesize($data["full_path"]);
$widthrat = 1200 / $imgsize[0];
$h = $imgsize[1] * $widthrat;
$h = intval($h);
$big = imagecreatetruecolor(1200, $h);
imagecopyresampled($big, $res, 0, 0, 0, 0, 1200, $h, $imgsize[0], $imgsize[1]);
imagejpeg($big, $data["file_path"] . "big.jpg", 100);
//now let's put hem into the img directory
$this->load->helper('file');
$finalfilename = $this->_get_unique_file_name(str_replace('\\', '/', realpath('') . '/img/mgallery/big/'), $name);
$f = read_file($data["file_path"] . "big.jpg");
$werfull = str_replace('\\', '/', realpath('') . '/img/mgallery/big/');
$werfull = $werfull . $finalfilename . ".jpg";
write_file($werfull, $f);
$f = read_file($data["file_path"] . "thumb.jpg");
$werthumb = str_replace('\\', '/', realpath('') . '/img/mgallery/thumb/');
$werthumb = $werthumb . $finalfilename . ".jpg";
write_file($werthumb, $f);
$f = read_file($data["file_path"] . "mid.jpg");
$wermid = str_replace('\\', '/', realpath('') . '/img/mgallery/mid/');
$wermid = $wermid . $finalfilename . ".jpg";
write_file($wermid, $f);
$this->load->model("multi_gallery_model");
$this->multi_gallery_model->add_gallery_image($folderid, $name, $description, $finalfilename . ".jpg", $finalfilename . ".jpg", $finalfilename . ".jpg", $finalfilename . ".jpg");
delete_files('./img/upload/');
}
else
{
//echo $this->upload->display_errors();
//$error = array('error' => $this->upload->display_errors());
//var_dump($error);
//$this->load->view('upload_form', $error);
}
$this->load->model("multi_gallery_model");
$gn = $this->multi_gallery_model->get_gallery_name($galleryid);
$fn = $this->multi_gallery_model->get_folder_name($folderid);
redirect("mgallery/view/" . $gn . "/" . $fn);
}
function delmultigalleryimage($galleryname = "", $foldername = "", $imageid = -1) {
if (!$this->is_admin)
show_404();
$this->load->helper("url");
if ($imageid == -1)
redirect("mgallery/view/" . $galleryname . "/" . $foldername);
$this->load->model("multi_gallery_model");
$data = $this->multi_gallery_model->del_image_from_db($imageid);
if ($data) {
$this->load->helper('file');
$werfull = str_replace('\\', '/', realpath('') . '/img/mgallery/big/');
$werfull = $werfull . $data["big"];
if (get_file_info($werfull)) {
unlink($werfull);
}
$werthumb = str_replace('\\', '/', realpath('') . '/img/mgallery/thumb/');
$werthumb = $werthumb . $data["thumb"];
if (get_file_info($werthumb)) {
unlink($werthumb);
}
$wermid = str_replace('\\', '/', realpath('') . '/img/mgallery/mid/');
$wermid = $wermid . $data["mid"];
if (get_file_info($wermid)) {
unlink($wermid);
}
}
redirect("mgallery/view/" . $galleryname . "/" . $foldername);
}
}

View File

@ -0,0 +1,86 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Gallery extends V_Controller {
public function index($page = "")
{
$this->load->helper("url");
redirect('gallery/view/');
}
public function view($gallery = "", $picture = "")
{
if (!$gallery) {
$this->load->helper("url");
redirect("main/index");
}
$this->load->model("gallery_model");
$this->load->model('menu_model');
$this->load->model("content_model");
$data["is_admin"] = $this->is_admin;
$p = $this->gallery_model->get_page_and_id_from_gallery_link($gallery);
if (!$p) {
$this->load->helper("url");
redirect("main/index");
}
$page = $p["page"];
$pageid = $p["pageid"];
$data["pageid"] = $pageid;
$data["page"] = $page;
$data["gallery_info"] = $this->gallery_model->get_gallery_info($gallery);
$data["gallery_data"] = $this->gallery_model->get_gallery_data($data["gallery_info"]["id"]);
$picdata = null;
if ($data["gallery_data"]) {
$found = false;
foreach ($data["gallery_data"] as $d) {
if ($d["link"] == strval($picture)) {
$picdata = $d;
$found = true;
break;
}
/*
if (is_numeric($picture)) {
if ($d["id"] == intval($picture)) {
$picdata = $d;
$found = true;
break;
}
} else {
if ($d["name"] == $picture) {
$picdata = $d;
$found = true;
break;
}
}*/
}
if (!$found) {
if ($data["gallery_data"]) {
$picdata = $data["gallery_data"][0];
}
}
}
$data["curr_pic"] = $picdata;
$data["galleryname"] = $gallery;
$data["currpic"] = $picture;
$this->_send_headers($page, "gallery");
$this->load->view("gallery", $data);
$this->_send_footer();
}
}

View File

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>

View File

@ -0,0 +1,90 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Main extends V_Controller {
public function index($page = "")
{
$this->load->model('menu_model');
$this->load->model("content_model");
$data["is_admin"] = $this->is_admin;
if ($page != "") {
if (!$this->menu_model->is_page_valid($page)) {
show_404();
}
}
if ($page == "") {
$data = $this->menu_model->getFirstMenuItem();
$page = $data["link"];
}
$pageid = $this->menu_model->getPageId($page);
$data["pageid"] = $pageid;
$content_data;
$contents;
$i = 0;
if ($pageid != -1) {
$contentlinks = $this->content_model->get_page_contents($pageid);
if (sizeof($contentlinks) > 0)
{
//first let's prep a class like array
foreach($contentlinks as $c) {
$contents[$i]["link"] = $c;
$d = null;
if ($c["content_type"] == "1") {
$d = $this->content_model->get_content_text($c["content_id"]);
} elseif ($c["content_type"] == "3") {
$d["main"] = $this->content_model->get_content_gallery($c["content_id"]);
$d["data"] = $this->content_model->get_gallery_data($d["main"]["id"]);
} elseif ($c["content_type"] == "4") {
$d["main"] = $this->content_model->get_content_multi_gallery($c["content_id"]);
$d["folders"] = $this->content_model->get_content_multi_gallery_folders($d["main"]["id"]);
}
$contents[$i]["data"] = $d;
$i++;
}
}
}
$this->_send_headers($page);
$htmld;
$j = 0;
if (isset($contents)) {
if (sizeof($contents) > 0) {
$i = 0;
$data["contsize"] = sizeof($contents);
foreach ($contents as $c) {
$data["data"] = $c["data"];
$data["link"] = $c["link"];
$data["i"] = $i;
//var_dump($c["data"]);
//var_dump($c["data"]);
if ($c["link"]["content_type"] == 1) {
$data["htmld"][$j] = $this->load->view("textcontent", $data, true);
} else if ($c["link"]["content_type"] == 3) {
$data["htmld"][$j] = $this->load->view("gallerycontent", $data, true);
} else if ($c["link"]["content_type"] == 4) {
$data["htmld"][$j] = $this->load->view("multigallerycontent", $data, true);
}
$i++;
$j++;
}
}
}
$this->load->view("content", $data);
$this->_send_footer();
}
}

View File

@ -0,0 +1,159 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class V_Controller extends CI_Controller {
public $is_admin;
function __construct()
{
parent::__construct();
$this->isadmin = false;
$this->_manage_session();
}
function _manage_session() {
if (isset($_SESSION['sid'])) {
$this->load->model("admin_model");
$this->is_admin = $this->admin_model->is_admin($_SESSION['sid']);
}
}
function _manage_admin_session() {
}
function _send_admin_headers() {
}
function _send_headers($page, $type = "") {
$this->load->helper('url');
$data["title"] = "title";
$data["pageid"] = $page;
$data["is_admin"] = $this->is_admin;
$data["type"] = $type;
$this->load->helper("url");
$this->_send_header($data);
$this->_send_menu($data);
}
function _send_header($data) {
$this->load->view("header", $data);
}
function _send_menu($data) {
$this->load->model('menu_model');
$data["menu"] = $this->menu_model->getBaseMenuData();
$this->load->view("menu", $data);
}
function _send_footer() {
$data["is_admin"] = $this->is_admin;
$this->load->view("footer", $data);
}
function salt_md5($text) {
return hash("sha512", "dla=/aasdf42)%/sf14" . $text . "$)/fasdfh297452sdikfahzsbgdfa|");
}
function redirect_to_pageid($id) {
$this->load->helper('url');
if (!is_numeric($id))
redirect("main/index");
if ($id < 0)
redirect("main/index");
$this->load->model("common_model");
$pname = $this->common_model->get_page_name_from_id($id);
if ($pname)
redirect("main/index/" . $pname);
else
redirect("main/index");
}
protected function _url_sanitize_name($name) {
//allowed a-z, A-Z, 0-9, _
$name = str_replace(" ","_", $name);
//var_dump($name);
$regex = '/[^A-Za-z0-9_]/';
$name = preg_replace($regex, "", $name);
//var_dump($name);
return $name;
}
protected function _get_unique_file_name($path, $hint) {
$filename = "";
$this->load->helper('file');
$dir = get_filenames($path);
if ($hint) {
//$hint = str_replace(" ","_", $hint);
$hint = $this->_url_sanitize_name($hint);
$h = $hint . ".jpg";
$mid = "";
if ($dir) {
$i = 0;
while (true) {
$ffound = false;
foreach ($dir as $d) {
if ($d == $h) {
$ffound = true;
break;
}
}
if ($ffound) {
$mid = "_" . $i;
$h = $hint . $mid . ".jpg";
} else {
return $hint . $mid;
}
$i++;
}
} else {
return $hint;
}
} else {
if ($dir) {
$max = 0;
foreach ($dir as $d) {
$n = explode(".", $d);
if ($n[0]) {
$name = $n[0];
if (is_numeric($name)) {
$num = intval($name);
if ($num > $max) {
$max = $num;
}
}
}
}
$max++;
return $max;
} else {
return "1";
}
}
return $filename;
}
}

View File

@ -0,0 +1,51 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class V_Model extends CI_Model {
public function __construct()
{
parent::__construct();
}
public function convert_string_all($text) {
$text = $this->escape($text);
$text = $this->convert_le_to_br($text);
$text = $this->convert_bb_to_html($text);
return $text;
}
public function escape($text) {
$text = strip_tags($text);
$text = htmlentities($text, ENT_COMPAT | ENT_HTML5, "UTF-8", true);
$test = htmlspecialchars($text, ENT_COMPAT | ENT_HTML5, "UTF-8", true);
return $text;
}
public function convert_le_to_br($text) {
$text = nl2br($text, false);
return $text;
}
public function convert_bb_to_html($text) {
return $text;
}
protected function _url_sanitize_name($name) {
//allowed a-z, A-Z, 0-9, _
$name = str_replace(" ","_", $name);
//var_dump($name);
$regex = '/[^A-Za-z0-9_]/';
$name = preg_replace($regex, "", $name);
//var_dump($name);
return $name;
}
}

View File

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>

View File

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>

View File

@ -0,0 +1,22 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Common_model extends V_Model
{
function __construct()
{
parent::__construct();
}
function get_page_name_from_id($id) {
$sql = "SELECT * FROM menu WHERE id = ?";
$res = $this->db->query($sql, array($id));
if (!$res->num_rows())
return false;
$res = $res->row_array();
return $res["link"];
}
}

View File

@ -0,0 +1,221 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Admin_model extends V_Model
{
function __construct()
{
parent::__construct();
}
function is_registration_enabled() {
$sql = "SELECT * FROM settings";
$res = $this->db->query($sql);
$res = $res->result_array();
foreach ($res as $r) {
if ($r["name"] == "reg_enabled") {
if ($r["value"] == "true") {
return true;
} else {
return false;
}
}
}
return false;
}
function check_user($username, $password) {
$sql = "SELECT password FROM avxg_users WHERE name = ?";
$res = $this->db->query($sql, array($username));
if ($res->num_rows() <= 0) {
return false;
}
$res = $res->row_array();
if ($res['password'] == $password)
return true;
return false;
}
function create_cookie_session_id() {
$sql = "SELECT * FROM session_links";
$res = $this->db->query($sql);
if ($res->num_rows() <= 0)
return $this->getcsid();
$res->result_array();
$sess_id = "";
$found = false;
while(!found) {
$sess_id = $this->getcsid();
$f = false;
foreach ($res as $r) {
if ($r["cookie_session_id"] == $sess_id) {
$f = true;
break;
}
}
if (!$f) {
$found = true;
}
}
return $sess_id;
}
function getcsid() {
return md5("+41)d" . rand() . "ikZtzdDJU");
}
function get_or_create_session_id($username) {
$sql = "SELECT * FROM avxg_users WHERE name = ?";
$res = $this->db->query($sql, array($username));
if ($res->num_rows() <= 0)
return -1;
$res = $res->row_array();
$sess_id = "";
if ($res['session_id'] == "") {
$sql = "SELECT * FROM avxg_users";
$res2 = $this->db->query($sql);
$res2 = $res2->result_array();
$found = false;
while (!$found) {
$sess_id = md5("77=89$@" + rand() + "99)(!4%)");
$f = false;
foreach ($res2 as $u) {
if ($u["session_id"] == $sess_id) {
$f = true;
break;
}
}
if (!$f) {
$found = true;
}
$sql = "UPDATE avxg_users SET session_id = ? WHERE name = ?";
$this->db->query($sql, array($sess_id, $username));
}
} else {
$sess_id = $res['session_id'];
}
return $sess_id;
}
function register_session($sessionid, $cookie_session_id) {
$sql = "INSERT INTO session_links VALUES(default, ?, ?)";
$this->db->query($sql, array($sessionid, $cookie_session_id));
return true;
}
function login_user($username, $sessionid) {
}
function register_user($username, $password, $email) {
$sql = "SELECT * FROM avxg_users";
$res = $this->db->query($sql);
$res = $res->result_array();
$nametaken = false;
$emailtaken = false;
foreach ($res as $r) {
if ($r["name"] == $username) {
$nametaken = true;
}
if ($r["email"] == $email) {
$emailtaken = true;
}
}
//TODO tell error?
if ($emailtaken || $nametaken)
return;
$sql = "INSERT INTO avxg_users VALUES(default, ?, ?, ?, NULL, NULL, NULL)";
$this->db->query($sql, array($username, $password, $email));
//turn off registration
$sql = "UPDATE settings SET value = 'false' WHERE name LIKE 'reg_enabled'";
$this->db->query($sql);
}
function is_admin($sid) {
$sql = "SELECT * FROM session_links WHERE cookie_session_id = ?";
$res = $this->db->query($sql, array($sid));
if (!$res->num_rows())
return false;
$res = $res->row_array();
$sql = "SELECT * FROM avxg_users WHERE session_id = ?";
$res2 = $this->db->query($sql, array($res["session_id"]));
if (!$res2->num_rows())
return false;
return true;
}
function get_username_sid($sid) {
$sql = "SELECT * FROM session_links WHERE cookie_session_id = ?";
$res = $this->db->query($sql, array($sid));
if (!$res->num_rows())
return "E";
$res = $res->row_array();
$sql = "SELECT * FROM avxg_users WHERE session_id = ?";
$res2 = $this->db->query($sql, array($res["session_id"]));
if (!$res2->num_rows())
return "E2";
$res2 = $res2->row_array();
return $res2["name"];
}
function logout($sid) {
$sql = "DELETE FROM session_links WHERE cookie_session_id = ?";
$this->db->query($sql, array($sid));
}
function logout_all($sid) {
$sql = "SELECT * FROM session_links WHERE cookie_session_id = ?";
$res = $this->db->query($sql, array($sid));
if (!$res->num_rows())
return;
$res = $res->row_array();
$sql = "DELETE FROM session_links WHERE session_id = ?";
$this->db->query($sql, array($res["session_id"]));
}
}

View File

@ -0,0 +1,355 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Content_model extends V_Model
{
public $content_types = array(
1 => "TEXT"
);
function __construct()
{
parent::__construct();
}
function get_page_contents($pageid) {
$sql = "SELECT * FROM page_contents WHERE pageid = ? ORDER BY `order` ASC";
$res = $this->db->query($sql, array($pageid));
return $res->result_array();
}
function get_content_text($id) {
$sql = "SELECT * FROM content_text WHERE id = ?";
$res = $this->db->query($sql, array($id));
if (!$res->num_rows())
return false;
return $res->row_array();
}
function get_content_gallery($id) {
$sql = "SELECT * FROM content_gallery WHERE id = ?";
$res = $this->db->query($sql, array($id));
if (!$res->num_rows())
return false;
return $res->row_array();
}
function get_gallery_data($id) {
$sql = "SELECT * FROM gallery_data WHERE gallery_id = ?";
$res = $this->db->query($sql, array($id));
if (!$res->num_rows())
return false;
return $res->result_array();
}
function get_content_multi_gallery($id) {
$sql = "SELECT * FROM content_multi_gallery WHERE id = ?";
$res = $this->db->query($sql, array($id));
if (!$res->num_rows())
return false;
return $res->row_array();
}
function get_content_multi_gallery_folders($id) {
$sql = "SELECT * FROM multi_gallery_folders WHERE galleryid = ?";
$res = $this->db->query($sql, array($id));
if (!$res->num_rows())
return false;
return $res->result_array();
}
function get_content_text_noformat($id) {
$sql = "SELECT * FROM content_text WHERE id = ?";
$res = $this->db->query($sql, array($id));
//if ($res->num_rows() > 0)
//$res = $res->row_array();
return $res->row_array();
}
function add_page_text($pageid, $message) {
$sql = "SELECT * FROM page_contents WHERE pageid = ? ORDER BY `order` ASC";
$res = $this->db->query($sql, array($pageid));
$nextid = 1;
if ($res->num_rows()) {
$res = $res->result_array();
foreach($res as $e) {
if ($e["order"] > $nextid) {
$nextid = $e["order"];
}
}
$nextid++;
}
$m = $message;
$messagehtmld = $this->convert_string_all($m);
$sql = "INSERT INTO content_text VALUES(DEFAULT, ?, ?)";
$this->db->query($sql, array($messagehtmld, $message));
$sql = "SELECT MAX(id) AS id FROM content_text";
$res = $this->db->query($sql);
if ($res->num_rows()) {
$res = $res->row_array();
$sql = "INSERT INTO page_contents VALUES(DEFAULT, ?, ?, 1, ?)";
$this->db->query($sql, array($pageid, $nextid, $res["id"]));
}
}
function edit_page_text($textid, $message) {
$m = $message;
$messagehtmld = $this->convert_string_all($m);
$sql = "UPDATE content_text SET `text` = ?,`text_noformat` = ? WHERE id = ?";
$this->db->query($sql, array($messagehtmld, $message, $textid));
}
function get_content_types() {
return $content_types;
}
function content_down($pageid, $id) {
$sql = "SELECT * from page_contents WHERE pageid = ?";
$res = $this->db->query($sql, array($pageid));
if (!$res->num_rows())
return;
$res = $res->result_array();
$selected;
foreach ($res as $r) {
if ($r["id"] == $id) {
$selected = $r;
break;
}
}
if (!$selected)
return;
$lower;
foreach ($res as $r) {
if ($r["order"] == $selected["order"] + 1) {
$lower = $r;
break;
}
}
if (!$lower)
return;
$sql = "UPDATE page_contents SET `order` = ? WHERE id = ?";
$this->db->query($sql, array($lower["order"], $selected["id"]));
$this->db->query($sql, array($selected["order"], $lower["id"]));
}
function content_up($pageid, $id) {
$sql = "SELECT * from page_contents WHERE pageid = ?";
$res = $this->db->query($sql, array($pageid));
if (!$res->num_rows())
return;
$res = $res->result_array();
$selected;
foreach ($res as $r) {
if ($r["id"] == $id) {
$selected = $r;
break;
}
}
if (!$selected)
return;
$higher;
foreach ($res as $r) {
if ($r["order"] == $selected["order"] - 1) {
$higher = $r;
break;
}
}
if (!$higher)
return;
$sql = "UPDATE page_contents SET `order` = ? WHERE id = ?";
$this->db->query($sql, array($higher["order"], $selected["id"]));
$this->db->query($sql, array($selected["order"], $higher["id"]));
}
function content_delete($pageid, $id) {
$sql = "SELECT * FROM page_contents WHERE id = ?";
$res = $this->db->query($sql, array($id));
if (!$res->num_rows())
return;
$res = $res->row_array();
$sql = "DELETE FROM page_contents WHERE id = ?";
$this->db->query($sql, array($id));
$sql = "SELECT * FROM page_contents WHERE pageid = ?";
$ares = $this->db->query($sql, array($id));
if (!$ares->num_rows())
return;
$ares = $ares->result_array();
//TODO make a concatenated query
foreach ($ares as $r) {
if ($r["order"] > $res["order"]) {
$sql = "UPDATE page_contents SET `order` = ? WHERE id = ?";
$this->db->query($sql, array($r["order"] - 1, $r["id"]));
}
}
switch ($res["content_type"]) {
case 1: //text
$sql = "DELETE FROM content_text WHERE id = ?";
$this->db->query($sql, array($res["content_id"]));
break;
}
}
function add_gallery($pageid, $name, $description) {
$link = "";
if ($name) {
$link = _url_sanitize_name($name);
$sql = "SELECT * FROM content_gallery WHERE link LIKE ?";
$res = $this->db->query($sql, array($link));
if ($res->num_rows())
$link = "";
}
$sql = "INSERT INTO content_gallery VALUES(default, ?, ?, ?, default)";
$this->db->query($sql, array($name, $link, $description));
$sql = "SELECT MAX(id) AS id FROM content_gallery";
$res = $this->db->query($sql);
$res = $res->row_array();
$id = $res["id"];
if (!$name) {
$sql = "UPDATE content_gallery SET name = ? WHERE id = ?";
$this->db->query($sql, array($id, $id));
}
if (!$link) {
$sql = "UPDATE content_gallery SET link = ? WHERE id = ?";
$this->db->query($sql, array($id, $id));
}
$order = 1;
$sql = "SELECT MAX(`order`) AS `order` FROM page_contents WHERE pageid = ?";
$res = $this->db->query($sql, array($pageid));
if ($res->num_rows()) {
$res = $res->row_array();
$order = $res["order"];
$order++;
}
$sql = "INSERT INTO page_contents VALUES(default, ?, ?, 3, ?)";
$this->db->query($sql, array($pageid, $order, $id));
}
function add_gallery_image($galleryid, $name, $description, $img, $thumb, $orig_img) {
$link = "";
if ($name) {
$link = $this->_url_sanitize_name($name);
$sql = "SELECT * FROM gallery_data WHERE gallery_id = ? AND link LIKE ?";
$res = $this->db->query($sql, array($galleryid, $link));
if ($res->num_rows())
$link = "";
}
$sql = "INSERT INTO gallery_data VALUES(default, ?, ?, ?, ?, ?, ?, ?)";
$this->db->query($sql, array($galleryid, $name, $link, $description, $img, $thumb, $orig_img));
if (!$link) {
$sql = "UPDATE gallery_data SET link = id ORDER BY id DESC LIMIT 1";
$this->db->query($sql);
}
}
function add_multi_gallery($pageid, $name, $description) {
$link = "";
if ($name) {
$link = $this->_url_sanitize_name($name);
$sql = "SELECT * FROM content_multi_gallery WHERE id = ? AND link LIKE ?";
$res = $this->db->query($sql, array($pageid, $link));
if ($res->num_rows())
$link = "";
}
$sql = "INSERT INTO content_multi_gallery VALUES(default, ?, ?, ?, default)";
$this->db->query($sql, array($name, $link, $description));
$sql = "SELECT MAX(id) AS id FROM content_multi_gallery";
$res = $this->db->query($sql);
$res = $res->row_array();
$id = $res["id"];
if (!$name) {
$sql = "UPDATE content_multi_gallery SET name = ? WHERE id = ?";
$this->db->query($sql, array($id, $id));
}
if (!$link) {
$sql = "UPDATE content_multi_gallery SET link = ? WHERE id = ?";
$this->db->query($sql, array($id, $id));
}
$order = 1;
$sql = "SELECT MAX(`order`) AS `order` FROM page_contents WHERE pageid = ?";
$res = $this->db->query($sql, array($pageid));
if ($res->num_rows()) {
$res = $res->row_array();
$order = $res["order"];
$order++;
}
$sql = "INSERT INTO page_contents VALUES(default, ?, ?, 4, ?)";
$this->db->query($sql, array($pageid, $order, $id));
}
}

View File

@ -0,0 +1,149 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Gallery_model extends V_Model
{
function __construct()
{
parent::__construct();
}
function get_gallery_info($galleryname) {
$sql = "SELECT * FROM content_gallery WHERE link LIKE ?";
$res = $this->db->query($sql, array($galleryname));
if ($res->num_rows())
return $res->row_array();
$sql = "SELECT * FROM content_gallery LIMIT 1";
$res = $this->db->query($sql);
if ($res->num_rows())
return $res->row_array();
}
function get_gallery_data($galleryid) {
$sql = "SELECT * FROM gallery_data WHERE gallery_id = ?";
$res = $this->db->query($sql, array($galleryid));
if ($res->num_rows())
return $res->result_array();
return null;
}
function get_gallery_image_data($galleryid, $imagename) {
}
function get_first_gallery_name() {
}
function get_fake_page_and_id_from_gallery_name() {
//let's just return false for now
return false;
/*
$sql = "SELECT * FROM content_gallery LIMIT 1";
$res = $this->db->query($sql);
$res = $res->row_array();
$id = $res["id"];
$sql = "SELECT * FROM page_contents WHERE content_id = ? AND content_type = 3";
$res = $this->db->query($sql, array($id));
$res = $res->row_array();
$pageid = $res["pageid"];
$sql = "SELECT * FROM menu WHERE id = ?";
$res = $this->db->query($sql, array($pageid));
$res = $res->row_array();
$link = $res["link"];
$d["page"] = $link;
$d["pageid"] = $pageid;
return $d;*/
}
function get_page_and_id_from_gallery_link($galleryname) {
$sql = "SELECT * FROM content_gallery WHERE link = ?";
$res = $this->db->query($sql, array($galleryname));
if (!$res->num_rows())
return $this->get_fake_page_and_id_from_gallery_name();
$res = $res->row_array();
$id = $res["id"];
$sql = "SELECT * FROM page_contents WHERE content_id = ? AND content_type = 3";
$res = $this->db->query($sql, array($id));
if (!$res->num_rows())
return $this->get_fake_page_and_id_from_gallery_name();
$res = $res->row_array();
$pageid = $res["pageid"];
$sql = "SELECT * FROM menu WHERE id = ?";
$res = $this->db->query($sql, array($pageid));
if (!$res->num_rows())
return $this->get_fake_page_and_id_from_gallery_name();
$res = $res->row_array();
$link = $res["link"];
$d["page"] = $link;
$d["pageid"] = $pageid;
return $d;
}
function get_gallery_name($id) {
$sql = "SELECT * FROM content_gallery WHERE id = ?";
$res = $this->db->query($sql, array($id));
if (!$res->num_rows())
return $this->get_first_gallery_name();
$res = $res->row_array();
return $res["name"];
}
function get_gallery_link($id) {
$sql = "SELECT * FROM content_gallery WHERE id = ?";
$res = $this->db->query($sql, array($id));
if (!$res->num_rows())
return $this->get_first_gallery_name();
$res = $res->row_array();
return $res["link"];
}
function del_gallery_image_from_db($id) {
$id = intval($id);
$sql = "SELECT * FROM gallery_data WHERE id = ?";
$res = $this->db->query($sql, array($id));
if (!$res->num_rows())
return false;
$res = $res->row_array();
$sql = "DELETE FROM gallery_data WHERE id = ?";
$this->db->query($sql, array($id));
return $res;
}
}

View File

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>

View File

@ -0,0 +1,57 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Menu_model extends V_Model
{
function __construct()
{
parent::__construct();
}
function is_page_valid($page) {
$sql = "SELECT * FROM menu";
$res = $this->db->query($sql);
if (!$res->num_rows())
return false;
$res = $res->result_array();
foreach ($res as $m) {
if ($m["link"] == $page) {
return true;
}
}
return false;
}
function getFirstMenuItem() {
$sql = "SELECT * FROM menu WHERE id = 1";
$q = $this->db->query($sql);
return $q->row_array();
}
function getBaseMenuData() {
$sql = "SELECT * FROM menu ORDER BY menu.order ASC";
$q = $this->db->query($sql);
return $q->result_array();
}
function getPageId($page) {
$sql = "SELECT * FROM menu WHERE name = ?";
$q = $this->db->query($sql, array($page));
if ($q->num_rows())
$q = $q->row_array();
else
return -1;
return $q["id"];
}
}

View File

@ -0,0 +1,260 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Multi_gallery_model extends V_Model
{
function __construct()
{
parent::__construct();
}
function add_multi_gallery_folder($galleryid, $name, $description, $filename) {
$link = "";
if ($name) {
$link = $this->_url_sanitize_name($name);
$sql = "SELECT * FROM multi_gallery_folders WHERE galleryid = ? AND link LIKE ?";
$res = $this->db->query($sql, array($galleryid, $link));
if ($res->num_rows())
$link = "";
}
$sql = "INSERT INTO multi_gallery_folders VALUES(default, ?, ?, ?, ?, ?, ?, default)";
$this->db->query($sql, array($galleryid, $name, $link, $description, $filename, 0));
if (!$link) {
$sql = "UPDATE multi_gallery_folders SET link = id ORDER BY id DESC LIMIT 1";
$this->db->query($sql);
}
}
function get_content_multi_gallery($id) {
$sql = "SELECT * FROM content_multi_gallery WHERE id = ?";
$res = $this->db->query($sql, array($id));
if (!$res->num_rows())
return false;
return $res->row_array();
}
function get_content_multi_gallery_folders($id) {
$sql = "SELECT * FROM multi_gallery_folders WHERE galleryid = ?";
$res = $this->db->query($sql, array($id));
if (!$res->num_rows())
return false;
return $res->result_array();
}
function get_multi_gallery_folder($gallery, $folder) {
//is folder is a number, it's the id, no need for $gallery
if (is_numeric($folder)) {
$sql = "SELECT * FROM multi_gallery_folders WHERE id = ?";
$res = $this->db->query($sql, array($folder));
if (!$res->num_rows())
return false;
return $res->row_array();
} else {
$sql = "";
$res = null;
if (is_numeric($gallery)) {
$sql = "SELECT * FROM multi_gallery_folders WHERE link LIKE ? AND galleryid = ?";
$res = $this->db->query($sql, array($folder, $gallery));
} else {
$sql = "SELECT * FROM content_multi_gallery WHERE link LIKE ?";
$res = $this->db->query($sql, array($gallery));
if (!$res->num_rows())
return false;
$res = $res->row_array();
$sql = "SELECT * FROM multi_gallery_folders WHERE link LIKE ? AND galleryid = ?";
$res = $this->db->query($sql, array($folder, $res["id"]));
}
if (!$res->num_rows())
return false;
return $res->row_array();
}
}
function get_multi_gallery_folder_images($folderid) {
$sql = "SELECT * FROM multi_gallery_data WHERE folderid = ?";
$res = $this->db->query($sql, array($folderid));
if (!$res->num_rows())
return false;
return $res->result_array();
}
function add_gallery_image($folderid, $name, $description, $thumb, $mid, $big, $orig) {
$link = "";
if ($name) {
$link = $this->_url_sanitize_name($name);
$sql = "SELECT * FROM multi_gallery_data WHERE folderid = ? AND link LIKE ?";
$res = $this->db->query($sql, array($folderid, $name));
if ($res->num_rows())
$link = "";
}
$sql = "INSERT INTO multi_gallery_data VALUES(default, ?, ?, ?, ?, ?, ?, ?, ?)";
$this->db->query($sql, array($folderid, $name, $link, $description, $thumb, $mid, $big, $orig));
if (!$name) {
$sql = "UPDATE multi_gallery_data SET name = id ORDER BY id DESC LIMIT 1";
$this->db->query($sql);
}
if (!$link) {
$sql = "UPDATE multi_gallery_data SET link = id ORDER BY id DESC LIMIT 1";
$this->db->query($sql);
}
}
function get_gallery_name($id) {
$sql = "SELECT * FROM content_multi_gallery WHERE id = ?";
$res = $this->db->query($sql, array($id));
if (!$res->num_rows())
return "";
$res = $res->row_array();
return $res["link"];
}
function get_folder_name($id) {
$sql = "SELECT * FROM multi_gallery_folders WHERE id = ?";
$res = $this->db->query($sql, array($id));
if (!$res->num_rows())
return "";
$res = $res->row_array();
return $res["link"];
}
function del_image_from_db($imageid) {
$imageid = intval($imageid);
$sql = "SELECT * FROM multi_gallery_data WHERE id = ?";
$res = $this->db->query($sql, array($imageid));
if (!$res->num_rows())
return false;
$res = $res->row_array();
$sql = "DELETE FROM multi_gallery_data WHERE id = ?";
$this->db->query($sql, array($imageid));
return $res;
}
//TODO are any of this needed?:
function get_fake_page_and_id_from_gallery_name() {
//let's just return false for now
return false;
/*
$sql = "SELECT * FROM content_gallery LIMIT 1";
$res = $this->db->query($sql);
$res = $res->row_array();
$id = $res["id"];
$sql = "SELECT * FROM page_contents WHERE content_id = ? AND content_type = 3";
$res = $this->db->query($sql, array($id));
$res = $res->row_array();
$pageid = $res["pageid"];
$sql = "SELECT * FROM menu WHERE id = ?";
$res = $this->db->query($sql, array($pageid));
$res = $res->row_array();
$link = $res["link"];
$d["page"] = $link;
$d["pageid"] = $pageid;
return $d;*/
}
function get_page_and_id_from_gallery_name($galleryname) {
$id = 0;
if (!is_numeric($galleryname)) {
$sql = "SELECT * FROM content_multi_gallery WHERE link = ?";
$res = $this->db->query($sql, array($galleryname));
if (!$res->num_rows())
return $this->get_fake_page_and_id_from_gallery_name();
$res = $res->row_array();
$id = $res["id"];
} else {
$id = $galleryname;
}
$sql = "SELECT * FROM page_contents WHERE content_id = ? AND content_type = 4";
$res = $this->db->query($sql, array($id));
if (!$res->num_rows())
return $this->get_fake_page_and_id_from_gallery_name();
$res = $res->row_array();
$pageid = $res["pageid"];
$sql = "SELECT * FROM menu WHERE id = ?";
$res = $this->db->query($sql, array($pageid));
if (!$res->num_rows())
return $this->get_fake_page_and_id_from_gallery_name();
$res = $res->row_array();
$link = $res["link"];
$d["page"] = $link;
$d["pageid"] = $pageid;
return $d;
}
function get_page_name_from_gallery_id($galleryid) {
$sql = "SELECT * FROM page_contents WHERE content_id = ? AND content_type = 4";
$res = $this->db->query($sql, array($galleryid));
if (!$res->num_rows())
return "";
$res = $res->row_array();
$pageid = $res["pageid"];
$sql = "SELECT * FROM menu WHERE id = ?";
$res = $this->db->query($sql, array($pageid));
if (!$res->num_rows())
return "";
$res = $res->row_array();
return $res["link"];
}
}

View File

@ -0,0 +1,52 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
$url = "";
if ($mode == "add") {
$url = site_url("admin/addgallery/" . $pageid);
}
if ($mode == "edit") {
$url = site_url("admin/editgallery/" . $contentid);
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="<?=base_url("css/admin.css") ?>">
<?php if ($mode == "edit"): ?>
<title>Galéria Szerkesztése</title>
<?php endif; ?>
<?php if ($mode == "add"): ?>
<title>Galéria hozzáadása</title>
<?php endif; ?>
</head>
<body>
<div class="topspacer"></div>
<div class="galleryspacer"></div>
<div class="addgallerybox"> <?php if ($mode == "edit"): ?>
Galéria Szerkesztése
<?php endif; ?>
<?php if ($mode == "add"): ?>
Galéria hozzáadása
<?php endif; ?><br><br>
<form action="<?=$url; ?>" method="post">
Galéria neve (Nem kötelező):<br>
<input name="name">
<?php if ($mode == "edit"): ?>
<?php endif; ?>
<br>
Leírás: (Nem kötelező):<br>
<textarea name="description" rows="10" cols="60">
<?php if ($mode == "edit"): ?>
<?php endif; ?>
</textarea><br><br>
<input type="submit" value="Küld">
</form>
</div>
<div class="fc"></div>
</body>
</html>

View File

@ -0,0 +1,54 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
$url = "";
if ($mode == "add") {
$url = site_url("admin/doaddgalleryimage/" . $id);
}
if ($mode == "edit") {
$url = site_url("admin/editgallery/" . $id);
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="<?=base_url("css/admin.css") ?>">
<?php if ($mode == "edit"): ?>
<title>Kép hozzáadása</title>
<?php endif; ?>
<?php if ($mode == "add"): ?>
<title>Kép hozzáadása</title>
<?php endif; ?>
</head>
<body>
<div class="topspacer"></div>
<div class="imgaddspacer"></div>
<div class="imgaddbox">
<?php echo form_open_multipart($url); ?>
<?php if ($mode == "edit"): ?>
Kép szerkesztése:
<?php endif; ?>
<?php if ($mode == "add"): ?>
Kép hozzáadása:
<?php endif; ?><br><br>
Kép neve (Nem kötelező):<br>
<input name="name">
<?php if ($mode == "edit"): ?>
<?php endif; ?>
<br>
Leírás: (Nem kötelező):<br>
<textarea name="description" rows="10" cols="60">
<?php if ($mode == "edit"): ?>
<?php endif; ?>
</textarea><br><br>
<input type="file" name="img" id="img" accept="image/jpeg, image/png, image/gif"><br><br>
<input type="submit" value="Küld">
</form>
</div>
<div class="fc"></div>
</body>
</html>

View File

@ -0,0 +1,52 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
$url = "";
if ($mode == "add") {
$url = site_url("admin/addmultigallery/" . $pageid);
}
if ($mode == "edit") {
$url = site_url("admin/editmultigallery/" . $contentid);
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="<?=base_url("css/admin.css") ?>">
<?php if ($mode == "edit"): ?>
<title>Galéria Szerkesztése</title>
<?php endif; ?>
<?php if ($mode == "add"): ?>
<title>Galéria hozzáadása</title>
<?php endif; ?>
</head>
<body>
<div class="topspacer"></div>
<div class="galleryspacer"></div>
<div class="addgallerybox"> <?php if ($mode == "edit"): ?>
Galéria Szerkesztése
<?php endif; ?>
<?php if ($mode == "add"): ?>
Galéria hozzáadása
<?php endif; ?><br><br>
<form action="<?=$url; ?>" method="post">
Galéria neve (Nem kötelező):<br>
<input name="name">
<?php if ($mode == "edit"): ?>
<?php endif; ?>
<br>
Leírás: (Nem kötelező):<br>
<textarea name="description" rows="10" cols="60">
<?php if ($mode == "edit"): ?>
<?php endif; ?>
</textarea><br><br>
<input type="submit" value="Küld">
</form>
</div>
<div class="fc"></div>
</body>
</html>

View File

@ -0,0 +1,60 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
$url = "";
if ($mode == "add") {
$url = site_url("admin/addmultigalleryfolder/" . $id);
}
if ($mode == "edit") {
$url = site_url("admin/editmultigalleryfolder/" . $id);
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="<?=base_url("css/admin.css") ?>">
<?php if ($mode == "edit"): ?>
<title>Mappa szerkesztése</title>
<?php endif; ?>
<?php if ($mode == "add"): ?>
<title>Mappa hozzáadása</title>
<?php endif; ?>
</head>
<body>
<div class="topspacer"></div>
<div class="imgaddspacer"></div>
<div class="imgaddbox">
<?php echo form_open_multipart($url); ?>
<?php if ($mode == "edit"): ?>
Mappa szerkesztése:
<?php endif; ?>
<?php if ($mode == "add"): ?>
Mappa hozzáadása:
<?php endif; ?><br><br>
Mappa neve (Nem kötelező):<br>
<input name="name">
<?php if ($mode == "edit"): ?>
<?php endif; ?>
<br>
Mappa leírása: (Nem kötelező):<br>
<textarea name="description" rows="10" cols="60">
<?php if ($mode == "edit"): ?>
<?php endif; ?>
</textarea><br><br>
Kép:
<?php if ($mode == "edit"): ?>
Csak csere esetén kell választani!
<?php endif; ?>
<br>
<input type="file" name="img" id="img" accept="image/jpeg, image/png, image/gif"><br>
<br>
<input type="submit" value="Küld">
</form>
</div>
<div class="fc"></div>
</body>
</html>

View File

@ -0,0 +1,54 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
$url = "";
if ($mode == "add") {
$url = site_url("admin/addmultigalleryimage/" . $id . "/" . $folderid);
}
if ($mode == "edit") {
$url = site_url("admin/editmultigalleryimage/" . $id . "/" . $folderid);
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="<?=base_url("css/admin.css") ?>">
<?php if ($mode == "edit"): ?>
<title>Kép hozzáadása</title>
<?php endif; ?>
<?php if ($mode == "add"): ?>
<title>Kép hozzáadása</title>
<?php endif; ?>
</head>
<body>
<div class="topspacer"></div>
<div class="imgaddspacer"></div>
<div class="imgaddbox">
<?php echo form_open_multipart($url); ?>
<?php if ($mode == "edit"): ?>
Kép szerkesztése:
<?php endif; ?>
<?php if ($mode == "add"): ?>
Kép hozzáadása:
<?php endif; ?><br><br>
Kép neve (Nem kötelező):<br>
<input name="name">
<?php if ($mode == "edit"): ?>
<?php endif; ?>
<br>
Leírás: (Nem kötelező):<br>
<textarea name="description" rows="10" cols="60">
<?php if ($mode == "edit"): ?>
<?php endif; ?>
</textarea><br><br>
<input type="file" name="img" id="img" accept="image/jpeg, image/png, image/gif"><br><br>
<input type="submit" value="Küld">
</form>
</div>
<div class="fc"></div>
</body>
</html>

View File

@ -0,0 +1,30 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
?>
<!DOCTYPE html>
<html lang="hu-HU">
<html>
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="<?=base_url("css/admin.css") ?>">
<title>Admin</title>
</head>
<body>
<div class="topspacer"></div>
<div class="spacer"></div>
<div class="loginbox">
Belépés:<br><br>
<form action="<?=site_url("admin/dologin"); ?>" method="POST">
Felhasználónév:<br>
<input type="text" name="user"><br>
Jelszó:<br>
<input type="password" name="pass"><br><br>
<input type="submit" value="Küld"><br>
</form>
<?php if ($reg_enabled): ?>
<a href="<?=site_url("admin/register"); ?>">Regisztráció</a>
<?php endif; ?>
</div>
<div class="fc"></div>
</body>
</html>

View File

@ -0,0 +1,30 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
?>
<html lang="hu-HU">
<html>
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="<?=base_url("css/admin.css") ?>">
<title>Admin</title>
</head>
<body>
<div class="topspacer"></div>
<div class="regspacer"></div>
<div class="registerbox">
Regisztráció: <br><br>
<form action="<?=site_url("admin/doregister"); ?>" method="POST">
Felhasználónév (legalább 4 karakter):<br>
<input type="text" name="user"><br>
Jelszó (legalább 5 karakter):<br>
<input type="password" name="pass"><br>
Jelszó megint:<br>
<input type="password" name="pass2"><br>
e-mail cím:<br>
<input type="text" name="email"><br><br>
<input type="submit" value="Küld">
</form>
</div>
<div class="fc"></div>
</body>
</html>

View File

@ -0,0 +1,40 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
$url = "";
if ($mode == "add") {
$url = site_url("admin/addtext/" . $pageid);
}
if ($mode == "edit") {
$url = site_url("admin/edittext/" . $contentid);
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="<?=base_url("css/admin.css") ?>">
<?php if ($mode == "edit"): ?>
<title>Szöveg Szerkesztése</title>
<?php endif; ?>
<?php if ($mode == "add"): ?>
<title>Szöveg hozzáadása</title>
<?php endif; ?>
</head>
<body>
<div class="texteditbox">
<form action="<?=$url; ?>" method="post">
<textarea name="message" rows="30" cols="120">
<?php if ($mode == "edit"): ?>
<?=$text; ?>
<?php endif; ?>
</textarea>
<br><br>
<input type="submit" value="Küld">
</form>
</div>
</body>
</html>

View File

@ -0,0 +1,17 @@
<?php defined('BASEPATH') OR exit('No direct script access allowed'); ?>
<div class="content">
<?php if (isset($htmld) && sizeof($htmld) > 0): ?>
<?php for ($i = 0; $i < sizeof($htmld); $i++): ?>
<div class="entry">
<?=$htmld[$i]; ?>
</div>
<?php endfor; ?>
<?php endif; ?>
<?php if ($is_admin): ?>
<div class="entry">
<a href="<?=site_url(); ?>/admin/addcontent/<?=$pageid ?>/1">[Szövegdoboz hozzáadása]</a>
<a href="<?=site_url(); ?>/admin/addcontent/<?=$pageid ?>/3">[Galéria hozzáadása]</a>
<a href="<?=site_url(); ?>/admin/addcontent/<?=$pageid ?>/4">[Többmappás Galéria hozzáadása]</a>
</div>
<?php endif; ?>
</div>

View File

@ -0,0 +1,13 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
?>
<div class="footer">
<?php if (!$is_admin): ?>
<a href="<?=site_url('/admin/index/'); ?>">Admin</a>
<?php else: ?>
<a href="<?=site_url('/admin/logout/'); ?>">Kilépés</a> <a href="<?=site_url('/admin/logoutall/'); ?>">Kilépés minden gépről</a>
<?php endif; ?>
<div>
</div>
</body>
</html>

View File

@ -0,0 +1,87 @@
<?php defined('BASEPATH') OR exit('No direct script access allowed'); ?>
<?php $this->load->helper("text"); ?>
<div class="gallerycontent">
<a href="<?=site_url("main/index/" . $page); ?>">
<div class="back">
<-- Vissza
</div>
</a>
<?php if ($gallery_info["name"] && !is_numeric($gallery_info["name"])): ?>
<div class="galleryname">
<?=$gallery_info["name"]; ?>
</div>
<?php endif; ?>
<?php if ($gallery_info["description"]): ?>
<div class="gallerydescription">
<?=$gallery_info["description"]; ?>
</div>
<?php endif; ?>
<div class="gallerymaindiv">
<div class="galleryleft">
<a href="<?=base_url("img/gallery/orig/" . $curr_pic["img"]); ?>" id="bigimageopen">
<div class="gallerybigimage">
<img src="<?=base_url("img/gallery/mid/" . $curr_pic["img"]); ?>" width=470>
</div>
</a>
<?php if ($curr_pic["name"]): ?>
<div class="galleryimagename">
<?=$curr_pic["name"]; ?>
</div>
<?php endif; ?>
<?php if ($curr_pic["description"]): ?>
<div class="galleryimagedescription">
<?=$curr_pic["description"]; ?>
</div>
<?php endif; ?>
<?php if ($is_admin): ?>
<div class="galleryimagename">
<a href="<?=site_url("admin/delgalleryimage/" . $gallery_info["link"] . "/" . $curr_pic["id"]); ?>">Törlés</a>
</div>
<?php endif; ?>
</div>
<div class="galleryright">
<?php if ($gallery_data): ?>
<?php $i = 1; ?>
<div class="gallerysrow">
<?php foreach ($gallery_data as $gd): ?>
<a href="<?=site_url("gallery/view/" . $gallery_info["link"] . "/" . $gd["link"]); ?>">
<div class="galleryimagecontainer">
<div class="galleryimage">
<img src="<?=base_url("img/gallery/thumb/" . $gd["thumb"]); ?>" width=155 height=155>
</div>
<div class="gallerythumbdesc">
<?php if ($gd["name"]): ?>
<?=ellipsize($gd["name"], 20); ?>
<?php endif; ?>
</div>
<div class="fc"></div>
</div>
</a>
<?php if ($i % 3 == 0): ?>
</div>
<div class="gallerysrow">
<?php endif; ?>
<?php $i++; ?>
<?php endforeach; ?>
</div>
<?php endif; ?>
<?php if ($is_admin): ?>
<div class="galleryrow">
<a href="<?=site_url("admin/addgalleryimage/" . $gallery_info["id"]) ?>">
<div class="galleryimagecontainer">
<div class="galleryimage">
<img src="<?=base_url("img/plus.png") ?>" alt="Kép Hozzáadás" width="155" height="155">
</div>
<div class="gallerythumbdesc">
Kép Hozzáadása
</div>
<div class="fc"></div>
</div>
</a>
</div>
<?php endif; ?>
<div class="fc"></div>
</div>
<div class="fc"></div>
</div>
</div>

View File

@ -0,0 +1,69 @@
<?php defined('BASEPATH') OR exit('No direct script access allowed'); ?>
<?php $this->load->helper("text"); ?>
<?php if ($is_admin): ?>
<div class="info">
<?php if ($i != 0): ?>
<a href="<?=site_url("admin/contentup/" . $link["pageid"] . "/" . $link["id"]); ?>">Fel</a>
<?php else: ?>
Fel
<?php endif; ?>
<?php if (!($i == $contsize - 1)): ?>
<a href="<?=site_url("admin/contentdown/" . $link["pageid"] . "/" . $link["id"]); ?>">Le</a>
<?php else: ?>
Le
<?php endif; ?>
<a href="<?=site_url("admin/editcontent/" . $link["pageid"] . "/" . $link["content_type"] . "/" . $link["content_id"]); ?>">Szerkeszt</a>
<a href="<?=site_url("admin/deletecontent/" . $link["pageid"] . "/" . $link["id"]); ?>">Töröl</a><br>
</div>
<?php endif; ?>
<div class="info">
<?php if ($data["main"]["name"] && !is_numeric($data["main"]["name"])): ?>
<?=$data["main"]["name"]; ?><br>
<?php endif; ?>
<?php if ($data["main"]["description"]): ?>
<?=$data["main"]["description"]; ?><br>
<?php endif; ?>
<?php if ($is_admin): ?>
<br><br>
<?php endif; ?>
</div>
<div class="imgboxes">
<?php if ($data["data"]): ?>
<?php $i = 1; ?>
<div class="galleryrow">
<?php foreach ($data["data"] as $d): ?>
<div class="imgbox">
<div class="imgboximgdiv">
<a href="<?=site_url("gallery/view/" . $data["main"]["link"] . "/" . $d["link"]); ?>">
<img src="<?=base_url("img/gallery/thumb/" . $d["thumb"]); ?>" alt="<?php if ($d["name"]) echo $d["name"]; ?>" width="155" height="155">
</a>
</div>
<div class="imgboxtextdiv">
<?php if ($d["name"] && !is_numeric($d["name"])): ?>
<?=ellipsize($d["name"], 20); ?>
<?php endif; ?>
</div>
</div>
<?php if ($i % 5 == 0): ?>
</div>
<div class="galleryrow">
<?php endif; ?>
<?php $i++; ?>
<?php endforeach; ?>
</div>
<?php endif; ?>
<?php if ($is_admin): ?>
<div class="galleryrow">
<div class="imgbox">
<div class="imgboximgdiv">
<a href="<?=site_url("admin/addgalleryimage/" . $link["content_id"]) ?>">
<img src="<?=base_url("img/plus.png") ?>" alt="Kép Hozzáadás" width="155" height="155">
</a>
</div>
<div class="imgboxtextdiv">
Kép Hozzáadása
</div>
</div>
</div>
<?php endif; ?>
</div>

View File

@ -0,0 +1,19 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
?>
<!DOCTYPE html>
<html lang="hu-HU">
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="<?=base_url("css/base.css") ?>">
<link rel="shortcut icon" type="image/png" href="<?=base_url("favico.png") ?>"/>
<?php if ($type == "gallery"): ?>
<script src="<?=base_url("js/jquery.js"); ?>"></script>
<script src="<?=base_url("js/gallery.js"); ?>"></script>
<?php endif; ?>
<title></title>
</head>
<body>
<div class="banner">
<img src="<?=base_url("img/banner.jpg"); ?>"></img>
</div>

View File

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>

View File

@ -0,0 +1,8 @@
<?php defined('BASEPATH') OR exit('No direct script access allowed'); ?>
<div class="menu">
<?php foreach ($menu as $row): ?>
<?php if ($row["link"] != $pageid) echo '<a href="' . site_url('/main/index/' . $row["link"]) . '">'; ?><div class="menuentry<?php if ($row["double"]) echo " menuentrydouble "; ?><?php if ($pageid == $row["link"]) echo " menuentryselected"; ?>"><?=$row["name"]; ?></div><?php if ($row["order"] != $pageid) echo "</a>"; ?>
<?php endforeach; ?>
</div>

View File

@ -0,0 +1,94 @@
<?php defined('BASEPATH') OR exit('No direct script access allowed'); ?>
<?php $this->load->helper("text"); ?>
<div class="gallerycontent">
<a href="<?=site_url("main/index/" . $page); ?>">
<div class="back">
<-- Vissza
</div>
</a>
<?php if ($gallery_info["name"] && !is_numeric($gallery_info["name"])): ?>
<div class="galleryname">
<?=$gallery_info["name"]; ?>
</div>
<?php endif; ?>
<?php if ($gallery_info["description"]): ?>
<div class="gallerydescription">
<?=$gallery_info["description"]; ?>
</div>
<?php endif; ?>
<div class="gallerymaindiv">
<div class="galleryleft">
<?php if ($curr_pic): ?>
<a href="<?=base_url("img/mgallery/big/" . $curr_pic["big"]); ?>" id="bigimageopen">
<div class="gallerybigimage">
<img src="<?=base_url("img/mgallery/mid/" . $curr_pic["mid"]); ?>" alt="<?=$curr_pic["name"]; ?>" width=470>
</div>
</a>
<?php else: ?>
<div class="gallerybigimage">
<br><br>
Ebben a mappában jelenleg nincs kép!
<br><br>
</div>
<?php endif; ?>
<?php if ($curr_pic["name"] && !is_numeric($curr_pic["name"])): ?>
<div class="galleryimagename">
<?=$curr_pic["name"]; ?>
</div>
<?php endif; ?>
<?php if ($curr_pic["description"]): ?>
<div class="galleryimagedescription">
<?=$curr_pic["description"]; ?>
</div>
<?php endif; ?>
<?php if ($is_admin && $curr_pic): ?>
<div class="galleryimagename">
<a href="<?=site_url("admin/delmultigalleryimage/" . $gallery_info["galleryid"] . "/" . $gallery_info["name"] . "/" . $curr_pic["id"]); ?>">Törlés</a>
</div>
<?php endif; ?>
</div>
<div class="galleryright">
<?php if ($gallery_data): ?>
<div class="mgallerysrow">
<?php $i = 1; ?>
<?php foreach ($gallery_data as $gd): ?>
<a href="<?=site_url("mgallery/view/" . $galleryname . "/" . $gallery_info["link"] . "/" . $gd["link"]); ?>">
<div class="galleryimagecontainer">
<div class="galleryimage">
<img src="<?=base_url("img/mgallery/thumb/" . $gd["thumb"]); ?>" alt="<?=$gd["name"]; ?>" width=155 height=155>
</div>
<div class="gallerythumbdesc">
<?php if ($gd["name"] && !is_numeric($gd["name"])): ?>
<?=ellipsize($gd["name"], 18); ?>
<?php endif; ?>
</div>
</div>
</a>
<?php if ($i % 3 == 0): ?>
</div>
<div class="mgallerysrow">
<?php endif; ?>
<?php $i++; ?>
<?php endforeach; ?>
</div>
<?php endif; ?>
<?php if ($is_admin): ?>
<div class="mgallerysrow">
<a href="<?=site_url("admin/addmultigalleryimage/" . $gallery_info["galleryid"] . "/" . $gallery_info["id"]) ?>">
<div class="galleryimagecontainer">
<div class="galleryimage">
<img src="<?=base_url("img/plus.png") ?>" alt="Kép Hozzáadás" width="155" height="155">
</div>
<div class="gallerythumbdesc">
Kép Hozzáadása
</div>
<div class="fc"></div>
</div>
</a>
</div>
<?php endif; ?>
<div class="fc"></div>
</div>
<div class="fc"></div>
</div>
</div>

View File

@ -0,0 +1,63 @@
<?php defined('BASEPATH') OR exit('No direct script access allowed'); ?>
<?php $this->load->helper("text"); ?>
<?php if ($is_admin): ?>
<div class="info">
<?php if ($i != 0): ?>
<a href="<?=site_url("admin/contentup/" . $link["pageid"] . "/" . $link["id"]); ?>">Fel</a>
<?php else: ?>
Fel
<?php endif; ?>
<?php if (!($i == $contsize - 1)): ?>
<a href="<?=site_url("admin/contentdown/" . $link["pageid"] . "/" . $link["id"]); ?>">Le</a>
<?php else: ?>
Le
<?php endif; ?>
<a href="<?=site_url("admin/editcontent/" . $link["pageid"] . "/" . $link["content_type"] . "/" . $link["content_id"]); ?>">Szerkeszt</a>
<a href="<?=site_url("admin/deletecontent/" . $link["pageid"] . "/" . $link["id"]); ?>">Töröl</a><br>
</div>
<?php endif; ?>
<div class="info">
<?php if ($data["main"]["name"] && !is_numeric($data["main"]["name"])): ?>
<?=$data["main"]["name"]; ?><br>
<?php endif; ?>
<?php if ($data["main"]["description"]): ?>
<?=$data["main"]["description"]; ?><br>
<?php endif; ?>
<?php if ($is_admin): ?>
<br><br>
<?php endif; ?>
</div>
<div class="imgboxes">
<?php if ($data["folders"]): ?>
<?php foreach ($data["folders"] as $d): ?>
<div class="imgbox">
<div class="imgboximgdiv">
<a href="<?=site_url("mgallery/view/" . $data["main"]["link"] . "/" . $d["link"]); ?>">
<?php if ($d["description"]): ?>
<img src="<?=base_url("img/mgallery/folder/" . $d["thumb"]) ?>" alt="<?=$d["description"]; ?>" width="202" height="202">
<?php else: ?>
<img src="<?=base_url("img/mgallery/folder/" . $d["thumb"]) ?>" alt="" width="202" height="202">
<?php endif; ?>
</a>
</div>
<?php if ($d["name"] && !is_numeric($d["name"])): ?>
<div class="imgboxtextdiv">
<?=ellipsize($d["name"], 25); ?>
</div>
<?php endif; ?>
</div>
<?php endforeach; ?>
<?php endif; ?>
<?php if ($is_admin): ?>
<div class="imgbox">
<div class="imgboximgdiv">
<a href="<?=site_url("admin/addmultigalleryfolder/" . $link["content_id"]) ?>">
<img src="<?=base_url("img/plus.png") ?>" alt="Mappa Hozzáadása" width="202" height="202">
</a>
</div>
<div class="imgboxtextdiv">
Mappa Hozzáadása
</div>
</div>
<?php endif; ?>
</div>

View File

@ -0,0 +1,23 @@
<?php defined('BASEPATH') OR exit('No direct script access allowed'); ?>
<?php if ($is_admin): ?>
<div class="info">
<?php if ($i != 0): ?>
<a href="<?=site_url("admin/contentup/" . $link["pageid"] . "/" . $link["id"]); ?>">Fel</a>
<?php else: ?>
Fel
<?php endif; ?>
<?php if (!($i == $contsize - 1)): ?>
<a href="<?=site_url("admin/contentdown/" . $link["pageid"] . "/" . $link["id"]); ?>">Le</a>
<?php else: ?>
Le
<?php endif; ?>
<a href="<?=site_url("admin/editcontent/" . $link["pageid"] . "/" . $link["content_type"] . "/" . $link["content_id"]); ?>">Szerkeszt</a>
<a href="<?=site_url("admin/deletecontent/" . $link["pageid"] . "/" . $link["id"]); ?>">Töröl</a><br>
</div>
<?php endif; ?>
<div class="info">
<?=$data["text"]; ?>
<?php if ($is_admin): ?>
<br><br>
<?php endif; ?>
</div>

95
ci_scms/contributing.md Normal file
View File

@ -0,0 +1,95 @@
# Contributing to CodeIgniter
CodeIgniter is a community driven project and accepts contributions of code and documentation from the community. These contributions are made in the form of Issues or [Pull Requests](http://help.github.com/send-pull-requests/) on the [CodeIgniter repository](https://github.com/bcit-ci/CodeIgniter>) on GitHub.
Issues are a quick way to point out a bug. If you find a bug or documentation error in CodeIgniter then please check a few things first:
1. There is not already an open Issue
2. The issue has already been fixed (check the develop branch, or look for closed Issues)
3. Is it something really obvious that you can fix yourself?
Reporting issues is helpful but an even better approach is to send a Pull Request, which is done by "Forking" the main repository and committing to your own copy. This will require you to use the version control system called Git.
## Guidelines
Before we look into how, here are the guidelines. If your Pull Requests fail
to pass these guidelines it will be declined and you will need to re-submit
when youve made the changes. This might sound a bit tough, but it is required
for us to maintain quality of the code-base.
### PHP Style
All code must meet the [Style Guide](http://codeigniter.com/user_guide/general/styleguide.html), which is
essentially the [Allman indent style](http://en.wikipedia.org/wiki/Indent_style#Allman_style), underscores and readable operators. This makes certain that all code is the same format as the existing code and means it will be as readable as possible.
### Documentation
If you change anything that requires a change to documentation then you will need to add it. New classes, methods, parameters, changing default values, etc are all things that will require a change to documentation. The change-log must also be updated for every change. Also PHPDoc blocks must be maintained.
### Compatibility
CodeIgniter recommends PHP 5.4 or newer to be used, but it should be
compatible with PHP 5.2.4 so all code supplied must stick to this
requirement. If PHP 5.3 (and above) functions or features are used then
there must be a fallback for PHP 5.2.4.
### Branching
CodeIgniter uses the [Git-Flow](http://nvie.com/posts/a-successful-git-branching-model/) branching model which requires all pull requests to be sent to the "develop" branch. This is
where the next planned version will be developed. The "master" branch will always contain the latest stable version and is kept clean so a "hotfix" (e.g: an emergency security patch) can be applied to master to create a new version, without worrying about other features holding it up. For this reason all commits need to be made to "develop" and any sent to "master" will be closed automatically. If you have multiple changes to submit, please place all changes into their own branch on your fork.
One thing at a time: A pull request should only contain one change. That does not mean only one commit, but one change - however many commits it took. The reason for this is that if you change X and Y but send a pull request for both at the same time, we might really want X but disagree with Y, meaning we cannot merge the request. Using the Git-Flow branching model you can create new branches for both of these features and send two requests.
### Signing
You must sign your work, certifying that you either wrote the work or otherwise have the right to pass it on to an open source project. git makes this trivial as you merely have to use `--signoff` on your commits to your CodeIgniter fork.
`git commit --signoff`
or simply
`git commit -s`
This will sign your commits with the information setup in your git config, e.g.
`Signed-off-by: John Q Public <john.public@example.com>`
If you are using [Tower](http://www.git-tower.com/) there is a "Sign-Off" checkbox in the commit window. You could even alias git commit to use the `-s` flag so you dont have to think about it.
By signing your work in this manner, you certify to a "Developer's Certificate of Origin". The current version of this certificate is in the `DCO.txt` file in the root of this repository.
## How-to Guide
There are two ways to make changes, the easy way and the hard way. Either way you will need to [create a GitHub account](https://github.com/signup/free).
Easy way GitHub allows in-line editing of files for making simple typo changes and quick-fixes. This is not the best way as you are unable to test the code works. If you do this you could be introducing syntax errors, etc, but for a Git-phobic user this is good for a quick-fix.
Hard way The best way to contribute is to "clone" your fork of CodeIgniter to your development area. That sounds like some jargon, but "forking" on GitHub means "making a copy of that repo to your account" and "cloning" means "copying that code to your environment so you can work on it".
1. Set up Git (Windows, Mac & Linux)
2. Go to the CodeIgniter repo
3. Fork it
4. Clone your CodeIgniter repo: git@github.com:<your-name>/CodeIgniter.git
5. Checkout the "develop" branch At this point you are ready to start making changes.
6. Fix existing bugs on the Issue tracker after taking a look to see nobody else is working on them.
7. Commit the files
8. Push your develop branch to your fork
9. Send a pull request [http://help.github.com/send-pull-requests/](http://help.github.com/send-pull-requests/)
The Reactor Engineers will now be alerted about the change and at least one of the team will respond. If your change fails to meet the guidelines it will be bounced, or feedback will be provided to help you improve it.
Once the Reactor Engineer handling your pull request is happy with it they will merge it into develop and your patch will be part of the next release.
### Keeping your fork up-to-date
Unlike systems like Subversion, Git can have multiple remotes. A remote is the name for a URL of a Git repository. By default your fork will have a remote named "origin" which points to your fork, but you can add another remote named "codeigniter" which points to `git://github.com/bcit-ci/CodeIgniter.git`. This is a read-only remote but you can pull from this develop branch to update your own.
If you are using command-line you can do the following:
1. `git remote add codeigniter git://github.com/bcit-ci/CodeIgniter.git`
2. `git pull codeigniter develop`
3. `git push origin develop`
Now your fork is up to date. This should be done regularly, or before you send a pull request at least.

292
ci_scms/index.php Normal file
View File

@ -0,0 +1,292 @@
<?php
/**
* CodeIgniter
*
* An open source application development framework for PHP
*
* This content is released under the MIT License (MIT)
*
* Copyright (c) 2014 - 2015, British Columbia Institute of Technology
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* @package CodeIgniter
* @author EllisLab Dev Team
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (http://ellislab.com/)
* @copyright Copyright (c) 2014 - 2015, British Columbia Institute of Technology (http://bcit.ca/)
* @license http://opensource.org/licenses/MIT MIT License
* @link http://codeigniter.com
* @since Version 1.0.0
* @filesource
*/
/*
*---------------------------------------------------------------
* APPLICATION ENVIRONMENT
*---------------------------------------------------------------
*
* You can load different configurations depending on your
* current environment. Setting the environment also influences
* things like logging and error reporting.
*
* This can be set to anything, but default usage is:
*
* development
* testing
* production
*
* NOTE: If you change these, also change the error_reporting() code below
*/
define('ENVIRONMENT', isset($_SERVER['CI_ENV']) ? $_SERVER['CI_ENV'] : 'development');
/*
*---------------------------------------------------------------
* ERROR REPORTING
*---------------------------------------------------------------
*
* Different environments will require different levels of error reporting.
* By default development will show errors but testing and live will hide them.
*/
switch (ENVIRONMENT)
{
case 'development':
error_reporting(-1);
ini_set('display_errors', 1);
break;
case 'testing':
case 'production':
ini_set('display_errors', 0);
if (version_compare(PHP_VERSION, '5.3', '>='))
{
error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT & ~E_USER_NOTICE & ~E_USER_DEPRECATED);
}
else
{
error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT & ~E_USER_NOTICE);
}
break;
default:
header('HTTP/1.1 503 Service Unavailable.', TRUE, 503);
echo 'The application environment is not set correctly.';
exit(1); // EXIT_ERROR
}
/*
*---------------------------------------------------------------
* SYSTEM FOLDER NAME
*---------------------------------------------------------------
*
* This variable must contain the name of your "system" folder.
* Include the path if the folder is not in the same directory
* as this file.
*/
$system_path = 'system';
/*
*---------------------------------------------------------------
* APPLICATION FOLDER NAME
*---------------------------------------------------------------
*
* If you want this front controller to use a different "application"
* folder than the default one you can set its name here. The folder
* can also be renamed or relocated anywhere on your server. If
* you do, use a full server path. For more info please see the user guide:
* http://codeigniter.com/user_guide/general/managing_apps.html
*
* NO TRAILING SLASH!
*/
$application_folder = 'application';
/*
*---------------------------------------------------------------
* VIEW FOLDER NAME
*---------------------------------------------------------------
*
* If you want to move the view folder out of the application
* folder set the path to the folder here. The folder can be renamed
* and relocated anywhere on your server. If blank, it will default
* to the standard location inside your application folder. If you
* do move this, use the full server path to this folder.
*
* NO TRAILING SLASH!
*/
$view_folder = '';
/*
* --------------------------------------------------------------------
* DEFAULT CONTROLLER
* --------------------------------------------------------------------
*
* Normally you will set your default controller in the routes.php file.
* You can, however, force a custom routing by hard-coding a
* specific controller class/function here. For most applications, you
* WILL NOT set your routing here, but it's an option for those
* special instances where you might want to override the standard
* routing in a specific front controller that shares a common CI installation.
*
* IMPORTANT: If you set the routing here, NO OTHER controller will be
* callable. In essence, this preference limits your application to ONE
* specific controller. Leave the function name blank if you need
* to call functions dynamically via the URI.
*
* Un-comment the $routing array below to use this feature
*/
// The directory name, relative to the "controllers" folder. Leave blank
// if your controller is not in a sub-folder within the "controllers" folder
// $routing['directory'] = '';
// The controller class file name. Example: mycontroller
// $routing['controller'] = '';
// The controller function you wish to be called.
// $routing['function'] = '';
/*
* -------------------------------------------------------------------
* CUSTOM CONFIG VALUES
* -------------------------------------------------------------------
*
* The $assign_to_config array below will be passed dynamically to the
* config class when initialized. This allows you to set custom config
* items or override any default config values found in the config.php file.
* This can be handy as it permits you to share one application between
* multiple front controller files, with each file containing different
* config values.
*
* Un-comment the $assign_to_config array below to use this feature
*/
// $assign_to_config['name_of_config_item'] = 'value of config item';
// --------------------------------------------------------------------
// END OF USER CONFIGURABLE SETTINGS. DO NOT EDIT BELOW THIS LINE
// --------------------------------------------------------------------
/*
* ---------------------------------------------------------------
* Resolve the system path for increased reliability
* ---------------------------------------------------------------
*/
// Set the current directory correctly for CLI requests
if (defined('STDIN'))
{
chdir(dirname(__FILE__));
}
if (($_temp = realpath($system_path)) !== FALSE)
{
$system_path = $_temp.'/';
}
else
{
// Ensure there's a trailing slash
$system_path = rtrim($system_path, '/').'/';
}
// Is the system path correct?
if ( ! is_dir($system_path))
{
header('HTTP/1.1 503 Service Unavailable.', TRUE, 503);
echo 'Your system folder path does not appear to be set correctly. Please open the following file and correct this: '.pathinfo(__FILE__, PATHINFO_BASENAME);
exit(3); // EXIT_CONFIG
}
/*
* -------------------------------------------------------------------
* Now that we know the path, set the main path constants
* -------------------------------------------------------------------
*/
// The name of THIS file
define('SELF', pathinfo(__FILE__, PATHINFO_BASENAME));
// Path to the system folder
define('BASEPATH', str_replace('\\', '/', $system_path));
// Path to the front controller (this file)
define('FCPATH', dirname(__FILE__).'/');
// Name of the "system folder"
define('SYSDIR', trim(strrchr(trim(BASEPATH, '/'), '/'), '/'));
// The path to the "application" folder
if (is_dir($application_folder))
{
if (($_temp = realpath($application_folder)) !== FALSE)
{
$application_folder = $_temp;
}
define('APPPATH', $application_folder.DIRECTORY_SEPARATOR);
}
else
{
if ( ! is_dir(BASEPATH.$application_folder.DIRECTORY_SEPARATOR))
{
header('HTTP/1.1 503 Service Unavailable.', TRUE, 503);
echo 'Your application folder path does not appear to be set correctly. Please open the following file and correct this: '.SELF;
exit(3); // EXIT_CONFIG
}
define('APPPATH', BASEPATH.$application_folder.DIRECTORY_SEPARATOR);
}
// The path to the "views" folder
if ( ! is_dir($view_folder))
{
if ( ! empty($view_folder) && is_dir(APPPATH.$view_folder.DIRECTORY_SEPARATOR))
{
$view_folder = APPPATH.$view_folder;
}
elseif ( ! is_dir(APPPATH.'views'.DIRECTORY_SEPARATOR))
{
header('HTTP/1.1 503 Service Unavailable.', TRUE, 503);
echo 'Your view folder path does not appear to be set correctly. Please open the following file and correct this: '.SELF;
exit(3); // EXIT_CONFIG
}
else
{
$view_folder = APPPATH.'views';
}
}
if (($_temp = realpath($view_folder)) !== FALSE)
{
$view_folder = $_temp.DIRECTORY_SEPARATOR;
}
else
{
$view_folder = rtrim($view_folder, '/\\').DIRECTORY_SEPARATOR;
}
define('VIEWPATH', $view_folder);
/*
* --------------------------------------------------------------------
* LOAD THE BOOTSTRAP FILE
* --------------------------------------------------------------------
*
* And away we go...
*/
require_once BASEPATH.'core/CodeIgniter.php';

21
ci_scms/license.txt Normal file
View File

@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2014 - 2015, British Columbia Institute of Technology
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

69
ci_scms/readme.rst Normal file
View File

@ -0,0 +1,69 @@
###################
What is CodeIgniter
###################
CodeIgniter is an Application Development Framework - a toolkit - for people
who build web sites using PHP. Its goal is to enable you to develop projects
much faster than you could if you were writing code from scratch, by providing
a rich set of libraries for commonly needed tasks, as well as a simple
interface and logical structure to access these libraries. CodeIgniter lets
you creatively focus on your project by minimizing the amount of code needed
for a given task.
*******************
Release Information
*******************
This repo contains in-development code for future releases. To download the
latest stable release please visit the `CodeIgniter Downloads
<http://www.codeigniter.com/download>`_ page.
**************************
Changelog and New Features
**************************
You can find a list of all changes for each release in the `user
guide change log <https://github.com/bcit-ci/CodeIgniter/blob/develop/user_guide_src/source/changelog.rst>`_.
*******************
Server Requirements
*******************
PHP version 5.4 or newer is recommended.
It should work on 5.2.4 as well, but we strongly advise you NOT to run
such old versions of PHP, because of potential security and performance
issues, as well as missing features.
************
Installation
************
Please see the `installation section <http://www.codeigniter.com/user_guide/installation/index.html>`_
of the CodeIgniter User Guide.
*******
License
*******
Please see the `license
agreement <https://github.com/bcit-ci/CodeIgniter/blob/develop/user_guide_src/source/license.rst>`_.
*********
Resources
*********
- `User Guide <http://www.codeigniter.com/docs>`_
- `Language File Translations <https://github.com/bcit-ci/codeigniter3-translations>`_
- `Community Forums <http://forum.codeigniter.com/>`_
- `Community Wiki <https://github.com/bcit-ci/CodeIgniter/wiki>`_
- `Community IRC <http://www.codeigniter.com/irc>`_
Report security issues to our `Security Panel <mailto:security@codeigniter.com>`_, thank you.
***************
Acknowledgement
***************
The CodeIgniter team would like to thank EllisLab, all the
contributors to the CodeIgniter project and you, the CodeIgniter user.

200
ci_scms/sql/007.sql Normal file
View File

@ -0,0 +1,200 @@
/*
SQLyog Community v12.09 (64 bit)
MySQL - 5.6.17 : Database - v
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
/*Table structure for table `avxg_users` */
DROP TABLE IF EXISTS `avxg_users`;
CREATE TABLE `avxg_users` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` char(20) NOT NULL,
`password` text,
`email` text NOT NULL,
`last_login` text,
`ip` text,
`session_id` text,
KEY `id` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1;
/*Table structure for table `ci_sessions` */
DROP TABLE IF EXISTS `ci_sessions`;
CREATE TABLE `ci_sessions` (
`id` varchar(40) NOT NULL,
`ip_address` varchar(45) NOT NULL,
`timestamp` int(10) unsigned NOT NULL DEFAULT '0',
`data` blob NOT NULL,
PRIMARY KEY (`id`),
KEY `ci_sessions_timestamp` (`timestamp`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*Table structure for table `content_gallery` */
DROP TABLE IF EXISTS `content_gallery`;
CREATE TABLE `content_gallery` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` text,
`link` text,
`description` text,
`active` tinyint(1) NOT NULL DEFAULT '1',
KEY `id` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
/*Table structure for table `content_multi_gallery` */
DROP TABLE IF EXISTS `content_multi_gallery`;
CREATE TABLE `content_multi_gallery` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` text,
`link` text NOT NULL,
`description` text,
`active` tinyint(1) NOT NULL DEFAULT '1',
KEY `id` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
/*Table structure for table `content_text` */
DROP TABLE IF EXISTS `content_text`;
CREATE TABLE `content_text` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`text` text,
`text_noformat` text,
KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*Data for the table `content_text` */
/*Table structure for table `gallery_data` */
DROP TABLE IF EXISTS `gallery_data`;
CREATE TABLE `gallery_data` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`gallery_id` int(11) NOT NULL,
`name` text,
`link` text NOT NULL,
`description` text,
`img` text NOT NULL,
`thumb` text NOT NULL,
`orig_img` text,
KEY `id` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;
/*Data for the table `gallery_data` */
/*Table structure for table `menu` */
DROP TABLE IF EXISTS `menu`;
CREATE TABLE `menu` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` text NOT NULL,
`link` text NOT NULL,
`order` int(11) NOT NULL,
`double` tinyint(1) NOT NULL DEFAULT '0',
KEY `id` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8;
/*Data for the table `menu` */
/*Table structure for table `multi_gallery_data` */
DROP TABLE IF EXISTS `multi_gallery_data`;
CREATE TABLE `multi_gallery_data` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`folderid` int(11) NOT NULL,
`name` text,
`link` text NOT NULL,
`description` text,
`thumb` text,
`mid` text,
`big` text,
`orig` text,
KEY `id` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=latin1;
/*Data for the table `multi_gallery_data` */
/*Table structure for table `multi_gallery_folders` */
DROP TABLE IF EXISTS `multi_gallery_folders`;
CREATE TABLE `multi_gallery_folders` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`galleryid` int(11) NOT NULL,
`name` text,
`link` text NOT NULL,
`description` text,
`thumb` text NOT NULL,
`order` int(11) NOT NULL,
`active` tinyint(1) NOT NULL DEFAULT '1',
KEY `id` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1;
/*Data for the table `multi_gallery_folders` */
/*Table structure for table `page_contents` */
DROP TABLE IF EXISTS `page_contents`;
CREATE TABLE `page_contents` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`pageid` int(11) NOT NULL,
`order` int(11) NOT NULL,
`content_type` int(11) NOT NULL,
`content_id` int(11) NOT NULL,
KEY `id` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;
/*Data for the table `page_contents` */
/*Table structure for table `session_links` */
DROP TABLE IF EXISTS `session_links`;
CREATE TABLE `session_links` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`session_id` text NOT NULL,
`cookie_session_id` text NOT NULL,
KEY `id` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=latin1;
/*Data for the table `session_links` */
/*Table structure for table `settings` */
DROP TABLE IF EXISTS `settings`;
CREATE TABLE `settings` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` text NOT NULL,
`value` text NOT NULL,
KEY `id` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
/*Data for the table `settings` */
insert into `settings`(`id`,`name`,`value`) values (1,'reg_enabled','false');
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;