Developer Connection
Use this forum to interact with our development team on technical issues, suggestions and official best practices advice.
1,680 topics in this forum
-
- 6 replies
- 254 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
- 193 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
- 187 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
- 233 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
- 311 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
- 277 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
- 254 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
- 218 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
- 197 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
- 221 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
- 330 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
- 283 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
- 2k 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
- 302 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
- 216 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
- 296 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
- 289 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
- 258 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
- 373 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
- 252 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
- 373 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, -
- 1 follower
- 8 replies
- 1.1k views
Hi, I am sorry if i am posting this in the wrong area, i hope not. Is there a way to dump all variables per template? Something like XF has? Example: {xen:helper dump, $visitor} Thanks.
Last reply by Bluto, -
- 2 followers
- 6 replies
- 278 views
Currently clearAll not support fine exclusion of more file, is possible to improve it for each store method? (like with a custom callback/regex/array) system/Data/Store/FileSystem.php /** * Abstract Method: Clear All Caches * * @return void */ public function clearAll( $exclude=NULL ) { foreach ( new \DirectoryIterator( $this->_path ) as $file ) { if ( !$file->isDot() and ( mb_substr( $file, -9 ) === '.ipsstore' or ( mb_substr( $file, -4 ) === '.php' and $file != $exclude . '.php' ) ) ) { @unlink( $this->_path . '/' . $file ); } } foreach( static::$cache as $key => $value ) { if( $exclude === NUL…
Last reply by BomAle, -
- 2 replies
- 361 views
I cant seem to work out how to query the db using two params, there's not really any documentation that I can find and I don't know how to read through the source code to check. Anyway I want to do the following query: SELECT columnname FROM `tablename` WHERE member_id = 1 AND somethingelse = 2 I have tried the following with no luck: $row = \IPS\Db::i()->select('coin_id', 'trader_holdings', array('member_id=?', $member_id, 'period=?', $period));
Last reply by Midnight Modding, -
- 2 replies
- 187 views
I did a tab bar like the one on this very page (qa). But on mine, unlike on this site, when I go to my page, the content from all tabs shows below it, while the page is loading, before going back beyond the tabs like it's supposed to be. I inspected elements on this page, and compared to my own and any time I saw any difference, such as some extra div, I added it in and it didn't improve anything. And for some reason mine has 2 cWidgetContainer divs whereas on this page of this site, there is only one. It's frustrating. I can't even get the content in a tab looking right. I tried to do one with the same look as the "About Me" profile tab by using the richte…
Last reply by Midnight Modding,