summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorStarla Insigna <hatkirby@fourisland.com>2008-12-17 21:00:03 -0500
committerStarla Insigna <hatkirby@fourisland.com>2008-12-17 21:00:03 -0500
commitc895d2f41b0737f8a2799d36beca087e6b642f05 (patch)
treef6243c7c270bbec4f5e0d01547b2c6048cea200f
parente3ffdb84d705dd1a1000fa91a49cc6c58fc58e05 (diff)
downloadfourisland-c895d2f41b0737f8a2799d36beca087e6b642f05.tar.gz
fourisland-c895d2f41b0737f8a2799d36beca087e6b642f05.tar.bz2
fourisland-c895d2f41b0737f8a2799d36beca087e6b642f05.zip
Added an emoticon parsing system
I decided that, because I use the :) emoticon so often, I might as well replace it with an actual image. I've added a Smiley parsing system to
complement the BBCode parsing one.
-rwxr-xr-xincludes/bbcode.php2
-rwxr-xr-xincludes/comments.php2
-rwxr-xr-xincludes/functions.php2
-rwxr-xr-xincludes/parsers.php36
-rwxr-xr-xincludes/smilies.php64
-rwxr-xr-xindex.php2
-rwxr-xr-xpages/admin.php6
-rwxr-xr-xpages/blog.php2
-rwxr-xr-xpages/poll.php2
-rwxr-xr-xpages/welcome.php2
-rwxr-xr-xrss.php4
-rw-r--r--theme/images/smilies/001_smile.gifbin0 -> 699 bytes
12 files changed, 112 insertions, 12 deletions
diff --git a/includes/bbcode.php b/includes/bbcode.php index 42ff8d0..3cae84c 100755 --- a/includes/bbcode.php +++ b/includes/bbcode.php
@@ -50,7 +50,7 @@ class BBCode
50 $this->bbcodes['bquote'] = '<P><DIV CLASS="autosize"><DIV CLASS="bubble"><DIV CLASS="bquote"><BLOCKQUOTE><DIV>{CONTENT}</DIV></BLOCKQUOTE></DIV><CITE><STRONG>Anonymous</STRONG></CITE></DIV></DIV><DIV CLASS="cleardiv"></DIV>'; 50 $this->bbcodes['bquote'] = '<P><DIV CLASS="autosize"><DIV CLASS="bubble"><DIV CLASS="bquote"><BLOCKQUOTE><DIV>{CONTENT}</DIV></BLOCKQUOTE></DIV><CITE><STRONG>Anonymous</STRONG></CITE></DIV></DIV><DIV CLASS="cleardiv"></DIV>';
51 $this->bbcodes2['bquote'] = '<P><DIV CLASS="autosize"><DIV CLASS="bubble"><DIV CLASS="bquote"><BLOCKQUOTE><DIV>{CONTENT}</DIV></BLOCKQUOTE></DIV><CITE><STRONG>{PARAM}</STRONG></CITE></DIV></DIV><DIV CLASS="cleardiv"></DIV>'; 51 $this->bbcodes2['bquote'] = '<P><DIV CLASS="autosize"><DIV CLASS="bubble"><DIV CLASS="bquote"><BLOCKQUOTE><DIV>{CONTENT}</DIV></BLOCKQUOTE></DIV><CITE><STRONG>{PARAM}</STRONG></CITE></DIV></DIV><DIV CLASS="cleardiv"></DIV>';
52 $this->bbcodes2['abbr'] = '<ABBR TITLE="{PARAM}">{CONTENT}</ABBR>'; 52 $this->bbcodes2['abbr'] = '<ABBR TITLE="{PARAM}">{CONTENT}</ABBR>';
53 $this->bbcodes['hidden'] = '<DIV STYLE="display: none">{CONTENT}</DIV>'; 53 $this->bbcodes['hidden'] = '<SPAN STYLE="display: none">{CONTENT}</SPAN>';
54 54
55 $this->init = true; 55 $this->init = true;
56 } 56 }
diff --git a/includes/comments.php b/includes/comments.php index bf73318..15e9fc8 100755 --- a/includes/comments.php +++ b/includes/comments.php
@@ -71,7 +71,7 @@ while ($getcomments3[$i] = mysql_fetch_array($getcomments2))
71 'USERNAME' => (($website != '') ? '<A HREF="http://' . $website . '">' . $username . '</A>' : $username), 71 'USERNAME' => (($website != '') ? '<A HREF="http://' . $website . '">' . $username . '</A>' : $username),
72 'DATE' => date("F dS Y \a\\t g:i:s a",strtotime($getcomments3[$i]['posttime'])), 72 'DATE' => date("F dS Y \a\\t g:i:s a",strtotime($getcomments3[$i]['posttime'])),
73 'ID' => $getcomments3[$i]['id'], 73 'ID' => $getcomments3[$i]['id'],
74 'TEXT' => parseBBCode($getcomments3[$i]['comment']))); 74 'TEXT' => parseText($getcomments3[$i]['comment'])));
75 } 75 }
76 $i++; 76 $i++;
77} 77}
diff --git a/includes/functions.php b/includes/functions.php index 1caef59..881bfd1 100755 --- a/includes/functions.php +++ b/includes/functions.php
@@ -124,7 +124,7 @@ function postBlogPost($title,$author,$tags,$content)
124 $upconf = "UPDATE config SET value = \"" . date('md') . "\" WHERE name = \"lastUpdate\""; 124 $upconf = "UPDATE config SET value = \"" . date('md') . "\" WHERE name = \"lastUpdate\"";
125 $upconf2 = mysql_query($upconf); 125 $upconf2 = mysql_query($upconf);
126 126
127 preg_match_all('|<a\s[^>]*href="([^"]+)"|i', parseBBCode($content), $matches); 127 preg_match_all('|<a\s[^>]*href="([^"]+)"|i', parseText($content), $matches);
128 128
129 foreach ($matches[1] as $link) 129 foreach ($matches[1] as $link)
130 { 130 {
diff --git a/includes/parsers.php b/includes/parsers.php new file mode 100755 index 0000000..5e984c2 --- /dev/null +++ b/includes/parsers.php
@@ -0,0 +1,36 @@
1<?php
2/*
3 444444444
4 4::::::::4
5 4:::::::::4
6 4::::44::::4
7 4::::4 4::::4 Four Island
8 4::::4 4::::4
9 4::::4 4::::4 Written and maintained by Starla Insigna
104::::444444::::444
114::::::::::::::::4 includes/parsers.php
124444444444:::::444
13 4::::4 Please do not use, reproduce or steal the
14 4::::4 contents of this file without explicit
15 4::::4 permission from Hatkirby.
16 44::::::44
17 4::::::::4
18 4444444444
19*/
20
21if (!defined('S_INCLUDE_FILE')) {define('S_INCLUDE_FILE',1);}
22
23require('headerproc.php');
24
25include('includes/bbcode.php');
26include('includes/smilies.php');
27
28function parseText($text)
29{
30 $text = parseBBCode($text);
31 $text = parseSmilies($text);
32
33 return $text;
34}
35
36?>
diff --git a/includes/smilies.php b/includes/smilies.php new file mode 100755 index 0000000..843af05 --- /dev/null +++ b/includes/smilies.php
@@ -0,0 +1,64 @@
1<?php
2/*
3 444444444
4 4::::::::4
5 4:::::::::4
6 4::::44::::4
7 4::::4 4::::4 Four Island
8 4::::4 4::::4
9 4::::4 4::::4 Written and maintained by Starla Insigna
104::::444444::::444
114::::::::::::::::4 includes/smilies.php
124444444444:::::444
13 4::::4 Please do not use, reproduce or steal the
14 4::::4 contents of this file without explicit
15 4::::4 permission from Hatkirby.
16 44::::::44
17 4::::::::4
18 4444444444
19*/
20
21if (!defined('S_INCLUDE_FILE')) {define('S_INCLUDE_FILE',1);}
22
23require('headerproc.php');
24
25class Smilies
26{
27 var $init = false;
28 var $smilies;
29
30 function init()
31 {
32 $this->smilies[':)'] = '001_smile.gif';
33
34 $this->init = true;
35 }
36
37 function parseSmilies($text)
38 {
39 if (!$this->init)
40 {
41 $this->init();
42 }
43
44 foreach ($this->smilies as $name => $value)
45 {
46 $text = str_replace($name, '<IMG SRC="http://fourisland.com/theme/images/smilies/' . $value . '" ALT="' . $name . '" />', $text);
47 }
48
49 return $text;
50 }
51}
52
53function parseSmilies($text)
54{
55 global $smilies;
56 if (!isset($smilies))
57 {
58 $smilies = new Smilies();
59 }
60
61 return $smilies->parseSmilies($text);
62}
63
64?>
diff --git a/index.php b/index.php index 9faecc9..6a04591 100755 --- a/index.php +++ b/index.php
@@ -27,7 +27,7 @@ include('includes/db.php');
27include('includes/template.php'); 27include('includes/template.php');
28include('includes/mantainence.php'); 28include('includes/mantainence.php');
29include('includes/session.php'); 29include('includes/session.php');
30include('includes/bbcode.php'); 30include('includes/parsers.php');
31include('includes/xmlrpc/xmlrpc.inc'); 31include('includes/xmlrpc/xmlrpc.inc');
32include('includes/specialdates.php'); 32include('includes/specialdates.php');
33include('includes/functions.php'); 33include('includes/functions.php');
diff --git a/pages/admin.php b/pages/admin.php index aff21cf..a171b6f 100755 --- a/pages/admin.php +++ b/pages/admin.php
@@ -240,7 +240,7 @@ if (isLoggedIn())
240 'TITLE' => $getdraft3['title'], 240 'TITLE' => $getdraft3['title'],
241 'AUTHOR' => $getdraft3['author'], 241 'AUTHOR' => $getdraft3['author'],
242 'RATING' => 0, 242 'RATING' => 0,
243 'TEXT' => parseBBCode($getdraft3['text']))); 243 'TEXT' => parseText($getdraft3['text'])));
244 244
245 $tags = getTags($getdraft3['id'], 'draft'); 245 $tags = getTags($getdraft3['id'], 'draft');
246 foreach ($tags as $tag) 246 foreach ($tags as $tag)
@@ -342,7 +342,7 @@ if (isLoggedIn())
342 'TITLE' => $getpending3['title'], 342 'TITLE' => $getpending3['title'],
343 'AUTHOR' => $getpending3['author'], 343 'AUTHOR' => $getpending3['author'],
344 'RATING' => 0, 344 'RATING' => 0,
345 'TEXT' => parseBBCode($getpending3['text']))); 345 'TEXT' => parseText($getpending3['text'])));
346 346
347 $tags = getTags($getpending3['id'], 'pending'); 347 $tags = getTags($getpending3['id'], 'pending');
348 foreach ($tags as $tag) 348 foreach ($tags as $tag)
@@ -554,7 +554,7 @@ if (isLoggedIn())
554 $template->add('ID', $_GET['id']); 554 $template->add('ID', $_GET['id']);
555 $template->add('USERNAME', $getcomment3['author']); 555 $template->add('USERNAME', $getcomment3['author']);
556 $template->add('CODEDEMAIL', md5(strtolower($getuser3['email']))); 556 $template->add('CODEDEMAIL', md5(strtolower($getuser3['email'])));
557 $template->add('TEXT', parseBBCode($getcomment3['comment'])); 557 $template->add('TEXT', parseText($getcomment3['comment']));
558 $template->add('DATE', date("F dS Y \a\\t g:i:s a",strtotime($getcomment3['pubDate']))); 558 $template->add('DATE', date("F dS Y \a\\t g:i:s a",strtotime($getcomment3['pubDate'])));
559 } else { 559 } else {
560 $template = new FITemplate('msg'); 560 $template = new FITemplate('msg');
diff --git a/pages/blog.php b/pages/blog.php index d55f9a4..a03d3b1 100755 --- a/pages/blog.php +++ b/pages/blog.php
@@ -72,7 +72,7 @@ if (isset($_GET['post']))
72 'TITLE' => $getpost3['title'], 72 'TITLE' => $getpost3['title'],
73 'AUTHOR' => $getpost3['author'], 73 'AUTHOR' => $getpost3['author'],
74 'RATING' => $getpost3['rating'], 74 'RATING' => $getpost3['rating'],
75 'TEXT' => parseBBCode($getpost3['text']))); 75 'TEXT' => parseText($getpost3['text'])));
76 76
77 $tags = getTags($getpost3['id']); 77 $tags = getTags($getpost3['id']);
78 foreach ($tags as $tag) 78 foreach ($tags as $tag)
diff --git a/pages/poll.php b/pages/poll.php index 2dee559..d9cce70 100755 --- a/pages/poll.php +++ b/pages/poll.php
@@ -112,7 +112,7 @@ if (isset($_GET['submit']))
112 112
113 if ($getrss3['id'] == $_GET['id']) 113 if ($getrss3['id'] == $_GET['id'])
114 { 114 {
115 $template->adds_block('COMPLETE', array( 'RSS' => parseBBCode($getrss3['rss']), 115 $template->adds_block('COMPLETE', array( 'RSS' => parseText($getrss3['rss']),
116 'AUTHOR' => $getrss3['author'], 116 'AUTHOR' => $getrss3['author'],
117 'DATE' => date("F dS Y \a\\t g:i:s a",strtotime($getrss3['date'])), 117 'DATE' => date("F dS Y \a\\t g:i:s a",strtotime($getrss3['date'])),
118 'OPTION1' => $getpoll3['option1'], 118 'OPTION1' => $getpoll3['option1'],
diff --git a/pages/welcome.php b/pages/welcome.php index 6e06006..e224c8e 100755 --- a/pages/welcome.php +++ b/pages/welcome.php
@@ -68,7 +68,7 @@ while ($getpost3 = mysql_fetch_array($getpost2))
68 'PLURALCOMMENT' => (isset($plural) ? $plural : ''), 68 'PLURALCOMMENT' => (isset($plural) ? $plural : ''),
69 'COMMENTS' => $comText, 69 'COMMENTS' => $comText,
70 'RATING' => $getpost3['rating'], 70 'RATING' => $getpost3['rating'],
71 'TEXT' => parseBBCode($getpost3['text']))); 71 'TEXT' => parseText($getpost3['text'])));
72 72
73 $tags = getTags($getpost3['id']); 73 $tags = getTags($getpost3['id']);
74 foreach ($tags as $tag) 74 foreach ($tags as $tag)
diff --git a/rss.php b/rss.php index c232fe3..176ea32 100755 --- a/rss.php +++ b/rss.php
@@ -232,7 +232,7 @@ foreach ($items as $key => $value)
232 232
233 <link>http://fourisland.com/blog/<?php echo($value['slug']); ?>/</link> 233 <link>http://fourisland.com/blog/<?php echo($value['slug']); ?>/</link>
234 234
235 <description><?php echo(stripslashes(htmlentities(parseBBCode($value['text'])))); ?></description> 235 <description><?php echo(stripslashes(htmlentities(parseText($value['text'])))); ?></description>
236 236
237 <pubDate><?php echo(date('D, d M Y H:i:s O',$value['sortDate'])); ?></pubDate> 237 <pubDate><?php echo(date('D, d M Y H:i:s O',$value['sortDate'])); ?></pubDate>
238 </item> 238 </item>
@@ -260,7 +260,7 @@ foreach ($items as $key => $value)
260 260
261 <link>http://fourisland.com/<?php echo($value['url']); ?>#comment-<?php echo($value['id']); ?></link> 261 <link>http://fourisland.com/<?php echo($value['url']); ?>#comment-<?php echo($value['id']); ?></link>
262 262
263 <description><?php echo(stripslashes(htmlentities(parseBBCode($value['comment'])))); ?></description> 263 <description><?php echo(stripslashes(htmlentities(parseText($value['comment'])))); ?></description>
264 264
265 <pubDate><?php echo(date('D, d M Y H:i:s O',$value['sortDate'])); ?></pubDate> 265 <pubDate><?php echo(date('D, d M Y H:i:s O',$value['sortDate'])); ?></pubDate>
266 </item> 266 </item>
diff --git a/theme/images/smilies/001_smile.gif b/theme/images/smilies/001_smile.gif new file mode 100644 index 0000000..f8dc278 --- /dev/null +++ b/theme/images/smilies/001_smile.gif
Binary files differ