Developer Connection
Use this forum to interact with our development team on technical issues, suggestions and official best practices advice.
1,734 topics in this forum
-
- 1 follower
- 2 replies
- 335 views
I had this code in 4.1 that worked perfectly: $form->add( new \IPS\Helpers\Form\Ftp( 'directory_ftp', $this->ftp, true, array( 'validate' => false ), function( $val ){ if( empty( $val ) ) { $val = \IPS\Request::i()->directory_ftp; } $conn_id = ftp_connect( $val['server'], $val['port'] ); $login_result = ftp_login( $conn_id, $val['un'], $val['pw'] ); if( !$conn_id || !$login_result ) { throw new \InvalidArgumentException( 'FTP Connection Failed' ); } ftp_pasv( $conn_id, true ); if( !ftp…
Last reply by HeadStand, -
- 1 reply
- 298 views
Hello, "Complete My Profile" header block generate a lot of sql queries. Steps to reproduce - Enable query log - Create first step and add custom field - On front-end you can see 2 queries - Add new field in the step - On front-end you can see 3 queries - Add new field in the step - On front-end you can see 4 queries - Add new step with 1 custom field - On front-end you can see 6 queries - etc.
Last reply by bfarber, -
- 2 followers
- 4 replies
- 450 views
A few of my apps utilize the built in custom profile fields to manage user data. In 3.x, the unique key ensured we got data from one field, and one field only. In 4.x, there is no unique key for custom profile fields. There is no way to ensure the field you're calling is the one with the data you're expecting. Custom fields are a great functionality, however there is no way to limit the client from creating more than one field of your custom type. So while custom fields help a great deal, there is still no guarantee that it is unique. Is there any way we can get a unique key re-added for profile fields to simplify the process of locating a custom field with th…
Last reply by bfarber, -
- 6 replies
- 373 views
Hey, If the IPS on a "clean" installation, can restore files to the forum? Or would it be in this case, easier to install and build the pages again because it is not yet a big forum. Thank you!
Last reply by Tracy Perry, -
- 1 follower
- 1 reply
- 305 views
i don't usually do "default inserts" when i add a table, but i added a table in one of my apps which had default inserts. however when the upgrader ran and added the table, queries.json doesn't contain the default inserts, which caused an error when users were trying to use the app after the upgrade. so could queries.json also include default inserts if they are added to a table?
Last reply by bfarber, -
- 1 follower
- 4 replies
- 392 views
I have this code $table = new \IPS\Helpers\Table\Db( 'core_sys_lang_words', $baseUrl, $where ); $table->tableTemplate = array( \IPS\Theme::i()->getTemplate( 'tables', 'core', 'admin'), 'table' ); $table->rowsTemplate = array( \IPS\Theme::i()->getTemplate( 'tables', 'core', 'admin' ), 'rows' ); $table->advancedSearch = array( 'word_app' => array( \IPS\Helpers\Table\SEARCH_NODE, array( 'class'=> 'IPS\Application', 'subnodes' => false, 'permissionCheck' => function( $app ) { …
Last reply by bfarber, -
- 1 follower
- 1 reply
- 300 views
foreach( $this->value as $k => $v ) { $class = new $classType( $this->name .'_validate', $v, FALSE, $this->options, $this->customValidationCode, $this->prefix, $this->suffix); $class->validate(); } parent::validate(); Has new change refer to \IPS\Helpers\Form\Stack::validate ? this code take same $this->customValidationCode closure for each $this->value and \IPS\Helpers\Form\_FormAbstract::validate if( $this->customValidationCode !== NULL ) { call_user_func( $this->customValidationCode, $this->value ); } Why this? how I can manage for a function same closure (into secure purpose, one is Stack::validate array…
Last reply by bfarber, -
- 1 follower
- 1 reply
- 348 views
I have some difficult to understand why doing on 4.2: \IPS\Output::i()->output = $output; if( \IPS\Dispatcher::i()->application->directory == 'cms' ) { \IPS\cms\Databases\Dispatcher::i()->output = \IPS\Output::i()->output; } on 4.1.19 the code working fine like \IPS\Output::i()->output = $output; For example when a member reach the url /articles.html/articles/test-r1/?do=getPoll it seem I must assign also for cms Dispatcher instance the output value, it don't autopopulate the subclass? EDIT: The "issue" happen also when try to run via AJAX ?do=edit a record of articles EDIT 2: /** * @brief Singleton Instance (So we do…
Last reply by bfarber, -
- 1 follower
- 2 replies
- 360 views
I am wanting to add a horizontal row of 2 or 3 ads at the bottom of my pages. I can see how to do this and have them appear underneath each other but I want them to appear side by side. Is this best done by adding a table and placing the ad keys within each cell? If so can someone show a novice the step by step way of doing this in the Themes If there is a better way then please let me know. Thanks, Wade
Last reply by Wade Nash, -
- 2 replies
- 304 views
Hello, 1. Any reason why you use duplicate code in appmenu template? applications/core/dev/html/admin/global/appmenu.phtml {{if count( $item ) > 1}} <li data-menuKey='{$appAndModule}'> <h3>{lang="menu__{$appAndModule}"}</h3> <ul class='ipsList_reset'> {{foreach $item as $key => $url}} <li> {{$badgeNumber = NULL; try { $badgeNumber = \IPS\Application::load( mb_substr( $appAndModule, 0, mb_strpos( $appAndModule, '_' ) ) )->acpMenuNumber( $url ); } catch( \Exception $ex ){ } }} {{if $badgeNumber}} <a href='{url="$url"}'> {lang="menu_…
Last reply by bfarber, -
- 1 follower
- 0 replies
- 244 views
I might be missing something, is there a way in nexus on a license key invoice, to change the usage data? if not, is this a feature we will be seeing in the future?
Last reply by CodingJungle, -
- 1 follower
- 3 replies
- 268 views
I need to strips html tags from the $content in a plain text email template. I try to use strip_tags but I got a syntax error, unexpected '$return' (T_VARIABLE)
Last reply by bfarber, -
- 2 replies
- 288 views
Hi All, I would like to display on top of each forum, the forum moderators, but only the current forum moderators. Can someone redirect me to the right direction? Thanks in advance
Last reply by Dor Zuberi, -
- 1 follower
- 4 replies
- 315 views
Is it possible to post to the search form from a third party site? In other words, the keyword field and search submit button would be on a different site, then it would forward the user to the community site with the search results. So it would need to accept the POST fields. The problem I'm having is the search form uses some kind of csrfKey (hidden input) to validify that the search came from the site. Any way around this?
Last reply by bfarber, -
- 1 follower
- 4 replies
- 568 views
Hello, I am trying to pass data from my PHP controller to a JavaScript controller. The data could be either a number or a JSON object. The best thing I can think of right now is to get the ID from the URL that the page loads the JS controller on and then use Ajax to retrieve the JSON object but if there is a better way, please let me know. Thanks
Last reply by FNDN Admin, -
- 1 follower
- 5 replies
- 600 views
Here is what I would like to do. Hope someone can tell me how to accomplish. I have created 4 side bar advertising locations. I have placed them at the bottom of my side bar. They are called LowerAD, LowerAD1, LowerAD2 and so on. So I understand the basic (very basic) process. I would like to create a banner location that is specific to pages. For example. I would like to create a custom banner location that appears on all the Index pages. I would like a custom placement for the Index Headder and the Index Footer. I would like to create a custom banner location that appears on the Forum pages. I would like a custom placement for the Forum Heade…
Last reply by Mark Round, -
- 1 reply
- 300 views
I'm developing an application that heavily relies on manipulating tables on remote databases. ActiveRecord is compatible with this no problem, because of its db() function. But Nodes, not so much \IPS\Node\Model and \IPS\Node\Controller would be a lot more compatible with situations like this if they called the ActiveRecord::db() function for queries, instead of \IPS\Db::i()
Last reply by GriefCode, -
- 2 followers
- 2 replies
- 241 views
Hello, I would know if is possible to assign a item into multiple categories without edit all method for urls / langs bit / related. I am thinking to use tags because it is ready to use but I don't checked already if it provide some permissions per groups. Thanks for any helps
Last reply by HeadStand, -
- 1 follower
- 11 replies
- 654 views
I having issue when try to join 3+ \IPS\Db\Select to a subquery... $join[] = [ \IPS\Db::i()->select( ... ), \IPS\Poll\Vote::$databaseTable .'.'. \IPS\Poll\Vote::$databasePrefix . 'poll=core_polls.pid'] ; $join[] = array(\IPS\Db::i()->select( ... ), $class::$databaseTable . '.' . $class::$databasePrefix . $class::$databaseColumnMap['poll'] . '=core_polls.pid'); $join[] = array(\IPS\Db::i()->select( ... ), $class::$databaseTable . '.' . $class::$databasePrefix . $class::$databaseColumnMap['poll'] . '=core_polls.pid'); $subquery = \IPS\Db::i()->select( $select, 'core_polls',$where); foreach ( $join as $j ) { $subquery->join( $j[0], $j[1]); } $query = \IPS…
Last reply by BomAle, -
- 4 replies
- 314 views
Hello We use 3.2.2 and currently use IP Board "login name" and "password" for a membership area on another website. (ie. they can login to the website using their IP Board Login name and current password) Can anyone tell me ---- if we upgrade to 4, will that membership area still work on the other website as it currently is, or will some code adjustments be required? If adjustments would be required, any specifics on what would need to be adjusted code-wise would be most helpful. Thank you very much
Last reply by dacho, -
- 1 follower
- 14 replies
- 522 views
I would extend $databaseColumnMap adding "poll" => "poll_state" but I don't know how. Currently I have a hook on __construct() Records.php but when i try to call statically the class like \IPS\cms\Records1::$databaseColumnMap["poll"] it is not called yet... I see \IPS\cms\Application have a autoload, how I can interact when class is evalued/initialized? $multitons could help me here? anyone use another spl_autoload_register to permise it?
Last reply by BomAle, -
- 1 reply
- 305 views
Hey, I am building a JavaScript mixin to load with a controller and I am having trouble loading it in IPS version 4.1.19.4. The problem is when I try to load the script, I get two forward slashes in the URL which leads to it being not found: http://172.18.15.11/<domain>//applications/<appname>/... I looked in the system/Output/Output.php and on line 231, there is a comment: /* @see http://community.invisionpower.com/4bugtrack/some-js-files-get-loaded-with-a-double-in-the-url-r3558/ */ but the link http://community.invisionpower.com/4bugtrack/some-js-files-get-loaded-with-a-double-in-the-url-r3558/ leads to an error. The problem seemed to be…
Last reply by bfarber, -
- 1 follower
- 4 replies
- 332 views
The code here could be improved call buildEditForm instead of: $form = new \IPS\Helpers\Form( 'form', isset( \IPS\Member::loggedIn()->language()->words[ $recordClass::$formLangPrefix . '_save' ] ) ? $recordClass::$formLangPrefix . '_save' : 'save' ); $form->class = 'ipsForm_vertical'; foreach( $formElements as $name => $field ) { $form->add( $field ); } this permise developers to add for example new tab @Matt some details into mp (remove $collection)
Last reply by bfarber, -
using ajax
by teez- 1 follower
- 1 reply
- 377 views
Hi! Where can i find some details about using ajax in apps? I have added pagination (now just reloads whole page) I have some buttons in post container which call to my apps, it makes something and after all return to post and I want to get ride of this reload.
Last reply by bfarber, -
- 3 followers
- 2 replies
- 320 views
Currently, if a hook has a compile error, such as not reflecting the parameters of the method that it overrides (particularly an issue with the backwards-incompatible changes in 4.2), the error is discarded silently, even when IN_DEV. This obviously isn't ideal. Can we kill two birds with one stone and get better exceptions for hooks too, by replacing the monkey patch code with $contents = "namespace {$namespace}; ". str_replace( '_HOOK_CLASS_', $realClass, file_get_contents( ROOT_PATH . '/' . $data['file'] ) ); if (\IPS\IN_DEV) { $filename = tempnam(\IPS\TEMP_DIRECTORY, "HOOK_{$namespace}\\{$finalClass}_{$data['file']}"); $fullContents = "<?p…
Last reply by Andy Millne,