2 .advancedcontentfilter-content-wrapper {
3 min-height: calc(100vh - 150px);
8 /*background-color: #fff;*/
9 background-color: rgba(255,255,255,0.95);
14 box-shadow: 0 0 3px #dadada;
15 -webkit-box-shadow: 0 0 3px #dadada;
16 -moz-box-shadow: 0 0 3px #dadada;
20 <a href="advancedcontentfilter">🔙 Back to Advanced Content Filter Settings</a>
22 # Advanced Content Filter Help
24 The advanced Content Filter uses Symfony's Expression Language.
25 This help page includes a summary of [the Symfony's Expression Language documentation page.](https://symfony.com/doc/current/components/expression_language/syntax.html)
29 The advanced content filter matches each post that is about to be displayed against each enabled rule you set.
31 A rule is a boolean expression that should return either `true` or `false` depending on post variables.
33 If the expression using a post variables returns `true`, the post will be collapsed and the matching rule name will be displayed above the collapsed content.
35 A post will be collapsed if at least one rule matches, but all matching rule names will be displayed above the collapsed content.
39 1. To block specific domains `body matches "/\\.example\\.com/"`
40 2. To block everything that contains the words `body matches "/Guten Morgen/"`
41 3. To block every occurence of the word facebook with a space in front and after the word `body matches "//s facebook/s /"`
42 4. To colapse every post that contains more than 1 image `body matches "/(?:(?:(?:\\[url(?:=.*)?\\])?\\[img(?:=.*)?\\].*\\[\\/img\\]\\s*(?:\\[\\/url\\])?)\\s*){2}/"`
47 ### Supported Literals
49 - **strings** - single and double quotes (e.g. `'hello'`).
50 - **numbers** - e.g. `103`.
51 - **arrays** - using JSON-like notation (e.g. `[1, 2]`).
52 - **hashes** - using JSON-like notation (e.g. `{ foo: 'bar' }`).
53 - **booleans** - `true` and `false`.
56 A backslash (``\``) must be escaped by 2 backslashes (``\\``) in a string and 4 backslashes (``\\\\``) in a regex::
58 `"a\\b" matches "/^a\\\\b$/"`
60 Control characters (e.g. ``\n``) in expressions are replaced with whitespace. To avoid this, escape the sequence with a single backslash (e.g. ``\\n``).
62 ### Supported Operators
64 The component comes with a lot of operators:
66 #### Arithmetic Operators
70 * ``*`` (multiplication)
75 #### Bitwise Operators
81 #### Comparison Operators
86 * ``!==`` (not identical)
88 * ``>`` (greater than)
89 * ``<=`` (less than or equal to)
90 * ``>=`` (greater than or equal to)
91 * ``matches`` (regex match)
93 To test if a string does *not* match a regex, use the logical ``not`` operator in combination with the ``matches`` operator:
95 `not ("foo" matches "/bar/")`
97 You must use parenthesis because the unary operator ``not`` has precedence over the binary operator ``matches``.
99 #### Logical Operators
105 #### String Operators
107 * ``~`` (concatenation)
109 For example: ``firstName ~ " " ~ lastName``
114 * ``not in`` (does not contain)
116 For example: ``user.group in ["human_resources", "marketing"]``
118 #### Numeric Operators
122 For example: ``user.age in 18..45``
124 #### Ternary Operators
126 * ``foo ? 'yes' : 'no'``
127 * ``foo ?: 'no'`` (equal to ``foo ? foo : 'no'``)
128 * ``foo ? 'yes'`` (equal to ``foo ? 'yes' : ''``)
130 ### Supported variables
132 Here are a sample of the available variables you can use in your expressions.
133 You can also retrieve the variables of a specific post by pasting its URL below the rule list.
135 <table class="table-bordered table-condensed table-striped">
140 <th>Sample Value</th>
152 <td>https://friendica.mrpetovan.com/profile/hypolite</td>
157 <td>Hypolite Petovan</td>
160 <th>author_avatar</th>
162 <td>https://friendica.mrpetovan.com/photo/41084997915a94a8c83cc39708500207-5.png</td>
172 <td>https://friendica.mrpetovan.com/profile/hypolite</td>
177 <td>Hypolite Petovan</td>
180 <th>owner_avatar</th>
182 <td>https://friendica.mrpetovan.com/photo/41084997915a94a8c83cc39708500207-5.png</td>
207 <td>urn:X-dfrn:friendica.mrpetovan.com:1:twit:978740198937907200</td>
212 <td>urn:X-dfrn:friendica.mrpetovan.com:1:twit:978740198937907200</td>
217 <td>urn:X-dfrn:friendica.mrpetovan.com:1:twit:978740198937907200</td>
220 <th>content_warning</th>
227 <td>2018-03-27 21:10:18</td>
232 <td>2018-03-27 21:10:18</td>
237 <td>2018-03-27 21:10:18</td>
242 <td>2018-03-27 21:10:18</td>
247 <td>http://activitystrea.ms/schema/1.0/post</td>
252 <td>http://activitystrea.ms/schema/1.0/bookmark</td>
257 <td>twitter&lang=pidgin;0.24032407407407:english;0.225:french;0.18055555555556</td>
262 <td>https://friendica.mrpetovan.com/display/735a2029995abab33a5c006052376776</td>
267 <td>735a2029995abab33a5c006052376776</td>
292 <td>Over-compensation #[url=https://friendica.mrpetovan.com/search?tag=Street]Street[/url] #[url=https://friendica.mrpetovan.com/search?tag=Night]Night[/url] #[url=https://friendica.mrpetovan.com/search?tag=CarLights]CarLights[/url] #[url=https://friendica.mrpetovan.com/search?tag=Jeep]Jeep[/url] #[url=https://friendica.mrpetovan.com/search?tag=NoPeople]NoPeople[/url] #[url=https://friendica.mrpetovan.com/search?tag=Close]Close[/url]-up
293 [attachment type='link' url='https://www.eyeem.com/p/120800309' title='Over-compensation Street Night Car Lights Jeep No | EyeEm' image='https://cdn.eyeem.com/thumb/b2f019738cbeef06e2f8c9517c6286a8adcd3a00-1522184820641/640/480']Photo by @[url=https://twitter.com/MrPetovan]MrPetovan[/url][/attachment]</td>
325 <th>rendered_hash</th>
327 <td>b70abdea8b362dc5dcf63e1b2836ad89</td>
330 <th>rendered_html</th>
333 Over-compensation #<a href="https://friendica.mrpetovan.com/search?tag=Street" class="tag" title="Street">Street</a> #<a href="https://friendica.mrpetovan.com/search?tag=Night" class="tag" title="Night">Night</a> #<a href="https://friendica.mrpetovan.com/search?tag=CarLights" class="tag" title="CarLights">CarLights</a> #<a href="https://friendica.mrpetovan.com/search?tag=Jeep" class="tag" title="Jeep">Jeep</a> #<a href="https://friendica.mrpetovan.com/search?tag=NoPeople" class="tag" title="NoPeople">NoPeople</a> #<a href="https://friendica.mrpetovan.com/search?tag=Close" class="tag" title="Close">Close</a>-up <div class="type-link"><a href="https://www.eyeem.com/p/120800309" target="_blank" rel="noopener noreferrer"><img src="https://friendica.mrpetovan.com/proxy/bb/aHR0cHM6Ly9jZG4uZXllZW0uY29tL3RodW1iL2IyZjAxOTczOGNiZWVmMDZlMmY4Yzk1MTdjNjI4NmE4YWRjZDNhMDAtMTUyMjE4NDgyMDY0MS82NDAvNDgw" alt="" title="Over-compensation Street Night Car Lights Jeep No | EyeEm" class="attachment-image"></a><br><h4><a href="https://www.eyeem.com/p/120800309">Over-compensation Street Night Car Lights Jeep No | EyeEm</a></h4><blockquote>Photo by @<a href="https://twitter.com/MrPetovan" class="userinfo mention" title="MrPetovan">MrPetovan</a></blockquote><sup><a href="https://www.eyeem.com/p/120800309">www.eyeem.com</a></sup></div>
339 <td>{"created_at":"Tue Mar 27 21:07:02 +0000 2018","id":978740198937907200,"id_str":"978740198937907200","full_text":"Over-compensation #Street #Night #CarLights #Jeep #NoPeople #Close-up https:\/\/t.co\/7w4ua13QA7","truncated":false,"display_text_range":[0,93],"entities":{"hashtags":[{"text":"Street","indices":[18,25]},{"text":"Night","indices":[26,32]},{"text":"CarLights","indices":[33,43]},{"text":"Jeep","indices":[44,49]},{"text":"NoPeople","indices":[50,59]},{"text":"Close","indices":[60,66]}],"symbols":[],"user_mentions":[],"urls":[{"url":"https:\/\/t.co\/7w4ua13QA7","expanded_url":"http:\/\/EyeEm.com\/p\/120800309","display_url":"EyeEm.com\/p\/120800309","indices":[70,93]}]},"source":"<a href=\"http:\/\/www.eyeem.com\" rel=\"nofollow\">EyeEm<\/a>","in_reply_to_status_id":null,"in_reply_to_status_id_str":null,"in_reply_to_user_id":null,"in_reply_to_user_id_str":null,"in_reply_to_screen_name":null,"user":{"id":403748896,"id_str":"403748896","name":"\ud83d\udc30yp\ud83e\udd5ali\u271d\ufe0fe Pet\ud83e\udd5avan","screen_name":"MrPetovan","location":"NYC","description":"White male form of milquetoast. Avatar by @DearMsDear inspired by @TSG_LAB.\n\nFriendica\/Diaspora\/Mastodon: hypolite@friendica.mrpetovan.com","url":"https:\/\/t.co\/PcARi5OhQO","entities":{"url":{"urls":[{"url":"https:\/\/t.co\/PcARi5OhQO","expanded_url":"https:\/\/mrpetovan.com","display_url":"mrpetovan.com","indices":[0,23]}]},"description":{"urls":[]}},"protected":false,"followers_count":182,"friends_count":146,"listed_count":15,"created_at":"Wed Nov 02 23:13:14 +0000 2011","favourites_count":45826,"utc_offset":-14400,"time_zone":"Eastern Time (US & Canada)","geo_enabled":false,"verified":false,"statuses_count":15554,"lang":"en","contributors_enabled":false,"is_translator":false,"is_translation_enabled":false,"profile_background_color":"000000","profile_background_image_url":"http:\/\/pbs.twimg.com\/profile_background_images\/370213187\/fond_twitter_mrpetovan.png","profile_background_image_url_https":"https:\/\/pbs.twimg.com\/profile_background_images\/370213187\/fond_twitter_mrpetovan.png","profile_background_tile":false,"profile_image_url":"http:\/\/pbs.twimg.com\/profile_images\/968008546322395136\/6qLCiu0o_normal.jpg","profile_image_url_https":"https:\/\/pbs.twimg.com\/profile_images\/968008546322395136\/6qLCiu0o_normal.jpg","profile_banner_url":"https:\/\/pbs.twimg.com\/profile_banners\/403748896\/1464321684","profile_link_color":"0084B4","profile_sidebar_border_color":"C0DEED","profile_sidebar_fill_color":"DDEEF6","profile_text_color":"000000","profile_use_background_image":true,"has_extended_profile":true,"default_profile":false,"default_profile_image":false,"following":false,"follow_request_sent":false,"notifications":false,"translator_type":"none"},"geo":null,"coordinates":null,"place":null,"contributors":null,"is_quote_status":false,"retweet_count":0,"favorite_count":0,"favorited":false,"retweeted":false,"possibly_sensitive":false,"lang":"en"}</td>
367 <th>item_network</th>
372 <th>author_thumb</th>
374 <td>https://friendica.mrpetovan.com/photo/0cb3d7231eb751139d7d309c7c686c49-5.png?ts=1522941604</td>
379 <td>https://friendica.mrpetovan.com/photo/0cb3d7231eb751139d7d309c7c686c49-5.png?ts=1522941604</td>
389 <td>https://friendica.mrpetovan.com/profile/hypolite</td>
394 <td>Hypolite Petovan</td>
417 <th>event_created</th>
422 <th>event_edited</th>
432 <th>event_finish</th>
437 <th>event_summary</th>
447 <th>event_location</th>
457 <th>event_nofinish</th>
462 <th>event_adjust</th>
467 <th>event_ignore</th>
481 <li>#<a href="https://friendica.mrpetovan.com/search?tag=Street" target="_blank" rel="noopener noreferrer">street</a></li>
482 <li>#<a href="https://friendica.mrpetovan.com/search?tag=Night" target="_blank" rel="noopener noreferrer">night</a></li>
483 <li>#<a href="https://friendica.mrpetovan.com/search?tag=CarLights" target="_blank" rel="noopener noreferrer">carlights</a></li>
484 <li>#<a href="https://friendica.mrpetovan.com/search?tag=Jeep" target="_blank" rel="noopener noreferrer">jeep</a></li>
485 <li>#<a href="https://friendica.mrpetovan.com/search?tag=NoPeople" target="_blank" rel="noopener noreferrer">nopeople</a></li>
486 <li>#<a href="https://friendica.mrpetovan.com/search?tag=Close" target="_blank" rel="noopener noreferrer">close</a></li>
487 <li>@<a href="https://twitter.com/MrPetovan" target="_blank" rel="noopener noreferrer">mrpetovan</a></li>
488 <li>#<a href="https://friendica.mrpetovan.com/search?tag=Close-up" target="_blank" rel="noopener noreferrer">close-up</a></li>
497 <li>#<a href="https://friendica.mrpetovan.com/search?tag=Street" target="_blank" rel="noopener noreferrer">street</a></li>
498 <li>#<a href="https://friendica.mrpetovan.com/search?tag=Night" target="_blank" rel="noopener noreferrer">night</a></li>
499 <li>#<a href="https://friendica.mrpetovan.com/search?tag=CarLights" target="_blank" rel="noopener noreferrer">carlights</a></li>
500 <li>#<a href="https://friendica.mrpetovan.com/search?tag=Jeep" target="_blank" rel="noopener noreferrer">jeep</a></li>
501 <li>#<a href="https://friendica.mrpetovan.com/search?tag=NoPeople" target="_blank" rel="noopener noreferrer">nopeople</a></li>
502 <li>#<a href="https://friendica.mrpetovan.com/search?tag=Close" target="_blank" rel="noopener noreferrer">close</a></li>
503 <li>#<a href="https://friendica.mrpetovan.com/search?tag=Close-up" target="_blank" rel="noopener noreferrer">close-up</a></li>
512 <li>@<a href="https://twitter.com/MrPetovan" target="_blank" rel="noopener noreferrer">mrpetovan</a></li>