Jump to content

sobrenome

Clients
  • Posts

    2,525
  • Joined

  • Last visited

 Content Type 

Downloads

Release Notes

IPS4 Guides

IPS4 Developer Documentation

Invision Community Blog

Development Blog

Deprecation Tracker

Providers Directory

Forums

Events

Store

Gallery

Everything posted by sobrenome

  1. I am using select field type in Pages to store in the database integers from 0 to 5 as a rating system. How do I get this values in the template. I am trying something like this: {{if $record->$field_165 == 0}} {$estrela_0|raw} {{elseif $record->$field_165 == 1}} {$estrela_1|raw} {{elseif $record->$field_165 == 2}} {$estrela_2|raw} {{elseif $record->$field_165 == 3}} {$estrela_3|raw} {{elseif $record->$field_165 == 4}} {$estrela_4|raw} {{elseif $record->$field_165 == 5}} {$estrela_5|raw} {{endif}} What I need is the content stored on the database for the field_165.
  2. There are results. I have changed the query to limit it to one row instead of using ->first(); {{$select = \IPS\Db::i()->select( 'cms_custom_database_12.field_142 as preco, cms_custom_database_12.field_154 as link, cms_custom_database_12.record_updated as atualizado, cms_custom_database_13.field_143 as loja, cms_custom_database_13.record_image_thumb as logo, cms_custom_database_13.field_160 as cupom, cms_custom_database_13.field_161 as cupom_valor, cms_custom_database_13.primary_id_field as loja_ID', 'cms_custom_database_12', array( array( 'field_156=?', $row->primary_id_field ), array( 'field_141=?', 1 ) ), 'cms_custom_database_12.field_142 ASC', 1)->join( 'cms_custom_database_13', 'cms_custom_database_13.primary_id_field=field_155', 'INNER' );}}
  3. It does not work. An error is prompted: UnderflowException: (0) #0 /var/www/html/applications/cms/sources/Theme/Theme.php(610) : eval()'d code(1214): IPS\Db\_Select->first() #1 /var/www/html/applications/cms/sources/Theme/Theme.php(610) : eval()'d code(697): IPS\Theme\class_cms_database_suplementos_record_listing_4_5->recordRow() #2 /var/www/html/system/Helpers/Table/Table.php(564): IPS\Theme\class_cms_database_suplementos_record_listing_4_5->categoryTable() #3 /var/www/html/applications/cms/modules/front/database/category.php(697): IPS\Helpers\Table\_Table->__toString() #4 /var/www/html/applications/cms/modules/front/database/index.php(48): IPS\cms\modules\front\database\_category->view() #5 /var/www/html/system/Dispatcher/Controller.php(101): IPS\cms\modules\front\database\_index->manage() #6 /var/www/html/applications/cms/sources/Databases/Dispatcher.php(327): IPS\Dispatcher\_Controller->execute() #7 /var/www/html/system/Theme/Theme.php(4481) : eval()'d code(9): IPS\cms\Databases\_Dispatcher->run() #8 /var/www/html/applications/cms/sources/Pages/Page.php(1261): IPS\Theme\content_pages_55() #9 /var/www/html/applications/cms/sources/Pages/Page.php(2266): IPS\cms\Pages\_Page->getHtmlContent() #10 /var/www/html/applications/cms/modules/front/pages/page.php(116): IPS\cms\Pages\_Page->output() #11 /var/www/html/applications/cms/modules/front/pages/page.php(43): IPS\cms\modules\front\pages\_page->view() #12 /var/www/html/system/Dispatcher/Controller.php(101): IPS\cms\modules\front\pages\_page->manage() #13 /var/www/html/applications/cms/modules/front/pages/page.php(33): IPS\Dispatcher\_Controller->execute() #14 /var/www/html/system/Dispatcher/Dispatcher.php(152): IPS\cms\modules\front\pages\_page->execute() #15 /var/www/html/index.php(13): IPS\_Dispatcher->run() #16 {main} The query: {{$select = \IPS\Db::i()->select( 'cms_custom_database_12.field_142 as preco, cms_custom_database_12.field_154 as link, cms_custom_database_12.record_updated as atualizado, cms_custom_database_13.field_143 as loja, cms_custom_database_13.record_image_thumb as logo, cms_custom_database_13.field_160 as cupom, cms_custom_database_13.field_161 as cupom_valor, cms_custom_database_13.primary_id_field as loja_ID', 'cms_custom_database_12', array( array( 'field_156=?', $row->primary_id_field ), array( 'field_141=?', 1 ) ), 'cms_custom_database_12.field_142 ASC')->join( 'cms_custom_database_13', 'cms_custom_database_13.primary_id_field=field_155', 'INNER' )->first();}}
  4. I am running this database query: {{$select = \IPS\Db::i()->select( 'cms_custom_database_12.field_142 as preco, cms_custom_database_12.field_154 as link, cms_custom_database_12.record_updated as atualizado, cms_custom_database_13.field_143 as loja, cms_custom_database_13.record_image_thumb as logo, cms_custom_database_13.field_160 as cupom, cms_custom_database_13.field_161 as cupom_valor, cms_custom_database_13.primary_id_field as loja_ID', 'cms_custom_database_12', array( array( 'field_156=?', $row->primary_id_field ), array( 'field_141=?', 1 ) ), 'cms_custom_database_12.field_142 ASC')->join( 'cms_custom_database_13', 'cms_custom_database_13.primary_id_field=field_155', 'INNER' );}} I would like to get just the first row, I do not want to loop over all results. How to use ->first() in this query?
  5. It is a new template based on the built in category listing templates, the categoryRow template to be more specific.
  6. I am customising the category row template and I would like to present the last post along with the record_image, not only title and date. How to get the last post record image on database category row template?
  7. It was my bad. My HTML code was incorrect. Now that HTML 5 standard is ok, the parent data-controller is not affecting the child. Thanks! 🙈
  8. In Pages templates, how to check if logged member is admin?
  9. Is there a way to remove the parent HTML element data-controller JS on a child HTML element?
  10. Is there a guide for available data-controller?
  11. I am working on a Pages template and I want to get the URL of a record of another database. To get the URL of the current database I am using this code: {{$url = \IPS\Http\Url::internal( "app=cms&module=pages&controller=page&path=" . \IPS\cms\Pages\Page::loadByDatabaseId( $record->database()->id )->full_path, 'front', 'content_page_path' );}} And how to get the URL of a record from another database using the record primary id field?
  12. Perfect, I guess caching was the reason it did not work before.
  13. How to get the ID of the record on Pages templates? I have tried: $record->id $record->_id $record->primary_id_field
  14. Hello, will it be available on IPS 4.5?
  15. Thanks @stoo2000! It was a long journey to upgrade from 4.4 to 4.5, but everything looks fine now! 🙏🏻
  16. The one I was using was not updated to 4.5. But this one was: thanks. Ops... these are social profiles. There is no WhatsApp share button to IPS 4.5 yet.
  17. IPS 4.5 is missing WhatsApp share button!
  18. If I do not allow remote images and the user paste a image in the editor the image will be saved and if I do allow remote images the src of the image will be kept, is that right?
  19. I have tried to upgrade from 4.4 to 4.5 and could not. On AdminCP I get this error: SELECT count(mlog_id) FROM `ip_boardcore_mail_error_logs` AS `core_mail_error_logs` WHERE mlog_notification_sent=false IPS\Db\Exception: Unknown column 'mlog_notification_sent' in 'where clause' (1054) #0 /var/www/html/system/Db/Select.php(383): IPS\_Db->preparedQuery() #1 /var/www/html/system/Db/Select.php(441): IPS\Db\_Select->runQuery() #2 /var/www/html/system/Db/Select.php(365): IPS\Db\_Select->rewind() #3 /var/www/html/system/Email/Email.php(1612): IPS\Db\_Select->first() #4 /var/www/html/applications/core/extensions/core/AdminNotifications/ConfigurationError.php(178): IPS\_Email::countFailedMail() #5 /var/www/html/applications/core/modules/admin/system/login.php(193): IPS\core\extensions\core\AdminNotifications\_ConfigurationError::runChecksAndSendNotifications() #6 /var/www/html/applications/core/modules/admin/system/login.php(104): IPS\core\modules\admin\system\_login->_doLogin() #7 /var/www/html/system/Dispatcher/Controller.php(101): IPS\core\modules\admin\system\_login->manage() #8 /var/www/html/system/Dispatcher/Dispatcher.php(152): IPS\Dispatcher\_Controller->execute() #9 /var/www/html/admin/index.php(14): IPS\_Dispatcher->run() #10 {main} Is mail_error_logs a table created by Mail Bouncer? My community is offline.
  20. Yes, Gallery has big potential and needs a revisit to be as modern as the rest of IPS apps.
  21. Good to know that it works in real life. Hope we have an IPS plugin soon.
  22. Have you seen this new Cloudflare plugin Automatic Platform Optimization to serve dynamic content from the point of presence cache? https://blog.cloudflare.com/automatic-platform-optimizations-starting-with-wordpress/ It would be great if IPS asked Cloudflare to develop a plugin for our communities.
×
×
  • Create New...