mirror of
https://github.com/claudehohl/Stikked.git
synced 2025-04-29 06:51:11 -05:00
languages as config file
This commit is contained in:
parent
f537ecccde
commit
2513a0dc2d
@ -9,58 +9,88 @@ if (!defined('BASEPATH')) exit('No direct script access allowed');
|
|||||||
|
|
||||||
//geshi languages
|
//geshi languages
|
||||||
$config['geshi_languages'] = array(
|
$config['geshi_languages'] = array(
|
||||||
'c' => 'C',
|
'html4strict' => 'HTML',
|
||||||
'css' => 'CSS',
|
'css' => 'CSS',
|
||||||
'cpp' => 'C++',
|
'javascript' => 'JavaScript',
|
||||||
'html4strict' => 'HTML (4 Strict)',
|
|
||||||
'java' => 'Java',
|
|
||||||
'perl' => 'Perl',
|
|
||||||
'php' => 'PHP',
|
'php' => 'PHP',
|
||||||
'python' => 'Python',
|
'python' => 'Python',
|
||||||
'ruby' => 'Ruby',
|
'ruby' => 'Ruby',
|
||||||
'text' => 'Plain Text',
|
'bash' => 'Bash',
|
||||||
'asm' => 'ASM (Nasm Syntax)',
|
'c' => 'C',
|
||||||
'xhtml' => 'XHTML',
|
'cpp' => 'C++',
|
||||||
|
'diff' => 'Diff',
|
||||||
|
'latex' => 'LaTeX',
|
||||||
|
'sql' => 'SQL',
|
||||||
|
'xml' => 'XML',
|
||||||
|
'text' => 'Plaintext',
|
||||||
|
'abap' => 'ABAP',
|
||||||
'actionscript' => 'Actionscript',
|
'actionscript' => 'Actionscript',
|
||||||
'ada' => 'ADA',
|
'ada' => 'ADA',
|
||||||
'apache' => 'Apache Log',
|
'apache' => 'Apache Log',
|
||||||
'applescript' => 'AppleScript',
|
'applescript' => 'AppleScript',
|
||||||
'autoit' => 'AutoIT',
|
'asm' => 'Assembler',
|
||||||
'bash' => 'Bash',
|
'asp' => 'ASP',
|
||||||
'bptzbasic' => 'BptzBasic',
|
'autoit' => 'AutoIt',
|
||||||
|
'blitzbasic' => 'Blitzbasic',
|
||||||
|
'bnf' => 'Backus-Naur-Form',
|
||||||
'c_mac' => 'C for Macs',
|
'c_mac' => 'C for Macs',
|
||||||
|
'caddcl' => 'CAD DCL',
|
||||||
|
'cadlisp' => 'CAD Lisp',
|
||||||
|
'cfdg' => 'CFDG',
|
||||||
|
'cfm' => 'CFM',
|
||||||
|
'cpp-qt' => 'C++ QT',
|
||||||
'csharp' => 'C#',
|
'csharp' => 'C#',
|
||||||
'ColdFusion' => 'coldfusion',
|
'd' => 'D',
|
||||||
'delphi' => 'Delphi',
|
'delphi' => 'Delphi',
|
||||||
|
'div' => 'DIV',
|
||||||
|
'dos' => 'DOS',
|
||||||
|
'dot' => 'dot',
|
||||||
'eiffel' => 'Eiffel',
|
'eiffel' => 'Eiffel',
|
||||||
'fortran' => 'Fortran',
|
'fortran' => 'Fortran',
|
||||||
'freebasic' => 'FreeBasic',
|
'freebasic' => 'FreeBasic',
|
||||||
|
'genero' => 'Genero',
|
||||||
'gml' => 'GML',
|
'gml' => 'GML',
|
||||||
'groovy' => 'Groovy',
|
'groovy' => 'Groovy',
|
||||||
'inno' => 'Inno',
|
'haskell' => 'Haskell',
|
||||||
|
'idl' => 'Unoidl',
|
||||||
|
'ini' => 'INI',
|
||||||
|
'inno' => 'Inno Script',
|
||||||
|
'io' => 'Io',
|
||||||
|
'java' => 'Java',
|
||||||
'java5' => 'Java 5',
|
'java5' => 'Java 5',
|
||||||
'javascript' => 'Javascript',
|
'lisp' => 'Lisp',
|
||||||
'latex' => 'LaTeX',
|
'lua' => 'LUA',
|
||||||
|
'm68k' => 'm68k',
|
||||||
|
'matlab' => 'Matlab',
|
||||||
'mirc' => 'mIRC',
|
'mirc' => 'mIRC',
|
||||||
|
'mpasm' => 'MPASM',
|
||||||
'mysql' => 'MySQL',
|
'mysql' => 'MySQL',
|
||||||
'nsis' => 'NSIS',
|
'nsis' => 'NSIS',
|
||||||
'objc' => 'Objective C',
|
'objc' => 'Objective C',
|
||||||
'ocaml' => 'OCaml',
|
'ocaml' => 'ocaml',
|
||||||
'oobas' => 'OpenOffice BASIC',
|
'oobas' => 'OpenOffice.org Basic',
|
||||||
'orcale8' => 'Orcale 8 SQL',
|
'oracle8' => 'Orcale 8 SQL',
|
||||||
'pascal' => 'Pascal',
|
'pascal' => 'Pascal',
|
||||||
|
'per' => 'Per',
|
||||||
|
'perl' => 'Perl',
|
||||||
'plsql' => 'PL/SQL',
|
'plsql' => 'PL/SQL',
|
||||||
'qbasic' => 'Q(uick)BASIC',
|
'qbasic' => 'QBasic',
|
||||||
|
'rails' => 'Rails',
|
||||||
|
'reg' => 'Registry',
|
||||||
'robots' => 'robots.txt',
|
'robots' => 'robots.txt',
|
||||||
|
'sas' => 'SAS',
|
||||||
'scheme' => 'Scheme',
|
'scheme' => 'Scheme',
|
||||||
'sdlbasic' => 'SDLBasic',
|
'sdlbasic' => 'sdlBasic',
|
||||||
'smalltalk' => 'Smalltalk',
|
'smalltalk' => 'Smalltalk',
|
||||||
'smarty' => 'Smarty',
|
'smarty' => 'Smarty',
|
||||||
'sql' => 'SQL',
|
|
||||||
'tcl' => 'TCL',
|
'tcl' => 'TCL',
|
||||||
|
'thinbasic' => 'thinBasic',
|
||||||
|
'tsql' => 'T-SQL',
|
||||||
|
'vb' => 'Visual Basic',
|
||||||
'vbnet' => 'VB.NET',
|
'vbnet' => 'VB.NET',
|
||||||
'vb' => 'Visual BASIC',
|
'vhdl' => 'VHDL',
|
||||||
'winbatch' => 'Winbatch',
|
'visualfoxpro' => 'Visual FoxPro',
|
||||||
'xml' => 'XML',
|
'winbatch' => 'WinBatch',
|
||||||
'z80' => 'z80 ASM',
|
'xpp' => 'X++',
|
||||||
|
'z80' => 'Z80',
|
||||||
);
|
);
|
||||||
|
@ -22,28 +22,17 @@ class Languages extends CI_Model
|
|||||||
|
|
||||||
function valid_language($lang)
|
function valid_language($lang)
|
||||||
{
|
{
|
||||||
$this->db->where('code', $lang);
|
return array_key_exists($lang, $this->geshi_languages);
|
||||||
$query = $this->db->get('languages');
|
|
||||||
|
|
||||||
if ($query->num_rows() > 0)
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_languages()
|
function get_languages()
|
||||||
{
|
{
|
||||||
$query = $this->db->get('languages');
|
|
||||||
$data = array();
|
$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"] = "-----------------";
|
$data["0"] = "-----------------";
|
||||||
}
|
}
|
||||||
@ -53,20 +42,6 @@ class Languages extends CI_Model
|
|||||||
|
|
||||||
function code_to_description($code)
|
function code_to_description($code)
|
||||||
{
|
{
|
||||||
$this->db->select('description');
|
return $this->geshi_languages[$code];
|
||||||
$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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -19,46 +19,6 @@ class Pastes extends CI_Model
|
|||||||
function __construct()
|
function __construct()
|
||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
|
|
||||||
if (!$this->db->table_exists('pastes'))
|
|
||||||
{
|
|
||||||
$this->db->simple_query(<<<EOT
|
|
||||||
--
|
|
||||||
-- Table structure for table `ci_sessions`
|
|
||||||
--
|
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS `ci_sessions` (
|
|
||||||
`session_id` varchar(40) NOT NULL default '0',
|
|
||||||
`ip_address` varchar(16) NOT NULL default '0',
|
|
||||||
`user_agent` varchar(50) NOT NULL,
|
|
||||||
`last_activity` int(10) unsigned NOT NULL default '0',
|
|
||||||
`session_data` text NOT NULL,
|
|
||||||
PRIMARY KEY (`session_id`)
|
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
|
|
||||||
|
|
||||||
--
|
|
||||||
-- Table structure for table `pastes`
|
|
||||||
--
|
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS `pastes` (
|
|
||||||
`id` int(10) NOT NULL auto_increment,
|
|
||||||
`pid` varchar(8) character set utf8 collate utf8_unicode_ci NOT NULL,
|
|
||||||
`title` varchar(32) character set utf8 collate utf8_unicode_ci NOT NULL,
|
|
||||||
`name` varchar(32) character set utf8 collate utf8_unicode_ci NOT NULL,
|
|
||||||
`lang` varchar(32) character set utf8 collate utf8_unicode_ci NOT NULL,
|
|
||||||
`private` tinyint(1) NOT NULL,
|
|
||||||
`paste` longtext character set utf8 collate utf8_unicode_ci NOT NULL,
|
|
||||||
`raw` longtext character set utf8 collate utf8_unicode_ci NOT NULL,
|
|
||||||
`created` int(10) NOT NULL,
|
|
||||||
`expire` int(10) NOT NULL default '0',
|
|
||||||
`toexpire` tinyint(1) unsigned NOT NULL,
|
|
||||||
`snipurl` varchar(64) character set utf8 collate utf8_unicode_ci NOT NULL default '0',
|
|
||||||
`replyto` varchar(8) character set utf8 collate utf8_unicode_ci NOT NULL,
|
|
||||||
PRIMARY KEY (`id`)
|
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=154 ;
|
|
||||||
EOT;
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function countPastes()
|
function countPastes()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user