From: <kar...@us...> - 2010-05-29 14:44:38
|
Revision: 12009 http://pcgen.svn.sourceforge.net/pcgen/?rev=12009&view=rev Author: karianna Date: 2010-05-29 14:44:32 +0000 (Sat, 29 May 2010) Log Message: ----------- Make download Alpha/Beta section reasonable (and use the new RSS feed) Modified Paths: -------------- Trunk/website/03_get_pcgen.php Modified: Trunk/website/03_get_pcgen.php =================================================================== --- Trunk/website/03_get_pcgen.php 2010-05-29 00:40:55 UTC (rev 12008) +++ Trunk/website/03_get_pcgen.php 2010-05-29 14:44:32 UTC (rev 12009) @@ -1,159 +1,176 @@ -<?php - -require_once('include/header.php.inc'); - -function writePcgenFileItems($url, $viewProd, $maxRecs) -{ - if ($url) - { - $rss = fetch_rss($url); - $outCount = 0; - $prevVerNum = array(0,0,0); - - foreach ($rss->items as $item) - { - $title = $item['title']; - $title = strtolower($title); - $title = str_replace("_", " ", $title); - $title = str_replace("<br>", "<br /> ", $title); - $title = ucwords($title); - - $findme = 'Released'; - $found = strpos($title, $findme); - $title = substr($title, 0, $found); - - $found = strpos($title, " "); - $ver = substr($title, $found); - $verNum = split("\.", $ver); - $isProd = false; - $isSnapshot = false; - if (count($verNum > 1)) - { - if ($verNum[1] % 2 == 0) - { - if (strpos(strtolower($title), "rc") == 0) - { - $isProd = true; - } - } - } - if (strpos(strtolower($title), "snapshot") != 0) - { - $isSnapshot = true; - } - - if ($viewProd && $isProd && ($verNum[0] == $prevVerNum[0]) - && ($verNum[1] == $prevVerNum[1])) - { - // When showing multiple prod versions, get the latest patch from each - $isProd = false; - } - - if (($outCount < $maxRecs) && !$isSnapshot && (($viewProd && $isProd) || (!$viewProd && !$isProd))) - { - $pub = date("Y-m-d", strtotime($item['pubdate'])); - - $desc = substr($item['description'], 2); - $findme = '<br>'; - $found = (4 + strpos($desc, $findme)); - $desc = substr($desc, $found); - $desc = str_replace("<br>", "<br /> ", $desc); - $desc = str_replace("),", "),<br /> ", $desc); - $desc = str_replace("files:", "files:<br /> ", $desc); - $desc = str_replace("&release_id", "&release_id", $desc); - - $href = $item['link']; - echo "<h3>$title</h3>\n"; - - echo "<div class=\"published\">Released: $pub</div>\n"; - - echo "<p>$desc</p>\n"; - echo "\n"; - $outCount++; - - if ($isProd) - { - $prevVerNum = $verNum; - } - } - } - } -} - -?> - - - <div id="content" class="content"> - - <h1>How to Get PCGen</h1> - <p>PCGen is open-source software available for free under the <a href="http://www.gnu.org/copyleft/lgpl.html">LGPL License</a>. There are a couple of ways you can get it: - <ul> - <li><a href="#stable">Stable Download</a></li> - <li><a href="#data">Stable Data Sets</a> - New data sets can be installed into an existing version of PCGen</li> - <li><a href="#alpha">Alpha/Beta/RC Releases</a></li> - <li><a href="#autobuild">Nightly Builds</a></li> - <li><a href="#subversion">Subversion Access</a></li> - <li><a href="http://wiki.pcgen.org/index.php?title=Roadmap">Roadmap</a> - Find out when you get your next fix!</li> - <li><a href="http://sourceforge.net/projects/pcgen/files/PrettyLst/v%201.39%20build%208180/prettylst_1-39_build-8180.zip/download" target="_blank">PrettyLst</a> - PERL Utility for data coders.</li> - </ul> - - <h2>Option 1. Download Latest Stable Release of PCGen<a class="" title="stable" name="stable"></a></h2> - <p>Click on the link suited to your computer below. You can also look at - the <a href="http://sourceforge.net/project/showfiles.php?group_id=25576&package_id=129606" style="font-size: 80%;">Full Package</a> - for further files such as PDF documentation and alpha dataasets. - </p> - <p>This is the most recent stable or production PCGen Release. If you are - using PCGen data sets from Code Monkey Publishing, you should be using a - production release of PCGen. - <a href="http://sourceforge.net/project/showfiles.php?group_id=25576&package_id=129606" style="font-size: 80%;">[View Older Production Releases]</a> - </p> - - <div class="downloadbar"><a href="http://downloads.sourceforge.net/pcgen/pcgen5162_win_install.exe">Download PCGen 5.16.2 for Windows<small> </small></a></div><br /> - <div class="downloadbar"><a href="http://downloads.sourceforge.net/pcgen/pcgen5162_mac_build.dmg">Download PCGen 5.16.2 for Mac<small> </small></a></div><br /> - <div class="downloadbar"><a href="http://downloads.sourceforge.net/pcgen/pcgen5162_full.zip">Download PCGen 5.16.2 for Other Systems<small> </small></a></div><br/> - - <h3>Download Stable Data Sets<a class="" title="data" name="data"></a></h3> - <p>These are stable data sets that are developed in between stable releases of PCGen but can be installed and used with a stable version of PCGen. - </p> - <div class="downloadbar"><a href="https://sourceforge.net/projects/pcgen/files/PCGen%20Stable%20Datasets/5.16.1%20OOC%20Data%20Sets/5161_pathfinder_role_playing_game_release4.zip/download">Download Pathfinder RPG dataset for PCGen 5.16.1<small> </small></a></div><br /> - <p> - <a href="http://sourceforge.net/projects/pcgen/files/PCGen%20Stable%20Datasets/" style="font-size: 80%;">[View Stable Data Sets]</a> - </p> - - <h2>Option 2. Download Alpha Releases<a class="" title="alpha" name="alpha"></a></h2> - <p>These are development milestone releases designed to display the work in progress on PCGen - and for use in testing new features. Use at own risk. Basic functionality is tested before - each alpha and beta build though. - </p><!-- <p>The beta releases have all of the features of the next production release of PCGen, - and work focuses on fixing bugs and getting the program ready for a production release.<br /> --> - <a href="http://sourceforge.net/project/showfiles.php?group_id=25576&package_id=21689" style="font-size: 80%;">[View Older Alpha and Beta Releases]</a> - </p> -<?php - -writePcgenFileItems("http://sourceforge.net/export/rss2_projfiles.php?group_id=25576&rss_limit=20", false, 5); - -?> - - <h2>Option 3. Nightly Builds<a class="" title="autobuild" name="autobuild"></a></h2> - <p>Autobuilds are compilations of the PCGen program and data taken - direct from our source at regular intervals. They are not manually tested - at all prior to upload, but are instead an excellent tool to allow people - to test what we are currently working on. - </p><p>See the - <a href="07_autobuilds.php" style="font-size: 80%;">Autobuilds page</a> - for these downloads. - </p> - - <h2>Option 4. Subversion Access<a class="" title="subversion" name="subversion"></a></h2> - <p>We use the Subversion service hosted by SourceForge for - all our code and data. If you want direct access to the source, see the - <a href="http://sourceforge.net/scm/?type=svn&group_id=25576" style="font-size: 80%;">Subversion usage page</a> - </p> - - </div> <!-- div content --> - -<?php - -require_once('include/footer.php.inc'); - -?> +<?php + +require_once('include/header.php.inc'); + +function nth_position($str, $letter, $n, $offset = 0) +{ + $str_arr = str_split($str); + $letter_size = array_count_values(str_split(substr($str, $offset))); + if( !isset($letter_size[$letter])) + { + trigger_error('letter "' . $letter . '" does not exist in ' . $str . ' after ' . $offset . '. position', E_USER_WARNING); + return false; + } + else if($letter_size[$letter] < $n) + { + trigger_error('letter "' . $letter . '" does not exist ' . $n .' times in ' . $str . ' after ' . $offset . '. position', E_USER_WARNING); + return false; + } + for($i = $offset, $x = 0, $count = (count($str_arr) - $offset); $i < $count, $x != $n; $i++) + { + if($str_arr[$i] == $letter) + { + $x++; + } + } + return $i - 1; +} + +function writePcgenFileItems($url, $viewProd, $maxRecs) +{ + if ($url) + { + $rss = fetch_rss($url); + $outCount = 0; + $prevVerNum = array(0,0,0); + + $ver2 = ''; + foreach ($rss->items as $item) + { + $title = $item['title']; + $title = strtolower($title); + $title = str_replace("_", " ", $title); + $title = str_replace("<br>", "<br /> ", $title); + $title = ucwords($title); + $found = nth_position($title, '/', 2); + $found2 = nth_position($title, '/', 3); + $ver = substr($title, $found + 1, $found2 - $found - 1); + if ($ver != $ver2) + { + $ver2 = $ver; + $display = true; + } + else + { + $display = false; + } + + // Check its PRD status + $verNum = split("\.", $ver); + $isProd = false; + $isSnapshot = false; + if (count($verNum > 1)) + { + if ($verNum[1] % 2 == 0) + { + if (strpos(strtolower($title), "rc") == 0) + { + $isProd = true; + } + } + } + if (strpos(strtolower($title), "snapshot") != 0) + { + $isSnapshot = true; + } + + if ($viewProd && $isProd && ($verNum[0] == $prevVerNum[0]) + && ($verNum[1] == $prevVerNum[1])) + { + // When showing multiple prod versions, get the latest patch from each + $isProd = false; + } + + if (($outCount < $maxRecs) && !$isSnapshot && (($viewProd && $isProd) || (!$viewProd && !$isProd)) && $display) + { + $pub = date("Y-m-d", strtotime($item['pubdate'])); + $href = 'http://sourceforge.net/projects/pcgen/files/PCGen%20Unstable/'; + $ver = str_replace("Rc", "RC", $ver); + echo "<h3><a href='$href$ver'>$ver</a></h3>\n"; + echo "Released: $pub\n"; + $outCount++; + + if ($isProd) + { + $prevVerNum = $verNum; + } + } + } + } +} + +?> + + + <div id="content" class="content"> + + <h1>How to Get PCGen</h1> + <p>PCGen is open-source software available for free under the <a href="http://www.gnu.org/copyleft/lgpl.html">LGPL License</a>. There are a couple of ways you can get it: + <ul> + <li><a href="#stable">Stable Download</a></li> + <li><a href="#data">Stable Data Sets</a> - New data sets can be installed into an existing version of PCGen</li> + <li><a href="#alpha">Alpha/Beta/RC Releases</a></li> + <li><a href="#autobuild">Nightly Builds</a></li> + <li><a href="#subversion">Subversion Access</a></li> + <li><a href="http://wiki.pcgen.org/index.php?title=Roadmap">Roadmap</a> - Find out when you get your next fix!</li> + <li><a href="http://sourceforge.net/projects/pcgen/files/PrettyLst/v%201.39%20build%208180/prettylst_1-39_build-8180.zip/download" target="_blank">PrettyLst</a> - PERL Utility for data coders.</li> + </ul> + + <h2>Option 1. Download Latest Stable Release of PCGen<a class="" title="stable" name="stable"></a></h2> + <p>Click on the link suited to your computer below. You can also look at + the <a href="http://sourceforge.net/project/showfiles.php?group_id=25576&package_id=129606" style="font-size: 80%;">Full Package</a> + for further files such as PDF documentation and alpha dataasets. + </p> + <p>This is the most recent stable or production PCGen Release. If you are + using PCGen data sets from Code Monkey Publishing, you should be using a + production release of PCGen. + <a href="http://sourceforge.net/project/showfiles.php?group_id=25576&package_id=129606" style="font-size: 80%;">[View Older Production Releases]</a> + </p> + + <div class="downloadbar"><a href="http://downloads.sourceforge.net/pcgen/pcgen5162_win_install.exe">Download PCGen 5.16.2 for Windows<small> </small></a></div><br /> + <div class="downloadbar"><a href="http://downloads.sourceforge.net/pcgen/pcgen5162_mac_build.dmg">Download PCGen 5.16.2 for Mac<small> </small></a></div><br /> + <div class="downloadbar"><a href="http://downloads.sourceforge.net/pcgen/pcgen5162_full.zip">Download PCGen 5.16.2 for Other Systems<small> </small></a></div><br/> + + <h3>Download Stable Data Sets<a class="" title="data" name="data"></a></h3> + <p>These are stable data sets that are developed in between stable releases of PCGen but can be installed and used with a stable version of PCGen. + </p> + <div class="downloadbar"><a href="https://sourceforge.net/projects/pcgen/files/PCGen%20Stable%20Datasets/5.16.1%20OOC%20Data%20Sets/5161_pathfinder_role_playing_game_release4.zip/download">Download Pathfinder RPG dataset for PCGen 5.16.1<small> </small></a></div><br /> + <p> + <a href="http://sourceforge.net/projects/pcgen/files/PCGen%20Stable%20Datasets/" style="font-size: 80%;">[View Stable Data Sets]</a> + </p> + + <h2>Option 2. Download Alpha Releases<a class="" title="alpha" name="alpha"></a></h2> + <p>These are development milestone releases designed to display the work in progress on PCGen + and for use in testing new features. Use at own risk. Basic functionality is tested before + each alpha and beta build though. + </p> +<?php +writePcgenFileItems("http://sourceforge.net/api/file/index/project-id/25576/mtime/desc/rss?path=/PCGen%20Unstable", false, 5); +?> + <p> + <a href="http://sourceforge.net/project/showfiles.php?group_id=25576&package_id=21689" style="font-size: 80%;">[View Older Alpha and Beta Releases]</a> + </p> + + <h2>Option 3. Nightly Builds<a class="" title="autobuild" name="autobuild"></a></h2> + <p>Autobuilds are compilations of the PCGen program and data taken + direct from our source at regular intervals. They are not manually tested + at all prior to upload, but are instead an excellent tool to allow people + to test what we are currently working on. + </p><p>See the + <a href="07_autobuilds.php" style="font-size: 80%;">Autobuilds page</a> + for these downloads. + </p> + + <h2>Option 4. Subversion Access<a class="" title="subversion" name="subversion"></a></h2> + <p>We use the Subversion service hosted by SourceForge for + all our code and data. If you want direct access to the source, see the + <a href="http://sourceforge.net/scm/?type=svn&group_id=25576" style="font-size: 80%;">Subversion usage page</a> + </p> + + </div> <!-- div content --> + +<?php + +require_once('include/footer.php.inc'); + +?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |