I made the necessary changes and put a version for
![The Port Forum :tpf:](./images/smilies/tpf.gif)
on site at
http://www.jacob-head.com/tpf. For the record, the necessary changes did only take 10 minutes, though working out that the reason that the same 10 bottles were shown 15 times each was not because of a bug in the code but because I’d downloaded the same page 15 times, took considerably more…
![Surprised :o](./images/smilies/icon_surprised.gif)
pps:
It’s a bit rough-and-ready but hopefully shows what might be possible.
KillerB, the only non-trivial bit of code is
this one which takes an arbitrary string and then returns an array containing a guess as to the shipper, type of port and vintage referred to in that string.
The index is generated in three stages, using XML. First we get the raw data, consisting of topic names and urls, and format them into an XML file as follows:
Code: Select all
<forum>
<topic>
<name>Cruz Ruby</name>
<url>http://www.xyz.com/xzy.php</url>
</topic>
</forum>
For these mock-ups, I‘ve been doing this by grabbing the forum index source code with wget and parsing it through some sed scripts.
Stage two is
this set of code, which loops through the XML and produces:
Code: Select all
<forum>
<topic>
<name>Cruz Ruby</name>
<type>Ruby</type>
<year>nv</year>
<url>http://www.xyz.com/xzy.php</url>
</topic>
</forum>
Finally, stage three is the index.php (
source code) which just takes the XML and displays/manipulates it.
With database access, stage one would be eliminated and I could incorporate stage 2 into the index.php file in a slightly more sophisticated way (so as to make it auto-update).
Alternatively, perhaps there might be some use for the basic portid function in generating the current static list, so you don’t have to do any manual sorting?