⌈⌋ ⎇ branch:  freshcode


Check-in [41f5267633]

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

Overview
SHA1 Hash:41f526763361eb89c1a0054ae227370e65aab672
Date: 2014-12-07 21:18:08
User: mario
Comment:Add ->nl newline conversion, ->f_version filter, and url_user_icon() utilization (@github / @sourceforge / @launchpad), keep local part from email-style (gravatar/etc.) submitter if plain nick is absent, fix comparison to previous submitter name (else emptying `submitter_image`).
Tags And Properties
  • branch=trunk inherited from [82405bb421]
  • sym-trunk inherited from [82405bb421]
Context
2014-12-07
21:20
[54f1d36a8c] Document new gravatar/identicon options @github / @sourceforge / @launchpad. (user: mario, tags: trunk)
21:18
[41f5267633] Add ->nl newline conversion, ->f_version filter, and url_user_icon() utilization (@github / @sourceforge / @launchpad), keep local part from email-style (gravatar/etc.) submitter if plain nick is absent, fix comparison to previous submitter name (else emptying `submitter_image`). (user: mario, tags: trunk)
21:15
[3788dc5e44] Introduce `f_version()` filter to compact spaces, and strip leading "v". Complexer `url_user_icon()` to convert @github, @sourceforge and @launchpad user names to gravatar/user images. (user: mario, tags: trunk)
Changes

Changes to release.php.

82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
...
166
167
168
169
170
171
172
173
174
175
176

177
178
179
180
181
182
183
184
185
186
        $newdata = array(
                 "name"     => $newdata->proj_name         ->length…3…33["name"],
                 "homepage" => $newdata->ascii->trim->http  ->length…250["homepage"],
                 "download" => $newdata->ascii->trim->url   ->length…250["download"],
                 "image"    => $newdata->ascii->trim->http  ->length…250["image"],
           "autoupdate_url" => $newdata->ascii->trim->http  ->length…250["autoupdate_url"],
                 "title"    => $newdata->text               ->length…100["title"],
              "description" => $newdata                    ->length…2000["description"],
                 "license"  => $newdata->words               ->length…30["license"],
                 "tags"     => $newdata->words->f_tags      ->length…150["tags"],
                 "version"  => $newdata->words               ->length…30["version"],
                 "state"    => $newdata->words->strtolower   ->length…30["state"],
                 "scope"    => $newdata->words->strtolower   ->length…30["scope"],
                 "changes"  => $newdata->text              ->length…2000["changes"],
                "submitter" => $newdata->text               ->length…100["submitter"],
                 "urls"     => $newdata->has_urls          ->length…2000["urls"],
                 "lock"     => $newdata->raw               ->length…2000["lock"],
        "autoupdate_module" => $newdata->id                  ->length…30["autoupdate_module"],
         "autoupdate_regex" => $newdata->raw               ->length…2000["autoupdate_regex"],
        );

        // Base data for version/t_published lookup, in case we only got partial $newdata
        $name = $newdata["name"] ?: $this["name"];
        $version = in_array("version", $newkeys) ? $newdata["version"] : $this["version"];

        // Declare some automatic system flags
................................................................................
     * in particular the email out of `submitter`.
     *
     */
    function unpack(&$newdata) {

        // extract new img@gravatar
        if (!empty($newdata["submitter"]) and is_int(strpos($newdata["submitter"], "@"))
        and preg_match($rx = "/[^,;\s]+@[^,;\s]+/", $newdata["submitter"], $match))
        {
            $newdata["submitter_image"] = $match[0];
            $newdata["submitter"] = trim(preg_replace($rx, "", $newdata["submitter"]), ", ");

        }
        // empty any previous _image data
        elseif (!empty($this["submitter"]) and strnatcasecmp($this["submitter"], $newdata["submitter"])) {
            $newdata["submitter_image"] = "";
        }
    }


    /**
     * Retrieve latest published release version.







|


|


|




|







 







|

|
|
>

|
|







82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
...
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
        $newdata = array(
                 "name"     => $newdata->proj_name         ->length…3…33["name"],
                 "homepage" => $newdata->ascii->trim->http  ->length…250["homepage"],
                 "download" => $newdata->ascii->trim->url   ->length…250["download"],
                 "image"    => $newdata->ascii->trim->http  ->length…250["image"],
           "autoupdate_url" => $newdata->ascii->trim->http  ->length…250["autoupdate_url"],
                 "title"    => $newdata->text               ->length…100["title"],
              "description" => $newdata->nl                ->length…2000["description"],
                 "license"  => $newdata->words               ->length…30["license"],
                 "tags"     => $newdata->words->f_tags      ->length…150["tags"],
                 "version"  => $newdata->f_version           ->length…30["version"],
                 "state"    => $newdata->words->strtolower   ->length…30["state"],
                 "scope"    => $newdata->words->strtolower   ->length…30["scope"],
                 "changes"  => $newdata->text->nl          ->length…2000["changes"],
                "submitter" => $newdata->text               ->length…100["submitter"],
                 "urls"     => $newdata->has_urls          ->length…2000["urls"],
                 "lock"     => $newdata->raw               ->length…2000["lock"],
        "autoupdate_module" => $newdata->id                  ->length…30["autoupdate_module"],
         "autoupdate_regex" => $newdata->raw->nl           ->length…2000["autoupdate_regex"],
        );

        // Base data for version/t_published lookup, in case we only got partial $newdata
        $name = $newdata["name"] ?: $this["name"];
        $version = in_array("version", $newkeys) ? $newdata["version"] : $this["version"];

        // Declare some automatic system flags
................................................................................
     * in particular the email out of `submitter`.
     *
     */
    function unpack(&$newdata) {

        // extract new img@gravatar
        if (!empty($newdata["submitter"]) and is_int(strpos($newdata["submitter"], "@"))
        and preg_match($rx = "/([^,;\s]+)@[^,;\s]+/", $newdata["submitter"], $match))
        {
            $newdata["submitter_image"] = url_user_icon($match[0]);
            $newdata["submitter"] = trim(preg_replace($rx, "", $newdata["submitter"]), ", ")
            or $newdata["submitter"] = strtok($match[0], "+@");
        }
        // if name was changed, empty any previous _image data
        elseif (!empty($this["submitter"]) and soundex($this["submitter"]) != soundex($newdata["submitter"])) {
            $newdata["submitter_image"] = "";
        }
    }


    /**
     * Retrieve latest published release version.