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 reply
- 320 views
Im just trying to get my head around the namespaces and how to use them. How would I go about loading the post comment object? Am I close? $post = \IPS\Content\Item::load( pid ); pid is obviously being the post id. Also is there any documentation for seeking the namespace classes and what methods are available to each of them?
Last reply by newbie LAC, -
- 1 follower
- 2 replies
- 329 views
One of my clients makes heavy use of the Custom package option to create special packages for some of their customers. One of the things we're having trouble with is editing the package once it's been created. I don't see anywhere in the code where we can edit these properties. Does that exist? If not, can it? Thanks.
Last reply by Mark, -
- 3 replies
- 307 views
Hi, I am using the REST-API to create members on demand. It is kind of a data-transfer from another community-database. Everything is working fine, until I get an user with a special char in it's name - let's say "Gérome". The API creates a user called "G", everything starting from the special char is truncated. If I understood correctly, the function "http_build_query" should encode the data accordingly. Manually creating an user with this name works as expected. Anyone having an idea what is missing here? $querydata = array( 'name' => 'Gérome', 'password' => 'test123', ); $curl = curl_init( $communityUrl . 'api' . $endpoint ); …
Last reply by bfarber, -
- 3 followers
- 0 replies
- 318 views
Alright, we all love pages, well, mostly. I have clients that use pages heavily, almost ungodly so, and they are always like "we want to use pages to do this really really complicated thing". they love the custom building of the form, that is like the biggest thing they love about it, but they are always wanting a little more than pages can offer. so on some of their complex things, they have to either have me make hooks for them or actually build an app. so here are my glorious suggestions for pages: Adding a Pseudo Hook system: when creating/editing a database, if i am using categories or turn on reviews/comments, have a tab appear where i can ove…
Last reply by CodingJungle, -
- 2 replies
- 290 views
My app adds a field in registration screen ( \IPS\core\modules\front\system\register\buildRegistrationForm() ) $form->add( new \IPS\Helpers\Form\Text( 'invite_code_req', NULL, TRUE, array( 'maxLength' => 32 ) ), 'password_confirm' ); It should appear AFTER the Confirm Password field. But it doesn't: So I installed a plugin that I've made a quite while ago and it works fine IF my app is disabled: If I enable my app, then: I already removed and made my hook from the scratch but it's enough my app to be enabled and the positions aren't respected. Where else, apart from the hook file itself, can I check to see what is happen…
Last reply by Adriano Faria, -
- 2 followers
- 4 replies
- 403 views
Hello, a client contact me for a simple fix for tapatalk uploads/attachments I have fixed with following code, but why not add proxy images into lightbox images group? <script type="text/javascript"> ;( function($, _, undefined){ "use strict"; ips.controller.mixin('tapatalkAttach', 'core.front.core.lightboxedImages', true, function () { this._initializeImages = function () { var self = this; var images = this.scope.find('img'); if( !images.length ){ return; } this.scope.imagesLoaded( function (imagesLoaded) { if( !imagesLoaded.images.length ){ return; } _.each( imagesLoaded.images, function (image, i) { var…
Last reply by BomAle, -
- 1 follower
- 4 replies
- 461 views
The variable documentation seems a little lacklustre, and I can't seem to find any reference to how these variables are actually passed to the templates. For example if I wanted to pass a variable i called $balance to a particular template file, how would i do so? I know that I can add it to the list of variables in the tempalte editor, but where do those variables actually get sent from?
Last reply by bfarber, -
- 1 follower
- 1 reply
- 332 views
$table->joins = array( array( 'select' => 'othertable.*', 'from' => array( 'myapp_othertable', 'othertable'), 'where' => "myapp_firsttable.id=othertable.other_id" ) ); How can I access to othertable fields on template row? My table is generated with: $table = new \IPS\Helpers\Table\Content... but If I debug the object in template row I can't see "othertable" fields.
Last reply by Adriano Faria, -
- 1 follower
- 0 replies
- 240 views
I've run into this far too often, trying to have a theme and app developed at the same time, and the two clash with each other. The problem is this, the structure for IN_DEV and Designer mode are different from each other, which forces at least 3 sub-repo (css/html/resources) along with the theme's repo and the app's repo. then this becomes increasing ludicrous, when there is more than one app is being developed. you'd end up having at least 9 repo's ( 6 for the css/html/resources, 2 app repo's, 1 theme). We could also just have 1 repo, where we just push everything to it (including IPS files), but this has its own set of problems. It is time consuming as it is to h…
Last reply by CodingJungle, -
- 2 replies
- 263 views
I have a plugin which takes RSS input and displays the images Now I am no more adding images- so output remains same... I want to showcase random 10 images So is it possible to have such RSS feed
Last reply by Saurabh Jain, -
- 1 follower
- 1 reply
- 317 views
I would suggest changing as follow the js controller of navBar improve condition to check if add a menu item into more menu, outerwidth only if navMore contain a child, this way more menu is counted only if has child <script type='text/javascript'> ;( function($, _, undefined){ "use strict"; ips.controller.mixin('test', 'core.front.core.navBar', true, function () { this.lengthMore = function (bar) { if( bar.is('[data-role="primaryNavBar"]') ){ if( this._usingSubBars ){ return bar.find('> [data-role="navMore"] > [data-role="secondaryNavBar"] > li').length; } else { return this.scope.find('#elNavigationMore_dropdown_menu &g…
Last reply by bfarber, -
- 1 follower
- 43 replies
- 814 views
Any tips on my upgrade routine? In 3.x I did not use a built in file upload system, I uploaded them with my own code, and so I need to know the easiest way of updating those AND also I guess I need to go through updating titles to the custom lang bits, right? Any easy built in way to do that in mass without me writing something? I'm finished as a fresh install, and I just tested my memberSync and moving files to resources/ (had them elsewhere…) and all is great, so upgrade routine, then done. (also had already thoroughly tested and got bugs ironed out everywhere.)
Last reply by Midnight Modding, -
- 3 followers
- 5 replies
- 1k views
The IPS AdminCP infers that I can use Google Fonts or @font-face to use a custom font not available in IPS natively; however, I am unable to determine if the custom font can be injected into the software in a seamless way (i.e., added to the list of available fonts shown below?): I see that @font-face is in injected via css according to these choices and understand that 'default' will use the font as defined in the native css (i.e., HelveticaNeue), but I cannot see the stylesheets so assume that is all in the DB. How should I inject my custom font installed locally on the server using @font-face css? I can load my custom css by editing the global template …
Last reply by Pete T, -
- 2 followers
- 23 replies
- 729 views
So, it's been a while for me since i've done some plugins, now i'm trying getting back to it.. I've created plugin, for this plugin i've created a hook file, and no matter what i put inside of it, every time it throws error that's how my hook file looks like: //<?php /* To prevent PHP errors (extending class does not exist) revealing path */ if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) ) { exit; } class hook28 extends _HOOK_CLASS_ { $variable = "value"; }
Last reply by szalik.dev, -
- 1 follower
- 3 replies
- 283 views
This feels very much like a bug, but the IPS core code appears to deliberately work around it. If you delete a task in the dev center, it removes the task on the dev install (including the task's PHP file), and removes it from the tasks.json file so it isn't installed on any new installs. However, when the app is updated on an existing install it only updates existing tasks and adds new ones - it doesn't delete the tasks that are no longer required. For a traditional setup, this results in the task continuing to be run, because the old PHP file won't be deleted. I deploy most of my stuff through git, so for me and some other large sites this results in the task faili…
Last reply by bfarber, -
- 1 follower
- 2 replies
- 378 views
How do I add an icon to my application?
Last reply by LZDigital, -
- 1 follower
- 3 replies
- 343 views
Hello, I wanted to suggest changing this: /* Protected Groups */ if ( $owner->inGroup( explode( ',', \IPS\Settings::i()->reputation_protected_groups ) ) ) { return FALSE; } into a better way to check if there is a group (primary or secondary) authorized to receive reaction.
Last reply by BomAle, -
- 9 replies
- 787 views
For some reason, while running a task its unable to find the class '\IPS\avovix\Request' when running a foreach loop with an ActiveRecordIterator namespace IPS\avovix; /* To prevent PHP errors (extending class does not exist) revealing path */ if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) ) { header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' ); exit; } class _Request extends \IPS\Patterns\ActiveRecord { const STATUS_PENDING = 'pend'; const STATUS_COMPLETED = 'comp'; const STATUS_FAILED = 'fail'; /** * @brief Multiton Store */ protected static $multitons; /** * @brief Database Table */ public…
Last reply by newbie LAC, -
- 1 reply
- 256 views
Hello, Please add the ability to specify multiple venues as you did for $calendar /** * Retrieve events to show based on a provided start and end date, optionally filtering by a supplied calendar * * @param \IPS\calendar\Date $startDate Date to start from * @param \IPS\calendar\Date|NULL $endDate Cut off date for events. NULL accepted as a possible value only if $formatEvents is set to FALSE. * @param \IPS\calendar\Calendar|NULL|array $calendar Calendar to filter by * @param int|null $limit Maximum number of events to return (only supported when not formatting events) * @param bool $formatEvents Whether or not to f…
Last reply by bfarber, -
- 8 replies
- 367 views
Through testing, in my app, there was an "incorrect string value" exception. I glanced in the database and noticed that my own apps' tables are not the same collation as the IPB ones. Mine say utf8, and the ones IPS updated for 4.x say utfmb4_. Since I already have my schema all set up and am basically done with this app, what is the best way for me to update my tables since they weren't the right collation when I imported them into db schema? And can you tell me exactly the steps in me doing this? I assume these was indeed what would cause that error I mentioned? It was when trying to save editor data with emoticons in my table. And I guess I should d…
Last reply by Midnight Modding, -
- 1 reply
- 285 views
Hi, I was wondering if it's possible to split payment with the IP Commerce (programming or via the settings tab https://developer.paypal.com/docs/classic/adaptive-payments/integration-guide/APIntro/) and my other question is how would I go about adding custom onpay functions for some of the products? (I wanna keep using the original onpay function for the other products) Thanks
Last reply by bfarber, -
- 1 follower
- 6 replies
- 417 views
Is there a class/function I can use to create a new member programmatically? So, I pass in the necessary parameters, such as display name, email, password, etc. And it creates an account?
Last reply by Tom S., -
- 1 reply
- 355 views
In the vein of this: And in the train of thought of avoiding doing this: Can the hunk of code that actually 'follows' and 'unfollows' things in IPS\core\modules\front\system\notifications be abstracted out to actually be on the item/node object, or anywhere it could actually be reused? The above reason is not the first time I have needed to control follow status dynamically, and currently such strays extremely close to a direct copy-past of a large chunk of code that is not desired to be maintained by me, and falls foul of the license agreement.
Last reply by bfarber, -
- 3 followers
- 1 reply
- 334 views
Hi, I've created plugin, which should ONLY connect to external database (i've accomplished that) and now i want to use this connection in second plugin. I'm using this plugin as "core" and some kind of protection (when somehow anyone gets my plugins, they can't use it without it) I will be gratefull for any answers! 🙂
Last reply by bfarber, -
- 2 replies
- 285 views
When looking through the MySQL slow query log I saw a lot of references to "IteratorIterator::rewind::xxx" in the query comment. Those aren't exactly helpful when trying to identify a slow query. My proposal here is to add that class to the list of ignored classes in \IPS\Db::preparedQuery. Thanks.
Last reply by bfarber,