@include("includes/header.php"); ?> // ---------------------------------------------------------------------------------- // DO NOT MODIFY SECTION --> // ---------------------------------------------------------------------------------- // Check to make sure directory permissions are correct @set_time_limit(0); $configfile = "articles.xml"; $updateurl = "http://www.contentspooling.net/update.php?w=".$_SERVER['HTTP_HOST']."&v=2"; $articleurl = "http://www.contentspooling.net/update.php?did="; $topicurl = "http://www.contentspooling.net/update.php"; $perms_error = false; if (!file_exists($configfile)){ $fp = @fopen($configfile, "w+"); if (!$fp){ $perms_error = true; } else { if (@fwrite($fp, "temp") === FALSE){ $perms_error = true; } } } if ($perms_error){ echo "
Permissions Error:
Your directory cannot be written to. Please ensure the permissions are set to 755 or 777.
Updating, please wait...
"; echo 'Update Error:
Your website could not be updated. Please try again later."; }
// ------------------------------------
if ($updatexml && $updatexml <> "temp"){
// load xml
$parser = xml_parser_create();
xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0);
xml_parse_into_struct($parser, $updatexml, $values, $tags);
xml_parser_free($parser);
if (isset($tags['error'])){
$error_message = $values[$tags['error'][0]+1]['value'];
echo "
Update Error:
".$error_message." (ERROR #".$values[$tags['error'][0]]['attributes']['id'].")
| "; } // echo ""; echo ""; if ($i == $split){ $i = 0; echo " | "; } } if ($i <> 0){ echo ""; } echo '
".$topic." | ";
echo ''.$text_view_categories.' | '; echo '
Showing '.($start+1).' - '.$end.' of '.$total_results.' articles.
'; } $i = $start; while ($i < $end){ $article = $articles[$articles_index[$i]]; echo ''.$article['title'].'';
if (in_array("Author", $preferences['index_format'])){ echo '
by '.$article['author']; }
if (in_array("Date Added", $preferences['index_format'])){ if (in_array("Author", $preferences['index_format'])){ echo ", "; } else { echo "
"; } echo $article['date']; }
if (in_array("Article Summary", $preferences['index_format'])){ echo '
'.$article['summary']; }
echo '
| '; if ($start - $limit >= 0){ echo 'Prev '; } $curr_page = $start / $limit + 1; if ($curr_page == 0){ $curr_page = 1; } $total_pages = $total_results / $limit; if (substr_count($total_pages, ".")){ $total_pages = $total_pages + 1; $pos = strpos($total_pages, "."); $total_pages = substr($total_pages, 0, $pos); } $next_pages = array(); $i = $curr_page + 1; while ($i < ($curr_page+10) && $i <= $total_pages){ $next_pages[] = $i; $i++; } $prev_pages = array(); $i = $curr_page - 1; while ($i > ($curr_page-10) && $i >= 1){ $prev_pages[] = $i; $i--; } asort($prev_pages); echo ' | '; echo '
| '; if ($start + $limit < $total_results){ echo 'Next'; } echo ' |
".$text_no_articles."
"; } echo '