⌈⌋ ⎇ branch:  freshcode


Check-in [db90e8a5a7]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Add linuxgamenews.biz as news source.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: db90e8a5a7348fe7e6caab3ee9596060c1669d1f
User & Date: mario 2014-11-25 16:46:54
Context
2014-11-25
16:48
Add #flags/#incoming count to stats (for moderators). check-in: 5d57a1e1ed user: mario tags: trunk
16:46
Add linuxgamenews.biz as news source. check-in: db90e8a5a7 user: mario tags: trunk
16:46
Introduce `IS_ADMIN` shortcut, header stats for moderator infos, fix flagged entry clearing. check-in: 7ee36caef9 user: mario tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to cron.daily/news_feeds.php.

22
23
24
25
26
27
28

29
30
31
32
33
34
35

#-- RSS
$feeds = array(
    "linuxcom,7" => "http://www.linux.com/news/software?format=feed&type=rss",
    "reddit,17" => "http://www.reddit.com/r/linux/.rss",
    "linuxgames,5" => "http://www.linuxgames.com/feed",
    "gamingonlinux,4" => "http://www.gamingonlinux.com/article_rss.php",

    "freegamer,3" => "http://freegamer.blogspot.com/feeds/posts/default?alt=rss",
    "sourceforge,22" => "http://sourceforge.net/directory/release_feed/",
    "distrowatch,15" => "http://distrowatch.com/news/dwd.xml",
    "beopen,7" => "http://beopen.bplaced.net/category/projects/feed/",
);
$filter = 
    "/Please 'report' off-topic|namelessrom|machomebrew/"







>







22
23
24
25
26
27
28
29
30
31
32
33
34
35
36

#-- RSS
$feeds = array(
    "linuxcom,7" => "http://www.linux.com/news/software?format=feed&type=rss",
    "reddit,17" => "http://www.reddit.com/r/linux/.rss",
    "linuxgames,5" => "http://www.linuxgames.com/feed",
    "gamingonlinux,4" => "http://www.gamingonlinux.com/article_rss.php",
    "linuxgamenews,3" => "http://linuxgamenews.com/rss",
    "freegamer,3" => "http://freegamer.blogspot.com/feeds/posts/default?alt=rss",
    "sourceforge,22" => "http://sourceforge.net/directory/release_feed/",
    "distrowatch,15" => "http://distrowatch.com/news/dwd.xml",
    "beopen,7" => "http://beopen.bplaced.net/category/projects/feed/",
);
$filter = 
    "/Please 'report' off-topic|namelessrom|machomebrew/"
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

        # per feed
        switch ($name) {

            // Extract project base names and version numbers
            case "sourceforge":
                if (preg_match("~^(http://sourceforge.net/projects/(\w+))/files/.+?(\d+(\.\d+)+([-_. ](rc|beta|alpha|dev)([-._]?\d[.\d]*)?)?).+?/download$~", urldecode($item->link), $m)) {
                    $output .= "<a href=\"$m[1]\">$m[2] <em>$m[3]</em></a>\n";
                    $i++;
                }
                break;

            // Extract project base names and version numbers
            case "distrowatch":
                if (preg_match("~^(\d+/\d+)\s(\D+)\s+(.+)$~", $title, $m)) {
                    $output .= "<a href=\"$link\"><small>$m[1]</small> $m[2] <em>$m[3]</em></a>\n";
                }
                break;

            // Titles as is
            default:
            case "reddit":
            case "linuxcom":
            case "linuxgames":
                if (strlen($item->link) and strlen($item->title)) {
                    $title = preg_replace("~(\d+\.[\d-.]+)~", "<em>$0</em>", $title);
                    $output .="<a href=\"$link\">$title</a>\n";
                    $i++;
                }
                break;
        }

        if ($i >= $max) { break; }
    }







|







|










|







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

        # per feed
        switch ($name) {

            // Extract project base names and version numbers
            case "sourceforge":
                if (preg_match("~^(http://sourceforge.net/projects/(\w+))/files/.+?(\d+(\.\d+)+([-_. ](rc|beta|alpha|dev)([-._]?\d[.\d]*)?)?).+?/download$~", urldecode($item->link), $m)) {
                    $output .= "<a class=\"feed-$name\" href=\"$m[1]\">$m[2] <em>$m[3]</em></a>\n";
                    $i++;
                }
                break;

            // Extract project base names and version numbers
            case "distrowatch":
                if (preg_match("~^(\d+/\d+)\s(\D+)\s+(.+)$~", $title, $m)) {
                    $output .= "<a class=\"feed-$name\" href=\"$link\"><small>$m[1]</small> $m[2] <em>$m[3]</em></a>\n";
                }
                break;

            // Titles as is
            default:
            case "reddit":
            case "linuxcom":
            case "linuxgames":
                if (strlen($item->link) and strlen($item->title)) {
                    $title = preg_replace("~(\d+\.[\d-.]+)~", "<em>$0</em>", $title);
                    $output .="<a class=\"feed-$name\" href=\"$link\">$title</a>\n";
                    $i++;
                }
                break;
        }

        if ($i >= $max) { break; }
    }

Changes to template/index_sidebar.php.

35
36
37
38
39
40
41

42
43
44
45
46
47
48
        <?php  include("template/feed.distrowatch.htm");  ?>
    </section>

    <section class="article-links trimmed">
        <h5>Games <a href="http://www.linuxgames.com/" style=display:inline>LG</a>, <a href="http://www.gamingonlinux.com/" style=display:inline>GoL</a>, <a href="http://freegamer.blogspot.com/" style=display:inline>FG</a></h5>
        <?php  include("template/feed.gamingonlinux.htm");  ?>
        <?php  include("template/feed.linuxgames.htm");  ?>

        <?php  include("template/feed.freegamer.htm");  ?>
    </section>

    <section class="article-links untrimmed">
        <h5>Sourceforge Files</h5>
        <?php  include("template/feed.sourceforge.htm");  ?>
    </section>







>







35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
        <?php  include("template/feed.distrowatch.htm");  ?>
    </section>

    <section class="article-links trimmed">
        <h5>Games <a href="http://www.linuxgames.com/" style=display:inline>LG</a>, <a href="http://www.gamingonlinux.com/" style=display:inline>GoL</a>, <a href="http://freegamer.blogspot.com/" style=display:inline>FG</a></h5>
        <?php  include("template/feed.gamingonlinux.htm");  ?>
        <?php  include("template/feed.linuxgames.htm");  ?>
        <?php  include("template/feed.linuxgamenews.htm");  ?>
        <?php  include("template/feed.freegamer.htm");  ?>
    </section>

    <section class="article-links untrimmed">
        <h5>Sourceforge Files</h5>
        <?php  include("template/feed.sourceforge.htm");  ?>
    </section>