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
- 0 replies
- 271 views
Initially submitted as a bug... Fair point that it's not a bug. But it is a deviation from the IPS code standards. I wouldn't be living up to @Lindy standards if I didn't let the anal retentive side of me post this. ? massMoveorDeleteWhere() massMoveorDelete()
Last reply by Aiwa, -
- 4 replies
- 313 views
A lot of times I end up undecided whether various methods are best to be put into the model or the controller. For instance, forms. For specific ones that ip.suite has helpful methods for, I use the model, such as node forms and content item forms. For other forms, I kind of go back and forth on what would be best. Typically, if I am going to use a form for both the front end and the acp side, I put it in the model, to be able to easily reuse the form. For others, I have mostly been putting in the controllers, partly because of how large one of my models is. I see a lot of first party forms in models and a lot in controllers, as well. Also, technically ever…
Last reply by Midnight Modding, -
- 2 followers
- 3 replies
- 358 views
I created my own CKEditor plugin that takes highscore stats from an API and displays it in the post. The problem is with styling, the editor shows the content perfectly fine, but once its posted, IPS strips away the id and class attributes for any user rank that doesn't have html enabled. I find it odd that it has no issue leaving all the other attributes, yet strips those particular ones. It also appears to remove the display class from any hard coded styling via the style attribute. Is there a setting somewhere or some code I can modify to allow both id and class? I tried the following to allow the display class, but it didn't resolve the issue:
Last reply by Aetherdan, -
- 1 follower
- 3 replies
- 323 views
In script <script> var ipsDebug = {{if ( \IPS\IN_DEV and \IPS\DEV_DEBUG_JS ) or \IPS\DEBUG_JS}}true{{else}}false{{endif}}; {{if \IPS\IN_DEV}} var CKEDITOR_BASEPATH = '{url="applications/core/dev/ckeditor" base="none" protocol="\IPS\Http\Url::PROTOCOL_RELATIVE"}/'; {{else}} var CKEDITOR_BASEPATH = '{url="applications/core/interface/ckeditor/ckeditor" base="none" protocol="\IPS\Http\Url::PROTOCOL_RELATIVE"}/'; {{endif}} var ipsSettings = { {{if \IPS\Dispatcher::hasInstance() and \IPS\Dispatcher::i()->controllerLocation == 'admin'}} adsess: "{expression="\IPS\Request::i()->adsess"}", {{endif}} {{if \IPS\COOKIE_DOMAIN !== NULL}} coo…
Last reply by Adlago, -
- 6 replies
- 324 views
Aren't they automatically checked if the url do= matches the restriction key add/edit/manage/delete? I do see it manually checked in files in function execute(), but I assume that is just to be sure it checks it for the various methods that don't match the key? So i wouldn't need to do my own check in function add(), for instance, if I have a restriction for add?
Last reply by bfarber, -
- 1 follower
- 1 reply
- 266 views
It seems changeAuthor-method on the item-objects doesn't actually check if it has to do anything. I would suggest to have a simple $oldAuthor->member_id == $newAuthor->member_id check within it. system/Content/Comment.php system/Content/Content.php system/Content/Item.php
Last reply by bfarber, -
- 2 replies
- 276 views
For some first party apps, if I go to their dev center it says the local db doesn't match the schema. Why? Isn't it comparing it to the schema files on my server, even if it's in_dev, ie not comparing to a future version I don't have installed yet? Also, I decided there was no point to having an auto increment id in this table that has a 1:1 relationship to the members table, so I got rid of that and changed my member id column from unique to primary.... well I accidentally left a name of the index, so it updated it, but then said my own app's schema wasn't matching my local db, since my local db had the index named PRIMARY. I guess that's no big deal, as I just clic…
Last reply by Midnight Modding, -
- 2 replies
- 305 views
So I have a couple of resources that uses login form.With all changes in 4.3, it uses a "hardcoded" template and there's no way to remove options like Remember Me, Sign in anonymously and Forgot your password?, at least I didn't find it. $url = \IPS\Http\Url::internal( 'app=core&module=system&controller=settings&area=linkedaccounts', 'front', 'settings_linkedaccounts' ); $login = new \IPS\Login( $url, \IPS\Login::LOGIN_ACP ); $error = NULL; Tried to change the login type to ACP, UCP, no change at all. ACP for example, only has USERNAME and EMAIL, exactly what I need, but I change it there and see no change in template. <div class='cLogi…
Last reply by Adriano Faria, -
- 1 follower
- 5 replies
- 381 views
I tried to create a front navigation extension, but I'm having troubles creating "sub menus" for it. Example: I have a feeling I see I should be using the children method, but it returns an array, I'm not too sure of what..?
Last reply by Midnight Modding, -
- 1 follower
- 2 replies
- 347 views
Hello, I want to add some strings to one of method in /applications/cms/sources/Categories/Categories.php How can I do it with code hooks? thanks
Last reply by Inlens, -
- 1 reply
- 332 views
I'm migrating some code from 3.4 Nexus to 4.x eCommerce. I don't find any docs like the older 3.4 Nexus docs about mark an invoice paid, create a payment gateway etc... A specific question: all my payments gateway i need to migrate do something like public function payScreen() { $html = "my html"; ... return array("html" => $html); } The only payment gateway in the default installation that use a paymentScreen is AuthorizeNet, with this kind of code: public function paymentScreen( \IPS\nexus\Invoice $invoice, \IPS\nexus\Money $amount, \IPS\nexus\Customer $member = NULL, $recurrings = array() ) { $return = array(); $return['card'] = new \IPS…
Last reply by Mark, -
- 1 follower
- 4 replies
- 291 views
I posted about this in the past, but I here it goes again... If I attempt to edit or add anything to the acp menu through the acp menu tab in dev center, it gives an illegal offset error, triggered by the following line: $this->menu['tabs'][ $item['tab'] ][ "{$app->directory}_{$moduleKey}" ][ $itemKey ] = "app={$app->directory}&module={$moduleKey}&controller={$item['controller']}" . ( $item['do'] ? "&do={$item['do']}" : '' ); I then looked in the acp menu file and saw it put [] around the community tab name. I fixed it, reuploaded, and the error was gone. I then reordered menu items via that same acp menu tab in dev center. …
Last reply by Midnight Modding, -
- 2 replies
- 274 views
This is probably intentional, but if you have all your files in the uploads folder served on a separate domain, is it intended for interface files to be served on the website domain? Thanks!
Last reply by silenceheaven, -
- 2 followers
- 2 replies
- 312 views
What is the best way for me to track down theme syntax errors for my templates? It doesn't give line numbers or show the code for where it was triggered, like it does for everything else. I had one that said unexpected $k and in my template $k was in there probably 10 times, so it was a mess figuring it out, since I had some tricky variables.
Last reply by Midnight Modding, -
- 10 replies
- 422 views
I'm sometimes getting things a bit mixed up on times and lang bits, due to differences dependent on the methods used. 1. In the past, I used $la = \IPS\Member::loggedIn()->language()->addToStack('key') in the php file and passed $la to the template. Then simply putting {$la} in the template wouldn't work because it just displayed the unique key returned by addToStack(). So I used {lang="$la"} in the template, which worked. HOWEVER, another time in my template I put {$row->la} where my model had a getter with that name... the getter returned \IPS\Member::loggedIn()->language()->addToStack('key') and yet that worked, without using {lang=""}. So why does …
Last reply by Midnight Modding, -
- 1 follower
- 3 replies
- 370 views
I'm trying to run this code on plugin install, but get an error: Code: \IPS\Db::i()->createTable([ 'name' => 'sypexgeo_cache', 'columns' => [ \IPS\Db::i()->compileColumnDefinition([ 'name' => 'ip_address', 'type' => 'VARCHAR', 'length' => 46, 'allow_null' => false, 'comment' => 'The IP address' ]), \IPS\Db::i()->compileColumnDefinition([ 'name' => 'data', 'type' => 'TEXT', 'allow_null' => true, 'comment' => 'The JSON-encoded data returned by the service' ]), \IPS\Db::i()->compileColumnDefinition([ 'name' => 'date', 'type' => 'INT', 'length' => 10, 'allow…
Last reply by newbie LAC, -
- 2 followers
- 53 replies
- 2.6k views
Edit: after a lot of time researching and testing, I have figured out most of what I need, hopefully... One thing I don't understand, though, is that lists of topics have the topic title more bold if it's unread, but in the template topicRow, it doesn't seem to do any change to the title based on read status. Unless I am missing something it must be formatted elsewhere (maybe there's a getter for title in Topic.php? I haven't looked yet...)
Last reply by imJexs, -
- 1 reply
- 400 views
This is a really big request, I'm on my knees, but I posted a bit ago about the first theme ID not being 1, and breaking some stuff. Do you think we could have it be a constant in init.php instead, so one could manually adjust it? \IPS\Theme\Dev\Theme \IPS\Theme::deleteCompiledResources( $dir->getFilename(), null, null, null, ( $id === 0 ? 1 : $id ) ); \IPS\Developer \IPS\Theme::load(1)->saveSet(); To something like \IPS\DEFAULT_THEME_ID This would really let me continue to have the first theme in the table have an ID of 3 without manually editing the files everytime. Thanks!
Last reply by bfarber, -
- 1 reply
- 282 views
I have an already-exists website with /api url. I'm testing a migration to IPB4. I cannot change our API entry point for existing customers. I cannot override the /api url management in IPB4 via furl json files, because api/index.php file physically exists. But if i rename the /api directory to /xx_api, nginx try_files don't find it and i can match it in my IPB custom application via normal furl management. My question: IPS original /api is used internally somewhere? My workaround is safe or cause issues? Thx for any advice.
Last reply by bfarber, -
- 1 follower
- 6 replies
- 395 views
I have around 32 reactions, and from profiling it seems that in \IPS\Content\Reaction::isLikeMode() it was hanging up there for 1ms, but spread across a large amount of calls for each reaction for each post, it seems to be causing some major delays. Replacing it with this has seemed to have solved the issue, I hope I didn't break anything! public static $isLikeMode = NULL; /** * Is Like Mode * * @return bool */ public static function isLikeMode() { if ( static::$isLikeMode === NULL ) { $i = 0; foreach( static::roots() AS $row ) { if ( $row->_enabled !== FA…
Last reply by SeNioR-, -
- 3 followers
- 4 replies
- 347 views
Hi, 1) The method storeWithExpire in system/Data/Cache.php doesn't return any indication on whether the value was stored successfully. However, for example, the memcache class (system/Data/Cache/Memcache.php) does return a boolean value in the set-method, which is the method that is called within storeWithExpire in the \IPS\Data\Cache-class. The same seems to be the case in other cache-classes. Could you please return the value that the set()-method returns when it's called in storeWithExpire? 2) Also, the method storeWithExpire in Cache.php does this: <?php if ( $this->set( $key, $this->encode( $value ), $expire ) ) { $t…
Last reply by Stuart Silvester, -
- 1 follower
- 5 replies
- 346 views
Hello, I would like to know where I can have informations about classes that are deleted in updates (for example the class NumberRange was deleted in one of update but I can't find this information anywhere). Can you please try to give more informations to developers about your changes in each update?
Last reply by Aiwa, -
- 7 replies
- 608 views
What am I missing here? Function manage() in Content\Controller.php catches exceptions. When it checks the permission for the content item, in Content\Content.php, it throws an exception without catching it to show an error. So, if someone doesn't have permissions, it's going to throw an exception that isn't caught, ie no clean error message? canView() and can() only return bool, so no error() there. All of the first party apps I look at, they don't do anything other than call parent::manage(), so no error() there. Am i overlooking something? It's already odd to me that manage() catches all exceptions, to begin with. And I needed joins, so i just did my query before calli…
Last reply by bfarber, -
- 2 replies
- 366 views
Let's say I have 3 tables. They are as follows: users logins names The users table contains an auto incremented primary key as well as a user_unique which is a unique identifier for a user. The names table contains an auto incremented primary key as well as a name_unique which is a unique name to this table. Now assume that a user can login with their user_unique BUT they can choose any name they want. So multiple users will end up with the same name_unique. Inside logins it simple stores users.id (the primary key) and names.id (the primary key) as well as a timestamp. Here is where my problem lies. I want to show a \Table\Db of t…
Last reply by imJexs, -
- 3 replies
- 510 views
When attaching members for a notification, does it need so many of the members table columns as to warrant me using constructFromData() on a whole row? Or does it only need a few columns like member_id and their notification settings? (I sure hope their notification settings aren't in a whole different table where it would have to do an extra query for each attached member... I'm going to assume it's probably stored in one column in the members table as an encoded array, but I haven't had time to go through files looking.). The reason this all came up in my mind is because I was debating how important it is to select only the needed columns. But the more I think abou…
Last reply by bfarber,