-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path03_get_pcgen.php
180 lines (157 loc) · 7.37 KB
/
03_get_pcgen.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
<?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']));
$pub = $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="https://sourceforge.net/projects/pcgen/files/PCGen%20Stable/6.04.0/" style="font-size: 80%;">Full Package</a>
for further files such as release notes, sources and SHA values for file integrity checking.
</p>
<p>This is the most recent stable or production PCGen Release.
</p>
<div class="downloadbar"><a href="http://downloads.sourceforge.net/pcgen/pcgen60400_win_install.exe">Download PCGen 6.04.0 for Windows<small> </small></a></div><br />
<div class="downloadbar"><a href="http://downloads.sourceforge.net/pcgen/pcgen60400_mac_install.dmg">Download PCGen 6.04.0 for Mac<small> </small></a></div><br />
<div class="downloadbar"><a href="http://downloads.sourceforge.net/pcgen/pcgen-6.04.00-full.zip">Download PCGen 6.04.0 for Other Systems<small> </small></a></div><br/>
<p>
<a href="https://sourceforge.net/projects/pcgen/files/PCGen%20Stable/" style="font-size: 80%;">[View Older Production Releases]</a>
</p>
<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.4%20OOC%20Data%20Sets/5164_piazo_pathfinder_alpha_update_07.pcz/download">Download Pathfinder RPG APG dataset Update 7 for PCGen 5.16.4</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, Beta and RC 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="https://sourceforge.net/projects/pcgen/files/PCGen%20Unstable/" 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');
?>