Re: Conference teaser on the front page
| From: | Hannes Magnusson | Date: | Tue, 13 Feb 2007 14:29:49 +0000 |
| Subject: | Re: Conference teaser on the front page | ||
| References: | 1 2 3 | Groups: | php.mirrors |
| Request: | Send a blank email to php-mirrors+get-34286@lists.php.net to get a copy of this message | ||
Hi Sean & all
After rethinking it a bit I feel like current patch adds an
unnecessary overhead.
Pregenerating that list on master, exported as array would make more sense IMO.
See upgraded patch for phpweb/index.php, new file on
master/scripts/conference_teaser & patch against
master/scripts/updated-backend
The conference_teaser scripts requires ext/simplexml... if it isn't
available on master we can replace it easily with similar parsing
mechanism as the previous phpweb/index.php patch.
-Hannes
On 2/12/07, Sean Coates <sean@caedmon.net> wrote:
> Hannes Magnusson wrote:
> > Hi
> >
> > I hear some of you are worried over flooding the top, here is a patch
> > to limit confs announcements to 4, and cfp to 4..
>
> I'm currently in Vancouver at the PHP Conference, there.
> I'd really like to review this patch, but I won't have time until
> probably Thursday.
>
> Do you mind waiting a few days, as a courtesy, for review, before this
> is committed?
>
> S
>
>
Index: index.php =================================================================== RCS file: /repository/phpweb/index.php,v retrieving revision 1.860 diff -u -r1.860 index.php --- index.php 12 Feb 2007 14:52:02 -0000 1.860 +++ index.php 13 Feb 2007 14:17:31 -0000 @@ -19,8 +19,9 @@ */ $timestamps[] = @filemtime("include/prepend.inc"); -// Calendar is the only "dynamic" feature on this page +// Calendar & conference teasers are the only "dynamic" features on this page $timestamps[] = @filemtime("include/pregen-events.inc"); +$timestamps[] = @filemtime("include/pregen-confs.inc"); // The latest of these modification dates is our real Last-Modified date $timestamp = max($timestamps); @@ -42,6 +43,7 @@ $_SERVER['BASE_PAGE'] = 'index.php'; include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc'; include_once $_SERVER['DOCUMENT_ROOT'] . '/include/pregen-events.inc'; +include_once $_SERVER['DOCUMENT_ROOT'] . '/include/pregen-confs.inc'; // This goes to the left sidebar of the front page $SIDEBAR_DATA = ' @@ -142,6 +144,23 @@ // Write out common header site_header("Hypertext Preprocessor", array('onload' => 'boldEvents();', 'headtags' => '<link rel="alternate" type="application/rss+xml" title="PHP: Hypertext Preprocessor" href="' . $MYSITE . 'news.rss" />')); +if (is_array($CONF_TEASER) && count($CONF_TEASER)) { + echo ' <div id="confTeaser">' . "\n"; + foreach($CONF_TEASER as $k => $a) { + echo ' <ul class="' .$k. '">' . "\n"; + $count = 0; + foreach($a as $url => $title) { + if ($count++ >= 4) { + break; + } + echo ' <li><a href="' . $url. '">' . $title. '</a></li>' . "\n"; + } + echo " </ul>\n"; + } + echo " </div>\n"; +} + + // DO NOT REMOVE THIS COMMENT (the RSS parser is dependant on it) ?> Index: scripts/update-backend =================================================================== RCS file: /repository/php-master-web/scripts/update-backend,v retrieving revision 1.22 diff -u -r1.22 update-backend --- scripts/update-backend 8 Feb 2007 22:36:06 -0000 1.22 +++ scripts/update-backend 13 Feb 2007 14:21:28 -0000 @@ -46,6 +46,7 @@ } touch("$root/news.rss", @filemtime("$root/index.php")); +// Create conferences/cfp feed $dest = fopen("$root/conferences/news.rss", "w"); if (!$dest) { echo "failed to open $root/conferences/news.rss for writing"; } else { @@ -54,6 +55,10 @@ } touch("$root/conferences/news.rss", @filemtime("$root/conferences/index.php")); +// Pregenerate conference teaser +include "conference_teaser"; +pregenerate_conf_teaser("$root/conferences/news.rss", "$root/include/pregen-confs.inc"); + // Compress mirrorkit dir in backend to mirrorkit.tgz, and // then move it to the webspace in case it is properly done chdir("$root/backend/mirrorkit"); Attachment: [application/x-php] conference_teaser
Index: index.php =================================================================== RCS file: /repository/phpweb/index.php,v retrieving revision 1.860 diff -u -r1.860 index.php --- index.php 12 Feb 2007 14:52:02 -0000 1.860 +++ index.php 13 Feb 2007 14:17:31 -0000 @@ -19,8 +19,9 @@ */ $timestamps[] = @filemtime("include/prepend.inc"); -// Calendar is the only "dynamic" feature on this page +// Calendar & conference teasers are the only "dynamic" features on this page $timestamps[] = @filemtime("include/pregen-events.inc"); +$timestamps[] = @filemtime("include/pregen-confs.inc"); // The latest of these modification dates is our real Last-Modified date $timestamp = max($timestamps); @@ -42,6 +43,7 @@ $_SERVER['BASE_PAGE'] = 'index.php'; include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc'; include_once $_SERVER['DOCUMENT_ROOT'] . '/include/pregen-events.inc'; +include_once $_SERVER['DOCUMENT_ROOT'] . '/include/pregen-confs.inc'; // This goes to the left sidebar of the front page $SIDEBAR_DATA = ' @@ -142,6 +144,23 @@ // Write out common header site_header("Hypertext Preprocessor", array('onload' => 'boldEvents();', 'headtags' => '<link rel="alternate" type="application/rss+xml" title="PHP: Hypertext Preprocessor" href="' . $MYSITE . 'news.rss" />')); +if (is_array($CONF_TEASER) && count($CONF_TEASER)) { + echo ' <div id="confTeaser">' . "\n"; + foreach($CONF_TEASER as $k => $a) { + echo ' <ul class="' .$k. '">' . "\n"; + $count = 0; + foreach($a as $url => $title) { + if ($count++ >= 4) { + break; + } + echo ' <li><a href="' . $url. '">' . $title. '</a></li>' . "\n"; + } + echo " </ul>\n"; + } + echo " </div>\n"; +} + + // DO NOT REMOVE THIS COMMENT (the RSS parser is dependant on it) ?> Index: scripts/update-backend =================================================================== RCS file: /repository/php-master-web/scripts/update-backend,v retrieving revision 1.22 diff -u -r1.22 update-backend --- scripts/update-backend 8 Feb 2007 22:36:06 -0000 1.22 +++ scripts/update-backend 13 Feb 2007 14:21:28 -0000 @@ -46,6 +46,7 @@ } touch("$root/news.rss", @filemtime("$root/index.php")); +// Create conferences/cfp feed $dest = fopen("$root/conferences/news.rss", "w"); if (!$dest) { echo "failed to open $root/conferences/news.rss for writing"; } else { @@ -54,6 +55,10 @@ } touch("$root/conferences/news.rss", @filemtime("$root/conferences/index.php")); +// Pregenerate conference teaser +include "conference_teaser"; +pregenerate_conf_teaser("$root/conferences/news.rss", "$root/include/pregen-confs.inc"); + // Compress mirrorkit dir in backend to mirrorkit.tgz, and // then move it to the webspace in case it is properly done chdir("$root/backend/mirrorkit"); Attachment: [application/x-php] conference_teaser