Everything posted by sobrenome
-
Mail Bouncer - Automated Bounce Management
Hello, I cannot remove blocked users from bouncer list. There is an error related to outdate theme or plugin: 2S119/1 - CSRF key does not match.
-
Redis caching not improving performance - it's worse
Is this the best option for performance? I am using redis already for all the other cache settings available on AdminCP.
-
Content-visibility for fast loading website
I have tried this new Chrome feature content-visibility: auto on my community and had some issues with scrolling the pages: https://web.dev/content-visibility/ So I have use the trick to set the contain-intrinsec-size that is used on this video: But the tests on webpagetest show worse results on loading time and no difference on Lighthouse. Has anyone tested it? Maybe it is something to be used on future releases.
-
Elasticsearch 7.9.1 not working on 4.5.1
It would nice to use the latest Elastic Search version with IPS.
-
Support PHP 8.0?
Will JIT be used?
-
Amazon SES API For Sending Mail
Nice! Does it block bounced emails?
-
Mail Bouncer - Automated Bounce Management
Hello, There is a GMAIL user that have been complaining about several blocks and that is tired of unblock the e-mail every time that comes back to my community. Where can I check the reason why the user's email is being blocked?
-
Why json_decode() returns empty?
It is the json api response from YouTube for videos from channels. It is not a user generated content, it is content delivered by YouTube api.
-
Why json_decode() returns empty?
I have checked json_last_error() and number 4 pop out: syntax error. So I have adopted a different approach to cache the array API data: serialize() and unserialize(). But I had also the same syntax issues, that were solved by base64_encode() and base64_decode(). To save in the database: {{$videos_serialized = base64_encode(serialize($videos));}} To use it again: {{$videos = unserialize(base64_decode($videos));}} Hope this helps someone using json APIs and caching the results.
-
Why json_decode() returns empty?
This is my code on a Page template: {{$videos = $record->customFieldDisplayByKey('youtube_json');}} {{$videos = json_decode($videos, true);}} {{print_r($videos);}} I have tested the content of the field and it is a valid json format. But when I decode it to use it as a php array, it is empty.
-
Get YouTube json API data on Pages template
Cloud hosting with auto upscale does not allow this approach I guess. New instances are launched on demand with new IPs and ranges are also variable: https://docs.aws.amazon.com/general/latest/gr/aws-ip-ranges.html
-
Get YouTube json API data on Pages template
What would be the preferred method to protect the key?
-
Get YouTube json API data on Pages template
I have tried to use raw php block and checked that the issue is related to permission to access YouTube api: array(1) { ["error"]=> array(4) { ["code"]=> int(403) ["message"]=> string(42) "Requests from referer are blocked." ["errors"]=> array(1) { [0]=> array(3) { ["message"]=> string(42) "Requests from referer are blocked." ["domain"]=> string(6) "global" ["reason"]=> string(9) "forbidden" } } ["status"]=> string(17) "PERMISSION_DENIED" } } I have used HTTP restriction to accept only mydomain.com/* What is the HTTP referer used by IPS?
-
Get YouTube json API data on Pages template
Without restrictions: { "kind": "youtube#searchListResponse", "etag": "e7yynn8uB_ol2402PjXEO7wAOi4", "nextPageToken": "CAUQAA", "regionCode": "BR", "pageInfo": { "totalResults": 11, "resultsPerPage": 5 }, "items": [ { "kind": "youtube#searchResult", "etag": "jznUn23q7z5iMHGhgDHVzStPO7k", "id": { "kind": "youtube#video", "videoId": "60B-cMqugOI" }, "snippet": { "publishedAt": "2019-11-07T20:59:54Z", "channelId": "UCdOrJP8qk2A2cL9aM2VybOw", "title": "Probiogurt Puravida", "description": "Pronto em 1 minuto! O PROBIOGURT da Puravida é um alimento fermentado em pó feito a partir de leite de coco puro, elementos prebióticos e 11 diferentes ...", "thumbnails": { "default": { "url": "https://i.ytimg.com/vi/60B-cMqugOI/default.jpg", "width": 120, "height": 90 }, "medium": { "url": "https://i.ytimg.com/vi/60B-cMqugOI/mqdefault.jpg", "width": 320, "height": 180 }, "high": { "url": "https://i.ytimg.com/vi/60B-cMqugOI/hqdefault.jpg", "width": 480, "height": 360 } }, "channelTitle": "Puravida Superfoods", "liveBroadcastContent": "none", "publishTime": "2019-11-07T20:59:54Z" } }, { "kind": "youtube#searchResult", "etag": "09HwUSDUdatDykcQylssLB-eAbY", "id": { "kind": "youtube#video", "videoId": "Rp6xWL6AiwI" }, "snippet": { "publishedAt": "2019-11-07T20:49:45Z", "channelId": "UCdOrJP8qk2A2cL9aM2VybOw", "title": "One Nutrition Puravida", "description": "Um alimento, múltiplos benefÃcios. Elaborado com proteÃnas vegetais de alto desempenho (92% de biodisponibilidade), o ONE é um complexo nutritivo de ...", "thumbnails": { "default": { "url": "https://i.ytimg.com/vi/Rp6xWL6AiwI/default.jpg", "width": 120, "height": 90 }, "medium": { "url": "https://i.ytimg.com/vi/Rp6xWL6AiwI/mqdefault.jpg", "width": 320, "height": 180 }, "high": { "url": "https://i.ytimg.com/vi/Rp6xWL6AiwI/hqdefault.jpg", "width": 480, "height": 360 } }, "channelTitle": "Puravida Superfoods", "liveBroadcastContent": "none", "publishTime": "2019-11-07T20:49:45Z" } }, { "kind": "youtube#searchResult", "etag": "TDjy3XttLGMCwZQK_CP1bgpNBpg", "id": { "kind": "youtube#video", "videoId": "kwuNS0ko38Y" }, "snippet": { "publishedAt": "2018-10-19T16:43:53Z", "channelId": "UCdOrJP8qk2A2cL9aM2VybOw", "title": "Coconut Granola Puravida", "description": "O segredo de qualquer receita é a qualidade dos ingredientes. E a Coconut Granola Low Carb da Puravida é feita com os mais nobres alimentos!", "thumbnails": { "default": { "url": "https://i.ytimg.com/vi/kwuNS0ko38Y/default.jpg", "width": 120, "height": 90 }, "medium": { "url": "https://i.ytimg.com/vi/kwuNS0ko38Y/mqdefault.jpg", "width": 320, "height": 180 }, "high": { "url": "https://i.ytimg.com/vi/kwuNS0ko38Y/hqdefault.jpg", "width": 480, "height": 360 } }, "channelTitle": "Puravida Superfoods", "liveBroadcastContent": "none", "publishTime": "2018-10-19T16:43:53Z" } }, { "kind": "youtube#searchResult", "etag": "mtpTXL4UgYKBtX2sLnlcxogn_mc", "id": { "kind": "youtube#video", "videoId": "H2739WTmO8o" }, "snippet": { "publishedAt": "2018-10-19T16:45:09Z", "channelId": "UCdOrJP8qk2A2cL9aM2VybOw", "title": "Spirulina Premium Puravida", "description": "Estas microalgas são possivelmente os alimentos naturais com maior densidade nutritiva. A Spirulina e a Clorella oferecem uma altÃssima riqueza e ...", "thumbnails": { "default": { "url": "https://i.ytimg.com/vi/H2739WTmO8o/default.jpg", "width": 120, "height": 90 }, "medium": { "url": "https://i.ytimg.com/vi/H2739WTmO8o/mqdefault.jpg", "width": 320, "height": 180 }, "high": { "url": "https://i.ytimg.com/vi/H2739WTmO8o/hqdefault.jpg", "width": 480, "height": 360 } }, "channelTitle": "Puravida Superfoods", "liveBroadcastContent": "none", "publishTime": "2018-10-19T16:45:09Z" } }, { "kind": "youtube#searchResult", "etag": "SkmlPdjeSNdwoOHZj7RbgaWmz4Y", "id": { "kind": "youtube#video", "videoId": "zMdz1pLA1eE" }, "snippet": { "publishedAt": "2018-10-19T16:42:34Z", "channelId": "UCdOrJP8qk2A2cL9aM2VybOw", "title": "Coco Cream Puravida", "description": "O Coco Cream é o puro leite de coco em pó instantâneo mais cremoso e delicioso do mercado! Basta adicionar uma colher na água morna e pronto!", "thumbnails": { "default": { "url": "https://i.ytimg.com/vi/zMdz1pLA1eE/default.jpg", "width": 120, "height": 90 }, "medium": { "url": "https://i.ytimg.com/vi/zMdz1pLA1eE/mqdefault.jpg", "width": 320, "height": 180 }, "high": { "url": "https://i.ytimg.com/vi/zMdz1pLA1eE/hqdefault.jpg", "width": 480, "height": 360 } }, "channelTitle": "Puravida Superfoods", "liveBroadcastContent": "none", "publishTime": "2018-10-19T16:42:34Z" } } ] }
-
Get YouTube json API data on Pages template
I am trying to retrieve json API data from YouTube using this code: {{$key = 'xxxxxxxxxxxxx';}} {{$base_url = 'https://www.googleapis.com/youtube/v3/search';}} {{$channel_id = $record->customFieldDisplayByKey('youtube_channel_id');}} {{$max_results = 3;}} {{$api_url = \IPS\Http\Url::external( $base_url )->setQueryString( array( 'order' => 'date', 'part' => 'snippet', 'channelId' => $channel_id, 'maxResult' => $max_results, 'key' => $key ) );}} {{$videos = $api_url->request()->get()->decodeJson();}} But the string $videos is empty. Could not use this code: // Create a URL object $url = \IPS\Http\Url::external( "http://someurl.com" )->setQueryString( 'key', 'value' ); // Now fetch it and decode the JSON try { $response = $url->request()->get()->decodeJson(); } catch( \IPS\Http\Request\Exception $e ) { die( "There was a problem fetching the request" ); } catch( \RuntimeException $e ) { die( "The response was not valid JSON" ); } var_dump( $response ); exit; Because I am on a Page template that does not accept raw php. The URL from YouTube seems to be ok (it only allows GET from my domain) : { "error": { "code": 403, "message": "Requests from referer \u003cempty\u003e are blocked.", "errors": [ { "message": "Requests from referer \u003cempty\u003e are blocked.", "domain": "global", "reason": "forbidden" } ], "status": "PERMISSION_DENIED" } }
-
Pagination on record view template
-
4.5 and Video Attachments
Video is now a must for many communities. We really need better video features. There is also this Amazon service to process video files: https://aws.amazon.com/elastictranscoder/ So it is now possible to have better video on the communities with low cost.
-
Post Attachments to Gallery - Is It Possible?
I think that I would be a nice option to auto populate a member album called "Member Name Attachments" and make easier for the community to see every image or video posted by the member along the community, as long as there is no attachment display on member profile.
-
'my attachments' on profile drop down menu - not needed?
Are attachments available on member's profile?
-
flag \IPS\Db::SELECT_SQL_CALC_FOUND_ROWS not working
-
Adding Pagination to Custom Record Feed Block
I also would like to know.
-
flag \IPS\Db::SELECT_SQL_CALC_FOUND_ROWS not working
It is updated now! Thanks @bfarber!
-
Pagination on record view template
I have changed the $baseUrl to: {{$baseUrl = \IPS\Http\Url::internal( 'app=cms&module=pages&controller=page', 'front', 'content_page_path');}} But now there is no pagination number attached to the pages URL. I see that on record view there is pagination for comments (?tab=comments) and reviews (?tab=reviews). Can I add my own custom tab to paginate the records from another database?
-
flag \IPS\Db::SELECT_SQL_CALC_FOUND_ROWS not working
Perfect! Thanks! Please update the developer docs: https://invisioncommunity.com/developers/docs/fundamentals/accessing-the-database-r166/
-
Pagination on record view template
On a record view template of a database (brand database), I want to show records from another database that are related (products from the brand). The custom code: {{$baseUrl = $record->url( "getPrefComment" );}} {{$limit=20;}} {{$page = (isset( \IPS\Request::i()->page ) and (intval( \IPS\Request::i()->page ) > 0)) ? \IPS\Request::i()->page : 1;}} {{$start = ( $limit * ( $page - 1 ) );}} {{$total = \IPS\Db::i()->select( 'COUNT(*)', 'cms_custom_database_8', array( 'field_140=?', $record->primary_id_field ) )->first();}} {{$select = \IPS\Db::i()->select( 'cms_custom_database_8.field_68 as nome_do_suplemento, cms_custom_database_8.record_image_thumb as imagem, cms_custom_database_8.primary_id_field as id_do_suplementos, cms_custom_database_8.member_id as autor, cms_custom_database_8.record_updated as data_de_atualizacao, cms_custom_database_8.record_comments as numero_de_comentarios', 'cms_custom_database_8', array( 'field_140=?', $record->primary_id_field ), 'cms_custom_database_8.field_68 ASC', array( $start, $limit ) );}} {{$pages = ceil($total / $limit);}} <div> {template="pagination" group="global" app="core" location="global" params="$baseUrl, $pages, $page, $limit, TRUE, 'page'"} </div> The problem is that when page 2 and so on are requested, IPS automatically redirects the URL to original record url (no pagination at all). Is there a way to add pagination on record view template (avoid auto redirect)?