⌈⌋ branch:  freshcode


Check-in [a2cad88cbe]

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

Overview
SHA1 Hash:a2cad88cbe7c3fcd381828198f6b5066dc3ec73d
Date: 2014-12-19 22:46:45
User: mario
Comment:Compare search term also against plain project `name`.
Tags And Properties
  • branch=trunk inherited from [82405bb421]
  • sym-trunk inherited from [82405bb421]
Context
2014-12-23
05:06
[fa55b2f072] Text: clear up that CC-BY-SA only covers the project description/text, not the project itself (user: mario, tags: trunk)
2014-12-19
22:46
[a2cad88cbe] Compare search term also against plain project `name`. (user: mario, tags: trunk)
2014-12-07
21:21
[9a076b186e] UI-tag as 0.7.7 (user: mario, tags: trunk)
Changes

Changes to page_search.php.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
..
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64

65
66
67
68
69
70
71
<?php
/**
 * type: page
 * title: Search function
 * description: Scans packages for description, tags, license, user names
 * license: AGPL
 * version 0.2
 * 
 * Builds a search query from multiple input params:
 *   → ?user=
 *   → ?tags[]= or ?tag=
 *   → ?trove[]= for ANDed tags
 *   → ?license=
 *   → ?q= for actual text search
................................................................................
               version, image, homepage, download, submitter, submitter_image,
               release.tags AS tags, scope, changes,
               license, state, t_published, flag, hidden, deleted, MAX(t_changed)
          FROM release
         WHERE NOT deleted AND flag < 5
      GROUP BY release.name
        HAVING 1=1
               :*  :*  :*  :*  :*  :*
      ORDER BY t_published DESC, t_changed DESC
         LIMIT 100 ",
            // expr :* placeholders only interpolate when inner array contains params
            [" AND description LIKE ? ",  $search],
            [" AND submitter LIKE ? ", $user],
            [" AND license IN (??) ",   $license],
            [" AND name IN (SELECT name FROM tags WHERE tag IN (??)) ", $tags],
            [" AND name IN (SELECT name FROM tags WHERE tag IN (??)
               GROUP BY name HAVING COUNT(tag) = 1*?) ", $trove],
            // project name == tags

            [" OR name IN (??)", $tags]
    );



    // Show sidebar + long project description
    foreach ($result as $entry) {






|







 







|










>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
..
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<?php
/**
 * type: page
 * title: Search function
 * description: Scans packages for description, tags, license, user names
 * license: AGPL
 * version 0.2.2
 * 
 * Builds a search query from multiple input params:
 *   → ?user=
 *   → ?tags[]= or ?tag=
 *   → ?trove[]= for ANDed tags
 *   → ?license=
 *   → ?q= for actual text search
................................................................................
               version, image, homepage, download, submitter, submitter_image,
               release.tags AS tags, scope, changes,
               license, state, t_published, flag, hidden, deleted, MAX(t_changed)
          FROM release
         WHERE NOT deleted AND flag < 5
      GROUP BY release.name
        HAVING 1=1
               :* :*  :*  :*  :*  :*  :*
      ORDER BY t_published DESC, t_changed DESC
         LIMIT 100 ",
            // expr :* placeholders only interpolate when inner array contains params
            [" AND description LIKE ? ",  $search],
            [" AND submitter LIKE ? ", $user],
            [" AND license IN (??) ",   $license],
            [" AND name IN (SELECT name FROM tags WHERE tag IN (??)) ", $tags],
            [" AND name IN (SELECT name FROM tags WHERE tag IN (??)
               GROUP BY name HAVING COUNT(tag) = 1*?) ", $trove],
            // project name == tags
            [" OR name LIKE ? ",  $search],
            [" OR name IN (??)", $tags]
    );



    // Show sidebar + long project description
    foreach ($result as $entry) {