Пример #1
0
<a href="rideleadingcomic.html" target="_blank" onClick="document.getElementById('didcomic').checked = true;">Ride Leading Comic</a>
for tips that will help you lead the best ride ever.
<p>
If you have questions about this form, contact
the <a href="/contacts/index.php?eCon=CalCrew">Calendar Crew</a>.
<?php 
# This used to be a link to Shift's support address, but last year that
# address started receiving a lot of spam -- possibly because a spammer
# found the "mailto:" link.  It has been replaced by a the /contacts link
# in the plain HTML line above.
if (0) {
    print "<a href=\"mailto:";
    print str_replace("@", "%40", SHIFTEMAIL);
    print "\"><strong>";
    #print str_replace("@", "<img src=\"".IMAGES."/at.gif\" alt=\"[at]\" border=0>", SHIFTEMAIL);
    print mangleemail(SHIFTEMAIL);
    print "</strong></a>.\n";
}
?>
<p>
<div id="formatlong" class="clicked" onClick="formversion('long');" title="Book any day or combination of days, with all features available">Long Version</div>
<div id="formatshort" class="unclicked" onClick="formversion('short');" title="Book near-future days with only the most common features">Short Version</div>
<div id="formatpp" class="unclicked" onClick="formversion('pp');" title="Book during <?php 
print PPNAME;
?>
, with all features available"><?php 
print PPNAME;
?>
 Version</div>
</center>
<br>
Пример #2
0
function listevents($events)
{
    if (mysql_num_rows($events) == 0) {
        print '<em>No events</em>';
    } else {
        while ($record = mysql_fetch_array($events)) {
            $eventid = substr($record["eventdate"], -2) . '-' . $record['id'];
            print '<div class="event">';
            print "<a class=\"timetitle\" href=\"#\" onClick='return clickevent(\"{$eventid}\")'>" . hmmpm($record['eventtime']) . ' ' . htmlspecialchars($record['title']) . '</a>';
            print "<div class=\"detail\" id=\"{$eventid}\">";
            #time
            if ($record['eventduration'] || $record['timedetails']) {
                if ($record['eventduration']) {
                    print hmmpm($record['eventtime']) . '-' . endtime($record['eventtime'], $record['eventduration']);
                    if ($record['timedetails']) {
                        print ', ';
                    }
                }
                if ($record['timedetails']) {
                    print htmlspecialchars($record['timedetails']);
                }
                print '<br />';
            }
            #place
            if ($record['locname']) {
                print htmlspecialchars($record['locname']) . ', ';
            }
            print htmlspecialchars($record['address']);
            if ($record['locdetails']) {
                print ', ' . htmlspecialchars($record['locdetails']);
            }
            print '<br />';
            #description
            print htmlspecialchars($record['printdescr']);
            print '<br />';
            #contact
            $name = htmlspecialchars(ucwords($record["name"]));
            $email = $record["hideemail"] ? "" : htmlspecialchars($record["email"]);
            $email = mangleemail($email);
            $phone = $record["hidephone"] ? "" : htmlspecialchars($record["phone"]);
            $contact = $record["hidecontact"] ? "" : htmlspecialchars($record["contact"]);
            $weburl = $record["weburl"];
            $webname = $record["webname"];
            if ($webname == "" || $_REQUEST["p"] != "") {
                $webname = $weburl;
            }
            $webname = htmlspecialchars($webname);
            print "{$name}";
            if ($email) {
                print ", {$email}";
            }
            if ($phone) {
                print ", <a href=\"tel:{$phone}\">{$phone}</a>";
            }
            if ($contact) {
                print ", {$contact}";
            }
            if ($weburl) {
                print ", <a href=\"{$weburl}\">{$webname}</a>";
            }
            print '</div>';
            # class="detail"
            print '</div>';
            # class="event"
        }
    }
}
Пример #3
0
function fullentry($record)
{
    global $conn;
    global $imageover;
    # 24 hours ago.  We compare timestamps to this in order to
    # detect recently changed entries.
    $yesterday = date("Y-m-d H:i:s", strtotime("yesterday"));
    # extract info from the record
    $id = $record["id"];
    $title = htmlspecialchars(strtoupper($record["title"]));
    if ($record["eventstatus"] == "C") {
        $eventtime = "CANCELED";
        $eventduration = 0;
    } else {
        $eventtime = hmmpm($record["eventtime"]);
        $eventduration = $record["eventduration"];
    }
    $dayofmonth = substr($record["eventdate"], -2);
    $timedetails = $record["timedetails"];
    if ($record["audience"] == "F" && $record["area"] == "P") {
        $badge = "ff.gif";
        $badgealt = "FF";
        $badgehint = "Family Friendly";
    }
    if ($record["audience"] == "G" && $record["area"] == "P") {
        $badge = "";
        $badgealt = "";
        $badgehint = "";
    }
    if ($record["audience"] == "A" && $record["area"] == "P") {
        $badge = "beer.gif";
        $badgealt = "21+";
        $badgehint = "Adult Only (21+)";
    }
    if ($record["audience"] == "F" && $record["area"] == "V") {
        $badge = "ffwa.gif";
        $badgealt = "FF,WA";
        $badgehint = "Family Friendly, Meet in/around Vancouver";
    }
    if ($record["audience"] == "G" && $record["area"] == "V") {
        $badge = "washington.gif";
        $badgealt = "WA";
        $badgehint = "Meet in/around Vancouver";
    }
    if ($record["audience"] == "A" && $record["area"] == "V") {
        $badge = "beerwa.gif";
        $badgealt = "21+,WA";
        $badgehint = "Adult Only (21+), Meet in/around Vancouver";
    }
    $address = htmlspecialchars($record["address"]);
    if ($record["locname"]) {
        $address = htmlspecialchars($record["locname"]) . ", {$address}";
    }
    $locdetails = htmlspecialchars($record["locdetails"]);
    $descr = htmldescription($record["descr"]);
    $newsflash = htmlspecialchars($record["newsflash"]);
    $name = htmlspecialchars(ucwords($record["name"]));
    $email = $record["hideemail"] ? "" : htmlspecialchars($record["email"]);
    $email = mangleemail($email);
    $phone = $record["hidephone"] ? "" : htmlspecialchars($record["phone"]);
    $contact = $record["hidecontact"] ? "" : htmlspecialchars($record["contact"]);
    $weburl = $record["weburl"];
    $webname = $record["webname"];
    if ($webname == "" || array_key_exists('p', $_REQUEST)) {
        $webname = $weburl;
    }
    $webname = htmlspecialchars($webname);
    $forum = mysql_query("SELECT modified FROM calforum WHERE id={$id} ORDER BY modified DESC", $conn) or die(mysql_error());
    $forumimg = "images/forum.gif";
    $forumqty = mysql_num_rows($forum);
    $forumtitle = "{$forumqty} message" . ($forumqty == 1 ? "" : "s");
    if ($forumqty > 0) {
        $msg = mysql_fetch_array($forum);
        $msgmod = $msg["modified"];
        # Format the timestamp -- varies with SQL ver.
        if (strlen($msgmod) == 14) {
            # older MySQL uses YYYYMMDDhhmmss format
            $msgmod = substr($msgmod, 0, 4) . "-" . substr($msgmod, 4, 2) . "-" . substr($msgmod, 6, 2) . " " . substr($msgmod, 8, 2) . ":" . substr($msgmod, 10, 2) . ":" . substr($msgmod, 12, 2);
        }
        $forumtitle = "{$forumtitle}, newest " . substr($msgmod, 0, 10);
        if (strcmp($msgmod, $yesterday) > 0) {
            $forumimg = "images/forumflash.gif";
        }
    }
    # get the image info
    $image = "";
    if ($record["image"] && !isset($_REQUEST["i"])) {
        $t = pathinfo($record["image"]);
        $t = $t["extension"];
        $image = "eventimages/{$id}.{$t}";
        $imageheight = $record["imageheight"];
        $imagewidth = $record["imagewidth"];
        # Defend against obnoxiously wide banners or zero-height images.
        if ($imagewidth > 300) {
            $imageheight = $imageheight * 300 / $imagewidth;
            $imagewidth = 300;
        }
        if ($imageheight < 1) {
            $imagehight = 1;
        }
    }
    if ($eventtime == "CANCELED") {
        $style = "text-decoration: line-through;";
    } else {
        $style = "";
    }
    print "<dt style=\"{$style}\">";
    if ($image && $imageover <= 0 && $imageheight > RIGHTHEIGHT / 2) {
        if ($imageheight > RIGHTHEIGHT) {
            $imagewidth = $imagewidth * RIGHTHEIGHT / $imageheight;
            $imageheight = RIGHTHEIGHT;
        }
        print "\n<img src=\"{$image}\" height={$imageheight} width={$imagewidth} align=\"right\" alt=\"\">\n";
    }
    print "<a name=\"{$dayofmonth}-{$id}\" style=\"{$style}\">{$title}</a>\n";
    print "<a href=\"#{$dayofmonth}-{$id}\"><img border=0 src=\"images/chain.gif\" alt=\"Link\" title=\"Link to this event\"></a>\n";
    if (isset($_COOKIE['havemore']) && $_COOKIE['havemore'] == 'bikefun') {
        print "<a href=\"calform.php?edit=" . obscure($id) . "\"><img src=\"images/edit.gif\" alt=\"[edit]\" border=0></a>\n";
    }
    if ($badge != "") {
        print "<img align=left src=\"" . IMAGES . "/{$badge}\" alt=\"{$badgealt}\" title=\"{$badgehint}\">\n";
    }
    if ($image && ($imageover > 0 || $imageheight <= RIGHTHEIGHT / 2)) {
        if ($imageheight > LEFTHEIGHT) {
            $imagewidth = $imagewidth * LEFTHEIGHT / $imageheight;
            $imageheight = LEFTHEIGHT;
        }
        print "</dt><dd><img src=\"{$image}\" height={$imageheight} width={$imagewidth} align=\"left\" alt=\"\">\n";
    } else {
        print "</dt><dd>";
    }
    print "<div style=\"{$style}\">";
    if (TRUE || $record["addressverified"] == "Y") {
        #print '<a href="http://tripplanner.bycycle.org/?region=portlandor&q='.urlencode($record["address"]).'" target="_BLANK">'.$address.'</a>';
        print '<a href="http://maps.google.com/?bounds=45.389771,-122.829208|45.659647,-122.404175&q=' . urlencode($record["address"]) . '" target="_BLANK">' . $address . '</a>';
    } else {
        print $address;
    }
    if (!isset($_REQUEST['p']) || $_REQUEST['p'] == '') {
        print " <a href=\"" . trimeturl($record["eventdate"], $record["eventtime"], $record["address"]) . "\" target=\"_BLANK\" title=\"TriMet trip planner\"><img alt=\"Take Trimet\" src=\"images/trimetrose.gif\" border=0></a>";
    }
    if ($locdetails != "") {
        print " ({$locdetails})";
    }
    print "</div>\n";
    print "{$eventtime}";
    if ($eventtime == "CANCELED" && $newsflash != "") {
        print " <font color=magenta>{$newsflash}</font>";
    }
    if ($eventtime != "CANCELED") {
        if ($eventduration != 0) {
            print " - " . endtime($eventtime, $eventduration);
        }
        if ($timedetails != "") {
            print ", {$timedetails}";
        }
        if ($record["datestype"] == "C" || $record["datestype"] == "S") {
            print ", {$record[dates]}";
        }
    }
    print "<div style=\"{$style}\">\n";
    print "<em>{$descr}</em>\n";
    if ($newsflash != "" && $eventtime != "CANCELED") {
        print "<font color=magenta>{$newsflash}</font>";
    }
    print '<br>';
    if (strstr($name, '@')) {
        print mangleemail($name);
    } else {
        print $name;
    }
    if ($email != "") {
        print ", {$email}";
    }
    if ($weburl != "") {
        print ", <a href=\"{$weburl}\">{$webname}</a>";
    }
    if ($contact != "") {
        print ", " . mangleemail($contact);
    }
    if ($phone != "") {
        print ", {$phone}";
    }
    if (!isset($_REQUEST['p'])) {
        print "&nbsp;&nbsp;<a href=\"calforum.php?id={$id}\" title=\"{$forumtitle}\"><img border=0 src=\"{$forumimg}\" alt=\"[forum]\"></a>\n";
    }
    print "</div></dd>\n";
    # if this event has no image, then the next event's
    # image can be left-aligned.
    if ($image == "" || $imageover > 0 || $imageheight <= RIGHTHEIGHT / 2) {
        $imageover = 0;
    } else {
        $imageover = $imageheight - RIGHTHEIGHT / 2;
    }
}
Пример #4
0
}
?>
    <hr>
      <h2>Email mangler</h2>
	<form action="repeattest.php">
	  Email: <input type=text size=40 name="email" value="<?php 
print $_REQUEST["email"];
?>
">
	  <input type=submit>
	  <a href="calemail.html" target="_BLANK" onclick="window.open('explain/email.html', 'explain', 'width=600, height=500, menubar=no, status=no, location=no, toolbar=no, scrollbars=yes'); return false;">About email...</a>
	</form>
<?php 
if ($_REQUEST["email"]) {
    print "<h3>Results for '{$_REQUEST['email']}'</h3>\n";
    $mangled = mangleemail($_REQUEST["email"]);
    print "HTML: " . htmlspecialchars($mangled) . "<br>\n";
    print "Displayed as: {$mangled}\n";
}
?>
    <hr>
      <h2>ID obscurer</h2>
	Each event has a $id number.  This is public; e.g., it's used as the
	anchor number for each event's long description in the PP calendar.
	However, to edit an event you must pass an obscured version of the
	event number, via an edit=... parameter.  These functions convert
	between the number and obscured edit string.
        <p>
	<form id="obscurer" action="repeattest.php">
	  <table>
	    <tr>