echo "\n\t\t\t\t<div id=\"pixie_content\">\n\t\t\t\t\t<ul id=\"log_tools\">\n\t\t\t\t\t\t<li id=\"log_switch_referral\"><a href=\"?s=myaccount&do=referral\" title=\"" . $lang['switch_to'] . " " . $lang['latest_referrals'] . "\">" . $lang['switch_to'] . " " . $lang['latest_referrals'] . "</a></li>\n\t\t\t\t\t\t<li id=\"log_rss\"><a href=\"?s=myaccount&do=rss&user="******"\" title=\"" . $lang['feed_subscribe'] . "\">" . $lang['feed_subscribe'] . "</a></li>\n\t\t\t\t\t</ul>\n\t\t\t\t\t<h2>" . $lang['latest_activity'] . "</h2>\n\t\t\t\t\t<div id=\"logs_table\">\n\t\t\t\t\t\t<table class=\"tbl\" summary=\"" . $lang['latest_activity'] . " @ " . str_replace('http://', "", $site_url) . "\">\n\t\t\t\t\t\t<thead>\n\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<th class=\"tbl_heading\" id=\"icon\"></th>\n\t\t\t\t\t\t\t\t<th class=\"tbl_heading\" id=\"when\">" . $lang['when'] . "</th>\n\t\t\t\t\t\t\t\t<th class=\"tbl_heading\" id=\"who\">" . $lang['who'] . "</th>\n\t\t\t\t\t\t\t\t<th class=\"tbl_heading\" id=\"what\">" . $lang['what'] . "</th>\n\t\t\t\t\t\t\t</tr>\n\n\t\t\t\t\t\t</thead>\n\t\t\t\t\t\t<tbody>\n\t\t\t\t\t"; } safe_delete('pixie_log', "`log_time` < date_sub(utc_timestamp(),interval {$GLOBALS['logs_expire']} day)"); safe_optimize('pixie_log'); safe_repair('pixie_log'); if (isset($do) && $do == 'referral') { $rs = safe_rows_start('*, unix_timestamp(log_time) as stamp', 'pixie_log', "log_type = 'referral' order by log_time desc limit 30"); } else { $rs = safe_rows_start('*, unix_timestamp(log_time) as stamp', 'pixie_log', "log_type = 'system' order by log_time desc limit 30"); } if ($rs) { $counter = 0; while ($a = nextRow($rs)) { $counter++; extract($a); $logunix = returnUnixtimestamp($log_time); $time = safe_strftime($date_format, $logunix); if ($log_important == 'yes') { $trclass = 'logimportant'; } else { $trclass = 'normal'; } if (is_even($counter)) { $trclass .= ' even'; } else { $trclass .= ' odd'; } if ($counter >= 20) { $trclass .= ' fade' . (30 - $counter); } if (isset($do) && $do == 'referral') {
$current = $tags_array[$final]; $link = str_replace(" ", "-", $current); $url1 = createURL($pagename, 'tag', $link); //print $final." ".$current."\n"; $cats[] = array('loc' => $url1, 'changefreq' => 'monthly', 'lastmod' => $recent); } } // also need a dynamic prority calculator 0 -> 1 } else { if ($type == 'module') { $change = 'monthly'; } else { $change = 'monthly'; } } $logunix = returnUnixtimestamp($lastmodified); $lm = safe_strftime('%Y-%m-%d', $logunix); $cats[] = array('loc' => $url, 'changefreq' => $change, 'lastmod' => $lm); $i++; } $site_map_container = new google_sitemap(); for ($i = 0; $i < count($cats); $i++) { $value = $cats[$i]; $site_map_item = new google_sitemap_item($value['loc'], $value['lastmod'], $value['changefreq'], '0.7'); $site_map_container->add_item($site_map_item); } /* http://php.net/manual/en/function.header.php header() must be called before any actual output is sent, either by normal HTML tags, blank lines in a file, or from PHP. There must be no spaces or empty lines that are output before header() is called. What's happening here then? */ /* I think we should use goto for this */ header("Content-type: application/xml; charset=\"" . $site_map_container->charset . "\"", TRUE);
function show_archives() { global $s, $m, $x, $mtitle, $site_url, $page_display_name, $lang, $timezone; $date_array = getdate(); $this_month = $date_array['mon']; $this_year = $date_array['year']; if (isset($s)) { $id = get_page_id($s); $rs = safe_row('*', 'pixie_dynamic_posts', "page_id = '{$id}' and public = 'yes' order by posted asc limit 0,1"); } echo "<div id=\"archives\">\n\t\t\t\t\t\t<h3>{$mtitle}</h3>\n\t\t\t\t\t\t<dl class=\"list_archives\">\n"; if ($rs) { extract($rs); $last_year = returnUnixtimestamp($posted); $last_year = date('Y', $last_year); $num = ($this_year - $last_year) * 12 + 12; $i = 0; while ($i < $num) { $smonth = mktime(0, 0, 0, $this_month, 1, $this_year); $start_month = safe_strftime('%Y-%m-%d', $smonth); $last_day = date('t', $smonth); $emonth = mktime(23, 59, 59, $this_month, $last_day, $this_year); $end_month = safe_strftime('%Y-%m-%d %H:%M:%S', $emonth); $search = safe_rows('*', 'pixie_dynamic_posts', "page_id = '{$id}' and public = 'yes' and posted between '" . $start_month . "' and date '" . $end_month . "' order by posted desc"); if ($search) { echo "\t\t\t\t\t\t\t<dt>" . date('F', $smonth) . " " . $this_year . "</dt>\n"; $numy = count($search); $j = 0; while ($j < $numy) { $out = $search[$j]; $title = $out['title']; $posty = $out['posted']; $slug = $out['post_slug']; $stamp = returnUnixtimestamp($posty); $day = date('d', $stamp); echo "\t\t\t\t\t\t\t<dd><span class=\"archive_subdate\">" . $day . ":</span> <a href=\""; if (isset($s)) { echo createURL($s, 'permalink', $slug); } echo "\" title=\"" . $lang['permalink_to'] . ": {$title}\">" . $title . "</a></dd>\n"; $j++; } $this_month = $this_month - 1; if ($this_month == 0) { $this_month = 12; $this_year = $this_year - 1; } } else { $this_month = $this_month - 1; if ($this_month == 0) { $this_month = 12; $this_year = $this_year - 1; } } $i++; } } echo "\t\t\t\t\t\t</dl>\n\t\t\t\t\t</div>"; }
echo $new_style; } echo "\">\r\n\t\t\t\t\t\t\t\t<div class=\"form_label\"><label for=\"new_password\">" . $lang['form_new_password'] . " <span class=\"form_required\">" . $lang['form_required'] . "</span></label></div>\r\n\t\t\t\t\t\t\t\t<div class=\"form_item\"><input type=\"password\" class=\"form_text\" name=\"new_password\" value=\"\" size=\"40\" maxlength=\"80\" id=\"new_password\" /></div>\r\n\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t<div class=\"form_row "; if (isset($confirm_style)) { echo $confirm_style; } echo "\">\r\n\t\t\t\t\t\t\t\t<div class=\"form_label\"><label for=\"confirm_password\">" . $lang['form_confirm_password'] . " <span class=\"form_required\">" . $lang['form_required'] . "</span></label></div>\r\n\t\t\t\t\t\t\t\t<div class=\"form_item\"><input type=\"password\" class=\"form_text\" name=\"confirm_password\" value=\"\" size=\"40\" maxlength=\"80\" id=\"confirm_password\" /></div>\r\n\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t<div class=\"form_row_button\" id=\"form_button\">\r\n\t\t\t\t\t\t\t\t<input type=\"submit\" name=\"profile_pass\" class=\"form_submit\" value=\"" . $lang['form_button_update'] . "\" />\r\n\t\t\t\t\t\t\t\t<input type=\"hidden\" name=\"user_name\" value=\"" . $GLOBALS['pixie_user'] . "\" maxlength=\"64\" />\r\n\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t<div class=\"safclear\"></div>\r\n\t\t\t\t\t\t</fieldset>\r\n \t\t\t\t\t</form>\r\n \t\t\t\t</div>"; break; default: $uname = $GLOBALS['pixie_user']; if (isset($uname)) { $rs = safe_row('*', 'pixie_users', "user_name = '{$uname}' limit 0,1"); } if ($rs && !isset($error)) { extract($rs); $logunix = returnUnixtimestamp($last_access); $date = date('l dS M y @ H:i', $logunix); } if (in_array('realname', $scream)) { $realname_style = 'form_highlight'; } if (in_array('email', $scream)) { $email_style = 'form_highlight'; } if (in_array('website', $scream)) { $website_style = 'form_highlight'; } if (in_array('link_1', $scream)) { $link_1_style = 'form_highlight'; } if (in_array('link_2', $scream)) {
function date_dropdown($date) { $months = array('', 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'); /* Could go in language file? - needs language */ if (!isset($date) && !$date) { $unixtime = time() + tz_offset(); $this_day = date('d', $unixtime); $this_month = date('n', $unixtime); $this_year = date('Y', $unixtime); $time = date('H' . ':' . 'i', $unixtime); } else { $unixtime = returnUnixtimestamp($date); $this_day = date('d', $unixtime); $this_month = date('n', $unixtime); $this_year = date('Y', $unixtime); $time = date('H' . ':' . 'i', $unixtime); } $max_day = 31; $min_day = 1; echo "\t\t\t\t\t\t\t\t<select class=\"form_select\" id=\"date\" name=\"day\">\n"; while ($min_day <= $max_day) { if ($min_day == $this_day) { echo "\t\t\t\t\t\t\t\t\t<option selected=\"selected\" value=\"{$min_day}\">{$min_day}</option>\n"; } else { echo "\t\t\t\t\t\t\t\t\t<option value=\"{$min_day}\">{$min_day}</option>\n"; } $min_day++; } echo "\t\t\t\t\t\t\t\t</select>\n"; $max_month = 12; $min_month = 1; echo "\t\t\t\t\t\t\t\t<select class=\"form_select\" name=\"month\">\n"; while ($min_month <= $max_month) { if ($min_month == $this_month) { echo "\t\t\t\t\t\t\t\t\t<option selected=\"selected\" value=\"{$min_month}\">{$months[$min_month]}</option>\n"; } else { echo "\t\t\t\t\t\t\t\t\t<option value=\"{$min_month}\">{$months[$min_month]}</option>\n"; } $min_month++; } echo "\t\t\t\t\t\t\t\t</select>\n"; $max_year = $this_year + 5; $min_year = $this_year - 5; echo "\t\t\t\t\t\t\t\t<select class=\"form_select\" name=\"year\">\n"; while ($min_year <= $max_year) { if ($min_year == $this_year) { echo "\t\t\t\t\t\t\t\t\t<option selected=\"selected\" value=\"{$min_year}\">{$min_year}</option>\n"; } else { echo "\t\t\t\t\t\t\t\t\t<option value=\"{$min_year}\">{$min_year}</option>\n"; } $min_year++; } echo "\t\t\t\t\t\t\t\t</select>\n"; echo "\n\t\t\t\t\t\t\t\t@ <input type=\"text\" class=\"form_text\" name=\"time\" value=\"{$time}\" size=\"5\" maxlength=\"5\" />"; }
function DrawBody() { global $date_format, $lang, $page_display_name; echo "\t<table class=\"tbl {$this->table}\" summary=\"" . $lang['results_from'] . " {$this->table}.\">\n\t\t\t\t\t\t\t<thead>\n\t\t\t\t\t\t\t\t<tr>"; for ($j = 0; $j < mysql_num_fields($this->Res); $j++) { if (!in_array(mysql_field_name($this->Res, $j), $this->exclude)) { if (isset($arlen) && isset($sum)) { $arlen[$j] = mysql_field_len($this->Res, $j); $sum += $arlen[$j]; } } } for ($j = 0; $j < mysql_num_fields($this->Res); $j++) { if (!in_array(mysql_field_name($this->Res, $j), $this->exclude)) { $st3 = "class=\"tbl_heading\""; $fieldname = simplify(mysql_field_name($this->Res, $j)); if (isset($lang['form_' . mysql_field_name($this->Res, $j)]) && $lang['form_' . mysql_field_name($this->Res, $j)]) { $fieldname = $lang['form_' . mysql_field_name($this->Res, $j)]; } echo "<th {$st3} id=\"" . mysql_field_name($this->Res, $j) . "\">{$fieldname}</th>"; } } echo "\n\t\t\t\t\t\t\t\t\t<th class=\"tbl_heading\" id=\"page_edit\"></th>\n\t\t\t\t\t\t\t\t\t<th class=\"tbl_heading\" id=\"page_delete\"></th>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t</thead>"; if ($this->finalmax) { $this->limit = $this->finalmax; } echo "\n\t\t\t\t\t\t\t<tbody>"; $counter = NULL; while ($counter < $this->limit) { $F = mysql_fetch_array($this->Res); if (is_even($counter)) { $trclass = 'odd'; } else { $trclass = 'even'; } echo "\n\t\t\t\t\t\t\t\t<tr class=\"{$trclass}\">\n"; for ($j = 0; $j < mysql_num_fields($this->Res); $j++) { if (!in_array(mysql_field_name($this->Res, $j), $this->exclude)) { if (mysql_field_type($this->Res, $j) == 'timestamp') { $logunix = returnUnixtimestamp($F[$j]); $date = safe_strftime($date_format, $logunix); echo "\n\t\t\t\t\t\t\t\t\t<td class=\"tbl_row\" headers=\"" . mysql_field_name($this->Res, $j) . "\">" . $date . "</td>"; } else { if (mysql_field_name($this->Res, $j) == 'url') { echo "\n\t\t\t\t\t\t\t\t\t<td class=\"tbl_row\" headers=\"" . mysql_field_name($this->Res, $j) . "\"><a href=\"" . $F[$j] . "\">" . $F[$j] . "</a></td>"; } else { if (mysql_field_name($this->Res, $j) == 'email') { echo "\n\t\t\t\t\t\t\t\t\t<td class=\"tbl_row\" headers=\"" . mysql_field_name($this->Res, $j) . "\"><a href=\"mailto:" . $F[$j] . "\">" . $F[$j] . "</a></td>"; } else { if ($F[$j] == "") { echo "\n\t\t\t\t\t\t\t\t\t<td class=\"tbl_row\" headers=\"" . mysql_field_name($this->Res, $j) . "\">No Content</td>"; } else { echo "\n\t\t\t\t\t\t\t\t\t<td class=\"tbl_row\" headers=\"" . mysql_field_name($this->Res, $j) . "\">" . strip_tags($F[$j]) . "</td>"; } } } } } } echo "\n\t\t\t\t\t\t\t\t\t<td class=\"tbl_row tbl_edit\" headers=\"page_edit\"><a href=\"{$this->whereami}&edit={$F['0']}\" title=\"" . $lang['edit'] . "\">" . $lang['edit'] . "</a></td>\n\t\t\t\t\t\t\t\t\t<td class=\"tbl_row tbl_delete\" headers=\"page_delete\"><a href=\"{$this->whereami}&delete={$F['0']}\" onclick=\"return confirm('" . $lang['sure_delete_entry'] . " (#{$F['0']}) " . $lang['from_the'] . " {$page_display_name} " . $lang['settings_page'] . "?')\" title=\"" . $lang['delete'] . "\">" . $lang['delete'] . "</a></td>\n\t\t\t\t\t\t\t\t</tr>"; $counter++; } echo "\n\t\t\t\t\t\t\t</tbody>\n\t\t\t\t\t\t</table>\n"; }
font-weight:bold; } </style> <?php break; // Show Module // This is where your module will output into the content div on the page // Show Module // This is where your module will output into the content div on the page default: if (isset($s)) { echo "<div id=\"{$s}\">\n\t\t\t\t\t\t<h3>{$page_display_name}</h3>\n"; if ($rs) { while ($a = nextRow($rs)) { extract($a); $logunix = returnUnixtimestamp($date); $dateis = safe_strftime($date_format, $logunix); $microformat = safe_strftime('%Y-%m-%dT%T%z', $logunix); $googtime = safe_strftime('%Y%m%dT%H%M%SZ', $logunix); echo "\n\t\t\t\t\t\t<div class=\"vevent\">\n\t\t\t\t\t\t\t<h4 class=\"summary\" title=\""; if (isset($title)) { echo $title; } echo "\">"; if (isset($title)) { echo $title; } echo "</h4>\n\t\t\t\t\t\t\t<ul class=\"vdetails\"><p>\n\t\t\t\t\t\t\t\t<li class=\"vtime\">Date: <abbr class=\"dtstart\" title=\"{$microformat}\">{$dateis}</abbr></li>\n"; if ($location) { echo "\t\t\t\t\t\t\t\t<li class=\"vlocation\">Venue: <span class=\"location\">{$location}</span></li>\n"; }
function adminrss($s, $user) { global $site_name, $site_url, $s, $lang, $date_format; if (safe_field('nonce', 'pixie_users', "nonce='{$user}'")) { header('Content-type: text/xml'); // Note : header should ALWAYS go at the top of a document. See php header(); in the php manual. echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"; ?> <rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/"> <channel> <title><?php echo "{$site_name} - " . $lang['latest_activity'] . ' (' . $lang['rss_feed'] . ')'; ?> </title> <description><?php echo "{$site_name} - " . $lang['latest_activity'] . ""; ?> </description> <link><?php echo "{$site_url}/admin/?s=myaccount&do=rss&user={$user}&referrer=rss"; ?> </link> <generator>Pixie installed @ http://<?php echo "{$site_url}"; ?> </generator> <language>en</language> <image> <url><?php echo "{$site_url}"; ?> files/images/rss_feed_icon.gif</url> <link><?php echo $site_url . "admin/?s=myaccount&do=rss&user={$user}&referrer=rss"; ?> </link> <title><?php echo "{$site_name}"; ?> </title> </image> <?php $max = 60; $data = safe_rows('*', 'pixie_log', "log_type = 'system' order by log_time desc"); $total = count($data); if ($total) { if ($total < $max) { $max = $total; } } $i = 0; while ($i < $max) { $out = $data[$i]; $title = $out['log_message']; $link = $site_url; $author = $out['user_id']; $time = $out['log_time']; $logunix = returnUnixtimestamp($time); $time = safe_strftime('%a, %d %b %Y %H:%M:%S %z', $logunix); $site = str_replace('http://', "", $site_url); echo " \t\t\r\n\t\t<item>\r\n\t\t\t<title>({$site_name}) - {$author}: {$title}</title>\r\n\t\t\t<link>{$link}?referrer=rss</link>\r\n\t\t\t<author>{$author}</author>\r\n\t\t\t<pubdate>{$time}</pubdate>\r\n\t\t</item>"; $i++; } echo "\n\t</channel>\n</rss>"; } else { // the user has attempted to access the RSS feed with an invalid nonce logme($lang['rss_access_attempt'], 'yes', 'error'); echo $lang['rss_access_attempt']; } }