├── cache ├── .cvsignore └── .htaccess ├── templates ├── bottom.inc.php ├── error.404.tpl.php ├── error.500.tpl.php ├── sidebar.block.watchlist.php ├── sidebar.tpl.php ├── tagdelete.tpl.php ├── sidebar.block.profile.php ├── tags.tpl.php ├── sidebar.block.common.php ├── sidebar.block.watchstatus.php ├── sidebar.block.tagactions.php ├── sidebar.block.related.php ├── password.tpl.php ├── sidebar.block.popular.php ├── rss.tpl.php ├── tagrename.tpl.php ├── toolbar.inc.php ├── sidebar.block.recent.php ├── login.tpl.php ├── about.tpl.php ├── importDelicious.tpl.php ├── top.inc.php ├── editprofile.tpl.php ├── profile.tpl.php ├── importNetscape.tpl.php └── register.tpl.php ├── .cvsignore ├── rss.gif ├── icon.png ├── logo.png ├── bg_bar.png ├── loading.gif ├── logo_24.png ├── bg_header.png ├── bg_sidebar.png ├── includes ├── player │ ├── load.swf │ ├── play.swf │ ├── stop.swf │ ├── error.swf │ ├── musicplayer_f6.swf │ └── license.txt ├── php-gettext │ ├── examples │ │ ├── locale │ │ │ ├── de_CH │ │ │ │ └── LC_MESSAGES │ │ │ │ │ ├── messages.mo │ │ │ │ │ └── messages.po │ │ │ └── sr_CS │ │ │ │ └── LC_MESSAGES │ │ │ │ ├── messages.mo │ │ │ │ └── messages.po │ │ ├── update │ │ ├── index.php │ │ ├── pigs_fallback.php │ │ └── pigs_dropin.php │ ├── AUTHORS │ ├── Makefile │ └── tests │ │ ├── ParsingTest.php │ │ └── LocalesTest.php ├── utf8 │ ├── tests │ │ ├── bench │ │ │ ├── strlen.php │ │ │ ├── strpos.php │ │ │ ├── strrpos.php │ │ │ └── substr.php │ │ ├── runtests.php │ │ ├── benchconfig.php │ │ ├── index.php │ │ ├── cases │ │ │ ├── utf8_strtolower.test.php │ │ │ ├── utf8_strtoupper.test.php │ │ │ ├── utf8_strlen.test.php │ │ │ ├── utf8_strrev.test.php │ │ │ ├── utf8_ord.test.php │ │ │ ├── utf8_strpos.test.php │ │ │ ├── utf8_str_pad.test.php │ │ │ ├── utf8_strcspn.test.php │ │ │ ├── utf8_strspn.test.php │ │ │ ├── utf8_ucfirst.test.php │ │ │ ├── utf8_strrpos.test.php │ │ │ ├── utf8_ucwords.test.php │ │ │ ├── utf8_substr_replace.test.php │ │ │ ├── utf8_stristr.test.php │ │ │ ├── utf8_strcasecmp.test.php │ │ │ ├── utf8_str_split.test.php │ │ │ ├── utf8_specials.test.php │ │ │ └── utf8_substr.test.php │ │ ├── data │ │ │ └── bench │ │ │ │ ├── strlen_native_20060226.txt │ │ │ │ ├── strlen_native_20061001.txt │ │ │ │ ├── strpos_native_20060226.txt │ │ │ │ ├── strpos_native_20061001.txt │ │ │ │ ├── substr_native_20060226.txt │ │ │ │ ├── substr_native_20061001.txt │ │ │ │ ├── strlen_mbstring_20060226.txt │ │ │ │ ├── strlen_mbstring_20061001.txt │ │ │ │ ├── strpos_mbstring_20060226.txt │ │ │ │ ├── strpos_mbstring_20061001.txt │ │ │ │ ├── strrpos_native_20060226.txt │ │ │ │ ├── strrpos_native_20061001.txt │ │ │ │ ├── substr_mbstring_20060226.txt │ │ │ │ ├── substr_mbstring_20061001.txt │ │ │ │ ├── strrpos_mbstring_20060226.txt │ │ │ │ └── strrpos_mbstring_20061001.txt │ │ └── config.php │ ├── strrev.php │ ├── strcasecmp.php │ ├── substr_replace.php │ ├── docs │ │ ├── makeDocs.pl │ │ ├── examples │ │ │ └── 1.php │ │ ├── screen.css │ │ └── print.css │ ├── ucfirst.php │ ├── stristr.php │ ├── strspn.php │ ├── str_split.php │ ├── strcspn.php │ ├── ucwords.php │ ├── exp │ │ └── regexunicode.php │ ├── str_pad.php │ ├── trim.php │ ├── utf8.php │ ├── str_ireplace.php │ ├── ord.php │ └── utils │ │ └── patterns.php └── db │ └── index.htm ├── locales ├── de_DE │ └── LC_MESSAGES │ │ └── messages.mo ├── dk_DK │ └── LC_MESSAGES │ │ └── messages.mo ├── en_GB │ └── LC_MESSAGES │ │ └── messages.mo ├── es_ES │ └── LC_MESSAGES │ │ └── messages.mo ├── fr_FR │ └── LC_MESSAGES │ │ └── messages.mo ├── hi_IN │ └── LC_MESSAGES │ │ └── messages.mo ├── it_IT │ └── LC_MESSAGES │ │ └── messages.mo ├── ja_JP │ └── LC_MESSAGES │ │ └── messages.mo ├── lt_LT │ └── LC_MESSAGES │ │ └── messages.mo ├── nl_NL │ └── LC_MESSAGES │ │ └── messages.mo ├── pt_BR │ └── LC_MESSAGES │ │ └── messages.mo └── zh_CN │ └── LC_MESSAGES │ └── messages.mo ├── api ├── .htaccess ├── httpauth.inc.php ├── tags_get.php ├── posts_update.php ├── tags_rename.php ├── posts_delete.php ├── posts_dates.php ├── posts_all.php ├── posts_recent.php ├── posts_add.php └── posts_get.php ├── debug.inc.php ├── AUTHORS ├── readme.txt ├── services ├── cacheservice.php ├── templateservice.php └── servicefactory.php ├── about.php ├── header.inc.php ├── ajaxIsAvailable.php ├── ajaxDelete.php ├── search.inc.php ├── tables.sql ├── tagdelete.php ├── watch.php ├── ajaxGetTitle.php ├── login.php ├── jsScuttle.php ├── tagrename.php ├── index.php ├── alltags.php ├── password.php ├── tags.php └── populartags.php /cache/.cvsignore: -------------------------------------------------------------------------------- 1 | *.cache -------------------------------------------------------------------------------- /templates/bottom.inc.php: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /cache/.htaccess: -------------------------------------------------------------------------------- 1 | order allow,deny 2 | deny from all -------------------------------------------------------------------------------- /.cvsignore: -------------------------------------------------------------------------------- 1 | *.~*~ 2 | #*# 3 | *.project 4 | config.inc.php 5 | -------------------------------------------------------------------------------- /rss.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/scuttle/master/rss.gif -------------------------------------------------------------------------------- /icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/scuttle/master/icon.png -------------------------------------------------------------------------------- /logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/scuttle/master/logo.png -------------------------------------------------------------------------------- /bg_bar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/scuttle/master/bg_bar.png -------------------------------------------------------------------------------- /loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/scuttle/master/loading.gif -------------------------------------------------------------------------------- /logo_24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/scuttle/master/logo_24.png -------------------------------------------------------------------------------- /bg_header.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/scuttle/master/bg_header.png -------------------------------------------------------------------------------- /bg_sidebar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/scuttle/master/bg_sidebar.png -------------------------------------------------------------------------------- /includes/player/load.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/scuttle/master/includes/player/load.swf -------------------------------------------------------------------------------- /includes/player/play.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/scuttle/master/includes/player/play.swf -------------------------------------------------------------------------------- /includes/player/stop.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/scuttle/master/includes/player/stop.swf -------------------------------------------------------------------------------- /includes/player/error.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/scuttle/master/includes/player/error.swf -------------------------------------------------------------------------------- /includes/player/musicplayer_f6.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/scuttle/master/includes/player/musicplayer_f6.swf -------------------------------------------------------------------------------- /locales/de_DE/LC_MESSAGES/messages.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/scuttle/master/locales/de_DE/LC_MESSAGES/messages.mo -------------------------------------------------------------------------------- /locales/dk_DK/LC_MESSAGES/messages.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/scuttle/master/locales/dk_DK/LC_MESSAGES/messages.mo -------------------------------------------------------------------------------- /locales/en_GB/LC_MESSAGES/messages.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/scuttle/master/locales/en_GB/LC_MESSAGES/messages.mo -------------------------------------------------------------------------------- /locales/es_ES/LC_MESSAGES/messages.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/scuttle/master/locales/es_ES/LC_MESSAGES/messages.mo -------------------------------------------------------------------------------- /locales/fr_FR/LC_MESSAGES/messages.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/scuttle/master/locales/fr_FR/LC_MESSAGES/messages.mo -------------------------------------------------------------------------------- /locales/hi_IN/LC_MESSAGES/messages.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/scuttle/master/locales/hi_IN/LC_MESSAGES/messages.mo -------------------------------------------------------------------------------- /locales/it_IT/LC_MESSAGES/messages.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/scuttle/master/locales/it_IT/LC_MESSAGES/messages.mo -------------------------------------------------------------------------------- /locales/ja_JP/LC_MESSAGES/messages.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/scuttle/master/locales/ja_JP/LC_MESSAGES/messages.mo -------------------------------------------------------------------------------- /locales/lt_LT/LC_MESSAGES/messages.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/scuttle/master/locales/lt_LT/LC_MESSAGES/messages.mo -------------------------------------------------------------------------------- /locales/nl_NL/LC_MESSAGES/messages.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/scuttle/master/locales/nl_NL/LC_MESSAGES/messages.mo -------------------------------------------------------------------------------- /locales/pt_BR/LC_MESSAGES/messages.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/scuttle/master/locales/pt_BR/LC_MESSAGES/messages.mo -------------------------------------------------------------------------------- /locales/zh_CN/LC_MESSAGES/messages.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/scuttle/master/locales/zh_CN/LC_MESSAGES/messages.mo -------------------------------------------------------------------------------- /includes/php-gettext/examples/locale/de_CH/LC_MESSAGES/messages.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/scuttle/master/includes/php-gettext/examples/locale/de_CH/LC_MESSAGES/messages.mo -------------------------------------------------------------------------------- /includes/php-gettext/examples/locale/sr_CS/LC_MESSAGES/messages.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TarekJor/scuttle/master/includes/php-gettext/examples/locale/sr_CS/LC_MESSAGES/messages.mo -------------------------------------------------------------------------------- /includes/utf8/tests/bench/strlen.php: -------------------------------------------------------------------------------- 1 | 5 | -------------------------------------------------------------------------------- /includes/php-gettext/AUTHORS: -------------------------------------------------------------------------------- 1 | Danilo Segan 2 | Nico Kaiser (contributed most changes between 1.0.2 and 1.0.3, bugfix for 1.0.5) 3 | Steven Armstrong (gettext.inc, leading to 1.0.6) 4 | -------------------------------------------------------------------------------- /includes/db/index.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /includes/utf8/tests/bench/strpos.php: -------------------------------------------------------------------------------- 1 | 8 | -------------------------------------------------------------------------------- /includes/utf8/tests/bench/strrpos.php: -------------------------------------------------------------------------------- 1 | 8 | -------------------------------------------------------------------------------- /includes/utf8/tests/bench/substr.php: -------------------------------------------------------------------------------- 1 | 9 | -------------------------------------------------------------------------------- /templates/error.404.tpl.php: -------------------------------------------------------------------------------- 1 | includeTemplate($GLOBALS['top_include']); 4 | if (!$error) { 5 | echo '

'. T_('Not Found') .'

'; 6 | echo '

'. T_('The requested URL was not found on this server') .'

'; 7 | } 8 | $this->includeTemplate($GLOBALS['bottom_include']); 9 | ?> -------------------------------------------------------------------------------- /templates/error.500.tpl.php: -------------------------------------------------------------------------------- 1 | includeTemplate($GLOBALS['top_include']); 4 | if (!$error) { 5 | echo '

'. T_('General server error') .'

'; 6 | echo '

'. T_('The requested URL could not be processed') .'

'; 7 | } 8 | $this->includeTemplate($GLOBALS['bottom_include']); 9 | ?> 10 | -------------------------------------------------------------------------------- /api/.htaccess: -------------------------------------------------------------------------------- 1 | RewriteEngine On 2 | RewriteRule ^tags/get tags_get.php 3 | RewriteRule ^posts/dates posts_dates.php 4 | RewriteRule ^posts/get posts_get.php 5 | RewriteRule ^posts/recent posts_recent.php 6 | RewriteRule ^posts/all posts_all.php 7 | RewriteRule ^posts/update posts_update.php 8 | RewriteRule ^posts/add posts_add.php 9 | RewriteRule ^posts/delete posts_delete.php 10 | RewriteRule ^tags/rename tags_rename.php -------------------------------------------------------------------------------- /includes/php-gettext/examples/update: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | TEMPLATE=pigs.pot 3 | xgettext -kT_ngettext:1,2 -kT_ -L PHP -o $TEMPLATE pigs_dropin.php 4 | if [ "x$1" = "x-p" ]; then 5 | msgfmt --statistics $TEMPLATE 6 | else 7 | if [ -f $1.po ]; then 8 | msgmerge -o .tmp$1.po $1.po $TEMPLATE 9 | mv .tmp$1.po $1.po 10 | msgfmt --statistics $1.po 11 | else 12 | echo "Usage: $0 [-p|]" 13 | fi 14 | fi 15 | -------------------------------------------------------------------------------- /debug.inc.php: -------------------------------------------------------------------------------- 1 | 14 | http://savannah.nongnu.org/projects/php-gettext/ 15 | 16 | PHP UTF-8 17 | https://sourceforge.net/projects/phputf8/ 18 | 19 | XSPF Web Music Player (Flash) 20 | http://musicplayer.sourceforge.net/ -------------------------------------------------------------------------------- /templates/sidebar.block.watchlist.php: -------------------------------------------------------------------------------- 1 | getWatchNames($userid); 5 | if ($watching) { 6 | ?> 7 | 8 |

9 |
10 |
    11 | 12 |
  • 13 | 14 |
15 |
16 | 17 | -------------------------------------------------------------------------------- /templates/sidebar.tpl.php: -------------------------------------------------------------------------------- 1 | 14 | -------------------------------------------------------------------------------- /readme.txt: -------------------------------------------------------------------------------- 1 | Scuttle 0.9.0 2 | http://scuttle.org/ 3 | 4 | Copyright (C) 2004 - 2010 Marcus Campbell 5 | Available under the GNU General Public License 6 | 7 | ============ 8 | INSTALLATION 9 | ============ 10 | 11 | * Use the SQL contained in tables.sql to create the necessary database tables. This file was written specifically for MySQL, so may need rewritten if you intend to use a different database system. 12 | 13 | * Edit config.inc.php.example and save the changes as a new config.inc.php file in the same directory. 14 | 15 | * Set the CHMOD permissions on the /cache/ subdirectory to 777 -------------------------------------------------------------------------------- /templates/tagdelete.tpl.php: -------------------------------------------------------------------------------- 1 | includeTemplate($GLOBALS['top_include']); 3 | ?> 4 | 5 |
6 |

7 |

8 | 9 | 10 |

11 | 12 | 13 |
14 | 15 | 16 |
17 | 18 | includeTemplate($GLOBALS['bottom_include']); 20 | ?> -------------------------------------------------------------------------------- /includes/utf8/strrev.php: -------------------------------------------------------------------------------- 1 | 0) { 4 | $name = $userinfo['name']; 5 | } else { 6 | $name = $userinfo['username']; 7 | } 8 | ?> 9 |

10 |
11 |
    12 |
  • 13 |
  • 14 |
  • 15 |
16 |
17 | -------------------------------------------------------------------------------- /includes/utf8/strcasecmp.php: -------------------------------------------------------------------------------- 1 | login($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']); 18 | if (!$login) { 19 | authenticate(); 20 | } 21 | } 22 | ?> -------------------------------------------------------------------------------- /includes/utf8/substr_replace.php: -------------------------------------------------------------------------------- 1 | includeTemplate($GLOBALS['top_include']); 3 | if ($tags && count($tags) > 0) { 4 | ?> 5 | 6 |

7 | 8 | / 9 | 10 |

11 |

12 | 13 | '. filter($row['tag']) .' '; 18 | } 19 | echo $contents ."\n"; 20 | ?> 21 | 22 |

23 | 24 | includeTemplate($GLOBALS['bottom_include']); 27 | ?> -------------------------------------------------------------------------------- /templates/sidebar.block.common.php: -------------------------------------------------------------------------------- 1 | getRelatedTagsByHash($hash); 4 | $commonTags =& $tagservice->tagCloud($commonTags, 5, 90, 225, 'alphabet_asc'); 5 | 6 | if ($commonTags && count($commonTags) > 0) { 7 | ?> 8 | 9 |

10 |
11 |

12 | '. filter($row['tag']) .' '; 17 | } 18 | echo $contents ."\n"; 19 | ?> 20 |

21 |
22 | 23 | -------------------------------------------------------------------------------- /templates/sidebar.block.watchstatus.php: -------------------------------------------------------------------------------- 1 | isLoggedOn()) { 4 | $currentUser = $userservice->getCurrentUser(); 5 | $currentUsername = $currentUser[$userservice->getFieldName('username')]; 6 | 7 | if ($currentUsername != $user) { 8 | $result = $userservice->getWatchStatus($userid, $userservice->getCurrentUserId()); 9 | if ($result) { 10 | $linkText = T_('Remove from Watchlist'); 11 | } else { 12 | $linkText = T_('Add to Watchlist'); 13 | } 14 | $linkAddress = createURL('watch', $user); 15 | ?> 16 | 17 |

18 |
19 |
    20 |
  • 21 |
22 |
23 | 24 | -------------------------------------------------------------------------------- /api/tags_get.php: -------------------------------------------------------------------------------- 1 | getTags($userservice->getCurrentUserId()); 16 | 17 | // Set up the XML file and output all the tags. 18 | header('Content-Type: text/xml'); 19 | echo '\r\n"; 20 | echo "\r\n"; 21 | foreach ($tags as $row) { 22 | echo "\t\r\n"; 23 | } 24 | echo ""; 25 | -------------------------------------------------------------------------------- /includes/utf8/tests/runtests.php: -------------------------------------------------------------------------------- 1 | GroupTest('All PHPUTF8 Tests'); 10 | $this->loadGroups(); 11 | } 12 | 13 | function loadGroups() { 14 | $path = dirname(__FILE__).'/cases'; 15 | if ( $d = opendir($path) ) { 16 | while (($file = readdir($d)) !== false) { 17 | if ( is_file($path.'/'.$file) ) { 18 | $farray = explode('.',$file); 19 | if ( $farray[1] == 'test' ) { 20 | $this->AddTestFile($path.'/'.$file); 21 | } 22 | } 23 | } 24 | closedir($d); 25 | } 26 | } 27 | } 28 | /** 29 | * Run the tests 30 | */ 31 | $test = &new AllTests(); 32 | $test->run(getTestReporter()); 33 | -------------------------------------------------------------------------------- /api/posts_update.php: -------------------------------------------------------------------------------- 1 | getBookmarks(0, 1, $userservice->getCurrentUserId()); 16 | 17 | // Set up the XML file and output all the tags. 18 | header('Content-Type: text/xml'); 19 | echo '\r\n"; 20 | foreach ($bookmarks['bookmarks'] as $row) { 21 | echo ''; 22 | } 23 | -------------------------------------------------------------------------------- /includes/utf8/docs/makeDocs.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | 3 | use strict; 4 | use Pod::Xhtml; 5 | use File::Basename; 6 | 7 | my $filename = 'phputf8.pod'; 8 | 9 | my $basename = basename($filename); 10 | $basename =~ s/.[a-z]{3}$//; 11 | 12 | 13 | my $POD = Pod::Xhtml->new(); 14 | 15 | $POD->addHeadText(''); 17 | $POD->addHeadText(''); 18 | $POD->addHeadText(''); 19 | $POD->addBodyOpenText(''); 22 | $POD->addBodyOpenText(''); 25 | 26 | $POD->parse_from_file('phputf8.pod'); 27 | 28 | -------------------------------------------------------------------------------- /templates/sidebar.block.tagactions.php: -------------------------------------------------------------------------------- 1 | isLoggedOn()) { 4 | $currentUser = $userservice->getCurrentUser(); 5 | $currentUsername = $currentUser[$userservice->getFieldName('username')]; 6 | 7 | if ($currentUsername == $user) { 8 | $tags = explode('+', $currenttag); 9 | $renametext = T_ngettext('Rename Tag', 'Rename Tags', count($tags)); 10 | $renamelink = createURL('tagrename', $currenttag); 11 | $deletelink = createURL('tagdelete', $currenttag); 12 | ?> 13 | 14 |

15 |
16 |
    17 |
  • 18 | 19 |
  • 20 | 21 |
22 |
23 | 24 | -------------------------------------------------------------------------------- /includes/php-gettext/examples/locale/de_CH/LC_MESSAGES/messages.po: -------------------------------------------------------------------------------- 1 | # Sample translation for PHP-gettext 1.0 2 | # Copyright (c) 2003 Danilo Segan 3 | # 4 | msgid "" 5 | msgstr "" 6 | "Project-Id-Version: pigs\n" 7 | "Report-Msgid-Bugs-To: \n" 8 | "POT-Creation-Date: 2003-10-23 04:50+0200\n" 9 | "PO-Revision-Date: 2003-11-01 23:40+0100\n" 10 | "Last-Translator: Danilo Segan \n" 11 | "Language-Team: Serbian (sr) \n" 12 | "MIME-Version: 1.0\n" 13 | "Content-Type: text/plain; charset=UTF-8\n" 14 | "Content-Transfer-Encoding: 8bit\n" 15 | #"Plural-Forms: nplurals=2; plural=n != 1;\n" 16 | 17 | #: pigs.php:19 18 | msgid "" 19 | "This is how the story goes.\n" 20 | "\n" 21 | msgstr "" 22 | "Und so geht die Geschichte.\n" 23 | "\n" 24 | 25 | #: pigs.php:21 26 | #, php-format 27 | msgid "%d pig went to the market\n" 28 | msgid_plural "%d pigs went to the market\n" 29 | msgstr[0] "%d Schwein ging zum Markt\n" 30 | msgstr[1] "%d Schweine gingen zum Markt\n" 31 | -------------------------------------------------------------------------------- /includes/utf8/tests/benchconfig.php: -------------------------------------------------------------------------------- 1 | \n"; 16 | 17 | # Check it's a well formed UTF-8 string 18 | require_once UTF8 . '/utils/validation.php'; 19 | if ( utf8_is_valid($str) ) { 20 | print "It's well formed UTF-8
\n"; 21 | } else { 22 | print "It's badly formed UTF-8 - this shouldn't happen
\n"; 23 | } 24 | 25 | print "Num chars: ".utf8_strlen($str)."
\n"; 26 | 27 | print "Uppercase: ".utf8_strtoupper($str)."
\n"; 28 | 29 | # Load an additional function; 30 | require_once UTF8 . '/strrev.php'; 31 | 32 | print "Reversed: ".utf8_strrev($str)."
\n"; 33 | ?> -------------------------------------------------------------------------------- /includes/php-gettext/examples/index.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | PHP-gettext examples 4 | 5 | 6 |

PHP-gettext

7 | 8 |

Introduction

9 |

PHP-gettext provides a simple gettext replacement that works independently from the system's gettext abilities. 10 | It can read MO files and use them for translating strings.

11 |

This version has the ability to cache all strings and translations to speed up the string lookup. 12 | While the cache is enabled by default, it can be switched off with the second parameter in the constructor (e.g. when using very large MO files 13 | that you don't want to keep in memory)

14 | 15 | 16 |

Examples

17 | 21 | 22 |
23 |

Copyright (c) 2003-2006 Danilo Segan

24 |

Copyright (c) 2005-2006 Steven Armstrong

25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /includes/utf8/stristr.php: -------------------------------------------------------------------------------- 1 | basedir = $GLOBALS['dir_cache']; 16 | } 17 | 18 | function Start($hash, $time = 300) { 19 | $cachefile = $this->basedir .'/'. $hash . $this->fileextension; 20 | if (file_exists($cachefile) && time() < filemtime($cachefile) + $time) { 21 | @readfile($cachefile); 22 | echo "\n\n"; 23 | unset($cachefile); 24 | exit; 25 | } 26 | ob_start("ob_gzhandler"); 27 | } 28 | 29 | function End($hash) { 30 | $cachefile = $this->basedir .'/'. $hash . $this->fileextension; 31 | $handle = fopen($cachefile, 'w'); 32 | fwrite($handle, ob_get_contents()); 33 | fclose($handle); 34 | ob_flush(); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /templates/sidebar.block.related.php: -------------------------------------------------------------------------------- 1 | getCurrentUserId(); 6 | if ($logged_on_userid === false) { 7 | $logged_on_userid = NULL; 8 | } 9 | if ($currenttag) { 10 | $relatedTags = $tagservice->getRelatedTags($currenttag, $userid, $logged_on_userid); 11 | if (sizeof($relatedTags) > 0) { 12 | ?> 13 | 14 |

15 | 25 | 26 | -------------------------------------------------------------------------------- /includes/utf8/str_split.php: -------------------------------------------------------------------------------- 1 | includeTemplate($GLOBALS['top_include']); 3 | ?> 4 | 5 |

6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 |
23 | 24 | includeTemplate($GLOBALS['bottom_include']); 26 | ?> -------------------------------------------------------------------------------- /includes/php-gettext/examples/locale/sr_CS/LC_MESSAGES/messages.po: -------------------------------------------------------------------------------- 1 | # Sample translation for PHP-gettext 1.0 2 | # Copyright (c) 2003,2006 Danilo Segan 3 | # 4 | msgid "" 5 | msgstr "" 6 | "Project-Id-Version: pigs\n" 7 | "Report-Msgid-Bugs-To: \n" 8 | "POT-Creation-Date: 2003-10-23 04:50+0200\n" 9 | "PO-Revision-Date: 2006-02-02 21:06+0100\n" 10 | "Last-Translator: Danilo Segan \n" 11 | "Language-Team: Serbian (sr) \n" 12 | "MIME-Version: 1.0\n" 13 | "Content-Type: text/plain; charset=UTF-8\n" 14 | "Content-Transfer-Encoding: 8bit\n" 15 | "Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && " 16 | "n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" 17 | 18 | #: pigs.php:19 19 | msgid "" 20 | "This is how the story goes.\n" 21 | "\n" 22 | msgstr "Овако иде прича.\n\n" 23 | 24 | #: pigs.php:21 25 | #, php-format 26 | msgid "%d pig went to the market\n" 27 | msgid_plural "%d pigs went to the market\n" 28 | msgstr[0] "%d мало прасе је отишло на пијац\n" 29 | msgstr[1] "%d мала прасета су отишла на пијац\n" 30 | msgstr[2] "%d малих прасића је отишло на пијац\n" 31 | -------------------------------------------------------------------------------- /templates/sidebar.block.popular.php: -------------------------------------------------------------------------------- 1 | getCurrentUserId(); 6 | if ($logged_on_userid === false) { 7 | $logged_on_userid = NULL; 8 | } 9 | $popularTags =& $tagservice->getPopularTags($userid, $popCount, $logged_on_userid); 10 | $popularTags =& $tagservice->tagCloud($popularTags, 5, 90, 225, 'alphabet_asc'); 11 | 12 | if ($popularTags && count($popularTags) > 0) { 13 | ?> 14 | 15 |

16 | 28 | 29 | -------------------------------------------------------------------------------- /includes/utf8/tests/index.php: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | PHPUTF8 Tests 7 | 8 | 9 | 16 | 38 | 39 | -------------------------------------------------------------------------------- /includes/utf8/strcspn.php: -------------------------------------------------------------------------------- 1 | \n"; ?> 2 | 3 | 4 | <?php echo $feedtitle; ?> 5 | 6 | 7 | 60 8 | 9 | 10 | <?php echo $bookmark['title']; ?> 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /about.php: -------------------------------------------------------------------------------- 1 | loadTemplate('about.tpl', $tplVars); 27 | -------------------------------------------------------------------------------- /services/templateservice.php: -------------------------------------------------------------------------------- 1 | basedir = $GLOBALS['TEMPLATES_DIR']; 15 | } 16 | 17 | function loadTemplate($template, $vars = NULL) { 18 | if (substr($template, -4) != '.php') { 19 | $template .= '.php'; 20 | } 21 | $tpl = new Template($this->basedir .'/'. $template, $vars, $this); 22 | $tpl->parse(); 23 | return $tpl; 24 | } 25 | } 26 | 27 | class Template { 28 | var $vars = array(); 29 | var $file = ''; 30 | var $templateservice; 31 | 32 | function Template($file, $vars = NULL, &$templateservice) { 33 | $this->vars = $vars; 34 | $this->file = $file; 35 | $this->templateservice = $templateservice; 36 | } 37 | 38 | function parse() { 39 | if (isset($this->vars)) { 40 | extract($this->vars); 41 | } 42 | include $this->file; 43 | } 44 | 45 | function includeTemplate($name) { 46 | return $this->templateservice->loadTemplate($name, $this->vars); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /templates/tagrename.tpl.php: -------------------------------------------------------------------------------- 1 | includeTemplate($GLOBALS['top_include']); 3 | ?> 4 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 27 | 28 | 29 | 30 |
24 | 25 | 26 |
31 |

32 | 33 | 34 |
35 | 36 | 37 |
38 | 39 | includeTemplate($GLOBALS['bottom_include']); 41 | ?> 42 | 43 | -------------------------------------------------------------------------------- /templates/toolbar.inc.php: -------------------------------------------------------------------------------- 1 | isLoggedOn()) { 4 | $cUser = $userservice->getCurrentUser(); 5 | $cUsername = $cUser[$userservice->getFieldName('username')]; 6 | ?> 7 | 8 | 14 | 15 | 18 | 19 | 24 | 25 | 28 | -------------------------------------------------------------------------------- /header.inc.php: -------------------------------------------------------------------------------- 1 | getCurrentUserId(); 6 | if ($logged_on_userid === false) { 7 | $logged_on_userid = NULL; 8 | } 9 | $recentTags = $tagservice->getPopularTags($userid, $popCount, $logged_on_userid, $GLOBALS['defaultRecentDays']); 10 | $recentTags =& $tagservice->tagCloud($recentTags, 5, 90, 225, 'alphabet_asc'); 11 | 12 | if ($recentTags && count($recentTags) > 0) { 13 | ?> 14 | 15 |

16 |
17 | '; 19 | foreach ($recentTags as $row) { 20 | $entries = T_ngettext('bookmark', 'bookmarks', $row['bCount']); 21 | $contents .= ' '; 22 | } 23 | echo $contents ."

\n"; 24 | ?> 25 |

26 |
27 | 28 | -------------------------------------------------------------------------------- /api/tags_rename.php: -------------------------------------------------------------------------------- 1 | ) than the other API calls. 6 | 7 | // Force HTTP authentication first! 8 | require_once 'httpauth.inc.php'; 9 | require_once '../header.inc.php'; 10 | 11 | $tagservice =& ServiceFactory::getServiceInstance('TagService'); 12 | $userservice =& ServiceFactory::getServiceInstance('UserService'); 13 | 14 | // Get the tag info. 15 | if (isset($_REQUEST['old']) && (trim($_REQUEST['old']) != '')) 16 | $old = trim($_REQUEST['old']); 17 | else 18 | $old = NULL; 19 | 20 | if (isset($_REQUEST['new']) && (trim($_REQUEST['new']) != '')) 21 | $new = trim($_REQUEST['new']); 22 | else 23 | $new = NULL; 24 | 25 | if (is_null($old) || is_null($new)) { 26 | $renamed = FALSE; 27 | } 28 | else { 29 | // Rename the tag. 30 | $result = $tagservice->renameTag($userservice->getCurrentUserId(), $old, $new, TRUE); 31 | $renamed = $result; 32 | } 33 | 34 | // Set up the XML file and output the result. 35 | header('Content-Type: text/xml'); 36 | echo '\r\n"; 37 | echo ''. ($renamed ? 'done' : 'something went wrong') .''; 38 | -------------------------------------------------------------------------------- /api/posts_delete.php: -------------------------------------------------------------------------------- 1 | getBookmarkByAddress($_REQUEST['url']); 25 | $bid = $bookmark['bId']; 26 | $delete = $bookmarkservice->deleteBookmark($bid); 27 | $deleted = TRUE; 28 | } 29 | 30 | // Set up the XML file and output the result. 31 | header('Content-Type: text/xml'); 32 | echo '\r\n"; 33 | echo ''; 34 | -------------------------------------------------------------------------------- /services/servicefactory.php: -------------------------------------------------------------------------------- 1 | sql_connect($dbhost, $dbuser, $dbpass, $dbname, $dbport, $dbpersist); 14 | if(!$db->db_connect_id) { 15 | message_die(CRITICAL_ERROR, "Could not connect to the database", $db); 16 | } 17 | } 18 | if (!isset($instances[$name])) { 19 | if (isset($serviceoverrules[$name])) { 20 | $name = $serviceoverrules[$name]; 21 | } 22 | if (!class_exists($name)) { 23 | if (!isset($servicedir)) { 24 | $servicedir = dirname(__FILE__) .'/'; 25 | } 26 | require_once $servicedir . strtolower($name) .'.php'; 27 | } 28 | $instances[$name] = call_user_func(array($name, 'getInstance'), $db); 29 | } 30 | return $instances[$name]; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /templates/login.tpl.php: -------------------------------------------------------------------------------- 1 | includeTemplate($GLOBALS['top_include']); ?> 2 | 3 |
4 |
5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 |

»

23 | 24 | 29 | 30 | includeTemplate($GLOBALS['bottom_include']); ?> -------------------------------------------------------------------------------- /ajaxIsAvailable.php: -------------------------------------------------------------------------------- 1 | isReserved($_GET['username']) || $userservice->getUserByUsername($_GET['username'])); 28 | -------------------------------------------------------------------------------- /includes/utf8/tests/cases/utf8_strtolower.test.php: -------------------------------------------------------------------------------- 1 | UnitTestCase('utf8_strtolower()'); 25 | } 26 | 27 | function testLower() { 28 | $str = 'IÑTËRNÂTIÔNÀLIZÆTIØN'; 29 | $lower = 'iñtërnâtiônàlizætiøn'; 30 | $this->assertEqual(utf8_strtolower($str),$lower); 31 | } 32 | 33 | function testEmptyString() { 34 | $str = ''; 35 | $lower = ''; 36 | $this->assertEqual(utf8_strtolower($str),$lower); 37 | } 38 | } 39 | 40 | //-------------------------------------------------------------------- 41 | /** 42 | * @package utf8 43 | * @subpackage Tests 44 | */ 45 | if (!defined('TEST_RUNNING')) { 46 | define('TEST_RUNNING', true); 47 | $test = &new test_utf8_strtolower(); 48 | $reporter = & getTestReporter(); 49 | $test->run($reporter); 50 | } 51 | -------------------------------------------------------------------------------- /includes/utf8/tests/cases/utf8_strtoupper.test.php: -------------------------------------------------------------------------------- 1 | UnitTestCase('utf8_strtoupper()'); 25 | } 26 | 27 | function testUpper() { 28 | $str = 'iñtërnâtiônàlizætiøn'; 29 | $upper = 'IÑTËRNÂTIÔNÀLIZÆTIØN'; 30 | $this->assertEqual(utf8_strtoupper($str),$upper); 31 | } 32 | 33 | function testEmptyString() { 34 | $str = ''; 35 | $upper = ''; 36 | $this->assertEqual(utf8_strtoupper($str),$upper); 37 | } 38 | } 39 | 40 | //-------------------------------------------------------------------- 41 | /** 42 | * @package utf8 43 | * @subpackage Tests 44 | */ 45 | if (!defined('TEST_RUNNING')) { 46 | define('TEST_RUNNING', true); 47 | $test = &new test_utf8_strtoupper(); 48 | $reporter = & getTestReporter(); 49 | $test->run($reporter); 50 | } 51 | -------------------------------------------------------------------------------- /includes/utf8/docs/screen.css: -------------------------------------------------------------------------------- 1 | /* 2 | * Adapted from http://resources.neolao.com/php/dokuwiki/templates 3 | */ 4 | * { 5 | font-family: Verdana, Helvetica, Arial, sans-serif; 6 | font-size: small; 7 | } 8 | body { 9 | background: white; 10 | } 11 | a { text-decoration: none; color: #5d579d; } 12 | a:hover { color: #827db7; } 13 | h1 { 14 | color: #f4a600; 15 | font-size: 1.5em; 16 | } 17 | h1.title { 18 | background-color: #fffff5; 19 | font-size: 2.0em; 20 | } 21 | h2 { 22 | color: #f4a600; 23 | font-size: 1.2em; 24 | } 25 | h3 { 26 | color: #817cb6; 27 | font-size: 1em; 28 | } 29 | h4 { 30 | color: #817cb6; 31 | font-size: 1em; 32 | } 33 | h5 { 34 | color: #817cb6; 35 | font-size: 1em; 36 | } 37 | table { border: solid 1px #999; } 38 | table th { border: solid 1px #999; background-color: #eee; } 39 | table td { border: solid 1px #ccc; background-color: #fff; } 40 | table tr:hover { background-color: #ffffe5; } 41 | blockquote { border-left: solid 2px #a58fbb; margin: 0; padding: 0 0 0 .5em; } 42 | p { margin: .5em 0 0 0; } 43 | pre { 44 | padding: 2px; 45 | border: 1px dotted #8cacbb; 46 | color: #000; 47 | overflow: auto; 48 | background-color: #fffff5; font-size: 1em; font-family: "Courier New",Courier,monospace; 49 | } 50 | pre * { background-color: #fffff5; font-size: 1em; font-family: "Courier New",Courier,monospace; } 51 | code { background-color: #fffff5; border: 1px dotted #8cacbb; font-size: 1em; font-family: "Courier New",Courier,monospace; } 52 | 53 | -------------------------------------------------------------------------------- /includes/player/license.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2005, Fabricio Zuardi 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 5 | 6 | * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 7 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 8 | * Neither the name of the author nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 9 | 10 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 11 | -------------------------------------------------------------------------------- /includes/php-gettext/tests/ParsingTest.php: -------------------------------------------------------------------------------- 1 | assertEquals( 12 | 'nplurals=2; plural=n == 1 ? 0 : 1;', 13 | $parser->extract_plural_forms_header_from_po_header("")); 14 | 15 | // Extracting it from the middle of the header works. 16 | $this->assertEquals( 17 | 'nplurals=1; plural=0;', 18 | $parser->extract_plural_forms_header_from_po_header( 19 | "Content-type: text/html; charset=UTF-8\n" 20 | ."Plural-Forms: nplurals=1; plural=0;\n" 21 | ."Last-Translator: nobody\n" 22 | )); 23 | 24 | // It's also case-insensitive. 25 | $this->assertEquals( 26 | 'nplurals=1; plural=0;', 27 | $parser->extract_plural_forms_header_from_po_header( 28 | "PLURAL-forms: nplurals=1; plural=0;\n" 29 | )); 30 | 31 | // It falls back to default if it's not on a separate line. 32 | $this->assertEquals( 33 | 'nplurals=2; plural=n == 1 ? 0 : 1;', 34 | $parser->extract_plural_forms_header_from_po_header( 35 | "Content-type: text/html; charset=UTF-8" // note the missing \n here 36 | ."Plural-Forms: nplurals=1; plural=0;\n" 37 | ."Last-Translator: nobody\n" 38 | )); 39 | 40 | } 41 | 42 | } 43 | ?> 44 | -------------------------------------------------------------------------------- /ajaxDelete.php: -------------------------------------------------------------------------------- 1 | editAllowed($bookmark)) { 29 | echo T_('You are not allowed to delete this bookmark'); 30 | } elseif ($bookmarkservice->deleteBookmark($bookmark)) { 31 | echo true; 32 | } else { 33 | echo T_('Failed to delete bookmark'); 34 | } 35 | -------------------------------------------------------------------------------- /includes/utf8/tests/data/bench/strlen_native_20060226.txt: -------------------------------------------------------------------------------- 1 | This is ApacheBench, Version 2.0.41-dev <$Revision: 1.1 $> apache-2.0 2 | Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ 3 | Copyright (c) 1998-2002 The Apache Software Foundation, http://www.apache.org/ 4 | 5 | Benchmarking localhost (be patient) 6 | 7 | 8 | Server Software: Apache/2.0.54 9 | Server Hostname: localhost 10 | Server Port: 80 11 | 12 | Document Path: /~harryf/utf8/tests/bench/strlen.php?engine=native 13 | Document Length: 6 bytes 14 | 15 | Concurrency Level: 1 16 | Time taken for tests: 6.914750 seconds 17 | Complete requests: 1000 18 | Failed requests: 0 19 | Write errors: 0 20 | Total transferred: 229000 bytes 21 | HTML transferred: 6000 bytes 22 | Requests per second: 144.62 [#/sec] (mean) 23 | Time per request: 6.915 [ms] (mean) 24 | Time per request: 6.915 [ms] (mean, across all concurrent requests) 25 | Transfer rate: 32.25 [Kbytes/sec] received 26 | 27 | Connection Times (ms) 28 | min mean[+/-sd] median max 29 | Connect: 0 0 0.0 0 0 30 | Processing: 4 6 4.5 4 42 31 | Waiting: 0 0 0.6 0 14 32 | Total: 4 6 4.5 4 42 33 | 34 | Percentage of the requests served within a certain time (ms) 35 | 50% 4 36 | 66% 4 37 | 75% 5 38 | 80% 13 39 | 90% 13 40 | 95% 13 41 | 98% 14 42 | 99% 15 43 | 100% 42 (longest request) 44 | -------------------------------------------------------------------------------- /includes/utf8/tests/data/bench/strlen_native_20061001.txt: -------------------------------------------------------------------------------- 1 | This is ApacheBench, Version 2.0.41-dev <$Revision: 1.1 $> apache-2.0 2 | Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ 3 | Copyright (c) 1998-2002 The Apache Software Foundation, http://www.apache.org/ 4 | 5 | Benchmarking localhost (be patient) 6 | 7 | 8 | Server Software: Apache/2.0.55 9 | Server Hostname: localhost 10 | Server Port: 80 11 | 12 | Document Path: /~harryf/utf8/tests/bench/strlen.php?engine=native 13 | Document Length: 6 bytes 14 | 15 | Concurrency Level: 1 16 | Time taken for tests: 8.210329 seconds 17 | Complete requests: 1000 18 | Failed requests: 0 19 | Write errors: 0 20 | Total transferred: 207000 bytes 21 | HTML transferred: 6000 bytes 22 | Requests per second: 121.80 [#/sec] (mean) 23 | Time per request: 8.210 [ms] (mean) 24 | Time per request: 8.210 [ms] (mean, across all concurrent requests) 25 | Transfer rate: 24.60 [Kbytes/sec] received 26 | 27 | Connection Times (ms) 28 | min mean[+/-sd] median max 29 | Connect: 0 0 0.2 0 4 30 | Processing: 4 7 5.5 4 57 31 | Waiting: 0 0 0.8 0 23 32 | Total: 4 7 5.5 4 57 33 | 34 | Percentage of the requests served within a certain time (ms) 35 | 50% 4 36 | 66% 12 37 | 75% 12 38 | 80% 13 39 | 90% 14 40 | 95% 17 41 | 98% 17 42 | 99% 25 43 | 100% 57 (longest request) 44 | -------------------------------------------------------------------------------- /includes/utf8/tests/data/bench/strpos_native_20060226.txt: -------------------------------------------------------------------------------- 1 | This is ApacheBench, Version 2.0.41-dev <$Revision: 1.1 $> apache-2.0 2 | Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ 3 | Copyright (c) 1998-2002 The Apache Software Foundation, http://www.apache.org/ 4 | 5 | Benchmarking localhost (be patient) 6 | 7 | 8 | Server Software: Apache/2.0.54 9 | Server Hostname: localhost 10 | Server Port: 80 11 | 12 | Document Path: /~harryf/utf8/tests/bench/strpos.php?engine=native 13 | Document Length: 95 bytes 14 | 15 | Concurrency Level: 1 16 | Time taken for tests: 9.5046 seconds 17 | Complete requests: 1000 18 | Failed requests: 0 19 | Write errors: 0 20 | Total transferred: 319000 bytes 21 | HTML transferred: 95000 bytes 22 | Requests per second: 111.05 [#/sec] (mean) 23 | Time per request: 9.005 [ms] (mean) 24 | Time per request: 9.005 [ms] (mean, across all concurrent requests) 25 | Transfer rate: 34.54 [Kbytes/sec] received 26 | 27 | Connection Times (ms) 28 | min mean[+/-sd] median max 29 | Connect: 0 0 0.0 0 0 30 | Processing: 6 8 5.4 6 46 31 | Waiting: 0 0 0.1 0 4 32 | Total: 6 8 5.4 6 46 33 | 34 | Percentage of the requests served within a certain time (ms) 35 | 50% 6 36 | 66% 6 37 | 75% 6 38 | 80% 6 39 | 90% 19 40 | 95% 20 41 | 98% 20 42 | 99% 22 43 | 100% 46 (longest request) 44 | -------------------------------------------------------------------------------- /includes/utf8/tests/data/bench/strpos_native_20061001.txt: -------------------------------------------------------------------------------- 1 | This is ApacheBench, Version 2.0.41-dev <$Revision: 1.1 $> apache-2.0 2 | Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ 3 | Copyright (c) 1998-2002 The Apache Software Foundation, http://www.apache.org/ 4 | 5 | Benchmarking localhost (be patient) 6 | 7 | 8 | Server Software: Apache/2.0.55 9 | Server Hostname: localhost 10 | Server Port: 80 11 | 12 | Document Path: /~harryf/utf8/tests/bench/strpos.php?engine=native 13 | Document Length: 95 bytes 14 | 15 | Concurrency Level: 1 16 | Time taken for tests: 9.257604 seconds 17 | Complete requests: 1000 18 | Failed requests: 0 19 | Write errors: 0 20 | Total transferred: 297000 bytes 21 | HTML transferred: 95000 bytes 22 | Requests per second: 108.02 [#/sec] (mean) 23 | Time per request: 9.258 [ms] (mean) 24 | Time per request: 9.258 [ms] (mean, across all concurrent requests) 25 | Transfer rate: 31.33 [Kbytes/sec] received 26 | 27 | Connection Times (ms) 28 | min mean[+/-sd] median max 29 | Connect: 0 0 0.0 0 1 30 | Processing: 7 8 2.8 8 44 31 | Waiting: 0 8 3.3 8 43 32 | Total: 7 8 2.8 8 44 33 | 34 | Percentage of the requests served within a certain time (ms) 35 | 50% 8 36 | 66% 8 37 | 75% 8 38 | 80% 9 39 | 90% 10 40 | 95% 11 41 | 98% 17 42 | 99% 24 43 | 100% 44 (longest request) 44 | -------------------------------------------------------------------------------- /includes/utf8/tests/data/bench/substr_native_20060226.txt: -------------------------------------------------------------------------------- 1 | This is ApacheBench, Version 2.0.41-dev <$Revision: 1.1 $> apache-2.0 2 | Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ 3 | Copyright (c) 1998-2002 The Apache Software Foundation, http://www.apache.org/ 4 | 5 | Benchmarking localhost (be patient) 6 | 7 | 8 | Server Software: Apache/2.0.54 9 | Server Hostname: localhost 10 | Server Port: 80 11 | 12 | Document Path: /~harryf/utf8/tests/bench/substr.php?engine=native 13 | Document Length: 5 bytes 14 | 15 | Concurrency Level: 1 16 | Time taken for tests: 21.496423 seconds 17 | Complete requests: 1000 18 | Failed requests: 0 19 | Write errors: 0 20 | Total transferred: 228000 bytes 21 | HTML transferred: 5000 bytes 22 | Requests per second: 46.52 [#/sec] (mean) 23 | Time per request: 21.496 [ms] (mean) 24 | Time per request: 21.496 [ms] (mean, across all concurrent requests) 25 | Transfer rate: 10.33 [Kbytes/sec] received 26 | 27 | Connection Times (ms) 28 | min mean[+/-sd] median max 29 | Connect: 0 0 0.0 0 0 30 | Processing: 16 20 11.7 17 68 31 | Waiting: 0 20 11.9 16 68 32 | Total: 16 20 11.7 17 68 33 | 34 | Percentage of the requests served within a certain time (ms) 35 | 50% 17 36 | 66% 17 37 | 75% 17 38 | 80% 17 39 | 90% 44 40 | 95% 54 41 | 98% 56 42 | 99% 58 43 | 100% 68 (longest request) 44 | -------------------------------------------------------------------------------- /includes/utf8/tests/data/bench/substr_native_20061001.txt: -------------------------------------------------------------------------------- 1 | This is ApacheBench, Version 2.0.41-dev <$Revision: 1.1 $> apache-2.0 2 | Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ 3 | Copyright (c) 1998-2002 The Apache Software Foundation, http://www.apache.org/ 4 | 5 | Benchmarking localhost (be patient) 6 | 7 | 8 | Server Software: Apache/2.0.55 9 | Server Hostname: localhost 10 | Server Port: 80 11 | 12 | Document Path: /~harryf/utf8/tests/bench/substr.php?engine=native 13 | Document Length: 5 bytes 14 | 15 | Concurrency Level: 1 16 | Time taken for tests: 25.217880 seconds 17 | Complete requests: 1000 18 | Failed requests: 0 19 | Write errors: 0 20 | Total transferred: 206000 bytes 21 | HTML transferred: 5000 bytes 22 | Requests per second: 39.65 [#/sec] (mean) 23 | Time per request: 25.218 [ms] (mean) 24 | Time per request: 25.218 [ms] (mean, across all concurrent requests) 25 | Transfer rate: 7.97 [Kbytes/sec] received 26 | 27 | Connection Times (ms) 28 | min mean[+/-sd] median max 29 | Connect: 0 0 0.0 0 0 30 | Processing: 18 24 16.1 19 128 31 | Waiting: 15 24 16.0 19 127 32 | Total: 18 24 16.1 19 128 33 | 34 | Percentage of the requests served within a certain time (ms) 35 | 50% 19 36 | 66% 20 37 | 75% 20 38 | 80% 20 39 | 90% 64 40 | 95% 67 41 | 98% 71 42 | 99% 80 43 | 100% 128 (longest request) 44 | -------------------------------------------------------------------------------- /includes/utf8/tests/data/bench/strlen_mbstring_20060226.txt: -------------------------------------------------------------------------------- 1 | This is ApacheBench, Version 2.0.41-dev <$Revision: 1.1 $> apache-2.0 2 | Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ 3 | Copyright (c) 1998-2002 The Apache Software Foundation, http://www.apache.org/ 4 | 5 | Benchmarking localhost (be patient) 6 | 7 | 8 | Server Software: Apache/2.0.54 9 | Server Hostname: localhost 10 | Server Port: 80 11 | 12 | Document Path: /~harryf/utf8/tests/bench/strlen.php?engine=mbstring 13 | Document Length: 6 bytes 14 | 15 | Concurrency Level: 1 16 | Time taken for tests: 5.520811 seconds 17 | Complete requests: 1000 18 | Failed requests: 0 19 | Write errors: 0 20 | Total transferred: 229000 bytes 21 | HTML transferred: 6000 bytes 22 | Requests per second: 181.13 [#/sec] (mean) 23 | Time per request: 5.521 [ms] (mean) 24 | Time per request: 5.521 [ms] (mean, across all concurrent requests) 25 | Transfer rate: 40.39 [Kbytes/sec] received 26 | 27 | Connection Times (ms) 28 | min mean[+/-sd] median max 29 | Connect: 0 0 0.0 0 0 30 | Processing: 4 5 2.3 5 34 31 | Waiting: 0 4 2.3 4 34 32 | Total: 4 5 2.3 5 34 33 | 34 | Percentage of the requests served within a certain time (ms) 35 | 50% 5 36 | 66% 5 37 | 75% 5 38 | 80% 5 39 | 90% 5 40 | 95% 6 41 | 98% 10 42 | 99% 19 43 | 100% 34 (longest request) 44 | -------------------------------------------------------------------------------- /includes/utf8/tests/data/bench/strlen_mbstring_20061001.txt: -------------------------------------------------------------------------------- 1 | This is ApacheBench, Version 2.0.41-dev <$Revision: 1.1 $> apache-2.0 2 | Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ 3 | Copyright (c) 1998-2002 The Apache Software Foundation, http://www.apache.org/ 4 | 5 | Benchmarking localhost (be patient) 6 | 7 | 8 | Server Software: Apache/2.0.55 9 | Server Hostname: localhost 10 | Server Port: 80 11 | 12 | Document Path: /~harryf/utf8/tests/bench/strlen.php?engine=mbstring 13 | Document Length: 6 bytes 14 | 15 | Concurrency Level: 1 16 | Time taken for tests: 5.480531 seconds 17 | Complete requests: 1000 18 | Failed requests: 0 19 | Write errors: 0 20 | Total transferred: 207000 bytes 21 | HTML transferred: 6000 bytes 22 | Requests per second: 182.46 [#/sec] (mean) 23 | Time per request: 5.481 [ms] (mean) 24 | Time per request: 5.481 [ms] (mean, across all concurrent requests) 25 | Transfer rate: 36.86 [Kbytes/sec] received 26 | 27 | Connection Times (ms) 28 | min mean[+/-sd] median max 29 | Connect: 0 0 0.0 0 0 30 | Processing: 3 4 3.6 4 53 31 | Waiting: 0 4 3.5 4 53 32 | Total: 3 4 3.6 4 53 33 | 34 | Percentage of the requests served within a certain time (ms) 35 | 50% 4 36 | 66% 4 37 | 75% 4 38 | 80% 5 39 | 90% 7 40 | 95% 9 41 | 98% 15 42 | 99% 18 43 | 100% 53 (longest request) 44 | -------------------------------------------------------------------------------- /includes/utf8/tests/data/bench/strpos_mbstring_20060226.txt: -------------------------------------------------------------------------------- 1 | This is ApacheBench, Version 2.0.41-dev <$Revision: 1.1 $> apache-2.0 2 | Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ 3 | Copyright (c) 1998-2002 The Apache Software Foundation, http://www.apache.org/ 4 | 5 | Benchmarking localhost (be patient) 6 | 7 | 8 | Server Software: Apache/2.0.54 9 | Server Hostname: localhost 10 | Server Port: 80 11 | 12 | Document Path: /~harryf/utf8/tests/bench/strpos.php?engine=mbstring 13 | Document Length: 95 bytes 14 | 15 | Concurrency Level: 1 16 | Time taken for tests: 4.664597 seconds 17 | Complete requests: 1000 18 | Failed requests: 0 19 | Write errors: 0 20 | Total transferred: 319000 bytes 21 | HTML transferred: 95000 bytes 22 | Requests per second: 214.38 [#/sec] (mean) 23 | Time per request: 4.665 [ms] (mean) 24 | Time per request: 4.665 [ms] (mean, across all concurrent requests) 25 | Transfer rate: 66.67 [Kbytes/sec] received 26 | 27 | Connection Times (ms) 28 | min mean[+/-sd] median max 29 | Connect: 0 0 0.0 0 0 30 | Processing: 2 4 3.1 2 33 31 | Waiting: 0 0 0.3 0 8 32 | Total: 2 4 3.1 2 33 33 | 34 | Percentage of the requests served within a certain time (ms) 35 | 50% 2 36 | 66% 6 37 | 75% 6 38 | 80% 7 39 | 90% 7 40 | 95% 7 41 | 98% 7 42 | 99% 9 43 | 100% 33 (longest request) 44 | -------------------------------------------------------------------------------- /includes/utf8/tests/data/bench/strpos_mbstring_20061001.txt: -------------------------------------------------------------------------------- 1 | This is ApacheBench, Version 2.0.41-dev <$Revision: 1.1 $> apache-2.0 2 | Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ 3 | Copyright (c) 1998-2002 The Apache Software Foundation, http://www.apache.org/ 4 | 5 | Benchmarking localhost (be patient) 6 | 7 | 8 | Server Software: Apache/2.0.55 9 | Server Hostname: localhost 10 | Server Port: 80 11 | 12 | Document Path: /~harryf/utf8/tests/bench/strpos.php?engine=mbstring 13 | Document Length: 95 bytes 14 | 15 | Concurrency Level: 1 16 | Time taken for tests: 5.337757 seconds 17 | Complete requests: 1000 18 | Failed requests: 0 19 | Write errors: 0 20 | Total transferred: 297000 bytes 21 | HTML transferred: 95000 bytes 22 | Requests per second: 187.34 [#/sec] (mean) 23 | Time per request: 5.338 [ms] (mean) 24 | Time per request: 5.338 [ms] (mean, across all concurrent requests) 25 | Transfer rate: 54.33 [Kbytes/sec] received 26 | 27 | Connection Times (ms) 28 | min mean[+/-sd] median max 29 | Connect: 0 0 1.0 0 31 30 | Processing: 1 4 4.4 5 59 31 | Waiting: 0 0 0.1 0 4 32 | Total: 1 4 4.5 5 59 33 | 34 | Percentage of the requests served within a certain time (ms) 35 | 50% 5 36 | 66% 6 37 | 75% 6 38 | 80% 6 39 | 90% 7 40 | 95% 9 41 | 98% 13 42 | 99% 22 43 | 100% 59 (longest request) 44 | -------------------------------------------------------------------------------- /includes/utf8/tests/data/bench/strrpos_native_20060226.txt: -------------------------------------------------------------------------------- 1 | This is ApacheBench, Version 2.0.41-dev <$Revision: 1.1 $> apache-2.0 2 | Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ 3 | Copyright (c) 1998-2002 The Apache Software Foundation, http://www.apache.org/ 4 | 5 | Benchmarking localhost (be patient) 6 | 7 | 8 | Server Software: Apache/2.0.54 9 | Server Hostname: localhost 10 | Server Port: 80 11 | 12 | Document Path: /~harryf/utf8/tests/bench/strrpos.php?engine=native 13 | Document Length: 156 bytes 14 | 15 | Concurrency Level: 1 16 | Time taken for tests: 33.444724 seconds 17 | Complete requests: 1000 18 | Failed requests: 0 19 | Write errors: 0 20 | Total transferred: 381000 bytes 21 | HTML transferred: 156000 bytes 22 | Requests per second: 29.90 [#/sec] (mean) 23 | Time per request: 33.445 [ms] (mean) 24 | Time per request: 33.445 [ms] (mean, across all concurrent requests) 25 | Transfer rate: 11.12 [Kbytes/sec] received 26 | 27 | Connection Times (ms) 28 | min mean[+/-sd] median max 29 | Connect: 0 0 0.0 0 0 30 | Processing: 29 33 14.1 30 126 31 | Waiting: 0 32 14.3 30 125 32 | Total: 29 33 14.1 30 126 33 | 34 | Percentage of the requests served within a certain time (ms) 35 | 50% 30 36 | 66% 30 37 | 75% 30 38 | 80% 30 39 | 90% 30 40 | 95% 48 41 | 98% 99 42 | 99% 99 43 | 100% 126 (longest request) 44 | -------------------------------------------------------------------------------- /includes/utf8/tests/data/bench/strrpos_native_20061001.txt: -------------------------------------------------------------------------------- 1 | This is ApacheBench, Version 2.0.41-dev <$Revision: 1.1 $> apache-2.0 2 | Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ 3 | Copyright (c) 1998-2002 The Apache Software Foundation, http://www.apache.org/ 4 | 5 | Benchmarking localhost (be patient) 6 | 7 | 8 | Server Software: Apache/2.0.55 9 | Server Hostname: localhost 10 | Server Port: 80 11 | 12 | Document Path: /~harryf/utf8/tests/bench/strrpos.php?engine=native 13 | Document Length: 156 bytes 14 | 15 | Concurrency Level: 1 16 | Time taken for tests: 35.459417 seconds 17 | Complete requests: 1000 18 | Failed requests: 0 19 | Write errors: 0 20 | Total transferred: 359000 bytes 21 | HTML transferred: 156000 bytes 22 | Requests per second: 28.20 [#/sec] (mean) 23 | Time per request: 35.459 [ms] (mean) 24 | Time per request: 35.459 [ms] (mean, across all concurrent requests) 25 | Transfer rate: 9.87 [Kbytes/sec] received 26 | 27 | Connection Times (ms) 28 | min mean[+/-sd] median max 29 | Connect: 0 0 0.1 0 3 30 | Processing: 29 34 17.6 31 156 31 | Waiting: 0 34 17.7 31 156 32 | Total: 29 34 17.6 31 156 33 | 34 | Percentage of the requests served within a certain time (ms) 35 | 50% 31 36 | 66% 31 37 | 75% 32 38 | 80% 32 39 | 90% 34 40 | 95% 54 41 | 98% 113 42 | 99% 115 43 | 100% 156 (longest request) 44 | -------------------------------------------------------------------------------- /includes/utf8/tests/data/bench/substr_mbstring_20060226.txt: -------------------------------------------------------------------------------- 1 | This is ApacheBench, Version 2.0.41-dev <$Revision: 1.1 $> apache-2.0 2 | Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ 3 | Copyright (c) 1998-2002 The Apache Software Foundation, http://www.apache.org/ 4 | 5 | Benchmarking localhost (be patient) 6 | 7 | 8 | Server Software: Apache/2.0.54 9 | Server Hostname: localhost 10 | Server Port: 80 11 | 12 | Document Path: /~harryf/utf8/tests/bench/substr.php?engine=mbstring 13 | Document Length: 5 bytes 14 | 15 | Concurrency Level: 1 16 | Time taken for tests: 18.344252 seconds 17 | Complete requests: 1000 18 | Failed requests: 0 19 | Write errors: 0 20 | Total transferred: 228000 bytes 21 | HTML transferred: 5000 bytes 22 | Requests per second: 54.51 [#/sec] (mean) 23 | Time per request: 18.344 [ms] (mean) 24 | Time per request: 18.344 [ms] (mean, across all concurrent requests) 25 | Transfer rate: 12.10 [Kbytes/sec] received 26 | 27 | Connection Times (ms) 28 | min mean[+/-sd] median max 29 | Connect: 0 0 0.0 0 0 30 | Processing: 14 17 9.8 15 53 31 | Waiting: 0 17 9.9 14 53 32 | Total: 14 17 9.8 15 53 33 | 34 | Percentage of the requests served within a certain time (ms) 35 | 50% 15 36 | 66% 15 37 | 75% 15 38 | 80% 15 39 | 90% 22 40 | 95% 48 41 | 98% 50 42 | 99% 50 43 | 100% 53 (longest request) 44 | -------------------------------------------------------------------------------- /includes/utf8/tests/data/bench/substr_mbstring_20061001.txt: -------------------------------------------------------------------------------- 1 | This is ApacheBench, Version 2.0.41-dev <$Revision: 1.1 $> apache-2.0 2 | Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ 3 | Copyright (c) 1998-2002 The Apache Software Foundation, http://www.apache.org/ 4 | 5 | Benchmarking localhost (be patient) 6 | 7 | 8 | Server Software: Apache/2.0.55 9 | Server Hostname: localhost 10 | Server Port: 80 11 | 12 | Document Path: /~harryf/utf8/tests/bench/substr.php?engine=mbstring 13 | Document Length: 5 bytes 14 | 15 | Concurrency Level: 1 16 | Time taken for tests: 16.417722 seconds 17 | Complete requests: 1000 18 | Failed requests: 0 19 | Write errors: 0 20 | Total transferred: 206000 bytes 21 | HTML transferred: 5000 bytes 22 | Requests per second: 60.91 [#/sec] (mean) 23 | Time per request: 16.418 [ms] (mean) 24 | Time per request: 16.418 [ms] (mean, across all concurrent requests) 25 | Transfer rate: 12.24 [Kbytes/sec] received 26 | 27 | Connection Times (ms) 28 | min mean[+/-sd] median max 29 | Connect: 0 0 0.0 0 0 30 | Processing: 14 15 3.4 16 55 31 | Waiting: 0 15 3.8 16 55 32 | Total: 14 15 3.4 16 55 33 | 34 | Percentage of the requests served within a certain time (ms) 35 | 50% 16 36 | 66% 16 37 | 75% 16 38 | 80% 17 39 | 90% 17 40 | 95% 18 41 | 98% 23 42 | 99% 35 43 | 100% 55 (longest request) 44 | -------------------------------------------------------------------------------- /includes/utf8/tests/data/bench/strrpos_mbstring_20060226.txt: -------------------------------------------------------------------------------- 1 | This is ApacheBench, Version 2.0.41-dev <$Revision: 1.1 $> apache-2.0 2 | Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ 3 | Copyright (c) 1998-2002 The Apache Software Foundation, http://www.apache.org/ 4 | 5 | Benchmarking localhost (be patient) 6 | 7 | 8 | Server Software: Apache/2.0.54 9 | Server Hostname: localhost 10 | Server Port: 80 11 | 12 | Document Path: /~harryf/utf8/tests/bench/strrpos.php?engine=mbstring 13 | Document Length: 156 bytes 14 | 15 | Concurrency Level: 1 16 | Time taken for tests: 31.210019 seconds 17 | Complete requests: 1000 18 | Failed requests: 0 19 | Write errors: 0 20 | Total transferred: 381000 bytes 21 | HTML transferred: 156000 bytes 22 | Requests per second: 32.04 [#/sec] (mean) 23 | Time per request: 31.210 [ms] (mean) 24 | Time per request: 31.210 [ms] (mean, across all concurrent requests) 25 | Transfer rate: 11.92 [Kbytes/sec] received 26 | 27 | Connection Times (ms) 28 | min mean[+/-sd] median max 29 | Connect: 0 0 0.0 0 0 30 | Processing: 27 30 13.8 27 123 31 | Waiting: 0 29 14.4 27 122 32 | Total: 27 30 13.8 27 123 33 | 34 | Percentage of the requests served within a certain time (ms) 35 | 50% 27 36 | 66% 27 37 | 75% 28 38 | 80% 28 39 | 90% 28 40 | 95% 46 41 | 98% 92 42 | 99% 92 43 | 100% 123 (longest request) 44 | -------------------------------------------------------------------------------- /includes/utf8/tests/data/bench/strrpos_mbstring_20061001.txt: -------------------------------------------------------------------------------- 1 | This is ApacheBench, Version 2.0.41-dev <$Revision: 1.1 $> apache-2.0 2 | Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ 3 | Copyright (c) 1998-2002 The Apache Software Foundation, http://www.apache.org/ 4 | 5 | Benchmarking localhost (be patient) 6 | 7 | 8 | Server Software: Apache/2.0.55 9 | Server Hostname: localhost 10 | Server Port: 80 11 | 12 | Document Path: /~harryf/utf8/tests/bench/strrpos.php?engine=mbstring 13 | Document Length: 156 bytes 14 | 15 | Concurrency Level: 1 16 | Time taken for tests: 32.406529 seconds 17 | Complete requests: 1000 18 | Failed requests: 0 19 | Write errors: 0 20 | Total transferred: 359000 bytes 21 | HTML transferred: 156000 bytes 22 | Requests per second: 30.86 [#/sec] (mean) 23 | Time per request: 32.407 [ms] (mean) 24 | Time per request: 32.407 [ms] (mean, across all concurrent requests) 25 | Transfer rate: 10.80 [Kbytes/sec] received 26 | 27 | Connection Times (ms) 28 | min mean[+/-sd] median max 29 | Connect: 0 0 0.0 0 0 30 | Processing: 26 31 16.9 28 140 31 | Waiting: 0 31 16.9 28 140 32 | Total: 26 31 16.9 28 140 33 | 34 | Percentage of the requests served within a certain time (ms) 35 | 50% 28 36 | 66% 28 37 | 75% 29 38 | 80% 29 39 | 90% 32 40 | 95% 55 41 | 98% 103 42 | 99% 112 43 | 100% 140 (longest request) 44 | -------------------------------------------------------------------------------- /api/posts_dates.php: -------------------------------------------------------------------------------- 1 | getBookmarks(0, NULL, $userservice->getCurrentUserId(), $tag); 20 | 21 | $currentuser = $userservice->getCurrentUser(); 22 | $currentusername = $currentuser[$userservice->getFieldName('username')]; 23 | 24 | // Set up the XML file and output all the tags. 25 | header('Content-Type: text/xml'); 26 | echo '\r\n"; 27 | echo '\r\n"; 28 | 29 | $count = 0; 30 | $lastdate = NULL; 31 | foreach ($bookmarks['bookmarks'] as $row) { 32 | $thisdate = gmdate('Y-m-d', strtotime($row['bDatetime'])); 33 | if ($thisdate != $lastdate && $lastdate != NULL) { 34 | echo "\t\r\n"; 35 | $count = 1; 36 | } 37 | else { 38 | $count++; 39 | } 40 | $lastdate = $thisdate; 41 | } 42 | 43 | echo ""; 44 | -------------------------------------------------------------------------------- /includes/utf8/tests/cases/utf8_strlen.test.php: -------------------------------------------------------------------------------- 1 | UnitTestCase('utf8_strlen()'); 25 | } 26 | 27 | function testUtf8() { 28 | $str = 'Iñtërnâtiônàlizætiøn'; 29 | $this->assertEqual(utf8_strlen($str),20); 30 | } 31 | 32 | function testUtf8Invalid() { 33 | $str = "Iñtërnâtiôn\xe9àlizætiøn"; 34 | $this->assertEqual(utf8_strlen($str),20); 35 | } 36 | 37 | function testAscii() { 38 | $str = 'ABC 123'; 39 | $this->assertEqual(utf8_strlen($str),7); 40 | } 41 | 42 | function testEmptyStr() { 43 | $str = ''; 44 | $this->assertEqual(utf8_strlen($str),0); 45 | } 46 | 47 | 48 | } 49 | 50 | //-------------------------------------------------------------------- 51 | /** 52 | * @package utf8 53 | * @subpackage Tests 54 | */ 55 | if (!defined('TEST_RUNNING')) { 56 | define('TEST_RUNNING', true); 57 | $test = &new test_utf8_strlen(); 58 | $reporter = & getTestReporter(); 59 | $test->run($reporter); 60 | } 61 | -------------------------------------------------------------------------------- /includes/utf8/tests/cases/utf8_strrev.test.php: -------------------------------------------------------------------------------- 1 | UnitTestCase('utf8_strrev()'); 26 | } 27 | 28 | function testReverse() { 29 | $str = 'Iñtërnâtiônàlizætiøn'; 30 | $rev = 'nøitæzilànôitânrëtñI'; 31 | $this->assertEqual(utf8_strrev($str),$rev); 32 | } 33 | 34 | function testEmptyStr() { 35 | $str = ''; 36 | $rev = ''; 37 | $this->assertEqual(utf8_strrev($str),$rev); 38 | } 39 | 40 | function testLinefeed() { 41 | $str = "Iñtërnâtiôn\nàlizætiøn"; 42 | $rev = "nøitæzilà\nnôitânrëtñI"; 43 | $this->assertEqual(utf8_strrev($str),$rev); 44 | } 45 | 46 | } 47 | 48 | //-------------------------------------------------------------------- 49 | /** 50 | * @package utf8 51 | * @subpackage Tests 52 | */ 53 | if (!defined('TEST_RUNNING')) { 54 | define('TEST_RUNNING', true); 55 | $test = &new test_utf8_strrev(); 56 | $reporter = & getTestReporter(); 57 | $test->run($reporter); 58 | } 59 | -------------------------------------------------------------------------------- /templates/about.tpl.php: -------------------------------------------------------------------------------- 1 | includeTemplate($GLOBALS['top_include']); ?> 2 | 3 |
9 | 10 |

11 |
    12 |
  • an open-source project licensed under the GNU General Public License. This means you can host it on your own web server for free, whether it is on the Internet, a private network or just your own computer.'), $GLOBALS['sitename']); ?>
  • 13 |
  • delicious API. Almost all of the neat tools made for that system can be modified to work with %1$s instead. If you find a tool that won\'t let you change the API address, ask the creator to add this setting. You never know, they might just do it.'), $GLOBALS['sitename']); ?>
  • 14 |
15 | 16 | includeTemplate($GLOBALS['bottom_include']); ?> -------------------------------------------------------------------------------- /includes/utf8/ucwords.php: -------------------------------------------------------------------------------- 1 | UnitTestCase('utf8_ord()'); 26 | } 27 | 28 | function testEmptyStr() { 29 | $str = ''; 30 | $this->assertEqual(utf8_ord($str),0); 31 | } 32 | 33 | function testAsciiChar() { 34 | $str = 'a'; 35 | $this->assertEqual(utf8_ord($str),97); 36 | } 37 | 38 | function test2ByteChar() { 39 | $str = 'ñ'; 40 | $this->assertEqual(utf8_ord($str),241); 41 | } 42 | 43 | function test3ByteChar() { 44 | $str = '₧'; 45 | $this->assertEqual(utf8_ord($str),8359); 46 | } 47 | 48 | function test4ByteChar() { 49 | $str = "\xf0\x90\x8c\xbc"; 50 | $this->assertEqual(utf8_ord($str),66364); 51 | } 52 | 53 | } 54 | 55 | //-------------------------------------------------------------------- 56 | /** 57 | * @package utf8 58 | * @subpackage Tests 59 | */ 60 | if (!defined('TEST_RUNNING')) { 61 | define('TEST_RUNNING', true); 62 | $test = &new test_utf8_ord(); 63 | $reporter = & getTestReporter(); 64 | $test->run($reporter); 65 | } 66 | -------------------------------------------------------------------------------- /includes/utf8/docs/print.css: -------------------------------------------------------------------------------- 1 | body { 2 | font: 10pt "Lucida Grande", Verdana, Lucida, Helvetica, Arial, sans-serif; 3 | background-color: White; 4 | color: Black; 5 | } 6 | table { 7 | font-size: 100%; 8 | padding:0; 9 | margin:0; 10 | } 11 | tr,td,th {padding:0; margin:0;} 12 | img {border:0} 13 | a { 14 | color:#000000; 15 | text-decoration:none; 16 | } 17 | pod.page { 18 | text-align: justify; 19 | } 20 | h1, h2, h3, h4, h5 { 21 | color: Black; 22 | background-color: transparent; 23 | font-family: "Lucida Grande", Verdana, Lucida, Helvetica, Arial, sans-serif; 24 | font-size: 100%; 25 | font-weight: normal; 26 | margin-left: 0; 27 | margin-right: 0; 28 | margin-top: 0; 29 | margin-bottom: 1em; 30 | padding-left: 0; 31 | padding-right: 0; 32 | padding-top: 0.5em; 33 | padding-bottom: 0; 34 | border-bottom: 1px solid #000000; 35 | clear:left; 36 | } 37 | h1 {font-size: 160%; font-weight: bold;} 38 | h2 {font-size: 150%; } 39 | h3 {font-size: 140%; border-bottom: none; } 40 | h4 {font-size: 120%; border-bottom: none; } 41 | h5 {font-size: 100%; border-bottom: none; } 42 | ul { 43 | line-height: 1.5em; 44 | list-style-type: square; 45 | margin: 0 0 1.0em 1.5em; 46 | padding: 0; 47 | 48 | } 49 | ol { 50 | line-height: 1.0em; 51 | margin: 0 0 1.0em 1.0em; 52 | padding: 0; 53 | font-weight: normal; 54 | } 55 | 56 | pre { 57 | font-size: 8pt; 58 | padding: 0.5em; 59 | border: 1px dashed #000000; 60 | color: Black; 61 | overflow: visible; 62 | font-family: "Courier New",Courier,monospace; 63 | } 64 | code { 65 | font-family: "Courier New",Courier,monospace; 66 | } 67 | .toplink {display:none} 68 | #nav {display:none} 69 | -------------------------------------------------------------------------------- /includes/utf8/exp/regexunicode.php: -------------------------------------------------------------------------------- 1 | includeTemplate($GLOBALS['top_include']); 3 | ?> 4 | 5 |
6 | 7 | 8 | 9 | 13 | 14 | 15 | 16 | 23 | 24 | 25 | 27 | 28 |
10 | 11 | 12 |
17 | 22 |
26 |
29 |
30 | 31 |

32 |
    33 |
  1. export page at del.icio.us'); ?>.
  2. 34 |
  3. XML file to your computer'); ?>.
  4. 35 |
  5. Browse... to find this file on your computer. The maximum size the file can be is 1MB'); ?>.
  6. 36 |
  7. .
  8. 37 |
  9. Import to start importing the bookmarks; it may take a minute'); ?>.
  10. 38 |
39 | 40 | includeTemplate($GLOBALS['bottom_include']); 42 | ?> -------------------------------------------------------------------------------- /templates/top.inc.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | <?php echo filter($GLOBALS['sitename'] . (isset($pagetitle) ? ': ' . $pagetitle : '')); ?> 6 | 7 | 8 | 9 | '; 13 | } 14 | ?> 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 28 | 29 | 37 | 38 | '. $subtitle ."\n"; 41 | } 42 | if (isset($error)) { 43 | echo '

'. $error ."

\n"; 44 | } 45 | if (isset($msg)) { 46 | echo '

'. $msg ."

\n"; 47 | } 48 | ?> 49 | -------------------------------------------------------------------------------- /includes/utf8/tests/config.php: -------------------------------------------------------------------------------- 1 | includeTemplate($GLOBALS['top_include']); 3 | ?> 4 | 5 |
6 | 7 |

8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 |
31 | 32 |

33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 |
52 |
53 | 54 | includeTemplate($GLOBALS['bottom_include']); 56 | ?> -------------------------------------------------------------------------------- /search.inc.php: -------------------------------------------------------------------------------- 1 | 43 | -------------------------------------------------------------------------------- /includes/utf8/tests/cases/utf8_strpos.test.php: -------------------------------------------------------------------------------- 1 | UnitTestCase('utf8_strpos()'); 25 | } 26 | 27 | function testUtf8() { 28 | $str = 'Iñtërnâtiônàlizætiøn'; 29 | $this->assertEqual(utf8_strpos($str,'â'),6); 30 | } 31 | 32 | function testUtf8Offset() { 33 | $str = 'Iñtërnâtiônàlizætiøn'; 34 | $this->assertEqual(utf8_strpos($str,'n',11),19); 35 | } 36 | 37 | function testUtf8Invalid() { 38 | $str = "Iñtërnâtiôn\xe9àlizætiøn"; 39 | $this->assertEqual(utf8_strpos($str,'æ'),15); 40 | } 41 | 42 | function testAscii() { 43 | $str = 'ABC 123'; 44 | $this->assertEqual(utf8_strpos($str,'B'),1); 45 | } 46 | 47 | function testVsStrpos() { 48 | $str = 'ABC 123 ABC'; 49 | $this->assertEqual(utf8_strpos($str,'B',3),strpos($str,'B',3)); 50 | } 51 | 52 | function testEmptyStr() { 53 | $str = ''; 54 | $this->assertFalse(utf8_strpos($str,'x')); 55 | } 56 | 57 | } 58 | 59 | //-------------------------------------------------------------------- 60 | /** 61 | * @package utf8 62 | * @subpackage Tests 63 | */ 64 | if (!defined('TEST_RUNNING')) { 65 | define('TEST_RUNNING', true); 66 | $test = &new test_utf8_strpos(); 67 | $reporter = & getTestReporter(); 68 | $test->run($reporter); 69 | } 70 | -------------------------------------------------------------------------------- /templates/profile.tpl.php: -------------------------------------------------------------------------------- 1 | includeTemplate($GLOBALS['top_include']); 4 | ?> 5 | 6 |
7 |
8 |
9 | 12 |
13 |
14 | 18 |
19 |
20 | 23 |
24 |
25 | 28 |
29 |
30 | getWatchNames($userid); 33 | if ($watching) { 34 | ?> 35 |
36 |
37 | '. $watchuser .', '; 41 | } 42 | echo substr($list, 0, -2); 43 | ?> 44 |
45 | getWatchNames($userid, true); 48 | if ($watchnames) { 49 | ?> 50 |
51 |
52 | '. $watchuser .', '; 56 | } 57 | echo substr($list, 0, -2); 58 | ?> 59 |
60 | 63 |
64 | 65 | includeTemplate($GLOBALS['bottom_include']); 67 | ?> -------------------------------------------------------------------------------- /includes/utf8/tests/cases/utf8_str_pad.test.php: -------------------------------------------------------------------------------- 1 | 20 | * @package utf8 21 | * @subpackage Tests 22 | */ 23 | class test_utf8_str_pad extends UnitTestCase { 24 | public function test(){ 25 | $toPad = ''; // 10 characters 26 | $padding = 'ø__'; // 4 characters 27 | 28 | $this->assertEqual(utf8_str_pad($toPad, 20), $toPad . ' '); 29 | $this->assertEqual(utf8_str_pad($toPad, 20, ' ', STR_PAD_LEFT), ' ' . $toPad); 30 | $this->assertEqual(utf8_str_pad($toPad, 20, ' ', STR_PAD_BOTH), ' ' . $toPad . ' '); 31 | 32 | $this->assertEqual(utf8_str_pad($toPad, 10), $toPad); 33 | $this->assertEqual(str_pad('5char', 4), '5char'); // str_pos won't truncate input string 34 | $this->assertEqual(utf8_str_pad($toPad, 8), $toPad); 35 | 36 | $this->assertEqual(utf8_str_pad($toPad, 20, $padding, STR_PAD_RIGHT), $toPad . 'ø__ø__ø__ø'); 37 | $this->assertEqual(utf8_str_pad($toPad, 20, $padding, STR_PAD_LEFT), 'ø__ø__ø__ø' . $toPad); 38 | $this->assertEqual(utf8_str_pad($toPad, 20, $padding, STR_PAD_BOTH), 'ø__ø_' . $toPad . 'ø__ø_'); 39 | } 40 | } 41 | 42 | //-------------------------------------------------------------------- 43 | /** 44 | * @package utf8 45 | * @subpackage Tests 46 | */ 47 | if (!defined('TEST_RUNNING')) { 48 | define('TEST_RUNNING', true); 49 | $test = &new test_utf8_str_pad (); 50 | $reporter = & getTestReporter(); 51 | $test->run($reporter); 52 | } 53 | -------------------------------------------------------------------------------- /includes/utf8/str_pad.php: -------------------------------------------------------------------------------- 1 | 13 | * @param string $input 14 | * @param int $length 15 | * @param string $padStr 16 | * @param int $type ( same constants as str_pad ) 17 | * @return string 18 | * @see http://www.php.net/str_pad 19 | * @see utf8_substr 20 | * @package utf8 21 | * @subpackage strings 22 | */ 23 | function utf8_str_pad($input, $length, $padStr = ' ', $type = STR_PAD_RIGHT) { 24 | 25 | $inputLen = utf8_strlen($input); 26 | if ($length <= $inputLen) { 27 | return $input; 28 | } 29 | 30 | $padStrLen = utf8_strlen($padStr); 31 | $padLen = $length - $inputLen; 32 | 33 | if ($type == STR_PAD_RIGHT) { 34 | $repeatTimes = ceil($padLen / $padStrLen); 35 | return utf8_substr($input . str_repeat($padStr, $repeatTimes), 0, $length); 36 | } 37 | 38 | if ($type == STR_PAD_LEFT) { 39 | $repeatTimes = ceil($padLen / $padStrLen); 40 | return utf8_substr(str_repeat($padStr, $repeatTimes), 0, floor($padLen)) . $input; 41 | } 42 | 43 | if ($type == STR_PAD_BOTH) { 44 | 45 | $padLen/= 2; 46 | $padAmountLeft = floor($padLen); 47 | $padAmountRight = ceil($padLen); 48 | $repeatTimesLeft = ceil($padAmountLeft / $padStrLen); 49 | $repeatTimesRight = ceil($padAmountRight / $padStrLen); 50 | 51 | $paddingLeft = utf8_substr(str_repeat($padStr, $repeatTimesLeft), 0, $padAmountLeft); 52 | $paddingRight = utf8_substr(str_repeat($padStr, $repeatTimesRight), 0, $padAmountLeft); 53 | return $paddingLeft . $input . $paddingRight; 54 | } 55 | 56 | trigger_error('utf8_str_pad: Unknown padding type (' . $type . ')',E_USER_ERROR); 57 | } 58 | -------------------------------------------------------------------------------- /includes/utf8/tests/cases/utf8_strcspn.test.php: -------------------------------------------------------------------------------- 1 | UnitTestCase('test_utf8_strcspn()'); 26 | } 27 | 28 | function testNoMatchSingleByteSearch() { 29 | $str = 'iñtërnâtiônàlizætiøn'; 30 | $this->assertEqual(utf8_strcspn($str,'t'),2); 31 | } 32 | 33 | function testNoMatchMultiByteSearch() { 34 | $str = 'iñtërnâtiônàlizætiøn'; 35 | $this->assertEqual(utf8_strcspn($str,'â'),6); 36 | } 37 | 38 | function testCompareStrspn() { 39 | $str = 'aeioustr'; 40 | $this->assertEqual(utf8_strcspn($str,'tr'),strcspn($str,'tr')); 41 | } 42 | 43 | function testMatchAscii() { 44 | $str = 'internationalization'; 45 | $this->assertEqual(utf8_strcspn($str,'a'),strcspn($str,'a')); 46 | } 47 | 48 | function testLinefeed() { 49 | $str = "i\nñtërnâtiônàlizætiøn"; 50 | $this->assertEqual(utf8_strcspn($str,'t'),3); 51 | } 52 | 53 | function testLinefeedMask() { 54 | $str = "i\nñtërnâtiônàlizætiøn"; 55 | $this->assertEqual(utf8_strcspn($str,"\n"),1); 56 | } 57 | } 58 | 59 | //-------------------------------------------------------------------- 60 | /** 61 | * @package utf8 62 | * @subpackage Tests 63 | */ 64 | if (!defined('TEST_RUNNING')) { 65 | define('TEST_RUNNING', true); 66 | $test = &new test_utf8_strcspn (); 67 | $reporter = & getTestReporter(); 68 | $test->run($reporter); 69 | } 70 | -------------------------------------------------------------------------------- /includes/utf8/tests/cases/utf8_strspn.test.php: -------------------------------------------------------------------------------- 1 | UnitTestCase('test_utf8_strspn()'); 26 | } 27 | 28 | function testMatch() { 29 | $str = 'iñtërnâtiônàlizætiøn'; 30 | $this->assertEqual(utf8_strspn($str,'âëiônñrt'),11); 31 | } 32 | 33 | function testMatchTwo() { 34 | $str = 'iñtërnâtiônàlizætiøn'; 35 | $this->assertEqual(utf8_strspn($str,'iñtë'),4); 36 | } 37 | 38 | function testCompareStrspn() { 39 | $str = 'aeioustr'; 40 | $this->assertEqual(utf8_strspn($str,'saeiou'),strspn($str,'saeiou')); 41 | } 42 | 43 | function testMatchAscii() { 44 | $str = 'internationalization'; 45 | $this->assertEqual(utf8_strspn($str,'aeionrt'),strspn($str,'aeionrt')); 46 | } 47 | 48 | function testLinefeed() { 49 | $str = "iñtërnât\niônàlizætiøn"; 50 | $this->assertEqual(utf8_strspn($str,'âëiônñrt'),8); 51 | } 52 | 53 | function testLinefeedMask() { 54 | $str = "iñtërnât\niônàlizætiøn"; 55 | $this->assertEqual(utf8_strspn($str,"âëiônñrt\n"),12); 56 | } 57 | 58 | } 59 | 60 | //-------------------------------------------------------------------- 61 | /** 62 | * @package utf8 63 | * @subpackage Tests 64 | */ 65 | if (!defined('TEST_RUNNING')) { 66 | define('TEST_RUNNING', true); 67 | $test = &new test_utf8_strspn (); 68 | $reporter = & getTestReporter(); 69 | $test->run($reporter); 70 | } 71 | -------------------------------------------------------------------------------- /api/posts_all.php: -------------------------------------------------------------------------------- 1 | getBookmarks(0, NULL, $userservice->getCurrentUserId(), $tag); 22 | 23 | $currentuser = $userservice->getCurrentUser(); 24 | $currentusername = $currentuser[$userservice->getFieldName('username')]; 25 | 26 | // Set up the XML file and output all the posts. 27 | header('Content-Type: text/xml'); 28 | echo '\r\n"; 29 | echo '\r\n"; 30 | 31 | foreach($bookmarks['bookmarks'] as $row) { 32 | if (is_null($row['bDescription']) || (trim($row['bDescription']) == '')) 33 | $description = ''; 34 | else 35 | $description = 'extended="'. filter($row['bDescription'], 'xml') .'" '; 36 | 37 | $taglist = ''; 38 | if (count($row['tags']) > 0) { 39 | foreach($row['tags'] as $tag) 40 | $taglist .= convertTag($tag) .' '; 41 | $taglist = substr($taglist, 0, -1); 42 | } else { 43 | $taglist = 'system:unfiled'; 44 | } 45 | 46 | echo "\t\r\n"; 47 | } 48 | 49 | echo ''; 50 | -------------------------------------------------------------------------------- /tables.sql: -------------------------------------------------------------------------------- 1 | -- 2 | -- Table structure for table `sc_bookmarks` 3 | -- 4 | 5 | CREATE TABLE `sc_bookmarks` ( 6 | `bId` int(11) NOT NULL auto_increment, 7 | `uId` int(11) NOT NULL default '0', 8 | `bIp` varchar(40) default NULL, 9 | `bStatus` tinyint(1) NOT NULL default '0', 10 | `bDatetime` datetime NOT NULL default '0000-00-00 00:00:00', 11 | `bModified` datetime NOT NULL default '0000-00-00 00:00:00', 12 | `bTitle` varchar(255) NOT NULL default '', 13 | `bAddress` text NOT NULL, 14 | `bDescription` varchar(255) default NULL, 15 | `bHash` varchar(32) NOT NULL default '', 16 | PRIMARY KEY (`bId`), 17 | KEY `sc_bookmarks_usd` (`uId`,`bStatus`,`bDatetime`), 18 | KEY `sc_bookmarks_hui` (`bHash`,`uId`,`bId`), 19 | KEY `sc_bookmarks_du` (`bDatetime`,`uId`) 20 | ); 21 | 22 | -- -------------------------------------------------------- 23 | 24 | -- 25 | -- Table structure for table `sc_tags` 26 | -- 27 | 28 | CREATE TABLE `sc_tags` ( 29 | `id` int(11) NOT NULL auto_increment, 30 | `bId` int(11) NOT NULL default '0', 31 | `tag` varchar(32) NOT NULL default '', 32 | PRIMARY KEY (`id`), 33 | UNIQUE KEY `sc_tags_tag_bId` (`tag`,`bId`), 34 | KEY `sc_tags_bId` (`bId`) 35 | ); 36 | 37 | -- -------------------------------------------------------- 38 | 39 | -- 40 | -- Table structure for table `scUsers` 41 | -- 42 | 43 | CREATE TABLE `sc_users` ( 44 | `uId` int(11) NOT NULL auto_increment, 45 | `username` varchar(25) NOT NULL default '', 46 | `password` varchar(40) NOT NULL default '', 47 | `uDatetime` datetime NOT NULL default '0000-00-00 00:00:00', 48 | `uModified` datetime NOT NULL default '0000-00-00 00:00:00', 49 | `name` varchar(50) default NULL, 50 | `email` varchar(50) NOT NULL default '', 51 | `homepage` varchar(255) default NULL, 52 | `uContent` text, 53 | PRIMARY KEY (`uId`) 54 | ); 55 | 56 | -- -------------------------------------------------------- 57 | 58 | -- 59 | -- Table structure for table `sc_watched` 60 | -- 61 | 62 | CREATE TABLE `sc_watched` ( 63 | `wId` int(11) NOT NULL auto_increment, 64 | `uId` int(11) NOT NULL default '0', 65 | `watched` int(11) NOT NULL default '0', 66 | PRIMARY KEY (`wId`), 67 | KEY `sc_watched_uId` (`uId`) 68 | ); -------------------------------------------------------------------------------- /includes/utf8/tests/cases/utf8_ucfirst.test.php: -------------------------------------------------------------------------------- 1 | UnitTestCase('test_utf8_ucfirst()'); 26 | } 27 | 28 | function testUcfirst() { 29 | $str = 'ñtërnâtiônàlizætiøn'; 30 | $ucfirst = 'Ñtërnâtiônàlizætiøn'; 31 | $this->assertEqual(utf8_ucfirst($str),$ucfirst); 32 | } 33 | 34 | function testUcfirstSpace() { 35 | $str = ' iñtërnâtiônàlizætiøn'; 36 | $ucfirst = ' iñtërnâtiônàlizætiøn'; 37 | $this->assertEqual(utf8_ucfirst($str),$ucfirst); 38 | } 39 | 40 | function testUcfirstUpper() { 41 | $str = 'Ñtërnâtiônàlizætiøn'; 42 | $ucfirst = 'Ñtërnâtiônàlizætiøn'; 43 | $this->assertEqual(utf8_ucfirst($str),$ucfirst); 44 | } 45 | 46 | function testEmptyString() { 47 | $str = ''; 48 | $this->assertEqual(utf8_ucfirst($str),''); 49 | } 50 | 51 | function testOneChar() { 52 | $str = 'ñ'; 53 | $ucfirst = "Ñ"; 54 | $this->assertEqual(utf8_ucfirst($str),$ucfirst); 55 | } 56 | 57 | function testLinefeed() { 58 | $str = "ñtërn\nâtiônàlizætiøn"; 59 | $ucfirst = "Ñtërn\nâtiônàlizætiøn"; 60 | $this->assertEqual(utf8_ucfirst($str),$ucfirst); 61 | } 62 | 63 | } 64 | 65 | //-------------------------------------------------------------------- 66 | /** 67 | * @package utf8 68 | * @subpackage Tests 69 | */ 70 | if (!defined('TEST_RUNNING')) { 71 | define('TEST_RUNNING', true); 72 | $test = &new test_utf8_ucfirst(); 73 | $reporter = & getTestReporter(); 74 | $test->run($reporter); 75 | } 76 | -------------------------------------------------------------------------------- /tagdelete.php: -------------------------------------------------------------------------------- 1 | deleteTag($tag)) { 30 | $tplVars['msg'] = T_('Tag deleted'); 31 | $logged_on_user = $userservice->getCurrentUser(); 32 | header('Location: '. createURL('bookmarks', $logged_on_user[$userservice->getFieldName('username')])); 33 | } else { 34 | $tplVars['error'] = T_('Failed to delete the tag'); 35 | $templateservice->loadTemplate('error.500.tpl', $tplVars); 36 | exit(); 37 | } 38 | } elseif ($_POST['cancel']) { 39 | $logged_on_user = $userservice->getCurrentUser(); 40 | header('Location: '. createURL('bookmarks', $logged_on_user[$userservice->getFieldName('username')] .'/'. $tags)); 41 | } 42 | 43 | $tplVars['subtitle'] = T_('Delete Tag') .': '. $tag; 44 | $tplVars['formaction'] = $_SERVER['SCRIPT_NAME'] .'/'. $tag; 45 | $tplVars['referrer'] = $_SERVER['HTTP_REFERER']; 46 | $templateservice->loadTemplate('tagdelete.tpl', $tplVars); 47 | ?> -------------------------------------------------------------------------------- /templates/importNetscape.tpl.php: -------------------------------------------------------------------------------- 1 | includeTemplate($GLOBALS['top_include']); ?> 2 | 3 |
4 |
5 | 6 | 7 | 8 | 12 | 13 | 14 | 15 | 22 | 23 | 24 | 26 | 27 |
9 | 10 | 11 |
16 | 21 |
25 |
28 |
29 | 30 |

31 |
    32 |
  1. 33 |

    :

    34 |
      35 |
    • File → Import and Export… → Export Favorites'); ?>
    • 36 |
    • Bookmarks → Manage Bookmarks… → File → Export…'); ?>
    • 37 |
    • Bookmark Manager → Organize → Export Bookmarks…'); ?>
    • 38 |
    39 |
  2. 40 |
  3. Browse… to find the saved bookmark file on your computer. The maximum size the file can be is 1MB.'); ?>
  4. 41 |
  5. 42 |
  6. Import to start importing the bookmarks; it may take a minute.'); ?>
  7. 43 |
44 |
45 | 46 | includeTemplate($GLOBALS['bottom_include']); ?> -------------------------------------------------------------------------------- /includes/utf8/tests/cases/utf8_strrpos.test.php: -------------------------------------------------------------------------------- 1 | UnitTestCase('utf8_strrpos()'); 25 | } 26 | 27 | function testUtf8() { 28 | $str = 'Iñtërnâtiônàlizætiøn'; 29 | $this->assertEqual(utf8_strrpos($str,'i'),17); 30 | } 31 | 32 | function testUtf8Offset() { 33 | $str = 'Iñtërnâtiônàlizætiøn'; 34 | $this->assertEqual(utf8_strrpos($str,'n',11),19); 35 | } 36 | 37 | function testUtf8Invalid() { 38 | $str = "Iñtërnâtiôn\xe9àlizætiøn"; 39 | $this->assertEqual(utf8_strrpos($str,'æ'),15); 40 | } 41 | 42 | function testAscii() { 43 | $str = 'ABC ABC'; 44 | $this->assertEqual(utf8_strrpos($str,'B'),5); 45 | } 46 | 47 | function testVsStrpos() { 48 | $str = 'ABC 123 ABC'; 49 | $this->assertEqual(utf8_strrpos($str,'B'),strrpos($str,'B')); 50 | } 51 | 52 | function testEmptyStr() { 53 | $str = ''; 54 | $this->assertFalse(utf8_strrpos($str,'x')); 55 | } 56 | 57 | function testLinefeed() { 58 | $str = "Iñtërnâtiônàlizætiø\nn"; 59 | $this->assertEqual(utf8_strrpos($str,'i'),17); 60 | } 61 | 62 | function testLinefeedSearch() { 63 | $str = "Iñtërnâtiônàlizætiø\nn"; 64 | $this->assertEqual(utf8_strrpos($str,"\n"),19); 65 | } 66 | } 67 | 68 | //-------------------------------------------------------------------- 69 | /** 70 | * @package utf8 71 | * @subpackage Tests 72 | */ 73 | if (!defined('TEST_RUNNING')) { 74 | define('TEST_RUNNING', true); 75 | $test = &new test_utf8_strrpos(); 76 | $reporter = & getTestReporter(); 77 | $test->run($reporter); 78 | } 79 | -------------------------------------------------------------------------------- /includes/utf8/tests/cases/utf8_ucwords.test.php: -------------------------------------------------------------------------------- 1 | UnitTestCase('test_utf8_ucwords ()'); 26 | } 27 | 28 | function testUcword() { 29 | $str = 'iñtërnâtiônàlizætiøn'; 30 | $ucwords = 'Iñtërnâtiônàlizætiøn'; 31 | $this->assertEqual(utf8_ucwords($str),$ucwords); 32 | } 33 | 34 | function testUcwords() { 35 | $str = 'iñt ërn âti ônà liz æti øn'; 36 | $ucwords = 'Iñt Ërn Âti Ônà Liz Æti Øn'; 37 | $this->assertEqual(utf8_ucwords($str),$ucwords); 38 | } 39 | 40 | function testUcwordsNewline() { 41 | $str = "iñt ërn âti\n ônà liz æti øn"; 42 | $ucwords = "Iñt Ërn Âti\n Ônà Liz Æti Øn"; 43 | $this->assertEqual(utf8_ucwords($str),$ucwords); 44 | } 45 | 46 | function testEmptyString() { 47 | $str = ''; 48 | $ucwords = ''; 49 | $this->assertEqual(utf8_ucwords($str),$ucwords); 50 | } 51 | 52 | function testOneChar() { 53 | $str = 'ñ'; 54 | $ucwords = 'Ñ'; 55 | $this->assertEqual(utf8_ucwords($str),$ucwords); 56 | } 57 | 58 | function testLinefeed() { 59 | $str = "iñt ërn âti\n ônà liz æti øn"; 60 | $ucwords = "Iñt Ërn Âti\n Ônà Liz Æti Øn"; 61 | $this->assertEqual(utf8_ucwords($str),$ucwords); 62 | } 63 | 64 | } 65 | 66 | //-------------------------------------------------------------------- 67 | /** 68 | * @package utf8 69 | * @subpackage Tests 70 | */ 71 | if (!defined('TEST_RUNNING')) { 72 | define('TEST_RUNNING', true); 73 | $test = &new test_utf8_ucwords (); 74 | $reporter = & getTestReporter(); 75 | $test->run($reporter); 76 | } 77 | -------------------------------------------------------------------------------- /watch.php: -------------------------------------------------------------------------------- 1 | isLoggedOn() && $user) { 26 | $tplVars = array(); 27 | $pagetitle = ''; 28 | 29 | if (is_int($user)) { 30 | $userid = intval($user); 31 | } else { 32 | if (!($userinfo = $userservice->getUserByUsername($user))) { 33 | $tplVars['error'] = sprintf(T_('User with username %s was not found'), $user); 34 | $templateservice->loadTemplate('error.404.tpl', $tplVars); 35 | exit(); 36 | } else { 37 | $userid =& $userinfo['uId']; 38 | } 39 | } 40 | 41 | $watched = $userservice->getWatchStatus($userid, $userservice->getCurrentUserId()); 42 | $changed = $userservice->setWatchStatus($userid); 43 | 44 | if ($watched) { 45 | $tplVars['msg'] = T_('User removed from your watchlist'); 46 | } else { 47 | $tplVars['msg'] = T_('User added to your watchlist'); 48 | } 49 | 50 | $currentUser = $userservice->getCurrentUser(); 51 | $currentUsername = $currentUser[$userservice->getFieldName('username')]; 52 | 53 | header('Location: '. createURL('watchlist', $currentUsername)); 54 | } 55 | ?> 56 | -------------------------------------------------------------------------------- /ajaxGetTitle.php: -------------------------------------------------------------------------------- 1 | (.*)<\/title>/si', $html, $matches); 34 | $title = $matches[1][0]; 35 | 36 | // Get encoding from charset attribute 37 | preg_match_all('//i', $html, $matches); 38 | $encoding = strtoupper($matches[1][0]); 39 | 40 | // Convert to UTF-8 from the original encoding 41 | if (function_exists('mb_convert_encoding')) { 42 | $title = @mb_convert_encoding($title, 'UTF-8', $encoding); 43 | } 44 | 45 | if (utf8_strlen($title) > 0) { 46 | return $title; 47 | } else { 48 | // No title, so return filename 49 | $uriparts = explode('/', $url); 50 | $filename = end($uriparts); 51 | unset($uriparts); 52 | 53 | return $filename; 54 | } 55 | } else { 56 | return false; 57 | } 58 | } 59 | echo getTitle($_GET['url']); 60 | -------------------------------------------------------------------------------- /login.php: -------------------------------------------------------------------------------- 1 | login($posteduser, $_POST['password'], ($_POST['keeppass'] == 'yes'), $path); 31 | if ($login) { 32 | if ($_POST['query']) 33 | header('Location: '. createURL('bookmarks', $posteduser .'?'. $_POST['query'])); 34 | else 35 | header('Location: '. createURL('bookmarks', $posteduser)); 36 | } else { 37 | $tplVars['error'] = T_('The details you have entered are incorrect. Please try again.'); 38 | } 39 | } 40 | if (!$login) { 41 | if ($userservice->isLoggedOn()) { 42 | $cUser = $userservice->getCurrentUser(); 43 | $cUsername = strtolower($cUser[$userservice->getFieldName('username')]); 44 | header('Location: '. createURL('bookmarks', $cUsername)); 45 | } 46 | 47 | $tplVars['subtitle'] = T_('Log In'); 48 | $tplVars['formaction'] = createURL('login'); 49 | $tplVars['querystring'] = filter($_SERVER['QUERY_STRING']); 50 | $templateservice->loadTemplate('login.tpl', $tplVars); 51 | } 52 | ?> 53 | -------------------------------------------------------------------------------- /includes/utf8/tests/cases/utf8_substr_replace.test.php: -------------------------------------------------------------------------------- 1 | UnitTestCase('utf8_str_split()'); 26 | } 27 | 28 | function testReplaceStart() { 29 | $str = 'Iñtërnâtiônàlizætiøn'; 30 | $replaced = 'IñtërnâtX'; 31 | $this->assertEqual(utf8_substr_replace($str,'X',8),$replaced); 32 | } 33 | 34 | function testEmptyString() { 35 | $str = ''; 36 | $replaced = 'X'; 37 | $this->assertEqual(utf8_substr_replace($str,'X',8),$replaced); 38 | } 39 | 40 | function testNegative() { 41 | $str = 'testing'; 42 | $replaced = substr_replace($str,'foo',-2,-2); 43 | $this->assertEqual(utf8_substr_replace($str,'foo',-2,-2),$replaced); 44 | } 45 | 46 | function testZero() { 47 | $str = 'testing'; 48 | $replaced = substr_replace($str,'foo',0,0); 49 | $this->assertEqual(utf8_substr_replace($str,'foo',0,0),$replaced); 50 | } 51 | 52 | function testLinefeed() { 53 | $str = "Iñ\ntërnâtiônàlizætiøn"; 54 | $replaced = "Iñ\ntërnâtX"; 55 | $this->assertEqual(utf8_substr_replace($str,'X',9),$replaced); 56 | } 57 | 58 | function testLinefeedReplace() { 59 | $str = "Iñ\ntërnâtiônàlizætiøn"; 60 | $replaced = "Iñ\ntërnâtX\nY"; 61 | $this->assertEqual(utf8_substr_replace($str,"X\nY",9),$replaced); 62 | } 63 | 64 | } 65 | 66 | //-------------------------------------------------------------------- 67 | /** 68 | * @package utf8 69 | * @subpackage Tests 70 | */ 71 | if (!defined('TEST_RUNNING')) { 72 | define('TEST_RUNNING', true); 73 | $test = &new test_utf8_native_substr_replace(); 74 | $reporter = & getTestReporter(); 75 | $test->run($reporter); 76 | } 77 | -------------------------------------------------------------------------------- /includes/utf8/tests/cases/utf8_stristr.test.php: -------------------------------------------------------------------------------- 1 | UnitTestCase('test_utf8_stristr()'); 26 | } 27 | 28 | function testSubstr() { 29 | $str = 'iñtërnâtiônàlizætiøn'; 30 | $search = 'NÂT'; 31 | $this->assertEqual(utf8_stristr($str,$search),'nâtiônàlizætiøn'); 32 | } 33 | 34 | function testSubstrNoMatch() { 35 | $str = 'iñtërnâtiônàlizætiøn'; 36 | $search = 'foo'; 37 | $this->assertFalse(utf8_stristr($str,$search)); 38 | } 39 | 40 | function testEmptySearch() { 41 | $str = 'iñtërnâtiônàlizætiøn'; 42 | $search = ''; 43 | $this->assertEqual(utf8_stristr($str,$search),'iñtërnâtiônàlizætiøn'); 44 | } 45 | 46 | function testEmptyStr() { 47 | $str = ''; 48 | $search = 'NÂT'; 49 | $this->assertFalse(utf8_stristr($str,$search)); 50 | } 51 | 52 | function testEmptyBoth() { 53 | $str = ''; 54 | $search = ''; 55 | $this->assertEqual(utf8_stristr($str,$search),''); 56 | } 57 | 58 | function testLinefeedStr() { 59 | $str = "iñt\nërnâtiônàlizætiøn"; 60 | $search = 'NÂT'; 61 | $this->assertEqual(utf8_stristr($str,$search),'nâtiônàlizætiøn'); 62 | } 63 | 64 | function testLinefeedBoth() { 65 | $str = "iñtërn\nâtiônàlizætiøn"; 66 | $search = "N\nÂT"; 67 | $this->assertEqual(utf8_stristr($str,$search),"n\nâtiônàlizætiøn"); 68 | } 69 | } 70 | 71 | //-------------------------------------------------------------------- 72 | /** 73 | * @package utf8 74 | * @subpackage Tests 75 | */ 76 | if (!defined('TEST_RUNNING')) { 77 | define('TEST_RUNNING', true); 78 | $test = &new test_utf8_stristr (); 79 | $reporter = & getTestReporter(); 80 | $test->run($reporter); 81 | } 82 | -------------------------------------------------------------------------------- /includes/utf8/tests/cases/utf8_strcasecmp.test.php: -------------------------------------------------------------------------------- 1 | UnitTestCase('test_utf8_strcasecmp()'); 26 | } 27 | 28 | function testCompareEqual() { 29 | $strX = 'iñtërnâtiônàlizætiøn'; 30 | $strY = 'IÑTËRNÂTIÔNÀLIZÆTIØN'; 31 | $this->assertEqual(utf8_strcasecmp($strX,$strY),0); 32 | } 33 | 34 | 35 | function testLess() { 36 | $strX = 'iñtërnâtiônàlizætiøn'; 37 | $strY = 'IÑTËRNÂTIÔÀLIZÆTIØN'; 38 | $this->assertTrue(utf8_strcasecmp($strX,$strY) < 0); 39 | } 40 | 41 | function testGreater() { 42 | $strX = 'iñtërnâtiôàlizætiøn'; 43 | $strY = 'IÑTËRNÂTIÔNÀLIZÆTIØN'; 44 | $this->assertTrue(utf8_strcasecmp($strX,$strY) > 0); 45 | } 46 | 47 | function testEmptyX() { 48 | $strX = ''; 49 | $strY = 'IÑTËRNÂTIÔNÀLIZÆTIØN'; 50 | $this->assertTrue(utf8_strcasecmp($strX,$strY) < 0); 51 | } 52 | 53 | function testEmptyY() { 54 | $strX = 'iñtërnâtiôàlizætiøn'; 55 | $strY = ''; 56 | $this->assertTrue(utf8_strcasecmp($strX,$strY) > 0); 57 | } 58 | 59 | function testEmptyBoth() { 60 | $strX = ''; 61 | $strY = ''; 62 | $this->assertTrue(utf8_strcasecmp($strX,$strY) == 0); 63 | } 64 | 65 | function testLinefeed() { 66 | $strX = "iñtërnâtiôn\nàlizætiøn"; 67 | $strY = "IÑTËRNÂTIÔN\nÀLIZÆTIØN"; 68 | $this->assertTrue(utf8_strcasecmp($strX,$strY) == 0); 69 | } 70 | 71 | } 72 | 73 | //-------------------------------------------------------------------- 74 | /** 75 | * @package utf8 76 | * @subpackage Tests 77 | */ 78 | if (!defined('TEST_RUNNING')) { 79 | define('TEST_RUNNING', true); 80 | $test = &new test_utf8_strcasecmp (); 81 | $reporter = & getTestReporter(); 82 | $test->run($reporter); 83 | } 84 | -------------------------------------------------------------------------------- /includes/utf8/tests/cases/utf8_str_split.test.php: -------------------------------------------------------------------------------- 1 | UnitTestCase('utf8_str_split()'); 26 | } 27 | 28 | function testSplitOneChar() { 29 | $str = 'Iñtërnâtiônàlizætiøn'; 30 | $array = array( 31 | 'I','ñ','t','ë','r','n','â','t','i','ô','n','à','l','i', 32 | 'z','æ','t','i','ø','n', 33 | ); 34 | $this->assertEqual(utf8_str_split($str),$array); 35 | } 36 | 37 | function testSplitFiveChars() { 38 | $str = 'Iñtërnâtiônàlizætiøn'; 39 | $array = array( 40 | 'Iñtër','nâtiô','nàliz','ætiøn', 41 | ); 42 | $this->assertEqual(utf8_str_split($str,5),$array); 43 | } 44 | 45 | function testSplitSixChars() { 46 | $str = 'Iñtërnâtiônàlizætiøn'; 47 | $array = array( 48 | 'Iñtërn','âtiônà', 'lizæti','øn', 49 | ); 50 | $this->assertEqual(utf8_str_split($str,6),$array); 51 | } 52 | 53 | function testSplitLong() { 54 | $str = 'Iñtërnâtiônàlizætiøn'; 55 | $array = array( 56 | 'Iñtërnâtiônàlizætiøn', 57 | ); 58 | $this->assertEqual(utf8_str_split($str,40),$array); 59 | } 60 | 61 | function testSplitNewline() { 62 | $str = "Iñtërn\nâtiônàl\nizætiøn\n"; 63 | $array = array( 64 | 'I','ñ','t','ë','r','n',"\n",'â','t','i','ô','n','à','l',"\n",'i', 65 | 'z','æ','t','i','ø','n',"\n", 66 | ); 67 | $this->assertEqual(utf8_str_split($str),$array); 68 | } 69 | 70 | } 71 | 72 | //-------------------------------------------------------------------- 73 | /** 74 | * @package utf8 75 | * @subpackage Tests 76 | */ 77 | if (!defined('TEST_RUNNING')) { 78 | define('TEST_RUNNING', true); 79 | $test = &new test_utf8_str_split(); 80 | $reporter = & getTestReporter(); 81 | $test->run($reporter); 82 | } 83 | -------------------------------------------------------------------------------- /templates/register.tpl.php: -------------------------------------------------------------------------------- 1 | includeTemplate($GLOBALS['top_include']); ?> 2 | 3 |

.

4 | 5 |
6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 |
33 |
34 | 55 | 56 | includeTemplate($GLOBALS['bottom_include']); ?> -------------------------------------------------------------------------------- /api/posts_recent.php: -------------------------------------------------------------------------------- 1 | $countMax) 26 | $count = $countMax; 27 | elseif ($count < 0) 28 | $count = 0; 29 | } else { 30 | $count = $countDefault; 31 | } 32 | 33 | // Get the posts relevant to the passed-in variables. 34 | $bookmarks =& $bookmarkservice->getBookmarks(0, $count, $userservice->getCurrentUserId(), $tag); 35 | 36 | $currentuser = $userservice->getCurrentUser(); 37 | $currentusername = $currentuser[$userservice->getFieldName('username')]; 38 | 39 | // Set up the XML file and output all the tags. 40 | header('Content-Type: text/xml'); 41 | echo '\r\n"; 42 | echo '\r\n"; 43 | 44 | foreach ($bookmarks['bookmarks'] as $row) { 45 | if (is_null($row['bDescription']) || (trim($row['bDescription']) == '')) 46 | $description = ''; 47 | else 48 | $description = 'extended="'. filter($row['bDescription'], 'xml') .'" '; 49 | 50 | $taglist = ''; 51 | if (count($row['tags']) > 0) { 52 | foreach($row['tags'] as $tag) 53 | $taglist .= convertTag($tag) .' '; 54 | $taglist = substr($taglist, 0, -1); 55 | } else { 56 | $taglist = 'system:unfiled'; 57 | } 58 | 59 | echo "\t\r\n"; 60 | } 61 | 62 | echo ''; 63 | -------------------------------------------------------------------------------- /includes/utf8/trim.php: -------------------------------------------------------------------------------- 1 | 15 | * @see http://www.php.net/ltrim 16 | * @see http://dev.splitbrain.org/view/darcs/dokuwiki/inc/utf8.php 17 | * @return string 18 | * @package utf8 19 | * @subpackage strings 20 | */ 21 | function utf8_ltrim( $str, $charlist = FALSE ) { 22 | if($charlist === FALSE) return ltrim($str); 23 | 24 | //quote charlist for use in a characterclass 25 | $charlist = preg_replace('!([\\\\\\-\\]\\[/^])!','\\\${1}',$charlist); 26 | 27 | return preg_replace('/^['.$charlist.']+/u','',$str); 28 | } 29 | 30 | //--------------------------------------------------------------- 31 | /** 32 | * UTF-8 aware replacement for rtrim() 33 | * Note: you only need to use this if you are supplying the charlist 34 | * optional arg and it contains UTF-8 characters. Otherwise rtrim will 35 | * work normally on a UTF-8 string 36 | * @author Andreas Gohr 37 | * @see http://www.php.net/rtrim 38 | * @see http://dev.splitbrain.org/view/darcs/dokuwiki/inc/utf8.php 39 | * @return string 40 | * @package utf8 41 | * @subpackage strings 42 | */ 43 | function utf8_rtrim( $str, $charlist = FALSE ) { 44 | if($charlist === FALSE) return rtrim($str); 45 | 46 | //quote charlist for use in a characterclass 47 | $charlist = preg_replace('!([\\\\\\-\\]\\[/^])!','\\\${1}',$charlist); 48 | 49 | return preg_replace('/['.$charlist.']+$/u','',$str); 50 | } 51 | 52 | //--------------------------------------------------------------- 53 | /** 54 | * UTF-8 aware replacement for trim() 55 | * Note: you only need to use this if you are supplying the charlist 56 | * optional arg and it contains UTF-8 characters. Otherwise trim will 57 | * work normally on a UTF-8 string 58 | * @author Andreas Gohr 59 | * @see http://www.php.net/trim 60 | * @see http://dev.splitbrain.org/view/darcs/dokuwiki/inc/utf8.php 61 | * @return string 62 | * @package utf8 63 | * @subpackage strings 64 | */ 65 | function utf8_trim( $str, $charlist = FALSE ) { 66 | if($charlist === FALSE) return trim($str); 67 | return utf8_ltrim(utf8_rtrim($str, $charlist), $charlist); 68 | } -------------------------------------------------------------------------------- /includes/utf8/utf8.php: -------------------------------------------------------------------------------- 1 | UnitTestCase('test_utf8_is_word_chars()'); 27 | } 28 | 29 | function testEmptyString() { 30 | $this->assertTrue(utf8_is_word_chars('')); 31 | } 32 | 33 | function testAllWordChars() { 34 | $this->assertTrue(utf8_is_word_chars('HelloWorld')); 35 | } 36 | 37 | function testSpecials() { 38 | $str = 'Hello ' . 39 | chr(0xe0 | (0x2234 >> 12)) . 40 | chr(0x80 | ((0x2234 >> 6) & 0x003f)) . 41 | chr(0x80 | (0x2234 & 0x003f)) . 42 | ' World'; 43 | $this->assertFalse(utf8_is_word_chars($str)); 44 | } 45 | 46 | } 47 | 48 | //-------------------------------------------------------------------- 49 | /** 50 | * @package utf8 51 | * @subpackage Tests 52 | */ 53 | class test_utf8_strip_specials extends UnitTestCase { 54 | 55 | function test_utf8_strip_specials() { 56 | $this->UnitTestCase('test_utf8_strip_specials()'); 57 | } 58 | 59 | function testEmptyString() { 60 | $this->assertEqual(utf8_strip_specials(''),''); 61 | } 62 | 63 | function testStrip() { 64 | $str = 'Hello ' . 65 | chr(0xe0 | (0x2234 >> 12)) . 66 | chr(0x80 | ((0x2234 >> 6) & 0x003f)) . 67 | chr(0x80 | (0x2234 & 0x003f)) . 68 | ' World'; 69 | $this->assertEqual(utf8_strip_specials($str),'HelloWorld'); 70 | } 71 | 72 | } 73 | 74 | //-------------------------------------------------------------------- 75 | /** 76 | * @package utf8 77 | * @subpackage Tests 78 | */ 79 | if (!defined('TEST_RUNNING')) { 80 | define('TEST_RUNNING', true); 81 | $test = &new GroupTest('utf8_ascii'); 82 | $test->addTestCase(new test_utf8_strip_specials()); 83 | $test->addTestCase(new test_utf8_is_word_chars()); 84 | $reporter = & getTestReporter(); 85 | $test->run($reporter); 86 | } 87 | -------------------------------------------------------------------------------- /includes/php-gettext/tests/LocalesTest.php: -------------------------------------------------------------------------------- 1 | assertEquals('sr_RS', _setlocale(LC_MESSAGES, 0)); 12 | 13 | // For an existing locale, it never needs emulation. 14 | putenv("LANG=C"); 15 | _setlocale(LC_MESSAGES, ""); 16 | $this->assertEquals(0, locale_emulation()); 17 | 18 | // If we set it to a non-existent locale, it still works, but uses 19 | // emulation. 20 | _setlocale(LC_MESSAGES, "xxx_XXX"); 21 | $this->assertEquals('xxx_XXX', _setlocale(LC_MESSAGES, 0)); 22 | $this->assertEquals(1, locale_emulation()); 23 | } 24 | 25 | public function test_get_list_of_locales() 26 | { 27 | // For a locale containing country code, we prefer 28 | // full locale name, but if that's not found, fall back 29 | // to the language only locale name. 30 | $this->assertEquals(array("sr_RS", "sr"), 31 | get_list_of_locales("sr_RS")); 32 | 33 | // If language code is used, it's the only thing returned. 34 | $this->assertEquals(array("sr"), 35 | get_list_of_locales("sr")); 36 | 37 | // There is support for language and charset only. 38 | $this->assertEquals(array("sr.UTF-8", "sr"), 39 | get_list_of_locales("sr.UTF-8")); 40 | 41 | // It can also split out character set from the full locale name. 42 | $this->assertEquals(array("sr_RS.UTF-8", "sr_RS", "sr"), 43 | get_list_of_locales("sr_RS.UTF-8")); 44 | 45 | // There is support for @modifier in locale names as well. 46 | $this->assertEquals(array("sr_RS.UTF-8@latin", "sr_RS@latin", "sr@latin", 47 | "sr_RS.UTF-8", "sr_RS", "sr"), 48 | get_list_of_locales("sr_RS.UTF-8@latin")); 49 | 50 | // We can pass in only language and modifier. 51 | $this->assertEquals(array("sr@latin", "sr"), 52 | get_list_of_locales("sr@latin")); 53 | 54 | 55 | // If locale name is not following the regular POSIX pattern, 56 | // it's used verbatim. 57 | $this->assertEquals(array("something"), 58 | get_list_of_locales("something")); 59 | 60 | // Passing in an empty string returns an empty array. 61 | $this->assertEquals(array(), 62 | get_list_of_locales("")); 63 | } 64 | } 65 | 66 | ?> 67 | -------------------------------------------------------------------------------- /api/posts_add.php: -------------------------------------------------------------------------------- 1 | 2) { 51 | $status = 0; 52 | } 53 | } else { 54 | switch ($status_str) { 55 | case 'private': 56 | $status = 2; 57 | break; 58 | case 'shared': 59 | $status = 1; 60 | break; 61 | default: 62 | $status = 0; 63 | break; 64 | } 65 | } 66 | } 67 | 68 | // Error out if there's no address or description 69 | if (is_null($url) || is_null($description)) { 70 | $added = FALSE; 71 | } else { 72 | // We're good with info; now insert it! 73 | if ($bookmarkservice->bookmarkExists($url, $userservice->getCurrentUserId())) 74 | $added = FALSE; 75 | else 76 | $added = $bookmarkservice->addBookmark($url, $description, $extended, $status, $tags, $dt, TRUE); 77 | } 78 | 79 | // Set up the XML file and output the result. 80 | header('Content-Type: text/xml'); 81 | echo '\r\n"; 82 | echo ''; 83 | -------------------------------------------------------------------------------- /jsScuttle.php: -------------------------------------------------------------------------------- 1 | 7 | 8 | var deleted = false; 9 | function deleteBookmark(ele, input) { 10 | $(ele).hide(); 11 | $(ele).parent().append(" - "); 12 | return false; 13 | } 14 | function deleteCancelled(ele) { 15 | $(ele).parent().prev().show(); 16 | $(ele).parent().remove(); 17 | return false; 18 | } 19 | function deleteConfirmed(ele, input) { 20 | $.get("ajaxDelete.php?id=" + input, function(data) { 21 | if (1 === parseInt(data)) { 22 | $(ele).parents(".xfolkentry").slideUp(); 23 | } 24 | }); 25 | return false; 26 | } 27 | 28 | function useAddress(ele) { 29 | var address = ele.value; 30 | if (address != '') { 31 | if (address.indexOf(':') < 0) { 32 | address = 'http:\/\/' + address; 33 | } 34 | getTitle(address, null); 35 | ele.value = address; 36 | } 37 | } 38 | 39 | function getTitle(input) { 40 | var title = $("#titleField").val(); 41 | if (title.length < 1) { 42 | $("#titleField").css("background-image", "url(loading.gif)"); 43 | if (input.indexOf("http") > -1) { 44 | $.get("ajaxGetTitle.php?url=" + input, function(data) { 45 | $("#titleField").css("background-image", "none") 46 | .val(data); 47 | }); 48 | } 49 | } 50 | } 51 | 52 | /* Page load */ 53 | $(function() { 54 | // Insert Flash player for MP3 links 55 | if ($("#bookmarks").length > 0) { 56 | $("a[href$=.mp3].taggedlink").each(function() { 57 | var url = this.href; 58 | var code = ''; 59 | code = code + ''; 60 | code = code + ' '; 61 | $(this).prepend(code); 62 | }); 63 | } 64 | }) 65 | -------------------------------------------------------------------------------- /api/posts_get.php: -------------------------------------------------------------------------------- 1 | getBookmarks(0, NULL, $userservice->getCurrentUserId(), $tag, NULL, NULL, NULL, $dtstart, $dtend); 34 | 35 | $currentuser = $userservice->getCurrentUser(); 36 | $currentusername = $currentuser[$userservice->getFieldName('username')]; 37 | 38 | // Set up the XML file and output all the tags. 39 | header('Content-Type: text/xml'); 40 | echo '\r\n"; 41 | echo '\r\n"; 42 | 43 | foreach ($bookmarks['bookmarks'] as $row) { 44 | if (is_null($row['bDescription']) || (trim($row['bDescription']) == '')) 45 | $description = ''; 46 | else 47 | $description = 'extended="'. filter($row['bDescription'], 'xml') .'" '; 48 | 49 | $taglist = ''; 50 | if (count($row['tags']) > 0) { 51 | foreach($row['tags'] as $tag) 52 | $taglist .= convertTag($tag) .' '; 53 | $taglist = substr($taglist, 0, -1); 54 | } else { 55 | $taglist = 'system:unfiled'; 56 | } 57 | 58 | echo "\t\r\n"; 59 | } 60 | 61 | echo ''; 62 | -------------------------------------------------------------------------------- /tagrename.php: -------------------------------------------------------------------------------- 1 | loadTemplate('error.500.tpl', $tplVars); 42 | exit(); 43 | } else { 44 | // Rename the tag. 45 | if($tagservice->renameTag($userservice->getCurrentUserId(), $old, $new, true)) { 46 | $tplVars['msg'] = T_('Tag renamed'); 47 | $logged_on_user = $userservice->getCurrentUser(); 48 | header('Location: '. createURL('bookmarks', $logged_on_user[$userservice->getFieldName('username')])); 49 | } else { 50 | $tplVars['error'] = T_('Failed to rename the tag'); 51 | $templateservice->loadTemplate('error.500.tpl', $tplVars); 52 | exit(); 53 | } 54 | } 55 | } elseif ($_POST['cancel']) { 56 | $logged_on_user = $userservice->getCurrentUser(); 57 | header('Location: '. createURL('bookmarks', $logged_on_user[$userservice->getFieldName('username')] .'/'. $tags)); 58 | } 59 | 60 | $tplVars['subtitle'] = T_('Rename Tag') .': '. $tag; 61 | $tplVars['formaction'] = $_SERVER['SCRIPT_NAME'] .'/'. $tag; 62 | $tplVars['referrer'] = $_SERVER['HTTP_REFERER']; 63 | $tplVars['old'] = $tag; 64 | $templateservice->loadTemplate('tagrename.tpl', $tplVars); 65 | ?> 66 | 67 | -------------------------------------------------------------------------------- /includes/utf8/ord.php: -------------------------------------------------------------------------------- 1 | = 0 && $ord0 <= 127 ) { 22 | return $ord0; 23 | } 24 | 25 | if ( !isset($chr{1}) ) { 26 | trigger_error('Short sequence - at least 2 bytes expected, only 1 seen'); 27 | return FALSE; 28 | } 29 | 30 | $ord1 = ord($chr{1}); 31 | if ( $ord0 >= 192 && $ord0 <= 223 ) { 32 | return ( $ord0 - 192 ) * 64 33 | + ( $ord1 - 128 ); 34 | } 35 | 36 | if ( !isset($chr{2}) ) { 37 | trigger_error('Short sequence - at least 3 bytes expected, only 2 seen'); 38 | return FALSE; 39 | } 40 | $ord2 = ord($chr{2}); 41 | if ( $ord0 >= 224 && $ord0 <= 239 ) { 42 | return ($ord0-224)*4096 43 | + ($ord1-128)*64 44 | + ($ord2-128); 45 | } 46 | 47 | if ( !isset($chr{3}) ) { 48 | trigger_error('Short sequence - at least 4 bytes expected, only 3 seen'); 49 | return FALSE; 50 | } 51 | $ord3 = ord($chr{3}); 52 | if ($ord0>=240 && $ord0<=247) { 53 | return ($ord0-240)*262144 54 | + ($ord1-128)*4096 55 | + ($ord2-128)*64 56 | + ($ord3-128); 57 | 58 | } 59 | 60 | if ( !isset($chr{4}) ) { 61 | trigger_error('Short sequence - at least 5 bytes expected, only 4 seen'); 62 | return FALSE; 63 | } 64 | $ord4 = ord($chr{4}); 65 | if ($ord0>=248 && $ord0<=251) { 66 | return ($ord0-248)*16777216 67 | + ($ord1-128)*262144 68 | + ($ord2-128)*4096 69 | + ($ord3-128)*64 70 | + ($ord4-128); 71 | } 72 | 73 | if ( !isset($chr{5}) ) { 74 | trigger_error('Short sequence - at least 6 bytes expected, only 5 seen'); 75 | return FALSE; 76 | } 77 | if ($ord0>=252 && $ord0<=253) { 78 | return ($ord0-252) * 1073741824 79 | + ($ord1-128)*16777216 80 | + ($ord2-128)*262144 81 | + ($ord3-128)*4096 82 | + ($ord4-128)*64 83 | + (ord($c{5})-128); 84 | } 85 | 86 | if ( $ord0 >= 254 && $ord0 <= 255 ) { 87 | trigger_error('Invalid UTF-8 with surrogate ordinal '.$ord0); 88 | return FALSE; 89 | } 90 | 91 | } 92 | 93 | -------------------------------------------------------------------------------- /index.php: -------------------------------------------------------------------------------- 1 | logout($path); 30 | $tplvars['msg'] = T_('You have now logged out'); 31 | } 32 | 33 | // Header variables 34 | $tplVars['loadjs'] = true; 35 | $tplVars['rsschannels'] = array( 36 | array(sprintf(T_('%s: Recent bookmarks'), $sitename), createURL('rss')) 37 | ); 38 | 39 | if ($usecache) { 40 | // Generate hash for caching on 41 | $hashtext = $_SERVER['REQUEST_URI']; 42 | if ($userservice->isLoggedOn()) { 43 | $hashtext .= $userservice->getCurrentUserID(); 44 | } 45 | $hash = md5($hashtext); 46 | 47 | // Cache for 15 minutes 48 | $cacheservice->Start($hash, 900); 49 | } 50 | 51 | // Pagination 52 | $perpage = getPerPageCount(); 53 | 54 | $tplVars['page'] = 0; 55 | $tplVars['start'] = 0; 56 | $tplVars['popCount'] = 30; 57 | $tplVars['sidebar_blocks'] = array('recent'); 58 | $tplVars['range'] = 'all'; 59 | $tplVars['pagetitle'] = T_('Store, share and tag your favourite links'); 60 | $tplVars['subtitle'] = T_('Recent Bookmarks'); 61 | $tplVars['bookmarkCount'] = 1; 62 | $bookmarks =& $bookmarkservice->getBookmarks(0, $perpage, NULL, NULL, NULL, getSortOrder(), NULL); 63 | $tplVars['total'] = $bookmarks['total']; 64 | $tplVars['bookmarks'] =& $bookmarks['bookmarks']; 65 | $tplVars['cat_url'] = createURL('tags', '%2$s'); 66 | $tplVars['nav_url'] = createURL('index', '%3$s'); 67 | 68 | $templateservice->loadTemplate('bookmarks.tpl', $tplVars); 69 | 70 | if ($usecache) { 71 | // Cache output if existing copy has expired 72 | $cacheservice->End($hash); 73 | } 74 | -------------------------------------------------------------------------------- /includes/php-gettext/examples/pigs_fallback.php: -------------------------------------------------------------------------------- 1 | . 4 | Copyright (c) 2005,2006 Steven Armstrong 5 | 6 | This file is part of PHP-gettext. 7 | 8 | PHP-gettext is free software; you can redistribute it and/or modify 9 | it under the terms of the GNU General Public License as published by 10 | the Free Software Foundation; either version 2 of the License, or 11 | (at your option) any later version. 12 | 13 | PHP-gettext is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with PHP-gettext; if not, write to the Free Software 20 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 21 | 22 | */ 23 | 24 | error_reporting(E_ALL | E_STRICT); 25 | 26 | // define constants 27 | define('PROJECT_DIR', realpath('./')); 28 | define('LOCALE_DIR', PROJECT_DIR .'/locale'); 29 | define('DEFAULT_LOCALE', 'en_US'); 30 | 31 | require_once('../gettext.inc'); 32 | 33 | $supported_locales = array('en_US', 'sr_CS', 'de_CH'); 34 | $encoding = 'UTF-8'; 35 | 36 | $locale = (isset($_GET['lang']))? $_GET['lang'] : DEFAULT_LOCALE; 37 | 38 | // gettext setup 39 | T_setlocale(LC_MESSAGES, $locale); 40 | // Set the text domain as 'messages' 41 | $domain = 'messages'; 42 | T_bindtextdomain($domain, LOCALE_DIR); 43 | T_bind_textdomain_codeset($domain, $encoding); 44 | T_textdomain($domain); 45 | 46 | header("Content-type: text/html; charset=$encoding"); 47 | ?> 48 | 49 | 50 | PHP-gettext fallback example 51 | 52 | 53 |

PHP-gettext as a fallback solution

54 |

Example showing how to use PHP-gettext as a fallback solution if the native gettext library is not available or the system does not support the requested locale.

55 | 56 | "; 58 | foreach($supported_locales as $l) { 59 | print "[$l] "; 60 | } 61 | print "

\n"; 62 | 63 | if (!locale_emulation()) { 64 | print "

locale '$locale' is supported by your system, using native gettext implementation.

\n"; 65 | } 66 | else { 67 | print "

locale '$locale' is not supported on your system, using custom gettext implementation.

\n"; 68 | } 69 | ?> 70 | 71 |
72 | 73 | "; 76 | print T_("This is how the story goes.\n\n"); 77 | for ($number=6; $number>=0; $number--) { 78 | print sprintf( T_ngettext("%d pig went to the market\n", 79 | "%d pigs went to the market\n", $number), 80 | $number ); 81 | } 82 | print "\n"; 83 | ?> 84 | 85 |
86 |

« back

87 | 88 | 89 | -------------------------------------------------------------------------------- /includes/php-gettext/examples/pigs_dropin.php: -------------------------------------------------------------------------------- 1 | . 4 | Copyright (c) 2005,2006 Steven Armstrong 5 | 6 | This file is part of PHP-gettext. 7 | 8 | PHP-gettext is free software; you can redistribute it and/or modify 9 | it under the terms of the GNU General Public License as published by 10 | the Free Software Foundation; either version 2 of the License, or 11 | (at your option) any later version. 12 | 13 | PHP-gettext is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with PHP-gettext; if not, write to the Free Software 20 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 21 | 22 | */ 23 | 24 | error_reporting(E_ALL | E_STRICT); 25 | 26 | // define constants 27 | define('PROJECT_DIR', realpath('./')); 28 | define('LOCALE_DIR', PROJECT_DIR .'/locale'); 29 | define('DEFAULT_LOCALE', 'en_US'); 30 | 31 | require_once('../gettext.inc'); 32 | 33 | $supported_locales = array('en_US', 'sr_CS', 'de_CH'); 34 | $encoding = 'UTF-8'; 35 | 36 | $locale = (isset($_GET['lang']))? $_GET['lang'] : DEFAULT_LOCALE; 37 | 38 | // gettext setup 39 | T_setlocale(LC_MESSAGES, $locale); 40 | // Set the text domain as 'messages' 41 | $domain = 'messages'; 42 | bindtextdomain($domain, LOCALE_DIR); 43 | // bind_textdomain_codeset is supported only in PHP 4.2.0+ 44 | if (function_exists('bind_textdomain_codeset')) 45 | bind_textdomain_codeset($domain, $encoding); 46 | textdomain($domain); 47 | 48 | header("Content-type: text/html; charset=$encoding"); 49 | ?> 50 | 51 | 52 | PHP-gettext dropin example 53 | 54 | 55 |

PHP-gettext as a dropin replacement

56 |

Example showing how to use PHP-gettext as a dropin replacement for the native gettext library.

57 | "; 59 | foreach($supported_locales as $l) { 60 | print "[$l] "; 61 | } 62 | print "

\n"; 63 | 64 | if (!locale_emulation()) { 65 | print "

locale '$locale' is supported by your system, using native gettext implementation.

\n"; 66 | } 67 | else { 68 | print "

locale '$locale' is _not_ supported on your system, using the default locale '". DEFAULT_LOCALE ."'.

\n"; 69 | } 70 | ?> 71 | 72 |
73 | 74 | "; 77 | print _("This is how the story goes.\n\n"); 78 | for ($number=6; $number>=0; $number--) { 79 | print sprintf(T_ngettext("%d pig went to the market\n", 80 | "%d pigs went to the market\n", $number), 81 | $number ); 82 | } 83 | print "\n"; 84 | ?> 85 | 86 |
87 |

« back

88 | 89 | 90 | -------------------------------------------------------------------------------- /alltags.php: -------------------------------------------------------------------------------- 1 | isLoggedOn()) { 38 | $hashtext .= $userservice->getCurrentUserID(); 39 | } 40 | $hash = md5($hashtext); 41 | 42 | // Cache for an hour 43 | $cacheservice->Start($hash, 3600); 44 | } 45 | 46 | // Header variables 47 | $tplvars = array(); 48 | $pagetitle = T_('All Tags'); 49 | 50 | if (isset($user) && $user != '') { 51 | if (is_int($user)) { 52 | $userid = intval($user); 53 | } else { 54 | if ($userinfo = $userservice->getUserByUsername($user)) { 55 | $userid =& $userinfo[$userservice->getFieldName('primary')]; 56 | } else { 57 | $tplVars['error'] = sprintf(T_('User with username %s was not found'), $user); 58 | $templateservice->loadTemplate('error.404.tpl', $tplVars); 59 | //throw a 404 error 60 | exit(); 61 | } 62 | } 63 | $pagetitle .= ': '. ucfirst($user); 64 | } else { 65 | $userid = NULL; 66 | } 67 | 68 | $tags =& $tagservice->getTags($userid); 69 | $tplVars['tags'] =& $tagservice->tagCloud($tags, 5, 90, 225, getSortOrder()); 70 | $tplVars['user'] = $user; 71 | 72 | if (isset($userid)) { 73 | $tplVars['cat_url'] = createURL('bookmarks', '%s/%s'); 74 | } else { 75 | $tplVars['cat_url'] = createURL('tags', '%2$s'); 76 | } 77 | 78 | $tplVars['subtitle'] = $pagetitle; 79 | $templateservice->loadTemplate('tags.tpl', $tplVars); 80 | 81 | if ($usecache) { 82 | // Cache output if existing copy has expired 83 | $cacheservice->End($hash); 84 | } 85 | ?> 86 | -------------------------------------------------------------------------------- /password.php: -------------------------------------------------------------------------------- 1 | e-mail address.'); 36 | 37 | // USERNAME AND E-MAIL 38 | } else { 39 | 40 | // NO MATCH 41 | if (!($userinfo = $userservice->getUserByUsername($_POST['username']))) { 42 | $tplVars['error'] = T_('No matches found for that username.'); 43 | 44 | } elseif ($_POST['email'] != $userinfo['email']) { 45 | $tplVars['error'] = T_('No matches found for that combination of username and e-mail address.'); 46 | 47 | // MATCH 48 | } else { 49 | 50 | // GENERATE AND STORE PASSWORD 51 | $password = $userservice->generatePassword($userinfo['uId']); 52 | if (!($password = $userservice->generatePassword($userinfo['uId']))) { 53 | $tplVars['error'] = T_('There was an error while generating your new password. Please try again.'); 54 | 55 | } else { 56 | // SEND E-MAIL 57 | $message = T_('Your new password is:') ."\n". $password ."\n\n". T_('To keep your bookmarks secure, you should change this password in your profile the next time you log in.'); 58 | $message = wordwrap($message, 70); 59 | $headers = 'From: '. $adminemail; 60 | $mail = mail($_POST['email'], sprintf(T_('%s Account Information'), $sitename), $message); 61 | 62 | $tplVars['msg'] = sprintf(T_('New password generated and sent to %s'), $_POST['email']); 63 | } 64 | } 65 | } 66 | } 67 | 68 | $templatename = 'password.tpl'; 69 | $tplVars['subtitle'] = T_('Forgotten Password'); 70 | $tplVars['formaction'] = createURL('password'); 71 | $templateservice->loadTemplate($templatename, $tplVars); 72 | ?> 73 | -------------------------------------------------------------------------------- /tags.php: -------------------------------------------------------------------------------- 1 | isLoggedOn()) { 42 | $hash = md5($_SERVER['REQUEST_URI'] . $userservice->getCurrentUserID()); 43 | } else { 44 | $hash = md5($_SERVER['REQUEST_URI']); 45 | } 46 | 47 | // Cache for 30 minutes 48 | $cacheservice->Start($hash, 1800); 49 | } 50 | 51 | // Header variables 52 | $tplVars['pagetitle'] = $pagetitle; 53 | $tplVars['loadjs'] = true; 54 | $tplVars['rsschannels'] = array( 55 | array(filter($sitename .': '. $pagetitle), createURL('rss', 'all/'. filter($cat, 'url'))) 56 | ); 57 | 58 | // Pagination 59 | $perpage = getPerPageCount(); 60 | if (isset($_GET['page']) && intval($_GET['page']) > 1) { 61 | $page = $_GET['page']; 62 | $start = ($page - 1) * $perpage; 63 | } else { 64 | $page = 0; 65 | $start = 0; 66 | } 67 | 68 | $tplVars['page'] = $page; 69 | $tplVars['start'] = $start; 70 | $tplVars['popCount'] = 25; 71 | $tplVars['currenttag'] = $cat; 72 | $tplVars['sidebar_blocks'] = array('related', 'popular'); 73 | $tplVars['subtitle'] = filter($pagetitle); 74 | $tplVars['bookmarkCount'] = $start + 1; 75 | $bookmarks =& $bookmarkservice->getBookmarks($start, $perpage, NULL, $cat, NULL, getSortOrder()); 76 | $tplVars['total'] = $bookmarks['total']; 77 | $tplVars['bookmarks'] =& $bookmarks['bookmarks']; 78 | $tplVars['cat_url'] = createURL('tags', '%2$s'); 79 | $tplVars['nav_url'] = createURL('tags', '%2$s%3$s'); 80 | 81 | $templateservice->loadTemplate('bookmarks.tpl', $tplVars); 82 | 83 | if ($usecache) { 84 | // Cache output if existing copy has expired 85 | $cacheservice->End($hash); 86 | } 87 | ?> 88 | -------------------------------------------------------------------------------- /includes/utf8/tests/cases/utf8_substr.test.php: -------------------------------------------------------------------------------- 1 | UnitTestCase('utf8_substr()'); 25 | } 26 | 27 | function testUtf8() { 28 | $str = 'Iñtërnâtiônàlizætiøn'; 29 | $this->assertEqual(utf8_substr($str,0,2),'Iñ'); 30 | } 31 | 32 | function testUtf8Two() { 33 | $str = 'Iñtërnâtiônàlizætiøn'; 34 | $this->assertEqual(utf8_substr($str,2,2),'të'); 35 | } 36 | 37 | function testUtf8Zero() { 38 | $str = 'Iñtërnâtiônàlizætiøn'; 39 | $this->assertEqual(utf8_substr($str,0),'Iñtërnâtiônàlizætiøn'); 40 | } 41 | 42 | function testUtf8ZeroZero() { 43 | $str = 'Iñtërnâtiônàlizætiøn'; 44 | $this->assertEqual(utf8_substr($str,0,0),''); 45 | } 46 | 47 | function testStartGreatThanLength() { 48 | $str = 'Iñt'; 49 | $this->assertFalse(utf8_substr($str,4)); 50 | } 51 | 52 | function testCompareStartGreatThanLength() { 53 | $str = 'abc'; 54 | $this->assertEqual(utf8_substr($str,4),substr($str,4)); 55 | } 56 | 57 | function testLengthBeyondString() { 58 | $str = 'Iñt'; 59 | $this->assertEqual(utf8_substr($str,1,5),'ñt'); 60 | } 61 | 62 | function testCompareLengthBeyondString() { 63 | $str = 'abc'; 64 | $this->assertEqual(utf8_substr($str,1,5),substr($str,1,5)); 65 | } 66 | 67 | function testStartNegative() { 68 | $str = 'Iñtërnâtiônàlizætiøn'; 69 | $this->assertEqual(utf8_substr($str,-4), 'tiøn'); 70 | } 71 | 72 | function testLengthNegative() { 73 | $str = 'Iñtërnâtiônàlizætiøn'; 74 | $this->assertEqual(utf8_substr($str,10,-2), 'nàlizæti'); 75 | } 76 | 77 | function testStartLengthNegative() { 78 | $str = 'Iñtërnâtiônàlizætiøn'; 79 | $this->assertEqual(utf8_substr($str,-4,-2), 'ti'); 80 | } 81 | 82 | function testLinefeed() { 83 | $str = "Iñ\ntërnâtiônàlizætiøn"; 84 | $this->assertEqual(utf8_substr($str,1,5),"ñ\ntër"); 85 | } 86 | 87 | function testLongLength() { 88 | $str = 'Iñtërnâtiônàlizætiøn'; 89 | $this->assertEqual(utf8_substr($str,0,15536),'Iñtërnâtiônàlizætiøn'); 90 | } 91 | 92 | } 93 | 94 | //-------------------------------------------------------------------- 95 | /** 96 | * @package utf8 97 | * @subpackage Tests 98 | */ 99 | if (!defined('TEST_RUNNING')) { 100 | define('TEST_RUNNING', true); 101 | $test = & new test_utf8_substr(); 102 | $reporter = & getTestReporter(); 103 | $test->run($reporter); 104 | } 105 | -------------------------------------------------------------------------------- /populartags.php: -------------------------------------------------------------------------------- 1 | isLoggedOn()) { 33 | $hashtext .= $userservice->getCurrentUserID(); 34 | $currentUser = $userservice->getCurrentUser(); 35 | $currentUsername = $currentUser[$userservice->getFieldName('username')]; 36 | if ($currentUsername == $user) { 37 | $hashtext .= $user; 38 | } 39 | } 40 | $hash = md5($hashtext); 41 | 42 | // Cache for an hour 43 | $cacheservice->Start($hash, 3600); 44 | } 45 | 46 | // Header variables 47 | $tplvars = array(); 48 | $pagetitle = T_('Popular Tags'); 49 | 50 | if (isset($user) && $user != '') { 51 | if (is_int($user)) { 52 | $userid = intval($user); 53 | } else { 54 | if ($userinfo = $userservice->getUserByUsername($user)) { 55 | $userid =& $userinfo[$userservice->getFieldName('primary')]; 56 | } else { 57 | $tplVars['error'] = sprintf(T_('User with username %s was not found'), $user); 58 | $templateservice->loadTemplate('error.404.tpl', $tplVars); 59 | //throw a 404 error 60 | exit(); 61 | } 62 | } 63 | $pagetitle .= ': '. ucfirst($user); 64 | } else { 65 | $userid = NULL; 66 | } 67 | 68 | $tags = $tagservice->getPopularTags($userid, 150, $logged_on_userid); 69 | $tplVars['tags'] =& $tagservice->tagCloud($tags, 5, 90, 225, getSortOrder('alphabet_asc')); 70 | $tplVars['user'] = $user; 71 | 72 | if (isset($userid)) { 73 | $tplVars['cat_url'] = createURL('bookmarks', '%s/%s'); 74 | } else { 75 | $tplVars['cat_url'] = createURL('tags', '%2$s'); 76 | } 77 | 78 | $tplVars['subtitle'] = $pagetitle; 79 | $templateservice->loadTemplate('tags.tpl', $tplVars); 80 | 81 | if ($usecache) { 82 | // Cache output if existing copy has expired 83 | $cacheservice->End($hash); 84 | } 85 | ?> 86 | -------------------------------------------------------------------------------- /includes/utf8/utils/patterns.php: -------------------------------------------------------------------------------- 1 |