2
2
$ per_page = 25 ;
3
3
$ show_ua = @preg_replace ('/[^10]/ ' , '' , $ _GET ['ua ' ]) ?: '0 ' ;
4
4
$ search = @preg_replace ('/[^-a-zA-Z0-9 ]/ ' , '' , $ _GET ['search ' ]);
5
- $ filter = @preg_replace ('/[^-a-zA-Z0-9_]/ ' , '' , $ _GET ['filter ' ] );
5
+ $ filter_tag = strtolower ( @preg_replace ('/[^-a-zA-Z0-9_]/ ' , '' , $ _GET ['filter_tag ' ]) );
6
6
if (isset ($ _GET ['p ' ])){
7
7
$ page = @preg_replace ('/[^0-9]/ ' , '' , $ _GET ['p ' ]);
8
8
}else {
48
48
if ($ cog ['rx_category ' ] == 'unapproved ' && $ show_ua !== "1 " ){ continue ; }
49
49
if (count ($ cog ['author ' ]) == 0 ){ continue ; } # ghost entries
50
50
foreach ($ cog ['tags ' ] as $ index => $ this_tag ){$ cog ['tags ' ][$ index ] = strtolower ($ this_tag );}
51
- if ($ filter && !in_array (strtolower ( $ filter ) , $ cog ['tags ' ])){ continue ; }
51
+ if ($ filter_tag && !in_array ($ filter_tag , $ cog ['tags ' ])){ continue ; }
52
52
if ($ search ){
53
53
$ matched = FALSE ;
54
54
if (stripos (strtolower ($ cog ['id ' ]), strtolower ($ search )) !== false ){ $ matched = TRUE ; } else
@@ -95,9 +95,9 @@ function byName($a,$b){ return ($a['id'] <= $b['id']) ? -1 : 1;}
95
95
<svg class="icon" viewBox="0 0 20 20">
96
96
<path d="M12.323,2.398c-0.741-0.312-1.523-0.472-2.319-0.472c-2.394,0-4.544,1.423-5.476,3.625C3.907,7.013,3.896,8.629,4.49,10.102c0.528,1.304,1.494,2.333,2.72,2.99L5.467,17.33c-0.113,0.273,0.018,0.59,0.292,0.703c0.068,0.027,0.137,0.041,0.206,0.041c0.211,0,0.412-0.127,0.498-0.334l1.74-4.23c0.583,0.186,1.18,0.309,1.795,0.309c2.394,0,4.544-1.424,5.478-3.629C16.755,7.173,15.342,3.68,12.323,2.398z M14.488,9.77c-0.769,1.807-2.529,2.975-4.49,2.975c-0.651,0-1.291-0.131-1.897-0.387c-0.002-0.004-0.002-0.004-0.002-0.004c-0.003,0-0.003,0-0.003,0s0,0,0,0c-1.195-0.508-2.121-1.452-2.607-2.656c-0.489-1.205-0.477-2.53,0.03-3.727c0.764-1.805,2.525-2.969,4.487-2.969c0.651,0,1.292,0.129,1.898,0.386C14.374,4.438,15.533,7.3,14.488,9.77z"></path>
97
97
</svg>
98
- <input type="text" name="search" placeholder="Search <?php print (count ($ cogs )); if ($ filter ){print (' ' . $ filter );}?> cogs..." value="<?php print ($ search );?> " />
98
+ <input type="text" name="search" placeholder="Search <?php print (count ($ cogs )); if ($ filter_tag ){print (' ' . $ filter_tag );}?> cogs..." value="<?php print ($ search );?> " />
99
99
<input type="hidden" name="ua" value="<?php print ($ show_ua ); ?> " />
100
- <input type="hidden" name="filter " value="<?php print ($ filter ); ?> " />
100
+ <input type="hidden" name="filter_tag " value="<?php print ($ filter_tag ); ?> " />
101
101
<button class="submit">
102
102
<svg class="icon" viewBox="0 0 20 20">
103
103
<path d="M14.989,9.491L6.071,0.537C5.78,0.246,5.308,0.244,5.017,0.535c-0.294,0.29-0.294,0.763-0.003,1.054l8.394,8.428L5.014,18.41c-0.291,0.291-0.291,0.763,0,1.054c0.146,0.146,0.335,0.218,0.527,0.218c0.19,0,0.382-0.073,0.527-0.218l8.918-8.919C15.277,10.254,15.277,9.784,14.989,9.491z"></path>
@@ -109,7 +109,7 @@ function byName($a,$b){ return ($a['id'] <= $b['id']) ? -1 : 1;}
109
109
<div class="ua-warning">The content of unapproved repositories has not been vetted by QA<br>Safety is not guaranteed. Use at your own risk</div>
110
110
<?php } ?>
111
111
<div class="filters">
112
- <box <?php if ($ show_ua === '1 ' ){?> href="?filter =<?php print ($ filter );?> &search=<?php print ($ search ); ?> &ua=0"<?php }else {?> show-model="uadisclaim"<?php } ?> ><svg class="icon" viewBox="0 0 20 20">
112
+ <box <?php if ($ show_ua === '1 ' ){?> href="?filter_tag =<?php print ($ filter_tag );?> &search=<?php print ($ search ); ?> &ua=0"<?php }else {?> show-model="uadisclaim"<?php } ?> ><svg class="icon" viewBox="0 0 20 20">
113
113
<?php if ($ show_ua === '1 ' ){ ?>
114
114
<path fill-rule="evenodd" d="M2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2zm10.03 4.97a.75.75 0 0 0-1.08.022L7.477 9.417 5.384 7.323a.75.75 0 0 0-1.06 1.06L6.97 11.03a.75.75 0 0 0 1.079-.02l3.992-4.99a.75.75 0 0 0-.01-1.05z"></path>
115
115
<?php }else { ?>
@@ -122,7 +122,7 @@ function byName($a,$b){ return ($a['id'] <= $b['id']) ? -1 : 1;}
122
122
<h><svg class="icon" viewBox="0 0 20 23">
123
123
<path d="M18.344,16.174l-7.98-12.856c-0.172-0.288-0.586-0.288-0.758,0L1.627,16.217c0.339-0.543-0.603,0.668,0.384,0.682h15.991C18.893,16.891,18.167,15.961,18.344,16.174 M2.789,16.008l7.196-11.6l7.224,11.6H2.789z M10.455,7.552v3.561c0,0.244-0.199,0.445-0.443,0.445s-0.443-0.201-0.443-0.445V7.552c0-0.245,0.199-0.445,0.443-0.445S10.455,7.307,10.455,7.552M10.012,12.439c-0.733,0-1.33,0.6-1.33,1.336s0.597,1.336,1.33,1.336c0.734,0,1.33-0.6,1.33-1.336S10.746,12.439,10.012,12.439M10.012,14.221c-0.244,0-0.443-0.199-0.443-0.445c0-0.244,0.199-0.445,0.443-0.445s0.443,0.201,0.443,0.445C10.455,14.021,10.256,14.221,10.012,14.221"></path></svg>Warning: Use at your own risk!</h>
124
124
<t>Unapproved repositories are provided by the community and have not yet been inspected for security or tested for stability. The Cog-Creators organization and Red's contributors are not responsible for any damage caused by 3rd party cogs.</t>
125
- <f><button hide-model="true">Nevermind</button><button class="right red" href="?filter =<?php print ($ filter );?> &search=<?php print ($ search ); ?> &ua=1">I understand and accept the risks</button></f>
125
+ <f><button hide-model="true">Nevermind</button><button class="right red" href="?filter_tag =<?php print ($ filter_tag );?> &search=<?php print ($ search ); ?> &ua=1">I understand and accept the risks</button></f>
126
126
</div>
127
127
<?php if (!isset ($ cog_chunks [$ page - 1 ])){ ?>
128
128
<div>
@@ -148,12 +148,12 @@ function byName($a,$b){ return ($a['id'] <= $b['id']) ? -1 : 1;}
148
148
<t><svg class="icon" viewBox="0 0 16 19">
149
149
<path fill-rule="evenodd" d="M0 6a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V6zm13 .25a.25.25 0 0 1 .25-.25h.5a.25.25 0 0 1 .25.25v.5a.25.25 0 0 1-.25.25h-.5a.25.25 0 0 1-.25-.25v-.5zM2.25 8a.25.25 0 0 0-.25.25v.5c0 .138.112.25.25.25h.5A.25.25 0 0 0 3 8.75v-.5A.25.25 0 0 0 2.75 8h-.5zM4 8.25A.25.25 0 0 1 4.25 8h.5a.25.25 0 0 1 .25.25v.5a.25.25 0 0 1-.25.25h-.5A.25.25 0 0 1 4 8.75v-.5zM6.25 8a.25.25 0 0 0-.25.25v.5c0 .138.112.25.25.25h.5A.25.25 0 0 0 7 8.75v-.5A.25.25 0 0 0 6.75 8h-.5zM8 8.25A.25.25 0 0 1 8.25 8h.5a.25.25 0 0 1 .25.25v.5a.25.25 0 0 1-.25.25h-.5A.25.25 0 0 1 8 8.75v-.5zM13.25 8a.25.25 0 0 0-.25.25v.5c0 .138.112.25.25.25h.5a.25.25 0 0 0 .25-.25v-.5a.25.25 0 0 0-.25-.25h-.5zm0 2a.25.25 0 0 0-.25.25v.5c0 .138.112.25.25.25h.5a.25.25 0 0 0 .25-.25v-.5a.25.25 0 0 0-.25-.25h-.5zm-3-2a.25.25 0 0 0-.25.25v.5c0 .138.112.25.25.25h1.5a.25.25 0 0 0 .25-.25v-.5a.25.25 0 0 0-.25-.25h-1.5zm.75 2.25a.25.25 0 0 1 .25-.25h.5a.25.25 0 0 1 .25.25v.5a.25.25 0 0 1-.25.25h-.5a.25.25 0 0 1-.25-.25v-.5zM11.25 6a.25.25 0 0 0-.25.25v.5c0 .138.112.25.25.25h.5a.25.25 0 0 0 .25-.25v-.5a.25.25 0 0 0-.25-.25h-.5zM9 6.25A.25.25 0 0 1 9.25 6h.5a.25.25 0 0 1 .25.25v.5a.25.25 0 0 1-.25.25h-.5A.25.25 0 0 1 9 6.75v-.5zM7.25 6a.25.25 0 0 0-.25.25v.5c0 .138.112.25.25.25h.5A.25.25 0 0 0 8 6.75v-.5A.25.25 0 0 0 7.75 6h-.5zM5 6.25A.25.25 0 0 1 5.25 6h.5a.25.25 0 0 1 .25.25v.5a.25.25 0 0 1-.25.25h-.5A.25.25 0 0 1 5 6.75v-.5zM2.25 6a.25.25 0 0 0-.25.25v.5c0 .138.112.25.25.25h1.5A.25.25 0 0 0 4 6.75v-.5A.25.25 0 0 0 3.75 6h-1.5zM2 10.25a.25.25 0 0 1 .25-.25h.5a.25.25 0 0 1 .25.25v.5a.25.25 0 0 1-.25.25h-.5a.25.25 0 0 1-.25-.25v-.5zM4.25 10a.25.25 0 0 0-.25.25v.5c0 .138.112.25.25.25h5.5a.25.25 0 0 0 .25-.25v-.5a.25.25 0 0 0-.25-.25h-5.5z"></path>
150
150
</svg><b>Installation commands</b><l>repo add <?php print (strtolower ($ cog ['source_name ' ])); ?> <?php print ($ cog ['source ' ]);?> <?php print ($ cog ['rx_branch ' ]);?> </l><l>cog install <?php print (strtolower ($ cog ['source_name ' ])); ?> <?php print ($ cog ['id ' ]); ?> </l></t>
151
- <f><?php sort ($ cog ['tags ' ]);foreach ($ cog ['tags ' ] as $ tag ){?> <tag href="?filter =<?php print ($ tag ); ?> &search=<?php print ($ search ); ?> &ua=<?php print ($ show_ua ); ?> "><?php print ($ tag ); ?> </tag><?php }?> <a class="src-link" href="<?php print ($ cog ['source ' ]);?> ">View Repository</a></f>
151
+ <f><?php sort ($ cog ['tags ' ]);foreach ($ cog ['tags ' ] as $ tag ){?> <tag href="?filter_tag =<?php print ($ tag ); ?> &search=<?php print ($ search ); ?> &ua=<?php print ($ show_ua ); ?> "><?php print ($ tag ); ?> </tag><?php }?> <a class="src-link" href="<?php print ($ cog ['source ' ]);?> ">View Repository</a></f>
152
152
</div>
153
153
<?php }} ?>
154
154
</div>
155
155
<div class="nav bottom">
156
- <a class="left <?php if ($ page <= 1 ){?> hidden<?php }?> " href="?p=<?php print ($ page - 1 );?> &filter =<?php print ($ filter );?> &search=<?php print ($ search ); ?> &ua=<?php print ($ show_ua );?> ">
156
+ <a class="left <?php if ($ page <= 1 ){?> hidden<?php }?> " href="?p=<?php print ($ page - 1 );?> &filter_tag =<?php print ($ filter_tag );?> &search=<?php print ($ search ); ?> &ua=<?php print ($ show_ua );?> ">
157
157
<svg class="icon" viewBox="0 0 20 20">
158
158
<path d="M18.271,9.212H3.615l4.184-4.184c0.306-0.306,0.306-0.801,0-1.107c-0.306-0.306-0.801-0.306-1.107,0
159
159
L1.21,9.403C1.194,9.417,1.174,9.421,1.158,9.437c-0.181,0.181-0.242,0.425-0.209,0.66c0.005,0.038,0.012,0.071,0.022,0.109
@@ -167,7 +167,7 @@ function byName($a,$b){ return ($a['id'] <= $b['id']) ? -1 : 1;}
167
167
<page>Page <?php print ($ page );?> of <?php print (count ($ cog_chunks )); ?> </page>
168
168
<?php } ?>
169
169
170
- <a class="right <?php if (count ($ cog_chunks ) <= $ page ){?> hidden<?php }?> " href="?p=<?php print ($ page + 1 );?> &filter =<?php print ($ filter );?> &search=<?php print ($ search ); ?> &ua=<?php print ($ show_ua );?> ">
170
+ <a class="right <?php if (count ($ cog_chunks ) <= $ page ){?> hidden<?php }?> " href="?p=<?php print ($ page + 1 );?> &filter_tag =<?php print ($ filter_tag );?> &search=<?php print ($ search ); ?> &ua=<?php print ($ show_ua );?> ">
171
171
Next
172
172
<svg class="icon" viewBox="0 0 20 20">
173
173
<path d="M1.729,9.212h14.656l-4.184-4.184c-0.307-0.306-0.307-0.801,0-1.107c0.305-0.306,0.801-0.306,1.106,0
0 commit comments