diff --git a/htdocs/application/config/geshi_languages.php b/htdocs/application/config/geshi_languages.php index d9086ae..2fe2630 100644 --- a/htdocs/application/config/geshi_languages.php +++ b/htdocs/application/config/geshi_languages.php @@ -9,58 +9,88 @@ if (!defined('BASEPATH')) exit('No direct script access allowed'); //geshi languages $config['geshi_languages'] = array( - 'c' => 'C', + 'html4strict' => 'HTML', 'css' => 'CSS', - 'cpp' => 'C++', - 'html4strict' => 'HTML (4 Strict)', - 'java' => 'Java', - 'perl' => 'Perl', + 'javascript' => 'JavaScript', 'php' => 'PHP', 'python' => 'Python', 'ruby' => 'Ruby', - 'text' => 'Plain Text', - 'asm' => 'ASM (Nasm Syntax)', - 'xhtml' => 'XHTML', + 'bash' => 'Bash', + 'c' => 'C', + 'cpp' => 'C++', + 'diff' => 'Diff', + 'latex' => 'LaTeX', + 'sql' => 'SQL', + 'xml' => 'XML', + 'text' => 'Plaintext', + 'abap' => 'ABAP', 'actionscript' => 'Actionscript', 'ada' => 'ADA', 'apache' => 'Apache Log', 'applescript' => 'AppleScript', - 'autoit' => 'AutoIT', - 'bash' => 'Bash', - 'bptzbasic' => 'BptzBasic', + 'asm' => 'Assembler', + 'asp' => 'ASP', + 'autoit' => 'AutoIt', + 'blitzbasic' => 'Blitzbasic', + 'bnf' => 'Backus-Naur-Form', 'c_mac' => 'C for Macs', + 'caddcl' => 'CAD DCL', + 'cadlisp' => 'CAD Lisp', + 'cfdg' => 'CFDG', + 'cfm' => 'CFM', + 'cpp-qt' => 'C++ QT', 'csharp' => 'C#', - 'ColdFusion' => 'coldfusion', + 'd' => 'D', 'delphi' => 'Delphi', + 'div' => 'DIV', + 'dos' => 'DOS', + 'dot' => 'dot', 'eiffel' => 'Eiffel', 'fortran' => 'Fortran', 'freebasic' => 'FreeBasic', + 'genero' => 'Genero', 'gml' => 'GML', 'groovy' => 'Groovy', - 'inno' => 'Inno', + 'haskell' => 'Haskell', + 'idl' => 'Unoidl', + 'ini' => 'INI', + 'inno' => 'Inno Script', + 'io' => 'Io', + 'java' => 'Java', 'java5' => 'Java 5', - 'javascript' => 'Javascript', - 'latex' => 'LaTeX', + 'lisp' => 'Lisp', + 'lua' => 'LUA', + 'm68k' => 'm68k', + 'matlab' => 'Matlab', 'mirc' => 'mIRC', + 'mpasm' => 'MPASM', 'mysql' => 'MySQL', 'nsis' => 'NSIS', 'objc' => 'Objective C', - 'ocaml' => 'OCaml', - 'oobas' => 'OpenOffice BASIC', - 'orcale8' => 'Orcale 8 SQL', + 'ocaml' => 'ocaml', + 'oobas' => 'OpenOffice.org Basic', + 'oracle8' => 'Orcale 8 SQL', 'pascal' => 'Pascal', + 'per' => 'Per', + 'perl' => 'Perl', 'plsql' => 'PL/SQL', - 'qbasic' => 'Q(uick)BASIC', + 'qbasic' => 'QBasic', + 'rails' => 'Rails', + 'reg' => 'Registry', 'robots' => 'robots.txt', + 'sas' => 'SAS', 'scheme' => 'Scheme', - 'sdlbasic' => 'SDLBasic', + 'sdlbasic' => 'sdlBasic', 'smalltalk' => 'Smalltalk', 'smarty' => 'Smarty', - 'sql' => 'SQL', 'tcl' => 'TCL', + 'thinbasic' => 'thinBasic', + 'tsql' => 'T-SQL', + 'vb' => 'Visual Basic', 'vbnet' => 'VB.NET', - 'vb' => 'Visual BASIC', - 'winbatch' => 'Winbatch', - 'xml' => 'XML', - 'z80' => 'z80 ASM', + 'vhdl' => 'VHDL', + 'visualfoxpro' => 'Visual FoxPro', + 'winbatch' => 'WinBatch', + 'xpp' => 'X++', + 'z80' => 'Z80', ); diff --git a/htdocs/application/models/languages.php b/htdocs/application/models/languages.php index be34219..c71558e 100644 --- a/htdocs/application/models/languages.php +++ b/htdocs/application/models/languages.php @@ -22,28 +22,17 @@ class Languages extends CI_Model function valid_language($lang) { - $this->db->where('code', $lang); - $query = $this->db->get('languages'); - - if ($query->num_rows() > 0) - { - return true; - } - else - { - return false; - } + return array_key_exists($lang, $this->geshi_languages); } function get_languages() { - $query = $this->db->get('languages'); $data = array(); - foreach ($query->result_array() as $row) + foreach ($this->geshi_languages as $key => $value) { - $data[$row['code']] = $row['description']; + $data[$key] = $value; - if ($row['code'] == 'text') + if ($key == 'text') { $data["0"] = "-----------------"; } @@ -53,20 +42,6 @@ class Languages extends CI_Model function code_to_description($code) { - $this->db->select('description'); - $this->db->where('code', $code); - $query = $this->db->get('languages'); - - if ($query->num_rows() > 0) - { - foreach ($query->result_array() as $row) - { - return $row['description']; - } - } - else - { - return false; - } + return $this->geshi_languages[$code]; } } diff --git a/htdocs/application/models/pastes.php b/htdocs/application/models/pastes.php index e1ef54d..a03e003 100755 --- a/htdocs/application/models/pastes.php +++ b/htdocs/application/models/pastes.php @@ -19,46 +19,6 @@ class Pastes extends CI_Model function __construct() { parent::__construct(); - - if (!$this->db->table_exists('pastes')) - { - $this->db->simple_query(<<