summaryrefslogtreecommitdiffstats
path: root/wp-inst/wp-content
diff options
context:
space:
mode:
Diffstat (limited to 'wp-inst/wp-content')
-rw-r--r--wp-inst/wp-content/blogs20
-rw-r--r--wp-inst/wp-content/plugins/BAStats/BAStats.php566
-rw-r--r--wp-inst/wp-content/plugins/BAStats/BAStats_graph.php375
-rw-r--r--wp-inst/wp-content/plugins/BAStats/BAStats_logger.php310
-rw-r--r--wp-inst/wp-content/plugins/BAStats/BAStats_options.php171
-rw-r--r--wp-inst/wp-content/plugins/BAStats/BAStats_reports.php330
-rw-r--r--wp-inst/wp-content/plugins/hello.php73
-rw-r--r--wp-inst/wp-content/plugins/jb_Recent_Comments_List.php68
-rw-r--r--wp-inst/wp-content/plugins/kittens-spaminator.php529
-rw-r--r--wp-inst/wp-content/plugins/wp_ozh_clickcounter.php522
-rw-r--r--wp-inst/wp-content/plugins/wpmu-plugin.php598
-rw-r--r--wp-inst/wp-content/sitetemplates/humancondition/img/bg.gifbin0 -> 202 bytes
-rw-r--r--wp-inst/wp-content/sitetemplates/humancondition/img/bullet.gifbin0 -> 53 bytes
-rw-r--r--wp-inst/wp-content/sitetemplates/humancondition/img/date.gifbin0 -> 4989 bytes
-rw-r--r--wp-inst/wp-content/sitetemplates/humancondition/img/fg.gifbin0 -> 126 bytes
-rw-r--r--wp-inst/wp-content/sitetemplates/humancondition/img/footer.gifbin0 -> 10488 bytes
-rw-r--r--wp-inst/wp-content/sitetemplates/humancondition/img/header.gifbin0 -> 12049 bytes
-rw-r--r--wp-inst/wp-content/sitetemplates/humancondition/img/posts.gifbin0 -> 48 bytes
-rw-r--r--wp-inst/wp-content/sitetemplates/humancondition/img/today.gifbin0 -> 48 bytes
-rw-r--r--wp-inst/wp-content/sitetemplates/humancondition/index.php10
-rw-r--r--wp-inst/wp-content/sitetemplates/humancondition/screenshot-sm.gifbin0 -> 17574 bytes
-rw-r--r--wp-inst/wp-content/sitetemplates/humancondition/screenshot.gifbin0 -> 102913 bytes
-rw-r--r--wp-inst/wp-content/sitetemplates/humancondition/templates/comments.html57
-rw-r--r--wp-inst/wp-content/sitetemplates/humancondition/templates/index.html127
-rw-r--r--wp-inst/wp-content/sitetemplates/humancondition/templates/post.html18
-rw-r--r--wp-inst/wp-content/sitetemplates/humancondition/templates/wp-layout.css413
-rw-r--r--wp-inst/wp-content/smarty-plugins/block.textformat.php102
-rw-r--r--wp-inst/wp-content/smarty-plugins/compiler.assign.php38
-rw-r--r--wp-inst/wp-content/smarty-plugins/custom_fields.enclosure.php17
-rw-r--r--wp-inst/wp-content/smarty-plugins/custom_fields.photoblog.php14
-rw-r--r--wp-inst/wp-content/smarty-plugins/function.assign.php30
-rw-r--r--wp-inst/wp-content/smarty-plugins/function.assign_debug_info.php39
-rw-r--r--wp-inst/wp-content/smarty-plugins/function.blogroll.php145
-rw-r--r--wp-inst/wp-content/smarty-plugins/function.config_load.php140
-rw-r--r--wp-inst/wp-content/smarty-plugins/function.cork.php157
-rw-r--r--wp-inst/wp-content/smarty-plugins/function.counter.php79
-rw-r--r--wp-inst/wp-content/smarty-plugins/function.custom_fields.php31
-rw-r--r--wp-inst/wp-content/smarty-plugins/function.cycle.php102
-rw-r--r--wp-inst/wp-content/smarty-plugins/function.debug.php35
-rw-r--r--wp-inst/wp-content/smarty-plugins/function.eightball.php23
-rw-r--r--wp-inst/wp-content/smarty-plugins/function.eval.php48
-rw-r--r--wp-inst/wp-content/smarty-plugins/function.fetch.php220
-rw-r--r--wp-inst/wp-content/smarty-plugins/function.get_recent_comments.php25
-rw-r--r--wp-inst/wp-content/smarty-plugins/function.getcustomfield.php39
-rw-r--r--wp-inst/wp-content/smarty-plugins/function.globalvar.php34
-rw-r--r--wp-inst/wp-content/smarty-plugins/function.googleit.php38
-rw-r--r--wp-inst/wp-content/smarty-plugins/function.html_checkboxes.php143
-rw-r--r--wp-inst/wp-content/smarty-plugins/function.html_image.php139
-rw-r--r--wp-inst/wp-content/smarty-plugins/function.html_options.php121
-rw-r--r--wp-inst/wp-content/smarty-plugins/function.html_radios.php150
-rw-r--r--wp-inst/wp-content/smarty-plugins/function.html_select_date.php316
-rw-r--r--wp-inst/wp-content/smarty-plugins/function.html_select_time.php192
-rw-r--r--wp-inst/wp-content/smarty-plugins/function.html_table.php137
-rw-r--r--wp-inst/wp-content/smarty-plugins/function.is_aside.php42
-rw-r--r--wp-inst/wp-content/smarty-plugins/function.lastposts.php66
-rw-r--r--wp-inst/wp-content/smarty-plugins/function.mailto.php163
-rw-r--r--wp-inst/wp-content/smarty-plugins/function.math.php83
-rw-r--r--wp-inst/wp-content/smarty-plugins/function.photoblog.php102
-rw-r--r--wp-inst/wp-content/smarty-plugins/function.pirate.php181
-rw-r--r--wp-inst/wp-content/smarty-plugins/function.popularposts.php80
-rw-r--r--wp-inst/wp-content/smarty-plugins/function.popup.php117
-rw-r--r--wp-inst/wp-content/smarty-plugins/function.popup_init.php39
-rw-r--r--wp-inst/wp-content/smarty-plugins/function.referer.php128
-rw-r--r--wp-inst/wp-content/smarty-plugins/function.relatedstories.php85
-rw-r--r--wp-inst/wp-content/smarty-plugins/function.todayayearago.php84
-rw-r--r--wp-inst/wp-content/smarty-plugins/function.wp_ozh_click_comment_author_link.php27
-rw-r--r--wp-inst/wp-content/smarty-plugins/function.wp_ozh_click_topclicks.php23
-rw-r--r--wp-inst/wp-content/smarty-plugins/insert.getreferer.php211
-rw-r--r--wp-inst/wp-content/smarty-plugins/insert.var.php21
-rw-r--r--wp-inst/wp-content/smarty-plugins/modifier.capitalize.php42
-rw-r--r--wp-inst/wp-content/smarty-plugins/modifier.cat.php33
-rw-r--r--wp-inst/wp-content/smarty-plugins/modifier.count_characters.php31
-rw-r--r--wp-inst/wp-content/smarty-plugins/modifier.count_paragraphs.php28
-rw-r--r--wp-inst/wp-content/smarty-plugins/modifier.count_sentences.php28
-rw-r--r--wp-inst/wp-content/smarty-plugins/modifier.count_words.php32
-rw-r--r--wp-inst/wp-content/smarty-plugins/modifier.date_format.php48
-rw-r--r--wp-inst/wp-content/smarty-plugins/modifier.debug_print_var.php56
-rw-r--r--wp-inst/wp-content/smarty-plugins/modifier.default.php31
-rw-r--r--wp-inst/wp-content/smarty-plugins/modifier.escape.php89
-rw-r--r--wp-inst/wp-content/smarty-plugins/modifier.highlightsearch.php80
-rw-r--r--wp-inst/wp-content/smarty-plugins/modifier.indent.php27
-rw-r--r--wp-inst/wp-content/smarty-plugins/modifier.lower.php25
-rw-r--r--wp-inst/wp-content/smarty-plugins/modifier.nl2br.php35
-rw-r--r--wp-inst/wp-content/smarty-plugins/modifier.regex_replace.php33
-rw-r--r--wp-inst/wp-content/smarty-plugins/modifier.replace.php29
-rw-r--r--wp-inst/wp-content/smarty-plugins/modifier.spacify.php29
-rw-r--r--wp-inst/wp-content/smarty-plugins/modifier.string_format.php28
-rw-r--r--wp-inst/wp-content/smarty-plugins/modifier.strip.php33
-rw-r--r--wp-inst/wp-content/smarty-plugins/modifier.strip_tags.php31
-rw-r--r--wp-inst/wp-content/smarty-plugins/modifier.truncate.php43
-rw-r--r--wp-inst/wp-content/smarty-plugins/modifier.upper.php25
-rw-r--r--wp-inst/wp-content/smarty-plugins/modifier.wordwrap.php28
-rw-r--r--wp-inst/wp-content/smarty-plugins/outputfilter.protect_email.php16
-rw-r--r--wp-inst/wp-content/smarty-plugins/outputfilter.trimwhitespace.php75
-rw-r--r--wp-inst/wp-content/smarty-plugins/shared.escape_special_chars.php30
-rw-r--r--wp-inst/wp-content/smarty-plugins/shared.make_timestamp.php43
-rw-r--r--wp-inst/wp-content/smarty-plugins/wp_ozh_clickcounter.php504
-rw-r--r--wp-inst/wp-content/smarty-templates/blogroll.tpl3
-rw-r--r--wp-inst/wp-content/smarty-templates/noblogroll.tpl1
-rw-r--r--wp-inst/wp-content/themes/classic/comments-popup.php113
-rw-r--r--wp-inst/wp-content/themes/classic/comments.php75
-rw-r--r--wp-inst/wp-content/themes/classic/footer.php12
-rw-r--r--wp-inst/wp-content/themes/classic/header.php30
-rw-r--r--wp-inst/wp-content/themes/classic/index.php32
-rw-r--r--wp-inst/wp-content/themes/classic/sidebar.php43
-rw-r--r--wp-inst/wp-content/themes/classic/style.css313
-rw-r--r--wp-inst/wp-content/themes/default/404.php11
-rw-r--r--wp-inst/wp-content/themes/default/archive.php68
-rw-r--r--wp-inst/wp-content/themes/default/archives.php25
-rw-r--r--wp-inst/wp-content/themes/default/comments-popup.php113
-rw-r--r--wp-inst/wp-content/themes/default/comments.php104
-rw-r--r--wp-inst/wp-content/themes/default/footer.php20
-rw-r--r--wp-inst/wp-content/themes/default/header.php61
-rw-r--r--wp-inst/wp-content/themes/default/images/kubrickbg.jpgbin0 -> 1043 bytes
-rw-r--r--wp-inst/wp-content/themes/default/images/kubrickbgcolor.jpgbin0 -> 556 bytes
-rw-r--r--wp-inst/wp-content/themes/default/images/kubrickbgwide.jpgbin0 -> 1014 bytes
-rw-r--r--wp-inst/wp-content/themes/default/images/kubrickfooter.jpgbin0 -> 2443 bytes
-rw-r--r--wp-inst/wp-content/themes/default/images/kubrickheader.jpgbin0 -> 7868 bytes
-rw-r--r--wp-inst/wp-content/themes/default/index.php39
-rw-r--r--wp-inst/wp-content/themes/default/links.php18
-rw-r--r--wp-inst/wp-content/themes/default/page.php21
-rw-r--r--wp-inst/wp-content/themes/default/search.php46
-rw-r--r--wp-inst/wp-content/themes/default/searchform.php5
-rw-r--r--wp-inst/wp-content/themes/default/sidebar.php72
-rw-r--r--wp-inst/wp-content/themes/default/single.php65
-rw-r--r--wp-inst/wp-content/themes/default/style.css610
126 files changed, 11625 insertions, 0 deletions
diff --git a/wp-inst/wp-content/blogs b/wp-inst/wp-content/blogs
new file mode 100644
index 0000000..5842897
--- /dev/null
+++ b/wp-inst/wp-content/blogs
@@ -0,0 +1,20 @@
+<?php
+require_once( "../wp-config.php" );
+if( is_file( ABSPATH . "wp-content/blogs.dir/" . $blog_id . $_SERVER[ 'REQUEST_URI' ] ) ) {
+ // get mime type
+ $ext = substr( $_SERVER[ 'REQUEST_URI' ], strrpos( $_SERVER[ 'REQUEST_URI' ], '.' ) + 1 );
+ if( $ext == 'jpg' )
+ $ext = 'jpeg';
+ $mimetype = "image/$ext";
+ header("Content-type: $mimetype" );
+ readfile( ABSPATH . "wp-content/blogs.dir/" . $blog_id . $_SERVER[ 'REQUEST_URI' ] );
+} else {
+ // 404
+ header("HTTP/1.1 404 Not Found");
+ print "<html><head><title>Error 404! File Not Found!</title></head>";
+ print "<body>";
+ print "<h1>File Not Found!</h1>";
+ print "No! No! Run Away! This file has escaped and is running wild!";
+ print "</body></html>";
+}
+?>
diff --git a/wp-inst/wp-content/plugins/BAStats/BAStats.php b/wp-inst/wp-content/plugins/BAStats/BAStats.php
new file mode 100644
index 0000000..ebe3f17
--- /dev/null
+++ b/wp-inst/wp-content/plugins/BAStats/BAStats.php
@@ -0,0 +1,566 @@
+<?php
+/*
+Plugin Name: BAStats
+Plugin URI: http://asymptomatic.net/wp-hacks
+Description: This plugin calculates statistics for a WordPress weblog.
+Author: Owen Winkler
+Version: 1.0&beta; build 8
+Author URI: http://asymptomatic.net
+*/
+
+/*
+BAStats - calculates statistics for a WordPress weblog.
+Copyright (c) 2004 Owen Winkler
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated
+documentation files (the "Software"), to deal in the
+Software without restriction, including without limitation
+the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software,
+and to permit persons to whom the Software is furnished to
+do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall
+be included in all copies or substantial portions of the
+Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
+KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
+OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+include_once('BAStats_logger.php');
+
+class BASP
+{
+ var $settings = array();
+ var $table_version = 6;
+ var $added_tables = false;
+ var $colors = array('#FF0000', '#FF1E00', '#FF3C00', '#FF5900', '#FF7700', '#FF9500', '#FFB300', '#FFD000', '#FFEE00', '#F2FF00', '#D5FF00', '#B7FF00', '#99FF00', '#7BFF00', '#5EFF00', '#40FF00', '#22FF00', '#04FF00', '#00FF1A', '#00FF37', '#00FF55', '#00FF73', '#00FF91', '#00FFAE', '#00FFCC', '#00FFEA', '#00F7FF', '#00D9FF', '#00BBFF', '#009DFF', '#0080FF', '#0062FF', '#0044FF', '#0026FF', '#0009FF', '#1500FF', '#3300FF', '#5100FF', '#6F00FF', '#8C00FF', '#AA00FF', '#C800FF', '#E600FF', '#FF00FB', '#FF00DD', '#FF00BF', '#FF00A2', '#FF0084', '#FF0066', '#FF0048', '#FF002B', '#FF000D',);
+
+
+ function BASP()
+ {
+ add_action('admin_menu', array(&$this, 'admin_menu'));
+ add_action('admin_footer', array(&$this, 'admin_footer'));
+ add_action('wp_head', array(&$this, 'wp_head'));
+ add_action('template_redirect', array(&$this, 'template_redirect'));
+
+ $this->settings = get_settings('bastats');
+ $this->wpdb_tables();
+
+ if($this->settings['table_version'] != $this->table_version)
+ {
+ $this->make_tables();
+ $this->added_tables = true;
+ }
+ }
+
+ function admin_footer()
+ {
+ update_option('bastats', $this->settings);
+ }
+
+ function admin_menu()
+ {
+ $pfile = basename(dirname(__FILE__)) . '/' . basename(__FILE__);
+ add_submenu_page('index.php', 'BA Stats', 'Stats', 8, $pfile, array(&$this, 'plugin_content'));
+ add_options_page('BA Stats', 'Stats', 8, $pfile, array(&$this, 'plugin_options'));
+ }
+
+ function plugin_options()
+ {
+ include('BAStats_options.php');
+ }
+
+ function plugin_content()
+ {
+ global $wpdb;
+
+ if($this->added_tables)
+ {
+ echo '<div class="updated"><p>Modified BA Stats Tables.</p></div>';
+ }
+
+ $reports = $this->get_reports();
+ $report_tags = array_keys($reports);
+
+ $rangeset = isset($_GET['rangeset']) ? $_GET['rangeset'] : 'ten_minutes';
+ list($start, $end) = $this->get_range($rangeset);
+ $limit = isset($_GET['limit']) ? $_GET['limit'] : '10';
+ $report = isset($_GET['report']) ? $_GET['report'] : $report_tags[0];
+?>
+<div class="wrap">
+<h2>Site Statistics</h2>
+<?php
+ $totalPages = $wpdb->get_var("SELECT count(page_id) FROM {$wpdb->pages}");
+ $totalSessions = $wpdb->get_var("SELECT count(visit_id) FROM {$wpdb->visitors}");
+ $totalHits = $wpdb->get_var("SELECT count(visit) FROM {$wpdb->log}");
+
+
+ echo "<p><strong>Unique Pages Served:</strong> {$totalPages}";
+ echo "<strong style=\"margin-left:50px;\">Total Sessions:</strong> {$totalSessions}";
+ echo "<strong style=\"margin-left:50px;\">Total Page Hits:</strong> {$totalHits}</p>";
+
+
+ echo '<form method="get">
+ <input type="hidden" name="page" value="' . $_GET['page'] .'"/>';
+
+ if(isset($_GET['filter']) > 0)
+ {
+ list($filt_type,$filt_crit) = explode('=', $_GET['filter'], 2);
+ $filter = stripslashes($_GET['filter']);
+ switch($filt_type)
+ {
+ case 'host':
+ $filt_crit_output = BAStats::inttoip($filt_crit);
+ $filt_label = "Host is " . $filt_crit_output;
+ break;
+ case 'search':
+ $filt_crit_output = $wpdb->get_var("SELECT search_engine FROM {$wpdb->searches} WHERE search_refer = {$filt_crit};");
+ $filt_label = "Search Engine is " . $filt_crit_output;
+ break;
+ case 'referer':
+ $filt_crit_output = $wpdb->get_var("SELECT referer_string FROM {$wpdb->refer} WHERE referer_id= {$filt_crit};");
+ $filt_label = "Referer is " . $filt_crit_output;
+ break;
+ }
+ echo '<fieldset id="stat_filter" style="clear:both;">
+ <legend>Filter:</legend>';
+ echo "<label style=\"display:block;\"><input type=\"checkbox\" name=\"filter\" value=\"{$filter}\" checked=\"checked\"/> {$filt_label}</label>\n";
+ if(!is_array($reports[$report]['filters']) || !in_array($filt_type, $reports[$report]['filters']))
+ {
+ echo "<div style=\"text-indent:3em;\"><em>Filter does not apply to this report</em></div>";
+ }
+ echo '</fieldset>';
+ }
+
+ foreach($reports as $kreport => $vreport)
+ {
+ if($filt_type != '')
+ {
+ if(isset($vreport['filters']) && in_array($filt_type, $vreport['filters']))
+ {
+ $methods[$kreport] = array(sprintf($vreport['title'], $filt_crit_output), 10, 'background-color:#CCCCCC;');
+ }
+ elseif(!isset($vreport['filters']))
+ {
+ $methods[$kreport] = $vreport['title'];
+ }
+ }
+ else
+ {
+ if(!isset($vreport['filters']))
+ {
+ $methods[$kreport] = $vreport['title'];
+ }
+ }
+ }
+ if(!in_array($report, array_keys($methods)))
+ {
+ $report = $report_tags[0];
+ }
+ echo '<fieldset id="stat_method" style="float: left; margin-right: 1em;"><legend>Report:</legend>'
+ . $this->build_select('report', $methods, $report)
+ . '</fieldset>';
+
+ $limits = array(
+ '10' => '10',
+ '20' => '20',
+ '50' => '50',
+ '-1' => 'Everything',
+ );
+ echo '<fieldset id="stat_limit" style="float: left; margin-right: 1em;"><legend>Count:</legend>'
+ . $this->build_select('limit', $limits, $limit)
+ . '</fieldset>';
+
+ $dateranges = array(
+ 'ten_minutes' => '10 Minutes',
+ 'last_hour' => 'Last Hour',
+ 'last_6hours' => 'Last 6 Hours',
+ 'twenty_four' => 'Last 24 Hours',
+ 'today' => 'Since Midnight Today',
+ 'yesterday' => 'Yesterday',
+ 'last_week' => 'Last 7 Days',
+ );
+ if($timestamps = $wpdb->get_col("select distinct date_format(stamp, '%Y-%m') from {$wpdb->log};"))
+ {
+ foreach($timestamps as $item)
+ {
+ $dateranges[$item] = date('F Y', strtotime($item . '-01'));
+ }
+ }
+ $dateranges[''] = 'Everything';
+ echo '<fieldset id="stat_daterange" style="float: left; margin-right: 1em;"><legend>Date Range:</legend>'
+ . $this->build_select('rangeset', $dateranges, $rangeset)
+ . '</fieldset>';
+
+ echo '<p class="submit" style="clear:both;"><input type="submit" value="Show" /></p>
+ </form>
+ </div>';
+
+ switch($reports[$report]['report_type'])
+ {
+ case 'graph':
+ echo '<div class="wrap"><h2>Result Graph</h2><div style="text-align:center;"><img src="' . get_bloginfo('siteurl') . '/wp-content/plugins/BAStats/BAStats_graph.php?graph=' . $report . '&amp;rangeset=' . $rangeset . '&amp;limit=' . $limit . '" /></div>';
+
+ $query = $reports[$report]['series'];
+ $qry = preg_replace('/{([^}]+)}/e', '\$\1', $query);
+ $data = $wpdb->get_results($qry);
+
+ $label_filter = create_function('$row', $reports[$report]['label_filter']);
+
+ echo "<ul>";
+ $count = 0;
+ foreach($data as $row)
+ {
+ echo "<li style=\"list-style:none;\"><span style=\"color:" . $this->get_color($count, count($data)) . ";font-size:x-large;\">&bull;</span> {$count}: " . $label_filter($row) . "</li>";
+ //echo "<li>" . print_r($row, 1)."<br/>{$reports[$report]['label_filter']}</li>";
+ $count ++;
+ }
+ echo "</ul>";
+ echo '</div>';
+ break;
+ }
+
+ $stamp = '';
+ $lasthere = '';
+ if($start != false)
+ {
+ $stamp .= " AND stamp >= '" . date('Y-m-d H:i:s', $start) . "'";
+ $lasthere .= " AND lasthere >= '" . date('Y-m-d H:i:s', $start) . "'";
+ }
+ if($end != false)
+ {
+ $stamp .= " AND stamp <= '" . date('Y-m-d H:i:s', $end) . "'";
+ $lasthere .= " AND lasthere <= '" . date('Y-m-d H:i:s', $end) . "'";
+ }
+ $qrylimit = '';
+ if($limit != -1)
+ {
+ $qrylimit = " LIMIT {$limit}";
+ }
+
+ foreach($reports[$report]['queries'] as $query)
+ {
+ if(($query != $reports[$report]['queries'][0]) && is_array($data))
+ {
+ extract($data[0]);
+ }
+ $qry = preg_replace('/{([^}]+)}/e', '\$\1', $query);
+ //$qry = sprintf($reports[$report]['query'], $where);
+
+ $data = $wpdb->get_results($qry, ARRAY_A);
+ }
+
+ echo '<div class="wrap"><h2>Query Results</h2>';
+
+ echo '<table id="stats_output" width="100%" cellpadding="3" cellspacing="3">
+ <thead>
+ <tr>
+ ';
+ foreach($reports[$report]['columns'] as $caption => $field)
+ {
+ echo "<th scope=\"col\">{$caption}</th>\n";
+ if(isset($reports[$report]['column_filter'][$caption]))
+ {
+ //echo "<strong>Filter Function:</strong>{$reports[$report]['column_filter'][$caption]}";
+ $column_filter[$caption] = create_function('$row', $reports[$report]['column_filter'][$caption]);
+ }
+ }
+ echo '</tr>
+ </thead>
+ <tbody>
+ ';
+
+
+ if(is_array($data) && count($data) > 0)
+ {
+ foreach($data as $item)
+ {
+ $alternate = ($alternate == '')? ' class="alternate"' : '';
+ echo "<tr{$alternate}>\n";
+ foreach($reports[$report]['columns'] as $caption => $field)
+ {
+ $output = $item[$field];
+ if(isset($column_filter[$caption]))
+ {
+ $output = $column_filter[$caption]($item);
+ }
+ echo "<td>{$output}</td>\n";
+ }
+ echo "</tr>\n";
+ }
+ }
+ else
+ {
+ echo "<tr class=\"alternate\"><td colspan=\"3\">No results</td></tr>";
+ }
+ echo '</tbody>
+ </table>';
+ echo "<div style=\"background-color:#EEE;margin:15px;font-size:xx-small;\">
+ You have downloaded BETA software. Provide this information to the developer only upon request:<br />
+ {$qry}</div><!--div><pre>". /*print_r(array_keys($data[0]), 1) .*/ "</pre></div-->";
+?>
+</div>
+<?php
+ }
+
+ function wpdb_tables() {
+ global $wpdb, $table_prefix;
+
+ $wpdb->visitors = "{$table_prefix}bas_visitors";
+ $wpdb->refer = "{$table_prefix}bas_refer";
+ $wpdb->os = "{$table_prefix}bas_os";
+ $wpdb->ua = "{$table_prefix}bas_ua";
+ $wpdb->log = "{$table_prefix}bas_log";
+ $wpdb->pages = "{$table_prefix}bas_pages";
+ $wpdb->searches = "{$table_prefix}bas_searches";
+ }
+
+ function make_tables() {
+ global $wpdb, $table_prefix;
+ if(!include_once(ABSPATH . 'wp-admin/upgrade-functions.php')) {
+ die(_e('There is was error adding the required tables to the database. Please refer to the documentation regarding this issue.', 'BAStats'));
+ }
+ $qry = "CREATE TABLE {$table_prefix}bas_visitors (
+ visit_id BIGINT(11) NOT NULL AUTO_INCREMENT,
+ visit_ip BIGINT(11) UNSIGNED,
+ referer INT(4),
+ osystem INT(4),
+ useragent INT(4),
+ lasthere DATETIME,
+ PRIMARY KEY (visit_id),
+ KEY refer (referer),
+ KEY os (osystem),
+ KEY ua (useragent)
+ );
+ CREATE TABLE {$table_prefix}bas_refer (
+ referer_id INT(4) NOT NULL AUTO_INCREMENT,
+ referer_string tinytext,
+ PRIMARY KEY (referer_id)
+ );
+ CREATE TABLE {$table_prefix}bas_os (
+ os_id INT(4) NOT NULL AUTO_INCREMENT,
+ os_string varchar(255),
+ PRIMARY KEY (os_id)
+ );
+ CREATE TABLE {$table_prefix}bas_ua (
+ ua_id INT(4) NOT NULL AUTO_INCREMENT,
+ ua_string varchar(255),
+ PRIMARY KEY (ua_id)
+ );
+ CREATE TABLE {$table_prefix}bas_log (
+ visit BIGINT(11) NOT NULL,
+ stamp DATETIME,
+ outbound TINYINT,
+ page BIGINT(11),
+ KEY visit (visit),
+ KEY page (page),
+ KEY stamp (stamp)
+ );
+ CREATE TABLE {$table_prefix}bas_pages (
+ page_id BIGINT(11) NOT NULL AUTO_INCREMENT,
+ page_string varchar(255),
+ permalink varchar(255),
+ page_label varchar(255),
+ PRIMARY KEY (page_id)
+ );
+ CREATE TABLE {$table_prefix}bas_searches (
+ search_refer BIGINT(11),
+ search_phrase varchar(255),
+ search_engine varchar(255),
+ KEY search_refer (search_refer)
+ );
+ ";
+ dbDelta($qry);
+
+ $this->settings['table_version'] = $this->table_version;
+ update_option('bastats', $this->settings);
+ }
+
+ function get_range($rangeset)
+ {
+ if(preg_match('/([0-9]{4})-([0-9]{2})(-([0-9]{2}))?(->([0-9]{4})-([0-9]{2})(-([0-9]{2}))?)?/', $rangeset, $dateset))
+ {
+ if($dateset[5] == '')
+ {
+ if($dateset[4] == '')
+ {
+ $start = mktime(0, 0, 0, $dateset[2], 1, $dateset[1]);
+ $end = mktime(23, 59, 59, $dateset[2], date('t', $start), $dateset[1]);
+ }
+ else
+ {
+ $start = mktime(0, 0, 0, $dateset[2], $dateset[4], $dateset[1]);
+ $end = mktime(23, 59, 59, $dateset[2], $dateset[4], $dateset[1]);
+ }
+ }
+ else
+ {
+ if($dateset[4] == '')
+ {
+ $start = mktime(0, 0, 0, $dateset[2], 1, $dateset[1]);
+ }
+ else
+ {
+ $start = mktime(0, 0, 0, $dateset[2], $dateset[4], $dateset[1]);
+ }
+ if($dateset[9] == '')
+ {
+ $end = mktime(23, 59, 59, $dateset[7], date('t', mktime(23, 59, 59, $dateset[7], 1, $dateset[6])), $dateset[6]);
+ }
+ else
+ {
+ $end = mktime(23, 59, 59, $dateset[7], $dateset[9], $dateset[6]);
+ }
+ }
+ }
+ else if(preg_match('/(today|last_week|yesterday|last_hour|last_6hours|ten_minutes|twenty_four)/', $rangeset, $dateset))
+ {
+ $dateinfo = getdate();
+ extract($dateinfo);
+ switch($dateset[1])
+ {
+ case 'today':
+ $start = mktime(0, 0, 0, $mon, $mday, $year);
+ $end = mktime(23, 59, 59, $mon, $mday, $year);
+ break;
+ case 'last_week':
+ $start = mktime(0, 0, 0, $mon, $mday - 7, $year);
+ $end = mktime(23, 59, 59, $mon, $mday, $year);
+ break;
+ case 'yesterday':
+ $start = mktime(0, 0, 0, $mon, $mday - 1, $year);
+ $end = mktime(23, 59, 59, $mon, $mday - 1, $year);
+ break;
+ case 'last_hour':
+ $start = mktime($hours - 1, $minutes, $seconds, $mon, $mday, $year);
+ $end = mktime($hours, $minutes, $seconds, $mon, $mday, $year);
+ break;
+ case 'last_6hours':
+ $start = mktime($hours - 6, $minutes, $seconds, $mon, $mday, $year);
+ $end = mktime($hours, $minutes, $seconds, $mon, $mday, $year);
+ break;
+ case 'ten_minutes':
+ $start = mktime($hours, $minutes - 10, $seconds, $mon, $mday, $year);
+ $end = mktime($hours, $minutes, $seconds, $mon, $mday, $year);
+ break;
+ case 'twenty_four':
+ $start = mktime($hours - 24, $minutes, $seconds, $mon, $mday, $year);
+ $end = mktime($hours, $minutes, $seconds, $mon, $mday, $year);
+ break;
+ }
+ }
+ else
+ {
+ $start = false;
+ $end = false;
+ }
+
+ return array($start, $end);
+ }
+
+ function build_select($name, $valuedisplay, $check)
+ {
+ $ret = "<select id=\"{$name}\" name=\"{$name}\">\n";
+ $options = array();
+ foreach($valuedisplay as $value => $display)
+ {
+ $selected = ($value == $check) ? ' selected="selected"' : '';
+ if(is_array($display))
+ {
+ $style = ($display[2] != '') ? " style=\"$display[2]\" " : '';
+ $options[$display[1]][] = "<option value=\"{$value}\"{$style}{$selected}>{$display[0]}</option>";
+ }
+ else
+ {
+ $options[100][] = "<option value=\"{$value}\"{$selected}>{$display}</option>";
+ }
+ }
+ ksort($options, SORT_NUMERIC);
+ foreach($options as $option)
+ {
+ $ret .= implode("\n", $option);
+ }
+ $ret .= "</select>\n";
+ return $ret;
+ }
+
+ function refer_replace($url)
+ {
+ $engs = BAStats::search_engines();
+ foreach($engs as $keng => $eng)
+ {
+ $repl[$keng] = "<strong class=\"BAStats_seng\">{$eng[0]}:</strong> \\" . $eng[1];
+ }
+ $url = preg_replace(array_keys($repl), array_values($repl), $url);
+ $url = preg_replace('/^http:\/\//', '', $url);
+ $url = urldecode($url);
+ if($url == '') $url = '[No Referrer]';
+ return $url;
+ }
+
+ function wp_head()
+ {
+ $title = trim(wp_title(' ', false));
+ BAStats::label($title);
+ return true;
+ }
+
+ function get_reports()
+ {
+ global $wpdb;
+ include_once('BAStats_reports.php');
+ return $reports;
+ }
+
+ function get_color($index, $total)
+ {
+ $out = count($this->colors) / $total * $index;
+ return $this->colors[$out];
+ }
+
+ function template_redirect()
+ {
+ $bas_options = get_settings('bas_options');
+ if(!is_array($bas_options)) $bas_options = array();
+ /* Actually DO statistics logging */
+ $do_logging = true;
+ if(!in_array('log_admins', $bas_options))
+ {
+ global $user_level;
+ get_currentuserinfo();
+ if (isset($user_level) && ($user_level >= 8)) $do_logging = false;
+ }
+ if(!in_array('log_console', $bas_options))
+ {
+ if(strstr($_SERVER['REQUEST_URI'], '/wp-admin')) $do_logging = false;
+ }
+ if(!in_array('log_content', $bas_options))
+ {
+ if(strstr($_SERVER['REQUEST_URI'], '/wp-content')) $do_logging = false;
+ }
+ if(!in_array('log_self', $bas_options))
+ {
+ $serveraddr = $_SERVER['LOCAL_ADDR'];
+ if($serveraddr == '') $serveraddr = $_SERVER['SERVER_ADDR'];
+ if($_SERVER['REMOTE_ADDR'] == $serveraddr) $do_logging = false;
+ }
+ if($do_logging)
+ {
+ BAStats::log($title);
+ }
+ //echo "<!-- BAStats Logged -->";
+ }
+}
+
+$basp = new BASP();
+
+?>
diff --git a/wp-inst/wp-content/plugins/BAStats/BAStats_graph.php b/wp-inst/wp-content/plugins/BAStats/BAStats_graph.php
new file mode 100644
index 0000000..a673730
--- /dev/null
+++ b/wp-inst/wp-content/plugins/BAStats/BAStats_graph.php
@@ -0,0 +1,375 @@
+<?php
+/*
+Version: 1.0&beta; build 8
+
+BAStats - calculates statistics for a WordPress weblog.
+Copyright (c) 2004 Owen Winkler
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated
+documentation files (the "Software"), to deal in the
+Software without restriction, including without limitation
+the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software,
+and to permit persons to whom the Software is furnished to
+do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall
+be included in all copies or substantial portions of the
+Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
+KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
+OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+class BAS_graph
+{
+ var $width = 600;
+ var $height = 400;
+ var $colors = array();
+ var $caption = "";
+
+ var $series = array();
+ var $xlabels = array();
+
+ var $image;
+ var $graphtype = 'bar';
+
+ function BAS_graph()
+ {
+ $this->image = ImageCreate($this->width, $this->height);
+ $this->InitColors();
+ }
+
+ function InitColors()
+ {
+ $this->SetColor('y_grade', '#EEEEEE');
+ $this->SetColor('x_grade', '#FFFFFF');
+ $this->SetColor('background', '#FFFFFF');
+ $this->SetColor('frame', '#EEEEEE');
+ $this->SetColor('values', '#999999');
+ $this->SetColor('black', '#000000');
+ $this->SetColor('white', '#FFFFFF');
+ $this->SetColor('light_gray', '#CCCCCC');
+ }
+
+ function SetColor($name, $hcolor)
+ {
+ if(isset($this->colors[$name]))
+ {
+ ImageColorDeallocate($this->image, $this->colors[$name]);
+ }
+ $this->colors[$name] = $this->hexcolor($hcolor);
+ }
+
+ function hexcolor($h)
+ {
+ if($h{0} == '#') $h = substr($h, 1);
+ sscanf($h, "%2x%2x%2x", $red, $green, $blue);
+ return ImageColorAllocate($this->image, $red, $green, $blue);
+ }
+
+ function AddSeries($name, $s)
+ {
+ $this->series[$name] = $s;
+ }
+
+ function DrawRect($rectary, $color)
+ {
+ ImageRectangle($this->image, $rectary[0], $rectary[1], $rectary[2], $rectary[3], $color);
+ }
+
+ function Build()
+ {
+ ImageFill($this->image, 0, 0, $this->colors['background']);
+ ImageRectangle($this->image, 0, 0, $this->width - 1, $this->height - 1, $this->colors['frame']);
+
+ $fwidth = ImageFontWidth(1);
+ $fheight = ImageFontHeight(1);
+
+ $graph_max = 0;
+ $graph_min = 9999;
+ foreach($this->series as $seriesname => $series)
+ {
+ foreach($this->xlabels as $label)
+ {
+ if(!isset($series[$label]))
+ {
+ $this->series[$seriesname][$label] = 0;
+ }
+ }
+ }
+ foreach($this->series as $s)
+ {
+ $av = array_values($s);
+ $series_max = count($s) > 1 ? max($s) : $av[0];
+ $graph_max = max($series_max, $graph_max);
+ $series_min = count($s) > 1 ? min($s) : $av[0];
+ $graph_min = min($series_min, $graph_min);
+ }
+ //owd($this->series);
+ if($graph_max == $graph_min)
+ {
+ $graph_max += 10;
+ $graph_min = 0;
+ }
+ $graph_min = 0;
+
+ ImageString($this->image, 1, 60, 2, $graph_min . ' - ' . $graph_max, $this->colors['black']);
+ $cw_graph_max = floor(log10(abs($graph_max)) + 1) * $fwidth;
+
+ $graph_rect = array($cw_graph_max + 2 * $fwidth, $fheight * 2, $this->width - $cw_graph_max, $this->height - $fwidth * 17);
+ $this->DrawRect($graph_rect, $this->colors['frame']);
+ $graph_height = $graph_rect[3] - $graph_rect[1];
+ $graph_width = $graph_rect[2] - $graph_rect[0];
+ for($z=0;$z<=4;$z++)
+ {
+ $y = $graph_rect[1] + ($z * $graph_height / 4);
+ ImageLine($this->image, $graph_rect[0], $y, $graph_rect[2], $y, $this->colors['frame']);
+ ImageString($this->image, 1, 4, $y - $fheight / 2, round(($graph_height - ($y - $graph_rect[1])) / $graph_height * ($graph_max - $graph_min) + $graph_min), $this->colors['black']);
+ }
+
+ $x_spot = 0;
+ $graph_inc = $graph_width / (count($series));
+ $bar_width = ($graph_inc - 1) / count($this->series);
+ foreach($this->xlabels as $label)
+ {
+ //$x_spot = 0;
+ $series_index = 0;
+ foreach($this->series as $seriesname => $series)
+ {
+ $value = isset($series[$label])? $series[$label] : 0;
+ $x = $x_spot * $graph_inc + $graph_rect[0];
+ $y = $graph_rect[1] + $graph_height - ($value - $graph_min) * (($graph_height) / ($graph_max - $graph_min));
+
+ switch($this->graphtype)
+ {
+ case 'bar':
+ ImageFilledRectangle($this->image, $x + $series_index * $bar_width, $y, $x + ($series_index + 1) * $bar_width - 1, $graph_rect[3], $this->colors[$seriesname]);
+ $labely = min($y + ($fheight * 1), $graph_rect[3] - ($fheight * 1.5));
+ ImageString($this->image, 1, $x + $series_index * $bar_width + $fwidth + 1, $labely + 1, $value, $this->colors['black']);
+ ImageString($this->image, 1, $x + $series_index * $bar_width + $fwidth, $labely, $value, $this->colors['light_gray']);
+ break;
+ case 'line';
+ ImageFilledRectangle($this->image, $x-2, $y-2, $x+2, $y+2, $this->colors[$seriesname]);
+ ImageString($this->image, 1, $x - ($fwidth * log10($value) / 2), $y - ($fheight * 1.2), $value, $this->colors['values']);
+ if($lx[$seriesname] != 0)
+ {
+ ImageLine($this->image, $lx[$seriesname], $ly[$seriesname], $x, $y, $this->colors[$seriesname]);
+ }
+ else
+ {
+ ImageString($this->image, 1, $x + $fwidth, $y - ($fheight * .5), $seriesname, $this->colors[$seriesname]);
+ //ImageString($this->image, 1, $x + $series_index * $bar_width, $graph_rect[3] - ($fheight * 2), $seriesname, $this->colors[$seriesname]);
+ }
+ $lx[$seriesname] = $x;
+ $ly[$seriesname] = $y;
+ break;
+ }
+
+ $series_index ++;
+ }
+
+ $x = $x_spot * $graph_inc + $graph_rect[0] - ($fheight / 2);
+ $y = min($graph_rect[3] + $fwidth * strlen($label), $this->height);
+ ImageStringUp($this->image, 1, $x, $y + $fwidth /2, $label, $this->colors['black']);
+ $x_spot ++;
+ }
+ }
+
+ function Output()
+ {
+ $this->Build();
+ if(function_exists('ImageGif'))
+ {
+ Header("Content-type: image/gif");
+ ImageGif($this->image);
+ }
+ else
+ {
+ Header("Content-type: image/jpeg");
+ ImageJpeg($this->image);
+ }
+ }
+}
+
+?>
+<?php
+
+class BAS_grapher extends BAS_graph
+{
+
+
+ function BAS_grapher($graph)
+ {
+ BAS_graph::BAS_graph();
+
+ global $user_level;
+ get_currentuserinfo();
+
+ // Authorize the user to operate this page solo
+ if($user_level == 0)
+ {
+ die("Unauthorized.");
+ }
+
+ $this->do_graph($graph);
+ }
+
+ function do_graph($graph)
+ {
+ global $basp, $wpdb;
+
+ $reports = $basp->get_reports();
+
+ $report = $reports[$graph];
+
+ $rangeset = isset($_GET['rangeset']) ? $_GET['rangeset'] : 'ten_minutes';
+ list($start, $end) = $basp->get_range($rangeset);
+ $stamp = '';
+ $lasthere = '';
+ $_starttext = '';
+ $_endtext = '';
+ $limit = isset($_GET['limit']) ? $_GET['limit'] : '10';
+ if($start != false)
+ {
+ $_starttext = "'" . date('Y-m-d H:i:s', $start) . "'";
+ $stamp .= " AND stamp >= '" . date('Y-m-d H:i:s', $start) . "'";
+ $lasthere .= " AND lasthere >= '" . date('Y-m-d H:i:s', $start) . "'";
+ }
+ if($end != false)
+ {
+ $_endtext = "'" . date('Y-m-d H:i:s', $end) . "'";
+ $stamp .= " AND stamp <= '" . date('Y-m-d H:i:s', $end) . "'";
+ $lasthere .= " AND lasthere <= '" . date('Y-m-d H:i:s', $end) . "'";
+ }
+ $_stamp = $stamp;
+ $_lasthere = $lasthere;
+ //Range increments
+ $timespan = $end - $start;
+
+ if($timespan > 60*60*24*365*2) { //1 year
+ $_grouping = "DATE_FORMAT(stamp, '%Y')";
+ $_ordering = "DATE_FORMAT(stamp, '%Y')";
+ $_datechunk = "'%Y'";
+ }
+ elseif($timespan > 60*60*24*31) { //1 month
+ $_grouping = "DATE_FORMAT(stamp, '%Y-%m')";
+ $_ordering = "DATE_FORMAT(stamp, '%Y-%m')";
+ $_datechunk = "'%Y-%m'";
+ }
+ elseif($timespan > 60*60*24) { //1 day
+ $_grouping = "DATE_FORMAT(stamp, '%Y-%m-%d')";
+ $_ordering = "DATE_FORMAT(stamp, '%Y-%m-%d')";
+ $_datechunk = "'%Y-%m-%d'";
+ }
+ elseif($timespan > 60*60) { //1 hour
+ $_grouping = "DATE_FORMAT(stamp, '%Y-%m-%d %H')";
+ $_ordering = "DATE_FORMAT(stamp, '%Y-%m-%d %H')";
+ $_datechunk = "'%Y-%m-%d %H'";
+ }
+ elseif($timespan > 60) { //1 minute
+ $_grouping = "DATE_FORMAT(stamp, '%Y-%m-%d %H:%i')";
+ $_ordering = "DATE_FORMAT(stamp, '%Y-%m-%d %H:%i')";
+ $_datechunk = "'%Y-%m-%d %H:%i'";
+ }
+ else {
+ $_grouping = "DATE_FORMAT(stamp, '%Y-%m-%d')";
+ $_ordering = "DATE_FORMAT(stamp, '%Y-%m-%d')";
+ $_datechunk = "'%Y-%m-%d'";
+ }
+
+
+ $query = $report['series'];
+ $qry = preg_replace('/{([^}]+)}/e', '\$\1', $query);
+ $data = $wpdb->get_results($qry);
+
+ $series_filter = create_function('$row', $report['label_filter']);
+
+
+
+ $newcolor = 0;
+ if($data)
+ {
+ foreach($data as $s_data)
+ {
+ $series_index = $s_data->$report['series_index'];
+ $series_caption = $series_index . ':' . $series_filter($s_data->$report['series_label']);
+ $qresult = '';
+
+ foreach($report['data'] as $query)
+ {
+ if(($query != $report['data'][0]) && is_array($qresult))
+ {
+ extract($qresult[0]);
+ }
+ //$qry = preg_replace_callback('/{([^}]+)}/e', 'graph_query', $query);
+ $qry = preg_replace('/{([^}]+)}/e', 'substr(\'\1\', 0, 1)!=\'_\'?addslashes(\$\1):\$\1', $query);
+ //$qry = preg_replace('/{([^}]+)}/e', '\$\1', $query);
+ $qresult = $wpdb->get_results($qry);
+ }
+ if($qresult)
+ {
+ foreach($qresult as $res)
+ {
+ $this->xlabels[$res->Label] = $res->Label;
+ $series[$res->Label] = $res->Count;
+ }
+ }
+ else
+ {
+ die('No Results: ' . $qry);
+ }
+
+ $this->AddSeries($series_caption, $series);
+ $this->SetColor($series_caption, $basp->get_color($newcolor, count($data)));
+ $newcolor++;
+ }
+ }
+
+ /*
+ // TEST DATA //
+ $this->xlabels = array('2005-02-16'=>'2005-02-16', '2005-02-17'=>'2005-02-17', '2005-02-18'=>'2005-02-18');
+ $this->AddSeries('test', array('2005-02-16'=>10, '2005-02-17'=>35, '2005-02-18'=>13));
+ $this->SetColor('test', $colors[0]);
+ */
+
+ //$g->graphtype = 'line';
+ $this->Build();
+ //owd($g->series);
+ $this->output();
+ }
+}
+
+
+function include_up($filename)
+{
+ $c=0;
+ while(!is_file($filename))
+ {
+ $filename = '../' . $filename;
+ $c++;
+ if($c==30) {
+ echo 'Could not find ' . basename($filename) . '.';
+ return '';
+ }
+ }
+ return $filename;
+}
+
+function owd($v)
+{
+ echo "<pre>".print_r($v,1)."</pre>";
+}
+
+require_once(include_up('wp-config.php'));
+require_once("BAStats.php");
+
+$g = new BAS_grapher($_GET['graph']);
+?> \ No newline at end of file
diff --git a/wp-inst/wp-content/plugins/BAStats/BAStats_logger.php b/wp-inst/wp-content/plugins/BAStats/BAStats_logger.php
new file mode 100644
index 0000000..8db8ae6
--- /dev/null
+++ b/wp-inst/wp-content/plugins/BAStats/BAStats_logger.php
@@ -0,0 +1,310 @@
+<?php
+
+/*
+Version: 1.0&beta; build 8
+
+BAStats - Calculates statistics for a WordPress weblog.
+Copyright (c) 2004 Owen Winkler
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated
+documentation files (the "Software"), to deal in the
+Software without restriction, including without limitation
+the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software,
+and to permit persons to whom the Software is furnished to
+do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall
+be included in all copies or substantial portions of the
+Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
+KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
+OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+class BAStats
+{
+
+ function BAStats_logger()
+ {
+ global $wpdb;
+
+
+ }
+
+ function log($label = '')
+ {
+ global $wpdb, $table_prefix;
+
+ $create_session = false;
+
+ //Find user session
+ if(isset($_COOKIE['basp']))
+ {
+ $sid = $_COOKIE['basp'];
+ $sdata = $wpdb->get_row("SELECT * FROM {$wpdb->visitors}, {$wpdb->refer}, {$wpdb->ua}, {$wpdb->os} WHERE visit_id = {$sid} AND referer = referer_id AND osystem = os_id AND useragent = ua_id");
+ if(!$sdata) $create_session = true;
+ }
+ elseif($sdata = $wpdb->get_row("SELECT * FROM {$wpdb->visitors}, {$wpdb->refer}, {$wpdb->ua}, {$wpdb->os} WHERE referer = referer_id AND osystem = os_id AND useragent = ua_id AND lasthere > DATE_SUB(NOW(), INTERVAL 20 MINUTE) AND visit_ip = " . ip2long($_SERVER['REMOTE_ADDR']) . " AND ua_string = '" . addslashes($_SERVER['HTTP_USER_AGENT']) . "' ORDER BY lasthere DESC LIMIT 1"))
+ {
+ $sid = $sdata->visit_id;
+ }
+ elseif(strpos($_SERVER['HTTP_REFERER'], get_settings('site_url')) && ($sdata = $wpdb->get_row("SELECT * FROM {$wpdb->visitors}, {$wpdb->refer}, {$wpdb->ua}, {$wpdb->os} WHERE referer = referer_id AND osystem = os_id AND useragent = ua_id AND visit_ip = " . ip2long($_SERVER['REMOTE_ADDR']) . " AND ua_string = '" . addslashes($_SERVER['HTTP_USER_AGENT']) . "' ORDER BY lasthere DESC LIMIT 1")))
+ {
+ $sid = $sdata->visit_id;
+ }
+ else
+ {
+ $create_session = true;
+ }
+ if($create_session)
+ {
+ //Create new session
+ $refer_id = $wpdb->get_var("SELECT referer_id FROM {$wpdb->refer} WHERE referer_string = '" . addslashes($_SERVER['HTTP_REFERER']) . "';");
+ if($refer_id == '')
+ {
+ $wpdb->query("INSERT INTO {$wpdb->refer} (referer_string) VALUES ('" . addslashes($_SERVER['HTTP_REFERER']) . "');");
+ $refer_id =$wpdb->insert_id;
+ }
+ $os_id = $wpdb->get_var("SELECT os_id FROM {$wpdb->os} WHERE os_string = '" . addslashes(BAStats::OSMap($_SERVER['HTTP_USER_AGENT'])) . "';");
+ if($os_id == '')
+ {
+ $wpdb->query("INSERT INTO {$wpdb->os} (os_string) VALUES ('" . addslashes(BAStats::OSMap($_SERVER['HTTP_USER_AGENT'])) . "');");
+ $os_id = $wpdb->insert_id;
+ }
+ $ua_id = $wpdb->get_var("SELECT ua_id FROM {$wpdb->ua} WHERE ua_string = '" . addslashes($_SERVER['HTTP_USER_AGENT']) . "';");
+ if($ua_id == '')
+ {
+ $wpdb->query("INSERT INTO {$wpdb->ua} (ua_string) VALUES ('" . addslashes($_SERVER['HTTP_USER_AGENT']) . "');");
+ $ua_id = $wpdb->insert_id;
+ }
+ $qry = "INSERT INTO {$wpdb->visitors} (visit_ip, referer, osystem, useragent, lasthere) VALUES (";
+ $qry .= ip2long($_SERVER['REMOTE_ADDR']);
+ $qry .= ", " . $refer_id;
+ $qry .= ", " . $os_id;
+ $qry .= ", " . $ua_id;
+ $qry .= ", '" . date('Y-m-d H:i:s') . "'";
+ $qry .= ");";
+ $wpdb->query($qry);
+ $sid = $wpdb->insert_id;
+ $sdata = $wpdb->get_row("SELECT * FROM {$wpdb->visitors}, {$wpdb->refer}, {$wpdb->ua}, {$wpdb->os} WHERE visit_id = {$sid} AND referer = referer_id AND osystem = os_id AND useragent = ua_id");
+ }
+ setcookie('basp', $sid, time()+60*20, '/');
+
+ $page_string = '';
+ $permalink = '';
+ BAStats::getPageString($page_string, $permalink);
+
+ $page = $wpdb->get_row("SELECT * FROM {$wpdb->pages} WHERE page_string = '" . addslashes($page_string) . "';");
+ if(!$page)
+ {
+ $wpdb->query("INSERT INTO {$wpdb->pages} (page_string, permalink, page_label) VALUES ('" . addslashes($page_string) . "', '" . addslashes($permalink) . "', '" . addslashes($label) . "');");
+ $page = $wpdb->get_row("SELECT * FROM {$wpdb->pages} WHERE page_string = '" . addslashes($page_string) . "';");
+ }
+
+ $options = get_settings('bas_options');
+ $settings = get_settings('bas_settings');
+ if(in_array('log_spam', $options) && in_array('referer_spam', $settings))
+ {
+ $logok = true;
+ $badlist = explode("\n", $settings['referer_spam']);
+ foreach($badlist as $entry)
+ {
+ if(isset($_SERVER['HTTP_REFERER']) && stristr($_SERVER['HTTP_REFERER'], $entry) !== false)
+ {
+ $logok = false;
+ break;
+ }
+ }
+ }
+ else
+ {
+ $logok = true;
+ }
+
+ if($logok)
+ {
+ BAStats::log_search($_SERVER['HTTP_REFERER'], $sdata->referer);
+
+ if($page->page_id != '')
+ {
+ $wpdb->query("INSERT INTO {$wpdb->log} (visit, stamp, outbound, page) VALUES ({$sid}, '" . date('Y-m-d H:i:s') . "', 0, {$page->page_id});");
+ }
+ }
+ else
+ {
+ if(in_array('die_spam', $options))
+ {
+ die('Sorry. Your referral domain is in a spam wordlist, and may not view this site.');
+ }
+ }
+
+ /*echo "<pre>";
+ print_r($sid);
+ print_r($sdata);
+ print_r($page);
+ echo "<br/>{$wpdb->last_query}";
+ echo "</pre>";*/
+ }
+
+ function getPageString(&$page_string, &$permalink)
+ {
+ if(isset($_SERVER['HTTP_X_REWRITE_URL']))
+ {
+ $page_string = $_SERVER['HTTP_X_REWRITE_URL'];
+ $permalink = $_SERVER['REQUEST_URI'];
+ }
+ elseif(isset($_SERVER['ORIG_PATH_INFO']))
+ {
+ $page_string = $_SERVER['ORIG_PATH_INFO'];
+ $permalink = $_SERVER['ORIG_PATH_INFO'];
+ }
+ else
+ {
+ $page_string = $_SERVER['REQUEST_URI'];
+ $permalink = $_SERVER['REQUEST_URI'];
+ }
+ }
+
+ function label($label = '')
+ {
+ global $wpdb;
+ $page_string = '';
+ $permalink = '';
+ BAStats::getPageString($page_string, $permalink);
+ if($label != '') $wpdb->query("UPDATE {$wpdb->pages} SET page_label = '" . addslashes($label) . "' WHERE page_string = '" . addslashes($page_string) . "';");
+ }
+
+ function iptoint($ip)
+ {
+ return ip2long($ip);
+ }
+
+ function inttoip($int)
+ {
+ return long2ip($int);
+ }
+
+ function OSMap($ua)
+ {
+ $matches = array(
+ 'Win.*NT 5\.0'=>'Windows 2000',
+ 'Win.*NT 5.1'=>'Windows XP',
+ 'Win.*(XP|2000|ME|NT|9.?)'=>'Windows $1',
+ 'Windows .*(3\.11|NT)'=>'Windows $1',
+ 'Win32'=>'Windows [unknown version]',
+ 'Linux 2\.(.?)\.'=>'Linux 2.$1.x',
+ 'Linux'=>'Linux [unknown version]',
+ 'FreeBSD .*-CURRENT$'=>'FreeBSD -CURRENT',
+ 'FreeBSD (.?)\.'=>'FreeBSD $1.x',
+ 'NetBSD 1\.(.?)\.'=>'NetBSD 1.$1.x',
+ '(Free|Net|Open)BSD'=>'$1BSD [unknown version]',
+ 'HP-UX B\.(10|11)\.'=>'HP-UX B.$1.x',
+ 'IRIX(64)? 6\.'=>'IRIX 6.x',
+ 'SunOS 4\.1'=>'SunOS 4.1.x',
+ 'SunOS 5\.([4-6])'=>'Solaris 2.$1.x',
+ 'SunOS 5\.([78])'=>'Solaris $1.x',
+ 'Mac_PowerPC'=>'Mac OS [PowerPC]',
+ 'Mac'=>'Mac OS',
+ 'X11'=>'UNIX [unknown version]',
+ 'Unix'=>'UNIX [unknown version]',
+ 'BeOS'=>'BeOS [unknown version]',
+ 'QNX'=>'QNX [unknown version]',
+ );
+ $uas = array_map(create_function('$a', 'return "#.*$a.*#";'), array_keys($matches));
+ return preg_replace($uas, array_values($matches), $ua);
+ }
+
+ function BrowserMap($ua)
+ {
+ $matches = array(
+ '^Mozilla/\d+\.\d+ \(compatible; iCab ([^;]); ([^;]); [NUI]; ([^;])\)'=>'iCab $1',
+ '^Opera/(\d+\.\d+) \(([^;]+); [^)]+\)'=>'Opera $1',
+ '^Mozilla/\d+\.\d+ \(compatible; MSIE [^;]+; ([^)]+)\) Opera (\d+\.\d+)'=>'Opera $2',
+ '^Mozilla/\d+\.\d+ \(([^;]+); [^)]+\) Opera (\d+\.\d+)'=>'Opera $2',
+ '^Mozilla/[1-9]\.0 ?\(compatible; MSIE ([1-9]\.[0-9b]+);(?: ?[^;]+;)*? (Mac_[^;)]+|Windows [^;)]+)(?:; [^;]+)*\)'=>'MSIE $1',
+ '^Mozilla/\d+\.\d+ \([^;]+; [NIU]; ([^;]+); [^;]+; Galeon\) Gecko/\d{8}$'=>'Galeon',
+ '^Mozilla/\d+\.\d+ \([^;]+; [NIU]; Galeon; [^;]+; ([^;)]+)\)$'=>'Galeon $1',
+ '^Mozilla/\d+\.\d+ Galeon/([0-9.]+) \(([^;)]+)\) Gecko/\d{8}$'=>'Galeon $1',
+ '^Mozilla/\d+\.\d+ \([^;]+; [NIU]; ([^;]+); [^;]+; rv:[^;]+(?:; [^;]+)*\) Gecko/\d{8} ([a-zA-Z ]+/[0-9.b]+)'=>'$2',
+ '^Mozilla/\d+\.\d+ \([^;]+; [NIU]; ([^;]+); [^;]+; rv:([^;]+)(?:; [^;]+)*\) Gecko/\d{8}$'=>'Mozilla $2',
+ '^Mozilla/\d+\.\d+ \([^;]+; [NIU]; ([^;]+); [^;]+; (m\d+)(?:; [^;]+)*\) Gecko/\d{8}$'=>'Mozilla $2',
+ '^Mozilla/\d+\.\d+ \([^;]+; [NIU]; ([^;]+)(?:; [^;]+)*\) Mozilla/(.+)$'=>'Mozilla $2',
+ '^Mozilla/4\.(\d+)[^(]+\(X11; [NIU] ?; ([^;]+)(?:; [^;]+)*\)'=>'Netscape 4.$1',
+ '^Mozilla/4\.(\d+)[^(]+\((OS/2|Linux|Macintosh|Win[^;]*)[;,] [NUI] ?[^)]*\)'=>'Netscape 4.$1',
+ '^Mozilla/3\.(\d+)\S*[^(]+\(X11; [NIU] ?; ([^;]+)(?:; [^;)]+)*\)'=>'Netscape 3.$1',
+ '^Mozilla/3\.(\d+)\S*[^(]+\(([^;]+); [NIU] ?(?:; [^;)]+)*\)'=>'Netscape 3.$1',
+ '^Mozilla/2\.(\d+)\S*[^(]+\(([^;]+); [NIU] ?(?:; [^;)]+)*\)'=>'Netscape 2.$1',
+ '^Mozilla \(X11; [NIU] ?; ([^;)]+)\)'=>'Netscape',
+ '^Mozilla/3.0 \(compatible; StarOffice/(\d+)\.\d+; ([^)]+)\)$'=>'StarOffice $1',
+ '^ELinks \((.+); (.+); .+\)$'=>'ELinks $1',
+ '^Mozilla/3\.0 \(compatible; NetPositive/([0-9.]+); BeOS\)$'=>'NetPositive $1',
+ '^Konqueror/(\S+)$'=>'Konqueror $1',
+ '^Mozilla/5\.0 \(compatible; Konqueror/([^;]); ([^)]+)\).*$'=>'Konqueror $1',
+ '^Lynx/(\S+)'=>'Lynx/$1',
+ '^Mozilla/4.0 WebTV/(\d+\.\d+) \(compatible; MSIE 4.0\)$'=>'WebTV $1',
+ '^Mozilla/4.0 \(compatible; MSIE 5.0; (Win98 A); (ATHMWWW1.1); MSOCD;\)$'=>'$2',
+ '^(RMA/1.0) \(compatible; RealMedia\)$'=>'$1',
+ '^antibot\D+([0-9.]+)/(\S+)'=>'antibot $1',
+ '^Mozilla/[1-9]\.\d+ \(compatible; ([^;]+); ([^)]+)\)$'=>'$1',
+ '^Mozilla/([1-9]\.\d+)'=>'compatible Mozilla/$1',
+ '\bmsnbot/([0-9.]+)'=>'MSN Search Bot $1',
+ '^Mozilla/\d+\.\d+ \(Macintosh; U; PPC Mac OS X; en\) AppleWebKit/\d+\.\d+ \(KHTML, like Gecko\) Safari/(\d+\.\d+)'=>'Safari $1',
+ '^([^;]+)$'=>'$1',
+ );
+ foreach($matches as $srch => $repl)
+ {
+ if(preg_match('#' . $srch . '#i', $ua, $m))
+ {
+ return preg_replace('/\$([0-9])/e', '"$m[\1]"', $repl);
+ }
+ }
+ return 'Unknown';
+ }
+
+ function search_engines()
+ {
+ $ret = array(
+ '/images\\.google(\\.[a-z]{2,3})+.*(\\?|&)prev=\/images%3Fq%3D(.+?)(%26.*|$)/i'=> array('Google Image Search', 3),
+ '/www\\.google(\\.[a-z]{2,3})+.*(\\?|&)q=([^&]+).*/i'=> array('Google Search', 3),
+ '/search\\.msn\\.com.*(\?|&)q=([^&]+).*/i'=>array('MSN Search', 2),
+ '/video\\.search\\.yahoo(\\.[a-z]{2,3})+.*(\\?|&)back=p%3D(.*?)(%26.*|$)/i'=>array('Yahoo Video Search', 3),
+ '/video\.search\.yahoo(\\.[a-z]{2,3}).*(\?|&)va=([^&]+).*/i'=>array('Yahoo Video Search', 3),
+ '/alltheweb\\.com.*(\?|&)q=([^&]+).*/i'=>array('AllTheWeb Search', 2),
+ '/search\.yahoo\.com.*(\?|&)p=([^&]+).*/i'=>array('Yahoo Search', 2),
+ '/web\.ask\.com.*(\?|&)ask=([^&]+).*/i'=>array('Ask Jeeves Search', 2),
+ '/aolsearch\.aol(\\.[a-z]{2,3})+.*(\?|&)query=([^&]+).*/i'=>array('AOL Search', 3),
+ '/www\.dogpile\.com.*\/([^\/]+)/i'=>array('Dogpile', 1),
+ '/www\\.mywebsearch\\.com.*(\\?|&)searchfor=(.+?)(&|$).*/i'=>array('MyWay', 2),
+ '/search\\.wanadoo(\\.[a-z]{2,3})+.*(\\?|&)q=(.+?)(&|$).*/i'=>array('Wanadoo', 3),
+ '/www\\.technorati\\.com\/tag\/(.*)/i'=>array('Technorati Tags', 1),
+ );
+ $ret['/' . get_settings('site_url') . '.*(\?|&)s=([^&]+).*/i'] = array('Local Search', 2);
+ return $ret;
+ }
+
+ function log_search($refer, $rid)
+ {
+ global $wpdb;
+
+ $engs = BAStats::search_engines();
+ foreach($engs as $keng => $eng)
+ {
+ if(preg_match($keng, $refer, $matches))
+ {
+ $wpdb->query("INSERT INTO {$wpdb->searches} (search_refer, search_phrase, search_engine) VALUES ({$rid}, '" . addslashes(urldecode($matches[$eng[1]])) . "', '" . addslashes($eng[0]) . "');");
+ break;
+ }
+ }
+ }
+
+}
+
+?> \ No newline at end of file
diff --git a/wp-inst/wp-content/plugins/BAStats/BAStats_options.php b/wp-inst/wp-content/plugins/BAStats/BAStats_options.php
new file mode 100644
index 0000000..c6c7606
--- /dev/null
+++ b/wp-inst/wp-content/plugins/BAStats/BAStats_options.php
@@ -0,0 +1,171 @@
+<?php
+/*
+Version: 1.0&beta; build 8
+
+BAStats - calculates statistics for a WordPress weblog.
+Copyright (c) 2004 Owen Winkler
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated
+documentation files (the "Software"), to deal in the
+Software without restriction, including without limitation
+the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software,
+and to permit persons to whom the Software is furnished to
+do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall
+be included in all copies or substantial portions of the
+Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
+KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
+OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+
+global $wpdb;
+
+function check_option($opt)
+{
+ $settings = get_settings('bas_options');
+ if(in_array($opt, $settings)) echo ' checked="checked"';
+}
+
+$default_options = array();
+$default_settings = array (
+ 'referer_spam' => "nutzu.com",
+);
+
+switch($_POST['action'])
+{
+case 'label':
+ $wpdb->query("UPDATE {$wpdb->pages} SET page_label = '{$_POST['Label']}' WHERE page_string = '{$_POST['URI']}';");
+ $result = "Added Label '{$_POST['Label']}' to URI '{$_POST['URI']}'";
+ break;
+case 'options':
+ update_option('bas_options', $_POST['bas_options']);
+ update_option('bas_settings', $_POST['bas_settings']);
+ break;
+case 'purge':
+ switch($_POST['range'])
+ {
+ case 'all':
+ $wpdb->query('TRUNCATE {$wpdb->visitors};');
+ $wpdb->query('TRUNCATE {$wpdb->refer};');
+ $wpdb->query('TRUNCATE {$wpdb->os};');
+ $wpdb->query('TRUNCATE {$wpdb->ua};');
+ $wpdb->query('TRUNCATE {$wpdb->log};');
+ $wpdb->query('TRUNCATE {$wpdb->pages};');
+ $wpdb->query('TRUNCATE {$wpdb->searches};');
+ $result = "Purged all stats.";
+ break;
+ case 'hits':
+ $wpdb->query('TRUNCATE {$wpdb->log};');
+ $result = "Purged all hits.";
+ break;
+ case 'oldhits':
+ $monthago = date('Y-m-d', time()-60*60*24*30);
+ $wpdb->query("DELETE FROM {$wpdb->log} WHERE stamp < '{$monthago}';");
+ $result = "Purged all hits older than 30 days.";
+ break;
+ }
+default:
+ add_option('bas_options', $default_options);
+ add_option('bas_settings', $default_settings);
+}
+
+$options = get_settings('bas_options');
+$settings = get_settings('bas_settings');
+
+if($result != '')
+{
+ echo "<div class=\"updated\"><p>{$result}</p></div>";
+}
+?>
+
+<div class="wrap">
+<form method="post">
+<input type="hidden" name="action" value="options" />
+<h2>BA Stats Options</h2>
+<p>Set the options below according to your loggin preferences, then click Update Options to commit your choices.</p>
+
+<h3>Basic Tracking Options</h3>
+
+<ul>
+ <li>
+ <label><input type="checkbox" name="bas_options[]" value="log_admins" <?php check_option('log_admins'); ?>/> Track page hits for logged in WordPress users of level 8+.</label>
+ </li>
+ <li>
+ <label><input type="checkbox" name="bas_options[]" value="log_console" <?php check_option('log_console'); ?>/> Track page hits for the WordPress admin console pages.</label>
+ </li>
+ <li>
+ <label><input type="checkbox" name="bas_options[]" value="log_content" <?php check_option('log_content'); ?>/> Track page hits for <code>/wp-content/</code> area.</label>
+ </li>
+ <li>
+ <?php
+ $serveraddr = $_SERVER['LOCAL_ADDR'];
+ if($serveraddr == '') $serveraddr = $_SERVER['SERVER_ADDR'];
+ ?>
+ <label><input type="checkbox" name="bas_options[]" value="log_self" <?php check_option('log_self'); ?>/> Track page hits from this site's IP address (<?php echo $serveraddr; ?> ).</label>
+ </li>
+</ul>
+
+<!-- hr style="border:0;color:#6699CC;height:1px;background-color:#6699CC;"/>
+<h3>Advanced File Tracking</h3>
+
+<ul>
+ <li>
+ <label><input type="checkbox" name="bas_options[]" value="log_images" <?php check_option('log_images'); ?>/> Track hits on local images (jpg, gif, png).</label>
+ </li>
+</ul -->
+
+
+<hr style="border:0;color:#6699CC;height:1px;background-color:#6699CC;"/>
+<h3>Referer Spam</h3>
+
+<p>Each of the following lines is indicative of referer spam when BAStats finds it anywhere in the referer header field:</p>
+<textarea name="bas_settings[referer_spam]" style="width:50%;height:5em;"><?php echo $settings['referer_spam']; ?></textarea>
+<p>What to do about referer spam:</p>
+<ul>
+ <li><label><input type="checkbox" name="bas_options[]" value="log_spam" <?php check_option('log_spam'); ?>/> Don't log referers that match the spam entries.</label></li>
+ <li><label><input type="checkbox" name="bas_options[]" value="die_spam" <?php check_option('die_spam'); ?>/> Immediately stop further script processing of requests that match the spam list.</label></li>
+</ul>
+<p class="submit"><input type="submit" value="Update Options"></p>
+</form>
+</div>
+
+<div class="wrap">
+<h2>Label Page</h2>
+<p>Submit the values in this form to provide a recognizable label for a page that typically appears only as a URI.</p>
+<p>For example, you might want to label the page <code>/index.php</code> as "<code>Home Page</code>".</p>
+<form method="post">
+<input type="hidden" name="action" value="label" />
+<label for="label_URI">URI to label: <input type="text" id="label_URI" name="URI" /></label>
+<label for="label_text">Label to use: <input type="text" id="label_text" name="Label" /></label>
+<p class="submit"><input type="submit" value="Apply Label"></p>
+</form>
+</div>
+
+<div class="wrap">
+<h2>Clear Stats</h2>
+<p>Submit this form to purge old stats from your stats tables.</p>
+<p>Select the action that best suits your needs from the dropdown, then click Purge.</p>
+<form method="post" onsubmit="return confirm('Are you sure you want to perform this action on your stats? It can't be undone.');>
+<input type="hidden" name="action" value="purge" />
+<label>Action:
+<select name="range">
+<option value="">Choose one</option>
+<option value="all" style="background-color:red;color:white;font-weight:bold;">Purge All Stats</option>
+<option value="hits">Purge Only Hits</option>
+<option value="oldhits">Purge Only Hits Older Than 30 Days</option>
+</select>
+</label>
+<p class="submit"><input type="submit" value="Purge"></p>
+</form>
+</div> \ No newline at end of file
diff --git a/wp-inst/wp-content/plugins/BAStats/BAStats_reports.php b/wp-inst/wp-content/plugins/BAStats/BAStats_reports.php
new file mode 100644
index 0000000..a1e4744
--- /dev/null
+++ b/wp-inst/wp-content/plugins/BAStats/BAStats_reports.php
@@ -0,0 +1,330 @@
+<?php
+/*
+Version: 1.0&beta; build 8
+
+BAStats - calculates statistics for a WordPress weblog.
+Copyright (c) 2004 Owen Winkler
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated
+documentation files (the "Software"), to deal in the
+Software without restriction, including without limitation
+the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software,
+and to permit persons to whom the Software is furnished to
+do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall
+be included in all copies or substantial portions of the
+Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
+KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
+OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+
+$reports = array(
+ // Each element of the $reports array is an array describing a single report.
+ // Each element of the $reports array must have a unique key.
+ 'top_page_hits'=> array (
+ //The 'title' key is the name that appears in the report dropdown
+ 'title'=>'Top Page Hits',
+ //The 'report_type' key can be 'table' or 'graph', depending on what it displays.
+ 'report_type'=>'table',
+ //The 'query' key contains an array of queries to execute in order
+ //to retrieve the report data.
+ //{stamp} is replaced with the date range selected in the UI.
+ //{qrylimit} is replaced with the limit setting from the UI.
+ 'queries'=> array(
+ "SELECT *, count(page_id) AS `Count` FROM {$wpdb->pages}, {$wpdb->log} WHERE page = page_id {stamp} GROUP BY page_id ORDER BY `Count` DESC {qrylimit}",
+ ),
+ //The 'columns' key contains an array of 'Column Caption'=>'field_from_query' values.
+ 'columns'=>array('Page'=>'page_string', 'Count'=>'Count'),
+ //The 'column_filter' key contains an array of filters indexed by column caption.
+ //For the values in that column, instead of the raw data value, the filter is applied
+ //to the value of $row, which contains the row data from the query for that result row.
+ 'column_filter'=>array(
+ 'Page'=>'return ($row["page_label"] == \'\') ? "<a href=\"{$row[\'page_string\']}\">{$row[\'page_string\']}</a>" : "<a href=\"{$row[\'page_string\']}\" style=\"font-weight:bold;\">{$row[\'page_label\']}</a><br><div style=\"font-size:xx-small;text-indent:3em;\">{$row[\'page_string\']}</div>";',
+ )
+ ),
+ 'top_page_hits_referer'=> array (
+ 'title'=>'Top Page Hits From Referrer',
+ 'report_type'=>'table',
+ 'filters'=>array('referer'),
+ 'queries'=> array(
+ "SELECT *, count(page_id) AS `Count` FROM {$wpdb->pages}, {$wpdb->log}, {$wpdb->visitors} WHERE visit = visit_id AND page = page_id AND referer = {filt_crit} {stamp} GROUP BY page_id ORDER BY `Count` DESC {qrylimit}",
+ ),
+ 'columns'=>array('Page'=>'page_string', 'Count'=>'Count'),
+ 'column_filter'=>array(
+ 'Page'=>'return ($row["page_label"] == \'\') ? "<a href=\"{$row[\'page_string\']}\">{$row[\'page_string\']}</a>" : "<a href=\"{$row[\'page_string\']}\" style=\"font-weight:bold;\">{$row[\'page_label\']}</a><br><div style=\"font-size:xx-small;text-indent:3em;\">{$row[\'page_string\']}</div>";',
+ )
+ ),
+ 'top_page_hits_host'=> array (
+ 'title'=>'Top Page Hits From %s',
+ 'report_type'=>'table',
+ 'filters'=>array('host'),
+ 'queries'=>array(
+ "SELECT *, count(page_id) AS `Count` FROM {$wpdb->pages}, {$wpdb->log}, {$wpdb->visitors} WHERE page = page_id AND visit= visit_id AND visit_ip = {filt_crit} {stamp} GROUP BY page_id ORDER BY `Count` DESC {qrylimit}",
+ ),
+ 'columns'=>array('Page'=>'page_string', 'Count'=>'Count'),
+ 'column_filter'=>array(
+ 'Page'=>'return ($row["page_label"] == \'\') ? "<a href=\"{$row[\'page_string\']}\">{$row[\'page_string\']}</a>" : "<a href=\"{$row[\'page_string\']}\" style=\"font-weight:bold;\">{$row[\'page_label\']}</a><br><div style=\"font-size:xx-small;text-indent:3em;\">{$row[\'page_string\']}</div>";',
+ )
+ ),
+ 'top_hosts'=> array (
+ 'title'=>'Top Hosts',
+ 'report_type'=>'table',
+ 'queries'=>array(
+ "SELECT *, count(visit_id) AS `Count` FROM {$wpdb->visitors}, {$wpdb->log} WHERE visit_id = visit {stamp} GROUP BY visit_ip ORDER BY `Count` DESC {qrylimit}",
+ ),
+ 'columns'=>array('Host IP'=>'visit_ip', 'Count'=>'Count'),
+ 'column_filter'=>array(
+ 'Host IP'=>'return "<a href=\"" . add_query_arg(array("filter"=>"host={$row[\'visit_ip\']}", "report"=>"host_profile"), $_SERVER[\'REQUEST_URI\']) . "\">" . long2ip($row[\'visit_ip\']) . "</a>";',
+ )
+ ),
+ 'top_refer'=> array (
+ 'title'=>'Top Referring Pages',
+ 'report_type'=>'table',
+ 'queries'=>array(
+ "SELECT *, count(visit_id) AS `Count` FROM {$wpdb->refer}, {$wpdb->visitors} WHERE referer_id = referer AND referer_string <> '' {lasthere} GROUP BY referer ORDER BY `Count` DESC {qrylimit}",
+ ),
+ 'columns'=>array('Referring Page'=>'referer_string', 'Count'=>'Count'),
+ 'column_filter'=>array(
+ 'Referring Page'=>'return "<a href=\"{$row[\'referer_string\']}\">" . substr(BASP::refer_replace($row[\'referer_string\']), 0, 100) . "</a>";',
+ 'Count'=>'return "<a href=\"" . add_query_arg(array("filter"=>"referer={$row[\'referer\']}", "report"=>"top_page_hits_referer"), $_SERVER[\'REQUEST_URI\']) . "\">{$row[\'Count\']}</a>";',
+ )
+ ),
+ 'top_refer_host'=> array (
+ 'title'=>'Top Referring Pages for %s',
+ 'report_type'=>'table',
+ 'filters'=>array('host'),
+ 'queries'=>array(
+ "SELECT *, count(visit_id) AS `Count` FROM {$wpdb->refer}, {$wpdb->visitors} WHERE referer_id = referer AND visit_ip = {filt_crit} {lasthere} GROUP BY referer ORDER BY `Count` DESC {qrylimit}",
+ ),
+ 'columns'=>array('Referring Page'=>'referer_string', 'Count'=>'Count'),
+ 'column_filter'=>array(
+ 'Referring Page'=>'return "<a href=\"{$row[\'referer_string\']}\">" . substr(BASP::refer_replace($row[\'referer_string\']), 0, 100) . "</a>";',
+ )
+ ),
+ 'top_os'=> array (
+ 'title'=>'Top Operating Systems',
+ 'report_type'=>'table',
+ 'queries'=>array(
+ "SELECT *, count(visit_id) AS `Count` FROM {$wpdb->os}, {$wpdb->visitors} WHERE os_id = osystem {lasthere} GROUP BY os_id ORDER BY `Count` DESC {qrylimit}",
+ ),
+ 'columns'=>array('Operating System'=>'os_string', 'Count'=>'Count'),
+ 'column_filter'=>array(
+ )
+ ),
+ 'top_ua'=> array (
+ 'title'=>'Top User Agents',
+ 'report_type'=>'table',
+ 'queries'=>array(
+ "SELECT *, count(ua_id) AS `Count` FROM {$wpdb->ua}, {$wpdb->visitors} WHERE ua_id = useragent {lasthere} GROUP BY ua_id ORDER BY `Count` DESC {qrylimit}",
+ ),
+ 'columns'=>array('User Agent'=>'ua_string', 'Count'=>'Count'),
+ 'column_filter'=>array(
+ 'User Agent'=>'return BAStats::BrowserMap($row["ua_string"]) . "<div style=\"font-size:xx-small;text-indent:3em;\">{$row["ua_string"]}</div>";',
+ )
+ ),
+ 'top_searches'=> array (
+ 'title'=>'Top Search Phrases',
+ 'report_type'=>'table',
+ 'queries'=>array(
+ "SELECT *, count(search_refer) AS `Count` FROM {$wpdb->searches}, {$wpdb->visitors}, {$wpdb->refer} WHERE search_refer = referer_id AND search_refer = referer AND referer_string <> '' {lasthere} GROUP BY search_refer ORDER BY `Count` DESC {qrylimit}",
+ ),
+ 'columns'=>array('Search Phrase'=>'search_phrase', 'Search Engine'=>'search_engine', 'Count'=>'Count'),
+ 'column_filter'=>array(
+ 'Search Phrase'=>'return "<a href=\"{$row[\'referer_string\']}\">{$row[\'search_phrase\']}</a>";',
+ 'Search Engine'=>'return "<a href=\"" . add_query_arg(array("filter"=>"search={$row[\'search_refer\']}", "report"=>"search_profile"), $_SERVER[\'REQUEST_URI\']) . "\">{$row[\'search_engine\']}</a>";',
+ )
+ ),
+
+ 'recent_page_hits'=> array (
+ 'title'=>'Recent Page Hits',
+ 'report_type'=>'table',
+ 'queries'=> array(
+ "SELECT * FROM {$wpdb->pages}, {$wpdb->log}, {$wpdb->visitors} WHERE page = page_id AND visit = visit_id {stamp} ORDER BY stamp DESC {qrylimit}",
+ ),
+ 'columns'=>array('Page'=>'page_string', 'Date'=>'stamp', 'Host IP'=>'visit_ip'),
+ 'column_filter'=>array(
+ 'Page'=>'return ($row["page_label"] == \'\') ? "<a href=\"{$row[\'page_string\']}\">{$row[\'page_string\']}</a>" : "<a href=\"{$row[\'page_string\']}\" style=\"font-weight:bold;\">{$row[\'page_label\']}</a><br><div style=\"font-size:xx-small;text-indent:3em;\">{$row[\'page_string\']}</div>";',
+ 'Host IP'=>'return "<a href=\"" . add_query_arg(array("filter"=>"host={$row[\'visit_ip\']}", "report"=>"host_profile"), $_SERVER[\'REQUEST_URI\']) . "\">" . long2ip($row[\'visit_ip\']) . "</a>";',
+ )
+ ),
+ 'recent_page_hits_host'=> array (
+ 'title'=>'Recent Page Hits From %s',
+ 'report_type'=>'table',
+ 'filters'=>array('host'),
+ 'queries'=>array(
+ "SELECT * FROM {$wpdb->pages}, {$wpdb->log}, {$wpdb->visitors} WHERE page = page_id AND visit= visit_id AND visit_ip = {filt_crit} {stamp} ORDER BY stamp DESC {qrylimit}",
+ ),
+ 'columns'=>array('Page'=>'page_string', 'Date'=>'stamp'),
+ 'column_filter'=>array(
+ 'Page'=>'return ($row["page_label"] == \'\') ? "<a href=\"{$row[\'page_string\']}\">{$row[\'page_string\']}</a>" : "<a href=\"{$row[\'page_string\']}\" style=\"font-weight:bold;\">{$row[\'page_label\']}</a><br><div style=\"font-size:xx-small;text-indent:3em;\">{$row[\'page_string\']}</div>";',
+ )
+ ),
+ 'recent_hosts'=> array (
+ 'title'=>'Recent Hosts',
+ 'report_type'=>'table',
+ 'queries'=>array(
+ "SELECT * FROM {$wpdb->visitors}, {$wpdb->log} WHERE visit_id = visit {stamp} ORDER BY stamp DESC {qrylimit}",
+ ),
+ 'columns'=>array('Host IP'=>'visit_ip', 'Date'=>'stamp'),
+ 'column_filter'=>array(
+ 'Host IP'=>'return "<a href=\"" . add_query_arg(array("filter"=>"host={$row[\'visit_ip\']}", "report"=>"host_profile"), $_SERVER[\'REQUEST_URI\']) . "\">" . long2ip($row[\'visit_ip\']) . "</a>";',
+ )
+ ),
+ /*
+ 'recent_refer'=> array (
+ 'title'=>'Recent Referring Pages',
+ 'report_type'=>'table',
+ 'queries'=>array(
+ "SELECT * FROM {$wpdb->refer}, {$wpdb->visitors} WHERE referer_id = referer AND referer_string <> '' {lasthere} ORDER BY lasthere DESC {qrylimit}",
+ ),
+ 'columns'=>array('Referring Page'=>'referer_string', 'Date'=>'lasthere'),
+ 'column_filter'=>array(
+ 'Referring Page'=>'return "<a href=\"{$row[\'referer_string\']}\">" . substr(BASP::refer_replace($row[\'referer_string\']), 0, 100) . "</a>";',
+ )
+ ),
+ */
+ /* New recet_refer report, thanks to Steve Smith @ www.orderedlist.com */
+ 'recent_refer'=> array (
+ 'title'=>'Recent Referring Pages',
+ 'report_type'=>'table',
+ 'queries'=>array(
+ "SELECT * FROM {$wpdb->refer}, {$wpdb->visitors}, {$wpdb->pages} right join {$wpdb->log} on visit_id = visit WHERE referer_id = referer AND referer_string <> '' {lasthere} and page_id = page group by visit ORDER BY lasthere desc, stamp {qrylimit}",
+ ),
+ 'columns'=>array('Referring Page'=>'referer_string', 'Page' => 'page_string', 'Date'=>'lasthere'),
+ 'column_filter'=>array(
+ 'Referring Page'=>'return "<a href=\"{$row[\'referer_string\']}\">" . substr(BASP::refer_replace($row[\'referer_string\']), 0, 100) . "</a>";',
+ 'Page'=>'return ($row["page_label"] == \'\') ? "<a href=\"{$row[\'page_string\']}\">{$row[\'page_string\']}</a>" : "<a href=\"{$row[\'page_string\']}\" style=\"font-weight:bold;\">{$row[\'page_label\']}</a><br><div style=\"font-size:xx-small;text-indent:3em;\">{$row[\'page_string\']}</ div>";',
+ )
+ ),
+ 'recent_os'=> array (
+ 'title'=>'Recent Operating Systems',
+ 'report_type'=>'table',
+ 'queries'=>array(
+ "SELECT * FROM {$wpdb->os}, {$wpdb->visitors} WHERE os_id = osystem {lasthere} ORDER BY lasthere DESC {qrylimit}",
+ ),
+ 'columns'=>array('Operating System'=>'os_string', 'Date'=>'lasthere'),
+ 'column_filter'=>array(
+ )
+ ),
+ 'recent_ua'=> array (
+ 'title'=>'Recent User Agents',
+ 'report_type'=>'table',
+ 'queries'=>array(
+ "SELECT * FROM {$wpdb->ua}, {$wpdb->visitors} WHERE ua_id = useragent {lasthere} ORDER BY lasthere DESC {qrylimit}",
+ ),
+ 'columns'=>array('User Agent'=>'ua_string', 'Date'=>'lasthere'),
+ 'column_filter'=>array(
+ 'User Agent'=>'return BAStats::BrowserMap($row["ua_string"]) . "<div style=\"font-size:xx-small;text-indent:3em;\">{$row["ua_string"]}</div>";',
+ )
+ ),
+ 'recent_searches'=> array (
+ 'title'=>'Recent Search Phrases',
+ 'report_type'=>'table',
+ 'queries'=>array(
+ "SELECT * FROM {$wpdb->searches}, {$wpdb->visitors}, {$wpdb->refer} WHERE referer_id = search_refer AND search_refer = referer AND referer_string <> '' {lasthere} ORDER BY lasthere DESC {qrylimit}",
+ ),
+ 'columns'=>array('Search Phrase'=>'search_phrase', 'Search Engine'=>'search_engine', 'Date'=>'lasthere'),
+ 'column_filter'=>array(
+ 'Search Phrase'=>'return "<a href=\"{$row[\'referer_string\']}\">{$row[\'search_phrase\']}</a>";',
+ 'Search Engine'=>'return "<a href=\"" . add_query_arg(array("filter"=>"search={$row[\'search_refer\']}", "report"=>"search_profile"), $_SERVER[\'REQUEST_URI\']) . "\">{$row[\'search_engine\']}</a>";',
+ )
+ ),
+
+ 'host_profile'=> array (
+ 'title'=>'Host Profile for %s',
+ 'report_type'=>'table',
+ 'filters'=>array('host'),
+ 'queries'=> array(
+ "SELECT * FROM {$wpdb->visitors}, {$wpdb->refer}, {$wpdb->ua} WHERE ua_id = useragent AND referer = referer_id AND visit_ip = {filt_crit} {lasthere} ORDER BY lasthere DESC {qrylimit}",
+ ),
+ 'columns'=>array('Host IP'=>'visit_ip', 'Date'=>'lasthere'),
+ 'column_filter'=>array(
+ 'Host IP'=>'return "<a href=\"" . add_query_arg(array("filter"=>"host={$row[\'visit_ip\']}", "report"=>"top_page_hits_host"), $_SERVER[\'REQUEST_URI\']) . "\">" . long2ip($row[\'visit_ip\']) . "</a>
+ <div style=\"font-size:xx-small;text-indent:3em;\">Referring Page: {$row["referer_string"]}</div>
+ <div style=\"font-size:xx-small;text-indent:3em;\">User Agent: {$row["ua_string"]}</div>
+ ";',
+ )
+ ),
+ 'search_profile'=> array (
+ 'title'=>'Search Results from %s',
+ 'report_type'=>'table',
+ 'filters'=>array('search'),
+ 'queries'=>array(
+ "SELECT DISTINCT search_engine FROM {$wpdb->searches} WHERE search_refer = {filt_crit}",
+ "SELECT * FROM {$wpdb->searches}, {$wpdb->visitors}, {$wpdb->refer} WHERE search_refer = referer_id AND search_refer = referer AND search_engine = '{search_engine}' {lasthere} ORDER BY lasthere DESC {qrylimit}",
+ ),
+ 'columns'=>array('Search Phrase'=>'search_phrase', 'Search Engine'=>'search_engine', 'Date'=>'lasthere'),
+ 'column_filter'=>array(
+ 'Search Phrase'=>'return "<a href=\"{$row[\'referer_string\']}\">{$row[\'search_phrase\']}</a>";',
+ )
+ ),
+
+ 'graph_top_hits_segment'=> array (
+ 'title'=>'Graph Top 5 Page Hits - Segmented',
+ 'report_type'=>'graph',
+ 'queries'=> array(
+ "SELECT *, count(page_id) AS `Count` FROM {$wpdb->pages}, {$wpdb->log} WHERE page = page_id {stamp} GROUP BY page_id ORDER BY `Count` DESC {qrylimit}",
+ ),
+ 'columns'=>array('Page'=>'page_string', 'Count'=>'Count'),
+ 'column_filter'=>array(
+ 'Page'=>'return ($row["page_label"] == \'\') ? "<a href=\"{$row[\'page_string\']}\">{$row[\'page_string\']}</a>" : "<a href=\"{$row[\'page_string\']}\" style=\"font-weight:bold;\">{$row[\'page_label\']}</a><br><div style=\"font-size:xx-small;text-indent:3em;\">{$row[\'page_string\']}</div>";',
+ ),
+ 'series'=>"SELECT *, count(page_id) AS `Count` FROM {$wpdb->pages}, {$wpdb->log} WHERE page = page_id {stamp} GROUP BY page_id ORDER BY `Count` DESC LIMIT 5",
+ 'series_index'=>'page_id',
+ 'series_label'=>'page_string',
+ 'label_filter'=>'return ($row->page_label == \'\') ? "<a href=\"{$row->page_string}\">{$row->page_string}</a>" : "<a href=\"{$row->page_string}\" style=\"font-weight:bold;\">{$row->page_label}</a><br><div style=\"font-size:xx-small;text-indent:3em;\">{$row->page_string}</div>";',
+ 'data'=> array(
+ "SELECT {_grouping} AS Label, count(page_id) AS `Count` FROM {$wpdb->pages}, {$wpdb->log} WHERE page = page_id AND page_id = {series_index} {_stamp} GROUP BY {_grouping} ORDER BY {_ordering}",
+ ),
+ ),
+ 'graph_top_hits'=> array (
+ 'title'=>'Graph Top Page Hits',
+ 'report_type'=>'graph',
+ 'queries'=> array(
+ "SELECT *, count(page_id) AS `Count` FROM {$wpdb->pages}, {$wpdb->log} WHERE page = page_id {stamp} GROUP BY page_id ORDER BY `Count` DESC {qrylimit}",
+ ),
+ 'columns'=>array('Page'=>'page_string', 'Count'=>'Count'),
+ 'column_filter'=>array(
+ 'Page'=>'return ($row["page_label"] == \'\') ? "<a href=\"{$row[\'page_string\']}\">{$row[\'page_string\']}</a>" : "<a href=\"{$row[\'page_string\']}\" style=\"font-weight:bold;\">{$row[\'page_label\']}</a><br><div style=\"font-size:xx-small;text-indent:3em;\">{$row[\'page_string\']}</div>";',
+ ),
+ 'series'=>"SELECT page_id, page_string, page_label, count(page_id) AS `Count` FROM {$wpdb->pages}, {$wpdb->log} WHERE page = page_id {stamp} GROUP BY page_id ORDER BY `Count` DESC LIMIT {limit}",
+ 'series_index'=>'page_id',
+ 'series_label'=>'page_string',
+ 'label_filter'=>'return ($row->page_label == \'\') ? "<a href=\"{$row->page_string}\">{$row->page_string}</a>" : "<a href=\"{$row->page_string}\" style=\"font-weight:bold;\">{$row->page_label}</a><br><div style=\"font-size:xx-small;text-indent:3em;\">{$row->page_string}</div>";',
+ 'data'=> array(
+ "SELECT count(page_id) AS `Count` FROM {$wpdb->pages}, {$wpdb->log} WHERE page = page_id AND page_id = {series_index} {_stamp} ORDER BY {_ordering}",
+ ),
+ ),
+ /*
+ // Spam Graph not ready for primetime. :(
+ 'graph_spam'=> array (
+ 'title'=>'Graph Spam Frequency',
+ 'report_type'=>'graph',
+ 'queries'=> array(
+ "SELECT count(comment_id) AS `Spam` FROM {$wpdb->comments} WHERE comment_approved='spam' {_stamp};",
+ ),
+ 'columns'=>array('Spam Comments'=>'Spam'),
+ 'column_filter'=>array(
+ ),
+ 'series'=>"SELECT 'Spam Comments' as Spam",
+ 'series_index'=>'Spam',
+ 'series_label'=>'Spam',
+ 'label_filter'=>'return "Spam Comments";',
+ 'data'=> array(
+ "SELECT DATE_FORMAT(comment_date, '%Y-%m-%d %H:%i') AS Label, count(comment_id) AS `Count` FROM {$wpdb->comments} WHERE comment_approved='spam' AND comment_date >= {_starttext} AND comment_date <= {_endtext} GROUP BY DATE_FORMAT(comment_date, '%Y-%m-%d %H:%i') ORDER BY DATE_FORMAT(comment_date, {_datechunk})",
+ ),
+ ),
+ */
+);
+?> \ No newline at end of file
diff --git a/wp-inst/wp-content/plugins/hello.php b/wp-inst/wp-content/plugins/hello.php
new file mode 100644
index 0000000..3eee83f
--- /dev/null
+++ b/wp-inst/wp-content/plugins/hello.php
@@ -0,0 +1,73 @@
+<?php
+/*
+Plugin Name: Hello Dolly
+Plugin URI: http://wordpress.org/#
+Description: This is not just a plugin, it symbolizes the hope and enthusiasm of an entire generation summed up in two words sung most famously by Louis Armstrong. Hello, Dolly. This is, by the way, the world's first official WordPress plugin. When enabled you will randomly see a lyric from <cite>Hello, Dolly</cite> in the upper right of your admin screen on every page.
+Author: Matt Mullenweg
+Version: 1.0
+Author URI: http://photomatt.net/
+*/
+
+// These are the lyrics to Hello Dolly
+$lyrics = "Hello, Dolly
+Well, hello, Dolly
+It's so nice to have you back where you belong
+You're lookin' swell, Dolly
+I can tell, Dolly
+You're still glowin', you're still crowin'
+You're still goin' strong
+We feel the room swayin'
+While the band's playin'
+One of your old favourite songs from way back when
+So, take her wrap, fellas
+Find her an empty lap, fellas
+Dolly'll never go away again
+Hello, Dolly
+Well, hello, Dolly
+It's so nice to have you back where you belong
+You're lookin' swell, Dolly
+I can tell, Dolly
+You're still glowin', you're still crowin'
+You're still goin' strong
+We feel the room swayin'
+While the band's playin'
+One of your old favourite songs from way back when
+Golly, gee, fellas
+Find her a vacant knee, fellas
+Dolly'll never go away
+Dolly'll never go away
+Dolly'll never go away again";
+
+// Here we split it into lines
+$lyrics = explode("\n", $lyrics);
+// And then randomly choose a line
+$chosen = wptexturize( $lyrics[ mt_rand(0, count($lyrics) ) ] );
+
+// This just echoes the chosen line, we'll position it later
+function hello_dolly() {
+ global $chosen;
+ echo "<p id='dolly'>$chosen</p>";
+}
+
+// Now we set that function up to execute when the admin_footer action is called
+add_action('admin_footer', 'hello_dolly');
+
+// We need some CSS to position the paragraph
+function dolly_css() {
+ echo "
+ <style type='text/css'>
+ #dolly {
+ position: absolute;
+ top: 5px;
+margin: 0; padding: 0;
+ right: 3em;
+ font-size: 20px;
+ color: #666;
+ }
+ </style>
+ ";
+}
+
+add_action('admin_head', 'dolly_css');
+
+?> \ No newline at end of file
diff --git a/wp-inst/wp-content/plugins/jb_Recent_Comments_List.php b/wp-inst/wp-content/plugins/jb_Recent_Comments_List.php
new file mode 100644
index 0000000..2622b00
--- /dev/null
+++ b/wp-inst/wp-content/plugins/jb_Recent_Comments_List.php
@@ -0,0 +1,68 @@
+<?php
+
+/*
+Plugin Name: Recent Comments List
+Plugin URI: http://freepressblog.org/plugins/recentComments.html
+
+Description: This plugin will add a list of the most frequent comments posted to your blog. They are gathered in descending order (newest at the top), but then group them together by post title, so that comments from the same post are listed together. The list items will be links to the comments, and will contain the name of the commenter. Derived from the "Top/Recent Commenters" plugin by Scott Reilly (http://www.coffee2code.com/wp-plugins/)
+Author: Jared Bangs
+Author URI: http://freepressblog.org/
+Version: 1.7
+*/
+
+function get_recent_comments($no_comments = 5, $comment_lenth = 5) {
+
+ global $wpdb, $tablecomments, $tableposts, $id;
+ if (!isset($tablecomments)) $tablecomments = $wpdb->comments;
+ if (!isset($tableposts)) $tableposts = $wpdb->posts;
+
+ $request = "SELECT ID, comment_ID, comment_content, comment_author, post_title FROM $tablecomments LEFT JOIN $tableposts ON $tableposts.ID=$tablecomments.comment_post_ID ";
+ $request .= "WHERE post_status = 'publish' ";
+ if(!$show_pass_post) $request .= "AND post_password ='' ";
+ $request .= "AND comment_approved = '1' ORDER BY comment_ID DESC LIMIT $no_comments";
+ $comments = $wpdb->get_results($request);
+ $output = '';
+
+ foreach ($comments as $comment) {
+
+ $comment_author = stripslashes($comment->comment_author);
+
+ if ($comment_author == "")
+ $comment_author = "anonymous";
+
+ $comment_content = strip_tags($comment->comment_content);
+ $comment_content = stripslashes($comment_content);
+ $words=split(" ",$comment_content);
+ $comment_excerpt = join(" ",array_slice($words,0,$comment_lenth));
+
+ $permalink = get_permalink($comment->ID)."#comment-".$comment->comment_ID;
+ $postlink = get_permalink($comment->ID);
+
+ // Assemble link
+ $post_title = '<a href="' . $postlink . '">' . stripslashes($comment->post_title) . '</a>';
+ $comment_ID = stripslashes($comment->comment_ID);
+ $postTitles[$post_title][$comment_ID] = '<li><span class="commentAuthor">' . $comment_author . ':</span> <a href="' . $permalink;
+ $postTitles[$post_title][$comment_ID] .= '" title="View the entire comment by ' . $comment_author.'">' . $comment_excerpt.'...</a></li>';
+ }
+
+ $output = '<div id="recentcomments"><span id="recentCommentsTitle">Recent Comments:</span><ul id="recentcommentsList">' . "\n";
+
+ foreach ($postTitles as $title => $commentPreview) {
+
+ $output .= '<li><span class="recentCommentsPostTitle">' . $title . ':</span>' . "\n";
+ $output .= '<ul>' . "\n";
+
+ foreach ($commentPreview as $comID => $commentPreviewHTML) {
+ $output .= $commentPreviewHTML . "\n";
+ }
+
+ $output .= '</ul>' . "\n";
+ $output .= '</li>';
+ }
+
+ $output .= "\n" . '</ul>' . "\n" . '</div>' . "\n";
+
+ return $output;
+}
+
+?> \ No newline at end of file
diff --git a/wp-inst/wp-content/plugins/kittens-spaminator.php b/wp-inst/wp-content/plugins/kittens-spaminator.php
new file mode 100644
index 0000000..937df6b
--- /dev/null
+++ b/wp-inst/wp-content/plugins/kittens-spaminator.php
@@ -0,0 +1,529 @@
+<?php
+/*
+Plugin Name: Kitten's Spaminator
+Version: 1.0rc7
+Plugin URI: http://blog.mookitty.co.uk/wordpress/spaminator/
+Description: Spam prevention and blocking using tarpitting and strike counting. Comments are assigned strikes for spam content, and a comment that meets the criteria for spam is blocked from posting.<br>If you're using WP 1.3 or higher, you have an admin menu under "Options" if you wish to change the defaults. For 1.2 users, you must edit the plugin file directly.<br><strong> Copyright 2004, Released under the GPL.</strong>
+Author: Kitten
+Author URI: http://blog.mookitty.co.uk
+
+INSTALLATION INSTRUCTIONS
+=========================
+1) If you're viewing this on the web, select all and paste it into a new text file named "kittens-spaminator.php"
+
+2) Copy the "kittens-spaminator.php" file to your wp-contents/plugins directory.
+
+3) On your plugins admin page, activate the plugin.
+
+4) Enjoy your freedom from spam!
+
+ 4a) Configure options if you don't like the defaults. Use the admin page for WP 1.3+, edit
+ edit this file for 1.2.
+=========================
+
+Change Log:
+0.1a - initial release
+0.2a - add more stuff
+0.3a - add whitelisting, fix checker function
+0.3b - fix debug code error
+0.4a - changed even more stuff
+0.5a - add crapflood check, change default values
+0.6a - add stike if no email,etc
+0.6b - fix php error
+0.7a - add check for empty email (Donncha)
+0.8a - add encoded char check, from functions.php
+0.9a - add post ID check, from techgnome
+0.9b - clean up email stuff & version
+0.10a - add user regex for especially annoying spam
+0.10b - fix user regex bug
+0.10c - fix another user regex bug
+0.10d - clean up code, add TODO
+0.11a - add URL check, fix strpos errors, interface for $strike_cnt
+0.11b - add user regex for email
+1.0rc - Release candidate, add GPL license
+1.0rc2 - Add admin page skel, 1.2 fixes, name whitelisting, "how" in email, clear TODOs
+ fix excessive links bug, change default for no referrer, double stripslashes on the
+ comment (to make the comment_url filter work to detect strange urls), fix html
+ entities
+1.0rc3 - Add check for real url in URL field, expand character entities check, check
+ all urls for dashes (most spam urls have dashes). Change user_regex_c to hopefully
+ catch the garbage spammer. Add record keeping on passed comments.
+1.0rc4 - Now used now 'preprocess' comment filter hook, only works with v1.5 nightlies from
+ Jan 5th or later. New email address for returned mail.
+1.0rc5 - New shiny admin interface + Kitten's regex service.
+1.0rc6 - Fix install bug.
+1.0rc7 - Sanitize regex service text, trim form fields.
+*/
+
+/**************---------------- CLASS DEFINITIONS ----------------**************/
+/// Admin page
+if ( ! class_exists( 'spaminator_admin_page' ) ) :
+class spaminator_admin_page
+{
+ function spaminator_admin_page( $post = '' )
+ {
+ $this->installed = get_settings( 'spaminator_status' );
+ // Get and load old options
+ $this->opts = get_settings( 'spaminator_settings' );
+ if ( count( $this->opts ) == 6 ) {
+ foreach ( $this->opts as $key => $val ) $this->$key = $val;
+ }
+ // Override with new options
+ if ( 'Save Options' == $post['save_spaminator_options'] ) {
+ $this->save_options = trim( $post['save_spaminator_options'] );
+ $this->strikes = trim( $post['spaminator_strikes'] );
+ $this->user_regex_c = trim( $post['spaminator_comment_regex'] );
+ $this->user_regex_e = trim( $post['spaminator_email_regex'] );
+ $this->nap_time = trim( $post['spaminator_naptime'] );
+ $this->send_mail = trim( $post['spaminator_sendmail'] );
+ $this->crap_flood = trim( $post['spaminator_crapflood'] );
+ }
+
+ if ( 'Remove Options' == $post['remove_spaminator_options'] ) {
+ $this->remove_options();
+ }
+
+ // Need to set things up
+ $this->install_options = $post['install_spaminator_options'];
+ $this->process_options();
+
+ // Get regex list
+ if ( 'Get Regexs' == $post['get_regexs'] ) {
+ $this->get_regexs();
+ }
+ }
+
+ function process_options()
+ {
+ // Install
+ if ( 'Install now' == $this->install_options && 'installed' != $this->installed ) {
+ add_option( 'spaminator_status', 'installed', 'Spaminator install flag' );
+ $settings = array( 'strikes' => 5,
+ 'user_regex_e' => '/^byob.*[0-9]{1,4}/i',
+ 'user_regex_c' => '/bea?stiality|rape|incest/i',
+ 'nap_time' => 60,
+ 'send_mail' => TRUE,
+ 'crap_flood' => 60 );
+ add_option( 'spaminator_settings', $settings, 'Spaminator options' );
+ $this->installed = get_settings( 'spaminator_status' );
+ $this->opts = get_settings( 'spaminator_settings' );
+ if ( count( $this->opts ) == 6 ) {
+ foreach ( $this->opts as $key => $val ) $this->$key = $val;
+ } else {
+ die( "There was a problem installing the default settings. Please try again." );
+ }
+ }
+
+ // Save new options
+ if ( 'Save Options' == $this->save_options ) {
+ $settings = array( 'strikes' => $this->strikes,
+ 'user_regex_c' => $this->user_regex_c,
+ 'user_regex_e' => $this->user_regex_e,
+ 'nap_time' => $this->nap_time,
+ 'send_mail' => $this->send_mail,
+ 'crap_flood' => $this->crap_flood );
+ update_option( 'spaminator_settings', $settings );
+ $this->updated = '<div class="updated"><p>The Spaminator&#146;s settings were updated successfully.</p></div>' . "\n";
+ }
+ }
+
+ function get_regexs()
+ {
+ $f = @fopen( "http://mookitty.co.uk/regexs.txt", 'r' );
+ $data = @fread( $f, 2048 ); // even if corrupted, only 2K max
+ @fclose( $f );
+
+ if ( strlen( $data ) < 1 ) {
+ $this->regexs = 'Sorry, no data available.<br />See <a href="http://mookitty.co.uk/regexs.txt">this page</a> for the latest.';
+ } else {
+ $this->regexs = htmlentities( $data );
+ }
+ }
+
+ function remove_options()
+ {
+ delete_option( 'spaminator_status' );
+ delete_option( 'spaminator_settings' );
+ $this->installed = '';
+ $this->updated = '<div class="updated"><p style="color: red;"><strong>The Spaminator&#146;s settings were removed.</strong> You are now using the built in defaults.</p></div>' . "\n";
+ }
+
+ function display_admin_page()
+ {
+ if ( 'installed' == $this->installed ) {
+ return $this->show_form();
+ } else {
+ return $this->show_install_form();
+ }
+ }
+
+ function show_install_form()
+ {
+ $text = $this->updated;
+ $text .= '<div class="wrap"><h2>Install The Spaminator&#146;s Config</h2>' . "\n";
+ $text .= '<form method="post" action="">' . "\n";
+ $text .= '<h3>Do you want to be able to configure The Spaminator from this admin page?</h3>' . "\n";
+ $text .= "<p>This will install The Spaminator's options in your database.</p>" . "\n";
+ $text .= '<input type="submit" name="install_spaminator_options" value="Install now" />' . "\n";
+ $text .= '</form>'. "\n";
+ $text .= '</div>' . "\n";
+ return $text;
+ }
+
+ function show_form()
+ {
+ $text = $this->updated;
+ $text .= '<div class="wrap"><h2>Configure The Spaminator</h2>' . "\n";
+ $text .= '<form method="post" action="" name="spaminator_options">' . "\n";
+ $text .= '<table>' . "\n";
+ $text .= '<tr><td>Strikes:</td>' . "\n";
+ $text .= '<td><input type="text" name="spaminator_strikes" value="'.$this->strikes.'" /></td>' . "\n";
+ $text .= '<td>The number of "hits" needed to kill a comment as spam.</td></tr>' . "\n";
+
+ $text .= '<tr><td>Send email?</td>' . "\n";
+ $text .= '<td><select name="spaminator_sendmail">' . "\n";
+ if ( $this->send_mail ) {
+ $text .= '<option value="1" selected="selected">Yes&nbsp;&nbsp;</option>' . "\n";
+ $text .= '<option value="0">No</option>' . "\n";
+ } else {
+ $text .= '<option value="1">Yes&nbsp;&nbsp;</option>' . "\n";
+ $text .= '<option value="0" selected="selected">No</option>' . "\n";
+ }
+ $text .= '</select></td>' . "\n";
+ $text .= '<td>Send email confirmation of each comment killed?</td></tr>' . "\n";
+
+
+ $text .= '<tr><td>Nap Time:</td>' . "\n";
+ $text .= '<td><input type="text" name="spaminator_naptime" value="'.$this->nap_time.'" /></td>' . "\n";
+ $text .= '<td>How long to tarpit the spammer, in seconds.</td></tr>' . "\n";
+
+ $text .= '<tr><td>Crap Flood:</td>' . "\n";
+ $text .= '<td><input type="text" name="spaminator_crapflood" value="'.$this->crap_flood.'" /></td>' . "\n";
+ $text .= '<td>Minimum amount of time allowed between comments from same IP address.</td></tr>' . "\n";
+
+
+ $text .= '<tr><td>Email regex:</td>' . "\n";
+ $text .= '<td><input type="text" name="spaminator_email_regex" value="'.$this->user_regex_e.'" /></td>' . "\n";
+ $text .= '<td>Special pattern in the email address of the commenter to kill comments.</td></tr>' . "\n";
+
+
+ $text .= '<tr><td>Comment regex:</td>' . "\n";
+ $text .= '<td><input type="text" name="spaminator_comment_regex" value="'.$this->user_regex_c.'" /></td>' . "\n";
+ $text .= '<td>Special pattern in the comment body to kill comments.</td></tr>' . "\n";
+
+ $text .= '</table>' . "\n";
+ $text .= '<input type="submit" name="save_spaminator_options" value="Save Options" />' . "\n";
+ $text .= '</form>'. "\n";
+ $text .= '</div>' . "\n";
+
+ $text .= '<div class="wrap"><h2>Kitten\'s Regex Service</h2>' . "\n";
+ if ( !empty( $this->regexs ) ) {
+ $text .= "<pre>$this->regexs</pre>";
+ } else {
+ $text .= '<p>If you\'d like to see <a href="http://blog.mookitty.co.uk/wordpress/regex-service/">Kitten\'s custom regexs</a> that she\'s currently using to keep spam away, click the button below:</p>' . "\n";
+ $text .= '<p><strong style="color: red">Notice:</strong> This is highly dependant on your server configuration, and may not work. You\'ve been warned.</p>' . "\n";
+ $text .= '<form method="post" action="" name="kittens_regexs">' . "\n";
+ $text .= '<input type="submit" name="get_regexs" value="Get Regexs" />' . "\n";
+ $text .= '</form>' . "\n";
+ }
+ $text .= '</div>' . "\n";
+
+ $text .= '<div class="wrap"><h2>Remove The Spaminator&#146;s Options</h2>' . "\n";
+ $text .= '<p><strong style="color: red">Help!</strong> I\'ve totally screwed up my settings and want to use the built in defaults.</p>' . "\n";
+ $text .= '<form method="post" action="" name="remove_spaminator_options">' . "\n";
+ $text .= '<p>Really remove the user options?</p>' . "\n";
+ $text .= '<input type="submit" name="remove_spaminator_options" value="Remove Options" />' . "\n";
+ $text .= '</form>'. "\n";
+ $text .= '</div>' . "\n";
+
+ return $text;
+ }
+}
+endif;
+
+/// Spam redirector class
+if ( ! class_exists( 'spam_killer' ) ) :
+class spam_killer
+{
+ // Class vars
+ var $how;
+ var $post;
+ var $strikes;
+ var $strike_cnt;
+ var $word_list;
+ var $nap_time;
+ var $send_mail;
+ var $crap_flood;
+
+ function spam_killer( $post )
+ {
+ global $wpdb;
+ $options = array(
+ //==================================================================
+ // Adjust the number of strikes needed to reject a comment
+ strikes => 5, // Number
+ //==================================================================
+ // Change this to fight a particular spammer
+ user_regex_c => '/bea?stiality|rape|incest/i', // Text string
+ user_regex_e => '/^byob.*[0-9]{1,4}/i', // Text string
+ //==================================================================
+ // Adjust the nap time to vary the TarPit delay
+ nap_time => 10, // Time in seconds
+ //==================================================================
+ // Change to TRUE to enable sending email when a spammer is caught
+ send_mail => true, // TRUE or FALSE
+ //==================================================================
+ // Adjust the minimum time between posts (crapflooding)
+ crap_flood => 60, // Time in seconds
+ //==================================================================
+ );
+
+ $installed = get_settings( 'spaminator_status' );
+
+ if ( 'installed' == $installed ) { // this is set via the admin page
+ $saved_options = get_settings( 'spaminator_settings' );
+ if ( is_array( $saved_options ) ) $options = $saved_options; // override
+ }
+
+ foreach ( $options as $key => $opt ) $this->$key = $opt;
+
+ $this->post = $post;
+ $this->strike_cnt = 0;
+ $this->word_list = get_settings('moderation_keys');
+ /*
+ if( $wpdb->options != 'wp_main_options' )
+ {
+ $query = "SELECT option_value from wp_main_options WHERE option_name='moderation_keys'";
+ $this->word_list .= "\n" . $wpdb->get_var( $query );
+ }
+ */
+ }
+
+ function count_strikes( $str = 0, $how )
+ {
+ $this->how[] = $how; // list all checks so far
+ $this->strike_cnt += $str;
+
+ // stats
+ $this->post['comment_content'] .= "<!-- X-spaminator-strike: $how, $str -->";
+
+ if ( $this->strike_cnt >= $this->strikes ) {
+
+ // Maybe send mail - we got spammer tail
+ if ( $this->send_mail ) {
+ $why = implode( ", ", $this->how );
+ $body = "The Spaminator has killed a comment.\r\n\r\n";
+ $body .= "The details:\r\n";
+ $body .= "Strikes : $this->strike_cnt/$this->strikes\r\n";
+ $body .= "How : $why\r\n";
+ $body .= "IP Addr : ".$_SERVER['REMOTE_ADDR']."\r\n";
+ $body .= "Referer : ".$_SERVER['HTTP_REFERER']."\r\n";
+ $body .= "Client : ".$_SERVER['HTTP_USER_AGENT']."\r\n";
+ $body .= "Request : ".$_SERVER['REQUEST_METHOD']." ". $_SERVER['REQUEST_URI']."\r\n";
+ $body .= "Post ID : ".$this->post['comment_post_ID']."\r\n";
+ $body .= "Email : ".$this->post['comment_author_email']."\r\n";
+ $body .= "Author : ".$this->post['comment_author']."\r\n";
+ $body .= "URL : ".$this->post['comment_author_url']."\r\n";
+ $body .= "Body:\r\n";
+ $body .= $this->post['comment_content']."\r\n\r\n";
+ $body .= "--\r\nThis email has been sent because the Spaminator plugin is set to send emails when a suspected spam has been blocked.\r\nTo not receive these emails change the ".'$this->send_mail'." variable to FALSE.\r\n\r\nThanks for using this plugin, hope it helps!\r\nhttp://mookitty.co.uk/devblog/";
+ $headers = "From: The Spaminator <wp.spaminator@gmail.com>";
+ $to = "[" . get_settings('blogname') . "] Spaminator: Spammer caught!";
+
+ @mail( get_settings('admin_email'), $to, $body, $headers );
+ }
+
+ // Let's waste spambot time:
+ sleep ( $this->nap_time );
+
+ // Make sure the bot thinks that spam was posted:
+ header( "HTTP/1.0 200 OK" );
+
+ // Tell humans something else:
+ echo "<p>Sorry, you've been prevented from commenting on this blog.</p>\n";
+ echo "<p>Either your comment content was found to contain spam, or<br />\n";
+ echo "your IP address (or a subnet of your IP address) has spammed this blog before.</p>\n";
+ echo "<p>If you think you got this page in error, your entered name might be too short.</p>\n";
+ echo "<p>You can also complain to <a href=\"wp.spaminator@gmail.com\">wp.spaminator@gmail.com</a>. View source to see why you got blocked.\n";
+ echo "<p>Strike count: $this->strike_cnt</p>\n";
+ echo "\n<!-- ", implode( ", ", $this->how ), " -->";
+ exit;
+ }
+ }
+
+ function process_comment()
+ {
+ global $wpdb, $table_prefix;
+ if ( empty($wpdb->comments) ) $wpdb->comments = $table_prefix . 'comments';
+ if ( empty($wpdb->posts) ) $wpdb->posts = $table_prefix . 'posts';
+
+ /// Set up vars to use:
+
+ $type = $this->post['comment_type'];
+ $url = parse_url( $this->post['comment_author_url'] );
+ $postID = $this->post['comment_post_ID'];
+ $author = $this->post['comment_author'];
+ if ( empty( $this->post['comment_author_email'] ) ) {
+ if ( 'trackback' == $type ) {
+ $this->post['comment_author_email'] = 'trackback@' . $url['host'];
+ } elseif ( 'pingback' == $type ) {
+ $this->post['comment_author_email'] = 'pingback@' . $url['host'];
+ }
+ }
+ $email = $this->post['comment_author_email'];
+ // Filter the text so that links show up, etc.
+ $comment = apply_filters( 'comment_text', stripslashes(stripslashes($this->post['comment_content'])) );
+// $forward = $this->post['redirect_to'];
+ $remote = $_SERVER['REMOTE_ADDR'];
+ $referer = $_SERVER['HTTP_REFERER'];
+ $iplist = preg_grep( "/^([0-9]{1,3}\.?){2}/", explode("\n", $this->word_list) );
+ $wdlist = explode( "\n", $this->word_list );
+ $wdlist = array_diff( $wdlist, $iplist );
+ // Get email for whitelist
+ if ( !empty( $email ) ) {
+ $whlist = $wpdb->get_row("SELECT comment_approved, comment_author FROM $wpdb->comments WHERE comment_author_email = '$email' AND comment_approved = '1' AND NOW()+0 > UNIX_TIMESTAMP( DATE_ADD( comment_date, INTERVAL 1 DAY ) ) GROUP BY comment_author;");
+ } else {
+ $whlist = '0';
+ }
+
+ // This returns a unix timestamp
+ $cfchck = $wpdb->get_var("SELECT UNIX_TIMESTAMP(comment_date) FROM $wpdb->comments WHERE comment_author_IP = '$remote' ORDER BY comment_date_gmt DESC LIMIT 1;");
+
+ /// Check for spam:
+
+ // User regex check
+ if ( preg_match( $this->user_regex_c, $comment ) > 0 ) {
+ $this->count_strikes( 10, 'user regex - comment' );
+ }
+ if ( preg_match( $this->user_regex_e, $email ) > 0 ) {
+ $this->count_strikes( 10, 'user regex - email ');
+ }
+
+ // If non-existing post, spam for sure
+ if ( !$wpdb->get_var("SELECT ID FROM $wpdb->posts WHERE ID = '$postID'") ) {
+ $this->count_strikes( 10, 'non-existant post' );
+ }
+
+ // If previously approved, they get a headstart
+ if ( '1' == $whlist->comment_approved ) $this->count_strikes( -3, 'whitelist' );
+
+ // Check referer, see if a bot is directly inserting comment
+ if ( FALSE === strpos( $referer, get_settings('siteurl') ) ) {
+ $this->count_strikes( 3, 'bad referer - spambot?' );
+ }
+
+ // Check IP, see if it's a known spammer
+ $this->checker( $iplist, $remote, 5, 'IP check' );
+
+ // Check for crapflood
+ if ( $cfchck + $this->crap_flood > time() ) {
+ $this->count_strikes( 3, 'crap flooding' );
+ }
+
+ // Count links
+ if ( (count(explode('http', $comment)) - 1 ) > ( (int) get_settings('comment_max_links') ) ) {
+ $this->count_strikes( 3, 'excessive links' );
+ }
+
+ // Check email
+ $this->checker( $wdlist, $email, 1, 'email check' );
+
+ // Check author
+ // If the email is whitelisted, the name gets a free pass
+ // the most recent version of the name is used
+ if ( $author != $whlist->comment_author ) {
+ $this->checker( $wdlist, $author, 1, 'author check' );
+ }
+
+ // Check URL
+ // 3 points here, in case of "no body links" spam
+ $this->checker( $wdlist, $url['host'], 3, 'author url' );
+
+ // Check comment
+ $this->checker( $wdlist, $comment, 1, 'comment body' );
+
+ // From functions.php:
+ // Useless numeric encoding is a pretty good spam indicator:
+ // Extract entities:
+ if (preg_match_all('/&#?(\d+);/', $url['host'] . $author . $email, $chars)) {
+ foreach ($chars[1] as $char) {
+ // If it's an encoded char in the normal ASCII set, reject
+ if ($char < 128) $this->count_strikes( 1, 'html entity' );
+ }
+ }
+
+ // Check for dashes in urls
+ // Urls that are auto formatted will get counted twice - feature, not bug!
+ preg_match_all( '#(http:)?//([^\s"\'<>]*)#i', $comment, $match );
+ array_push( $match[2], $url['host'] );
+ array_push( $match[2], $email );
+ $cnt_dash = 0;
+ foreach ( $match[2] as $u ) {
+ $cnt_dash += substr_count( $u, '-' );
+ }
+ if ( $cnt_dash > 0 ) {
+ $this->count_strikes( $cnt_dash, 'url dashes' );
+ }
+
+ // Check if provided url is legit
+ if ( strlen( $url['host'] ) > 0 && ! checkdnsrr( $url['host'], 'A' ) ) {
+ $this->count_strikes( 4, "unknown url, $url" );
+ }
+
+ return $this->post;
+
+ } // end of function process_comment
+
+ function checker( $haystack, $needle, $strike_val, $how )
+ {
+ if ( is_array( $haystack ) && count( $haystack ) > 0 && strlen( $needle ) > 3 ) {
+ foreach ( $haystack as $item ) {
+ $item = trim( $item );
+ // skip empties & shorts in mod keys, faster than filtering list
+ if ( strlen( $item ) < 3 ) continue;
+
+ $word_cnt = substr_count( $needle, $item );
+ if ( $word_cnt > 0 ) {
+ $this->count_strikes( $strike_val * $word_cnt, $how . ' - ' . $item );
+ }
+ }
+ }
+ // Add a strike if email, etc is empty
+ if ( empty( $needle ) ) $this->count_strikes( 1, "empty field - $how" );
+ if ( ! empty( $needle ) && strlen( $needle ) <=3 ) $this->count_strikes( 1, 'short field' );
+
+ // Record keeping
+ $this->post['comment_content'] .= "<!-- X-spaminator-passed: $how -->";
+
+ } // end of function checker
+
+} // end class spam killer
+endif;
+/**************-------------- END CLASS DEFINITIONS --------------**************/
+
+/**************---------------- STANDALONE SECTION ---------------**************/
+/// Control block if comment posted.
+if ( ! function_exists( 'spaminate_comment' ) ) {
+ function spaminate_comment( $comment ) {
+ $incoming_spam = new spam_killer( $comment );
+ $foo = $incoming_spam->process_comment();
+ return $foo;
+ }
+}
+
+// Adds the menu item
+if ( ! function_exists( 'add_spaminator_menu' ) ) {
+ function add_spaminator_menu()
+ {
+ add_options_page(__('Spaminator Config'), __('Spaminator'), 9, 'kittens-spaminator.php');
+ }
+} elseif ( 'kittens-spaminator.php' == $_GET['page'] ) {
+ $spamiator_iface = new spaminator_admin_page( $_POST );
+ echo $spamiator_iface->display_admin_page();
+}
+
+add_action('preprocess_comment', 'spaminate_comment');
+add_action('admin_menu', 'add_spaminator_menu');
+/**************-------------- END STANDALONE SECTION -------------**************/
+
+?>
diff --git a/wp-inst/wp-content/plugins/wp_ozh_clickcounter.php b/wp-inst/wp-content/plugins/wp_ozh_clickcounter.php
new file mode 100644
index 0000000..53906c4
--- /dev/null
+++ b/wp-inst/wp-content/plugins/wp_ozh_clickcounter.php
@@ -0,0 +1,522 @@
+<?php
+/*
+Plugin Name: Click Counter
+Plugin URI: http://frenchfragfactory.net/ozh/archives/2004/09/17/click-counter-plugin-for-wordpress/
+Description: Adds a click counter to links in your posts (<a href="../wp-content/plugins/wp_ozh_clickcounter.php">quick readme & manual</a>)
+Version: 1.0
+Author: Ozh
+Author URI: http://planetOzh.com
+*/
+// script called directly (or something global badly misconfigured :)
+if (!function_exists("get_settings")) {wp_ozh_click_readme();die;}
+
+
+/*************************************
+ * OPTIONAL EDIT BELOW *
+ * ~~ *
+ *************************************/
+
+// when specified "default value" it means it can be overridden on a per-link basis in each post
+
+// Core variables
+
+$wp_ozh_click['table'] = 'wp_linkclicks';
+ /* name of the table where stats will be stored. Look at the bottom or at plugin page to learn how to create this table */
+$wp_ozh_click['file'] = get_settings('siteurl') . "/go.php" ;
+ /* name of the click counter php file (provided with the plugin archive). A good place for it is your blog root. */
+
+
+// Basic features
+
+$wp_ozh_click['do_posts'] = 1;
+ /* 0 or 1, or true / false
+ * Add or not a link counter to links in your posts */
+
+$wp_ozh_click['do_comments'] = 1;
+ /* 0 or 1, or true / false
+ * Add or not a link counter to links in comments */
+
+ /* There is a quick editing needed if you also want to add a counter
+ * to commenters' website when specified, see plugin page. */
+
+$wp_ozh_click['track_all_links'] = 1 ;
+ /* 0 : adds a counter only when you add count="value" in your links html tag
+ * 1 : adds a counter to all external links in your posts (no need to add counter="1" if you plan to track them all)
+ * To keep track of internal links if set to 1, put absolute path (http://yourblog/link) instead of relative (/link) */
+
+$wp_ozh_click['in_title'] = 0 ;
+ /* 1 or 0 (or true / false)
+ * add number of hits in link title tag : <a href="http://site.com" title="X hits">site</a> */
+
+$wp_ozh_click['in_plain'] = 0 ;
+ /* 1 or 0 (or true / false)
+ * add number of hits in plain text : <a href="http://site.com">site</a> <span class="hitcounter">(XX hits)</span> */
+
+$wp_ozh_click['0click'] = 'No Click';
+ /* default text for zero clicks. */
+
+$wp_ozh_click['1click'] = 'One hit';
+ /* default text for one click */
+
+$wp_ozh_click['clicks'] = '%% hits';
+ /* default text for several clicks, where %% will be replaced by a number */
+
+$wp_ozh_click['method'] = 2 ;
+ /* 1, 2 or 3
+ * There are 3 link 'href' modification modes available
+ * Each has advantages and drawbacks
+ * All validate any Doctype up to xhtml 1.1
+ *
+ * From input <a href="http://site.com">, each methods gives the following html :
+ *
+ * Method 1 :
+ * ^^^^^^^^^^
+ * <a href="http://site.com" onclick="window.location='/go.php?http://site.com'; return false">
+ * Cool : status bar shows real link without further trick.
+ * Less cool : doesnt work with "open link in new window"
+ *
+ * Method 2 :
+ * ^^^^^^^^^^
+ * <a href="/yourblog/go.php?http://site.com">
+ * Cool : works with "open in new window" and doesn't require Javascript enabled
+ * Less cool : shows ugly link "/blog/go.php?http://site.com" in status bar
+ *
+ * Method 3 :
+ * ^^^^^^^^^^
+ * like method 2 but also modify status bar to hide the "yoursite.com/blog/go.php?" part
+ * with an onmouseover="javascript:window.status='http://site.com'; return false"
+ * Cool : status bar shows real link.
+ * Less cool : adds a few bytes of html. But who cares :)
+ *
+ * I'd suggest you use preferably method 3, or at least method 2. Method 1 is really less
+ * accurate since it doesn't keep track of links opened in a new window */
+
+
+// Link title features
+// The plugin is able to retrieve a remote file title (from it's <title> html tag)
+
+$wp_ozh_click['get_title'] = 0;
+ /* 1 or 0 (or true / false)
+ * Get remote page title the first time a user clicks a link to store it along with hits in the table
+ * Will slow down a bit the first clicker (1 or 2 seconds, time for your website to retrieve the distant page)
+ * Titles stored are used for example when printing top clicked links
+ * !! Note : uses fopen(), check your host has enabled this !! */
+
+$wp_ozh_click['get_title_forcerefresh'] = 50;
+ /* Refresh remote page title every XX clicks ?
+ * Set to 0 if you don't want to check & refresh titles every XX clicks
+ * (the higher traffic - then clicks - you get, the higher you should set this
+ * To be honest this is really a gadget - almost totally useless :)
+ * Examples : 50 for Joe's blog, 3000 for Slashdottish blog */
+
+$wp_ozh_click['extensions'] = array (
+ "ace", "arj", "bin", "bz2", "dat", "deb", "gz", "hqx", "pak", "pk3", "rar", "rpm", "sea", "sit", "tar", "wsz", "zip",
+ "aif", "aiff", "au", "mid", "mod", "mp3", "ogg", "ram", "rm", "wav",
+ "ani", "bmp", "dwg", "eps", "eps2", "gif", "ico", "jpeg", "jpg", "png", "psd", "psp", "qt", "svg", "swf", "tga", "tiff", "wmf", "xcf",
+ "avi", "mov", "mpeg", "mpg",
+ "c", "class", "h", "java ", "jar", "js",
+ "bat", "chm", "cur", "dll", "exe", "hlp", "inf", "ocx", "pps", "ppt", "reg", "scr", "xls",
+ "css", "conf", "doc", "ini", "pdf", "rtf", "ttf", "txt"
+); /* Most common non html file extensions
+ * These are files that have no <title> html tag, so their link title will be $document.$ext */
+
+// Top links function features
+
+$wp_ozh_click['top_limit'] = 5;
+ /* default number of top links to be displayed by wp_ozh_click_topclicks() */
+
+$wp_ozh_click['top_pattern'] = '<li><a href="%%link_url%%" title="%%link_title%%">%%link_title_trim%%</a>: %%link_clicks%%</li>';
+ /* default pattern used to display top links
+ * Any %%tag%% where "tag" can be : link_id, link_url, link_clicks, link_date, link_title, link_title_trim (shortened, see below)
+ * Example : '%%link_title%% (%%link_url%%) = %%link_clicks%%' */
+
+$wp_ozh_click['trim'] = 15;
+ /* default maximum length of link titles
+ * When printing top links titles, trim long link titles output to XX characters (0 not to trim) */
+
+
+
+
+/*************************************
+ * DO NOT EDIT BELOW *
+ * ~~ *
+ *************************************/
+
+//**************************************************************************************************************************
+
+
+// inputs a URL, returns an integer (number of clicks for the URL)
+function wp_ozh_click_getcount2 ($wpblog, $url = "") {
+ global $wpdb, $wp_ozh_click;
+ $url = str_replace("&amp;", "&", $url);
+ $url = wp_ozh_click_getrealpath($url);
+ return $wpdb->get_var("SELECT link_clicks FROM $wp_ozh_click[table] WHERE blogID='$wpblog' AND link_url='$url'");
+}
+
+function wp_ozh_click_getcount ($url = "") {
+ global $wpblog;
+
+ if( @include_once( "Cache/Function.php" ) )
+ {
+ $cache = new Cache_Function( 'file', array('cache_dir' => ABSPATH . "/wp-content/smarty-cache", 'filename_prefix' => 'wp_ozh_click_getcount_cache_' ), 600 );
+ $count = $cache->call( "wp_ozh_click_getcount2", $wpblog, $url );
+ }
+ else
+ {
+ $count = wp_ozh_click_getcount2( $wpblog, $url );
+ }
+
+ return $count;
+}
+
+// inputs a URL, returns text
+function wp_ozh_click_getclicks ($url = '', $zeroclick = '',
+ $oneclick = '', $lotsaclicks = '' ) {
+ $result = wp_ozh_click_getcount ($url);
+ $result = wp_ozh_click_labelize ($result, $zeroclick, $oneclick, $lotsaclicks);
+ $wp_ozh_click['temp'] = "...".$url;
+ return $result;
+}
+
+// inputs a number, returns text like "<number> hits"
+function wp_ozh_click_labelize ($number = 0, $zeroclick = '',
+ $oneclick = '', $lotsaclicks = '' ) {
+ global $wp_ozh_click;
+ if (!$zeroclick) $zeroclick = $wp_ozh_click['0click'];
+ if (!$oneclick) $oneclick = $wp_ozh_click['1click'];
+ if (!$lotsaclicks) $lotsaclicks = $wp_ozh_click['clicks'];
+
+ switch ($number) :
+ case "":
+ return $zeroclick;
+ break;
+ case 1:
+ return $oneclick;
+ break;
+ default:
+ return (str_replace ("%%", $number, $lotsaclicks));
+ endswitch;
+}
+
+
+// parses string to detect and process pairs of tag="value"
+function wp_ozh_click_parse ($html="", $all=0) {
+ global $wp_ozh_click;
+
+ preg_match_all ('/[^=]{1,}="[^"]+"/', $html, $wp_ozh_click['link']);
+ foreach ($wp_ozh_click['link'][0] as $pair) {
+ list ($tag , $value) = explode ("=", $pair , 2);
+ $wp_ozh_click['link'][trim($tag)]=trim($value, '"');
+ }
+ unset ($wp_ozh_click['link'][0]);
+
+ $wp_ozh_click['modify_href'] = 0;
+ // do we want to display clicks ?
+ if ( !isset($wp_ozh_click['link']['count']) || $wp_ozh_click['link']['count'] != "0" ) {
+ if (
+ ( ($all == 1) && (eregi("^[a-z]+://", $wp_ozh_click['link']['href'])) )
+ ||
+ ( isset($wp_ozh_click['link']['count'] ) )
+ ) {
+ $wp_ozh_click['modify_href'] = 1;
+ }
+ }
+
+ if ($wp_ozh_click['modify_href']) {
+ if ( (!isset($wp_ozh_click['link']['count']) && $wp_ozh_click['track_all_links'] && $wp_ozh_click['in_title'] ) || ( $wp_ozh_click['in_title'] && $wp_ozh_click['link']['count']=="1" ) || stristr($wp_ozh_click['link']['count'],'title') ) {
+ if (isset($wp_ozh_click['link']['title'])) {
+ $wp_ozh_click['link']['title']= $wp_ozh_click['link']['title'] . " (" . wp_ozh_click_getclicks($wp_ozh_click['link']['href']) . ")";
+ } else {
+ $wp_ozh_click['link']['title']= "(" . wp_ozh_click_getclicks($wp_ozh_click['link']['href']) . ")";
+ }
+ }
+ if ( (!isset($wp_ozh_click['link']['count']) && $wp_ozh_click['track_all_links'] && $wp_ozh_click['in_plain'] ) || ( $wp_ozh_click['in_plain'] && $wp_ozh_click['link']['count']=="1" ) || stristr($wp_ozh_click['link']['count'],'inline') ) {
+ $wp_ozh_click['after'] = ' <span class="hitcounter">(' . wp_ozh_click_getclicks($wp_ozh_click['link']['href']) . ')</span>' ;
+ }
+
+ switch ($wp_ozh_click['method']) :
+ case 1 :
+ $wp_ozh_click['link']['onclick'] = "window.location='". $wp_ozh_click['file'] . "?" . $wp_ozh_click['link']['href'] . "'; return false";
+ break;
+ case 2 :
+ $wp_ozh_click['link']['href'] = $wp_ozh_click['file'] . "?" . $wp_ozh_click['link']['href'] ;
+ break;
+ case 3 :
+ $wp_ozh_click['link']['onmouseover']="javascript:window.status='". $wp_ozh_click['link']['href'] ."'; return true;" ;
+ $wp_ozh_click['link']['onmouseout']="javascript:window.status=''; return true;" ;
+ $wp_ozh_click['link']['href'] = $wp_ozh_click['file'] . "?" . $wp_ozh_click['link']['href'] ;
+ endswitch;
+
+
+ unset ($wp_ozh_click['link']['count']);
+ }
+
+ $html='';
+ foreach ($wp_ozh_click['link'] as $key => $value) {
+ $html .= $key . "=\"" . $value . "\" ";
+ }
+ $html=trim($html);
+ return '<a '. $html .'>';
+}
+
+// convert relative path ("/blog/dir/file" or "dir/this/file") into absolute (from blog's index.php)
+function wp_ozh_click_getrealpath ($url = "") {
+ $url = preg_replace ("/#.*$/",'',$url);
+
+ if (!eregi("^[a-z]+://", $url)) {
+ if (eregi("^/", $url)) {
+ $url = 'http://' . $_SERVER['HTTP_HOST'] . $url;
+ } else {
+ $url = get_settings('siteurl') . '/' . $url;
+ }
+ }
+ return $url;
+}
+
+
+// increments field link_click for a given URL
+function wp_ozh_click_increment ($url="") {
+ global $wpdb, $wp_ozh_click, $wpblog;
+ $url = wp_ozh_click_getrealpath($url);
+
+ // if (!get_magic_quotes_gpc()) {$url = add_magic_quotes($url);}
+
+ $result = $wpdb->get_var("SELECT link_clicks FROM $wp_ozh_click[table] WHERE blogID='$wpblog' AND link_url='$url'");
+
+ if ($result) {
+ $todo = 'link_clicks=(link_clicks + 1)';
+ if (($wp_ozh_click['get_title_forcerefresh']) && (($result % $wp_ozh_click['get_title_forcerefresh']) == 0)) {
+ $link_title=wp_ozh_click_gettitle($url);
+ if ($link_title) {
+ $todo .= ", link_title='$link_title'";
+ }
+ }
+ $return = $wpdb->query("UPDATE $wp_ozh_click[table] SET $todo WHERE blogID='$wpblog' AND link_url='$url'");
+ } else {
+ $link_date = gmdate('Y-m-d H:i:s', (time() + (get_settings('gmt_offset') * 3600)));
+ if ($wp_ozh_click['get_title']) {
+ $link_title=wp_ozh_click_gettitle($url);
+ } else {
+ $link_title='';
+ }
+ $return = $wpdb->query("INSERT INTO $wp_ozh_click[table] (blogID, link_url, link_clicks, link_date, link_title) VALUES ('$wpblog', '$url', 1, '$link_date', '$link_title')");
+ };
+ return $return;
+}
+
+
+// prints most clicked links
+function wp_ozh_click_topclicks ($limit = '', $trim = '', $pattern = '') {
+ global $wpdb, $wp_ozh_click, $wpblog;
+ if (!$limit) $limit = $wp_ozh_click['top_limit'];
+ if (!$pattern) $pattern = $wp_ozh_click['top_pattern'];
+ if (!$trim) $trim = $wp_ozh_click['trim'];
+
+ $results = $wpdb->get_results("select * from $wp_ozh_click[table] WHERE blogID='$wpblog' ORDER BY link_clicks DESC LIMIT $limit");
+ foreach ($results as $result) {
+ $html = $pattern;
+ $html = preg_replace ( "/%%link_url%%/i", $wp_ozh_click['file'] . "?" . "$result->link_url", $html);
+ $html = preg_replace ( "/%%link_clicks%%/i", wp_ozh_click_labelize($result->link_clicks), $html);
+ $html = preg_replace ( "/%%link_date%%/i", "$result->link_date", $html);
+ if (!$result->link_title) {
+ // prettyfies link_title for display : no "http://www." or trailing "/"
+ $result->link_title = preg_replace("/((ht)*f*tp:\/\/)*(www\.)*/", "", $result->link_url);
+ $result->link_title = preg_replace("/\/$/", "", $result->link_title);
+ }
+ if ($trim && (strlen($result->link_title) > $trim)) {
+ $result->link_title_trim = substr($result->link_title, 0, $trim) . '&#8230';
+ } else {
+ $result->link_title_trim = $result->link_title;
+ }
+ $html = preg_replace ( "/%%link_title_trim%%/i", "$result->link_title_trim", $html);
+ $html = preg_replace ( "/%%link_title%%/i", "$result->link_title", $html);
+ echo $html . "\n";
+ }
+}
+
+
+// prints number of links tracked
+function wp_ozh_click_linkcount ($display=1) {
+ global $wpdb, $wp_ozh_click;
+ if (!$wp_ozh_click['stats']) wp_ozh_click_getstats();
+ if ($display)
+ echo $wp_ozh_click['stats']->linkcount;
+ return $wp_ozh_click['stats']->linkcount;
+}
+
+
+// prints total number of clicks
+function wp_ozh_click_clickcount ($display=1) {
+ global $wpdb, $wp_ozh_click;
+ if (!$wp_ozh_click['stats']) wp_ozh_click_getstats();
+ if ($display)
+ echo $wp_ozh_click['stats']->clickcount;
+ return $wp_ozh_click['stats']->clickcount;
+
+}
+
+
+// retrieves various stats
+function wp_ozh_click_getstats () {
+ global $wpdb, $wp_ozh_click, $wpblog;
+ $wp_ozh_click['stats'] = $wpdb->get_row("SELECT count(*) AS linkcount, sum(link_clicks) AS clickcount FROM $wp_ozh_click[table] WHERE blogID='$wpblog'");
+ //echo $wp_ozh_click['stats']->clickcount;
+ //echo "<hr>";
+ //echo $wp_ozh_click['stats']->linkcount;
+ return $wp_ozh_click['stats'];
+}
+
+// return title of a (local or remote) webpage
+function wp_ozh_click_gettitle ($url = "") {
+ global $wp_ozh_click;
+ eregi("/([^#\?\/]+)\.([a-z0-9]+)$", $url, $file);
+ $ext = $file[2];
+ $file = $file[1];
+ $in_array = in_array($ext, $wp_ozh_click['extensions']);
+ switch ($in_array):
+ case true:
+ return "$file.$ext";
+ break;
+ case false:
+ if (function_exists('fopen')) {
+ $fp = @fopen ($url, 'r');
+ if( $fp ) {
+ while (! feof ($fp)){
+ $webpage .= fgets ($fp, 1024);
+ if (stristr($webpage, '<title>' )){
+ break;
+ }
+ }
+ if (eregi("<title>(.*)</title>", $webpage, $out)) {
+ return addslashes($out[1]);
+ } else {
+ return "";
+ }
+ } else {
+ return "$url";
+ }
+ } else {
+ return "";
+ }
+ break;
+ endswitch;
+}
+
+
+// readme & check install
+function wp_ozh_click_readme() {
+ echo '<html><head>
+ <title>Click Counter Plugin for Wordpress - By Ozh</title>
+ <link rel="stylesheet" href="../../wp-admin/wp-admin.css" type="text/css" />
+ </head>
+ <body>
+ <div id="wphead" style="height: 4.5em">
+ <h1 align="right">Click Counter Plugin - By Ozh</h1>
+ </div>
+ <div class="wrap">
+ <h2>Thanks :)</h2>
+ <p>Thank you for installing this plugin !</p>
+ <h2>About this plugin</h2>
+ <p>This plugin adds a "tracker" to links in your posts and your comments, so that when someone clicks on them, the link\'s hit counter increments. The number of hits can also be displayed in a variety of flavours. You can choose to add a hit counter to all links (default) or only to chosen links</p>
+ <h2>2 steps installation and usage "out of the box"</h2>
+ <ol><li><p>First, create a new table in your WordPress MySQL database, named wp_linkclicks, using for example PHPMyAdmin with the following query :</p>
+ <pre class="updated">
+CREATE TABLE `wp_linkclicks` (
+ `link_id` INT NOT NULL AUTO_INCREMENT ,
+ `link_url` TEXT NOT NULL ,
+ `link_clicks` INT NOT NULL ,
+ `link_date` DATETIME NOT NULL ,
+ `link_title` TEXT NOT NULL ,
+ UNIQUE (
+ `link_id`
+ )
+);</pre></li>
+ <li><p>Then put the plugin file in <strong><em>yourblog</em>/wp-content/plugins/</strong> and <strong>activate it</strong>
+ from the <a href="../../wp-admin/plugins.php">admin interface</a>.</p></li></ol>
+ <p>The plugin should now work silently without further working. Get back to blogging and posting link as usual :)</p>
+ <h2>Optional Configuration</h2>
+ <p>You will find detailed information about how to configure the plugin in its source itself:
+ the section you can configure is well commented. You can do so from within the <a href="../../wp-admin/templates.php?file=wp-content/plugins/wp_ozh_clickcounter.php">admin interface</a> as well.
+ <p>You can also find detailed information and examples of use
+ at the <a href="http://frenchfragfactory.net/ozh/">plugin\'s homepage</a>.</p>
+ <h2>Feedback & Disclaimer</h2>
+ <p>I\'d appreciate your leaving a comment on the plugin page, to suggest any improvement, bug fix, or just to say if you like the plugin or not :)
+ By the way, you\'ll find on <a href="http://frenchfragfactory.net/ozh/archives/category/wordpress/">my site</a> a few other plugins (<a href="http://frenchfragfactory.net/ozh/archives/2004/08/27/ip-to-nation-plugin/">IP to Nation plugin</a> in particular) you may find of interest.</p>
+ <p>Any resemblance between this page and a well-known admin interface is purely coincidental :-P</p>
+ </div>
+ <div id="footer"><p><a href="http://planetOzh.com/"><img src="http://frenchfragfactory.net/ozh/wp-images/btn_planetozh.png" border="0" alt="planetOzh.com" /></a><br />
+ </div>
+ </body></html>
+ ';
+}
+
+// the one that starts it all
+function wp_ozh_click_modifyhrefs ($input) {
+ $input = preg_replace_callback ("/<a ([^>]{1,})>(.+?<\/a>)/", "wp_ozh_click_do_posts", $input);
+ // ** OMFG ** I finally understood what preg_replace_callback is ! :))
+ return $input;
+}
+
+// callback function
+function wp_ozh_click_do_posts($text) {
+ global $wp_ozh_click;
+ unset ($wp_ozh_click['after']);
+
+ $before = wp_ozh_click_parse($text[1],$wp_ozh_click['track_all_links']);
+ $text = $text[2];
+ return $before.$text.$wp_ozh_click['after'];
+}
+
+function wp_ozh_click_comment_author_link() {
+ global $comment;
+ $url = apply_filters('comment_url', $comment->comment_author_url);
+ $author = apply_filters('comment_author', $comment->comment_author);
+ if (!$author) $author = 'Anonymous';
+
+ if (empty($url)) :
+ echo $author;
+ else:
+ echo wp_ozh_click_modifyhrefs("<a href=\"$url\" rel=\"external\">$author</a>");
+ endif;
+}
+
+
+// Add per-post filtering:
+if ($wp_ozh_click['do_posts'])
+ add_filter('the_content', 'wp_ozh_click_modifyhrefs');
+if ($wp_ozh_click['do_comments'])
+ add_filter('comment_text', 'wp_ozh_click_modifyhrefs');
+
+
+// And that's it.
+
+
+/* Future enhancements ?
+ - handle malformed html tags like <a href=http://site.com count=1>site</a> (no "quotes")
+*/
+
+
+/* Example post :
+ Post this in your blog and watch how modifying the script configuration affects display of counters.
+
+--8<-----8<-----[cut & paste]-
+<strong>Tests with external links : href="http://external-link.com" </strong>
+<a href="http://external-link.com" count="0">count="0"</a> never shows click count
+<a href="http://external-link.com" count="1">count="1"</a> shows click count according to defaults as set in the plugin
+<a href="http://external-link.com" count="title">count="title"</a> always shows a count in link title (mouseover)
+<a href="http://external-link.com" count="inline">count="inline"</a> always shows a count next to title in plain text
+<a href="http://external-link.com" count="inline title">count="inline title"</a> always shows both
+<a href="http://external-link.com">count not specified</a> shows or not depending on defaults as set in the plugin (tracking all links or not)
+
+<strong>Tests with internal links : href="/local_dir/file"</strong>
+<a href="/local_dir/file" count="0">count="0"</a> never shows click count
+<a href="/local_dir/file" count="1">count="1"</a> always shows click count, according to defaults
+<a href="/local_dir/file" count="title">count="title"</a> always shows click count in link title
+<a href="/local_dir/file" count="inline">count="inline"</a> always shows click count next to title in plain text
+<a href="/local_dir/file" count="inline title">count="inline title"</a> always shows both
+<a href="/local_dir/file">count not specified</a> never shows click count
+--8<-----8<-----[cut & paste]-
+
+*/
+
+?>
diff --git a/wp-inst/wp-content/plugins/wpmu-plugin.php b/wp-inst/wp-content/plugins/wpmu-plugin.php
new file mode 100644
index 0000000..c30ff7c
--- /dev/null
+++ b/wp-inst/wp-content/plugins/wpmu-plugin.php
@@ -0,0 +1,598 @@
+<?php
+/*
+ Plugin Name: WPMU Administration Console
+ Plugin URI: http://derek.ditch.name/
+ Description: Use this plugin to install new users, remove existing, and configure WPMU. <strong>Warning!</strong> This plugin is not ready for general use. It may lead to serious problems on your site if enabled!
+ Author: Derek Ditch
+ Author URI: http://derek.ditch.name
+ Version: 0.1
+ */
+
+ /* THINGS TO DO:
+ - Add option to backup database and/or templates into tarball or similar
+ - Add smarty code to insert aggregate of hosted blogs on main blog page
+
+ BUGS
+ - NONE so far! Please send me your bug reports! <derek AT ditch DOT name>
+ */
+
+if( ! function_exists('wpmu_admin_run') ){
+ function wpmu_admin_run() {
+ add_options_page( __('WPMU Administration'), __('WPMU'), 10, ABSPATH.'wp-content/plugins/wpmu-plugin.php');
+ }
+ }
+
+ if ( is_plugin_page() ){
+
+ function setPasswd($login){
+ global $table_prefix;
+
+ // Connect to the db
+ $link = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD);
+ mysql_select_db(DB_NAME);
+
+ $random_password = substr(md5(uniqid(microtime())), 0, 6);
+ mysql_query("UPDATE {$table_prefix}users SET user_pass=MD5('$random_password') WHERE ID='1'");
+
+ return $random_password;
+ }
+
+ function emailNewUser($password){
+ global $email, $login, $base;
+
+ $from = 'From: WPMU Admin <wordpress@'.$_SERVER['HTTP_HOST'].'>';
+ $message_headers = "$from";
+
+ mail($email, '
+ New WordPress Blog', "Your new WordPress blog has been successfully set up at:
+
+ http://{$_SERVER['HTTP_HOST']}{$base}{$login}/
+
+ You can log in to your account with the following information:
+
+ Username: $login
+ Password: $password
+
+ We hope you enjoy your new weblog. Thanks!
+
+ --The WordPress Team
+ http://wordpress.org/
+ ", $message_headers);
+ }
+
+ function emailNewPass($password, $email, $login){
+
+ $from = 'From: WPMU Admin <wordpress@'.$_SERVER['HTTP_HOST'].'>';
+ $message_headers = "$from";
+
+ mail($email, 'New WordPress Password', "
+ Your WordPress has been reset. If you do not think this should be happening,
+ please contact your site admin for further info.:
+
+ You can log in to your account with the following information:
+
+ Username: $login
+ Password: $password
+
+ Happy blogging. Thanks!
+
+ --The WordPress Team
+ http://wordpress.org/
+ ", $message_headers);
+
+ }
+
+ function &getUserInfo($blog){
+
+ global $wpmuBaseTablePrefix, $wpdb;
+
+ return $wpdb->get_row("SELECT CONCAT(user_lastname, ', ', user_firstname) as name, user_email, user_url FROM {$wpmuBaseTablePrefix}{$blog}_users WHERE ID='1' ");
+ }
+
+ function getSchema(){
+ global $login;
+
+ // Load the schema
+ $queries = file(ABSPATH.'wp-admin/upgrade-schema.php');
+ $queries = str_replace('$wpdb->', $login . '_', $queries);
+ $queries = implode('', $queries);
+ preg_match('/\"(.*?)\"/s', $queries, $matches);
+
+ $queries = $matches[1];
+
+ // Taken from upgrade-functions.php
+ // Seperate individual queries into an array
+ if( !is_array($queries) ) {
+ $queries = explode( ';', $queries );
+ if('' == $queries[count($queries) - 1]) array_pop($queries);
+ }
+
+ $cqueries = array(); // Creation Queries
+ $iqueries = array(); // Insertion Queries
+ $for_update = array();
+ // Create a tablename index for an array ($cqueries) of queries
+
+ foreach($queries as $qry) {
+ if(preg_match("|CREATE TABLE ([^ ]*)|", $qry, $matches)) {
+ $cqueries[strtolower(str_replace('PREFIX', '', $matches[1]))] = $qry;
+ $for_update[$matches[1]] = 'Created table '.$matches[1];
+ }
+ else if(preg_match("|CREATE DATABASE ([^ ]*)|", $qry, $matches)) {
+ array_unshift($cqueries, $qry);
+ }
+ else if(preg_match("|INSERT INTO ([^ ]*)|", $qry, $matches)) {
+ $iqueries[] = $qry;
+ }
+ else if(preg_match("|UPDATE ([^ ]*)|", $qry, $matches)) {
+ $iqueries[] = $qry;
+ }
+ else {
+ // Unrecognized query type
+ }
+ }
+
+ return array($cqueries, $iqueries, $for_update);
+ }
+
+ // Expects array of queries ready to be executed.
+ function installdb($queries){
+
+ // Connect to the db
+ $link = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD);
+ mysql_select_db(DB_NAME);
+
+ // Process each query.
+ foreach($queries as $query){
+ mysql_query($query);
+ }
+
+ mysql_close($link);
+ }
+
+ function deletedb($login){
+
+ global $table_prefix;
+
+ $delete_tables = array();
+
+ // Connect to the db
+ $link = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD);
+
+ $tables = mysql_list_tables(DB_NAME);
+ for ($i = 0; $i < mysql_num_rows($tables); $i++) {
+ if ((substr($tablename = mysql_tablename($tables,$i),0,strlen($table_prefix))==$table_prefix)) {
+ $delete_tables[] = $tablename;
+ }
+ }
+
+ mysql_free_result($tables);
+
+ foreach($delete_tables as $tablename){
+ mysql_query("DROP TABLE $tablename");
+ }
+ }
+
+ function dboptions(){
+ global $login, $base, $firstname, $lastname, $email, $table_prefix;
+ $name = '';
+ $value = '';
+ $description = '';
+
+ $qry = "INSERT INTO {$table_prefix}options (option_name, option_value, option_description) VALUES ('{&$name}', '{&$value}', '{&$description}')";
+
+ // Load the schema
+ $queries = file(ABSPATH.'wp-admin/upgrade-schema.php');
+ $queries = str_replace('$wpdb->', $login . '_', $queries);
+ $queries = implode('', $queries);
+
+ // Connect to the db
+ $link = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD);
+ mysql_select_db(DB_NAME);
+
+ $result = mysql_query("SELECT * FROM derek_users");
+
+ // Catch all add_option usage
+ preg_match_all('/add_option\((.*?)\)\;/', $queries, $matches);
+ foreach($matches[1] as $match){
+
+ list($name, $value, $description) = explode(',', $match);
+ $name = trim($name, " '");
+ $value = trim($value, " '");
+ $description = trim($description, " '");
+ $qry = "INSERT INTO PREFIXoptions (option_name, option_value, option_description) VALUES ('$name', '$value', '$description')";
+ $qry = str_replace('PREFIX', addslashes($login) . '_', $qry);
+
+ // Shouldn't be any result set since these are all INSERT queries.
+ mysql_query($qry);
+ } // foreach
+
+ // Need to update fileupload_realpath, fileupload_url, siteurl
+ // These values are not parsed correctly from schema because they utilize variables
+ $guessurl = 'http://' . $_SERVER['HTTP_HOST'] . $base . $login . '/';
+ mysql_query("UPDATE ". addslashes($login) ."_options SET option_value='" . ABSPATH . "wp-content/blogs/$login/images/' WHERE option_name='fileupload_realpath'");
+ mysql_query("UPDATE ". addslashes($login) ."_options SET option_value='{$guessurl}wp-content/blogs/$login/images/' WHERE option_name='fileupload_url'");
+ mysql_query("UPDATE ". addslashes($login) ."_options SET option_value='$guessurl', option_description='WordPress web address' WHERE option_name='siteurl'");
+ mysql_query("UPDATE ". addslashes($login) ."_options SET option_value='a:0:{}' WHERE option_name='active_plugins'");
+
+ // Need to add user information (login, pass, real name, e-mail, homepage) to db.
+ mysql_query("INSERT INTO {$login}_users (ID, user_login, user_nickname, user_email, user_level, user_idmode, user_firstname, user_lastname, user_url) VALUES ( '1', '$login', 'Administrator', '$email', '10', 'nickname', '$firstname', '$lastname', '$guessurl')");
+
+ // Set up a few options not to load by default
+ $fatoptions = array( 'moderation_keys', 'recently_edited' );
+ foreach ($fatoptions as $fatoption) :
+ mysql_query("UPDATE {$login}_options SET `autoload` = 'no' WHERE option_name = '$fatoption'");
+ endforeach;
+
+ // Need to add some default information
+ $now = date('Y-m-d H:i:s');
+ $now_gmt = gmdate('Y-m-d H:i:s');
+ mysql_query("INSERT INTO ". addslashes($login) . "_categories (cat_ID, cat_name) VALUES ('0', 'Uncategorized')");
+ mysql_query("INSERT INTO ". addslashes($login) . "_posts (post_author, post_date, post_date_gmt, post_content, post_title, post_category, post_modified, post_modified_gmt) VALUES ('1', '$now', '$now_gmt', 'Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!', 'Hello world!', '0', '$now', '$now_gmt')");
+ mysql_query("INSERT INTO ". addslashes($login) . "_post2cat (`rel_id`, `post_id`, `category_id`) VALUES (1, 1, 1)");
+ mysql_query("INSERT INTO ". addslashes($login) . "_comments (comment_post_ID, comment_author, comment_author_email, comment_author_url, comment_author_IP, comment_date, comment_date_gmt, comment_content) VALUES ('1', 'Mr WordPress', 'mr@wordpress.org', 'http://wordpress.org', '127.0.0.1', '$now', '$now_gmt', 'Hi, this is a comment.<br />To delete a comment, just log in, and view the posts\' comments, there you will have the option to edit or delete them.')");
+ mysql_query("INSERT INTO ". addslashes($login) . "_linkcategories (cat_id, cat_name) VALUES (1, 'Blogroll')");
+
+ // Links
+ mysql_query("INSERT INTO ". addslashes($login) . "_links (link_url, link_name, link_category) VALUES ('http://photomatt.net/', 'Matt', 1);");
+ mysql_query("INSERT INTO ". addslashes($login) . "_links (link_url, link_name, link_category) VALUES ('http://blog.carthik.net/index.php', 'Carthik', 1);");
+ mysql_query("INSERT INTO ". addslashes($login) . "_links (link_url, link_name, link_category) VALUES ('http://zengun.org/weblog/', 'Michel', 1);");
+ mysql_query("INSERT INTO ". addslashes($login) . "_links (link_url, link_name, link_category) VALUES ('http://zed1.com/journalized/', 'Mike', 1);");
+ mysql_query("INSERT INTO ". addslashes($login) . "_links (link_url, link_name, link_category) VALUES ('http://dougal.gunters.org/', 'Dougal', 1);");
+ mysql_query("INSERT INTO ". addslashes($login) . "_links (link_url, link_name, link_category) VALUES ('http://blogs.linux.ie/xeer/', 'Donncha', 1);");
+ mysql_query("INSERT INTO ". addslashes($login) . "_links (link_url, link_name, link_category) VALUES ('http://derek.ditch.name', 'Derek', 1);");
+ mysql_query("INSERT INTO ". addslashes($login) . "_links (link_url, link_name, link_category) VALUES ('http://www.alexking.org/', 'Alex', 1);");
+ mysql_query("INSERT INTO ". addslashes($login) . "_links (link_url, link_name, link_category) VALUES ('http://mu.wordpress.org', 'WPMU', 1);");
+ mysql_query("INSERT INTO ". addslashes($login) . "_links (link_url, link_name, link_category) VALUES ('http://wordpress.org', 'Wordpress', 1);");
+
+
+ mysql_close($link);
+ }
+
+ // Taken from Aidan Lister <aidan@php.net> http://aidan.dotgeek.org/lib/?file=function.copyr.php
+ function copyr($source, $dest){
+
+ // Simple copy for a file
+ if (is_file($source)) {
+ return copy($source, $dest);
+ }
+
+ // Make destination directory
+ if (!is_dir($dest)) {
+ mkdir($dest);
+ }
+
+ // Loop through the folder
+ $dir = dir($source);
+ while (false !== $entry = $dir->read()) {
+ // Skip pointers
+ if ($entry == '.' || $entry == '..') {
+ continue;
+ }
+
+ // Deep copy directories
+ if ($dest !== "$source/$entry") {
+ copyr("$source/$entry", "$dest/$entry");
+ }
+ }
+
+ // Clean up
+ $dir->close();
+ return true;
+ }
+
+ // Taken from Aidan Lister <aidan@php.net> http://aidan.dotgeek.org/lib/?file=function.rmdirr.php
+ function rmdirr($dirname)
+ {
+ // Sanity check
+ if (!file_exists($dirname)) {
+ return false;
+ }
+
+ // Simple delete for a file
+ if (is_file($dirname)) {
+ return unlink($dirname);
+ }
+
+ // Loop through the folder
+ $dir = dir($dirname);
+ while (false !== $entry = $dir->read()) {
+ // Skip pointers
+ if ($entry == '.' || $entry == '..') {
+ continue;
+ }
+
+ // Recurse
+ rmdirr("$dirname/$entry");
+ }
+
+ // Clean up
+ $dir->close();
+ return rmdir($dirname);
+ }
+
+ function setup($login){
+ global $base;
+ list($cqueries, $iqueries, $updates) = getSchema();
+
+ foreach($cqueries as $key => $qry){
+ $cqueries[$key] = str_replace('PREFIX', $install_prefix, $qry);
+ }
+
+ // Create the blog dir
+ mkdir( ABSPATH . 'wp-content/blogs/' . $login, 0777);
+ mkdir( ABSPATH . 'wp-content/blogs/' . $login . '/images', 0777);
+ mkdir( ABSPATH . 'wp-content/blogs/' . $login . '/templates', 0777);
+ mkdir( ABSPATH . 'wp-content/blogs/' . $login . '/templates_c', 0777);
+ mkdir( ABSPATH . 'wp-content/blogs/' . $login . '/smartycache', 0777);
+
+ copyr(ABSPATH . 'wp-content/sitetemplates/humancondition/templates' , ABSPATH . 'wp-content/blogs/' . $login . '/templates');
+
+ // Modify template files with correct paths
+ $cssfile = file_get_contents(ABSPATH . 'wp-content/blogs/' . $login . '/templates/wp-layout.css');
+ $cssfile = str_replace('BASE', $base, $cssfile);
+
+ $fh = fopen(ABSPATH . 'wp-content/blogs/' . $login . '/templates/wp-layout.css', w);
+ fwrite($fh, $cssfile);
+ fclose($fh);
+
+ // Get the DB pristine
+ installdb($cqueries);
+ dboptions();
+ $password = setPasswd($login);
+
+ // Notify him/her that his/her blog is ready
+ emailNewUser($password);
+ }
+
+
+ /* ############ PAGE ENTRY STARTS HERE ##############*/
+
+ // Set all vars from POST or GET
+ $wpvarstoreset = array('action', 'login', 'firstname', 'lastname', 'email');
+ for($i=0; $i<count($wpvarstoreset); $i += 1){
+ $wpvar = $wpvarstoreset[$i];
+ if(! isset($$wpvar)){
+ if( empty( $_POST["$wpvar"])){
+ if(empty($_GET["$wpvar"])){
+ $$wpvar = '';
+ } else {
+ $$wpvar = $_GET["$wpvar"];
+ } // GET
+ } else {
+ $$wpvar = $_POST["$wpvar"];
+ } // POST
+ }
+ } // for
+
+ if( 'main' != $wpblog ){
+ // Give error message. This blog isn't authorized to modify the whole site.
+ print('<div class="wrap"><p align="center"><font color="red">Error: </font> This site is not authorized to access this page. Please contact your site administrator if you need assistance.</p></div>');
+ include('admin-footer.php');
+ exit;
+ }
+
+ /*
+ switch($action){
+
+ case 'options':
+ // Update the disk space allowed
+ wpmu_adminOptionSet('wpmu_space_allocated',$option['wpmu_space_allocated']);
+
+ do_action('wpmu_options_admin_set',array('option'=>&$option));
+
+ break;
+
+ case 'add':
+ // Perform some simple input validation.
+ if( $login == ''){
+ die(__('<div class="wrap"><p align="center"><font color=red>Error: </font> Please enter a login.</p></div>'));
+ } elseif ( $email == '' || ! preg_match('/^.+@.+\..{2,4}$/', $email) ){
+ die(__('<div class="wrap"><p align="center"><font color=red>Error: </font> Please enter a valid e-mail address.</p></div>'));
+ }
+
+ $current_users = wpmu_getBlogs();
+ foreach($current_users as $user){
+ if($login == $user)
+ die(__('<div class="wrap"><p align="center"><font color=red>Error: </font> Username already exists. Please select a new unique value</p></div>'));
+ }
+
+ setup($login);
+
+ break;
+
+ case 'delete':
+ if( $login == ''){
+ die(__('<div class="wrap"><p align="center"><font color=red>Error: </font> Something didn\'t work correctly. Please use the delete button.</p></div>'));
+ }
+
+ // Pure irreversible destruction. Do not try this at home, we are professionals
+ deletedb($login);
+ rmdirr(ABSPATH . '/wp-content/blogs/' . $login);
+ break;
+
+ case 'resetpw':
+ if( $login == ''){
+ die(__('<div class="wrap"><p align="center"><font color=red>Error: </font> Something didn\'t work correctly. Please use the reset password button.</p></div>'));
+ }
+
+ // Get user info
+ list($name, $email, $URI) = getUserInfo($login);
+
+ emailNewPass(setPasswd($login), $email, $login);
+ break;
+
+ default:
+ break;
+ }
+ */
+
+ $dirs = wpmu_getBlogs();
+ $spaceAllowed = wpmu_adminOption_get("wpmu_space_allocated", (1024 * 1024));
+
+ ?>
+ <!-- commented out html because plugin has not be sufficiently tested -->
+ <div class="wrap">
+ <p>The WPMU admin plugin is temporarily disabled.</p>
+ </div>
+ <!--
+ <div class="wrap">
+ <h2><?php _e('Blogs') ?></h2>
+ <table cellpadding="3" cellspacing="3" width="100%">
+ <tr>
+ <th><?php _e('Name') ?></th>
+ <th><?php _e('E-mail') ?></th>
+ <th><?php _e('Website') ?></th>
+ <th><?php _e('Login') ?></th>
+ <th><?php _e('Password') ?></th>
+ <th>&nbsp;</th>
+ </tr>
+ <tr>
+ </tr>
+ <?php foreach($dirs as $blog):
+ $thisBlog =& getUserInfo($blog);
+ ?>
+ <tr class="alternate">
+ <td><?php echo $thisBlog->name; ?></td>
+ <td><?php echo $thisBlog->user_email; ?></td>
+ <td><a href="<?php echo $thisBlog->user_url; ?>"><?php echo $thisBlog->user_url; ?></a></td>
+ <td style="text-align:center;"><?php echo $blog; ?></td>
+ <td><?php if('main' !== $blog): ?><a href="<?php echo get_settings('siteurl'); ?>/wp-admin/admin.php?page=wpmu-plugin.php&action=resetpw&login=<?php echo $blog; ?>" class="delete" onclick="return confirm('Are you sure you wish to reset this password? This cannot be undone.')">Reset</a><?php endif; ?></td>
+ <td><?php if('main' !== $blog): ?><a href="<?php echo get_settings('siteurl'); ?>/wp-admin/admin.php?page=wpmu-plugin.php&action=delete&login=<?php echo $blog; ?>" class="delete" onclick="return confirm('Are you sure you wish to delete this site? This cannot be undone and all data will be lost.')">Delete</a><?php endif; ?></td>
+ <tr>
+ <?php endforeach; ?>
+
+ </table>
+ </div>
+
+ <div class="wrap">
+ <h2>
+ <?php
+ _e('Options');
+ $options = array(
+ 0=>array(
+ 'caption'=>'Disk Space (bytes)',
+ 'name'=>'wpmu_space_allocated',
+ 'value'=>$spaceAllowed,
+ 'type'=>'text'
+ ),
+/* 1=>array(
+ 'caption'=>'Plugins Enabled',
+ 'name'=>'all_user_plugins',
+ 'value'=>'none',
+ 'type'=>'text'
+ )
+*/ );
+ do_action('wpmu_options_admin_get', array('options'=>&$options));
+ ?>
+ </h2>
+ <form name="form1" method="post" action="<?php echo get_settings('siteurl'); ?>/wp-admin/admin.php?page=wpmu-plugin.php">
+ <table class="editform" width="100%" cellspacing="2" cellpadding="5">
+ <tr>
+ <input name="action" type="hidden" id="action" value="options" />
+ </tr>
+ <?php
+ foreach ($options as $thisOption) {
+ switch ($thisOption['type']) {
+ case 'text':
+ ?>
+ <tr>
+ <th scope="row" width="33%"><?php _e($thisOption['caption']) ?></th>
+ <td width="66%"><input name="option[<?php echo $thisOption['name']; ?>]" type="<?php echo $thisOption['type']; ?>" id="option[<?php echo $thisOption['name']; ?>]" value="<?php echo $thisOption['value']; ?>"/></td>
+ </tr>
+ <?php
+ break;
+
+ case 'checkbox':
+ if (is_array($thisOption['value'])) {
+ ?>
+ <tr>
+ <td align="right"><b><?php _e('Plugins') ?></b></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>
+ <table class="editform" width="100%">
+ <tr>
+ <td width="33%"><b><?php _e('Plugin Name');?></b></td><td width="66%"><b><?php _e('Active');?></b></td>
+ </tr>
+ <?php
+ foreach ($thisOption['value'] as $filename => $thisItem) {
+ ?>
+ <tr>
+ <td><?php echo $thisItem['Name'] ?></td>
+ <td align="center"><input name="option[<?php echo $thisOption['name']; ?>][<?php echo $filename; ?>]" type="checkbox" id="option[<?php echo $thisOption['name']; ?>][<?php echo $thisOption['name']; ?>]" value="1" <?php checked('1', $thisItem['enabled']) ?> /></td>
+ </tr>
+ <?php
+ }
+ ?>
+ </table>
+ </td>
+ </tr>
+ <?php
+ } else {
+ ?>
+ <tr>
+ <th scope="row" width="33%"><?php _e($thisOption['caption']) ?></th>
+ <td width="66%"><input name="option[<?php echo $thisOption['name']; ?>]" type="<?php echo $thisOption['type']; ?>" id="option[<?php echo $thisOption['name']; ?>]" value="1"/></td>
+ </tr>
+ <?php
+ }
+ break;
+ }
+ }
+ ?>
+ </table>
+ <p class="submit">
+ <input name="options" type="submit" id="options" value="<?php _e('Update') ?> &raquo;" />
+ </p>
+ </form>
+ </div>
+ -->
+
+ <?php /*
+ <!--
+
+ <div class="wrap">
+ <h2><?php _e('Add New Blog') ?></h2>
+ <form name="form1" method="post" action="<?php echo get_settings('siteurl'); ?>/wp-admin/admin.php?page=wpmu-plugin.php">
+ <table class="editform" width="100%" cellspacing="2" cellpadding="5">
+ <tr>
+ <th scope="row" width="33%"><?php _e('Nickname') ?>
+ <input name="action" type="hidden" id="action" value="add" /></th>
+ <td width="66%"><input name="login" type="text" id="user_login" /></td>
+ </tr>
+ <tr>
+ <th scope="row"><?php _e('First Name') ?> </th>
+ <td><input name="firstname" type="text" id="firstname" /></td>
+ </tr>
+ <tr>
+ <th scope="row"><?php _e('Last Name') ?> </th>
+ <td><input name="lastname" type="text" id="lastname" /></td>
+ </tr>
+ <tr>
+ <th scope="row"><?php _e('E-mail') ?></th>
+ <td><input name="email" type="text" id="email" /></td>
+ </tr>
+ </table>
+ <p class="submit">
+ <input name="add" type="submit" id="add" value="<?php _e('Add') ?> &raquo;" />
+ </p>
+ </form>
+ </div>
+ -->
+ */
+ ?>
+
+
+ <?php
+
+ // if (is_plugin_page())
+ } else {
+ if('main' == $wpblog){
+ add_action('admin_menu', 'wpmu_admin_run');
+ }
+
+ } // else
+
+?>
diff --git a/wp-inst/wp-content/sitetemplates/humancondition/img/bg.gif b/wp-inst/wp-content/sitetemplates/humancondition/img/bg.gif
new file mode 100644
index 0000000..c54c3d6
--- /dev/null
+++ b/wp-inst/wp-content/sitetemplates/humancondition/img/bg.gif
Binary files differ
diff --git a/wp-inst/wp-content/sitetemplates/humancondition/img/bullet.gif b/wp-inst/wp-content/sitetemplates/humancondition/img/bullet.gif
new file mode 100644
index 0000000..e22be35
--- /dev/null
+++ b/wp-inst/wp-content/sitetemplates/humancondition/img/bullet.gif
Binary files differ
diff --git a/wp-inst/wp-content/sitetemplates/humancondition/img/date.gif b/wp-inst/wp-content/sitetemplates/humancondition/img/date.gif
new file mode 100644
index 0000000..315ea86
--- /dev/null
+++ b/wp-inst/wp-content/sitetemplates/humancondition/img/date.gif
Binary files differ
diff --git a/wp-inst/wp-content/sitetemplates/humancondition/img/fg.gif b/wp-inst/wp-content/sitetemplates/humancondition/img/fg.gif
new file mode 100644
index 0000000..8f3f7f1
--- /dev/null
+++ b/wp-inst/wp-content/sitetemplates/humancondition/img/fg.gif
Binary files differ
diff --git a/wp-inst/wp-content/sitetemplates/humancondition/img/footer.gif b/wp-inst/wp-content/sitetemplates/humancondition/img/footer.gif
new file mode 100644
index 0000000..5148dbe
--- /dev/null
+++ b/wp-inst/wp-content/sitetemplates/humancondition/img/footer.gif
Binary files differ
diff --git a/wp-inst/wp-content/sitetemplates/humancondition/img/header.gif b/wp-inst/wp-content/sitetemplates/humancondition/img/header.gif
new file mode 100644
index 0000000..eb9add4
--- /dev/null
+++ b/wp-inst/wp-content/sitetemplates/humancondition/img/header.gif
Binary files differ
diff --git a/wp-inst/wp-content/sitetemplates/humancondition/img/posts.gif b/wp-inst/wp-content/sitetemplates/humancondition/img/posts.gif
new file mode 100644
index 0000000..d1d9efd
--- /dev/null
+++ b/wp-inst/wp-content/sitetemplates/humancondition/img/posts.gif
Binary files differ
diff --git a/wp-inst/wp-content/sitetemplates/humancondition/img/today.gif b/wp-inst/wp-content/sitetemplates/humancondition/img/today.gif
new file mode 100644
index 0000000..c48e391
--- /dev/null
+++ b/wp-inst/wp-content/sitetemplates/humancondition/img/today.gif
Binary files differ
diff --git a/wp-inst/wp-content/sitetemplates/humancondition/index.php b/wp-inst/wp-content/sitetemplates/humancondition/index.php
new file mode 100644
index 0000000..fac9dcd
--- /dev/null
+++ b/wp-inst/wp-content/sitetemplates/humancondition/index.php
@@ -0,0 +1,10 @@
+<?php
+
+/* $Id: index.php,v 1.1.1.1 2004/10/14 12:07:23 donncha Exp $ */
+
+$author = "Ian Main";
+$title = "Human Condition";
+$when = "2004";
+$url = "http://www.e-lusion.com/";
+$description = "Runner up of a WP <a href='http://www.alexking.org/index.php?content=software/wordpress/styles.php'>style competition</a> held by Alex King.";
+?>
diff --git a/wp-inst/wp-content/sitetemplates/humancondition/screenshot-sm.gif b/wp-inst/wp-content/sitetemplates/humancondition/screenshot-sm.gif
new file mode 100644
index 0000000..e146d6b
--- /dev/null
+++ b/wp-inst/wp-content/sitetemplates/humancondition/screenshot-sm.gif
Binary files differ
diff --git a/wp-inst/wp-content/sitetemplates/humancondition/screenshot.gif b/wp-inst/wp-content/sitetemplates/humancondition/screenshot.gif
new file mode 100644
index 0000000..329bff9
--- /dev/null
+++ b/wp-inst/wp-content/sitetemplates/humancondition/screenshot.gif
Binary files differ
diff --git a/wp-inst/wp-content/sitetemplates/humancondition/templates/comments.html b/wp-inst/wp-content/sitetemplates/humancondition/templates/comments.html
new file mode 100644
index 0000000..06b10bc
--- /dev/null
+++ b/wp-inst/wp-content/sitetemplates/humancondition/templates/comments.html
@@ -0,0 +1,57 @@
+<h2 id="comments">{comments_number zero="Comments" one="1 Comment" more="% Comments"}
+{if $post->comment_status == 'open'}
+<a href="#postcomment" title="{_e text="Leave a comment";}">&raquo;</a>
+{/if}
+</h2>
+{if $post->ping_status}
+<p>{_e text='The <acronym title="Uniform Resource Identifier">URI</acronym> to TrackBack this entry is:'} <em>{trackback_url}</em></p>
+{/if}
+{if $comments != ''}
+ <ol id="commentlist">
+ {foreach from=$comments key=key item=comment}
+ {globalvar var='comment' value=$comment}
+ <li id="comment-{comment_ID}">
+ {comment_text}
+ <p><cite>{comment_type} {_e text="by"} {comment_author_link} &#8212; {comment_date} @ <a href="#comment-{comment_ID}">{comment_time}</a></cite> {edit_comment_link link='Edit This' before=' |'}</p>
+ </li>
+ {/foreach}
+ </ol>
+{else} <!-- this is displayed if there are no comments so far -->
+ <p>{_e text="No comments yet."}</p>
+{/if}
+<p>{comments_rss_link link_text='<abbr title="Really Simple Syndication">RSS</abbr> feed for comments on this post.'}</p>
+<h2 id="postcomment">{_e text="Leave a comment"}</h2>
+{if 'open' == $post->comment_status}
+<p>{_e text="Line and paragraph breaks automatic, e-mail address never displayed, <acronym title='Hypertext Markup Language'>HTML</acronym> allowed:"} <code>{allowed_tags}</code></p>
+
+<form action="{$siteurl}/wp-comments-post.php" method="post" id="commentform">
+ <p>
+ <input type="text" name="author" id="author" class="textarea" value="{insert name=var var=comment_author}" size="28" tabindex="1" />
+ <label for="author">{_e text="Name"}</label> {if $req != ''} {_e text='(required)'} {/if}
+ <input type="hidden" name="comment_post_ID" value="{$post->ID}" />
+ <input type="hidden" name="redirect_to" value="{$redirect_to}" />
+ </p>
+
+ <p>
+ <input type="text" name="email" id="email" value="{insert name=var var=comment_author_email}" size="28" tabindex="2" />
+ <label for="email">{_e text="E-mail"}</label> {if $req != ''} {_e text='(required)'}{/if}
+ </p>
+
+ <p>
+ <input type="text" name="url" id="url" value="{insert name=var var=comment_author_url}" size="28" tabindex="3" />
+ <label for="url">{_e text="<acronym title='Uniform Resource Identifier'>URI</acronym>"}</label>
+ </p>
+
+ <p>
+ <label for="comment">{_e text="Your Comment"}</label>
+ <br />
+ <textarea name="comment" id="comment" cols="60" rows="4" tabindex="4"></textarea>
+ </p>
+
+ <p>
+ <input name="submit" type="submit" tabindex="5" value="{_e text="Say It!"}" />
+ </p>
+</form>
+{else} <!-- comments are closed -->
+<p>{_e text="Sorry, the comment form is closed at this time."}</p>
+{/if}
diff --git a/wp-inst/wp-content/sitetemplates/humancondition/templates/index.html b/wp-inst/wp-content/sitetemplates/humancondition/templates/index.html
new file mode 100644
index 0000000..8e0f633
--- /dev/null
+++ b/wp-inst/wp-content/sitetemplates/humancondition/templates/index.html
@@ -0,0 +1,127 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head>
+<title>{bloginfo show='name'} {single_post_title prefix=' :: '}{single_cat_title prefix=' :: '}{single_month_title prefix=' :: '}</title>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+<meta http-equiv="imagetoolbar" content="no">
+<meta content="TRUE" name="MSSmartTagsPreventParsing">
+<meta name="generator" content="WordPressMU, WP {$wp_version}"><!-- leave this for stats -->
+<style type="text/css" media="screen">
+@import url( "{$siteurl}/templates/wp-layout.css" );
+</style>
+<link rel="alternate" type="text/xml" title="RDF" href="{bloginfo show='rdf_url'}">
+<link rel="alternate" type="text/xml" title="RSS" href="{bloginfo show='rss2_url'}">
+<link rel="pingback" href="{bloginfo show='pingback_url'}"></head>
+</head>
+<body>
+{comments_popup_script}
+<div id="rap">
+<h1 id="header"><a href="{$siteurl}" title="{bloginfo show='name'}">{bloginfo show='name'}</a></h1>
+<div id="content">
+{$content}
+<br /><br />
+<blockquote><div class='STORYCONTENT' align='middle'>{posts_nav_link}</div></blockquote>
+<br>
+{referer}
+{if $refererlinks != ""}
+<blockquote>
+Referers in the last 24 hours:
+<ol>
+{foreach from=$refererlinks item=link}
+<li> <a href="{$link.referingURL}">{$link.baseDomain}</a> ({$link.visitTimes})
+{/foreach}
+</ol>
+</blockquote>
+{/if}
+<br><br><br><br><br><br><br>
+<br><br><br><br><br><br><br>
+<br><br><br><br><br><br><br>
+</div>
+<div id="menu">
+ <ul>
+ <li><a href="{$siteurl}">Home</a></li>
+ <li>Links:
+ <ul>
+ {get_links category='-1' before='<li>' after='</li>' between='' show_images='0' orderby='_updated' show_description='0' show_rating='0' limit='-1' show_updated='-1'}
+ </ul>
+ </li>
+ <li>Categories:
+ <ul>
+ {list_cats optionall='0' all='All' sort_column='name'}
+ </ul>
+ </li>
+ <li>Search: <form id="searchform" method="get" action="{$Smarty.server.PHP_SELF}">
+ <div><input type="text" name="s" size="15" /><br />
+ <input type="submit" name="submit" value="search" />
+ </div></form>
+ </li>
+ <li>Archives:
+ <ul>
+ {get_archives type='monthly'}
+ </ul>
+ </li>
+ {lastposts posts='20'}
+ {if $lastposts != ''}
+ <li>Most Recent Posts
+ <ul>
+ {foreach from=$lastposts key=id item=title}
+ <li><a href="{get_permalink id=$id}" title="{$title}">{$title|truncate:20:"..."}</a></li>
+ {/foreach}
+ </ul>
+ </li>
+ {/if}
+ {todayayearago when='month'}
+ {if $todayayearago != ''}
+ <li>A Month Ago
+ <ul>
+ {foreach from=$todayayearago key=id item=details}
+ <li><a href="{get_permalink id=$id}" title="{$details.content|truncate:20:"..."}">{$details.title|truncate:20:"..."}</a></li>
+ {/foreach}
+ </ul>
+ </li>
+ {/if}
+
+ {popularposts}
+ {if $pposts != ''}
+ <li>Most Popular Posts
+ <ul>
+ {foreach from=$pposts key=key item=hits}
+ <li><nobr><a href="{get_permalink id=$hits.postID}" title="{$hits.title}">{$hits.title|truncate:30:"..."}</a>: {$key}</nobr></li>
+ {/foreach}
+ </ul>
+ </li>
+ {/if}
+ <br><br>
+ <li>blo.gs favourites
+ <ul>
+ {blogroll blogID="" blogteststring=""}
+ </ul>
+ </li>
+ <li>Most Popular Clicks
+ <ul>
+ {wp_ozh_click_topclicks limit=10}
+ </ul>
+
+ <li>Other:
+ <ul>
+ <li><a href="{$siteurl}/wp-login.php">login</a></li>
+ </ul>
+ </li>
+ <li>Meta:
+ <ul>
+ <li><a href="{bloginfo show='rss_url'}">RSS .92</a></li>
+ <li><a href="{bloginfo show='rdf_url'}">RDF 1.0</a></li>
+ <li><a href="{bloginfo show='rss2_url'}">RSS 2.0</a></li>
+ <li><a href="{bloginfo show='comments_rss2_url'}">Comments RSS 2.0</a></li>
+ <li><a href="http://validator.w3.org/check/referer" title="This page validates as XHTML 1.0 Transitional">Valid <abbr title="eXtensible HyperText Markup Language">XHTML</abbr></a></li>
+ <li><a href="http://wordpress.org/" title="Powered by WordPress, personal publishing platform">WP</a></li>
+ <li><a href="http://mu.wordpress.org/" title="Powered by WordPress, personal publishing platform">WPMU</a></li>
+ </ul>
+ </li>
+ </ul>
+<!-- WordPress Counter - Check the referers list in your backend! -->
+<script type="text/javascript" language="JavaScript1.2" src="{$siteurl}/wp-counter.php"></script>
+<noscript>
+<img width=1 height=1 src="{$siteurl}/wp-counter.php?page=img&loc={$smarty.server.SERVER_NAME}/{$smarty.server.REQUEST_URI}" alt="Stat Counter" border=0>
+</noscript>
+</div>
+</body>
+</html>
diff --git a/wp-inst/wp-content/sitetemplates/humancondition/templates/post.html b/wp-inst/wp-content/sitetemplates/humancondition/templates/post.html
new file mode 100644
index 0000000..f61aa85
--- /dev/null
+++ b/wp-inst/wp-content/sitetemplates/humancondition/templates/post.html
@@ -0,0 +1,18 @@
+{the_date d='' before='<h2>' after='</h2>'}
+<div class="post">
+<h3 class="storytitle" id="post-{the_ID}"> <a href="{permalink_link}" rel="bookmark" title="Permanent Link: {the_title_rss}">{the_title}</a> </h3>
+<div class="meta">Filed under: {the_category seperator=", "}</div>
+<div class="storycontent">
+ {the_content}
+</div>
+
+<div class="feedback">
+ {link_pages before='<br />Pages: ' after='<br />' next_or_number='number'}
+ {comments_popup_link zero='Comments (0)' one='Comments (1)' more='Comments (%)'}
+</div>
+
+<!--
+{trackback_rdf}
+
+-->
+</div>
diff --git a/wp-inst/wp-content/sitetemplates/humancondition/templates/wp-layout.css b/wp-inst/wp-content/sitetemplates/humancondition/templates/wp-layout.css
new file mode 100644
index 0000000..84d689f
--- /dev/null
+++ b/wp-inst/wp-content/sitetemplates/humancondition/templates/wp-layout.css
@@ -0,0 +1,413 @@
+/* =-=-=-=-=-=-=-=-=-[Theme Name: Human Condition]-=-=-=-=-=-=-=-=-= */
+/* =-=-=-=-=-=-=-=-=-[Designed for Alexking Wordpress Competition - 30/01/04 - Ian Main - www.e-lusion.com]-=-=-=-=-=-=-=-=-= */
+
+/* =-=-=-=-=-=-=-=-=-[Licensing]-=-=-=-=-=-=-=-=-=
+
+1. GPL - Ian Main */
+
+/* =-=-=-=-=-=-=-=-=-[Hacks Used]-=-=-=-=-=-=-=-=-=
+
+1. BMH - #content */
+
+body, html {
+ margin: 0 auto;
+ background: #E4F2FF url(BASE/wp-inst/wp-content/sitetemplates/humancondition/img/bg.gif) repeat-y center;
+ width: 767px;
+ font-family: Lucida Grande, Lucida Sans Unicode, Lucida, Helvetica, Verdana, Arial, Sans-serif;
+ text-align: center;
+ }
+
+a:link {
+ color: #3F729E;
+ text-decoration: none;
+ page-break-after: always;
+ }
+
+a:visited {
+ color: #ABABAB;
+ text-decoration: none;
+ }
+
+a:hover, a:active {
+ color: #093860;
+ }
+
+#rap {
+ margin-left: auto;
+ margin-right: auto;
+ width: 749px;
+ }
+
+#header {
+ background: url(BASE/wp-inst/wp-content/sitetemplates/humancondition/img/header.gif) no-repeat;
+ height: 154px;
+ width: 747px;
+ margin: 0 auto;
+ text-align: left;
+ }
+
+#header a {
+ text-decoration: none;
+ font-size: .8em;
+ position: relative;
+ top: 95px;
+ left: 10px;
+ font-family: verdana, arial, helvetica, geneva, sans-serif;
+ text-transform: uppercase;
+ }
+
+#header a:visited {
+ color: #3F729E;
+ }
+
+#header a:hover {
+ color: #093860;
+ }
+
+#content {
+ text-align: left;
+ background: url(BASE/wp-inst/wp-content/sitetemplates/humancondition/img/fg.gif) repeat-y;
+ width: 749px;
+ padding: 10px;
+ float: left;
+ voice-family: "\"}\"";
+ voice-family: inherit;
+ width: 729px;
+ }
+
+.post {
+ width: 540px;
+ }
+
+h2 {
+ width: 508px;
+ font-size: .7em;
+ background: url(BASE/wp-inst/wp-content/sitetemplates/humancondition/img/date.gif) no-repeat;
+ height: 23px;
+ margin: 0;
+ padding-top: 4px;
+ padding-left: 5px;
+ color: #0E2E4A;
+ }
+
+h3 {
+ font-size: .9em;
+ margin: 5px 0 0 0;
+ }
+
+h3 a:link {
+ color: #000;
+ }
+
+h3 a:visited {
+ color: #000;
+ text-decoration: none;
+ }
+
+h3 a:hover, a:active {
+ color: #093860;
+ }
+
+#commentlist {
+ margin: 0;
+ padding: 0;
+ }
+
+#commentlist li {
+ background: #F3F3F3;
+ border: 1px solid #ddd;
+ font-size: 1em;
+ width: 530px;
+ margin-bottom: 20px;
+ padding: 0 5px 3px 5px;
+ }
+
+ol#commentlist {
+ font-size: 1em;
+ list-style: none;
+ }
+
+#commentlist code {
+ font-family: Courier New, Courier, mono;
+ border: 1px dashed #F3A0A0;
+ background: #F9E4E4;
+ padding: 0 5px 0 5px;
+ text-align: left;
+ }
+
+#commentlist cite {
+ margin: 0;
+ padding: 5px;
+ font-size: .9em;
+ font-style: normal;
+ background: #fff;
+ }
+
+#commentlist li p {
+ width: 530px;
+ }
+
+
+#content p {
+ font-size: .7em;
+ /* width: 535px; */
+ }
+
+.storycontent ul {
+ list-style-type: none;
+ margin-left: 10px;
+ margin-right: 20px;
+ padding: 0;
+ font-size: .7em;
+ }
+
+.storycontent ul li {
+ list-style-image: url(BASE/wp-inst/wp-content/sitetemplates/humancondition/img/bullet.gif);
+ margin-left: 20px;
+ }
+
+.storycontent ol {
+
+ margin-left: 10px;
+ margin-right: 20px;
+ padding: 0;
+ font-size: .7em;
+ }
+
+.storycontent ol li {
+
+ margin-left: 20px;
+ }
+
+.meta {
+ font-size: .7em;
+ background: #eee;
+ margin: 5px 0 0 0;
+ padding: 3px;
+ width: 502px;
+ color: #3A3A3A;
+ }
+
+.post-categories {
+ display: inline;
+ margin: 0;
+ padding: 0;
+ }
+
+.post-categories li {
+ display: inline;
+ list-style-type: none;
+ padding: 0;
+ margin: 0;
+ }
+
+.storycontent {
+ font-size: 1em;
+ border-left: 1px solid #ddd;
+ padding-left: 5px;
+ text-align: justify;
+ width: 535px;
+ margin: 10px 0 0 0;
+ }
+
+.storycontent a:hover {
+ background: #EFF8FF;
+ }
+
+.feedback {
+ font-size: .7em;
+ background: #eee;
+ margin: 10px 0 40px 0;
+ padding: 3px;
+ width: 502px;
+ color: #3A3A3A;
+ }
+
+#menu {
+ width: 200px;
+ margin-left: -207px;
+ float: right;
+ text-align: left;
+ margin-bottom: 20px;
+ }
+
+#menu ul {
+ color: #030;
+ font-weight: bold;
+ list-style-type: none;
+ margin: 0 0 0 20px;
+ padding-left: 10px;
+ width: 160px;
+ }
+
+#menu ul li {
+ color: #242424;
+ font-family: Lucida Grande, Lucida Sans Unicode, Lucida, Helvetica, Verdana, Arial, Sans-serif;
+ font-weight: bold;
+ font-size: .7em;
+ margin-top: 15px;
+ padding: 5px;
+ border: 1px solid #D7D7D7;
+ background: #EAEAEA;
+ }
+
+#menu ul ul {
+ font-weight: normal;
+ line-height: 100%;
+ list-style-type: none;
+ margin: 0;
+ padding: 0;
+ text-align: left;
+ }
+
+#menu ul ul li {
+ background: none;
+ font-family: Lucida Grande, Lucida Sans Unicode, Lucida, Helvetica, Verdana, Arial, Sans-serif;
+ font-size: 1em;
+ font-weight: normal;
+ margin-top: 5px;
+ padding: 0;
+ border: 0;
+ }
+
+#menu input {
+ background-color: #fff;
+ border: 1px solid #3F729E;
+ font-family: verdana, arial, helvetica, geneva, sans-serif;
+ font-size: .9em;
+ font-weight: normal;
+ }
+
+#wp-calendar {
+ background: #fff;
+ border: 1px solid #ddd;
+ empty-cells: show;
+ font-size: 14px;
+ width: 140px;
+ }
+
+#wp-calendar #next a {
+ padding-right: 10px;
+ text-align: right;
+ }
+
+#wp-calendar #prev a {
+ padding-left: 10px;
+ text-align: left;
+ }
+
+#wp-calendar a {
+ display: block;
+ text-decoration: none;
+ }
+
+#wp-calendar a:hover {
+ background: url(BASE/wp-inst/wp-content/sitetemplates/humancondition/img/posts.gif);
+ color: #333;
+ }
+
+#wp-calendar caption {
+ color: #242424;
+ font-size: .8em;
+ text-align: left;
+ padding-bottom: 2px;
+ padding-left: 2px;
+ }
+
+#wp-calendar td {
+ color: #999;
+ font: normal 11px Verdana, Geneva, sans-serif;
+ padding: 1px 1px;
+ text-align: right;
+ }
+
+#wp-calendar td.pad:hover {
+ background: #fff;
+ }
+
+#wp-calendar #today {
+ background: url(BASE/wp-inst/wp-content/sitetemplates/humancondition/img/today.gif);
+ color: #666;
+ }
+
+#wp-calendar th {
+ color: #7EABD1;
+ font-style: normal;
+ text-transform: capitalize;
+ }
+
+.credit {
+
+ clear: both;
+ background: url(BASE/wp-inst/wp-content/sitetemplates/humancondition/img/footer.gif) no-repeat;
+ width: 747px;
+ height: 26px;
+ margin: 0 auto;
+ font-size: .6em;
+ line-height: 2.4em;
+ text-align: center;
+ }
+
+cite {
+ margin: 0;
+ padding: 0;
+ font-size: .9em;
+ font-style: normal;
+ }
+
+/* =-=-=-=-=-=-=-=-=-[Formatting]-=-=-=-=-=-=-=-=-= */
+
+blockquote {
+ border: 1px dashed #7EACD1;
+ margin: 0;
+ background: #F2F9FF;
+ padding: 5px;
+ text-align: left;
+ font-size: .9em;
+ }
+
+code {
+ font-size: 1.2em;
+ color: #4C4C4C;
+ }
+
+abbr, acronym {
+ border-bottom: 3px double #7DAAD0;
+ }
+
+input {
+ border: 3px double #7DAAD0;
+ background: #EFF8FF;
+ margin: 5px;
+ padding-left: 3px;
+ color: #3F729E;
+ font-family: Arial, Helvetica, sans-serif;
+ }
+
+input:hover {
+ background: #D2E5F4;
+ }
+
+textarea {
+ border: 3px double #7DAAD0;
+ background: #EFF8FF;
+ margin: 5px;
+ padding-left: 3px;
+ color: #3F729E;
+ width: 70%;
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 1.2em;
+ }
+
+textarea:hover {
+ background: #D2E5F4;
+ }
+
+select {
+ border: 3px double #7DAAD0;
+ background: #EFF8FF;
+ margin: 5px;
+ padding-left: 3px;
+ color: #3F729E;
+ font-family: Arial, Helvetica, sans-serif;
+ }
diff --git a/wp-inst/wp-content/smarty-plugins/block.textformat.php b/wp-inst/wp-content/smarty-plugins/block.textformat.php
new file mode 100644
index 0000000..aaebab2
--- /dev/null
+++ b/wp-inst/wp-content/smarty-plugins/block.textformat.php
@@ -0,0 +1,102 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+/**
+ * Smarty {textformat}{/textformat} block plugin
+ *
+ * Type: block function<br>
+ * Name: textformat<br>
+ * Purpose: format text a certain way with preset styles
+ * or custom wrap/indent settings<br>
+ * @link http://smarty.php.net/manual/en/language.function.textformat.php {textformat}
+ * (Smarty online manual)
+ * @param array
+ * <pre>
+ * Params: style: string (email)
+ * indent: integer (0)
+ * wrap: integer (80)
+ * wrap_char string ("\n")
+ * indent_char: string (" ")
+ * wrap_boundary: boolean (true)
+ * </pre>
+ * @param string contents of the block
+ * @param Smarty clever simulation of a method
+ * @return string string $content re-formatted
+ */
+function smarty_block_textformat($params, $content, &$smarty)
+{
+ if (is_null($content)) {
+ return;
+ }
+
+ $style = null;
+ $indent = 0;
+ $indent_first = 0;
+ $indent_char = ' ';
+ $wrap = 80;
+ $wrap_char = "\n";
+ $wrap_cut = false;
+ $assign = null;
+
+ foreach ($params as $_key => $_val) {
+ switch ($_key) {
+ case 'style':
+ case 'indent_char':
+ case 'wrap_char':
+ case 'assign':
+ $$_key = (string)$_val;
+ break;
+
+ case 'indent':
+ case 'indent_first':
+ case 'wrap':
+ $$_key = (int)$_val;
+ break;
+
+ case 'wrap_cut':
+ $$_key = (bool)$_val;
+ break;
+
+ default:
+ $smarty->trigger_error("textformat: unknown attribute '$_key'");
+ }
+ }
+
+ if ($style == 'email') {
+ $wrap = 72;
+ }
+
+ // split into paragraphs
+ $_paragraphs = preg_split('![\r\n][\r\n]!',$content);
+ $_output = '';
+
+ for($_x = 0, $_y = count($_paragraphs); $_x < $_y; $_x++) {
+ if ($_paragraphs[$_x] == '') {
+ continue;
+ }
+ // convert mult. spaces & special chars to single space
+ $_paragraphs[$_x] = preg_replace(array('!\s+!','!(^\s+)|(\s+$)!'), array(' ',''), $_paragraphs[$_x]);
+ // indent first line
+ if($indent_first > 0) {
+ $_paragraphs[$_x] = str_repeat($indent_char, $indent_first) . $_paragraphs[$_x];
+ }
+ // wordwrap sentences
+ $_paragraphs[$_x] = wordwrap($_paragraphs[$_x], $wrap - $indent, $wrap_char, $wrap_cut);
+ // indent lines
+ if($indent > 0) {
+ $_paragraphs[$_x] = preg_replace('!^!m', str_repeat($indent_char, $indent), $_paragraphs[$_x]);
+ }
+ }
+ $_output = implode($wrap_char . $wrap_char, $_paragraphs);
+
+ return $assign ? $smarty->assign($assign, $_output) : $_output;
+
+}
+
+/* vim: set expandtab: */
+
+?>
diff --git a/wp-inst/wp-content/smarty-plugins/compiler.assign.php b/wp-inst/wp-content/smarty-plugins/compiler.assign.php
new file mode 100644
index 0000000..2e02017
--- /dev/null
+++ b/wp-inst/wp-content/smarty-plugins/compiler.assign.php
@@ -0,0 +1,38 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+/**
+ * Smarty {assign} compiler function plugin
+ *
+ * Type: compiler function<br>
+ * Name: assign<br>
+ * Purpose: assign a value to a template variable
+ * @link http://smarty.php.net/manual/en/language.custom.functions.php#LANGUAGE.FUNCTION.ASSIGN {assign}
+ * (Smarty online manual)
+ * @param string containing var-attribute and value-attribute
+ * @param Smarty_Compiler
+ */
+function smarty_compiler_assign($tag_attrs, &$compiler)
+{
+ $_params = $compiler->_parse_attrs($tag_attrs);
+
+ if (!isset($_params['var'])) {
+ $compiler->_syntax_error("assign: missing 'var' parameter", E_USER_WARNING);
+ return;
+ }
+
+ if (!isset($_params['value'])) {
+ $compiler->_syntax_error("assign: missing 'value' parameter", E_USER_WARNING);
+ return;
+ }
+
+ return "\$this->assign({$_params['var']}, {$_params['value']});";
+}
+
+/* vim: set expandtab: */
+
+?>
diff --git a/wp-inst/wp-content/smarty-plugins/custom_fields.enclosure.php b/wp-inst/wp-content/smarty-plugins/custom_fields.enclosure.php
new file mode 100644
index 0000000..d4a359b
--- /dev/null
+++ b/wp-inst/wp-content/smarty-plugins/custom_fields.enclosure.php
@@ -0,0 +1,17 @@
+<?php
+
+/* $Id: custom_fields.enclosure.php,v 1.2 2004/10/14 14:15:50 donncha Exp $ */
+
+
+function enclosure( &$smarty, $params, $custom_params )
+{
+ global $siteurl, $wpblog;
+
+ while( list( $key, $val ) = each( $custom_params ) )
+ {
+ $enclosure[] = split( "\n", $val );
+ }
+ $smarty->assign( "enclosure", $enclosure );
+}
+
+?>
diff --git a/wp-inst/wp-content/smarty-plugins/custom_fields.photoblog.php b/wp-inst/wp-content/smarty-plugins/custom_fields.photoblog.php
new file mode 100644
index 0000000..968cc59
--- /dev/null
+++ b/wp-inst/wp-content/smarty-plugins/custom_fields.photoblog.php
@@ -0,0 +1,14 @@
+<?php
+
+/* $Id: custom_fields.photoblog.php,v 1.3 2004/11/10 10:27:29 donncha Exp $ */
+
+
+function photoblog( &$smarty, $params, $custom_params )
+{
+ global $siteurl, $wpblog;
+
+ $smarty->assign( "photoblog", $siteurl."/images/photoblog-".$custom_params[0].".jpg" );
+
+}
+
+?>
diff --git a/wp-inst/wp-content/smarty-plugins/function.assign.php b/wp-inst/wp-content/smarty-plugins/function.assign.php
new file mode 100644
index 0000000..0eb2960
--- /dev/null
+++ b/wp-inst/wp-content/smarty-plugins/function.assign.php
@@ -0,0 +1,30 @@
+<?php
+
+/*
+ * Smarty plugin
+ * -------------------------------------------------------------
+ * Type: function
+ * Name: assign
+ * Purpose: assign a value to a template variable
+ * -------------------------------------------------------------
+ */
+function smarty_function_assign($params, &$smarty)
+{
+ extract($params);
+
+ if (empty($var)) {
+ $smarty->trigger_error("assign: missing 'var' parameter");
+ return;
+ }
+
+ if (!in_array('value', array_keys($params))) {
+ $smarty->trigger_error("assign: missing 'value' parameter");
+ return;
+ }
+
+ $smarty->assign($var, $value);
+}
+
+/* vim: set expandtab: */
+
+?>
diff --git a/wp-inst/wp-content/smarty-plugins/function.assign_debug_info.php b/wp-inst/wp-content/smarty-plugins/function.assign_debug_info.php
new file mode 100644
index 0000000..8015624
--- /dev/null
+++ b/wp-inst/wp-content/smarty-plugins/function.assign_debug_info.php
@@ -0,0 +1,39 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+/**
+ * Smarty {assign_debug_info} function plugin
+ *
+ * Type: function<br>
+ * Name: assign_debug_info<br>
+ * Purpose: assign debug info to the template<br>
+ * @param array unused in this plugin, this plugin uses {@link Smarty::$_config},
+ * {@link Smarty::$_tpl_vars} and {@link Smarty::$_smarty_debug_info}
+ * @param Smarty
+ */
+function smarty_function_assign_debug_info($params, &$smarty)
+{
+ $assigned_vars = $smarty->_tpl_vars;
+ ksort($assigned_vars);
+ if (@is_array($smarty->_config[0])) {
+ $config_vars = $smarty->_config[0];
+ ksort($config_vars);
+ $smarty->assign("_debug_config_keys", array_keys($config_vars));
+ $smarty->assign("_debug_config_vals", array_values($config_vars));
+ }
+
+ $included_templates = $smarty->_smarty_debug_info;
+
+ $smarty->assign("_debug_keys", array_keys($assigned_vars));
+ $smarty->assign("_debug_vals", array_values($assigned_vars));
+
+ $smarty->assign("_debug_tpls", $included_templates);
+}
+
+/* vim: set expandtab: */
+
+?>
diff --git a/wp-inst/wp-content/smarty-plugins/function.blogroll.php b/wp-inst/wp-content/smarty-plugins/function.blogroll.php
new file mode 100644
index 0000000..843f597
--- /dev/null
+++ b/wp-inst/wp-content/smarty-plugins/function.blogroll.php
@@ -0,0 +1,145 @@
+<?php
+
+/* $Id: function.blogroll.php,v 1.2 2004/11/30 00:50:56 donncha Exp $ */
+
+// Modified version of PHP blogroll by Phil Ringnalda @ http://philringnalda.com/phpblogroll/
+// Modified by Donncha O Caoimh, donncha@linux.ie
+
+$GLOBALS['blogroll_open_tags' ] = array(
+ 'WEBLOGUPDATES' => '<WEBLOGUPDATES>',
+ 'WEBLOG' => '<WEBLOG>');
+
+$GLOBALS['blogroll_close_tags' ] = array(
+ 'WEBLOGUPDATES' => '</WEBLOGUPDATES>');
+
+// declare the character set - UTF-8 is the default
+$GLOBALS['blogroll_type' ] = 'ISO-8859-1';
+
+
+function smarty_function_blogroll($params, &$smarty)
+{
+ global $blogroll_open_tags, $blogroll_close_tags, $blogroll_type;
+ global $b2sitePath, $site, $blogteststring;
+ global $wpblog;
+
+ $origCache = $smarty->cache_dir;
+ $smarty->cache_dir = ABSPATH . "/wp-content/smarty-cache";
+
+ extract( $params );
+ if( $blogID == '' )
+ {
+ $smarty->display( ABSPATH . "/wp-content/smarty-templates/noblogroll.tpl" );
+ }
+ else
+ {
+ $blogroll_xml_source = 'http://blo.gs/'.$blogID.'/favorites.xml';
+ //$blogroll_xml_source = '/tmp/favorites.xml';
+ $blogroll_xml_test = $blogteststring;
+
+ $smarty->caching = 2;
+ $smarty->cache_lifetime = 7200; // cache is updated at most once every hour.
+ if( $smarty->template_exists( "blogroll.tpl" ) == false )
+ {
+ copy( ABSPATH . "/wp-content/smarty-templates/blogroll.tpl", ABSPATH . "/wp-content/blogs/".$wpblog."/templates/blogroll.tpl" );
+ $origDir = $smarty->template_dir;
+ $smarty->template_dir = ABSPATH . "/templates";
+ }
+
+ if( $smarty->is_cached( "blogroll.tpl", $wpblog ) == false )
+ {
+ $smarty->clear_cache( 'blogroll.tpl', $wpblog );
+ $blogroll_remote_fp = @fopen($blogroll_xml_source,"r");
+ $blogroll_remote_data = '';
+ if( $blogroll_remote_fp )
+ {
+ while (!feof ($blogroll_remote_fp))
+ {
+ $blogroll_remote_data .= fgets($blogroll_remote_fp, 4096);
+ }
+ fclose($blogroll_remote_fp);
+ if (stristr($blogroll_remote_data, $blogroll_xml_test))
+ {
+ // create our parser
+ $blogroll_xml_parser = xml_parser_create($blogroll_type);
+
+ // set some parser options
+ xml_parser_set_option($blogroll_xml_parser, XML_OPTION_CASE_FOLDING, true);
+ xml_parser_set_option($blogroll_xml_parser, XML_OPTION_TARGET_ENCODING, $blogroll_type);
+
+ // this tells PHP what functions to call when it finds an element
+ // these funcitons also handle the element's attributes
+ xml_set_element_handler($blogroll_xml_parser, 'blogrollStartElement','blogrollEndElement');
+
+ if (!xml_parse($blogroll_xml_parser, $blogroll_remote_data)) {
+ die(sprintf( "XML error: %s at line %d\n\n",
+ xml_error_string(xml_get_error_code($blogroll_xml_parser)),
+ xml_get_current_line_number($blogroll_xml_parser)));
+ }
+
+ xml_parser_free($blogroll_xml_parser);
+ }
+
+ }
+ else
+ {
+ $smarty->assign( "gendate", date("n/d g:ia") );
+ $links[] = array( 'url' => '', 'name' => 'Not Available' );
+ $smarty->assign( "links", $links );
+ }
+ }
+ $smarty->display( "blogroll.tpl", $wpblog );
+ }
+ $smarty->cache_dir = $origCache;
+ if( $origDir != '' )
+ $smarty->template_dir = $origDir;
+}
+
+function blogrollStartElement($parser, $name, $attrs=''){
+ global $blogroll_open_tags, $blogroll_temp, $blogroll_current_tag, $blogroll_weblog_index;
+ $blogroll_current_tag = $name;
+ if ($format = $blogroll_open_tags[$name]){
+ switch($name){
+ case 'WEBLOGUPDATES':
+ //starting to parse
+ $blogroll_weblog_index = -1;
+ break;
+ case 'WEBLOG':
+ //indivdual blog
+ $blogroll_weblog_index++;
+ $blogroll_temp[$blogroll_weblog_index]['name'] = htmlentities(addslashes((strlen($attrs['NAME']) > 19) ? substr($attrs['NAME'], 0, 17) . "..." : $attrs['NAME']));
+ $blogroll_temp[$blogroll_weblog_index]['url'] = $attrs['URL'];
+ break;
+ default:
+ break;
+ }
+ }
+}
+
+function blogrollEndElement($parser, $name, $attrs=''){
+ global $blogroll_close_tags, $blogroll_temp, $blogroll_current_tag;
+ if ($format = $blogroll_close_tags[$name])
+ {
+ switch($name){
+ case 'WEBLOGUPDATES':
+ blogrollWriteLinks();
+ break;
+ default:
+ break;
+ }
+ }
+}
+
+
+function blogrollWriteLinks()
+{
+ global $blogroll_temp, $wpsmarty;
+ $wpsmarty->assign( "gendate", date("n/d g:ia") );
+ reset( $blogroll_temp );
+ while( list( $key, $val ) = each( $blogroll_temp ) )
+ {
+ $links[ $key ] = array( 'url' => $val[ 'url' ], 'name' => stripslashes( $val[ 'name' ] ) );
+ }
+ $wpsmarty->assign( "links", $links );
+}
+
+?>
diff --git a/wp-inst/wp-content/smarty-plugins/function.config_load.php b/wp-inst/wp-content/smarty-plugins/function.config_load.php
new file mode 100644
index 0000000..db7f8f6
--- /dev/null
+++ b/wp-inst/wp-content/smarty-plugins/function.config_load.php
@@ -0,0 +1,140 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+/**
+ * Smarty {config_load} function plugin
+ *
+ * Type: function<br>
+ * Name: config_load<br>
+ * Purpose: load config file vars
+ * @link http://smarty.php.net/manual/en/language.function.config.load.php {config_load}
+ * (Smarty online manual)
+ * @param array Format:
+ * <pre>
+ * array('file' => required config file name,
+ * 'section' => optional config file section to load
+ * 'scope' => local/parent/global
+ * 'global' => overrides scope, setting to parent if true)
+ * </pre>
+ * @param Smarty
+ */
+function smarty_function_config_load($params, &$smarty)
+{
+ if ($smarty->debugging) {
+ $_params = array();
+ require_once(SMARTY_CORE_DIR . 'core.get_microtime.php');
+ $_debug_start_time = smarty_core_get_microtime($_params, $smarty);
+ }
+
+ $_file = isset($params['file']) ? $smarty->_dequote($params['file']) : null;
+ $_section = isset($params['section']) ? $smarty->_dequote($params['section']) : null;
+ $_scope = isset($params['scope']) ? $smarty->_dequote($params['scope']) : 'global';
+ $_global = isset($params['global']) ? $smarty->_dequote($params['global']) : false;
+
+ if (!isset($_file) || strlen($_file) == 0) {
+ $smarty->trigger_error("missing 'file' attribute in config_load tag", E_USER_ERROR, __FILE__, __LINE__);
+ }
+
+ if (isset($_scope)) {
+ if ($_scope != 'local' &&
+ $_scope != 'parent' &&
+ $_scope != 'global') {
+ $smarty->trigger_error("invalid 'scope' attribute value", E_USER_ERROR, __FILE__, __LINE__);
+ }
+ } else {
+ if ($_global) {
+ $_scope = 'parent';
+ } else {
+ $_scope = 'local';
+ }
+ }
+
+ $_params = array('resource_name' => $_file,
+ 'resource_base_path' => $smarty->config_dir,
+ 'get_source' => false);
+ $smarty->_parse_resource_name($_params);
+ $_file_path = $_params['resource_type'] . ':' . $_params['resource_name'];
+ if (isset($_section))
+ $_compile_file = $smarty->_get_compile_path($_file_path.'|'.$_section);
+ else
+ $_compile_file = $smarty->_get_compile_path($_file_path);
+
+ if($smarty->force_compile || !file_exists($_compile_file)) {
+ $_compile = true;
+ } elseif ($smarty->compile_check) {
+ $_params = array('resource_name' => $_file,
+ 'resource_base_path' => $smarty->config_dir,
+ 'get_source' => false);
+ $_compile = $smarty->_fetch_resource_info($_params) &&
+ $_params['resource_timestamp'] > filemtime($_compile_file);
+ } else {
+ $_compile = false;
+ }
+
+ if($_compile) {
+ // compile config file
+ if(!is_object($smarty->_conf_obj)) {
+ require_once SMARTY_DIR . $smarty->config_class . '.class.php';
+ $smarty->_conf_obj = new $smarty->config_class();
+ $smarty->_conf_obj->overwrite = $smarty->config_overwrite;
+ $smarty->_conf_obj->booleanize = $smarty->config_booleanize;
+ $smarty->_conf_obj->read_hidden = $smarty->config_read_hidden;
+ $smarty->_conf_obj->fix_newlines = $smarty->config_fix_newlines;
+ }
+
+ $_params = array('resource_name' => $_file,
+ 'resource_base_path' => $smarty->config_dir,
+ $_params['get_source'] = true);
+ if (!$smarty->_fetch_resource_info($_params)) {
+ return;
+ }
+ $smarty->_conf_obj->set_file_contents($_file, $_params['source_content']);
+ $_config_vars = array_merge($smarty->_conf_obj->get($_file),
+ $smarty->_conf_obj->get($_file, $_section));
+ if(function_exists('var_export')) {
+ $_output = '<?php $_config_vars = ' . var_export($_config_vars, true) . '; ?>';
+ } else {
+ $_output = '<?php $_config_vars = unserialize(\'' . strtr(serialize($_config_vars),array('\''=>'\\\'', '\\'=>'\\\\')) . '\'); ?>';
+ }
+ $_params = (array('compile_path' => $_compile_file, 'compiled_content' => $_output, 'resource_timestamp' => $_params['resource_timestamp']));
+ require_once(SMARTY_CORE_DIR . 'core.write_compiled_resource.php');
+ smarty_core_write_compiled_resource($_params, $smarty);
+ } else {
+ include($_compile_file);
+ }
+
+ if ($smarty->caching) {
+ $smarty->_cache_info['config'][$_file] = true;
+ }
+
+ $smarty->_config[0]['vars'] = @array_merge($smarty->_config[0]['vars'], $_config_vars);
+ $smarty->_config[0]['files'][$_file] = true;
+
+ if ($_scope == 'parent') {
+ $smarty->_config[1]['vars'] = @array_merge($smarty->_config[1]['vars'], $_config_vars);
+ $smarty->_config[1]['files'][$_file] = true;
+ } else if ($_scope == 'global') {
+ for ($i = 1, $for_max = count($smarty->_config); $i < $for_max; $i++) {
+ $smarty->_config[$i]['vars'] = @array_merge($smarty->_config[$i]['vars'], $_config_vars);
+ $smarty->_config[$i]['files'][$_file] = true;
+ }
+ }
+
+ if ($smarty->debugging) {
+ $_params = array();
+ require_once(SMARTY_CORE_DIR . 'core.get_microtime.php');
+ $smarty->_smarty_debug_info[] = array('type' => 'config',
+ 'filename' => $_file.' ['.$_section.'] '.$_scope,
+ 'depth' => $smarty->_inclusion_depth,
+ 'exec_time' => smarty_core_get_microtime($_params, $smarty) - $_debug_start_time);
+ }
+
+}
+
+/* vim: set expandtab: */
+
+?>
diff --git a/wp-inst/wp-content/smarty-plugins/function.cork.php b/wp-inst/wp-content/smarty-plugins/function.cork.php
new file mode 100644
index 0000000..fac9c31
--- /dev/null
+++ b/wp-inst/wp-content/smarty-plugins/function.cork.php
@@ -0,0 +1,157 @@
+<?php
+/*
+ Smarty plugin
+ -------------------------------------------------------------
+ File: function.cork.php
+ Type: function
+ Name: cork
+ Purpose: Piratize your content!
+ -------------------------------------------------------------
+
+ $Id: function.cork.php,v 1.1.1.1 2004/10/14 12:07:23 donncha Exp $
+*/
+
+function smarty_function_cork($params, &$smarty)
+{
+ extract( $params );
+
+ if( '0919' != date('md') )
+ {
+ return $content;
+ }
+ // Always replace these:
+ $patterns = array(
+ '%\bmy\b%' => 'me',
+ '%\bcareful\b%' => 'wide',
+ '%\bfooling\b%' => 'codding',
+ '%\bjoking\b%' => 'codding',
+ '%\b[Ee]xcuse me\b%' => 'C\'mere',
+ '%\bcommon sense\b%' => 'cop on',
+ '%\bkick\b%' => 'funt',
+ '%\bgood looking\b%' => 'fine half',
+ '%\bgood looking guy\b%' => 'flah',
+ '%\bgood looking girl\b%' => 'flah',
+ '%\bbeautiful girl\b%' => 'flah',
+ '%\bbeautiful woman\b%' => 'flah',
+ '%\btired\b%' => 'flahed out',
+ '%\bexhausted\b%' => 'flahed out',
+ '%\bunpleasant\b%' => 'ganky',
+ '%\bterrible\b%' => 'nawful',
+ '%\bnot nice\b%' => 'ganky',
+ '%\blook\b%' => 'gawk',
+ '%\bidiot\b%' => 'gowl',
+ '%\bthat\'s good\b%' => 'how bad?',
+ '%\b[Nn]o!\b%' => 'I wil, yeah!',
+ '%\blovely\b%' => 'massive',
+ '%\bLovely\b%' => 'Massive',
+ '%\bnot real\b%' => 'mockeyah',
+ '%\bgirlfriend\b%' => 'oul doll',
+ '%\bskipping school\b%' => 'on the hop',
+ '%\bvery lucky\b%' => 'poxed',
+ '%\btrainers\b%' => 'rubber dollies',
+ '%\brunners\b%' => 'rubber dollies',
+ '%\bsports shoes\b%' => 'rubber dollies',
+ '%\bake a look\b%' => 'ake a sconse',
+ '%\bis vain\b%' => 'is septic',
+ '%\bfemale\b%' => 'wan',
+ '%\b\wouldn\'t dareb%' => 'would yeah',
+ '%\bHe looks bad\b%' => 'State a him la',
+ '%\bvery\b%' => 'pure',
+ '%\bcare\b%' => 'give two f*cks',
+ '%\bprostitue\b%' => 'brasser',
+ '%\bmale\b%' => 'fein',
+ '%\bman\b%' => 'feen',
+ '%\bstupid\b%' => 'gowl',
+ '%\bpotatoes\b%' => 'poppies',
+ '%\becstasy\b%' => 'yolkies',
+ '%\b[Gg]arda\b%' => 'Shades',
+ '%\b[Pp]olice\b%' => 'Law',
+ '%\bGarda motorbike\b%' => 'Speedy',
+ '%\bdeformed\b%' => 'gammy',
+ '%\bbroken\b%' => 'gammy',
+ '%\bdrink\b%' => 'on the tear',
+ '%\bdrinking\b%' => 'gattin',
+ '%\bGreat\b%' => 'How Bad!',
+ '%\bave a go\b%' => 'ave a lash',
+ '%\bmother\b%' => 'mam',
+ '%\blook\b%' => 'lamp',
+ '%\bhome\b%' => 'gaff',
+ '%\bhouse\b%' => 'gaff',
+ '%\bnose\b%' => 'gonzer',
+ '%\bHow\'s the form?\b%' => 'How are you?',
+ '%\bhaircut\b%' => 'bazzer',
+ '%\bsatisfaction\b%' => 'soot',
+ '%\bvomiting\b%' => 'gawking',
+ '%\bvomit\b%' => 'gawk',
+ '%\bsnail\b%' => 'shelityhorn',
+ '%\bvery nice\b%' => 'me daza',
+ '%\bThis\b%' => 'Dis'
+ #'%\b\b%' => '',
+ );
+
+ // Replace the words:
+ $content = array_apply_regexp($patterns,$content);
+
+ // Word ending mangling:
+ $patterns = array(
+ '/ing\b/' => "in'",
+ // '/([a-zA-Z]{3,}[^lbro])ly(\W)/' => '$1-like$2',
+ );
+
+ $content = array_apply_regexp($patterns,$content);
+
+ // Random exclamations and such:
+ $patterns = array(
+ '/(\.\s)/e' => 'avast("$0",3)',
+ );
+
+ $content = array_apply_regexp($patterns,$content);
+
+ // Let's increase the chance for exclamation marks and question marks
+ $patterns = array(
+ '/([!\?]\s)/e' => 'avast("$0",5)',
+ );
+
+ $content = array_apply_regexp($patterns,$content);
+
+ return $content;
+}
+
+// support function for cork()
+function avast($stub = '',$chance = 5) {
+ $shouts = array(
+ ", like!",
+ ", you know like?",
+ ", la!",
+ ", boy!",
+ "Like eh, $stub"
+ );
+
+ shuffle($shouts);
+
+ return (((1 == rand(1,$chance))?array_shift($shouts):$stub) . ' ');
+}
+
+// This function takes an array of ('/pattern/' => 'replacement') pairs
+// and applies them all to $content.
+function array_apply_regexp($patterns,$content) {
+ // Extract the values:
+ $keys = array_keys($patterns);
+ $values = array_values($patterns);
+
+ // Modify the key patterns to avoid modifying the contents
+ // of HTML tags
+ for ($i = 0; $i < count($keys); $i++) {
+ $regexp = $keys[$i];
+
+// $regexp = preg_replace('%^(.)(.+)(.)$%','$1(?!<[^>])$2(?![>])$3',$regexp);
+
+ $keys[$i] = $regexp;
+ }
+
+ // Replace the words:
+ $content = preg_replace($keys,$values,$content);
+
+ return $content;
+}
+?>
diff --git a/wp-inst/wp-content/smarty-plugins/function.counter.php b/wp-inst/wp-content/smarty-plugins/function.counter.php
new file mode 100644
index 0000000..cfe5dd8
--- /dev/null
+++ b/wp-inst/wp-content/smarty-plugins/function.counter.php
@@ -0,0 +1,79 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty {counter} function plugin
+ *
+ * Type: function<br>
+ * Name: counter<br>
+ * Purpose: print out a counter value
+ * @link http://smarty.php.net/manual/en/language.function.counter.php {counter}
+ * (Smarty online manual)
+ * @param array parameters
+ * @param Smarty
+ * @return string|null
+ */
+function smarty_function_counter($params, &$smarty)
+{
+ static $counters = array();
+
+ $name = (isset($params['name'])) ? $params['name'] : 'default';
+ if (!isset($counters[$name])) {
+ $counters[$name] = array(
+ 'start'=>1,
+ 'skip'=>1,
+ 'direction'=>'up',
+ 'count'=>1
+ );
+ }
+ $counter =& $counters[$name];
+
+ if (isset($params['start'])) {
+ $counter['start'] = $counter['count'] = (int)$params['start'];
+ }
+
+ if (!empty($params['assign'])) {
+ $counter['assign'] = $params['assign'];
+ }
+
+ if (isset($counter['assign'])) {
+ $smarty->assign($counter['assign'], $counter['count']);
+ }
+
+ if (isset($params['print'])) {
+ $print = (bool)$params['print'];
+ } else {
+ $print = empty($counter['assign']);
+ }
+
+ if ($print) {
+ $retval = $counter['count'];
+ } else {
+ $retval = null;
+ }
+
+ if (isset($params['skip'])) {
+ $counter['skip'] = $params['skip'];
+ }
+
+ if (isset($params['direction'])) {
+ $counter['direction'] = $params['direction'];
+ }
+
+ if ($counter['direction'] == "down")
+ $counter['count'] -= $counter['skip'];
+ else
+ $counter['count'] += $counter['skip'];
+
+ return $retval;
+
+}
+
+/* vim: set expandtab: */
+
+?>
diff --git a/wp-inst/wp-content/smarty-plugins/function.custom_fields.php b/wp-inst/wp-content/smarty-plugins/function.custom_fields.php
new file mode 100644
index 0000000..8c684b7
--- /dev/null
+++ b/wp-inst/wp-content/smarty-plugins/function.custom_fields.php
@@ -0,0 +1,31 @@
+<?php
+/*
+ * Smarty plugin
+ * -------------------------------------------------------------
+ * File: function.custom_fields.php
+ * Type: function
+ * Name: custom_fields
+ * Purpose: Passes the custom field value to the named function
+ * -------------------------------------------------------------
+ */
+function smarty_function_custom_fields($params, &$smarty)
+{
+ global $wpblog, $siteurl;
+
+ extract( $params );
+ $fields = get_post_custom();
+ if( is_array( $fields ) )
+ {
+ while( list( $func, $custom_params ) = each( $fields ) )
+ {
+ $func = str_replace('../', '', $func);
+ $file = $smarty->plugins_dir . "/custom_fields." . $func . ".php";
+ if( is_file( $file ) )
+ {
+ include_once( $file );
+ $func( $smarty, $params, $custom_params );
+ }
+ }
+ }
+}
+?>
diff --git a/wp-inst/wp-content/smarty-plugins/function.cycle.php b/wp-inst/wp-content/smarty-plugins/function.cycle.php
new file mode 100644
index 0000000..fe78bb8
--- /dev/null
+++ b/wp-inst/wp-content/smarty-plugins/function.cycle.php
@@ -0,0 +1,102 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+/**
+ * Smarty {cycle} function plugin
+ *
+ * Type: function<br>
+ * Name: cycle<br>
+ * Date: May 3, 2002<br>
+ * Purpose: cycle through given values<br>
+ * Input:
+ * - name = name of cycle (optional)
+ * - values = comma separated list of values to cycle,
+ * or an array of values to cycle
+ * (this can be left out for subsequent calls)
+ * - reset = boolean - resets given var to true
+ * - print = boolean - print var or not. default is true
+ * - advance = boolean - whether or not to advance the cycle
+ * - delimiter = the value delimiter, default is ","
+ * - assign = boolean, assigns to template var instead of
+ * printed.
+ *
+ * Examples:<br>
+ * <pre>
+ * {cycle values="#eeeeee,#d0d0d0d"}
+ * {cycle name=row values="one,two,three" reset=true}
+ * {cycle name=row}
+ * </pre>
+ * @link http://smarty.php.net/manual/en/language.function.cycle.php {cycle}
+ * (Smarty online manual)
+ * @author Monte Ohrt <monte at ohrt dot com>
+ * @author credit to Mark Priatel <mpriatel@rogers.com>
+ * @author credit to Gerard <gerard@interfold.com>
+ * @author credit to Jason Sweat <jsweat_php@yahoo.com>
+ * @version 1.3
+ * @param array
+ * @param Smarty
+ * @return string|null
+ */
+function smarty_function_cycle($params, &$smarty)
+{
+ static $cycle_vars;
+
+ $name = (empty($params['name'])) ? 'default' : $params['name'];
+ $print = (isset($params['print'])) ? (bool)$params['print'] : true;
+ $advance = (isset($params['advance'])) ? (bool)$params['advance'] : true;
+ $reset = (isset($params['reset'])) ? (bool)$params['reset'] : false;
+
+ if (!in_array('values', array_keys($params))) {
+ if(!isset($cycle_vars[$name]['values'])) {
+ $smarty->trigger_error("cycle: missing 'values' parameter");
+ return;
+ }
+ } else {
+ if(isset($cycle_vars[$name]['values'])
+ && $cycle_vars[$name]['values'] != $params['values'] ) {
+ $cycle_vars[$name]['index'] = 0;
+ }
+ $cycle_vars[$name]['values'] = $params['values'];
+ }
+
+ $cycle_vars[$name]['delimiter'] = (isset($params['delimiter'])) ? $params['delimiter'] : ',';
+
+ if(is_array($cycle_vars[$name]['values'])) {
+ $cycle_array = $cycle_vars[$name]['values'];
+ } else {
+ $cycle_array = explode($cycle_vars[$name]['delimiter'],$cycle_vars[$name]['values']);
+ }
+
+ if(!isset($cycle_vars[$name]['index']) || $reset ) {
+ $cycle_vars[$name]['index'] = 0;
+ }
+
+ if (isset($params['assign'])) {
+ $print = false;
+ $smarty->assign($params['assign'], $cycle_array[$cycle_vars[$name]['index']]);
+ }
+
+ if($print) {
+ $retval = $cycle_array[$cycle_vars[$name]['index']];
+ } else {
+ $retval = null;
+ }
+
+ if($advance) {
+ if ( $cycle_vars[$name]['index'] >= count($cycle_array) -1 ) {
+ $cycle_vars[$name]['index'] = 0;
+ } else {
+ $cycle_vars[$name]['index']++;
+ }
+ }
+
+ return $retval;
+}
+
+/* vim: set expandtab: */
+
+?>
diff --git a/wp-inst/wp-content/smarty-plugins/function.debug.php b/wp-inst/wp-content/smarty-plugins/function.debug.php
new file mode 100644
index 0000000..4345230
--- /dev/null
+++ b/wp-inst/wp-content/smarty-plugins/function.debug.php
@@ -0,0 +1,35 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty {debug} function plugin
+ *
+ * Type: function<br>
+ * Name: debug<br>
+ * Date: July 1, 2002<br>
+ * Purpose: popup debug window
+ * @link http://smarty.php.net/manual/en/language.function.debug.php {debug}
+ * (Smarty online manual)
+ * @author Monte Ohrt <monte at ohrt dot com>
+ * @version 1.0
+ * @param array
+ * @param Smarty
+ * @return string output from {@link Smarty::_generate_debug_output()}
+ */
+function smarty_function_debug($params, &$smarty)
+{
+ if (isset($params['output'])) {
+ $smarty->assign('_smarty_debug_output', $params['output']);
+ }
+ require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');
+ return smarty_core_display_debug_console(null, $smarty);
+}
+
+/* vim: set expandtab: */
+
+?>
diff --git a/wp-inst/wp-content/smarty-plugins/function.eightball.php b/wp-inst/wp-content/smarty-plugins/function.eightball.php
new file mode 100644
index 0000000..ccfbb4b
--- /dev/null
+++ b/wp-inst/wp-content/smarty-plugins/function.eightball.php
@@ -0,0 +1,23 @@
+<?php
+/*
+ * Smarty plugin
+ * -------------------------------------------------------------
+ * File: function.eightball.php
+ * Type: function
+ * Name: eightball
+ * Purpose: outputs a random magic answer
+ * -------------------------------------------------------------
+ */
+function smarty_function_eightball($params, &$smarty)
+{
+ $answers = array('Yes',
+ 'No',
+ 'No way',
+ 'Outlook not so good',
+ 'Ask again soon',
+ 'Maybe in your reality');
+
+ $result = array_rand($answers);
+ echo $answers[$result];
+}
+?>
diff --git a/wp-inst/wp-content/smarty-plugins/function.eval.php b/wp-inst/wp-content/smarty-plugins/function.eval.php
new file mode 100644
index 0000000..3a4b8b2
--- /dev/null
+++ b/wp-inst/wp-content/smarty-plugins/function.eval.php
@@ -0,0 +1,48 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty {eval} function plugin
+ *
+ * Type: function<br>
+ * Name: eval<br>
+ * Purpose: evaluate a template variable as a template<br>
+ * @link http://smarty.php.net/manual/en/language.function.eval.php {eval}
+ * (Smarty online manual)
+ * @param array
+ * @param Smarty
+ */
+function smarty_function_eval($params, &$smarty)
+{
+
+ if (!isset($params['var'])) {
+ $smarty->trigger_error("eval: missing 'var' parameter");
+ return;
+ }
+
+ if($params['var'] == '') {
+ return;
+ }
+
+ $smarty->_compile_source('evaluated template', $params['var'], $_var_compiled);
+
+ ob_start();
+ $smarty->_eval('?>' . $_var_compiled);
+ $_contents = ob_get_contents();
+ ob_end_clean();
+
+ if (!empty($params['assign'])) {
+ $smarty->assign($params['assign'], $_contents);
+ } else {
+ return $_contents;
+ }
+}
+
+/* vim: set expandtab: */
+
+?>
diff --git a/wp-inst/wp-content/smarty-plugins/function.fetch.php b/wp-inst/wp-content/smarty-plugins/function.fetch.php
new file mode 100644
index 0000000..f5a6987
--- /dev/null
+++ b/wp-inst/wp-content/smarty-plugins/function.fetch.php
@@ -0,0 +1,220 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty {fetch} plugin
+ *
+ * Type: function<br>
+ * Name: fetch<br>
+ * Purpose: fetch file, web or ftp data and display results
+ * @link http://smarty.php.net/manual/en/language.function.fetch.php {fetch}
+ * (Smarty online manual)
+ * @param array
+ * @param Smarty
+ * @return string|null if the assign parameter is passed, Smarty assigns the
+ * result to a template variable
+ */
+function smarty_function_fetch($params, &$smarty)
+{
+ if (empty($params['file'])) {
+ $smarty->_trigger_fatal_error("[plugin] parameter 'file' cannot be empty");
+ return;
+ }
+
+ $content = '';
+ if ($smarty->security && !preg_match('!^(http|ftp)://!i', $params['file'])) {
+ $_params = array('resource_type' => 'file', 'resource_name' => $params['file']);
+ require_once(SMARTY_CORE_DIR . 'core.is_secure.php');
+ if(!smarty_core_is_secure($_params, $smarty)) {
+ $smarty->_trigger_fatal_error('[plugin] (secure mode) fetch \'' . $params['file'] . '\' is not allowed');
+ return;
+ }
+
+ // fetch the file
+ if($fp = @fopen($params['file'],'r')) {
+ while(!feof($fp)) {
+ $content .= fgets ($fp,4096);
+ }
+ fclose($fp);
+ } else {
+ $smarty->_trigger_fatal_error('[plugin] fetch cannot read file \'' . $params['file'] . '\'');
+ return;
+ }
+ } else {
+ // not a local file
+ if(preg_match('!^http://!i',$params['file'])) {
+ // http fetch
+ if($uri_parts = parse_url($params['file'])) {
+ // set defaults
+ $host = $server_name = $uri_parts['host'];
+ $timeout = 30;
+ $accept = "image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*";
+ $agent = "Smarty Template Engine ".$smarty->_version;
+ $referer = "";
+ $uri = !empty($uri_parts['path']) ? $uri_parts['path'] : '/';
+ $uri .= !empty($uri_parts['query']) ? '?' . $uri_parts['query'] : '';
+ $_is_proxy = false;
+ if(empty($uri_parts['port'])) {
+ $port = 80;
+ } else {
+ $port = $uri_parts['port'];
+ }
+ if(!empty($uri_parts['user'])) {
+ $user = $uri_parts['user'];
+ }
+ if(!empty($uri_parts['pass'])) {
+ $pass = $uri_parts['pass'];
+ }
+ // loop through parameters, setup headers
+ foreach($params as $param_key => $param_value) {
+ switch($param_key) {
+ case "file":
+ case "assign":
+ case "assign_headers":
+ break;
+ case "user":
+ if(!empty($param_value)) {
+ $user = $param_value;
+ }
+ break;
+ case "pass":
+ if(!empty($param_value)) {
+ $pass = $param_value;
+ }
+ break;
+ case "accept":
+ if(!empty($param_value)) {
+ $accept = $param_value;
+ }
+ break;
+ case "header":
+ if(!empty($param_value)) {
+ if(!preg_match('![\w\d-]+: .+!',$param_value)) {
+ $smarty->_trigger_fatal_error("[plugin] invalid header format '".$param_value."'");
+ return;
+ } else {
+ $extra_headers[] = $param_value;
+ }
+ }
+ break;
+ case "proxy_host":
+ if(!empty($param_value)) {
+ $proxy_host = $param_value;
+ }
+ break;
+ case "proxy_port":
+ if(!preg_match('!\D!', $param_value)) {
+ $proxy_port = (int) $param_value;
+ } else {
+ $smarty->_trigger_fatal_error("[plugin] invalid value for attribute '".$param_key."'");
+ return;
+ }
+ break;
+ case "agent":
+ if(!empty($param_value)) {
+ $agent = $param_value;
+ }
+ break;
+ case "referer":
+ if(!empty($param_value)) {
+ $referer = $param_value;
+ }
+ break;
+ case "timeout":
+ if(!preg_match('!\D!', $param_value)) {
+ $timeout = (int) $param_value;
+ } else {
+ $smarty->_trigger_fatal_error("[plugin] invalid value for attribute '".$param_key."'");
+ return;
+ }
+ break;
+ default:
+ $smarty->_trigger_fatal_error("[plugin] unrecognized attribute '".$param_key."'");
+ return;
+ }
+ }
+ if(!empty($proxy_host) && !empty($proxy_port)) {
+ $_is_proxy = true;
+ $fp = fsockopen($proxy_host,$proxy_port,$errno,$errstr,$timeout);
+ } else {
+ $fp = fsockopen($server_name,$port,$errno,$errstr,$timeout);
+ }
+
+ if(!$fp) {
+ $smarty->_trigger_fatal_error("[plugin] unable to fetch: $errstr ($errno)");
+ return;
+ } else {
+ if($_is_proxy) {
+ fputs($fp, 'GET ' . $params['file'] . " HTTP/1.0\r\n");
+ } else {
+ fputs($fp, "GET $uri HTTP/1.0\r\n");
+ }
+ if(!empty($host)) {
+ fputs($fp, "Host: $host\r\n");
+ }
+ if(!empty($accept)) {
+ fputs($fp, "Accept: $accept\r\n");
+ }
+ if(!empty($agent)) {
+ fputs($fp, "User-Agent: $agent\r\n");
+ }
+ if(!empty($referer)) {
+ fputs($fp, "Referer: $referer\r\n");
+ }
+ if(isset($extra_headers) && is_array($extra_headers)) {
+ foreach($extra_headers as $curr_header) {
+ fputs($fp, $curr_header."\r\n");
+ }
+ }
+ if(!empty($user) && !empty($pass)) {
+ fputs($fp, "Authorization: BASIC ".base64_encode("$user:$pass")."\r\n");
+ }
+
+ fputs($fp, "\r\n");
+ while(!feof($fp)) {
+ $content .= fgets($fp,4096);
+ }
+ fclose($fp);
+ $csplit = split("\r\n\r\n",$content,2);
+
+ $content = $csplit[1];
+
+ if(!empty($params['assign_headers'])) {
+ $smarty->assign($params['assign_headers'],split("\r\n",$csplit[0]));
+ }
+ }
+ } else {
+ $smarty->_trigger_fatal_error("[plugin] unable to parse URL, check syntax");
+ return;
+ }
+ } else {
+ // ftp fetch
+ if($fp = @fopen($params['file'],'r')) {
+ while(!feof($fp)) {
+ $content .= fgets ($fp,4096);
+ }
+ fclose($fp);
+ } else {
+ $smarty->_trigger_fatal_error('[plugin] fetch cannot read file \'' . $params['file'] .'\'');
+ return;
+ }
+ }
+
+ }
+
+
+ if (!empty($params['assign'])) {
+ $smarty->assign($params['assign'],$content);
+ } else {
+ return $content;
+ }
+}
+
+/* vim: set expandtab: */
+
+?>
diff --git a/wp-inst/wp-content/smarty-plugins/function.get_recent_comments.php b/wp-inst/wp-content/smarty-plugins/function.get_recent_comments.php
new file mode 100644
index 0000000..ec504f3
--- /dev/null
+++ b/wp-inst/wp-content/smarty-plugins/function.get_recent_comments.php
@@ -0,0 +1,25 @@
+<?php
+
+/* $Id: function.get_recent_comments.php,v 1.1 2005/03/11 16:05:26 donncha Exp $ */
+
+/*
+ Smarty plugin
+ -------------------------------------------------------------
+ File: function.get_hashcash_special_code.hp
+ Type: function
+ Name: get_hashcash_special_code
+ Purpose: print hascash code.
+ -------------------------------------------------------------
+
+ $Id: function.get_recent_comments.php,v 1.1 2005/03/11 16:05:26 donncha Exp $
+*/
+
+function smarty_function_get_recent_comments($params, &$smarty)
+{
+ $no_comments = 5;
+ $comment_lenth = 5;
+ extract( $params );
+
+ return get_recent_comments( $no_comments, $comment_lenth );
+}
+?>
diff --git a/wp-inst/wp-content/smarty-plugins/function.getcustomfield.php b/wp-inst/wp-content/smarty-plugins/function.getcustomfield.php
new file mode 100644
index 0000000..9307dcb
--- /dev/null
+++ b/wp-inst/wp-content/smarty-plugins/function.getcustomfield.php
@@ -0,0 +1,39 @@
+<?php
+
+/* $Id: function.getcustomfield.php,v 1.1.1.1 2004/10/14 12:07:23 donncha Exp $ */
+
+// custom fields hack by Mystis @ http://www.mystis.net/b2customfields.html
+// commentary @ http://tidakada.com/board/viewtopic.php?t=2693
+// Highly modified by Donncha O Caoimh, donncha@linux.ie
+
+function smarty_function_getcustomfield($params, &$smarty)
+{
+ global $tableposts,$id, $site;
+
+ extract( $params );
+
+ $sql = "SELECT field_contents
+ FROM b2customfieldsContents
+ WHERE postID = '".$id."'
+ AND blog = '".$site."'
+ AND field_name = '".$name."'";
+ $result = mysql_query($sql);
+ if( @mysql_num_rows( $result ) )
+ {
+ $row = mysql_fetch_array($result);
+ $output = $row[ 'field_contents' ];
+ $output = convert_bbcode(convert_smilies(stripslashes($output)));
+ if( strstr( $output, ";;;" ) )
+ {
+ $output = split(";;;", $output );
+ }
+ }
+ else
+ {
+ $output = '';
+ }
+
+ $smarty->assign( "customfield", $output );
+}
+
+?>
diff --git a/wp-inst/wp-content/smarty-plugins/function.globalvar.php b/wp-inst/wp-content/smarty-plugins/function.globalvar.php
new file mode 100644
index 0000000..a9b5899
--- /dev/null
+++ b/wp-inst/wp-content/smarty-plugins/function.globalvar.php
@@ -0,0 +1,34 @@
+<?php
+
+/* $Id: function.globalvar.php,v 1.1.1.1 2004/10/14 12:07:23 donncha Exp $ */
+
+
+/*
+ * Smarty plugin
+ * -------------------------------------------------------------
+ * Type: function
+ * Name: globalvar
+ * Purpose: Make a Smarty variable global in PHP land.
+ * -------------------------------------------------------------
+ */
+function smarty_function_globalvar($params, &$smarty)
+{
+ extract($params);
+
+ if (empty($var)) {
+ $smarty->trigger_error("globalvar: missing 'var' parameter");
+ return;
+ }
+
+ if (!in_array('value', array_keys($params))) {
+ $smarty->trigger_error("globalvar: missing 'value' parameter");
+ return;
+ }
+
+ global $$var;
+ $$var = $value;
+}
+
+/* vim: set expandtab: */
+
+?>
diff --git a/wp-inst/wp-content/smarty-plugins/function.googleit.php b/wp-inst/wp-content/smarty-plugins/function.googleit.php
new file mode 100644
index 0000000..1b896e1
--- /dev/null
+++ b/wp-inst/wp-content/smarty-plugins/function.googleit.php
@@ -0,0 +1,38 @@
+<?php
+
+/* $Id: function.googleit.php,v 1.1.1.1 2004/10/14 12:07:23 donncha Exp $ */
+
+/*
+ Smarty plugin
+ -------------------------------------------------------------
+ File: function.googleit.php
+ Type: function
+ Name: googleit
+ Purpose: Return google search for string.
+ -------------------------------------------------------------
+
+ COPYRIGHT Donncha O Caoimh.
+
+ $Id: function.googleit.php,v 1.1.1.1 2004/10/14 12:07:23 donncha Exp $
+*/
+
+function smarty_function_googleit($params, &$smarty)
+{
+ extract( $params );
+ if( $search != '' )
+ {
+ $search1 = str_replace( " ", "+", $search );
+ echo '<a href="http://www.google.com/search?q=' . strip_tags( $search1 ).'" title="Search for '. strip_tags( $search ).'">';
+ if( $link != '' )
+ {
+ echo $link;
+ }
+ else
+ {
+ echo "Search";
+ }
+ echo '</a>';
+ }
+
+}
+?>
diff --git a/wp-inst/wp-content/smarty-plugins/function.html_checkboxes.php b/wp-inst/wp-content/smarty-plugins/function.html_checkboxes.php
new file mode 100644
index 0000000..ed8ad7f
--- /dev/null
+++ b/wp-inst/wp-content/smarty-plugins/function.html_checkboxes.php
@@ -0,0 +1,143 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty {html_checkboxes} function plugin
+ *
+ * File: function.html_checkboxes.php<br>
+ * Type: function<br>
+ * Name: html_checkboxes<br>
+ * Date: 24.Feb.2003<br>
+ * Purpose: Prints out a list of checkbox input types<br>
+ * Input:<br>
+ * - name (optional) - string default "checkbox"
+ * - values (required) - array
+ * - options (optional) - associative array
+ * - checked (optional) - array default not set
+ * - separator (optional) - ie <br> or &nbsp;
+ * - output (optional) - the output next to each checkbox
+ * - assign (optional) - assign the output as an array to this variable
+ * Examples:
+ * <pre>
+ * {html_checkboxes values=$ids output=$names}
+ * {html_checkboxes values=$ids name='box' separator='<br>' output=$names}
+ * {html_checkboxes values=$ids checked=$checked separator='<br>' output=$names}
+ * </pre>
+ * @link http://smarty.php.net/manual/en/language.function.html.checkboxes.php {html_checkboxes}
+ * (Smarty online manual)
+ * @author Christopher Kvarme <christopher.kvarme@flashjab.com>
+ * @author credits to Monte Ohrt <monte at ohrt dot com>
+ * @version 1.0
+ * @param array
+ * @param Smarty
+ * @return string
+ * @uses smarty_function_escape_special_chars()
+ */
+function smarty_function_html_checkboxes($params, &$smarty)
+{
+ require_once $smarty->_get_plugin_filepath('shared','escape_special_chars');
+
+ $name = 'checkbox';
+ $values = null;
+ $options = null;
+ $selected = null;
+ $separator = '';
+ $labels = true;
+ $output = null;
+
+ $extra = '';
+
+ foreach($params as $_key => $_val) {
+ switch($_key) {
+ case 'name':
+ case 'separator':
+ $$_key = $_val;
+ break;
+
+ case 'labels':
+ $$_key = (bool)$_val;
+ break;
+
+ case 'options':
+ $$_key = (array)$_val;
+ break;
+
+ case 'values':
+ case 'output':
+ $$_key = array_values((array)$_val);
+ break;
+
+ case 'checked':
+ case 'selected':
+ $selected = array_map('strval', array_values((array)$_val));
+ break;
+
+ case 'checkboxes':
+ $smarty->trigger_error('html_checkboxes: the use of the "checkboxes" attribute is deprecated, use "options" instead', E_USER_WARNING);
+ $options = (array)$_val;
+ break;
+
+ case 'assign':
+ break;
+
+ default:
+ if(!is_array($_val)) {
+ $extra .= ' '.$_key.'="'.smarty_function_escape_special_chars($_val).'"';
+ } else {
+ $smarty->trigger_error("html_checkboxes: extra attribute '$_key' cannot be an array", E_USER_NOTICE);
+ }
+ break;
+ }
+ }
+
+ if (!isset($options) && !isset($values))
+ return ''; /* raise error here? */
+
+ settype($selected, 'array');
+ $_html_result = array();
+
+ if (isset($options)) {
+
+ foreach ($options as $_key=>$_val)
+ $_html_result[] = smarty_function_html_checkboxes_output($name, $_key, $_val, $selected, $extra, $separator, $labels);
+
+
+ } else {
+ foreach ($values as $_i=>$_key) {
+ $_val = isset($output[$_i]) ? $output[$_i] : '';
+ $_html_result[] = smarty_function_html_checkboxes_output($name, $_key, $_val, $selected, $extra, $separator, $labels);
+ }
+
+ }
+
+ if(!empty($params['assign'])) {
+ $smarty->assign($params['assign'], $_html_result);
+ } else {
+ return implode("\n",$_html_result);
+ }
+
+}
+
+function smarty_function_html_checkboxes_output($name, $value, $output, $selected, $extra, $separator, $labels) {
+ $_output = '';
+ if ($labels) $_output .= '<label>';
+ $_output .= '<input type="checkbox" name="'
+ . smarty_function_escape_special_chars($name) . '[]" value="'
+ . smarty_function_escape_special_chars($value) . '"';
+
+ if (in_array((string)$value, $selected)) {
+ $_output .= ' checked="checked"';
+ }
+ $_output .= $extra . ' />' . $output;
+ if ($labels) $_output .= '</label>';
+ $_output .= $separator;
+
+ return $_output;
+}
+
+?>
diff --git a/wp-inst/wp-content/smarty-plugins/function.html_image.php b/wp-inst/wp-content/smarty-plugins/function.html_image.php
new file mode 100644
index 0000000..c62b0fe
--- /dev/null
+++ b/wp-inst/wp-content/smarty-plugins/function.html_image.php
@@ -0,0 +1,139 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty {html_image} function plugin
+ *
+ * Type: function<br>
+ * Name: html_image<br>
+ * Date: Feb 24, 2003<br>
+ * Purpose: format HTML tags for the image<br>
+ * Input:<br>
+ * - file = file (and path) of image (required)
+ * - height = image height (optional, default actual height)
+ * - width = image width (optional, default actual width)
+ * - basedir = base directory for absolute paths, default
+ * is environment variable DOCUMENT_ROOT
+ *
+ * Examples: {html_image file="images/masthead.gif"}
+ * Output: <img src="images/masthead.gif" width=400 height=23>
+ * @link http://smarty.php.net/manual/en/language.function.html.image.php {html_image}
+ * (Smarty online manual)
+ * @author Monte Ohrt <monte at ohrt dot com>
+ * @author credits to Duda <duda@big.hu> - wrote first image function
+ * in repository, helped with lots of functionality
+ * @version 1.0
+ * @param array
+ * @param Smarty
+ * @return string
+ * @uses smarty_function_escape_special_chars()
+ */
+function smarty_function_html_image($params, &$smarty)
+{
+ require_once $smarty->_get_plugin_filepath('shared','escape_special_chars');
+
+ $alt = '';
+ $file = '';
+ $height = '';
+ $width = '';
+ $extra = '';
+ $prefix = '';
+ $suffix = '';
+ $server_vars = ($smarty->request_use_auto_globals) ? $_SERVER : $GLOBALS['HTTP_SERVER_VARS'];
+ $basedir = isset($server_vars['DOCUMENT_ROOT']) ? $server_vars['DOCUMENT_ROOT'] : '';
+ foreach($params as $_key => $_val) {
+ switch($_key) {
+ case 'file':
+ case 'height':
+ case 'width':
+ case 'dpi':
+ case 'basedir':
+ $$_key = $_val;
+ break;
+
+ case 'alt':
+ if(!is_array($_val)) {
+ $$_key = smarty_function_escape_special_chars($_val);
+ } else {
+ $smarty->trigger_error("html_image: extra attribute '$_key' cannot be an array", E_USER_NOTICE);
+ }
+ break;
+
+ case 'link':
+ case 'href':
+ $prefix = '<a href="' . $_val . '">';
+ $suffix = '</a>';
+ break;
+
+ default:
+ if(!is_array($_val)) {
+ $extra .= ' '.$_key.'="'.smarty_function_escape_special_chars($_val).'"';
+ } else {
+ $smarty->trigger_error("html_image: extra attribute '$_key' cannot be an array", E_USER_NOTICE);
+ }
+ break;
+ }
+ }
+
+ if (empty($file)) {
+ $smarty->trigger_error("html_image: missing 'file' parameter", E_USER_NOTICE);
+ return;
+ }
+
+ if (substr($file,0,1) == '/') {
+ $_image_path = $basedir . $file;
+ } else {
+ $_image_path = $file;
+ }
+
+ if(!isset($params['width']) || !isset($params['height'])) {
+ if ($smarty->security &&
+ ($_params = array('resource_type' => 'file', 'resource_name' => $_image_path)) &&
+ (require_once(SMARTY_CORE_DIR . 'core.is_secure.php')) &&
+ (!smarty_core_is_secure($_params, $smarty)) ) {
+ $smarty->trigger_error("html_image: (secure) '$_image_path' not in secure directory", E_USER_NOTICE);
+
+ } elseif (!$_image_data = @getimagesize($_image_path)) {
+ if(!file_exists($_image_path)) {
+ $smarty->trigger_error("html_image: unable to find '$_image_path'", E_USER_NOTICE);
+ return;
+ } else if(!is_readable($_image_path)) {
+ $smarty->trigger_error("html_image: unable to read '$_image_path'", E_USER_NOTICE);
+ return;
+ } else {
+ $smarty->trigger_error("html_image: '$_image_path' is not a valid image file", E_USER_NOTICE);
+ return;
+ }
+ }
+
+ if(!isset($params['width'])) {
+ $width = $_image_data[0];
+ }
+ if(!isset($params['height'])) {
+ $height = $_image_data[1];
+ }
+
+ }
+
+ if(isset($params['dpi'])) {
+ if(strstr($server_vars['HTTP_USER_AGENT'], 'Mac')) {
+ $dpi_default = 72;
+ } else {
+ $dpi_default = 96;
+ }
+ $_resize = $dpi_default/$params['dpi'];
+ $width = round($width * $_resize);
+ $height = round($height * $_resize);
+ }
+
+ return $prefix . '<img src="'.$file.'" alt="'.$alt.'" width="'.$width.'" height="'.$height.'"'.$extra.' />' . $suffix;
+}
+
+/* vim: set expandtab: */
+
+?>
diff --git a/wp-inst/wp-content/smarty-plugins/function.html_options.php b/wp-inst/wp-content/smarty-plugins/function.html_options.php
new file mode 100644
index 0000000..ae864f7
--- /dev/null
+++ b/wp-inst/wp-content/smarty-plugins/function.html_options.php
@@ -0,0 +1,121 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty {html_options} function plugin
+ *
+ * Type: function<br>
+ * Name: html_options<br>
+ * Input:<br>
+ * - name (optional) - string default "select"
+ * - values (required if no options supplied) - array
+ * - options (required if no values supplied) - associative array
+ * - selected (optional) - string default not set
+ * - output (required if not options supplied) - array
+ * Purpose: Prints the list of <option> tags generated from
+ * the passed parameters
+ * @link http://smarty.php.net/manual/en/language.function.html.options.php {html_image}
+ * (Smarty online manual)
+ * @param array
+ * @param Smarty
+ * @return string
+ * @uses smarty_function_escape_special_chars()
+ */
+function smarty_function_html_options($params, &$smarty)
+{
+ require_once $smarty->_get_plugin_filepath('shared','escape_special_chars');
+
+ $name = null;
+ $values = null;
+ $options = null;
+ $selected = array();
+ $output = null;
+
+ $extra = '';
+
+ foreach($params as $_key => $_val) {
+ switch($_key) {
+ case 'name':
+ $$_key = (string)$_val;
+ break;
+
+ case 'options':
+ $$_key = (array)$_val;
+ break;
+
+ case 'values':
+ case 'output':
+ $$_key = array_values((array)$_val);
+ break;
+
+ case 'selected':
+ $$_key = array_map('strval', array_values((array)$_val));
+ break;
+
+ default:
+ if(!is_array($_val)) {
+ $extra .= ' '.$_key.'="'.smarty_function_escape_special_chars($_val).'"';
+ } else {
+ $smarty->trigger_error("html_options: extra attribute '$_key' cannot be an array", E_USER_NOTICE);
+ }
+ break;
+ }
+ }
+
+ if (!isset($options) && !isset($values))
+ return ''; /* raise error here? */
+
+ $_html_result = '';
+
+ if (isset($options)) {
+
+ foreach ($options as $_key=>$_val)
+ $_html_result .= smarty_function_html_options_optoutput($_key, $_val, $selected);
+
+ } else {
+
+ foreach ($values as $_i=>$_key) {
+ $_val = isset($output[$_i]) ? $output[$_i] : '';
+ $_html_result .= smarty_function_html_options_optoutput($_key, $_val, $selected);
+ }
+
+ }
+
+ if(!empty($name)) {
+ $_html_result = '<select name="' . $name . '"' . $extra . '>' . "\n" . $_html_result . '</select>' . "\n";
+ }
+
+ return $_html_result;
+
+}
+
+function smarty_function_html_options_optoutput($key, $value, $selected) {
+ if(!is_array($value)) {
+ $_html_result = '<option label="' . smarty_function_escape_special_chars($value) . '" value="' .
+ smarty_function_escape_special_chars($key) . '"';
+ if (in_array((string)$key, $selected))
+ $_html_result .= ' selected="selected"';
+ $_html_result .= '>' . smarty_function_escape_special_chars($value) . '</option>' . "\n";
+ } else {
+ $_html_result = smarty_function_html_options_optgroup($key, $value, $selected);
+ }
+ return $_html_result;
+}
+
+function smarty_function_html_options_optgroup($key, $values, $selected) {
+ $optgroup_html = '<optgroup label="' . smarty_function_escape_special_chars($key) . '">' . "\n";
+ foreach ($values as $key => $value) {
+ $optgroup_html .= smarty_function_html_options_optoutput($key, $value, $selected);
+ }
+ $optgroup_html .= "</optgroup>\n";
+ return $optgroup_html;
+}
+
+/* vim: set expandtab: */
+
+?>
diff --git a/wp-inst/wp-content/smarty-plugins/function.html_radios.php b/wp-inst/wp-content/smarty-plugins/function.html_radios.php
new file mode 100644
index 0000000..dc7baee
--- /dev/null
+++ b/wp-inst/wp-content/smarty-plugins/function.html_radios.php
@@ -0,0 +1,150 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty {html_radios} function plugin
+ *
+ * File: function.html_radios.php<br>
+ * Type: function<br>
+ * Name: html_radios<br>
+ * Date: 24.Feb.2003<br>
+ * Purpose: Prints out a list of radio input types<br>
+ * Input:<br>
+ * - name (optional) - string default "radio"
+ * - values (required) - array
+ * - options (optional) - associative array
+ * - checked (optional) - array default not set
+ * - separator (optional) - ie <br> or &nbsp;
+ * - output (optional) - the output next to each radio button
+ * - assign (optional) - assign the output as an array to this variable
+ * Examples:
+ * <pre>
+ * {html_radios values=$ids output=$names}
+ * {html_radios values=$ids name='box' separator='<br>' output=$names}
+ * {html_radios values=$ids checked=$checked separator='<br>' output=$names}
+ * </pre>
+ * @link http://smarty.php.net/manual/en/language.function.html.radios.php {html_radios}
+ * (Smarty online manual)
+ * @author Christopher Kvarme <christopher.kvarme@flashjab.com>
+ * @author credits to Monte Ohrt <monte at ohrt dot com>
+ * @version 1.0
+ * @param array
+ * @param Smarty
+ * @return string
+ * @uses smarty_function_escape_special_chars()
+ */
+function smarty_function_html_radios($params, &$smarty)
+{
+ require_once $smarty->_get_plugin_filepath('shared','escape_special_chars');
+
+ $name = 'radio';
+ $values = null;
+ $options = null;
+ $selected = null;
+ $separator = '';
+ $labels = true;
+ $output = null;
+ $extra = '';
+
+ foreach($params as $_key => $_val) {
+ switch($_key) {
+ case 'name':
+ case 'separator':
+ $$_key = (string)$_val;
+ break;
+
+ case 'checked':
+ case 'selected':
+ if(is_array($_val)) {
+ $smarty->trigger_error('html_radios: the "' . $_key . '" attribute cannot be an array', E_USER_WARNING);
+ } else {
+ $selected = (string)$_val;
+ }
+ break;
+
+ case 'labels':
+ $$_key = (bool)$_val;
+ break;
+
+ case 'options':
+ $$_key = (array)$_val;
+ break;
+
+ case 'values':
+ case 'output':
+ $$_key = array_values((array)$_val);
+ break;
+
+ case 'radios':
+ $smarty->trigger_error('html_radios: the use of the "radios" attribute is deprecated, use "options" instead', E_USER_WARNING);
+ $options = (array)$_val;
+ break;
+
+ case 'assign':
+ break;
+
+ default:
+ if(!is_array($_val)) {
+ $extra .= ' '.$_key.'="'.smarty_function_escape_special_chars($_val).'"';
+ } else {
+ $smarty->trigger_error("html_radios: extra attribute '$_key' cannot be an array", E_USER_NOTICE);
+ }
+ break;
+ }
+ }
+
+ if (!isset($options) && !isset($values))
+ return ''; /* raise error here? */
+
+ $_html_result = array();
+
+ if (isset($options)) {
+
+ foreach ($options as $_key=>$_val)
+ $_html_result[] = smarty_function_html_radios_output($name, $_key, $_val, $selected, $extra, $separator, $labels);
+
+ } else {
+
+ foreach ($values as $_i=>$_key) {
+ $_val = isset($output[$_i]) ? $output[$_i] : '';
+ $_html_result[] = smarty_function_html_radios_output($name, $_key, $_val, $selected, $extra, $separator, $labels);
+ }
+
+ }
+
+ if(!empty($params['assign'])) {
+ $smarty->assign($params['assign'], $_html_result);
+ } else {
+ return implode("\n",$_html_result);
+ }
+
+}
+
+function smarty_function_html_radios_output($name, $value, $output, $selected, $extra, $separator, $labels) {
+ $_output = '';
+ if ($labels) {
+ $_id = smarty_function_escape_special_chars($name . '_' . $value);
+ $_output .= '<label for="' . $_id . '">';
+ }
+ $_output .= '<input type="radio" name="'
+ . smarty_function_escape_special_chars($name) . '" value="'
+ . smarty_function_escape_special_chars($value) . '"';
+
+ if ($labels) $_output .= ' id="' . $_id . '"';
+
+ if ($value==$selected) {
+ $_output .= ' checked="checked"';
+ }
+ $_output .= $extra . ' />' . $output;
+ if ($labels) $_output .= '</label>';
+ $_output .= $separator;
+
+ return $_output;
+}
+
+?>
diff --git a/wp-inst/wp-content/smarty-plugins/function.html_select_date.php b/wp-inst/wp-content/smarty-plugins/function.html_select_date.php
new file mode 100644
index 0000000..fc2d449
--- /dev/null
+++ b/wp-inst/wp-content/smarty-plugins/function.html_select_date.php
@@ -0,0 +1,316 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+/**
+ * Smarty {html_select_date} plugin
+ *
+ * Type: function<br>
+ * Name: html_select_date<br>
+ * Purpose: Prints the dropdowns for date selection.
+ *
+ * ChangeLog:<br>
+ * - 1.0 initial release
+ * - 1.1 added support for +/- N syntax for begin
+ * and end year values. (Monte)
+ * - 1.2 added support for yyyy-mm-dd syntax for
+ * time value. (Jan Rosier)
+ * - 1.3 added support for choosing format for
+ * month values (Gary Loescher)
+ * - 1.3.1 added support for choosing format for
+ * day values (Marcus Bointon)
+ * - 1.3.2 suppport negative timestamps, force year
+ * dropdown to include given date unless explicitly set (Monte)
+ * @link http://smarty.php.net/manual/en/language.function.html.select.date.php {html_select_date}
+ * (Smarty online manual)
+ * @version 1.3.2
+ * @author Andrei Zmievski
+ * @param array
+ * @param Smarty
+ * @return string
+ */
+function smarty_function_html_select_date($params, &$smarty)
+{
+ require_once $smarty->_get_plugin_filepath('shared','make_timestamp');
+ require_once $smarty->_get_plugin_filepath('function','html_options');
+ /* Default values. */
+ $prefix = "Date_";
+ $start_year = strftime("%Y");
+ $end_year = $start_year;
+ $display_days = true;
+ $display_months = true;
+ $display_years = true;
+ $month_format = "%B";
+ /* Write months as numbers by default GL */
+ $month_value_format = "%m";
+ $day_format = "%02d";
+ /* Write day values using this format MB */
+ $day_value_format = "%d";
+ $year_as_text = false;
+ /* Display years in reverse order? Ie. 2000,1999,.... */
+ $reverse_years = false;
+ /* Should the select boxes be part of an array when returned from PHP?
+ e.g. setting it to "birthday", would create "birthday[Day]",
+ "birthday[Month]" & "birthday[Year]". Can be combined with prefix */
+ $field_array = null;
+ /* <select size>'s of the different <select> tags.
+ If not set, uses default dropdown. */
+ $day_size = null;
+ $month_size = null;
+ $year_size = null;
+ /* Unparsed attributes common to *ALL* the <select>/<input> tags.
+ An example might be in the template: all_extra ='class ="foo"'. */
+ $all_extra = null;
+ /* Separate attributes for the tags. */
+ $day_extra = null;
+ $month_extra = null;
+ $year_extra = null;
+ /* Order in which to display the fields.
+ "D" -> day, "M" -> month, "Y" -> year. */
+ $field_order = 'MDY';
+ /* String printed between the different fields. */
+ $field_separator = "\n";
+ $time = time();
+ $all_empty = null;
+ $day_empty = null;
+ $month_empty = null;
+ $year_empty = null;
+
+ foreach ($params as $_key=>$_value) {
+ switch ($_key) {
+ case 'prefix':
+ case 'time':
+ case 'start_year':
+ case 'end_year':
+ case 'month_format':
+ case 'day_format':
+ case 'day_value_format':
+ case 'field_array':
+ case 'day_size':
+ case 'month_size':
+ case 'year_size':
+ case 'all_extra':
+ case 'day_extra':
+ case 'month_extra':
+ case 'year_extra':
+ case 'field_order':
+ case 'field_separator':
+ case 'month_value_format':
+ case 'month_empty':
+ case 'day_empty':
+ case 'year_empty':
+ $$_key = (string)$_value;
+ break;
+
+ case 'all_empty':
+ $$_key = (string)$_value;
+ $day_empty = $month_empty = $year_empty = $all_empty;
+ break;
+
+ case 'display_days':
+ case 'display_months':
+ case 'display_years':
+ case 'year_as_text':
+ case 'reverse_years':
+ $$_key = (bool)$_value;
+ break;
+
+ default:
+ $smarty->trigger_error("[html_select_date] unknown parameter $_key", E_USER_WARNING);
+
+ }
+ }
+
+ if(preg_match('!^-\d+$!',$time)) {
+ // negative timestamp, use date()
+ $time = date('Y-m-d',$time);
+ }
+ // If $time is not in format yyyy-mm-dd
+ if (!preg_match('/^\d{0,4}-\d{0,2}-\d{0,2}$/', $time)) {
+ // use smarty_make_timestamp to get an unix timestamp and
+ // strftime to make yyyy-mm-dd
+ $time = strftime('%Y-%m-%d', smarty_make_timestamp($time));
+ }
+ // Now split this in pieces, which later can be used to set the select
+ $time = explode("-", $time);
+
+ // make syntax "+N" or "-N" work with start_year and end_year
+ if (preg_match('!^(\+|\-)\s*(\d+)$!', $end_year, $match)) {
+ if ($match[1] == '+') {
+ $end_year = strftime('%Y') + $match[2];
+ } else {
+ $end_year = strftime('%Y') - $match[2];
+ }
+ }
+ if (preg_match('!^(\+|\-)\s*(\d+)$!', $start_year, $match)) {
+ if ($match[1] == '+') {
+ $start_year = strftime('%Y') + $match[2];
+ } else {
+ $start_year = strftime('%Y') - $match[2];
+ }
+ }
+ if (strlen($time[0]) > 0) {
+ if ($start_year > $time[0] && !isset($params['start_year'])) {
+ // force start year to include given date if not explicitly set
+ $start_year = $time[0];
+ }
+ if($end_year < $time[0] && !isset($params['end_year'])) {
+ // force end year to include given date if not explicitly set
+ $end_year = $time[0];
+ }
+ }
+
+ $field_order = strtoupper($field_order);
+
+ $html_result = $month_result = $day_result = $year_result = "";
+
+ if ($display_months) {
+ $month_names = array();
+ $month_values = array();
+ if(isset($month_empty)) {
+ $month_names[''] = $month_empty;
+ $month_values[''] = '';
+ }
+ for ($i = 1; $i <= 12; $i++) {
+ $month_names[$i] = strftime($month_format, mktime(0, 0, 0, $i, 1, 2000));
+ $month_values[$i] = strftime($month_value_format, mktime(0, 0, 0, $i, 1, 2000));
+ }
+
+ $month_result .= '<select name=';
+ if (null !== $field_array){
+ $month_result .= '"' . $field_array . '[' . $prefix . 'Month]"';
+ } else {
+ $month_result .= '"' . $prefix . 'Month"';
+ }
+ if (null !== $month_size){
+ $month_result .= ' size="' . $month_size . '"';
+ }
+ if (null !== $month_extra){
+ $month_result .= ' ' . $month_extra;
+ }
+ if (null !== $all_extra){
+ $month_result .= ' ' . $all_extra;
+ }
+ $month_result .= '>'."\n";
+
+ $month_result .= smarty_function_html_options(array('output' => $month_names,
+ 'values' => $month_values,
+ 'selected' => $a=$time[1] ? strftime($month_value_format, mktime(0, 0, 0, (int)$time[1], 1, 2000)) : '',
+ 'print_result' => false),
+ $smarty);
+ $month_result .= '</select>';
+ }
+
+ if ($display_days) {
+ $days = array();
+ if (isset($day_empty)) {
+ $days[''] = $day_empty;
+ $day_values[''] = '';
+ }
+ for ($i = 1; $i <= 31; $i++) {
+ $days[] = sprintf($day_format, $i);
+ $day_values[] = sprintf($day_value_format, $i);
+ }
+
+ $day_result .= '<select name=';
+ if (null !== $field_array){
+ $day_result .= '"' . $field_array . '[' . $prefix . 'Day]"';
+ } else {
+ $day_result .= '"' . $prefix . 'Day"';
+ }
+ if (null !== $day_size){
+ $day_result .= ' size="' . $day_size . '"';
+ }
+ if (null !== $all_extra){
+ $day_result .= ' ' . $all_extra;
+ }
+ if (null !== $day_extra){
+ $day_result .= ' ' . $day_extra;
+ }
+ $day_result .= '>'."\n";
+ $day_result .= smarty_function_html_options(array('output' => $days,
+ 'values' => $day_values,
+ 'selected' => $time[2],
+ 'print_result' => false),
+ $smarty);
+ $day_result .= '</select>';
+ }
+
+ if ($display_years) {
+ if (null !== $field_array){
+ $year_name = $field_array . '[' . $prefix . 'Year]';
+ } else {
+ $year_name = $prefix . 'Year';
+ }
+ if ($year_as_text) {
+ $year_result .= '<input type="text" name="' . $year_name . '" value="' . $time[0] . '" size="4" maxlength="4"';
+ if (null !== $all_extra){
+ $year_result .= ' ' . $all_extra;
+ }
+ if (null !== $year_extra){
+ $year_result .= ' ' . $year_extra;
+ }
+ $year_result .= '>';
+ } else {
+ $years = range((int)$start_year, (int)$end_year);
+ if ($reverse_years) {
+ rsort($years, SORT_NUMERIC);
+ } else {
+ sort($years, SORT_NUMERIC);
+ }
+ $yearvals = $years;
+ if(isset($year_empty)) {
+ array_unshift($years, $year_empty);
+ array_unshift($yearvals, '');
+ }
+ $year_result .= '<select name="' . $year_name . '"';
+ if (null !== $year_size){
+ $year_result .= ' size="' . $year_size . '"';
+ }
+ if (null !== $all_extra){
+ $year_result .= ' ' . $all_extra;
+ }
+ if (null !== $year_extra){
+ $year_result .= ' ' . $year_extra;
+ }
+ $year_result .= '>'."\n";
+ $year_result .= smarty_function_html_options(array('output' => $years,
+ 'values' => $yearvals,
+ 'selected' => $time[0],
+ 'print_result' => false),
+ $smarty);
+ $year_result .= '</select>';
+ }
+ }
+
+ // Loop thru the field_order field
+ for ($i = 0; $i <= 2; $i++){
+ $c = substr($field_order, $i, 1);
+ switch ($c){
+ case 'D':
+ $html_result .= $day_result;
+ break;
+
+ case 'M':
+ $html_result .= $month_result;
+ break;
+
+ case 'Y':
+ $html_result .= $year_result;
+ break;
+ }
+ // Add the field seperator
+ if($i != 2) {
+ $html_result .= $field_separator;
+ }
+ }
+
+ return $html_result;
+}
+
+/* vim: set expandtab: */
+
+?>
diff --git a/wp-inst/wp-content/smarty-plugins/function.html_select_time.php b/wp-inst/wp-content/smarty-plugins/function.html_select_time.php
new file mode 100644
index 0000000..00cd1ae
--- /dev/null
+++ b/wp-inst/wp-content/smarty-plugins/function.html_select_time.php
@@ -0,0 +1,192 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty {html_select_time} function plugin
+ *
+ * Type: function<br>
+ * Name: html_select_time<br>
+ * Purpose: Prints the dropdowns for time selection
+ * @link http://smarty.php.net/manual/en/language.function.html.select.time.php {html_select_time}
+ * (Smarty online manual)
+ * @param array
+ * @param Smarty
+ * @return string
+ * @uses smarty_make_timestamp()
+ */
+function smarty_function_html_select_time($params, &$smarty)
+{
+ require_once $smarty->_get_plugin_filepath('shared','make_timestamp');
+ require_once $smarty->_get_plugin_filepath('function','html_options');
+ /* Default values. */
+ $prefix = "Time_";
+ $time = time();
+ $display_hours = true;
+ $display_minutes = true;
+ $display_seconds = true;
+ $display_meridian = true;
+ $use_24_hours = true;
+ $minute_interval = 1;
+ $second_interval = 1;
+ /* Should the select boxes be part of an array when returned from PHP?
+ e.g. setting it to "birthday", would create "birthday[Hour]",
+ "birthday[Minute]", "birthday[Seconds]" & "birthday[Meridian]".
+ Can be combined with prefix. */
+ $field_array = null;
+ $all_extra = null;
+ $hour_extra = null;
+ $minute_extra = null;
+ $second_extra = null;
+ $meridian_extra = null;
+
+ foreach ($params as $_key=>$_value) {
+ switch ($_key) {
+ case 'prefix':
+ case 'time':
+ case 'field_array':
+ case 'all_extra':
+ case 'hour_extra':
+ case 'minute_extra':
+ case 'second_extra':
+ case 'meridian_extra':
+ $$_key = (string)$_value;
+ break;
+
+ case 'display_hours':
+ case 'display_minutes':
+ case 'display_seconds':
+ case 'display_meridian':
+ case 'use_24_hours':
+ $$_key = (bool)$_value;
+ break;
+
+ case 'minute_interval':
+ case 'second_interval':
+ $$_key = (int)$_value;
+ break;
+
+ default:
+ $smarty->trigger_error("[html_select_time] unknown parameter $_key", E_USER_WARNING);
+ }
+ }
+
+ $time = smarty_make_timestamp($time);
+
+ $html_result = '';
+
+ if ($display_hours) {
+ $hours = $use_24_hours ? range(0, 23) : range(1, 12);
+ $hour_fmt = $use_24_hours ? '%H' : '%I';
+ for ($i = 0, $for_max = count($hours); $i < $for_max; $i++)
+ $hours[$i] = sprintf('%02d', $hours[$i]);
+ $html_result .= '<select name=';
+ if (null !== $field_array) {
+ $html_result .= '"' . $field_array . '[' . $prefix . 'Hour]"';
+ } else {
+ $html_result .= '"' . $prefix . 'Hour"';
+ }
+ if (null !== $hour_extra){
+ $html_result .= ' ' . $hour_extra;
+ }
+ if (null !== $all_extra){
+ $html_result .= ' ' . $all_extra;
+ }
+ $html_result .= '>'."\n";
+ $html_result .= smarty_function_html_options(array('output' => $hours,
+ 'values' => $hours,
+ 'selected' => strftime($hour_fmt, $time),
+ 'print_result' => false),
+ $smarty);
+ $html_result .= "</select>\n";
+ }
+
+ if ($display_minutes) {
+ $all_minutes = range(0, 59);
+ for ($i = 0, $for_max = count($all_minutes); $i < $for_max; $i+= $minute_interval)
+ $minutes[] = sprintf('%02d', $all_minutes[$i]);
+ $selected = intval(floor(strftime('%M', $time) / $minute_interval) * $minute_interval);
+ $html_result .= '<select name=';
+ if (null !== $field_array) {
+ $html_result .= '"' . $field_array . '[' . $prefix . 'Minute]"';
+ } else {
+ $html_result .= '"' . $prefix . 'Minute"';
+ }
+ if (null !== $minute_extra){
+ $html_result .= ' ' . $minute_extra;
+ }
+ if (null !== $all_extra){
+ $html_result .= ' ' . $all_extra;
+ }
+ $html_result .= '>'."\n";
+
+ $html_result .= smarty_function_html_options(array('output' => $minutes,
+ 'values' => $minutes,
+ 'selected' => $selected,
+ 'print_result' => false),
+ $smarty);
+ $html_result .= "</select>\n";
+ }
+
+ if ($display_seconds) {
+ $all_seconds = range(0, 59);
+ for ($i = 0, $for_max = count($all_seconds); $i < $for_max; $i+= $second_interval)
+ $seconds[] = sprintf('%02d', $all_seconds[$i]);
+ $selected = intval(floor(strftime('%S', $time) / $second_interval) * $second_interval);
+ $html_result .= '<select name=';
+ if (null !== $field_array) {
+ $html_result .= '"' . $field_array . '[' . $prefix . 'Second]"';
+ } else {
+ $html_result .= '"' . $prefix . 'Second"';
+ }
+
+ if (null !== $second_extra){
+ $html_result .= ' ' . $second_extra;
+ }
+ if (null !== $all_extra){
+ $html_result .= ' ' . $all_extra;
+ }
+ $html_result .= '>'."\n";
+
+ $html_result .= smarty_function_html_options(array('output' => $seconds,
+ 'values' => $seconds,
+ 'selected' => $selected,
+ 'print_result' => false),
+ $smarty);
+ $html_result .= "</select>\n";
+ }
+
+ if ($display_meridian && !$use_24_hours) {
+ $html_result .= '<select name=';
+ if (null !== $field_array) {
+ $html_result .= '"' . $field_array . '[' . $prefix . 'Meridian]"';
+ } else {
+ $html_result .= '"' . $prefix . 'Meridian"';
+ }
+
+ if (null !== $meridian_extra){
+ $html_result .= ' ' . $meridian_extra;
+ }
+ if (null !== $all_extra){
+ $html_result .= ' ' . $all_extra;
+ }
+ $html_result .= '>'."\n";
+
+ $html_result .= smarty_function_html_options(array('output' => array('AM', 'PM'),
+ 'values' => array('am', 'pm'),
+ 'selected' => strtolower(strftime('%p', $time)),
+ 'print_result' => false),
+ $smarty);
+ $html_result .= "</select>\n";
+ }
+
+ return $html_result;
+}
+
+/* vim: set expandtab: */
+
+?>
diff --git a/wp-inst/wp-content/smarty-plugins/function.html_table.php b/wp-inst/wp-content/smarty-plugins/function.html_table.php
new file mode 100644
index 0000000..62d7410
--- /dev/null
+++ b/wp-inst/wp-content/smarty-plugins/function.html_table.php
@@ -0,0 +1,137 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty {html_table} function plugin
+ *
+ * Type: function<br>
+ * Name: html_table<br>
+ * Date: Feb 17, 2003<br>
+ * Purpose: make an html table from an array of data<br>
+ * Input:<br>
+ * - loop = array to loop through
+ * - cols = number of columns
+ * - rows = number of rows
+ * - table_attr = table attributes
+ * - tr_attr = table row attributes (arrays are cycled)
+ * - td_attr = table cell attributes (arrays are cycled)
+ * - trailpad = value to pad trailing cells with
+ * - vdir = vertical direction (default: "down", means top-to-bottom)
+ * - hdir = horizontal direction (default: "right", means left-to-right)
+ * - inner = inner loop (default "cols": print $loop line by line,
+ * $loop will be printed column by column otherwise)
+ *
+ *
+ * Examples:
+ * <pre>
+ * {table loop=$data}
+ * {table loop=$data cols=4 tr_attr='"bgcolor=red"'}
+ * {table loop=$data cols=4 tr_attr=$colors}
+ * </pre>
+ * @author Monte Ohrt <monte at ohrt dot com>
+ * @version 1.0
+ * @link http://smarty.php.net/manual/en/language.function.html.table.php {html_table}
+ * (Smarty online manual)
+ * @param array
+ * @param Smarty
+ * @return string
+ */
+function smarty_function_html_table($params, &$smarty)
+{
+ $table_attr = 'border="1"';
+ $tr_attr = '';
+ $td_attr = '';
+ $cols = 3;
+ $rows = 3;
+ $trailpad = '&nbsp;';
+ $vdir = 'down';
+ $hdir = 'right';
+ $inner = 'cols';
+
+ if (!isset($params['loop'])) {
+ $smarty->trigger_error("html_table: missing 'loop' parameter");
+ return;
+ }
+
+ foreach ($params as $_key=>$_value) {
+ switch ($_key) {
+ case 'loop':
+ $$_key = (array)$_value;
+ break;
+
+ case 'cols':
+ case 'rows':
+ $$_key = (int)$_value;
+ break;
+
+ case 'table_attr':
+ case 'trailpad':
+ case 'hdir':
+ case 'vdir':
+ case 'inner':
+ $$_key = (string)$_value;
+ break;
+
+ case 'tr_attr':
+ case 'td_attr':
+ $$_key = $_value;
+ break;
+ }
+ }
+
+ $loop_count = count($loop);
+ if (empty($params['rows'])) {
+ /* no rows specified */
+ $rows = ceil($loop_count/$cols);
+ } elseif (empty($params['cols'])) {
+ if (!empty($params['rows'])) {
+ /* no cols specified, but rows */
+ $cols = ceil($loop_count/$rows);
+ }
+ }
+
+ $output = "<table $table_attr>\n";
+
+ for ($r=0; $r<$rows; $r++) {
+ $output .= "<tr" . smarty_function_html_table_cycle('tr', $tr_attr, $r) . ">\n";
+ $rx = ($vdir == 'down') ? $r*$cols : ($rows-1-$r)*$cols;
+
+ for ($c=0; $c<$cols; $c++) {
+ $x = ($hdir == 'right') ? $rx+$c : $rx+$cols-1-$c;
+ if ($inner!='cols') {
+ /* shuffle x to loop over rows*/
+ $x = floor($x/$cols) + ($x%$cols)*$rows;
+ }
+
+ if ($x<$loop_count) {
+ $output .= "<td" . smarty_function_html_table_cycle('td', $td_attr, $c) . ">" . $loop[$x] . "</td>\n";
+ } else {
+ $output .= "<td" . smarty_function_html_table_cycle('td', $td_attr, $c) . ">$trailpad</td>\n";
+ }
+ }
+ $output .= "</tr>\n";
+ }
+ $output .= "</table>\n";
+
+ return $output;
+}
+
+function smarty_function_html_table_cycle($name, $var, $no) {
+ if(!is_array($var)) {
+ $ret = $var;
+ } else {
+ $ret = $var[$no % count($var)];
+ }
+
+ return ($ret) ? ' '.$ret : '';
+}
+
+
+/* vim: set expandtab: */
+
+?>
diff --git a/wp-inst/wp-content/smarty-plugins/function.is_aside.php b/wp-inst/wp-content/smarty-plugins/function.is_aside.php
new file mode 100644
index 0000000..495407d
--- /dev/null
+++ b/wp-inst/wp-content/smarty-plugins/function.is_aside.php
@@ -0,0 +1,42 @@
+<?php
+
+/*
+ * Smarty plugin
+ * -------------------------------------------------------------
+ * Type: function
+ * Name: assign
+ * Purpose: assign a value to a template variable
+ * -------------------------------------------------------------
+ */
+function smarty_function_is_aside($params, &$smarty)
+{
+ extract($params);
+
+ $category = get_the_category();
+ //$wpsmarty->assign( "category", $category[0]->cat_name );
+ $t = count( $category );
+ $ret = false;
+ if( $t > 1 )
+ {
+ for( $i = 0; $i < $t; $i++ )
+ {
+ if( $category[$i]->cat_name == 'Asides' )
+ {
+ $ret = true;
+ }
+ }
+ }
+ else
+ {
+ if( $category[0]->cat_name == 'Asides' )
+ {
+ $ret = true;
+ }
+ }
+
+ $smarty->assign( "is_aside", $ret );
+}
+
+/* vim: set expandtab: */
+
+?>
diff --git a/wp-inst/wp-content/smarty-plugins/function.lastposts.php b/wp-inst/wp-content/smarty-plugins/function.lastposts.php
new file mode 100644
index 0000000..60da376
--- /dev/null
+++ b/wp-inst/wp-content/smarty-plugins/function.lastposts.php
@@ -0,0 +1,66 @@
+<?php
+
+/* $Id: function.lastposts.php,v 1.3 2005/01/09 11:54:18 donncha Exp $ */
+
+
+/*
+ * Smarty plugin
+ * -------------------------------------------------------------
+ * Type: function
+ * Name: lastposts
+ * Purpose: Returns a list of the last posts to the blog
+ * -------------------------------------------------------------
+ */
+
+function getposts( $wpblog, $posts )
+{
+ global $wpdb;
+
+ $query = "SELECT ID, post_title
+ FROM ".$wpdb->posts."
+ WHERE unix_timestamp( post_date ) < unix_timestamp( NOW() )
+ AND post_status = 'publish'
+ ORDER BY `post_date` DESC LIMIT 0, ".intval( $posts );
+ $result = $wpdb->get_results( $query );
+ if( $result )
+ {
+ foreach( $result as $details )
+ {
+ $postdata[ $details->ID ] = stripslashes( strip_tags( $details->post_title ) );
+ }
+
+ return $postdata;
+ }
+ else
+ {
+ return false;
+ }
+}
+
+function smarty_function_lastposts($params, &$smarty)
+{
+
+ global $wpblog;
+
+ $posts = 10;
+ extract($params);
+
+ if( $posts > 40 )
+ $posts = 40;
+
+ if( @include_once( "Cache/Function.php" ) )
+ {
+ $cache = new Cache_Function( 'file', array('cache_dir' => ABSPATH . "/wp-content/smarty-cache", 'filename_prefix' => 'lastposts_cache_' ), 600 );
+ $lastposts = $cache->call( "getposts", $wpblog, $posts );
+ }
+ else
+ {
+ $lastposts = getposts( $wpblog, $posts );
+ }
+
+ $smarty->assign( "lastposts", $lastposts );
+}
+
+/* vim: set expandtab: */
+
+?>
diff --git a/wp-inst/wp-content/smarty-plugins/function.mailto.php b/wp-inst/wp-content/smarty-plugins/function.mailto.php
new file mode 100644
index 0000000..64c122c
--- /dev/null
+++ b/wp-inst/wp-content/smarty-plugins/function.mailto.php
@@ -0,0 +1,163 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty {mailto} function plugin
+ *
+ * Type: function<br>
+ * Name: mailto<br>
+ * Date: May 21, 2002
+ * Purpose: automate mailto address link creation, and optionally
+ * encode them.<br>
+ * Input:<br>
+ * - address = e-mail address
+ * - text = (optional) text to display, default is address
+ * - encode = (optional) can be one of:
+ * * none : no encoding (default)
+ * * javascript : encode with javascript
+ * * javascript_charcode : encode with javascript charcode
+ * * hex : encode with hexidecimal (no javascript)
+ * - cc = (optional) address(es) to carbon copy
+ * - bcc = (optional) address(es) to blind carbon copy
+ * - subject = (optional) e-mail subject
+ * - newsgroups = (optional) newsgroup(s) to post to
+ * - followupto = (optional) address(es) to follow up to
+ * - extra = (optional) extra tags for the href link
+ *
+ * Examples:
+ * <pre>
+ * {mailto address="me@domain.com"}
+ * {mailto address="me@domain.com" encode="javascript"}
+ * {mailto address="me@domain.com" encode="hex"}
+ * {mailto address="me@domain.com" subject="Hello to you!"}
+ * {mailto address="me@domain.com" cc="you@domain.com,they@domain.com"}
+ * {mailto address="me@domain.com" extra='class="mailto"'}
+ * </pre>
+ * @link http://smarty.php.net/manual/en/language.function.mailto.php {mailto}
+ * (Smarty online manual)
+ * @version 1.2
+ * @author Monte Ohrt <monte at ohrt dot com>
+ * @author credits to Jason Sweat (added cc, bcc and subject functionality)
+ * @param array
+ * @param Smarty
+ * @return string
+ */
+function smarty_function_mailto($params, &$smarty)
+{
+ $extra = '';
+
+ if (empty($params['address'])) {
+ $smarty->trigger_error("mailto: missing 'address' parameter");
+ return;
+ } else {
+ $address = $params['address'];
+ }
+
+ $text = $address;
+
+ // netscape and mozilla do not decode %40 (@) in BCC field (bug?)
+ // so, don't encode it.
+ $mail_parms = array();
+ foreach ($params as $var=>$value) {
+ switch ($var) {
+ case 'cc':
+ case 'bcc':
+ case 'followupto':
+ if (!empty($value))
+ $mail_parms[] = $var.'='.str_replace('%40','@',rawurlencode($value));
+ break;
+
+ case 'subject':
+ case 'newsgroups':
+ $mail_parms[] = $var.'='.rawurlencode($value);
+ break;
+
+ case 'extra':
+ case 'text':
+ $$var = $value;
+
+ default:
+ }
+ }
+
+ $mail_parm_vals = '';
+ for ($i=0; $i<count($mail_parms); $i++) {
+ $mail_parm_vals .= (0==$i) ? '?' : '&';
+ $mail_parm_vals .= $mail_parms[$i];
+ }
+ $address .= $mail_parm_vals;
+
+ $encode = (empty($params['encode'])) ? 'none' : $params['encode'];
+ if (!in_array($encode,array('javascript','javascript_charcode','hex','none')) ) {
+ $smarty->trigger_error("mailto: 'encode' parameter must be none, javascript or hex");
+ return;
+ }
+
+ if ($encode == 'javascript' ) {
+ $string = 'document.write(\'<a href="mailto:'.$address.'" '.$extra.'>'.$text.'</a>\');';
+
+ $js_encode = '';
+ for ($x=0; $x < strlen($string); $x++) {
+ $js_encode .= '%' . bin2hex($string[$x]);
+ }
+
+ return '<script type="text/javascript">eval(unescape(\''.$js_encode.'\'))</script>';
+
+ } elseif ($encode == 'javascript_charcode' ) {
+ $string = '<a href="mailto:'.$address.'" '.$extra.'>'.$text.'</a>';
+
+ for($x = 0, $y = strlen($string); $x < $y; $x++ ) {
+ $ord[] = ord($string[$x]);
+ }
+
+ $_ret = "<script type=\"text/javascript\" language=\"javascript\">\n";
+ $_ret .= "<!--\n";
+ $_ret .= "{document.write(String.fromCharCode(";
+ $_ret .= implode(',',$ord);
+ $_ret .= "))";
+ $_ret .= "}\n";
+ $_ret .= "//-->\n";
+ $_ret .= "</script>\n";
+
+ return $_ret;
+
+
+ } elseif ($encode == 'hex') {
+
+ preg_match('!^(.*)(\?.*)$!',$address,$match);
+ if(!empty($match[2])) {
+ $smarty->trigger_error("mailto: hex encoding does not work with extra attributes. Try javascript.");
+ return;
+ }
+ $address_encode = '';
+ for ($x=0; $x < strlen($address); $x++) {
+ if(preg_match('!\w!',$address[$x])) {
+ $address_encode .= '%' . bin2hex($address[$x]);
+ } else {
+ $address_encode .= $address[$x];
+ }
+ }
+ $text_encode = '';
+ for ($x=0; $x < strlen($text); $x++) {
+ $text_encode .= '&#x' . bin2hex($text[$x]).';';
+ }
+
+ $mailto = "&#109;&#97;&#105;&#108;&#116;&#111;&#58;";
+ return '<a href="'.$mailto.$address_encode.'" '.$extra.'>'.$text_encode.'</a>';
+
+ } else {
+ // no encoding
+ return '<a href="mailto:'.$address.'" '.$extra.'>'.$text.'</a>';
+
+ }
+
+}
+
+/* vim: set expandtab: */
+
+?>
diff --git a/wp-inst/wp-content/smarty-plugins/function.math.php b/wp-inst/wp-content/smarty-plugins/function.math.php
new file mode 100644
index 0000000..0439107
--- /dev/null
+++ b/wp-inst/wp-content/smarty-plugins/function.math.php
@@ -0,0 +1,83 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty {math} function plugin
+ *
+ * Type: function<br>
+ * Name: math<br>
+ * Purpose: handle math computations in template<br>
+ * @link http://smarty.php.net/manual/en/language.function.math.php {math}
+ * (Smarty online manual)
+ * @param array
+ * @param Smarty
+ * @return string
+ */
+function smarty_function_math($params, &$smarty)
+{
+ // be sure equation parameter is present
+ if (empty($params['equation'])) {
+ $smarty->trigger_error("math: missing equation parameter");
+ return;
+ }
+
+ $equation = $params['equation'];
+
+ // make sure parenthesis are balanced
+ if (substr_count($equation,"(") != substr_count($equation,")")) {
+ $smarty->trigger_error("math: unbalanced parenthesis");
+ return;
+ }
+
+ // match all vars in equation, make sure all are passed
+ preg_match_all("!(?:0x[a-fA-F0-9]+)|([a-zA-Z][a-zA-Z0-9_]+)!",$equation, $match);
+ $allowed_funcs = array('int','abs','ceil','cos','exp','floor','log','log10',
+ 'max','min','pi','pow','rand','round','sin','sqrt','srand','tan');
+
+ foreach($match[1] as $curr_var) {
+ if ($curr_var && !in_array($curr_var, array_keys($params)) && !in_array($curr_var, $allowed_funcs)) {
+ $smarty->trigger_error("math: function call $curr_var not allowed");
+ return;
+ }
+ }
+
+ foreach($params as $key => $val) {
+ if ($key != "equation" && $key != "format" && $key != "assign") {
+ // make sure value is not empty
+ if (strlen($val)==0) {
+ $smarty->trigger_error("math: parameter $key is empty");
+ return;
+ }
+ if (!is_numeric($val)) {
+ $smarty->trigger_error("math: parameter $key: is not numeric");
+ return;
+ }
+ $equation = preg_replace("/\b$key\b/",$val, $equation);
+ }
+ }
+
+ eval("\$smarty_math_result = ".$equation.";");
+
+ if (empty($params['format'])) {
+ if (empty($params['assign'])) {
+ return $smarty_math_result;
+ } else {
+ $smarty->assign($params['assign'],$smarty_math_result);
+ }
+ } else {
+ if (empty($params['assign'])){
+ printf($params['format'],$smarty_math_result);
+ } else {
+ $smarty->assign($params['assign'],sprintf($params['format'],$smarty_math_result));
+ }
+ }
+}
+
+/* vim: set expandtab: */
+
+?>
diff --git a/wp-inst/wp-content/smarty-plugins/function.photoblog.php b/wp-inst/wp-content/smarty-plugins/function.photoblog.php
new file mode 100644
index 0000000..984fda1
--- /dev/null
+++ b/wp-inst/wp-content/smarty-plugins/function.photoblog.php
@@ -0,0 +1,102 @@
+<?php
+
+/* $Id: function.photoblog.php,v 1.4 2004/11/30 00:50:56 donncha Exp $ */
+
+/*
+ * Smarty plugin
+ * -------------------------------------------------------------
+ * File: function.photoblog.php
+ * Type: function
+ * Name: photoblog
+ * Purpose: outputs an image from the images/ directory.
+ * -------------------------------------------------------------
+ */
+function get_post_id( $when )
+{
+ global $wpdb;
+ $query = "SELECT post_id FROM ".$wpdb->postmeta." WHERE meta_key='photoblog' AND meta_value='".$when."'";
+ $post_id = $wpdb->get_var( $query );
+ return $post_id;
+
+}
+function smarty_function_photoblog($params, &$smarty)
+{
+ global $id, $wpblog, $siteurl, $wpdb;
+
+ $start = "<div align='center'>";
+ $msg = "<b>Pic of the Day</b><br>";
+ $randmsg = "<b>Random Pic</b><br>";
+ $end = "</div>";
+ $class = "pictureborder";
+ $display = 'yes';
+
+ extract( $params );
+ if( isset( $when ) == false )
+ {
+ $when = date( "Ymd" );
+ }
+
+ if( is_file( ABSPATH."wp-content/blogs/".$wpblog."/images/photoblog-".$when.".jpg" ) )
+ {
+ $post_id = get_post_id( $when );
+ if( $display == 'yes' )
+ {
+ echo $start;
+ echo $msg;
+ echo "<img class='$class' src='".$siteurl."/images/photoblog-".$when.".jpg'>";
+ if( $post_id )
+ {
+ $t = $id;
+ $id = $post_id;
+ print "<br /><a href='".get_permalink( $post_id )."'>";
+ print comments_number( 'View Comments', 'Comments (1)', $more='Comments (%)');
+ print "</a>";
+ $id = $t;
+ }
+ echo $end;
+ }
+ else
+ {
+ return array( "image" => $siteurl."/images/photoblog-".$when.".jpg" );
+ }
+ }
+ else
+ {
+ $dir = "wp-content/blogs/".$wpblog."/images/";
+ if (is_dir($dir)) {
+ if ($dh = opendir($dir)) {
+ while (($file = readdir($dh)) !== false) {
+ if( strpos( $file, "hotoblog-" ) == 1 )
+ {
+ $files[] = $file;
+ }
+ }
+ closedir($dh);
+ $pic = $files[ rand( 0, count( $files ) - 1 ) ];
+ if( $pic != '' )
+ {
+ $when = substr( $pic, 10, 8 );
+ $post_id = get_post_id( $when );
+ if( $display == 'yes' )
+ {
+ echo $start;
+ echo $randmsg;
+ echo "<img class='$class' src='".$siteurl."/images/".$pic."'>";
+ if( $post_id )
+ {
+ $t = $id;
+ $id = $post_id;
+ print "<br /><a href='".get_permalink( $post_id )."'>";
+ print comments_number( 'View Comments', 'Comments (1)', $more='Comments (%)');
+ print "</a>";
+ $id = $t;
+ }
+ echo $end;
+ }
+ }
+
+ }
+ }
+ }
+}
+?>
diff --git a/wp-inst/wp-content/smarty-plugins/function.pirate.php b/wp-inst/wp-content/smarty-plugins/function.pirate.php
new file mode 100644
index 0000000..f26d7ac
--- /dev/null
+++ b/wp-inst/wp-content/smarty-plugins/function.pirate.php
@@ -0,0 +1,181 @@
+<?php
+
+/* $Id: function.pirate.php,v 1.1.1.1 2004/10/14 12:07:23 donncha Exp $ */
+
+/*
+ Smarty plugin
+ -------------------------------------------------------------
+ File: function.pirate.php
+ Type: function
+ Name: pirate
+ Purpose: Piratize your content!
+ -------------------------------------------------------------
+
+ $Id: function.pirate.php,v 1.1.1.1 2004/10/14 12:07:23 donncha Exp $
+*/
+
+function smarty_function_pirate($params, &$smarty)
+{
+ extract( $params );
+
+ if( '0919' != date('md') )
+ {
+ return $content;
+ }
+ // Always replace these:
+ $patterns = array(
+ '%\bmy\b%' => 'me',
+ '%\bboss\b%' => 'admiral',
+ '%\bmanager\b%' => 'admiral',
+ '%\b[Cc]aptain\b%' => "Cap'n",
+ '%\bmyself\b%' => 'meself',
+ '%\byour\b%' => 'yer',
+ '%\byou\b%' => 'ye',
+ '%\bfriend\b%' => 'matey',
+ '%\bfriends\b%' => 'maties',
+ '%\bco[-]?worker\b%' => 'shipmate',
+ '%\bco[-]?workers\b%' => 'shipmates',
+ '%\bearlier\b%' => 'afore',
+ '%\bold\b%' => 'auld',
+ '%\bthe\b%' => "th'",
+ '%\bof\b%' => "o'",
+ "%\bdon't\b%" => "dern't",
+ '%\bdo not\b%' => "dern't",
+ '%\bnever\b%' => "ne'er",
+ '%\bever\b%' => "e'er",
+ '%\bover\b%' => "o'er",
+ '%\bYes\b%' => 'Aye',
+ '%\bNo\b%' => 'Nay',
+ "%\bdon't know\b%" => "dinna",
+ "%\bhadn't\b%" => "ha'nae",
+ "%\bdidn't\b%"=> "di'nae",
+ "%\bwasn't\b%" => "weren't",
+ "%\bhaven't\b%" => "ha'nae",
+ '%\bfor\b%' => 'fer',
+ '%\bbetween\b%' => 'betwixt',
+ '%\baround\b%' => "aroun'",
+ '%\bto\b%' => "t'",
+ "%\bit's\b%" => "'tis",
+ '%\bwoman\b%' => 'wench',
+ '%\blady\b%' => 'wench',
+ '%\bwife\b%' => 'lady',
+ '%\bgirl\b%' => 'lass',
+ '%\bgirls\b%' => 'lassies',
+ '%\bguy\b%' => 'lubber',
+ '%\bman\b%' => 'lubber',
+ '%\bfellow\b%' => 'lubber',
+ '%\bdude\b%' => 'lubber',
+ '%\bboy\b%' => 'lad',
+ '%\bboys\b%' => 'laddies',
+ '%\bchildren\b%' => 'little sandcrabs',
+ '%\bkids\b%' => 'minnows',
+ '%\bhim\b%' => 'that scurvey dog',
+ '%\bher\b%' => 'that comely wench',
+ '%\bhim\.\b%' => 'that drunken sailor',
+ '%\bHe\b%' => 'The ornery cuss',
+ '%\bShe\b%' => 'The winsome lass',
+ "%\bhe's\b%" => 'he be',
+ "%\bshe's\b%" => 'she be',
+ '%\bwas\b%' => "were bein'",
+ '%\bHey\b%' => 'Avast',
+ '%\bher\.\b%' => 'that lovely lass',
+ '%\bfood\b%' => 'chow',
+ '%\broad\b%' => 'sea',
+ '%\broads\b%' => 'seas',
+ '%\bstreet\b%' => 'river',
+ '%\bstreets\b%' => 'rivers',
+ '%\bhighway\b%' => 'ocean',
+ '%\bhighways\b%' => 'oceans',
+ '%\bcar\b%' => 'boat',
+ '%\bcars\b%' => 'boats',
+ '%\btruck\b%' => 'schooner',
+ '%\btrucks\b%' => 'schooners',
+ '%\bSUV\b%' => 'ship',
+ '%\bairplane\b%' => 'flying machine',
+ '%\bjet\b%' => 'flying machine',
+ '%\bmachine\b%' => 'contraption',
+ '%\bdriving\b%' => 'sailing',
+ '%\bdrive\b%' => 'sail',
+ );
+
+ // Replace the words:
+ $content = array_apply_regexp($patterns,$content);
+
+ // Word ending mangling:
+ $patterns = array(
+ '/ing\b/' => "in'",
+ // '/([a-zA-Z]{3,}[^lbro])ly(\W)/' => '$1-like$2',
+ );
+
+ $content = array_apply_regexp($patterns,$content);
+
+ // Random exclamations and such:
+ $patterns = array(
+ '/(\.\s)/e' => 'avast("$0",3)',
+ );
+
+ $content = array_apply_regexp($patterns,$content);
+
+ // Let's increase the chance for exclamation marks and question marks
+ $patterns = array(
+ '/([!\?]\s)/e' => 'avast("$0",2)',
+ );
+
+ $content = array_apply_regexp($patterns,$content);
+
+ return $content;
+}
+
+// support function for pirate()
+function avast($stub = '',$chance = 5) {
+ $shouts = array(
+ ", avast$stub",
+ "$stub Ahoy!",
+ ", and a bottle of rum!",
+ ", by Blackbeard's sword$stub",
+ ", by Davy Jones' locker$stub",
+ "$stub Walk the plank!",
+ "$stub Aarrr!",
+ "$stub Yaaarrrrr!",
+ ", pass the grog!",
+ ", and dinna spare the whip!",
+ ", with a chest full of booty$stub",
+ ", and a bucket o' chum$stub",
+ ", we'll keel-haul ye!",
+ "$stub Shiver me timbers!",
+ "$stub And hoist the mainsail!",
+ "$stub And swab the deck!",
+ ", ye scurvey dog$stub",
+ "$stub Fire the cannons!",
+ ", to be sure$stub",
+ ", I'll warrant ye$stub",
+ );
+
+ shuffle($shouts);
+
+ return (((1 == rand(1,$chance))?array_shift($shouts):$stub) . ' ');
+}
+
+// This function takes an array of ('/pattern/' => 'replacement') pairs
+// and applies them all to $content.
+function array_apply_regexp($patterns,$content) {
+ // Extract the values:
+ $keys = array_keys($patterns);
+ $values = array_values($patterns);
+
+ // Modify the key patterns to avoid modifying the contents
+ // of HTML tags
+ for ($i = 0; $i < count($keys); $i++) {
+ $regexp = $keys[$i];
+
+// $regexp = preg_replace('%^(.)(.+)(.)$%','$1(?!<[^>])$2(?![>])$3',$regexp);
+
+ $keys[$i] = $regexp;
+ }
+
+ // Replace the words:
+ $content = preg_replace($keys,$values,$content);
+
+ return $content;
+}
+?>
diff --git a/wp-inst/wp-content/smarty-plugins/function.popularposts.php b/wp-inst/wp-content/smarty-plugins/function.popularposts.php
new file mode 100644
index 0000000..4a66e32
--- /dev/null
+++ b/wp-inst/wp-content/smarty-plugins/function.popularposts.php
@@ -0,0 +1,80 @@
+<?php
+
+/* $Id: function.popularposts.php,v 1.2 2005/01/09 11:54:18 donncha Exp $ */
+
+/*
+ * Smarty plugin
+ * -------------------------------------------------------------
+ * File: function.popularposts.php
+ * Type: function
+ * Name: popularposts
+ * Purpose: outputs an image from the images/ directory.
+ * -------------------------------------------------------------
+ */
+
+function getlinks( $wpblog )
+{
+ global $wpdb, $site;
+ $s = strlen( $site );
+ $sql = "SELECT visitURL, sum( visitTimes ) as c
+ FROM `referer_visitLog`
+ WHERE blogID = '".$wpblog."'
+ AND visitURL LIKE '%/'
+ GROUP BY visitURL
+ ORDER BY c DESC LIMIT 0 , 30";
+ $results = $wpdb->get_results($sql);
+ if( $results )
+ {
+ reset( $results );
+ while( list( $key, $t ) = each( $results ) )
+ {
+ if( substr( $t->visitURL, -9 ) == 'index.php' )
+ $t->visitURL = substr( $t->visitURL, 0, -9 );
+ $hits[ $t->visitURL ] += $t->c;
+ }
+ arsort( $hits );
+ $hits = array_flip( $hits );
+ reset( $hits );
+ while( list( $key, $val ) = each( $hits ) )
+ {
+ if( substr( $val, -1 ) == '/' )
+ {
+ $post_name = substr( $val, 0, -1 );
+ $post_name = substr( $post_name, strrpos( $post_name, '/' ) + 1 );
+ $sql = "SELECT post_title
+ FROM ".$wpdb->posts."
+ WHERE post_name = '".$post_name."'";
+ $results = $wpdb->get_results($sql);
+ if( $results )
+ {
+ $links[ $key ] = array( "url" => $val, "title" => stripslashes( $results[0]->post_title ) );
+ }
+ }
+ }
+ }
+ else
+ {
+ $links = false;
+ }
+
+ return $links;
+}
+
+function smarty_function_popularposts($params, &$smarty)
+{
+ global $wpblog;
+ extract( $params );
+
+ if( @include_once( "Cache/Function.php" ) )
+ {
+ $cache = new Cache_Function( 'file', array('cache_dir' => ABSPATH . "/wp-content/smarty-cache", 'filename_prefix' => 'popularposts_cache_' ), 3600 );
+ $links = $cache->call( "getlinks", $wpblog );
+ }
+ else
+ {
+ $links = getlinks( $wpblog, $site );
+ }
+
+ $smarty->assign( "pposts", $links );
+}
+?>
diff --git a/wp-inst/wp-content/smarty-plugins/function.popup.php b/wp-inst/wp-content/smarty-plugins/function.popup.php
new file mode 100644
index 0000000..2ba54de
--- /dev/null
+++ b/wp-inst/wp-content/smarty-plugins/function.popup.php
@@ -0,0 +1,117 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty {popup} function plugin
+ *
+ * Type: function<br>
+ * Name: popup<br>
+ * Purpose: make text pop up in windows via overlib
+ * @link http://smarty.php.net/manual/en/language.function.popup.php {popup}
+ * (Smarty online manual)
+ * @param array
+ * @param Smarty
+ * @return string
+ */
+function smarty_function_popup($params, &$smarty)
+{
+ $append = '';
+ foreach ($params as $_key=>$_value) {
+ switch ($_key) {
+ case 'text':
+ case 'trigger':
+ case 'function':
+ case 'inarray':
+ $$_key = (string)$_value;
+ if ($_key == 'function' || $_key == 'inarray')
+ $append .= ',' . strtoupper($_key) . ",'$_value'";
+ break;
+
+ case 'caption':
+ case 'closetext':
+ case 'status':
+ $append .= ',' . strtoupper($_key) . ",'" . str_replace("'","\'",$_value) . "'";
+ break;
+
+ case 'fgcolor':
+ case 'bgcolor':
+ case 'textcolor':
+ case 'capcolor':
+ case 'closecolor':
+ case 'textfont':
+ case 'captionfont':
+ case 'closefont':
+ case 'fgbackground':
+ case 'bgbackground':
+ case 'caparray':
+ case 'capicon':
+ case 'background':
+ case 'frame':
+ $append .= ',' . strtoupper($_key) . ",'$_value'";
+ break;
+
+ case 'textsize':
+ case 'captionsize':
+ case 'closesize':
+ case 'width':
+ case 'height':
+ case 'border':
+ case 'offsetx':
+ case 'offsety':
+ case 'snapx':
+ case 'snapy':
+ case 'fixx':
+ case 'fixy':
+ case 'padx':
+ case 'pady':
+ case 'timeout':
+ case 'delay':
+ $append .= ',' . strtoupper($_key) . ",$_value";
+ break;
+
+ case 'sticky':
+ case 'left':
+ case 'right':
+ case 'center':
+ case 'above':
+ case 'below':
+ case 'noclose':
+ case 'autostatus':
+ case 'autostatuscap':
+ case 'fullhtml':
+ case 'hauto':
+ case 'vauto':
+ case 'mouseoff':
+ case 'followmouse':
+ if ($_value) $append .= ',' . strtoupper($_key);
+ break;
+
+ default:
+ $smarty->trigger_error("[popup] unknown parameter $_key", E_USER_WARNING);
+ }
+ }
+
+ if (empty($text) && !isset($inarray) && empty($function)) {
+ $smarty->trigger_error("overlib: attribute 'text' or 'inarray' or 'function' required");
+ return false;
+ }
+
+ if (empty($trigger)) { $trigger = "onmouseover"; }
+
+ $retval = $trigger . '="return overlib(\''.preg_replace(array("!'!","![\r\n]!"),array("\'",'\r'),$text).'\'';
+ $retval .= $append . ');"';
+ if ($trigger == 'onmouseover')
+ $retval .= ' onmouseout="nd();"';
+
+
+ return $retval;
+}
+
+/* vim: set expandtab: */
+
+?>
diff --git a/wp-inst/wp-content/smarty-plugins/function.popup_init.php b/wp-inst/wp-content/smarty-plugins/function.popup_init.php
new file mode 100644
index 0000000..f62c33c
--- /dev/null
+++ b/wp-inst/wp-content/smarty-plugins/function.popup_init.php
@@ -0,0 +1,39 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty {popup_init} function plugin
+ *
+ * Type: function<br>
+ * Name: popup_init<br>
+ * Purpose: initialize overlib
+ * @link http://smarty.php.net/manual/en/language.function.popup.init.php {popup_init}
+ * (Smarty online manual)
+ * @param array
+ * @param Smarty
+ * @return string
+ */
+function smarty_function_popup_init($params, &$smarty)
+{
+ $zindex = 1000;
+
+ if (!empty($params['zindex'])) {
+ $zindex = $params['zindex'];
+ }
+
+ if (!empty($params['src'])) {
+ return '<div id="overDiv" style="position:absolute; visibility:hidden; z-index:'.$zindex.';"></div>' . "\n"
+ . '<script type="text/javascript" language="JavaScript" src="'.$params['src'].'"></script>' . "\n";
+ } else {
+ $smarty->trigger_error("popup_init: missing src parameter");
+ }
+}
+
+/* vim: set expandtab: */
+
+?>
diff --git a/wp-inst/wp-content/smarty-plugins/function.referer.php b/wp-inst/wp-content/smarty-plugins/function.referer.php
new file mode 100644
index 0000000..cda8e59
--- /dev/null
+++ b/wp-inst/wp-content/smarty-plugins/function.referer.php
@@ -0,0 +1,128 @@
+<?php
+
+/* $Id: function.referer.php,v 1.4 2005/03/11 17:52:56 donncha Exp $ */
+
+
+// Based on code by Nathan Young @ http://ncyoung.com/entry/57
+// Modified by Donncha O Caoimh, donncha@linux.ie
+
+
+function getreferers( $wpblog, $siteDomain )
+{
+ global $wpdb;
+
+ /*if( $p || $cat || $m )
+ {
+ $sql = "select baseDomain,referingURL, visitTimes from referer_visitLog WHERE visitURL = '".$currentURL."' ORDER BY visitTime ASC LIMIT 0 , 10";
+ }
+ else
+ {*/
+ $sql = "select referingURL, visitTimes, visitTime from referer_visitLog WHERE blogID='".$wpblog."' and visitTime >= NOW() - INTERVAL 24 HOUR ORDER BY visitTime DESC";
+ //}
+ $result = $wpdb->get_results($sql);
+ if( $result )
+ {
+ foreach( $result as $details )
+ {
+ if( $details->referingURL == 'DIRECT' )
+ {
+ $details->baseDomain = $details->referingURL;
+ }
+ else
+ {
+ $t = preg_replace("/http:\/\//i", "", $details->referingURL );
+ $t = preg_replace("/^www\./i", "", $t );
+ $t = preg_replace("/\/.*/i", "", $t );
+ $details->baseDomain = $t;
+ }
+ if( $details->baseDomain != 'DIRECT' )
+ {
+ if( substr( $details->baseDomain, 0, 6 ) == 'google' )
+ {
+ $refererlinks[ 'google' ][ 'visitTimes' ] += $details->visitTimes;
+ $refererlinks[ 'google' ][ 'referingURL' ] = "http://www.google.com/";
+ $refererlinks[ 'google' ][ 'baseDomain' ] = "google.com";
+ }
+ elseif( strpos( $details->baseDomain, "ebsearch.com" ) )
+ {
+ $refererlinks[ 'websearch' ][ 'visitTimes' ] += $details->visitTimes;
+ $refererlinks[ 'websearch' ][ 'referingURL' ] = "http://www.websearch.com/";
+ $refererlinks[ 'websearch' ][ 'baseDomain' ] = "websearch.com";
+ }
+ elseif( strpos( $details->baseDomain, "ahoo.com" ) )
+ {
+ $refererlinks[ 'yahoo' ][ 'visitTimes' ] += $details->visitTimes;
+ $refererlinks[ 'yahoo' ][ 'referingURL' ] = "http://www.yahoo.com/";
+ $refererlinks[ 'yahoo' ][ 'baseDomain' ] = "yahoo.com";
+ }
+ elseif( strpos( $details->baseDomain, "sxml.infospace.com" ) )
+ {
+ $refererlinks[ 'yahoo' ][ 'visitTimes' ] += $details->visitTimes;
+ $refererlinks[ 'yahoo' ][ 'referingURL' ] = "http://msxml.infospace.com/";
+ $refererlinks[ 'yahoo' ][ 'baseDomain' ] = "infospace.com";
+ }
+ elseif( strpos( $details->baseDomain, $siteDomain ) === false )
+ {
+ $refererlinks[ $details->referingURL ][ "referingURL" ] = $details->referingURL;
+ $refererlinks[ $details->referingURL ][ "visitTimes" ] += $details->visitTimes;
+ $refererlinks[ $details->referingURL ][ "baseDomain" ] = $details->baseDomain;
+ }
+ }
+ }
+ if(is_array( $refererlinks ) == false )
+ $refererlinks = array();
+ reset( $refererlinks );
+ while( list( $key, $val ) = each( $refererlinks ) )
+ {
+ if( $val[ 'visitTimes' ] < 3 )
+ unset( $refererlinks[ $key ] );
+ }
+ }
+ else
+ {
+ $refererlinks = '';
+ }
+ return $refererlinks;
+}
+
+function smarty_function_referer($params, &$smarty)
+{
+ global $post, $wpdb, $wpblog;
+
+
+ $ref = getenv('HTTP_REFERER');
+ $currentURL = $_SERVER['REQUEST_URI'];
+ $fullCurrentURL = "http://" . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
+
+ $tomorrow = date( "d", mktime (0,0,0,date("m") ,date("d")+1,date("Y")) );
+ if( $site == 'root' )
+ {
+ $sql = "delete from referer_visitLog WHERE dayofmonth = '$tomorrow'"; // delete referers from a (month - 1 day) ago.
+ $result = $wpdb->query( $query );
+ }
+
+ $siteurl = get_settings( "siteurl" );
+ $siteDomain = str_replace( "http://", "", $siteurl );
+ if( strpos( $siteDomain, "/" ) )
+ $siteDomain = substr( $siteDomain, 0, strpos( $siteDomain, "/" ) );
+
+ // find referers for current page
+
+ if( @include_once( "Cache/Function.php" ) )
+ {
+ $cache = new Cache_Function( 'file', array('cache_dir' => ABSPATH . "/wp-content/smarty-cache", 'filename_prefix' => 'referers_cache_' ), 600 );
+ $refererlinks = $cache->call( "getreferers", $wpblog, $siteDomain );
+ }
+ else
+ {
+ $refererlinks = getreferers( $wpblog, $siteDomain );
+ }
+
+
+ if( is_array( $refererlinks ) )
+ reset( $refererlinks );
+
+ $smarty->assign( "refererlinks", $refererlinks );
+}
+
+?>
diff --git a/wp-inst/wp-content/smarty-plugins/function.relatedstories.php b/wp-inst/wp-content/smarty-plugins/function.relatedstories.php
new file mode 100644
index 0000000..2af572c
--- /dev/null
+++ b/wp-inst/wp-content/smarty-plugins/function.relatedstories.php
@@ -0,0 +1,85 @@
+<?php
+
+/* $Id: function.relatedstories.php,v 1.2 2005/01/09 11:54:18 donncha Exp $ */
+
+/*
+ Originally by GamerZ, http://tidakada.com/board/viewtopic.php?t=1805&postdays=0&postorder=asc&start=0
+ Extensively modified by Donncha O Caoimh.
+
+ Add {$relatedstories} to your post.tpl to enable it
+*/
+
+function relatedstories( $wpblog, $posts, $post )
+{
+ global $wpdb, $tableposts;
+
+ $p = false;
+
+ if( count( $posts ) == 1 )
+ {
+ if( $post->ID != "" )
+ {
+ $query = "SELECT post_title, post_content FROM $tableposts WHERE ID='".$post->ID."'";
+ $p = $wpdb->get_row( $query );
+ if( $p )
+ {
+ $titlesearch = $p->post_title;
+ if( $titlesearch == '' )
+ $titlesearch = substr( str_replace( "'", "", strip_tags( $p->post_content ) ), 0, 20 );
+
+ $howmanystories=5;
+
+ $exclude = array ("a", "and", "are", "do", "it", "its", "is", "in", "i", "my", "the", "to", "with", "you", "this", "them" );
+
+ $qry = "SELECT DISTINCT ID, DATE_FORMAT(post_date, '%e/%c/%y') as c, post_content, post_title FROM $tableposts WHERE (";
+
+ $titlesearch = preg_replace('/, +/', '', $titlesearch);
+ $titlesearch = strtolower( trim($titlesearch) );
+ $words = explode (" ", $titlesearch);
+ $words = array_diff($words,$exclude);
+
+ reset( $words );
+ foreach ($words as $word)
+ {
+ if( strlen( $word ) > 2 )
+ {
+ $word = addslashes( $word );
+ $qry .= "(post_content LIKE '% $word%' OR post_title LIKE '% $word%') OR ";
+ $usedWords .= stripslashes( $word ).", ";
+ }
+ }
+ $usedWords = substr( $usedWords, 0, -2 );
+ $qry = substr ($qry, 0, strlen ($qry) - 4);
+ $qry .= ") AND (ID != '".$post->ID."') ORDER BY post_date DESC LIMIT $howmanystories";
+ $p = $wpdb->get_results( $qry );
+ }
+ }
+ }
+ else
+ {
+ }
+ return array( "p" => $p, "usedWords" => $usedWords );
+}
+
+
+function smarty_function_relatedstories( $params, &$smarty )
+{
+ global $wpblog, $wpdb, $post, $tableposts, $posts;
+
+ extract( $params );
+ if( @include_once( "Cache/Function.php" ) )
+ {
+ $cache = new Cache_Function( 'file', array('cache_dir' => ABSPATH . "/wp-content/smarty-cache", 'filename_prefix' => 'relatedstories_cache_' ), 3600 );
+ $links = $cache->call( "relatedstories", $wpblog, $posts, $post );
+ }
+ else
+ {
+ $links = relatedstories( $wpblog, $posts, $post );
+ }
+
+
+ $smarty->assign( "relatedstories", $links[ 'p' ] );
+ $smarty->assign( "relatedstoriesWords", $links[ 'usedWords' ] );
+}
+
+?>
diff --git a/wp-inst/wp-content/smarty-plugins/function.todayayearago.php b/wp-inst/wp-content/smarty-plugins/function.todayayearago.php
new file mode 100644
index 0000000..b6781c0
--- /dev/null
+++ b/wp-inst/wp-content/smarty-plugins/function.todayayearago.php
@@ -0,0 +1,84 @@
+<?php
+
+/* $Id: function.todayayearago.php,v 1.2 2005/01/09 11:54:18 donncha Exp $ */
+
+/*
+ Smarty plugin
+ -------------------------------------------------------------
+ File: function.todayayearago.php
+ Type: function
+ Name: todayayearago
+ Purpose: Print links to posts a year ago.
+ -------------------------------------------------------------
+
+ COPYRIGHT Indigo Anand Meridian @ http://indiboi.com/
+ Modified for Smarty plugin API by Donncha O Caoimh
+
+ $Id: function.todayayearago.php,v 1.2 2005/01/09 11:54:18 donncha Exp $
+*/
+
+function todayayearago( $when, $wpblog, $spacer ='<br /' )
+{
+ global $tableposts,$row,$blogfilename,$querystring_start,$querystring_equal,$time_difference, $siteurl, $wpdb;
+
+ if( $spacer == '' )
+ $spacer = '<br />';
+
+ if( $when == 'month' )
+ {
+ if( date('m') == '01' )
+ {
+ $year = (date('Y', time()+($time_difference * 3600)) - 1);
+ }
+ else
+ {
+ $year = (date('Y', time()+($time_difference * 3600)));
+ }
+ $month = date('m', time()+($time_difference * 3600)) - 1;
+ }
+ else
+ {
+ $year = (date('Y', time()+($time_difference * 3600))) - 1;
+ $month = date('m', time()+($time_difference * 3600));
+ }
+
+ $day = date("d", (time()+($time_difference * 3600)));
+
+ $reqhistory = "SELECT post_date, ID, post_title, SUBSTRING(post_content, 1, 100) as post_content
+ FROM $tableposts
+ WHERE YEAR(post_date) = $year
+ AND MONTH(post_date) = $month
+ AND DAYOFMONTH(post_date) = $day
+ AND post_status = 'publish'";
+ $reqhistory = $wpdb->get_results($reqhistory);
+ if( $reqhistory )
+ {
+ foreach( $reqhistory as $row )
+ {
+ $todayayearago[ $row->ID ] = array( "title" => strip_tags( stripslashes($row->post_title) ),
+ "content" => strip_tags( stripslashes( $row->post_content ) ) );
+ }
+ }
+ return $todayayearago;
+}
+
+function smarty_function_todayayearago($params, &$smarty)
+{
+ global $wpblog, $tableposts,$row,$blogfilename,$querystring_start,$querystring_equal,$time_difference, $siteurl, $wpdb;
+
+ extract( $params );
+
+ if( @include_once( "Cache/Function.php" ) )
+ {
+ $cache = new Cache_Function( 'file', array('cache_dir' => ABSPATH . "/wp-content/smarty-cache", 'filename_prefix' => 'todayayearago_cache_' ), 3600 );
+ $todayayearago = $cache->call( "todayayearago", $when, $wpblog, $spacer );
+ }
+ else
+ {
+ $todayayearago = todayayearago( $when, $wpblog, $spacer );
+ }
+
+
+ $smarty->assign( "todayayearago", $todayayearago );
+}
+?>
diff --git a/wp-inst/wp-content/smarty-plugins/function.wp_ozh_click_comment_author_link.php b/wp-inst/wp-content/smarty-plugins/function.wp_ozh_click_comment_author_link.php
new file mode 100644
index 0000000..1924d4b
--- /dev/null
+++ b/wp-inst/wp-content/smarty-plugins/function.wp_ozh_click_comment_author_link.php
@@ -0,0 +1,27 @@
+<?php
+/*
+ * Smarty plugin
+ * -------------------------------------------------------------
+ * Type: function
+ * Name: wp_ozh_click_topclicks
+ * Purpose: Prints list of top links
+ * -------------------------------------------------------------
+ */
+function smarty_function_wp_ozh_click_comment_author_link($params, &$smarty)
+{
+ extract($params);
+
+ if( function_exists( wp_ozh_click_comment_author_link ) )
+ {
+ wp_ozh_click_comment_author_link();
+ }
+ else
+ {
+ comment_author_link();
+ }
+}
+
+/* vim: set expandtab: */
+
+
+?>
diff --git a/wp-inst/wp-content/smarty-plugins/function.wp_ozh_click_topclicks.php b/wp-inst/wp-content/smarty-plugins/function.wp_ozh_click_topclicks.php
new file mode 100644
index 0000000..6296629
--- /dev/null
+++ b/wp-inst/wp-content/smarty-plugins/function.wp_ozh_click_topclicks.php
@@ -0,0 +1,23 @@
+<?php
+/*
+ * Smarty plugin
+ * -------------------------------------------------------------
+ * Type: function
+ * Name: wp_ozh_click_topclicks
+ * Purpose: Prints list of top links
+ * -------------------------------------------------------------
+ */
+function smarty_function_wp_ozh_click_topclicks($params, &$smarty)
+{
+ extract($params);
+
+ if( function_exists( wp_ozh_click_topclicks ) )
+ {
+ wp_ozh_click_topclicks( $limit, $trim, $pattern );
+ }
+}
+
+/* vim: set expandtab: */
+
+
+?>
diff --git a/wp-inst/wp-content/smarty-plugins/insert.getreferer.php b/wp-inst/wp-content/smarty-plugins/insert.getreferer.php
new file mode 100644
index 0000000..5fa4bb8
--- /dev/null
+++ b/wp-inst/wp-content/smarty-plugins/insert.getreferer.php
@@ -0,0 +1,211 @@
+<?php
+
+/* $Id: insert.getreferer.php,v 1.1.1.1 2004/10/14 12:07:23 donncha Exp $ */
+
+
+// Based on code by Nathan Young @ http://ncyoung.com/entry/57
+// Modified by Donncha O Caoimh, donncha@linux.ie
+
+
+// TODO - see if I really need "visitID" in the table.
+
+
+function err( $err )
+{
+ error_log( "$err\n", 3, "/tmp/err.txt" );
+}
+
+function doCheckRef( $url )
+{
+ $check = true;
+ // Do we need to check the referer? If it's from a known site we can save some cycles.
+ $checklist = array( "direct", "http://www.technorati.com", "http://www.google", "http://www.yahoo", "http://www.linux.ie", "http://blogs.linux.ie", "http://blo.gs" );
+ reset( $checklist );
+ while( list( $key, $val ) = each( $checklist ) )
+ {
+ $p = strpos( strtolower( $url ), $val );
+ if( $p !== false )
+ /*
+ {
+ mail( "donncha@tradesignals.com", "check1: $val $url", "" );
+ return true;
+ }
+ else
+ */
+ {
+ $check = false;
+ }
+ }
+ /*
+ if( $check )
+ {
+ err( "check3: *$url*" );
+ }
+ else
+ {
+ err( "ok3: *$url*" );
+ }
+ */
+ return $check;
+}
+
+function smarty_insert_getreferer()
+{
+ global $siteurl, $p, $m, $cat, $site, $wpdb, $wpblog;
+
+
+ // delete tomorrow's referers today
+ $tomorrow = date( "j", mktime (0,0,0,date("m") ,date("d")+1,date("Y")) );
+ $sec = date( "s" );
+ $hour = date( "G" );
+ if( $sec == 30 && $hour < 2 )
+ {
+ $sql = "delete from referer_visitLog WHERE dayofmonth = '$tomorrow'"; // delete referers from a (month + 1 day) ago.
+ $wpdb->query($sql);
+ }
+
+ $ref = getenv('HTTP_REFERER');
+ $ua = getenv( 'HTTP_USER_AGENT' );
+ $currentURL = $_SERVER['REQUEST_URI'];
+ $fullCurrentURL = "http://" . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
+ if( $ref == '' )
+ {
+ $ref = "DIRECT";
+ }
+
+ $found = false;
+
+ if( $currentURL[ strlen( $currentURL ) -1 ] == '/' )
+ {
+ $found = true;
+ }
+ else
+ {
+ $count_files = array( "wp-admin" );
+ reset( $count_files );
+ while( list( $key, $val ) = each( $count_files ) )
+ {
+ $pos = strpos( $currentURL, $val );
+ if( $pos == true )
+ {
+ $found = true;
+ }
+ }
+ if( $found == true )
+ {
+ // Don't bother going further - no need to record request!
+ return;
+ }
+ }
+
+ if ($ref || $ref = strip_tags($ref) )
+ {
+
+ $realReferer = true;
+ $ignorePages = Array( 'lastupdated.php', 'b2rdf.php', 'b2rss2.php', 'b2bookmarklet.php', 'b2referers.php', 'b2commentspopup.php' );
+ foreach ($ignorePages as $ignoresite){
+ if (stristr($currentURL, $ignoresite)){
+ $realReferer = false;
+ }
+ }
+
+ $ignore = Array(
+ 'http://www.myelin.co.nz/ecosystem/bot.php',
+ 'http://radio.xmlstoragesystem.com/rcsPublic/',
+ 'http://blogdex.media.mit.edu//',
+ 'http://subhonker6.userland.com/rcsPublic/',
+ 'mastadonte.com',
+ 'http://blo.gs/ping.php',
+ $siteurl
+ );
+ foreach ($ignore as $ignoresite){
+ if (stristr($ref, $ignoresite)){
+ $realReferer = false;
+ }
+ }
+
+ $doubleCheckReferers = 1;
+
+ $checkRef = doCheckRef( $ref );
+
+ if( $realReferer && $checkRef && $ref != 'DIRECT' && $doubleCheckReferers)
+ {
+ //this is so that the page up until the call to
+ //logReferer will get shown before it tries to check
+ //back against the refering URL.
+ flush();
+ //err( "checking $ref" );
+
+ $goodReferer = 0;
+ $fp = @fopen ($ref, "r");
+ if ($fp){
+ socket_set_timeout($fp, 5);
+ while (!feof ($fp)) {
+ $page .= trim(fgets($fp));
+ }
+ if (strstr($page,$fullCurrentURL)){
+ $goodReferer = 1;
+ }
+ }
+
+ if(!$goodReferer){
+ $realReferer = false;
+ }
+ if( $realReferer == true )
+ {
+ $query = "SELECT ID FROM referer_blacklist WHERE URL like '%$ref%'";
+ //error_log( "$query\n", 3, "/tmp/queries.txt" );
+ #mail( "donncha@tradesignals.com", "query", $query );
+ $result = $wpdb->get_row( $query );
+ if( $result )
+ {
+ $ref = "DIRECT";
+ }
+ }
+
+ }
+
+ $useragents = array( "http://www.syndic8.com", "http://dir.com/pompos.html", "NaverBot-1.0", "http://help.yahoo.com/help/us/ysearch/slurp", "http://www.google.com/bot.html", "http://www.blogdigger.com/", "http://search.msn.com/msnbot.htm", "Feedster, LLC.", "http://www.breakingblogs.com/timbo_bot.html", "fastbuzz.com", "http://www.pubsub.com/", "http://www.bloglines.com", "http://www.drupal.org/", "Ask Jeeves/Teoma", "ia_archiver", "http://minutillo.com/steve/feedonfeeds/", "larbin_2", "lmspider", "kinjabot", "lickBot 2.0", "Downes/Referrers", "daypopbot", "www.globalspec.com" );
+ reset( $useragents );
+ while( list( $key, $val ) = each( $useragents ) )
+ {
+ if( strpos( $ua, $val ) !== false )
+ {
+ $realReferer = false;
+ }
+ }
+
+ if( $realReferer )
+ {
+ if( $ref == 'DIRECT' )
+ {
+ $anchor = $ref;
+ }
+ else
+ {
+ $anchor = preg_replace("/http:\/\//i", "", $ref);
+ $anchor = preg_replace("/^www\./i", "", $anchor);
+ $anchor = preg_replace("/\/.*/i", "", $anchor);
+ }
+ $today = date( "d" );
+
+ $sql = "update referer_visitLog
+ set visitTimes = visitTimes + 1
+ where blogID = '$wpblog'
+ AND dayofmonth = '$today'
+ AND referingURL = '$ref'
+ AND baseDomain = '$anchor'
+ AND visitURL = '$currentURL'";
+ $result = $wpdb->query( $sql );
+ if( $result == false )
+ {
+ $sql ="insert delayed into referer_visitLog (blogID,referingURL,baseDomain,visitURL,refpost, visitTimes, dayofmonth)
+ values ('$wpblog','$ref','$anchor','$currentURL','$p','1', '$today')";
+
+ $result = $wpdb->query( $sql );
+ }
+ }
+ }
+}
+
+?>
diff --git a/wp-inst/wp-content/smarty-plugins/insert.var.php b/wp-inst/wp-content/smarty-plugins/insert.var.php
new file mode 100644
index 0000000..21d8c39
--- /dev/null
+++ b/wp-inst/wp-content/smarty-plugins/insert.var.php
@@ -0,0 +1,21 @@
+<?php
+
+function smarty_insert_var( $params, $smarty )
+{
+ global $REMOTE_ADDR;
+
+ extract( $params );
+
+ if( $REMOTE_ADDR == '217.75.13.250' )
+ error_log( "$var: ".$$var."\n", 3, "/tmp/err.txt" );
+ if( $var )
+ {
+ global $$var;
+ return $$var;
+ }
+ else
+ {
+ return "";
+ }
+}
+?>
diff --git a/wp-inst/wp-content/smarty-plugins/modifier.capitalize.php b/wp-inst/wp-content/smarty-plugins/modifier.capitalize.php
new file mode 100644
index 0000000..2b9169c
--- /dev/null
+++ b/wp-inst/wp-content/smarty-plugins/modifier.capitalize.php
@@ -0,0 +1,42 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty capitalize modifier plugin
+ *
+ * Type: modifier<br>
+ * Name: capitalize<br>
+ * Purpose: capitalize words in the string
+ * @link http://smarty.php.net/manual/en/language.modifiers.php#LANGUAGE.MODIFIER.CAPITALIZE
+ * capitalize (Smarty online manual)
+ * @param string
+ * @return string
+ */
+function smarty_modifier_capitalize($string, $uc_digits = false)
+{
+ smarty_modifier_capitalize_ucfirst(null, $uc_digits);
+ return preg_replace_callback('!\b\w+\b!', 'smarty_modifier_capitalize_ucfirst', $string);
+}
+
+function smarty_modifier_capitalize_ucfirst($string, $uc_digits = null)
+{
+ static $_uc_digits = false;
+
+ if(isset($uc_digits)) {
+ $_uc_digits = $uc_digits;
+ return;
+ }
+
+ if(!preg_match('!\d!',$string[0]) || $_uc_digits)
+ return ucfirst($string[0]);
+ else
+ return $string[0];
+}
+
+
+?>
diff --git a/wp-inst/wp-content/smarty-plugins/modifier.cat.php b/wp-inst/wp-content/smarty-plugins/modifier.cat.php
new file mode 100644
index 0000000..2e37940
--- /dev/null
+++ b/wp-inst/wp-content/smarty-plugins/modifier.cat.php
@@ -0,0 +1,33 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty cat modifier plugin
+ *
+ * Type: modifier<br>
+ * Name: cat<br>
+ * Date: Feb 24, 2003
+ * Purpose: catenate a value to a variable
+ * Input: string to catenate
+ * Example: {$var|cat:"foo"}
+ * @link http://smarty.php.net/manual/en/language.modifier.cat.php cat
+ * (Smarty online manual)
+ * @author Monte Ohrt <monte at ohrt dot com>
+ * @version 1.0
+ * @param string
+ * @param string
+ * @return string
+ */
+function smarty_modifier_cat($string, $cat)
+{
+ return $string . $cat;
+}
+
+/* vim: set expandtab: */
+
+?>
diff --git a/wp-inst/wp-content/smarty-plugins/modifier.count_characters.php b/wp-inst/wp-content/smarty-plugins/modifier.count_characters.php
new file mode 100644
index 0000000..49ce655
--- /dev/null
+++ b/wp-inst/wp-content/smarty-plugins/modifier.count_characters.php
@@ -0,0 +1,31 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty count_characters modifier plugin
+ *
+ * Type: modifier<br>
+ * Name: count_characteres<br>
+ * Purpose: count the number of characters in a text
+ * @link http://smarty.php.net/manual/en/language.modifier.count.characters.php
+ * count_characters (Smarty online manual)
+ * @param string
+ * @param boolean include whitespace in the character count
+ * @return integer
+ */
+function smarty_modifier_count_characters($string, $include_spaces = false)
+{
+ if ($include_spaces)
+ return(strlen($string));
+
+ return preg_match_all("/[^\s]/",$string, $match);
+}
+
+/* vim: set expandtab: */
+
+?>
diff --git a/wp-inst/wp-content/smarty-plugins/modifier.count_paragraphs.php b/wp-inst/wp-content/smarty-plugins/modifier.count_paragraphs.php
new file mode 100644
index 0000000..6a9833c
--- /dev/null
+++ b/wp-inst/wp-content/smarty-plugins/modifier.count_paragraphs.php
@@ -0,0 +1,28 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty count_paragraphs modifier plugin
+ *
+ * Type: modifier<br>
+ * Name: count_paragraphs<br>
+ * Purpose: count the number of paragraphs in a text
+ * @link http://smarty.php.net/manual/en/language.modifier.count.paragraphs.php
+ * count_paragraphs (Smarty online manual)
+ * @param string
+ * @return integer
+ */
+function smarty_modifier_count_paragraphs($string)
+{
+ // count \r or \n characters
+ return count(preg_split('/[\r\n]+/', $string));
+}
+
+/* vim: set expandtab: */
+
+?>
diff --git a/wp-inst/wp-content/smarty-plugins/modifier.count_sentences.php b/wp-inst/wp-content/smarty-plugins/modifier.count_sentences.php
new file mode 100644
index 0000000..0c210f0
--- /dev/null
+++ b/wp-inst/wp-content/smarty-plugins/modifier.count_sentences.php
@@ -0,0 +1,28 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty count_sentences modifier plugin
+ *
+ * Type: modifier<br>
+ * Name: count_sentences
+ * Purpose: count the number of sentences in a text
+ * @link http://smarty.php.net/manual/en/language.modifier.count.paragraphs.php
+ * count_sentences (Smarty online manual)
+ * @param string
+ * @return integer
+ */
+function smarty_modifier_count_sentences($string)
+{
+ // find periods with a word before but not after.
+ return preg_match_all('/[^\s]\.(?!\w)/', $string, $match);
+}
+
+/* vim: set expandtab: */
+
+?>
diff --git a/wp-inst/wp-content/smarty-plugins/modifier.count_words.php b/wp-inst/wp-content/smarty-plugins/modifier.count_words.php
new file mode 100644
index 0000000..42c8a74
--- /dev/null
+++ b/wp-inst/wp-content/smarty-plugins/modifier.count_words.php
@@ -0,0 +1,32 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty count_words modifier plugin
+ *
+ * Type: modifier<br>
+ * Name: count_words<br>
+ * Purpose: count the number of words in a text
+ * @link http://smarty.php.net/manual/en/language.modifier.count.words.php
+ * count_words (Smarty online manual)
+ * @param string
+ * @return integer
+ */
+function smarty_modifier_count_words($string)
+{
+ // split text by ' ',\r,\n,\f,\t
+ $split_array = preg_split('/\s+/',$string);
+ // count matches that contain alphanumerics
+ $word_count = preg_grep('/[a-zA-Z0-9\\x80-\\xff]/', $split_array);
+
+ return count($word_count);
+}
+
+/* vim: set expandtab: */
+
+?>
diff --git a/wp-inst/wp-content/smarty-plugins/modifier.date_format.php b/wp-inst/wp-content/smarty-plugins/modifier.date_format.php
new file mode 100644
index 0000000..2f36b3b
--- /dev/null
+++ b/wp-inst/wp-content/smarty-plugins/modifier.date_format.php
@@ -0,0 +1,48 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+/**
+ * Include the {@link shared.make_timestamp.php} plugin
+ */
+require_once $smarty->_get_plugin_filepath('shared','make_timestamp');
+/**
+ * Smarty date_format modifier plugin
+ *
+ * Type: modifier<br>
+ * Name: date_format<br>
+ * Purpose: format datestamps via strftime<br>
+ * Input:<br>
+ * - string: input date string
+ * - format: strftime format for output
+ * - default_date: default date if $string is empty
+ * @link http://smarty.php.net/manual/en/language.modifier.date.format.php
+ * date_format (Smarty online manual)
+ * @param string
+ * @param string
+ * @param string
+ * @return string|void
+ * @uses smarty_make_timestamp()
+ */
+function smarty_modifier_date_format($string, $format="%b %e, %Y", $default_date=null)
+{
+ if (substr(PHP_OS,0,3) == 'WIN') {
+ $_win_from = array ('%e', '%T', '%D');
+ $_win_to = array ('%#d', '%H:%M:%S', '%m/%d/%y');
+ $format = str_replace($_win_from, $_win_to, $format);
+ }
+ if($string != '') {
+ return strftime($format, smarty_make_timestamp($string));
+ } elseif (isset($default_date) && $default_date != '') {
+ return strftime($format, smarty_make_timestamp($default_date));
+ } else {
+ return;
+ }
+}
+
+/* vim: set expandtab: */
+
+?>
diff --git a/wp-inst/wp-content/smarty-plugins/modifier.debug_print_var.php b/wp-inst/wp-content/smarty-plugins/modifier.debug_print_var.php
new file mode 100644
index 0000000..b9bb184
--- /dev/null
+++ b/wp-inst/wp-content/smarty-plugins/modifier.debug_print_var.php
@@ -0,0 +1,56 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty debug_print_var modifier plugin
+ *
+ * Type: modifier<br>
+ * Name: debug_print_var<br>
+ * Purpose: formats variable contents for display in the console
+ * @link http://smarty.php.net/manual/en/language.modifier.debug.print.var.php
+ * debug_print_var (Smarty online manual)
+ * @param array|object
+ * @param integer
+ * @param integer
+ * @return string
+ */
+function smarty_modifier_debug_print_var($var, $depth = 0, $length = 40)
+{
+ $_replace = array("\n"=>'<i>&#92;n</i>', "\r"=>'<i>&#92;r</i>', "\t"=>'<i>&#92;t</i>');
+ if (is_array($var)) {
+ $results = "<b>Array (".count($var).")</b>";
+ foreach ($var as $curr_key => $curr_val) {
+ $return = smarty_modifier_debug_print_var($curr_val, $depth+1, $length);
+ $results .= "<br>".str_repeat('&nbsp;', $depth*2)."<b>".strtr($curr_key, $_replace)."</b> =&gt; $return";
+ }
+ } else if (is_object($var)) {
+ $object_vars = get_object_vars($var);
+ $results = "<b>".get_class($var)." Object (".count($object_vars).")</b>";
+ foreach ($object_vars as $curr_key => $curr_val) {
+ $return = smarty_modifier_debug_print_var($curr_val, $depth+1, $length);
+ $results .= "<br>".str_repeat('&nbsp;', $depth*2)."<b>$curr_key</b> =&gt; $return";
+ }
+ } else if (is_resource($var)) {
+ $results = '<i>'.(string)$var.'</i>';
+ } else if (empty($var) && $var != "0") {
+ $results = '<i>empty</i>';
+ } else {
+ if (strlen($var) > $length ) {
+ $results = substr($var, 0, $length-3).'...';
+ } else {
+ $results = $var;
+ }
+ $results = htmlspecialchars($results);
+ $results = strtr($results, $_replace);
+ }
+ return $results;
+}
+
+/* vim: set expandtab: */
+
+?>
diff --git a/wp-inst/wp-content/smarty-plugins/modifier.default.php b/wp-inst/wp-content/smarty-plugins/modifier.default.php
new file mode 100644
index 0000000..8268e39
--- /dev/null
+++ b/wp-inst/wp-content/smarty-plugins/modifier.default.php
@@ -0,0 +1,31 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty default modifier plugin
+ *
+ * Type: modifier<br>
+ * Name: default<br>
+ * Purpose: designate default value for empty variables
+ * @link http://smarty.php.net/manual/en/language.modifier.default.php
+ * default (Smarty online manual)
+ * @param string
+ * @param string
+ * @return string
+ */
+function smarty_modifier_default($string, $default = '')
+{
+ if (!isset($string) || $string === '')
+ return $default;
+ else
+ return $string;
+}
+
+/* vim: set expandtab: */
+
+?>
diff --git a/wp-inst/wp-content/smarty-plugins/modifier.escape.php b/wp-inst/wp-content/smarty-plugins/modifier.escape.php
new file mode 100644
index 0000000..a32a876
--- /dev/null
+++ b/wp-inst/wp-content/smarty-plugins/modifier.escape.php
@@ -0,0 +1,89 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty escape modifier plugin
+ *
+ * Type: modifier<br>
+ * Name: escape<br>
+ * Purpose: Escape the string according to escapement type
+ * @link http://smarty.php.net/manual/en/language.modifier.escape.php
+ * escape (Smarty online manual)
+ * @param string
+ * @param html|htmlall|url|quotes|hex|hexentity|javascript
+ * @return string
+ */
+function smarty_modifier_escape($string, $esc_type = 'html')
+{
+ switch ($esc_type) {
+ case 'html':
+ return htmlspecialchars($string, ENT_QUOTES);
+
+ case 'htmlall':
+ return htmlentities($string, ENT_QUOTES);
+
+ case 'url':
+ return rawurlencode($string);
+
+ case 'quotes':
+ // escape unescaped single quotes
+ return preg_replace("%(?<!\\\\)'%", "\\'", $string);
+
+ case 'hex':
+ // escape every character into hex
+ $return = '';
+ for ($x=0; $x < strlen($string); $x++) {
+ $return .= '%' . bin2hex($string[$x]);
+ }
+ return $return;
+
+ case 'hexentity':
+ $return = '';
+ for ($x=0; $x < strlen($string); $x++) {
+ $return .= '&#x' . bin2hex($string[$x]) . ';';
+ }
+ return $return;
+
+ case 'decentity':
+ $return = '';
+ for ($x=0; $x < strlen($string); $x++) {
+ $return .= '&#' . ord($string[$x]) . ';';
+ }
+ return $return;
+
+ case 'javascript':
+ // escape quotes and backslashes, newlines, etc.
+ return strtr($string, array('\\'=>'\\\\',"'"=>"\\'",'"'=>'\\"',"\r"=>'\\r',"\n"=>'\\n','</'=>'<\/'));
+
+ case 'mail':
+ // safe way to display e-mail address on a web page
+ return str_replace(array('@', '.'),array(' [AT] ', ' [DOT] '), $string);
+
+ case 'nonstd':
+ // escape non-standard chars, such as ms document quotes
+ $_res = '';
+ for($_i = 0, $_len = strlen($string); $_i < $_len; $_i++) {
+ $_ord = ord($string{$_i});
+ // non-standard char, escape it
+ if($_ord >= 126){
+ $_res .= '&#' . $_ord . ';';
+ }
+ else {
+ $_res .= $string{$_i};
+ }
+ }
+ return $_res;
+
+ default:
+ return $string;
+ }
+}
+
+/* vim: set expandtab: */
+
+?>
diff --git a/wp-inst/wp-content/smarty-plugins/modifier.highlightsearch.php b/wp-inst/wp-content/smarty-plugins/modifier.highlightsearch.php
new file mode 100644
index 0000000..cba48e3
--- /dev/null
+++ b/wp-inst/wp-content/smarty-plugins/modifier.highlightsearch.php
@@ -0,0 +1,80 @@
+<?php
+/*
+ * Smarty plugin
+ * -------------------------------------------------------------
+ * Type: modifier
+ * Name: highlight
+ * Version: 0.5
+ * Date: 2003-03-27
+ * Author: Pavel Prishivalko, aloner#telephone.ru
+ * Purpose: Highlight search term in text
+ * Install: Drop into the plugin directory
+ *
+ * Extended To 0.5 By: Alexey Kulikov <alex@pvl.at>
+ * Strips Tags for nice output, allows multiple term for highlight
+ * Modified and simplified to high light b2 searches by Donncha O Caoimh
+ * Added google search highlight using code from http://www.textism.com/tools/google_hilite/
+ * -------------------------------------------------------------
+ */
+
+function smarty_modifier_highlightsearch($text, $start_tag='<b style="color: #000; background-color: #ff0;">', $end_tag='</b>')
+{
+ global $smarty, $p, $s, $_SERVER, $HTTP_REFERER;
+
+ $orig = $text;
+
+ if( $s != '' )
+ {
+ $b = preg_quote($s);
+
+ if (!preg_match('/<.+>/',$text)) {
+
+ // If there are no tags in the text, we'll just do a simple search and replace
+ $text = preg_replace('/(\b'.$b.'\b)/i',$start_tag.'$1'.$end_tag,$text);
+
+ } else {
+
+ // If there are tags, we need to stay outside them
+ $text = preg_replace('/(?<=>)([^<]+)?(\b'.$b.'\b)/i','$1'.$start_tag.'$2'.$end_tag,$text);
+
+ }
+ }
+ else
+ {
+ $ref = urldecode($_SERVER[ 'HTTP_REFERER' ]);
+ // let's see if the referrer is google
+ if (preg_match('/^http:\/\/w?w?w?\.?google.*/i',$ref))
+ {
+ // if so, tweezer out the search query
+ $query = preg_replace('/^.*q=([^&]+)&?.*$/i','$1',$ref);
+
+ // scrub away nasty quote marks
+ $query = preg_replace('/\'|"/','',$query);
+
+ // chop the search terms into an array
+ $query_array = preg_split ("/[\s,\+\.]+/",$query);
+
+ // loop through the search terms
+ foreach($query_array as $b)
+ {
+ if (!preg_match('/<.+>/',$text)) {
+
+ // If there are no tags in the text, we'll just do a simple search and replace
+ $text = preg_replace('/(\b'.$b.'\b)/i',$start_tag.'$1'.$end_tag,$text);
+
+ } else {
+
+ // If there are tags, we need to stay outside them
+ $text = preg_replace('/(?<=>)([^<]+)?(\b'.$b.'\b)/i','$1'.$start_tag.'$2'.$end_tag,$text);
+
+ }
+ }
+ }
+ }
+ if( $text != $orig )
+ if( $p != '' )
+ $smarty->clear_cache( "post.tpl", $p.$p );
+
+ return $text;
+}
+?>
diff --git a/wp-inst/wp-content/smarty-plugins/modifier.indent.php b/wp-inst/wp-content/smarty-plugins/modifier.indent.php
new file mode 100644
index 0000000..1642bac
--- /dev/null
+++ b/wp-inst/wp-content/smarty-plugins/modifier.indent.php
@@ -0,0 +1,27 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty indent modifier plugin
+ *
+ * Type: modifier<br>
+ * Name: indent<br>
+ * Purpose: indent lines of text
+ * @link http://smarty.php.net/manual/en/language.modifier.indent.php
+ * indent (Smarty online manual)
+ * @param string
+ * @param integer
+ * @param string
+ * @return string
+ */
+function smarty_modifier_indent($string,$chars=4,$char=" ")
+{
+ return preg_replace('!^!m',str_repeat($char,$chars),$string);
+}
+
+?>
diff --git a/wp-inst/wp-content/smarty-plugins/modifier.lower.php b/wp-inst/wp-content/smarty-plugins/modifier.lower.php
new file mode 100644
index 0000000..0b4d151
--- /dev/null
+++ b/wp-inst/wp-content/smarty-plugins/modifier.lower.php
@@ -0,0 +1,25 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty lower modifier plugin
+ *
+ * Type: modifier<br>
+ * Name: lower<br>
+ * Purpose: convert string to lowercase
+ * @link http://smarty.php.net/manual/en/language.modifier.lower.php
+ * lower (Smarty online manual)
+ * @param string
+ * @return string
+ */
+function smarty_modifier_lower($string)
+{
+ return strtolower($string);
+}
+
+?>
diff --git a/wp-inst/wp-content/smarty-plugins/modifier.nl2br.php b/wp-inst/wp-content/smarty-plugins/modifier.nl2br.php
new file mode 100644
index 0000000..d6fabff
--- /dev/null
+++ b/wp-inst/wp-content/smarty-plugins/modifier.nl2br.php
@@ -0,0 +1,35 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty plugin
+ *
+ * Type: modifier<br>
+ * Name: nl2br<br>
+ * Date: Feb 26, 2003
+ * Purpose: convert \r\n, \r or \n to <<br>>
+ * Input:<br>
+ * - contents = contents to replace
+ * - preceed_test = if true, includes preceeding break tags
+ * in replacement
+ * Example: {$text|nl2br}
+ * @link http://smarty.php.net/manual/en/language.modifier.nl2br.php
+ * nl2br (Smarty online manual)
+ * @version 1.0
+ * @author Monte Ohrt <monte at ohrt dot com>
+ * @param string
+ * @return string
+ */
+function smarty_modifier_nl2br($string)
+{
+ return nl2br($string);
+}
+
+/* vim: set expandtab: */
+
+?>
diff --git a/wp-inst/wp-content/smarty-plugins/modifier.regex_replace.php b/wp-inst/wp-content/smarty-plugins/modifier.regex_replace.php
new file mode 100644
index 0000000..7eee497
--- /dev/null
+++ b/wp-inst/wp-content/smarty-plugins/modifier.regex_replace.php
@@ -0,0 +1,33 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty regex_replace modifier plugin
+ *
+ * Type: modifier<br>
+ * Name: regex_replace<br>
+ * Purpose: regular epxression search/replace
+ * @link http://smarty.php.net/manual/en/language.modifier.regex.replace.php
+ * regex_replace (Smarty online manual)
+ * @param string
+ * @param string|array
+ * @param string|array
+ * @return string
+ */
+function smarty_modifier_regex_replace($string, $search, $replace)
+{
+ if (preg_match('!\W(\w+)$!s', $search, $match) && (strpos($match[1], 'e') !== false)) {
+ /* remove eval-modifier from $search */
+ $search = substr($search, 0, -strlen($match[1])) . str_replace('e', '', $match[1]);
+ }
+ return preg_replace($search, $replace, $string);
+}
+
+/* vim: set expandtab: */
+
+?>
diff --git a/wp-inst/wp-content/smarty-plugins/modifier.replace.php b/wp-inst/wp-content/smarty-plugins/modifier.replace.php
new file mode 100644
index 0000000..2a43515
--- /dev/null
+++ b/wp-inst/wp-content/smarty-plugins/modifier.replace.php
@@ -0,0 +1,29 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty replace modifier plugin
+ *
+ * Type: modifier<br>
+ * Name: replace<br>
+ * Purpose: simple search/replace
+ * @link http://smarty.php.net/manual/en/language.modifier.replace.php
+ * replace (Smarty online manual)
+ * @param string
+ * @param string
+ * @param string
+ * @return string
+ */
+function smarty_modifier_replace($string, $search, $replace)
+{
+ return str_replace($search, $replace, $string);
+}
+
+/* vim: set expandtab: */
+
+?>
diff --git a/wp-inst/wp-content/smarty-plugins/modifier.spacify.php b/wp-inst/wp-content/smarty-plugins/modifier.spacify.php
new file mode 100644
index 0000000..dad057f
--- /dev/null
+++ b/wp-inst/wp-content/smarty-plugins/modifier.spacify.php
@@ -0,0 +1,29 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty spacify modifier plugin
+ *
+ * Type: modifier<br>
+ * Name: spacify<br>
+ * Purpose: add spaces between characters in a string
+ * @link http://smarty.php.net/manual/en/language.modifier.spacify.php
+ * spacify (Smarty online manual)
+ * @param string
+ * @param string
+ * @return string
+ */
+function smarty_modifier_spacify($string, $spacify_char = ' ')
+{
+ return implode($spacify_char,
+ preg_split('//', $string, -1, PREG_SPLIT_NO_EMPTY));
+}
+
+/* vim: set expandtab: */
+
+?>
diff --git a/wp-inst/wp-content/smarty-plugins/modifier.string_format.php b/wp-inst/wp-content/smarty-plugins/modifier.string_format.php
new file mode 100644
index 0000000..efd6215
--- /dev/null
+++ b/wp-inst/wp-content/smarty-plugins/modifier.string_format.php
@@ -0,0 +1,28 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty string_format modifier plugin
+ *
+ * Type: modifier<br>
+ * Name: string_format<br>
+ * Purpose: format strings via sprintf
+ * @link http://smarty.php.net/manual/en/language.modifier.string.format.php
+ * string_format (Smarty online manual)
+ * @param string
+ * @param string
+ * @return string
+ */
+function smarty_modifier_string_format($string, $format)
+{
+ return sprintf($format, $string);
+}
+
+/* vim: set expandtab: */
+
+?>
diff --git a/wp-inst/wp-content/smarty-plugins/modifier.strip.php b/wp-inst/wp-content/smarty-plugins/modifier.strip.php
new file mode 100644
index 0000000..cc5c453
--- /dev/null
+++ b/wp-inst/wp-content/smarty-plugins/modifier.strip.php
@@ -0,0 +1,33 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty strip modifier plugin
+ *
+ * Type: modifier<br>
+ * Name: strip<br>
+ * Purpose: Replace all repeated spaces, newlines, tabs
+ * with a single space or supplied replacement string.<br>
+ * Example: {$var|strip} {$var|strip:"&nbsp;"}
+ * Date: September 25th, 2002
+ * @link http://smarty.php.net/manual/en/language.modifier.strip.php
+ * strip (Smarty online manual)
+ * @author Monte Ohrt <monte at ohrt dot com>
+ * @version 1.0
+ * @param string
+ * @param string
+ * @return string
+ */
+function smarty_modifier_strip($text, $replace = ' ')
+{
+ return preg_replace('!\s+!', $replace, $text);
+}
+
+/* vim: set expandtab: */
+
+?>
diff --git a/wp-inst/wp-content/smarty-plugins/modifier.strip_tags.php b/wp-inst/wp-content/smarty-plugins/modifier.strip_tags.php
new file mode 100644
index 0000000..45f1ec1
--- /dev/null
+++ b/wp-inst/wp-content/smarty-plugins/modifier.strip_tags.php
@@ -0,0 +1,31 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty strip_tags modifier plugin
+ *
+ * Type: modifier<br>
+ * Name: strip_tags<br>
+ * Purpose: strip html tags from text
+ * @link http://smarty.php.net/manual/en/language.modifier.strip.tags.php
+ * strip_tags (Smarty online manual)
+ * @param string
+ * @param boolean
+ * @return string
+ */
+function smarty_modifier_strip_tags($string, $replace_with_space = true)
+{
+ if ($replace_with_space)
+ return preg_replace('!<[^>]*?>!', ' ', $string);
+ else
+ return strip_tags($string);
+}
+
+/* vim: set expandtab: */
+
+?>
diff --git a/wp-inst/wp-content/smarty-plugins/modifier.truncate.php b/wp-inst/wp-content/smarty-plugins/modifier.truncate.php
new file mode 100644
index 0000000..15a26ba
--- /dev/null
+++ b/wp-inst/wp-content/smarty-plugins/modifier.truncate.php
@@ -0,0 +1,43 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty truncate modifier plugin
+ *
+ * Type: modifier<br>
+ * Name: truncate<br>
+ * Purpose: Truncate a string to a certain length if necessary,
+ * optionally splitting in the middle of a word, and
+ * appending the $etc string.
+ * @link http://smarty.php.net/manual/en/language.modifier.truncate.php
+ * truncate (Smarty online manual)
+ * @param string
+ * @param integer
+ * @param string
+ * @param boolean
+ * @return string
+ */
+function smarty_modifier_truncate($string, $length = 80, $etc = '...',
+ $break_words = false)
+{
+ if ($length == 0)
+ return '';
+
+ if (strlen($string) > $length) {
+ $length -= strlen($etc);
+ if (!$break_words)
+ $string = preg_replace('/\s+?(\S+)?$/', '', substr($string, 0, $length+1));
+
+ return substr($string, 0, $length).$etc;
+ } else
+ return $string;
+}
+
+/* vim: set expandtab: */
+
+?>
diff --git a/wp-inst/wp-content/smarty-plugins/modifier.upper.php b/wp-inst/wp-content/smarty-plugins/modifier.upper.php
new file mode 100644
index 0000000..69960ae
--- /dev/null
+++ b/wp-inst/wp-content/smarty-plugins/modifier.upper.php
@@ -0,0 +1,25 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty upper modifier plugin
+ *
+ * Type: modifier<br>
+ * Name: upper<br>
+ * Purpose: convert string to uppercase
+ * @link http://smarty.php.net/manual/en/language.modifier.upper.php
+ * upper (Smarty online manual)
+ * @param string
+ * @return string
+ */
+function smarty_modifier_upper($string)
+{
+ return strtoupper($string);
+}
+
+?>
diff --git a/wp-inst/wp-content/smarty-plugins/modifier.wordwrap.php b/wp-inst/wp-content/smarty-plugins/modifier.wordwrap.php
new file mode 100644
index 0000000..b9a9fe9
--- /dev/null
+++ b/wp-inst/wp-content/smarty-plugins/modifier.wordwrap.php
@@ -0,0 +1,28 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty wordwrap modifier plugin
+ *
+ * Type: modifier<br>
+ * Name: wordwrap<br>
+ * Purpose: wrap a string of text at a given length
+ * @link http://smarty.php.net/manual/en/language.modifier.wordwrap.php
+ * wordwrap (Smarty online manual)
+ * @param string
+ * @param integer
+ * @param string
+ * @param boolean
+ * @return string
+ */
+function smarty_modifier_wordwrap($string,$length=80,$break="\n",$cut=false)
+{
+ return wordwrap($string,$length,$break,$cut);
+}
+
+?>
diff --git a/wp-inst/wp-content/smarty-plugins/outputfilter.protect_email.php b/wp-inst/wp-content/smarty-plugins/outputfilter.protect_email.php
new file mode 100644
index 0000000..bf38f9d
--- /dev/null
+++ b/wp-inst/wp-content/smarty-plugins/outputfilter.protect_email.php
@@ -0,0 +1,16 @@
+<?php
+/*
+ * Smarty plugin
+ * -------------------------------------------------------------
+ * File: outputfilter.protect_email.php
+ * Type: outputfilter
+ * Name: protect_email
+ * Purpose: Converts @ sign in email addresses to %40 as
+ * a simple protection against spambots
+ * -------------------------------------------------------------
+ */
+ function smarty_outputfilter_protect_email($output, &$smarty)
+ {
+ return preg_replace('!(\S+)@([a-zA-Z0-9\.\-]+\.([a-zA-Z]{2,3}|[0-9]{1,3}))!', '$1%40$2', $output);
+ }
+?>
diff --git a/wp-inst/wp-content/smarty-plugins/outputfilter.trimwhitespace.php b/wp-inst/wp-content/smarty-plugins/outputfilter.trimwhitespace.php
new file mode 100644
index 0000000..01e35e0
--- /dev/null
+++ b/wp-inst/wp-content/smarty-plugins/outputfilter.trimwhitespace.php
@@ -0,0 +1,75 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+/**
+ * Smarty trimwhitespace outputfilter plugin
+ *
+ * File: outputfilter.trimwhitespace.php<br>
+ * Type: outputfilter<br>
+ * Name: trimwhitespace<br>
+ * Date: Jan 25, 2003<br>
+ * Purpose: trim leading white space and blank lines from
+ * template source after it gets interpreted, cleaning
+ * up code and saving bandwidth. Does not affect
+ * <<PRE>></PRE> and <SCRIPT></SCRIPT> blocks.<br>
+ * Install: Drop into the plugin directory, call
+ * <code>$smarty->load_filter('output','trimwhitespace');</code>
+ * from application.
+ * @author Monte Ohrt <monte at ohrt dot com>
+ * @author Contributions from Lars Noschinski <lars@usenet.noschinski.de>
+ * @version 1.3
+ * @param string
+ * @param Smarty
+ */
+function smarty_outputfilter_trimwhitespace($source, &$smarty)
+{
+ // Pull out the script blocks
+ preg_match_all("!<script[^>]+>.*?</script>!is", $source, $match);
+ $_script_blocks = $match[0];
+ $source = preg_replace("!<script[^>]+>.*?</script>!is",
+ '@@@SMARTY:TRIM:SCRIPT@@@', $source);
+
+ // Pull out the pre blocks
+ preg_match_all("!<pre>.*?</pre>!is", $source, $match);
+ $_pre_blocks = $match[0];
+ $source = preg_replace("!<pre>.*?</pre>!is",
+ '@@@SMARTY:TRIM:PRE@@@', $source);
+
+ // Pull out the textarea blocks
+ preg_match_all("!<textarea[^>]+>.*?</textarea>!is", $source, $match);
+ $_textarea_blocks = $match[0];
+ $source = preg_replace("!<textarea[^>]+>.*?</textarea>!is",
+ '@@@SMARTY:TRIM:TEXTAREA@@@', $source);
+
+ // remove all leading spaces, tabs and carriage returns NOT
+ // preceeded by a php close tag.
+ $source = trim(preg_replace('/((?<!\?>)\n)[\s]+/m', '\1', $source));
+
+ // replace script blocks
+ smarty_outputfilter_trimwhitespace_replace("@@@SMARTY:TRIM:SCRIPT@@@",$_script_blocks, $source);
+
+ // replace pre blocks
+ smarty_outputfilter_trimwhitespace_replace("@@@SMARTY:TRIM:PRE@@@",$_pre_blocks, $source);
+
+ // replace textarea blocks
+ smarty_outputfilter_trimwhitespace_replace("@@@SMARTY:TRIM:TEXTAREA@@@",$_textarea_blocks, $source);
+
+ return $source;
+}
+
+function smarty_outputfilter_trimwhitespace_replace($search_str, $replace, &$subject) {
+ $_len = strlen($search_str);
+ $_pos = 0;
+ for ($_i=0, $_count=count($replace); $_i<$_count; $_i++)
+ if (($_pos=strpos($subject, $search_str, $_pos))!==false)
+ $subject = substr_replace($subject, $replace[$_i], $_pos, $_len);
+ else
+ break;
+
+}
+
+?>
diff --git a/wp-inst/wp-content/smarty-plugins/shared.escape_special_chars.php b/wp-inst/wp-content/smarty-plugins/shared.escape_special_chars.php
new file mode 100644
index 0000000..515763a
--- /dev/null
+++ b/wp-inst/wp-content/smarty-plugins/shared.escape_special_chars.php
@@ -0,0 +1,30 @@
+<?php
+/**
+ * Smarty shared plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * escape_special_chars common function
+ *
+ * Function: smarty_function_escape_special_chars<br>
+ * Purpose: used by other smarty functions to escape
+ * special chars except for already escaped ones
+ * @param string
+ * @return string
+ */
+function smarty_function_escape_special_chars($string)
+{
+ if(!is_array($string)) {
+ $string = preg_replace('!&(#?\w+);!', '%%%SMARTY_START%%%\\1%%%SMARTY_END%%%', $string);
+ $string = htmlspecialchars($string);
+ $string = str_replace(array('%%%SMARTY_START%%%','%%%SMARTY_END%%%'), array('&',';'), $string);
+ }
+ return $string;
+}
+
+/* vim: set expandtab: */
+
+?>
diff --git a/wp-inst/wp-content/smarty-plugins/shared.make_timestamp.php b/wp-inst/wp-content/smarty-plugins/shared.make_timestamp.php
new file mode 100644
index 0000000..acdd777
--- /dev/null
+++ b/wp-inst/wp-content/smarty-plugins/shared.make_timestamp.php
@@ -0,0 +1,43 @@
+<?php
+/**
+ * Smarty shared plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Function: smarty_make_timestamp<br>
+ * Purpose: used by other smarty functions to make a timestamp
+ * from a string.
+ * @param string
+ * @return string
+ */
+function smarty_make_timestamp($string)
+{
+ if(empty($string)) {
+ $string = "now";
+ }
+ $time = strtotime($string);
+ if (is_numeric($time) && $time != -1)
+ return $time;
+
+ // is mysql timestamp format of YYYYMMDDHHMMSS?
+ if (preg_match('/^\d{14}$/', $string)) {
+ $time = mktime(substr($string,8,2),substr($string,10,2),substr($string,12,2),
+ substr($string,4,2),substr($string,6,2),substr($string,0,4));
+
+ return $time;
+ }
+
+ // couldn't recognize it, try to return a time
+ $time = (int) $string;
+ if ($time > 0)
+ return $time;
+ else
+ return time();
+}
+
+/* vim: set expandtab: */
+
+?>
diff --git a/wp-inst/wp-content/smarty-plugins/wp_ozh_clickcounter.php b/wp-inst/wp-content/smarty-plugins/wp_ozh_clickcounter.php
new file mode 100644
index 0000000..2a3fe8c
--- /dev/null
+++ b/wp-inst/wp-content/smarty-plugins/wp_ozh_clickcounter.php
@@ -0,0 +1,504 @@
+<?php
+/*
+Plugin Name: Click Counter
+Plugin URI: http://frenchfragfactory.net/ozh/archives/2004/09/17/click-counter-plugin-for-wordpress/
+Description: Adds a click counter to links in your posts (<a href="../wp-content/plugins/wp_ozh_clickcounter.php">quick readme & manual</a>)
+Version: 1.0
+Author: Ozh
+Author URI: http://planetOzh.com
+*/
+// script called directly (or something global badly misconfigured :)
+if (!function_exists("get_settings")) {wp_ozh_click_readme();die;}
+
+
+/*************************************
+ * OPTIONAL EDIT BELOW *
+ * ~~ *
+ *************************************/
+
+// when specified "default value" it means it can be overridden on a per-link basis in each post
+
+// Core variables
+
+$wp_ozh_click['table'] = 'wp_linkclicks';
+ /* name of the table where stats will be stored. Look at the bottom or at plugin page to learn how to create this table */
+$wp_ozh_click['file'] = get_settings('siteurl') . "/go.php" ;
+ /* name of the click counter php file (provided with the plugin archive). A good place for it is your blog root. */
+
+
+// Basic features
+
+$wp_ozh_click['do_posts'] = 1;
+ /* 0 or 1, or true / false
+ * Add or not a link counter to links in your posts */
+
+$wp_ozh_click['do_comments'] = 1;
+ /* 0 or 1, or true / false
+ * Add or not a link counter to links in comments */
+
+ /* There is a quick editing needed if you also want to add a counter
+ * to commenters' website when specified, see plugin page. */
+
+$wp_ozh_click['track_all_links'] = 1 ;
+ /* 0 : adds a counter only when you add count="value" in your links html tag
+ * 1 : adds a counter to all external links in your posts (no need to add counter="1" if you plan to track them all)
+ * To keep track of internal links if set to 1, put absolute path (http://yourblog/link) instead of relative (/link) */
+
+$wp_ozh_click['in_title'] = 1 ;
+ /* 1 or 0 (or true / false)
+ * add number of hits in link title tag : <a href="http://site.com" title="X hits">site</a> */
+
+$wp_ozh_click['in_plain'] = 0 ;
+ /* 1 or 0 (or true / false)
+ * add number of hits in plain text : <a href="http://site.com">site</a> <span class="hitcounter">(XX hits)</span> */
+
+$wp_ozh_click['0click'] = 'No click';
+ /* default text for zero clicks. */
+
+$wp_ozh_click['1click'] = 'One hit';
+ /* default text for one click */
+
+$wp_ozh_click['clicks'] = '%% hits';
+ /* default text for several clicks, where %% will be replaced by a number */
+
+$wp_ozh_click['method'] = 3 ;
+ /* 1, 2 or 3
+ * There are 3 link 'href' modification modes available
+ * Each has advantages and drawbacks
+ * All validate any Doctype up to xhtml 1.1
+ *
+ * From input <a href="http://site.com">, each methods gives the following html :
+ *
+ * Method 1 :
+ * ^^^^^^^^^^
+ * <a href="http://site.com" onclick="window.location='/go.php?http://site.com'; return false">
+ * Cool : status bar shows real link without further trick.
+ * Less cool : doesnt work with "open link in new window"
+ *
+ * Method 2 :
+ * ^^^^^^^^^^
+ * <a href="/yourblog/go.php?http://site.com">
+ * Cool : works with "open in new window" and doesn't require Javascript enabled
+ * Less cool : shows ugly link "/blog/go.php?http://site.com" in status bar
+ *
+ * Method 3 :
+ * ^^^^^^^^^^
+ * like method 2 but also modify status bar to hide the "yoursite.com/blog/go.php?" part
+ * with an onmouseover="javascript:window.status='http://site.com'; return false"
+ * Cool : status bar shows real link.
+ * Less cool : adds a few bytes of html. But who cares :)
+ *
+ * I'd suggest you use preferably method 3, or at least method 2. Method 1 is really less
+ * accurate since it doesn't keep track of links opened in a new window */
+
+
+// Link title features
+// The plugin is able to retrieve a remote file title (from it's <title> html tag)
+
+$wp_ozh_click['get_title'] = 0;
+ /* 1 or 0 (or true / false)
+ * Get remote page title the first time a user clicks a link to store it along with hits in the table
+ * Will slow down a bit the first clicker (1 or 2 seconds, time for your website to retrieve the distant page)
+ * Titles stored are used for example when printing top clicked links
+ * !! Note : uses fopen(), check your host has enabled this !! */
+
+$wp_ozh_click['get_title_forcerefresh'] = 50;
+ /* Refresh remote page title every XX clicks ?
+ * Set to 0 if you don't want to check & refresh titles every XX clicks
+ * (the higher traffic - then clicks - you get, the higher you should set this
+ * To be honest this is really a gadget - almost totally useless :)
+ * Examples : 50 for Joe's blog, 3000 for Slashdottish blog */
+
+$wp_ozh_click['extensions'] = array (
+ "ace", "arj", "bin", "bz2", "dat", "deb", "gz", "hqx", "pak", "pk3", "rar", "rpm", "sea", "sit", "tar", "wsz", "zip",
+ "aif", "aiff", "au", "mid", "mod", "mp3", "ogg", "ram", "rm", "wav",
+ "ani", "bmp", "dwg", "eps", "eps2", "gif", "ico", "jpeg", "jpg", "png", "psd", "psp", "qt", "svg", "swf", "tga", "tiff", "wmf", "xcf",
+ "avi", "mov", "mpeg", "mpg",
+ "c", "class", "h", "java ", "jar", "js",
+ "bat", "chm", "cur", "dll", "exe", "hlp", "inf", "ocx", "pps", "ppt", "reg", "scr", "xls",
+ "css", "conf", "doc", "ini", "pdf", "rtf", "ttf", "txt"
+); /* Most common non html file extensions
+ * These are files that have no <title> html tag, so their link title will be $document.$ext */
+
+// Top links function features
+
+$wp_ozh_click['top_limit'] = 5;
+ /* default number of top links to be displayed by wp_ozh_click_topclicks() */
+
+$wp_ozh_click['top_pattern'] = '<li><a href="%%link_url%%" title="%%link_title%%">%%link_title_trim%%</a>: %%link_clicks%%</li>';
+ /* default pattern used to display top links
+ * Any %%tag%% where "tag" can be : link_id, link_url, link_clicks, link_date, link_title, link_title_trim (shortened, see below)
+ * Example : '%%link_title%% (%%link_url%%) = %%link_clicks%%' */
+
+$wp_ozh_click['trim'] = 15;
+ /* default maximum length of link titles
+ * When printing top links titles, trim long link titles output to XX characters (0 not to trim) */
+
+
+
+
+/*************************************
+ * DO NOT EDIT BELOW *
+ * ~~ *
+ *************************************/
+
+//**************************************************************************************************************************
+
+
+// inputs a URL, returns an integer (number of clicks for the URL)
+function wp_ozh_click_getcount ($url = "") {
+ global $wpdb, $wp_ozh_click, $wpblog;
+ $url = str_replace("&amp;", "&", $url);
+ $url = wp_ozh_click_getrealpath($url);
+ return $wpdb->get_var("SELECT link_clicks FROM $wp_ozh_click[table] WHERE blogID='$wpblog' AND link_url='$url'");
+}
+
+
+// inputs a URL, returns text
+function wp_ozh_click_getclicks ($url = '', $zeroclick = '',
+ $oneclick = '', $lotsaclicks = '' ) {
+ $result = wp_ozh_click_getcount ($url);
+ $result = wp_ozh_click_labelize ($result, $zeroclick, $oneclick, $lotsaclicks);
+ $wp_ozh_click['temp'] = "...".$url;
+ return $result;
+}
+
+// inputs a number, returns text like "<number> hits"
+function wp_ozh_click_labelize ($number = 0, $zeroclick = '',
+ $oneclick = '', $lotsaclicks = '' ) {
+ global $wp_ozh_click;
+ if (!$zeroclick) $zeroclick = $wp_ozh_click['0click'];
+ if (!$oneclick) $oneclick = $wp_ozh_click['1click'];
+ if (!$lotsaclicks) $lotsaclicks = $wp_ozh_click['clicks'];
+
+ switch ($number) :
+ case "":
+ return $zeroclick;
+ break;
+ case 1:
+ return $oneclick;
+ break;
+ default:
+ return (str_replace ("%%", $number, $lotsaclicks));
+ endswitch;
+}
+
+
+// parses string to detect and process pairs of tag="value"
+function wp_ozh_click_parse ($html="", $all=0) {
+ global $wp_ozh_click;
+
+ preg_match_all ('/[^=]{1,}="[^"]+"/', $html, $wp_ozh_click['link']);
+ foreach ($wp_ozh_click['link'][0] as $pair) {
+ list ($tag , $value) = explode ("=", $pair , 2);
+ $wp_ozh_click['link'][trim($tag)]=trim($value, '"');
+ }
+ unset ($wp_ozh_click['link'][0]);
+
+ $wp_ozh_click['modify_href'] = 0;
+ // do we want to display clicks ?
+ if ( !isset($wp_ozh_click['link']['count']) || $wp_ozh_click['link']['count'] != "0" ) {
+ if (
+ ( ($all == 1) && (eregi("^[a-z]+://", $wp_ozh_click['link']['href'])) )
+ ||
+ ( isset($wp_ozh_click['link']['count'] ) )
+ ) {
+ $wp_ozh_click['modify_href'] = 1;
+ }
+ }
+
+ if ($wp_ozh_click['modify_href']) {
+ if ( (!isset($wp_ozh_click['link']['count']) && $wp_ozh_click['track_all_links'] && $wp_ozh_click['in_title'] ) || ( $wp_ozh_click['in_title'] && $wp_ozh_click['link']['count']=="1" ) || stristr($wp_ozh_click['link']['count'],'title') ) {
+ if (isset($wp_ozh_click['link']['title'])) {
+ $wp_ozh_click['link']['title']= $wp_ozh_click['link']['title'] . " (" . wp_ozh_click_getclicks($wp_ozh_click['link']['href']) . ")";
+ } else {
+ $wp_ozh_click['link']['title']= "(" . wp_ozh_click_getclicks($wp_ozh_click['link']['href']) . ")";
+ }
+ }
+ if ( (!isset($wp_ozh_click['link']['count']) && $wp_ozh_click['track_all_links'] && $wp_ozh_click['in_plain'] ) || ( $wp_ozh_click['in_plain'] && $wp_ozh_click['link']['count']=="1" ) || stristr($wp_ozh_click['link']['count'],'inline') ) {
+ $wp_ozh_click['after'] = ' <span class="hitcounter">(' . wp_ozh_click_getclicks($wp_ozh_click['link']['href']) . ')</span>' ;
+ }
+
+ switch ($wp_ozh_click['method']) :
+ case 1 :
+ $wp_ozh_click['link']['onclick'] = "window.location='". $wp_ozh_click['file'] . "?" . $wp_ozh_click['link']['href'] . "'; return false";
+ break;
+ case 2 :
+ $wp_ozh_click['link']['href'] = $wp_ozh_click['file'] . "?" . $wp_ozh_click['link']['href'] ;
+ break;
+ case 3 :
+ $wp_ozh_click['link']['onmouseover']="javascript:window.status='". $wp_ozh_click['link']['href'] ."'; return true;" ;
+ $wp_ozh_click['link']['onmouseout']="javascript:window.status=''; return true;" ;
+ $wp_ozh_click['link']['href'] = $wp_ozh_click['file'] . "?" . $wp_ozh_click['link']['href'] ;
+ endswitch;
+
+
+ unset ($wp_ozh_click['link']['count']);
+ }
+
+ $html='';
+ foreach ($wp_ozh_click['link'] as $key => $value) {
+ $html .= $key . "=\"" . $value . "\" ";
+ }
+ $html=trim($html);
+ return '<a '. $html .'>';
+}
+
+// convert relative path ("/blog/dir/file" or "dir/this/file") into absolute (from blog's index.php)
+function wp_ozh_click_getrealpath ($url = "") {
+ $url = preg_replace ("/#.*$/",'',$url);
+
+ if (!eregi("^[a-z]+://", $url)) {
+ if (eregi("^/", $url)) {
+ $url = 'http://' . $_SERVER['HTTP_HOST'] . $url;
+ } else {
+ $url = get_settings('siteurl') . '/' . $url;
+ }
+ }
+ return $url;
+}
+
+
+// increments field link_click for a given URL
+function wp_ozh_click_increment ($url="") {
+ global $wpdb, $wp_ozh_click, $wpblog;
+ $url = wp_ozh_click_getrealpath($url);
+
+ // if (!get_magic_quotes_gpc()) {$url = add_magic_quotes($url);}
+
+ $result = $wpdb->get_var("SELECT link_clicks FROM $wp_ozh_click[table] WHERE blogID='$wpblog' AND link_url='$url'");
+
+ if ($result) {
+ $todo = 'link_clicks=(link_clicks + 1)';
+ if (($wp_ozh_click['get_title_forcerefresh']) && (($result % $wp_ozh_click['get_title_forcerefresh']) == 0)) {
+ $link_title=wp_ozh_click_gettitle($url);
+ if ($link_title) {
+ $todo .= ", link_title='$link_title'";
+ }
+ }
+ $return = $wpdb->query("UPDATE $wp_ozh_click[table] SET $todo WHERE blogID='$wpblog' AND link_url='$url'");
+ } else {
+ $link_date = gmdate('Y-m-d H:i:s', (time() + (get_settings('gmt_offset') * 3600)));
+ if ($wp_ozh_click['get_title']) {
+ $link_title=wp_ozh_click_gettitle($url);
+ } else {
+ $link_title='';
+ }
+ $return = $wpdb->query("INSERT INTO $wp_ozh_click[table] (blogID, link_url, link_clicks, link_date, link_title) VALUES ('$wpblog', '$url', 1, '$link_date', '$link_title')");
+ };
+ return $return;
+}
+
+
+// prints most clicked links
+function wp_ozh_click_topclicks ($limit = '', $trim = '', $pattern = '') {
+ global $wpdb, $wp_ozh_click, $wpblog;
+ if (!$limit) $limit = $wp_ozh_click['top_limit'];
+ if (!$pattern) $pattern = $wp_ozh_click['top_pattern'];
+ if (!$trim) $trim = $wp_ozh_click['trim'];
+
+ $results = $wpdb->get_results("select * from $wp_ozh_click[table] WHERE blogID='$wpblog' ORDER BY link_clicks DESC LIMIT $limit");
+ foreach ($results as $result) {
+ $html = $pattern;
+ $html = preg_replace ( "/%%link_url%%/i", $wp_ozh_click['file'] . "?" . "$result->link_url", $html);
+ $html = preg_replace ( "/%%link_clicks%%/i", wp_ozh_click_labelize($result->link_clicks), $html);
+ $html = preg_replace ( "/%%link_date%%/i", "$result->link_date", $html);
+ if (!$result->link_title) {
+ // prettyfies link_title for display : no "http://www." or trailing "/"
+ $result->link_title = preg_replace("/((ht)*f*tp:\/\/)*(www\.)*/", "", $result->link_url);
+ $result->link_title = preg_replace("/\/$/", "", $result->link_title);
+ }
+ if ($trim && (strlen($result->link_title) > $trim)) {
+ $result->link_title_trim = substr($result->link_title, 0, $trim) . '&#8230';
+ } else {
+ $result->link_title_trim = $result->link_title;
+ }
+ $html = preg_replace ( "/%%link_title_trim%%/i", "$result->link_title_trim", $html);
+ $html = preg_replace ( "/%%link_title%%/i", "$result->link_title", $html);
+ echo $html . "\n";
+ }
+}
+
+
+// prints number of links tracked
+function wp_ozh_click_linkcount ($display=1) {
+ global $wpdb, $wp_ozh_click;
+ if (!$wp_ozh_click['stats']) wp_ozh_click_getstats();
+ if ($display)
+ echo $wp_ozh_click['stats']->linkcount;
+ return $wp_ozh_click['stats']->linkcount;
+}
+
+
+// prints total number of clicks
+function wp_ozh_click_clickcount ($display=1) {
+ global $wpdb, $wp_ozh_click;
+ if (!$wp_ozh_click['stats']) wp_ozh_click_getstats();
+ if ($display)
+ echo $wp_ozh_click['stats']->clickcount;
+ return $wp_ozh_click['stats']->clickcount;
+
+}
+
+
+// retrieves various stats
+function wp_ozh_click_getstats () {
+ global $wpdb, $wp_ozh_click, $wpblog;
+ $wp_ozh_click['stats'] = $wpdb->get_row("SELECT count(*) AS linkcount, sum(link_clicks) AS clickcount FROM $wp_ozh_click[table] WHERE blogID='$wpblog'");
+ //echo $wp_ozh_click['stats']->clickcount;
+ //echo "<hr>";
+ //echo $wp_ozh_click['stats']->linkcount;
+ return $wp_ozh_click['stats'];
+}
+
+// return title of a (local or remote) webpage
+function wp_ozh_click_gettitle ($url = "") {
+ global $wp_ozh_click;
+ eregi("/([^#\?\/]+)\.([a-z0-9]+)$", $url, $file);
+ $ext = $file[2];
+ $file = $file[1];
+ $in_array = in_array($ext, $wp_ozh_click['extensions']);
+ switch ($in_array):
+ case true:
+ return "$file.$ext";
+ break;
+ case false:
+ if (function_exists('fopen')) {
+ $fp = fopen ($url, 'r');
+ while (! feof ($fp)){
+ $webpage .= fgets ($fp, 1024);
+ if (stristr($webpage, '<title>' )){
+ break;
+ }
+ }
+ if (eregi("<title>(.*)</title>", $webpage, $out)) {
+ return addslashes($out[1]);
+ }
+ else{
+ return "";
+ }
+ } else {
+ return "";
+ }
+ break;
+ endswitch;
+}
+
+
+// readme & check install
+function wp_ozh_click_readme() {
+ echo '<html><head>
+ <title>Click Counter Plugin for Wordpress - By Ozh</title>
+ <link rel="stylesheet" href="../../wp-admin/wp-admin.css" type="text/css" />
+ </head>
+ <body>
+ <div id="wphead" style="height: 4.5em">
+ <h1 align="right">Click Counter Plugin - By Ozh</h1>
+ </div>
+ <div class="wrap">
+ <h2>Thanks :)</h2>
+ <p>Thank you for installing this plugin !</p>
+ <h2>About this plugin</h2>
+ <p>This plugin adds a "tracker" to links in your posts and your comments, so that when someone clicks on them, the link\'s hit counter increments. The number of hits can also be displayed in a variety of flavours. You can choose to add a hit counter to all links (default) or only to chosen links</p>
+ <h2>2 steps installation and usage "out of the box"</h2>
+ <ol><li><p>First, create a new table in your WordPress MySQL database, named wp_linkclicks, using for example PHPMyAdmin with the following query :</p>
+ <pre class="updated">
+CREATE TABLE `wp_linkclicks` (
+ `link_id` INT NOT NULL AUTO_INCREMENT ,
+ `link_url` TEXT NOT NULL ,
+ `link_clicks` INT NOT NULL ,
+ `link_date` DATETIME NOT NULL ,
+ `link_title` TEXT NOT NULL ,
+ UNIQUE (
+ `link_id`
+ )
+);</pre></li>
+ <li><p>Then put the plugin file in <strong><em>yourblog</em>/wp-content/plugins/</strong> and <strong>activate it</strong>
+ from the <a href="../../wp-admin/plugins.php">admin interface</a>.</p></li></ol>
+ <p>The plugin should now work silently without further working. Get back to blogging and posting link as usual :)</p>
+ <h2>Optional Configuration</h2>
+ <p>You will find detailed information about how to configure the plugin in its source itself:
+ the section you can configure is well commented. You can do so from within the <a href="../../wp-admin/templates.php?file=wp-content/plugins/wp_ozh_clickcounter.php">admin interface</a> as well.
+ <p>You can also find detailed information and examples of use
+ at the <a href="http://frenchfragfactory.net/ozh/">plugin\'s homepage</a>.</p>
+ <h2>Feedback & Disclaimer</h2>
+ <p>I\'d appreciate your leaving a comment on the plugin page, to suggest any improvement, bug fix, or just to say if you like the plugin or not :)
+ By the way, you\'ll find on <a href="http://frenchfragfactory.net/ozh/archives/category/wordpress/">my site</a> a few other plugins (<a href="http://frenchfragfactory.net/ozh/archives/2004/08/27/ip-to-nation-plugin/">IP to Nation plugin</a> in particular) you may find of interest.</p>
+ <p>Any resemblance between this page and a well-known admin interface is purely coincidental :-P</p>
+ </div>
+ <div id="footer"><p><a href="http://planetOzh.com/"><img src="http://frenchfragfactory.net/ozh/wp-images/btn_planetozh.png" border="0" alt="planetOzh.com" /></a><br />
+ </div>
+ </body></html>
+ ';
+}
+
+// the one that starts it all
+function wp_ozh_click_modifyhrefs ($input) {
+ $input = preg_replace_callback ("/<a ([^>]{1,})>(.+?<\/a>)/", "wp_ozh_click_do_posts", $input);
+ // ** OMFG ** I finally understood what preg_replace_callback is ! :))
+ return $input;
+}
+
+// callback function
+function wp_ozh_click_do_posts($text) {
+ global $wp_ozh_click;
+ unset ($wp_ozh_click['after']);
+
+ $before = wp_ozh_click_parse($text[1],$wp_ozh_click['track_all_links']);
+ $text = $text[2];
+ return $before.$text.$wp_ozh_click['after'];
+}
+
+function wp_ozh_click_comment_author_link() {
+ global $comment;
+ $url = apply_filters('comment_url', $comment->comment_author_url);
+ $author = apply_filters('comment_author', $comment->comment_author);
+ if (!$author) $author = 'Anonymous';
+
+ if (empty($url)) :
+ echo $author;
+ else:
+ echo wp_ozh_click_modifyhrefs("<a href=\"$url\" rel=\"external\">$author</a>");
+ endif;
+}
+
+
+// Add per-post filtering:
+if ($wp_ozh_click['do_posts'])
+ add_filter('the_content', 'wp_ozh_click_modifyhrefs');
+if ($wp_ozh_click['do_comments'])
+ add_filter('comment_text', 'wp_ozh_click_modifyhrefs');
+
+
+// And that's it.
+
+
+/* Future enhancements ?
+ - handle malformed html tags like <a href=http://site.com count=1>site</a> (no "quotes")
+*/
+
+
+/* Example post :
+ Post this in your blog and watch how modifying the script configuration affects display of counters.
+
+--8<-----8<-----[cut & paste]-
+<strong>Tests with external links : href="http://external-link.com" </strong>
+<a href="http://external-link.com" count="0">count="0"</a> never shows click count
+<a href="http://external-link.com" count="1">count="1"</a> shows click count according to defaults as set in the plugin
+<a href="http://external-link.com" count="title">count="title"</a> always shows a count in link title (mouseover)
+<a href="http://external-link.com" count="inline">count="inline"</a> always shows a count next to title in plain text
+<a href="http://external-link.com" count="inline title">count="inline title"</a> always shows both
+<a href="http://external-link.com">count not specified</a> shows or not depending on defaults as set in the plugin (tracking all links or not)
+
+<strong>Tests with internal links : href="/local_dir/file"</strong>
+<a href="/local_dir/file" count="0">count="0"</a> never shows click count
+<a href="/local_dir/file" count="1">count="1"</a> always shows click count, according to defaults
+<a href="/local_dir/file" count="title">count="title"</a> always shows click count in link title
+<a href="/local_dir/file" count="inline">count="inline"</a> always shows click count next to title in plain text
+<a href="/local_dir/file" count="inline title">count="inline title"</a> always shows both
+<a href="/local_dir/file">count not specified</a> never shows click count
+--8<-----8<-----[cut & paste]-
+
+*/
+
+?>
diff --git a/wp-inst/wp-content/smarty-templates/blogroll.tpl b/wp-inst/wp-content/smarty-templates/blogroll.tpl
new file mode 100644
index 0000000..0cde746
--- /dev/null
+++ b/wp-inst/wp-content/smarty-templates/blogroll.tpl
@@ -0,0 +1,3 @@
+{foreach from=$links item=link}
+ <a href="{$link.url}">{$link.name}</a><br />
+{/foreach}
diff --git a/wp-inst/wp-content/smarty-templates/noblogroll.tpl b/wp-inst/wp-content/smarty-templates/noblogroll.tpl
new file mode 100644
index 0000000..c3f00e7
--- /dev/null
+++ b/wp-inst/wp-content/smarty-templates/noblogroll.tpl
@@ -0,0 +1 @@
+<div style='padding: 2px; border: 1px dashed #000'> <b>blo.gs favourites!</b><br><a href="http://blo.gs/signup.php">Signup</a> on <a href="http://blo.gs/">blo.gs</a> to track your favourite blogs on this site! Fill in your blogID and a teststring in your blog template!</div>
diff --git a/wp-inst/wp-content/themes/classic/comments-popup.php b/wp-inst/wp-content/themes/classic/comments-popup.php
new file mode 100644
index 0000000..4d22c93
--- /dev/null
+++ b/wp-inst/wp-content/themes/classic/comments-popup.php
@@ -0,0 +1,113 @@
+<?php
+/* Don't remove these lines. */
+add_filter('comment_text', 'popuplinks');
+foreach ($posts as $post) { start_wp();
+?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+ <title><?php echo get_settings('blogname'); ?> - <?php echo sprintf(__("Comments on %s"), the_title('','',false)); ?></title>
+
+ <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_settings('blog_charset'); ?>" />
+ <style type="text/css" media="screen">
+ @import url( <?php bloginfo('stylesheet_url'); ?> );
+ body { margin: 3px; }
+ </style>
+
+</head>
+<body id="commentspopup">
+
+<h1 id="header"><a href="" title="<?php echo get_settings('blogname'); ?>"><?php echo get_settings('blogname'); ?></a></h1>
+
+<h2 id="comments"><?php _e("Comments"); ?></h2>
+
+<p><a href="<?php echo get_settings('siteurl'); ?>/wp-commentsrss2.php?p=<?php echo $post->ID; ?>"><?php _e("<abbr title=\"Really Simple Syndication\">RSS</abbr> feed for comments on this post."); ?></a></p>
+
+<?php if ('open' == $post->ping_status) { ?>
+<p><?php _e("The <acronym title=\"Uniform Resource Identifier\">URI</acronym> to TrackBack this entry is:"); ?> <em><?php trackback_url() ?></em></p>
+<?php } ?>
+
+<?php
+// this line is WordPress' motor, do not delete it.
+$comment_author = (isset($_COOKIE['comment_author_' . COOKIEHASH])) ? trim($_COOKIE['comment_author_'. COOKIEHASH]) : '';
+$comment_author_email = (isset($_COOKIE['comment_author_email_'. COOKIEHASH])) ? trim($_COOKIE['comment_author_email_'. COOKIEHASH]) : '';
+$comment_author_url = (isset($_COOKIE['comment_author_url_'. COOKIEHASH])) ? trim($_COOKIE['comment_author_url_'. COOKIEHASH]) : '';
+$comments = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_post_ID = $id AND comment_approved = '1' ORDER BY comment_date");
+$commentstatus = $wpdb->get_row("SELECT comment_status, post_password FROM $wpdb->posts WHERE ID = $id");
+if (!empty($commentstatus->post_password) && $_COOKIE['wp-postpass_'. COOKIEHASH] != $commentstatus->post_password) { // and it doesn't match the cookie
+ echo(get_the_password_form());
+} else { ?>
+
+<?php if ($comments) { ?>
+<ol id="commentlist">
+<?php foreach ($comments as $comment) { ?>
+ <li id="comment-<?php comment_ID() ?>">
+ <?php comment_text() ?>
+ <p><cite><?php comment_type(__('Comment'), __('Trackback'), __('Pingback')); ?> <?php _e("by"); ?> <?php comment_author_link() ?> &#8212; <?php comment_date() ?> @ <a href="#comment-<?php comment_ID() ?>"><?php comment_time() ?></a></cite></p>
+ </li>
+
+<?php } // end for each comment ?>
+</ol>
+<?php } else { // this is displayed if there are no comments so far ?>
+ <p><?php _e("No comments yet."); ?></p>
+<?php } ?>
+
+<?php if ('open' == $commentstatus->comment_status) { ?>
+<h2><?php _e("Leave a comment"); ?></h2>
+<p><?php _e("Line and paragraph breaks automatic, e-mail address never displayed, <acronym title=\"Hypertext Markup Language\">HTML</acronym> allowed:"); ?> <code><?php echo allowed_tags(); ?></code></p>
+
+<form action="<?php echo get_settings('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">
+ <p>
+ <input type="text" name="author" id="author" class="textarea" value="<?php echo $comment_author; ?>" size="28" tabindex="1" />
+ <label for="author"><?php _e("Name"); ?></label>
+ <input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" />
+ <input type="hidden" name="redirect_to" value="<?php echo wp_specialchars($_SERVER["REQUEST_URI"]); ?>" />
+ </p>
+
+ <p>
+ <input type="text" name="email" id="email" value="<?php echo $comment_author_email; ?>" size="28" tabindex="2" />
+ <label for="email"><?php _e("E-mail"); ?></label>
+ </p>
+
+ <p>
+ <input type="text" name="url" id="url" value="<?php echo $comment_author_url; ?>" size="28" tabindex="3" />
+ <label for="url"><?php _e("<acronym title=\"Uniform Resource Identifier\">URI</acronym>"); ?></label>
+ </p>
+
+ <p>
+ <label for="comment"><?php _e("Your Comment"); ?></label>
+ <br />
+ <textarea name="comment" id="comment" cols="70" rows="4" tabindex="4"></textarea>
+ </p>
+
+ <p>
+ <input name="submit" type="submit" tabindex="5" value="<?php _e("Say It!"); ?>" />
+ </p>
+ <?php do_action('comment_form', $post->ID); ?>
+</form>
+<?php } else { // comments are closed ?>
+<p><?php _e("Sorry, the comment form is closed at this time."); ?></p>
+<?php }
+} // end password check
+?>
+
+<div><strong><a href="javascript:window.close()"><?php _e("Close this window."); ?></a></strong></div>
+
+<?php // if you delete this the sky will fall on your head
+}
+?>
+
+<!-- // this is just the end of the motor - don't touch that line either :) -->
+<?php //} ?>
+<p class="credit"><?php timer_stop(1); ?> <?php echo sprintf(__("<cite>Powered by <a href=\"http://wordpress.org\" title=\"%s\"><strong>Wordpress</strong></a></cite>"),__("Powered by WordPress, state-of-the-art semantic personal publishing platform.")); ?></p>
+<?php // Seen at http://www.mijnkopthee.nl/log2/archive/2003/05/28/esc(18) ?>
+<script type="text/javascript">
+<!--
+document.onkeypress = function esc(e) {
+ if(typeof(e) == "undefined") { e=event; }
+ if (e.keyCode == 27) { self.close(); }
+}
+// -->
+</script>
+</body>
+</html>
diff --git a/wp-inst/wp-content/themes/classic/comments.php b/wp-inst/wp-content/themes/classic/comments.php
new file mode 100644
index 0000000..6222f1a
--- /dev/null
+++ b/wp-inst/wp-content/themes/classic/comments.php
@@ -0,0 +1,75 @@
+<?php if ( !empty($post->post_password) && $_COOKIE['wp-postpass_' . COOKIEHASH] != $post->post_password) : ?>
+<p><?php _e('Enter your password to view comments.'); ?></p>
+<?php return; endif; ?>
+
+<h2 id="comments"><?php comments_number(__('No Comments'), __('1 Comment'), __('% Comments')); ?>
+<?php if ( comments_open() ) : ?>
+ <a href="#postcomment" title="<?php _e("Leave a comment"); ?>">&raquo;</a>
+<?php endif; ?>
+</h2>
+
+<?php if ( $comments ) : ?>
+<ol id="commentlist">
+
+<?php foreach ($comments as $comment) : ?>
+ <li id="comment-<?php comment_ID() ?>">
+ <?php comment_text() ?>
+ <p><cite><?php comment_type(__('Comment'), __('Trackback'), __('Pingback')); ?> <?php _e('by'); ?> <?php comment_author_link() ?> &#8212; <?php comment_date() ?> @ <a href="#comment-<?php comment_ID() ?>"><?php comment_time() ?></a></cite> <?php edit_comment_link(__("Edit This"), ' |'); ?></p>
+ </li>
+
+<?php endforeach; ?>
+
+</ol>
+
+<?php else : // If there are no comments yet ?>
+ <p><?php _e('No comments yet.'); ?></p>
+<?php endif; ?>
+
+<p><?php comments_rss_link(__('<abbr title="Really Simple Syndication">RSS</abbr> feed for comments on this post.')); ?>
+<?php if ( pings_open() ) : ?>
+ <a href="<?php trackback_url() ?>" rel="trackback"><?php _e('TrackBack <abbr title="Uniform Resource Identifier">URI</abbr>'); ?></a>
+<?php endif; ?>
+</p>
+
+<?php if ( comments_open() ) : ?>
+<h2 id="postcomment"><?php _e('Leave a comment'); ?></h2>
+
+<?php if ( get_option('comment_registration') && !$user_ID ) : ?>
+<p>You must be <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?redirect_to=<?php the_permalink(); ?>">logged in</a> to post a comment.</p>
+<?php else : ?>
+
+<form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">
+
+<?php if ( $user_ID ) : ?>
+
+<p>Logged in as <a href="<?php echo get_option('siteurl'); ?>/wp-admin/profile.php"><?php echo $user_identity; ?></a>. <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?action=logout" title="<?php _e('Log out of this account') ?>">Logout &raquo;</a></p>
+
+<?php else : ?>
+
+<p><input type="text" name="author" id="author" value="<?php echo $comment_author; ?>" size="22" tabindex="1" />
+<label for="author"><small>Name <?php if ($req) _e('(required)'); ?></small></label></p>
+
+<p><input type="text" name="email" id="email" value="<?php echo $comment_author_email; ?>" size="22" tabindex="2" />
+<label for="email"><small>Mail (will not be published) <?php if ($req) _e('(required)'); ?></small></label></p>
+
+<p><input type="text" name="url" id="url" value="<?php echo $comment_author_url; ?>" size="22" tabindex="3" />
+<label for="url"><small>Website</small></label></p>
+
+<?php endif; ?>
+
+<!--<p><small><strong>XHTML:</strong> You can use these tags: <?php echo allowed_tags(); ?></small></p>-->
+
+<p><textarea name="comment" id="comment" cols="100%" rows="10" tabindex="4"></textarea></p>
+
+<p><input name="submit" type="submit" id="submit" tabindex="5" value="Submit Comment" />
+<input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" />
+</p>
+<?php do_action('comment_form', $post->ID); ?>
+
+</form>
+
+<?php endif; // If registration required and not logged in ?>
+
+<?php else : // Comments are closed ?>
+<p><?php _e('Sorry, the comment form is closed at this time.'); ?></p>
+<?php endif; ?>
diff --git a/wp-inst/wp-content/themes/classic/footer.php b/wp-inst/wp-content/themes/classic/footer.php
new file mode 100644
index 0000000..b18b022
--- /dev/null
+++ b/wp-inst/wp-content/themes/classic/footer.php
@@ -0,0 +1,12 @@
+<!-- begin footer -->
+</div>
+
+<?php get_sidebar(); ?>
+
+<p class="credit"><!--<?php echo $wpdb->num_queries; ?> queries. <?php timer_stop(1); ?> seconds. --> <cite><?php echo sprintf(__("Powered by <a href='http://wordpress.org' title='%s'><strong>WordPress</strong></a>"), __("Powered by WordPress, state-of-the-art semantic personal publishing platform.")); ?></cite></p>
+
+</div>
+
+<?php wp_footer(); ?>
+</body>
+</html> \ No newline at end of file
diff --git a/wp-inst/wp-content/themes/classic/header.php b/wp-inst/wp-content/themes/classic/header.php
new file mode 100644
index 0000000..2c1d7c4
--- /dev/null
+++ b/wp-inst/wp-content/themes/classic/header.php
@@ -0,0 +1,30 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+<head profile="http://gmpg.org/xfn/11">
+ <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
+
+ <title><?php bloginfo('name'); ?><?php wp_title(); ?></title>
+
+ <meta name="generator" content="WordPress <?php bloginfo('version'); ?>" /> <!-- leave this for stats please -->
+
+ <style type="text/css" media="screen">
+ @import url( <?php bloginfo('stylesheet_url'); ?> );
+ </style>
+
+ <link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="<?php bloginfo('rss2_url'); ?>" />
+ <link rel="alternate" type="text/xml" title="RSS .92" href="<?php bloginfo('rss_url'); ?>" />
+ <link rel="alternate" type="application/atom+xml" title="Atom 0.3" href="<?php bloginfo('atom_url'); ?>" />
+
+ <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
+ <?php wp_get_archives('type=monthly&format=link'); ?>
+ <?php //comments_popup_script(); // off by default ?>
+ <?php wp_head(); ?>
+</head>
+
+<body>
+<div id="rap">
+<h1 id="header"><a href="<?php bloginfo('url'); ?>"><?php bloginfo('name'); ?></a></h1>
+
+<div id="content">
+<!-- end header --> \ No newline at end of file
diff --git a/wp-inst/wp-content/themes/classic/index.php b/wp-inst/wp-content/themes/classic/index.php
new file mode 100644
index 0000000..bbee16e
--- /dev/null
+++ b/wp-inst/wp-content/themes/classic/index.php
@@ -0,0 +1,32 @@
+<?php
+get_header();
+?>
+
+<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
+
+<?php the_date('','<h2>','</h2>'); ?>
+
+<div class="post" id="post-<?php the_ID(); ?>">
+ <h3 class="storytitle"><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h3>
+ <div class="meta"><?php _e("Filed under:"); ?> <?php the_category(',') ?> &#8212; <?php the_author() ?> @ <?php the_time() ?> <?php edit_post_link(__('Edit This')); ?></div>
+
+ <div class="storycontent">
+ <?php the_content(__('(more...)')); ?>
+ </div>
+
+ <div class="feedback">
+ <?php wp_link_pages(); ?>
+ <?php comments_popup_link(__('Comments (0)'), __('Comments (1)'), __('Comments (%)')); ?>
+ </div>
+
+</div>
+
+<?php comments_template(); // Get wp-comments.php template ?>
+
+<?php endwhile; else: ?>
+<p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
+<?php endif; ?>
+
+<?php posts_nav_link(' &#8212; ', __('&laquo; Previous Page'), __('Next Page &raquo;')); ?>
+
+<?php get_footer(); ?>
diff --git a/wp-inst/wp-content/themes/classic/sidebar.php b/wp-inst/wp-content/themes/classic/sidebar.php
new file mode 100644
index 0000000..46dee78
--- /dev/null
+++ b/wp-inst/wp-content/themes/classic/sidebar.php
@@ -0,0 +1,43 @@
+
+<!-- begin sidebar -->
+<div id="menu">
+
+<ul>
+ <?php wp_list_pages(); ?>
+ <?php get_links_list(); ?>
+ <li id="categories"><?php _e('Categories:'); ?>
+ <ul>
+ <?php wp_list_cats(); ?>
+ </ul>
+ </li>
+ <li id="search">
+ <label for="s"><?php _e('Search:'); ?></label>
+ <form id="searchform" method="get" action="<?php echo $_SERVER['PHP_SELF']; ?>">
+ <div>
+ <input type="text" name="s" id="s" size="15" /><br />
+ <input type="submit" value="<?php _e('Search'); ?>" />
+ </div>
+ </form>
+ </li>
+ <li id="archives"><?php _e('Archives:'); ?>
+ <ul>
+ <?php wp_get_archives('type=monthly'); ?>
+ </ul>
+ </li>
+ <li id="meta"><?php _e('Meta:'); ?>
+ <ul>
+ <?php wp_register(); ?>
+ <li><?php wp_loginout(); ?></li>
+ <li><a href="feed:<?php bloginfo('rss2_url'); ?>" title="<?php _e('Syndicate this site using RSS'); ?>"><?php _e('<abbr title="Really Simple Syndication">RSS</abbr>'); ?></a></li>
+ <li><a href="feed:<?php bloginfo('comments_rss2_url'); ?>" title="<?php _e('The latest comments to all posts in RSS'); ?>"><?php _e('Comments <abbr title="Really Simple Syndication">RSS</abbr>'); ?></a></li>
+ <li><a href="http://validator.w3.org/check/referer" title="<?php _e('This page validates as XHTML 1.0 Transitional'); ?>"><?php _e('Valid <abbr title="eXtensible HyperText Markup Language">XHTML</abbr>'); ?></a></li>
+ <li><a href="http://gmpg.org/xfn/"><abbr title="XHTML Friends Network">XFN</abbr></a></li>
+ <li><a href="http://wordpress.org/" title="<?php _e('Powered by WordPress, state-of-the-art semantic personal publishing platform.'); ?>"><abbr title="WordPress">WP</abbr></a></li>
+ <?php wp_meta(); ?>
+ </ul>
+ </li>
+
+</ul>
+
+</div>
+<!-- end sidebar -->
diff --git a/wp-inst/wp-content/themes/classic/style.css b/wp-inst/wp-content/themes/classic/style.css
new file mode 100644
index 0000000..e09122d
--- /dev/null
+++ b/wp-inst/wp-content/themes/classic/style.css
@@ -0,0 +1,313 @@
+/*
+Theme Name: WordPress Classic
+Theme URI: http://wordpress.org/
+Description: The original WordPress theme that graced versions 1.2.x and prior.
+Version: 1.5
+Author: Dave Shea
+
+Default WordPress by Dave Shea || http://mezzoblue.com
+Modifications by Matthew Mullenweg || http://photomatt.net
+This is just a basic layout, with only the bare minimum defined.
+Please tweak this and make it your own. :)
+*/
+
+a {
+ color: #675;
+}
+
+a img {
+ border: none;
+}
+
+a:visited {
+ color: #342;
+}
+
+a:hover {
+ color: #9a8;
+}
+
+acronym, abbr {
+ border-bottom: 1px dashed #333;
+}
+
+acronym, abbr, span.caps {
+ font-size: 90%;
+ letter-spacing: .07em;
+}
+
+acronym, abbr {
+ cursor: help;
+}
+
+blockquote {
+ border-left: 5px solid #ccc;
+ margin-left: 1.5em;
+ padding-left: 5px;
+}
+
+body {
+ background: #fff;
+ border: solid 2px #565;
+ border-bottom: solid 1px #565;
+ border-top: solid 3px #565;
+ color: #000;
+ font-family: 'Lucida Grande', 'Lucida Sans Unicode', Verdana, sans-serif;
+ margin: 0;
+ padding: 0;
+}
+
+cite {
+ font-size: 90%;
+ font-style: normal;
+}
+
+h2 {
+ border-bottom: 1px dotted #ccc;
+ font: 95% "Times New Roman", Times, serif;
+ letter-spacing: 0.2em;
+ margin: 15px 0 2px 0;
+ padding-bottom: 2px;
+}
+
+h3 {
+ border-bottom: dotted 1px #eee;
+ font-family: "Times New Roman", Times, serif;
+ margin-top: 0;
+}
+
+ol#comments li p {
+ font-size: 100%;
+}
+
+p, li, .feedback {
+ font: 90%/175% 'Lucida Grande', 'Lucida Sans Unicode', Verdana, sans-serif;
+ letter-spacing: -1px;
+}
+
+/* classes used by the_meta() */
+ul.post-meta {
+ list-style: none;
+}
+
+ul.post-meta span.post-meta-key {
+ font-weight: bold;
+}
+
+.credit {
+ background: #90a090;
+ border-top: double 3px #aba;
+ color: #fff;
+ font-size: 11px;
+ margin: 10px 0 0 0;
+ padding: 3px;
+ text-align: center;
+}
+
+.credit a:link, .credit a:hover {
+ color: #fff;
+}
+
+.feedback {
+ color: #ccc;
+ text-align: right;
+ clear: both;
+}
+
+.meta {
+ font-size: .75em;
+}
+
+.meta li, ul.post-meta li {
+ display: inline;
+}
+
+.meta ul {
+ display: inline;
+ list-style: none;
+ margin: 0;
+ padding: 0;
+}
+
+.meta, .meta a {
+ color: #808080;
+ font-weight: normal;
+ letter-spacing: 0;
+}
+
+.storytitle {
+ margin: 0;
+}
+
+.storytitle a {
+ text-decoration: none;
+}
+
+#commentform #author, #commentform #email, #commentform #url, #commentform textarea {
+ background: #fff;
+ border: 1px solid #333;
+ padding: .2em;
+}
+
+#commentform textarea {
+ width: 100%;
+}
+
+#commentlist li ul {
+ border-left: 1px solid #ddd;
+ font-size: 110%;
+ list-style-type: none;
+}
+
+#content {
+ margin: 30px 13em 0 3em;
+ padding-right: 60px;
+}
+
+#header {
+ background: #90a090;
+ border-bottom: double 3px #aba;
+ border-left: solid 1px #9a9;
+ border-right: solid 1px #565;
+ border-top: solid 1px #9a9;
+ font: italic normal 230% 'Times New Roman', Times, serif;
+ letter-spacing: 0.2em;
+ margin: 0;
+ padding: 15px 10px 15px 60px;
+}
+
+#header a {
+ color: #fff;
+ text-decoration: none;
+}
+
+#header a:hover {
+ text-decoration: underline;
+}
+
+#menu {
+ background: #fff;
+ border-left: 1px dotted #ccc;
+ border-top: solid 3px #e0e6e0;
+ padding: 20px 0 10px 30px;
+ position: absolute;
+ right: 2px;
+ top: 0;
+ width: 11em;
+}
+
+#menu form {
+ margin: 0 0 0 13px;
+}
+
+#menu input#s {
+ width: 80%;
+ background: #eee;
+ border: 1px solid #999;
+ color: #000;
+}
+
+#menu ul {
+ color: #ccc;
+ font-weight: bold;
+ list-style-type: none;
+ margin: 0;
+ padding-left: 3px;
+ text-transform: lowercase;
+}
+
+#menu ul li {
+ font: italic normal 110% 'Times New Roman', Times, serif;
+ letter-spacing: 0.1em;
+ margin-top: 10px;
+ padding-bottom: 2px; /*border-bottom: dotted 1px #ccc;*/
+}
+
+#menu ul ul {
+ font-variant: normal;
+ font-weight: normal;
+ line-height: 100%;
+ list-style-type: none;
+ margin: 0;
+ padding: 0;
+ text-align: left;
+}
+
+#menu ul ul li {
+ border: 0;
+ font: normal normal 12px/115% 'Lucida Grande', 'Lucida Sans Unicode', Verdana, sans-serif;
+ letter-spacing: 0;
+ margin-top: 0;
+ padding: 0;
+ padding-left: 12px;
+}
+
+#menu ul ul li a {
+ color: #000;
+ text-decoration: none;
+}
+
+#menu ul ul li a:hover {
+ border-bottom: 1px solid #809080;
+}
+
+#menu ul ul ul.children {
+ font-size: 142%;
+ padding-left: 4px;
+}
+
+#wp-calendar {
+ border: 1px solid #ddd;
+ empty-cells: show;
+ font-size: 14px;
+ margin: 0;
+ width: 90%;
+}
+
+#wp-calendar #next a {
+ padding-right: 10px;
+ text-align: right;
+}
+
+#wp-calendar #prev a {
+ padding-left: 10px;
+ text-align: left;
+}
+
+#wp-calendar a {
+ display: block;
+ text-decoration: none;
+}
+
+#wp-calendar a:hover {
+ background: #e0e6e0;
+ color: #333;
+}
+
+#wp-calendar caption {
+ color: #999;
+ font-size: 16px;
+ text-align: left;
+}
+
+#wp-calendar td {
+ color: #ccc;
+ font: normal 12px 'Lucida Grande', 'Lucida Sans Unicode', Verdana, sans-serif;
+ letter-spacing: normal;
+ padding: 2px 0;
+ text-align: center;
+}
+
+#wp-calendar td.pad:hover {
+ background: #fff;
+}
+
+#wp-calendar td:hover, #wp-calendar #today {
+ background: #eee;
+ color: #bbb;
+}
+
+#wp-calendar th {
+ font-style: normal;
+ text-transform: capitalize;
+}
diff --git a/wp-inst/wp-content/themes/default/404.php b/wp-inst/wp-content/themes/default/404.php
new file mode 100644
index 0000000..01a8e8a
--- /dev/null
+++ b/wp-inst/wp-content/themes/default/404.php
@@ -0,0 +1,11 @@
+<?php get_header(); ?>
+
+ <div id="content" class="narrowcolumn">
+
+ <h2 class="center">Error 404 - Not Found</h2>
+
+ </div>
+
+<?php get_sidebar(); ?>
+
+<?php get_footer(); ?> \ No newline at end of file
diff --git a/wp-inst/wp-content/themes/default/archive.php b/wp-inst/wp-content/themes/default/archive.php
new file mode 100644
index 0000000..f6281db
--- /dev/null
+++ b/wp-inst/wp-content/themes/default/archive.php
@@ -0,0 +1,68 @@
+<?php get_header(); ?>
+
+ <div id="content" class="narrowcolumn">
+
+ <?php if (have_posts()) : ?>
+
+ <?php $post = $posts[0]; // Hack. Set $post so that the_date() works. ?>
+<?php /* If this is a category archive */ if (is_category()) { ?>
+ <h2 class="pagetitle">Archive for the '<?php echo single_cat_title(); ?>' Category</h2>
+
+ <?php /* If this is a daily archive */ } elseif (is_day()) { ?>
+ <h2 class="pagetitle">Archive for <?php the_time('F jS, Y'); ?></h2>
+
+ <?php /* If this is a monthly archive */ } elseif (is_month()) { ?>
+ <h2 class="pagetitle">Archive for <?php the_time('F, Y'); ?></h2>
+
+ <?php /* If this is a yearly archive */ } elseif (is_year()) { ?>
+ <h2 class="pagetitle">Archive for <?php the_time('Y'); ?></h2>
+
+ <?php /* If this is a search */ } elseif (is_search()) { ?>
+ <h2 class="pagetitle">Search Results</h2>
+
+ <?php /* If this is an author archive */ } elseif (is_author()) { ?>
+ <h2 class="pagetitle">Author Archive</h2>
+
+ <?php /* If this is a paged archive */ } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?>
+ <h2 class="pagetitle">Blog Archives</h2>
+
+ <?php } ?>
+
+
+ <div class="navigation">
+ <div class="alignleft"><?php next_posts_link('&laquo; Previous Entries') ?></div>
+ <div class="alignright"><?php previous_posts_link('Next Entries &raquo;') ?></div>
+ </div>
+
+ <?php while (have_posts()) : the_post(); ?>
+ <div class="post">
+ <h3 id="post-<?php the_ID(); ?>"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h3>
+ <small><?php the_time('l, F jS, Y') ?></small>
+
+ <div class="entry">
+ <?php the_excerpt() ?>
+ </div>
+
+ <p class="postmetadata">Posted in <?php the_category(', ') ?> <strong>|</strong> <?php edit_post_link('Edit','','<strong>|</strong>'); ?> <?php comments_popup_link('No Comments &#187;', '1 Comment &#187;', '% Comments &#187;'); ?></p>
+
+ </div>
+
+ <?php endwhile; ?>
+
+ <div class="navigation">
+ <div class="alignleft"><?php next_posts_link('&laquo; Previous Entries') ?></div>
+ <div class="alignright"><?php previous_posts_link('Next Entries &raquo;') ?></div>
+ </div>
+
+ <?php else : ?>
+
+ <h2 class="center">Not Found</h2>
+ <?php include (TEMPLATEPATH . '/searchform.php'); ?>
+
+ <?php endif; ?>
+
+ </div>
+
+<?php get_sidebar(); ?>
+
+<?php get_footer(); ?> \ No newline at end of file
diff --git a/wp-inst/wp-content/themes/default/archives.php b/wp-inst/wp-content/themes/default/archives.php
new file mode 100644
index 0000000..ae9d8dd
--- /dev/null
+++ b/wp-inst/wp-content/themes/default/archives.php
@@ -0,0 +1,25 @@
+<?php
+/*
+Template Name: Archives
+*/
+?>
+
+<?php get_header(); ?>
+
+<div id="content" class="widecolumn">
+
+<?php include (TEMPLATEPATH . '/searchform.php'); ?>
+
+<h2>Archives by Month:</h2>
+ <ul>
+ <?php wp_get_archives('type=monthly'); ?>
+ </ul>
+
+<h2>Archives by Subject:</h2>
+ <ul>
+ <?php wp_list_cats(); ?>
+ </ul>
+
+</div>
+
+<?php get_footer(); ?>
diff --git a/wp-inst/wp-content/themes/default/comments-popup.php b/wp-inst/wp-content/themes/default/comments-popup.php
new file mode 100644
index 0000000..f01e3eb
--- /dev/null
+++ b/wp-inst/wp-content/themes/default/comments-popup.php
@@ -0,0 +1,113 @@
+<?php
+/* Don't remove these lines. */
+add_filter('comment_text', 'popuplinks');
+foreach ($posts as $post) { start_wp();
+?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+ <title><?php echo get_settings('blogname'); ?> - Comments on <?php the_title(); ?></title>
+
+ <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_settings('blog_charset'); ?>" />
+ <style type="text/css" media="screen">
+ @import url( <?php bloginfo('stylesheet_url'); ?> );
+ body { margin: 3px; }
+ </style>
+
+</head>
+<body id="commentspopup">
+
+<h1 id="header"><a href="" title="<?php echo get_settings('blogname'); ?>"><?php echo get_settings('blogname'); ?></a></h1>
+
+<h2 id="comments">Comments</h2>
+
+<p><a href="<?php echo get_settings('siteurl'); ?>/wp-commentsrss2.php?p=<?php echo $post->ID; ?>"><abbr title="Really Simple Syndication">RSS</abbr> feed for comments on this post.</a></p>
+
+<?php if ('open' == $post->ping_status) { ?>
+<p>The <acronym title="Uniform Resource Identifier">URI</acronym> to TrackBack this entry is: <em><?php trackback_url() ?></em></p>
+<?php } ?>
+
+<?php
+// this line is WordPress' motor, do not delete it.
+$comment_author = (isset($_COOKIE['comment_author_' . COOKIEHASH])) ? trim($_COOKIE['comment_author_'. COOKIEHASH]) : '';
+$comment_author_email = (isset($_COOKIE['comment_author_email_'. COOKIEHASH])) ? trim($_COOKIE['comment_author_email_'. COOKIEHASH]) : '';
+$comment_author_url = (isset($_COOKIE['comment_author_url_'. COOKIEHASH])) ? trim($_COOKIE['comment_author_url_'. COOKIEHASH]) : '';
+$comments = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_post_ID = $id AND comment_approved = '1' ORDER BY comment_date");
+$commentstatus = $wpdb->get_row("SELECT comment_status, post_password FROM $wpdb->posts WHERE ID = $id");
+if (!empty($commentstatus->post_password) && $_COOKIE['wp-postpass_'. COOKIEHASH] != $commentstatus->post_password) { // and it doesn't match the cookie
+ echo(get_the_password_form());
+} else { ?>
+
+<?php if ($comments) { ?>
+<ol id="commentlist">
+<?php foreach ($comments as $comment) { ?>
+ <li id="comment-<?php comment_ID() ?>">
+ <?php comment_text() ?>
+ <p><cite><?php comment_type('Comment', 'Trackback', 'Pingback'); ?> by <?php comment_author_link() ?> &#8212; <?php comment_date() ?> @ <a href="#comment-<?php comment_ID() ?>"><?php comment_time() ?></a></cite></p>
+ </li>
+
+<?php } // end for each comment ?>
+</ol>
+<?php } else { // this is displayed if there are no comments so far ?>
+ <p>No comments yet.</p>
+<?php } ?>
+
+<?php if ('open' == $commentstatus->comment_status) { ?>
+<h2>Leave a comment</h2>
+<p>Line and paragraph breaks automatic, e-mail address never displayed, <acronym title="Hypertext Markup Language">HTML</acronym> allowed: <code><?php echo allowed_tags(); ?></code></p>
+
+<form action="<?php echo get_settings('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">
+ <p>
+ <input type="text" name="author" id="author" class="textarea" value="<?php echo $comment_author; ?>" size="28" tabindex="1" />
+ <label for="author">Name</label>
+ <input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" />
+ <input type="hidden" name="redirect_to" value="<?php echo wp_specialchars($_SERVER["REQUEST_URI"]); ?>" />
+ </p>
+
+ <p>
+ <input type="text" name="email" id="email" value="<?php echo $comment_author_email; ?>" size="28" tabindex="2" />
+ <label for="email">E-mail</label>
+ </p>
+
+ <p>
+ <input type="text" name="url" id="url" value="<?php echo $comment_author_url; ?>" size="28" tabindex="3" />
+ <label for="url"><acronym title="Uniform Resource Identifier">URI</acronym></label>
+ </p>
+
+ <p>
+ <label for="comment">Your Comment</label>
+ <br />
+ <textarea name="comment" id="comment" cols="70" rows="4" tabindex="4"></textarea>
+ </p>
+
+ <p>
+ <input name="submit" type="submit" tabindex="5" value="Say It!" />
+ </p>
+ <?php do_action('comment_form', $post->ID); ?>
+</form>
+<?php } else { // comments are closed ?>
+<p>Sorry, the comment form is closed at this time.</p>
+<?php }
+} // end password check
+?>
+
+<div><strong><a href="javascript:window.close()">Close this window.</a></strong></div>
+
+<?php // if you delete this the sky will fall on your head
+}
+?>
+
+<!-- // this is just the end of the motor - don't touch that line either :) -->
+<?php //} ?>
+<p class="credit"><?php timer_stop(1); ?> <cite>Powered by <a href="http://wordpress.org" title="Powered by WordPress, state-of-the-art semantic personal publishing platform"><strong>Wordpress</strong></a></cite></p>
+<?php // Seen at http://www.mijnkopthee.nl/log2/archive/2003/05/28/esc(18) ?>
+<script type="text/javascript">
+<!--
+document.onkeypress = function esc(e) {
+ if(typeof(e) == "undefined") { e=event; }
+ if (e.keyCode == 27) { self.close(); }
+}
+// -->
+</script>
+</body>
+</html>
diff --git a/wp-inst/wp-content/themes/default/comments.php b/wp-inst/wp-content/themes/default/comments.php
new file mode 100644
index 0000000..dff40d8
--- /dev/null
+++ b/wp-inst/wp-content/themes/default/comments.php
@@ -0,0 +1,104 @@
+<?php // Do not delete these lines
+ if ('comments.php' == basename($_SERVER['SCRIPT_FILENAME']))
+ die ('Please do not load this page directly. Thanks!');
+
+ if (!empty($post->post_password)) { // if there's a password
+ if ($_COOKIE['wp-postpass_' . COOKIEHASH] != $post->post_password) { // and it doesn't match the cookie
+ ?>
+
+ <p class="nocomments">This post is password protected. Enter the password to view comments.<p>
+
+ <?php
+ return;
+ }
+ }
+
+ /* This variable is for alternating comment background */
+ $oddcomment = 'alt';
+?>
+
+<!-- You can start editing here. -->
+
+<?php if ($comments) : ?>
+ <h3 id="comments"><?php comments_number('No Responses', 'One Response', '% Responses' );?> to &#8220;<?php the_title(); ?>&#8221;</h3>
+
+ <ol class="commentlist">
+
+ <?php foreach ($comments as $comment) : ?>
+
+ <li class="<?php echo $oddcomment; ?>" id="comment-<?php comment_ID() ?>">
+ <cite><?php comment_author_link() ?></cite> Says:
+ <?php if ($comment->comment_approved == '0') : ?>
+ <em>Your comment is awaiting moderation.</em>
+ <?php endif; ?>
+ <br />
+
+ <small class="commentmetadata"><a href="#comment-<?php comment_ID() ?>" title=""><?php comment_date('F jS, Y') ?> at <?php comment_time() ?></a> <?php edit_comment_link('e','',''); ?></small>
+
+ <?php comment_text() ?>
+
+ </li>
+
+ <?php /* Changes every other comment to a different class */
+ if ('alt' == $oddcomment) $oddcomment = '';
+ else $oddcomment = 'alt';
+ ?>
+
+ <?php endforeach; /* end for each comment */ ?>
+
+ </ol>
+
+ <?php else : // this is displayed if there are no comments so far ?>
+
+ <?php if ('open' == $post->comment_status) : ?>
+ <!-- If comments are open, but there are no comments. -->
+
+ <?php else : // comments are closed ?>
+ <!-- If comments are closed. -->
+ <p class="nocomments">Comments are closed.</p>
+
+ <?php endif; ?>
+<?php endif; ?>
+
+
+<?php if ('open' == $post->comment_status) : ?>
+
+<h3 id="respond">Leave a Reply</h3>
+
+<?php if ( get_option('comment_registration') && !$user_ID ) : ?>
+<p>You must be <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?redirect_to=<?php the_permalink(); ?>">logged in</a> to post a comment.</p>
+<?php else : ?>
+
+<form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">
+
+<?php if ( $user_ID ) : ?>
+
+<p>Logged in as <a href="<?php echo get_option('siteurl'); ?>/wp-admin/profile.php"><?php echo $user_identity; ?></a>. <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?action=logout" title="Log out of this account">Logout &raquo;</a></p>
+
+<?php else : ?>
+
+<p><input type="text" name="author" id="author" value="<?php echo $comment_author; ?>" size="22" tabindex="1" />
+<label for="author"><small>Name <?php if ($req) echo "(required)"; ?></small></label></p>
+
+<p><input type="text" name="email" id="email" value="<?php echo $comment_author_email; ?>" size="22" tabindex="2" />
+<label for="email"><small>Mail (will not be published) <?php if ($req) echo "(required)"; ?></small></label></p>
+
+<p><input type="text" name="url" id="url" value="<?php echo $comment_author_url; ?>" size="22" tabindex="3" />
+<label for="url"><small>Website</small></label></p>
+
+<?php endif; ?>
+
+<!--<p><small><strong>XHTML:</strong> You can use these tags: <?php echo allowed_tags(); ?></small></p>-->
+
+<p><textarea name="comment" id="comment" cols="100%" rows="10" tabindex="4"></textarea></p>
+
+<p><input name="submit" type="submit" id="submit" tabindex="5" value="Submit Comment" />
+<input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" />
+</p>
+<?php do_action('comment_form', $post->ID); ?>
+
+</form>
+
+<?php endif; // If registration required and not logged in ?>
+
+<?php endif; // if you delete this the sky will fall on your head ?>
diff --git a/wp-inst/wp-content/themes/default/footer.php b/wp-inst/wp-content/themes/default/footer.php
new file mode 100644
index 0000000..9ee08e2
--- /dev/null
+++ b/wp-inst/wp-content/themes/default/footer.php
@@ -0,0 +1,20 @@
+
+<hr />
+<div id="footer">
+ <p>
+ <?php bloginfo('name'); ?> is proudly powered by
+ <a href="http://wordpress.org">WordPress</a>
+ <br /><a href="feed:<?php bloginfo('rss2_url'); ?>">Entries (RSS)</a>
+ and <a href="feed:<?php bloginfo('comments_rss2_url'); ?>">Comments (RSS)</a>.
+ <!-- <?php echo $wpdb->num_queries; ?> queries. <?php timer_stop(1); ?> seconds. -->
+ </p>
+</div>
+</div>
+
+<!-- Gorgeous design by Michael Heilemann - http://binarybonsai.com/kubrick/ -->
+<?php /* "Just what do you think you're doing Dave?" */ ?>
+
+ <?php wp_footer(); ?>
+
+</body>
+</html> \ No newline at end of file
diff --git a/wp-inst/wp-content/themes/default/header.php b/wp-inst/wp-content/themes/default/header.php
new file mode 100644
index 0000000..99ff334
--- /dev/null
+++ b/wp-inst/wp-content/themes/default/header.php
@@ -0,0 +1,61 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+<head profile="http://gmpg.org/xfn/11">
+<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
+
+<title><?php bloginfo('name'); ?> <?php if ( is_single() ) { ?> &raquo; Blog Archive <?php } ?> <?php wp_title(); ?></title>
+
+<meta name="generator" content="WordPress <?php bloginfo('version'); ?>" /> <!-- leave this for stats -->
+
+<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
+<link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="<?php bloginfo('rss2_url'); ?>" />
+<link rel="alternate" type="text/xml" title="RSS .92" href="<?php bloginfo('rss_url'); ?>" />
+<link rel="alternate" type="application/atom+xml" title="Atom 0.3" href="<?php bloginfo('atom_url'); ?>" />
+<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
+
+<style type="text/css" media="screen">
+/* To accomodate differing install paths of WordPress, images are referred only here,
+ and not in the wp-layout.css file. If you prefer to use only CSS for colors and what
+ not, then go right ahead and delete the following lines, and the image files. */
+
+ body { background: url("<?php bloginfo('stylesheet_directory'); ?>/images/kubrickbgcolor.jpg"); }
+<?php /* Checks to see whether it needs a sidebar or not */ if ((! $withcomments) && (! is_single())) { ?>
+ #page { background: url("<?php bloginfo('stylesheet_directory'); ?>/images/kubrickbg.jpg") repeat-y top; border: none; }
+<?php } else { // No sidebar ?>
+ #page { background: url("<?php bloginfo('stylesheet_directory'); ?>/images/kubrickbgwide.jpg") repeat-y top; border: none; }
+<?php } ?>
+ #header { background: url("<?php bloginfo('stylesheet_directory'); ?>/images/kubrickheader.jpg") no-repeat bottom center; }
+ #footer { background: url("<?php bloginfo('stylesheet_directory'); ?>/images/kubrickfooter.jpg") no-repeat bottom; border: none;}
+
+/* Because the template is slightly different, size-wise, with images, this needs to be set here
+ If you don't want to use the template's images, you can also delete the following two lines. */
+
+ #header { margin: 0 !important; margin: 0 0 0 1px; padding: 1px; height: 198px; width: 758px; }
+ #headerimg { margin: 7px 9px 0; height: 192px; width: 740px; }
+
+/* To ease the insertion of a personal header image, I have done it in such a way,
+ that you simply drop in an image called 'personalheader.jpg' into your /images/
+ directory. Dimensions should be at least 760px x 200px. Anything above that will
+ get cropped off of the image. */
+ /*
+ #headerimg { background: url('<?php bloginfo('stylesheet_directory'); ?>/images/personalheader.jpg') no-repeat top;}
+ */
+</style>
+
+<?php wp_get_archives('type=monthly&format=link'); ?>
+
+<?php wp_head(); ?>
+</head>
+<body>
+
+<div id="page">
+
+
+<div id="header">
+ <div id="headerimg">
+ <h1><a href="<?php echo get_settings('home'); ?>"><?php bloginfo('name'); ?></a></h1>
+ <div class="description"><?php bloginfo('description'); ?></div>
+ </div>
+</div>
+<hr />
diff --git a/wp-inst/wp-content/themes/default/images/kubrickbg.jpg b/wp-inst/wp-content/themes/default/images/kubrickbg.jpg
new file mode 100644
index 0000000..dc74fb8
--- /dev/null
+++ b/wp-inst/wp-content/themes/default/images/kubrickbg.jpg
Binary files differ
diff --git a/wp-inst/wp-content/themes/default/images/kubrickbgcolor.jpg b/wp-inst/wp-content/themes/default/images/kubrickbgcolor.jpg
new file mode 100644
index 0000000..4653b68
--- /dev/null
+++ b/wp-inst/wp-content/themes/default/images/kubrickbgcolor.jpg
Binary files differ
diff --git a/wp-inst/wp-content/themes/default/images/kubrickbgwide.jpg b/wp-inst/wp-content/themes/default/images/kubrickbgwide.jpg
new file mode 100644
index 0000000..77096f2
--- /dev/null
+++ b/wp-inst/wp-content/themes/default/images/kubrickbgwide.jpg
Binary files differ
diff --git a/wp-inst/wp-content/themes/default/images/kubrickfooter.jpg b/wp-inst/wp-content/themes/default/images/kubrickfooter.jpg
new file mode 100644
index 0000000..d7a4c65
--- /dev/null
+++ b/wp-inst/wp-content/themes/default/images/kubrickfooter.jpg
Binary files differ
diff --git a/wp-inst/wp-content/themes/default/images/kubrickheader.jpg b/wp-inst/wp-content/themes/default/images/kubrickheader.jpg
new file mode 100644
index 0000000..69441ee
--- /dev/null
+++ b/wp-inst/wp-content/themes/default/images/kubrickheader.jpg
Binary files differ
diff --git a/wp-inst/wp-content/themes/default/index.php b/wp-inst/wp-content/themes/default/index.php
new file mode 100644
index 0000000..0e76687
--- /dev/null
+++ b/wp-inst/wp-content/themes/default/index.php
@@ -0,0 +1,39 @@
+<?php get_header(); ?>
+
+ <div id="content" class="narrowcolumn">
+
+ <?php if (have_posts()) : ?>
+
+ <?php while (have_posts()) : the_post(); ?>
+
+ <div class="post" id="post-<?php the_ID(); ?>">
+ <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2>
+ <small><?php the_time('F jS, Y') ?> <!-- by <?php the_author() ?> --></small>
+
+ <div class="entry">
+ <?php the_content('Read the rest of this entry &raquo;'); ?>
+ </div>
+
+ <p class="postmetadata">Posted in <?php the_category(', ') ?> <strong>|</strong> <?php edit_post_link('Edit','','<strong>|</strong>'); ?> <?php comments_popup_link('No Comments &#187;', '1 Comment &#187;', '% Comments &#187;'); ?></p>
+ </div>
+
+ <?php endwhile; ?>
+
+ <div class="navigation">
+ <div class="alignleft"><?php next_posts_link('&laquo; Previous Entries') ?></div>
+ <div class="alignright"><?php previous_posts_link('Next Entries &raquo;') ?></div>
+ </div>
+
+ <?php else : ?>
+
+ <h2 class="center">Not Found</h2>
+ <p class="center">Sorry, but you are looking for something that isn't here.</p>
+ <?php include (TEMPLATEPATH . "/searchform.php"); ?>
+
+ <?php endif; ?>
+
+ </div>
+
+<?php get_sidebar(); ?>
+
+<?php get_footer(); ?>
diff --git a/wp-inst/wp-content/themes/default/links.php b/wp-inst/wp-content/themes/default/links.php
new file mode 100644
index 0000000..2970897
--- /dev/null
+++ b/wp-inst/wp-content/themes/default/links.php
@@ -0,0 +1,18 @@
+<?php
+/*
+Template Name: Links
+*/
+?>
+
+<?php get_header(); ?>
+
+<div id="content" class="widecolumn">
+
+<h2>Links:</h2>
+<ul>
+<?php get_links_list(); ?>
+</ul>
+
+</div>
+
+<?php get_footer(); ?>
diff --git a/wp-inst/wp-content/themes/default/page.php b/wp-inst/wp-content/themes/default/page.php
new file mode 100644
index 0000000..5f914c1
--- /dev/null
+++ b/wp-inst/wp-content/themes/default/page.php
@@ -0,0 +1,21 @@
+<?php get_header(); ?>
+
+ <div id="content" class="narrowcolumn">
+
+ <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
+ <div class="post" id="post-<?php the_ID(); ?>">
+ <h2><?php the_title(); ?></h2>
+ <div class="entrytext">
+ <?php the_content('<p class="serif">Read the rest of this page &raquo;</p>'); ?>
+
+ <?php link_pages('<p><strong>Pages:</strong> ', '</p>', 'number'); ?>
+
+ </div>
+ </div>
+ <?php endwhile; endif; ?>
+ <?php edit_post_link('Edit this entry.', '<p>', '</p>'); ?>
+ </div>
+
+<?php get_sidebar(); ?>
+
+<?php get_footer(); ?> \ No newline at end of file
diff --git a/wp-inst/wp-content/themes/default/search.php b/wp-inst/wp-content/themes/default/search.php
new file mode 100644
index 0000000..602a19d
--- /dev/null
+++ b/wp-inst/wp-content/themes/default/search.php
@@ -0,0 +1,46 @@
+<?php get_header(); ?>
+
+ <div id="content" class="narrowcolumn">
+
+ <?php if (have_posts()) : ?>
+
+ <h2 class="pagetitle">Search Results</h2>
+
+ <div class="navigation">
+ <div class="alignleft"><?php next_posts_link('&laquo; Previous Entries') ?></div>
+ <div class="alignright"><?php previous_posts_link('Next Entries &raquo;') ?></div>
+ </div>
+
+
+ <?php while (have_posts()) : the_post(); ?>
+
+ <div class="post">
+ <h3 id="post-<?php the_ID(); ?>"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h3>
+ <small><?php the_time('l, F jS, Y') ?></small>
+
+ <div class="entry">
+ <?php the_excerpt() ?>
+ </div>
+
+ <p class="postmetadata">Posted in <?php the_category(', ') ?> <strong>|</strong> <?php edit_post_link('Edit','','<strong>|</strong>'); ?> <?php comments_popup_link('No Comments &#187;', '1 Comment &#187;', '% Comments &#187;'); ?></p>
+ </div>
+
+ <?php endwhile; ?>
+
+ <div class="navigation">
+ <div class="alignleft"><?php next_posts_link('&laquo; Previous Entries') ?></div>
+ <div class="alignright"><?php previous_posts_link('Next Entries &raquo;') ?></div>
+ </div>
+
+ <?php else : ?>
+
+ <h2 class="center">Not Found</h2>
+ <?php include (TEMPLATEPATH . '/searchform.php'); ?>
+
+ <?php endif; ?>
+
+ </div>
+
+<?php get_sidebar(); ?>
+
+<?php get_footer(); ?> \ No newline at end of file
diff --git a/wp-inst/wp-content/themes/default/searchform.php b/wp-inst/wp-content/themes/default/searchform.php
new file mode 100644
index 0000000..340a34b
--- /dev/null
+++ b/wp-inst/wp-content/themes/default/searchform.php
@@ -0,0 +1,5 @@
+<form method="get" id="searchform" action="<?php echo $_SERVER['PHP_SELF']; ?>">
+<div><input type="text" value="<?php echo wp_specialchars($s, 1); ?>" name="s" id="s" />
+<input type="submit" id="searchsubmit" value="Search" />
+</div>
+</form> \ No newline at end of file
diff --git a/wp-inst/wp-content/themes/default/sidebar.php b/wp-inst/wp-content/themes/default/sidebar.php
new file mode 100644
index 0000000..e74ecf7
--- /dev/null
+++ b/wp-inst/wp-content/themes/default/sidebar.php
@@ -0,0 +1,72 @@
+ <div id="sidebar">
+ <ul>
+
+ <li>
+ <?php include (TEMPLATEPATH . '/searchform.php'); ?>
+ </li>
+
+ <!-- Author information is disabled per default. Uncomment and fill in your details if you want to use it.
+ <li><h2>Author</h2>
+ <p>A little something about you, the author. Nothing lengthy, just an overview.</p>
+ </li>
+ -->
+
+ <li>
+ <?php /* If this is a 404 page */ if (is_404()) { ?>
+ <?php /* If this is a category archive */ } elseif (is_category()) { ?>
+ <p>You are currently browsing the archives for the <?php single_cat_title(''); ?> category.</p>
+
+ <?php /* If this is a yearly archive */ } elseif (is_day()) { ?>
+ <p>You are currently browsing the <a href="<?php echo get_settings('siteurl'); ?>"><?php echo bloginfo('name'); ?></a> weblog archives
+ for the day <?php the_time('l, F jS, Y'); ?>.</p>
+
+ <?php /* If this is a monthly archive */ } elseif (is_month()) { ?>
+ <p>You are currently browsing the <a href="<?php echo get_settings('siteurl'); ?>"><?php echo bloginfo('name'); ?></a> weblog archives
+ for <?php the_time('F, Y'); ?>.</p>
+
+ <?php /* If this is a yearly archive */ } elseif (is_year()) { ?>
+ <p>You are currently browsing the <a href="<?php echo get_settings('siteurl'); ?>"><?php echo bloginfo('name'); ?></a> weblog archives
+ for the year <?php the_time('Y'); ?>.</p>
+
+ <?php /* If this is a monthly archive */ } elseif (is_search()) { ?>
+ <p>You have searched the <a href="<?php echo get_settings('siteurl'); ?>"><?php echo bloginfo('name'); ?></a> weblog archives
+ for <strong>'<?php echo wp_specialchars($s); ?>'</strong>. If you are unable to find anything in these search results, you can try one of these links.</p>
+
+ <?php /* If this is a monthly archive */ } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?>
+ <p>You are currently browsing the <a href="<?php echo get_settings('siteurl'); ?>"><?php echo bloginfo('name'); ?></a> weblog archives.</p>
+
+ <?php } ?>
+ </li>
+
+ <?php wp_list_pages('title_li=<h2>Pages</h2>' ); ?>
+
+ <li><h2>Archives</h2>
+ <ul>
+ <?php wp_get_archives('type=monthly'); ?>
+ </ul>
+ </li>
+
+ <li><h2>Categories</h2>
+ <ul>
+ <?php wp_list_cats('sort_column=name&optioncount=1&hierarchical=0'); ?>
+ </ul>
+ </li>
+
+ <?php /* If this is the frontpage */ if ( is_home() || is_page() ) { ?>
+ <?php get_links_list(); ?>
+
+ <li><h2>Meta</h2>
+ <ul>
+ <?php wp_register(); ?>
+ <li><?php wp_loginout(); ?></li>
+ <li><a href="http://validator.w3.org/check/referer" title="This page validates as XHTML 1.0 Transitional">Valid <abbr title="eXtensible HyperText Markup Language">XHTML</abbr></a></li>
+ <li><a href="http://gmpg.org/xfn/"><abbr title="XHTML Friends Network">XFN</abbr></a></li>
+ <li><a href="http://wordpress.org/" title="Powered by WordPress, state-of-the-art semantic personal publishing platform.">WordPress</a></li>
+ <?php wp_meta(); ?>
+ </ul>
+ </li>
+ <?php } ?>
+
+ </ul>
+ </div>
+
diff --git a/wp-inst/wp-content/themes/default/single.php b/wp-inst/wp-content/themes/default/single.php
new file mode 100644
index 0000000..1130d2f
--- /dev/null
+++ b/wp-inst/wp-content/themes/default/single.php
@@ -0,0 +1,65 @@
+<?php get_header(); ?>
+
+ <div id="content" class="widecolumn">
+
+ <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
+
+ <div class="navigation">
+ <div class="alignleft"><?php previous_post_link('&laquo; %link') ?></div>
+ <div class="alignright"><?php next_post_link('%link &raquo;') ?></div>
+ </div>
+
+ <div class="post" id="post-<?php the_ID(); ?>">
+ <h2><a href="<?php echo get_permalink() ?>" rel="bookmark" title="Permanent Link: <?php the_title(); ?>"><?php the_title(); ?></a></h2>
+
+ <div class="entrytext">
+ <?php the_content('<p class="serif">Read the rest of this entry &raquo;</p>'); ?>
+
+ <?php link_pages('<p><strong>Pages:</strong> ', '</p>', 'number'); ?>
+
+ <p class="postmetadata alt">
+ <small>
+ This entry was posted
+ <?php /* This is commented, because it requires a little adjusting sometimes.
+ You'll need to download this plugin, and follow the instructions:
+ http://binarybonsai.com/archives/2004/08/17/time-since-plugin/ */
+ /* $entry_datetime = abs(strtotime($post->post_date) - (60*120)); echo time_since($entry_datetime); echo ' ago'; */ ?>
+ on <?php the_time('l, F jS, Y') ?> at <?php the_time() ?>
+ and is filed under <?php the_category(', ') ?>.
+ You can follow any responses to this entry through the <?php comments_rss_link('RSS 2.0'); ?> feed.
+
+ <?php if (('open' == $post-> comment_status) && ('open' == $post->ping_status)) {
+ // Both Comments and Pings are open ?>
+ You can <a href="#respond">leave a response</a>, or <a href="<?php trackback_url(true); ?>" rel="trackback">trackback</a> from your own site.
+
+ <?php } elseif (!('open' == $post-> comment_status) && ('open' == $post->ping_status)) {
+ // Only Pings are Open ?>
+ Responses are currently closed, but you can <a href="<?php trackback_url(true); ?> " rel="trackback">trackback</a> from your own site.
+
+ <?php } elseif (('open' == $post-> comment_status) && !('open' == $post->ping_status)) {
+ // Comments are open, Pings are not ?>
+ You can skip to the end and leave a response. Pinging is currently not allowed.
+
+ <?php } elseif (!('open' == $post-> comment_status) && !('open' == $post->ping_status)) {
+ // Neither Comments, nor Pings are open ?>
+ Both comments and pings are currently closed.
+
+ <?php } edit_post_link('Edit this entry.','',''); ?>
+
+ </small>
+ </p>
+
+ </div>
+ </div>
+
+ <?php comments_template(); ?>
+
+ <?php endwhile; else: ?>
+
+ <p>Sorry, no posts matched your criteria.</p>
+
+<?php endif; ?>
+
+ </div>
+
+<?php get_footer(); ?>
diff --git a/wp-inst/wp-content/themes/default/style.css b/wp-inst/wp-content/themes/default/style.css
new file mode 100644
index 0000000..820c993
--- /dev/null
+++ b/wp-inst/wp-content/themes/default/style.css
@@ -0,0 +1,610 @@
+/*
+Theme Name: WordPress Default
+Theme URI: http://wordpress.org/
+Description: The default WordPress theme based on the famous <a href="http://binarybonsai.com/kubrick/">Kubrick</a>.
+Version: 1.5
+Author: Michael Heilemann
+Author URI: http://binarybonsai.com/
+
+ Kubrick v1.5
+ http://binarybonsai.com/kubrick/
+
+ This theme was designed and built by Michael Heilemann,
+ whose blog you will find at http://binarybonsai.com/
+
+ The CSS, XHTML and design is released under GPL:
+ http://www.opensource.org/licenses/gpl-license.php
+
+
+ *** REGARDING IMAGES ***
+ All CSS that involves the use of images, can be found in the 'index.php' file.
+ This is to ease installation inside subdirectories of a server.
+
+ Have fun, and don't be afraid to contact me if you have questions.
+*/
+
+
+
+/* Begin Typography & Colors */
+body {
+ font-size: 62.5%; /* Resets 1em to 10px */
+ font-family: 'Lucida Grande', Verdana, Arial, Sans-Serif;
+ background-color: #d5d6d7;
+ color: #333;
+ text-align: center;
+ }
+
+#page {
+ background-color: white;
+ border: 1px solid #959596;
+ text-align: left;
+ }
+
+#header {
+ background-color: #73a0c5;
+ }
+
+#content {
+ font-size: 1.2em
+ }
+
+.widecolumn .entry p {
+ font-size: 1.05em;
+ }
+
+.narrowcolumn .entry, .widecolumn .entry {
+ line-height: 1.4em;
+ }
+
+.widecolumn {
+ line-height: 1.6em;
+ }
+
+.narrowcolumn .postmetadata {
+ text-align: center;
+ }
+
+.alt {
+ background-color: #f8f8f8;
+ border-top: 1px solid #ddd;
+ border-bottom: 1px solid #ddd;
+ }
+
+#footer {
+ background-color: #eee;
+ }
+
+small {
+ font-family: Arial, Helvetica, Sans-Serif;
+ font-size: 0.9em;
+ line-height: 1.5em;
+ }
+
+h1, h2, h3 {
+ font-family: 'Trebuchet MS', 'Lucida Grande', Verdana, Arial, Sans-Serif;
+ font-weight: bold;
+ }
+
+h1 {
+ font-size: 4em;
+ text-align: center;
+ }
+
+.description {
+ font-size: 1.2em;
+ text-align: center;
+ }
+
+h2 {
+ font-size: 1.6em;
+ }
+
+h2.pagetitle {
+ font-size: 1.6em;
+ }
+
+#sidebar h2 {
+ font-family: 'Lucida Grande', Verdana, Sans-Serif;
+ font-size: 1.2em;
+ }
+
+h3 {
+ font-size: 1.3em;
+ }
+
+h1, h1 a, h1 a:hover, h1 a:visited, .description {
+ text-decoration: none;
+ color: white;
+ }
+
+h2, h2 a, h2 a:visited, h3, h3 a, h3 a:visited {
+ color: #333;
+ }
+
+h2, h2 a, h2 a:hover, h2 a:visited, h3, h3 a, h3 a:hover, h3 a:visited, #sidebar h2, #wp-calendar caption, cite {
+ text-decoration: none;
+ }
+
+.entry p a:visited {
+ color: #b85b5a;
+ }
+
+.commentlist li, #commentform input, #commentform textarea {
+ font: 0.9em 'Lucida Grande', Verdana, Arial, Sans-Serif;
+ }
+
+.commentlist li {
+ font-weight: bold;
+ }
+
+.commentlist cite, .commentlist cite a {
+ font-weight: bold;
+ font-style: normal;
+ font-size: 1.1em;
+ }
+
+.commentlist p {
+ font-weight: normal;
+ line-height: 1.5em;
+ text-transform: none;
+ }
+
+#commentform p {
+ font-family: 'Lucida Grande', Verdana, Arial, Sans-Serif;
+ }
+
+.commentmetadata {
+ font-weight: normal;
+ }
+
+#sidebar {
+ font: 1em 'Lucida Grande', Verdana, Arial, Sans-Serif;
+ }
+
+small, #sidebar ul ul li, #sidebar ul ol li, .nocomments, .postmetadata, blockquote, strike {
+ color: #777;
+ }
+
+code {
+ font: 1.1em 'Courier New', Courier, Fixed;
+ }
+
+acronym, abbr, span.caps
+{
+ font-size: 0.9em;
+ letter-spacing: .07em;
+ }
+
+a, h2 a:hover, h3 a:hover {
+ color: #06c;
+ text-decoration: none;
+ }
+
+a:hover {
+ color: #147;
+ text-decoration: underline;
+ }
+
+#wp-calendar #prev a {
+ font-size: 9pt;
+ }
+
+#wp-calendar a {
+ text-decoration: none;
+ }
+
+#wp-calendar caption {
+ font: bold 1.3em 'Lucida Grande', Verdana, Arial, Sans-Serif;
+ text-align: center;
+ }
+
+#wp-calendar th {
+ font-style: normal;
+ text-transform: capitalize;
+ }
+/* End Typography & Colors */
+
+
+
+/* Begin Structure */
+body {
+ margin: 0;
+ padding: 0;
+ }
+
+#page {
+ background-color: white;
+ margin: 20px auto;
+ padding: 0;
+ width: 760px;
+ border: 1px solid #959596;
+ }
+
+#header {
+ padding: 0;
+ margin: 0 auto;
+ height: 200px;
+ width: 100%;
+ background-color: #73a0c5;
+ }
+
+#headerimg {
+ margin: 0;
+ height: 200px;
+ width: 100%;
+ }
+
+.narrowcolumn {
+ float: left;
+ padding: 0 0 20px 45px;
+ margin: 0px 0 0;
+ width: 450px;
+ }
+
+.widecolumn {
+ padding: 10px 0 20px 0;
+ margin: 5px 0 0 150px;
+ width: 450px;
+ }
+
+.post {
+ margin: 0 0 40px;
+ text-align: justify;
+ }
+
+.widecolumn .post {
+ margin: 0;
+ }
+
+.narrowcolumn .postmetadata {
+ padding-top: 5px;
+ }
+
+.widecolumn .postmetadata {
+ margin: 30px 0;
+ }
+
+#footer {
+ padding: 0 0 0 1px;
+ margin: 0 auto;
+ width: 760px;
+ clear: both;
+ }
+
+#footer p {
+ margin: 0;
+ padding: 20px 0;
+ text-align: center;
+ }
+/* End Structure */
+
+
+
+/* Begin Headers */
+h1 {
+ padding-top: 70px;
+ margin: 0;
+ }
+
+.description {
+ text-align: center;
+ }
+
+h2 {
+ margin: 30px 0 0;
+ }
+
+h2.pagetitle {
+ margin-top: 30px;
+ text-align: center;
+}
+
+#sidebar h2 {
+ margin: 5px 0 0;
+ padding: 0;
+ }
+
+h3 {
+ padding: 0;
+ margin: 30px 0 0;
+ }
+
+h3.comments {
+ padding: 0;
+ margin: 40px auto 20px ;
+ }
+/* End Headers */
+
+
+
+/* Begin Images */
+p img {
+ padding: 0;
+ max-width: 100%;
+ }
+
+/* Using 'class="alignright"' on an image will (who would've
+ thought?!) align the image to the right. And using 'class="centered',
+ will of course center the image. This is much better than using
+ align="center", being much more futureproof (and valid) */
+
+img.centered {
+ display: block;
+ margin-left: auto;
+ margin-right: auto;
+ }
+
+img.alignright {
+ padding: 4px;
+ margin: 0 0 2px 7px;
+ display: inline;
+ }
+
+img.alignleft {
+ padding: 4px;
+ margin: 0 7px 2px 0;
+ display: inline;
+ }
+
+.alignright {
+ float: right;
+ }
+
+.alignleft {
+ float: left
+ }
+/* End Images */
+
+
+
+/* Begin Lists
+
+ Special stylized non-IE bullets
+ Do not work in Internet Explorer, which merely default to normal bullets. */
+
+html>body .entry ul {
+ margin-left: 0px;
+ padding: 0 0 0 30px;
+ list-style: none;
+ padding-left: 10px;
+ text-indent: -10px;
+ }
+
+html>body .entry li {
+ margin: 7px 0 8px 10px;
+ }
+
+.entry ul li:before, #sidebar ul ul li:before {
+ content: "\00BB \0020";
+ }
+
+.entry ol {
+ padding: 0 0 0 35px;
+ margin: 0;
+ }
+
+.entry ol li {
+ margin: 0;
+ padding: 0;
+ }
+
+.postmetadata ul, .postmetadata li {
+ display: inline;
+ list-style-type: none;
+ list-style-image: none;
+ }
+
+#sidebar ul, #sidebar ul ol {
+ margin: 0;
+ padding: 0;
+ }
+
+#sidebar ul li {
+ list-style-type: none;
+ list-style-image: none;
+ margin-bottom: 15px;
+ }
+
+#sidebar ul p, #sidebar ul select {
+ margin: 5px 0 8px;
+ }
+
+#sidebar ul ul, #sidebar ul ol {
+ margin: 5px 0 0 10px;
+ }
+
+#sidebar ul ul ul, #sidebar ul ol {
+ margin: 0 0 0 10px;
+ }
+
+ol li, #sidebar ul ol li {
+ list-style: decimal outside;
+ }
+
+#sidebar ul ul li, #sidebar ul ol li {
+ margin: 3px 0 0;
+ padding: 0;
+ }
+/* End Entry Lists */
+
+
+
+/* Begin Form Elements */
+#searchform {
+ margin: 10px auto;
+ padding: 5px 3px;
+ text-align: center;
+ }
+
+#sidebar #searchform #s {
+ width: 115px;
+ padding: 2px;
+ }
+
+#sidebar #searchsubmit {
+ padding: 1px;
+ }
+
+.entry form { /* This is mainly for password protected posts, makes them look better. */
+ text-align:center;
+ }
+
+select {
+ width: 130px;
+ }
+
+#commentform input {
+ width: 170px;
+ padding: 2px;
+ margin: 5px 5px 1px 0;
+ }
+
+#commentform textarea {
+ width: 100%;
+ padding: 2px;
+ }
+
+#commentform #submit {
+ margin: 0;
+ float: right;
+ }
+/* End Form Elements */
+
+
+
+/* Begin Comments*/
+.alt {
+ margin: 0;
+ padding: 10px;
+ }
+
+.commentlist {
+ padding: 0;
+ text-align: justify;
+ }
+
+.commentlist li {
+ margin: 15px 0 3px;
+ padding: 5px 10px 3px;
+ list-style: none;
+ }
+
+.commentlist p {
+ margin: 10px 5px 10px 0;
+ }
+
+#commentform p {
+ margin: 5px 0;
+ }
+
+.nocomments {
+ text-align: center;
+ margin: 0;
+ padding: 0;
+ }
+
+.commentmetadata {
+ margin: 0;
+ display: block;
+ }
+/* End Comments */
+
+
+
+/* Begin Sidebar */
+#sidebar
+{
+ padding: 20px 0 10px 0;
+ margin-left: 545px;
+ width: 190px;
+ }
+
+#sidebar form {
+ margin: 0;
+ }
+/* End Sidebar */
+
+
+
+/* Begin Calendar */
+#wp-calendar {
+ empty-cells: show;
+ margin: 10px auto 0;
+ width: 155px;
+ }
+
+#wp-calendar #next a {
+ padding-right: 10px;
+ text-align: right;
+ }
+
+#wp-calendar #prev a {
+ padding-left: 10px;
+ text-align: left;
+ }
+
+#wp-calendar a {
+ display: block;
+ }
+
+#wp-calendar caption {
+ text-align: center;
+ width: 100%;
+ }
+
+#wp-calendar td {
+ padding: 3px 0;
+ text-align: center;
+ }
+
+#wp-calendar td.pad:hover { /* Doesn't work in IE */
+ background-color: #fff; }
+/* End Calendar */
+
+
+
+/* Begin Various Tags & Classes */
+acronym, abbr, span.caps {
+ cursor: help;
+ }
+
+acronym, abbr {
+ border-bottom: 1px dashed #999;
+ }
+
+blockquote {
+ margin: 15px 30px 0 10px;
+ padding-left: 20px;
+ border-left: 5px solid #ddd;
+ }
+
+blockquote cite {
+ margin: 5px 0 0;
+ display: block;
+ }
+
+.center {
+ text-align: center;
+ }
+
+hr {
+ display: none;
+ }
+
+a img {
+ border: none;
+ }
+
+.navigation {
+ display: block;
+ text-align: center;
+ margin-top: 10px;
+ margin-bottom: 60px;
+ }
+/* End Various Tags & Classes*/
+
+
+
+/* "Daisy, Daisy, give me your answer do. I'm half crazy all for the love of you.
+ It won't be a stylish marriage, I can't afford a carriage.
+ But you'll look sweet upon the seat of a bicycle built for two." */