~ubuntu-branches/ubuntu/precise/boinc/precise

« back to all changes in this revision

Viewing changes to doc/project_list.php

Tags: 6.12.8+dfsg-1
* New upstream release.
* Simplified debian/rules

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
<?php
 
2
 
 
3
// The BOINC client uses this to get a current list of projects,
 
4
// which it does every 14 days.
 
5
// Don't break backwards compatibility!
 
6
 
2
7
require_once("projects.inc");
 
8
require_once("account_managers.inc");
 
9
require_once("get_platforms.inc");
3
10
 
4
11
header('Content-type: text/xml');
5
12
echo '<?xml version="1.0" encoding="ISO-8859-1" ?>
15
22
    shuffle($projects);
16
23
    foreach ($projects as $p) {
17
24
        $np = null;
18
 
        if ($p[5]) {
 
25
        if (array_key_exists(5, $p)) {
19
26
            $np->image = $p[5];
20
27
        }
21
28
        $np->url = $p[1];
 
29
        $np->web_url = $p[1];
 
30
        if (array_key_exists(6, $p)) {
 
31
            $np->web_url = $p[6];
 
32
        }
22
33
        $np->home = $p[2];
23
34
        $np->general_area = $area_name;
24
35
        $np->specific_area = $p[3];
38
49
        <description>$p->description</description>
39
50
        <home>$p->home</home>
40
51
";
41
 
    if ($p->image) {
 
52
    $platforms = get_platforms_cached($p->web_url);
 
53
    if ($platforms) {
 
54
        echo "    <platforms>\n";
 
55
        foreach ($platforms as $platform) {
 
56
            if ($platform == 'Unknown') continue;
 
57
            echo "        <name>$platform</name>\n";
 
58
        }
 
59
        echo "    </platforms>\n";
 
60
    }
 
61
    if (isset($p->image)) {
42
62
        echo "      <image>http://boinc.berkeley.edu/images/$p->image</image>
43
63
";
44
64
    }
45
65
    echo "    </project>
46
66
";
47
67
}
 
68
 
 
69
foreach ($account_managers as $am) {
 
70
    $name = $am[0];
 
71
    $url = $am[1];
 
72
    $desc = $am[2];
 
73
    $image = $am[3];
 
74
    echo "   <account_manager>
 
75
        <name>$name</name>
 
76
        <url>$url</url>
 
77
        <description>$desc</description>
 
78
        <image>http://boinc.berkeley.edu/images/$image</image>
 
79
    </account_manager>
 
80
";
 
81
}
 
82
 
48
83
echo "</projects>
49
84
";
50
85