Imported Upstream version 0.72.3

This commit is contained in:
TANIGUCHI Takaki
2012-03-06 11:08:15 +09:00
parent ab070f0354
commit 606d4178ee
713 changed files with 13953 additions and 28840 deletions

View File

@@ -1,6 +1,6 @@
<?php
# dvdisaster: Homepage layout functions
# dvdisaster: Homepage layout funtions
# Copyright (C) 2007-2010 Carsten Gnörlich
require("version.php");
@@ -8,8 +8,6 @@ require("version.php");
# Preset some global variables
$project_at_hoster="http://sourceforge.net/projects/dvdisaster";
$max_news_flash_items = 7;
$create_feed = 0;
# Find out from where we have been called;
# the file name is important for creation of the index.
@@ -61,10 +59,6 @@ function ru($msg)
function start_html()
{ global $toc_title_mode;
global $toc_title_content;
global $script_name;
global $script_lang;
global $create_feed;
global $trans_atom_title;
echo "<html>\n";
echo "<head>\n";
@@ -75,10 +69,6 @@ function start_html()
echo " <title>$toc_title_content</title>\n";
$toc_title_mode = 0;
echo " <link rel=\"stylesheet\" type=\"text/css\" href=\"../include/dvdisaster.css\">\n";
if(!strcmp($script_name, "index"))
{ echo "<link rel=\"alternate\" type=\"application/atom+xml\" href=\"http://dvdisaster.net/$script_lang/feed/atom.xml\" title=\"$trans_atom_title\" />\n";
$create_feed=1;
}
echo "</head>\n";
echo "<body>\n";
@@ -105,8 +95,6 @@ function lang_link($lang_name, $lang, $spacing)
function begin_page()
{ global $cooked_version;
global $have_experimental;
global $stable_version;
global $trans_to_hoster;
global $trans_to_internet;
global $trans_version;
@@ -125,10 +113,8 @@ function begin_page()
echo " <tr>\n";
echo " <td align=\"left\">\n";
echo " <font size=\"+3\"><b>dvdisaster</b></font>\n";
if(!strcmp($have_experimental, "no"))
echo " <i>$trans_version $cooked_version</i>\n";
else
echo " <i>$trans_version $stable_version / $cooked_version</i>\n";
echo " <i>$trans_version $cooked_version</i>\n";
if(!strcmp($mode, "local"))
{ echo " </td>\n";
echo " <td align=\"right\">\n";
@@ -242,7 +228,7 @@ function toc_link($msg, $lang)
if(strcmp($lang, $script_lang)) return; # wrong locale
# Decide whether this is the currently unfolded section
# Decide whether this is the currently unfolded (sub)section
# and render it accordingly
if(!strcmp($toc_mode, "section"))
@@ -287,87 +273,27 @@ function toc_link($msg, $lang)
function news_headline($headline)
{ global $news_flash;
global $atom_handle;
global $create_feed;
global $script_lang;
global $doc_dir;
global $trans_atom_title;
if(!$news_flash) echo " <h3>$headline</h3>\n";
if($create_feed != 1) return;
# Prodoce atom feed xml file
$atom_name="atom.xml";
$atom_handle=fopen("$doc_dir/$script_lang/feed/$atom_name","w");
fwrite($atom_handle, "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n");
fwrite($atom_handle, "<feed xmlns=\"http://www.w3.org/2005/Atom\">\n");
fwrite($atom_handle, "<id>tag:dvdisaster.net,2009-10-02:/$script_lang/feeds/$atom_name</id>\n");
fwrite($atom_handle, "<title>$trans_atom_title</title>\n");
$updated=date(DATE_ATOM);
fwrite($atom_handle, "<updated>$updated</updated>\n");
fwrite($atom_handle, "<link rel=\"self\" href=\"http://dvdisaster.net/$script_lang/feed/$atom_name\" type=\"application/atom+xml\" />\n");
fwrite($atom_handle, "<author>\n");
fwrite($atom_handle, " <name>Carsten Gnörlich</name>\n");
fwrite($atom_handle, " <uri>http://www.dvdisaster.org</uri>\n");
fwrite($atom_handle, "</author>\n");
}
function news_finalize()
{ global $atom_handle;
global $create_feed;
if($create_feed != 1)
return;
fwrite($atom_handle, "</feed>\n");
fclose($atom_handle);
}
function news_item($date, $headline, $body, $atom_tag, $atom_created, $atom_updated)
function news_item($date, $headline, $body)
{ global $news_flash;
global $news_counter;
global $max_news_flash_items;
global $atom_handle;
global $create_feed;
global $script_lang;
$news_counter++;
if($create_feed == 1)
{ $stripped=strtr(strip_tags($body),"\n"," ");
$summary=substr($stripped, 0, 240);
$cutpos=240-strlen(strrchr($summary, " "));
$summary=substr($stripped, 0, $cutpos)." [...]";
fwrite($atom_handle,"<entry>\n");
fwrite($atom_handle,"<title>$headline</title>\n");
fwrite($atom_handle,"<category term=\"News\"/>\n");
$created=substr($atom_created,0,10);
fwrite($atom_handle,"<id>tag:dvdisaster.net,$created:/$script_lang/news.html/$atom_tag</id>\n");
fwrite($atom_handle,"<published>$atom_created</published>\n");
fwrite($atom_handle,"<updated>$atom_updated</updated>\n");
fwrite($atom_handle,"<link href=\"http://dvdisaster.net/$script_lang/news.html#item$atom_tag\"/>\n");
fwrite($atom_handle,"<summary>$summary</summary>\n");
fwrite($atom_handle,"</entry>\n");
}
if($news_flash)
{ if($news_counter > $max_news_flash_items)
return;
echo " <font size=\"-1\">$date</font> <br>\n";
{ echo " <font size=\"-1\">$date</font> <br>\n";
echo " <font size=\"-1\">\n";
echo " <a href=\"news.php#item$atom_tag\">$headline</a>\n";
echo " <a href=\"news.php#item$news_counter\">$headline</a>\n";
echo " </font><p>\n";
}
else
{
echo " <table width=\"90%\">\n";
echo " <tr>\n";
echo " <td><a name=\"item$atom_tag\"></a><b>${headline}</b></td>\n";
echo " <td><a name=\"item$news_counter\"></a><b>${headline}</b></td>\n";
echo " <td align=\"right\">$date</td>\n";
echo " </tr>\n";
echo " </table>\n";
@@ -455,8 +381,8 @@ function end_page()
global $trans_hosting;
global $modified_source;
global $news_flash;
global $news_counter;
global $script_lang;
global $script_lang; /* for old version link */
global $trans_old_version;
# Close the body table
@@ -474,7 +400,6 @@ function end_page()
<table width="100%" cellpadding="10"><tr><td>
<?php
echo " <font size=\"-1\"><b>$trans_news</b></font>\n";
echo " <a href=\"http://dvdisaster.net/$script_lang/feed/atom.xml\"><img src=\"../images/atom16.png\" border=></a>\n";
?>
<table width="100%" cellpadding="0" cellspacing="0">
<tr bgcolor="#000000">
@@ -508,8 +433,6 @@ function end_page()
?>
</tr>
<!---
<tr valign="bottom">
<td bgcolor="#f0f0f0">
<?php
@@ -519,8 +442,8 @@ function end_page()
</td>
<td></td>
<td></td>
</tr>
--->
</table> <!--- end of main body table --->
<?php