Migration to PDO database abstraction layer
[mirrors/Kyberia-bloodline.git] / wwwroot / inc / nodes.inc
CommitLineData
51ff3226 1<?php
3676f242
H
2require_once(INCLUDE_DIR.'base36.inc');
3
51ff3226 4 if (!function_exists('str_split')){
5 function str_split($string, $split_length=1){
6
7 if ($split_length < 1){
8 return false;
9 }
10
11 for ($pos=0, $chunks = array(); $pos < strlen($string); $pos+=$split_length){
12 $chunks[] = substr($string, $pos, $split_length);
13 }
14 return $chunks;
15 }
16 }
17
8d1d6291
DH
18
19
3676f242 20function processContent_hack($node_content) {
51ff3226 21 global $node;
e909f81b 22 include_once(INCLUDE_DIR.'htmlparse.inc');
51ff3226 23
24 if ($node['template_id']==$node['node_id'] && $_POST['event']=='configure_content') {
25
26 }
27
28 elseif ($_POST['no_html']) {
29 $node_content=htmlspecialchars($node_content);
30 }
31
32 elseif ($_POST['wiki']) {
33 // load the class file
34 require_once 'Text/Wiki.php';
35
36 // instantiate a Text_Wiki object with the default rule set
63c0e85f 37 $wiki = new Text_Wiki();
51ff3226 38
39 $node_content = $wiki->transform($node_content, 'Xhtml');
40 }
41
42 elseif ($_POST['code']) {}
43
44 else {
45 global $db,$htmlparse,$error;
46
54bc3775 47 if (!htmlparser::htmlparse($node_content)) {
51ff3226 48 $error=$htmlparse;
49 return false;
50 }
51
52 $node_content = eregi_Replace("((( )|(\n)|(^))+)(http://|ftp://|https://)([[:alnum:]][^,[:space:]]*)","\\2<a target='_blank' href=\"\\6\\7\">\\6\\7</a>",$node_content);
78f1a5f4 53 //$node_content = db_escape_string($node_content); once is enough
51ff3226 54 }
55
56 return $node_content;
57}
58
59
3676f242 60require_once(BACKEND_DIR.'/'.DB_TYPE.'/backend.inc');
51ff3226 61
This page took 0.281679 seconds and 4 git commands to generate.