Developer Connection
Use this forum to interact with our development team on technical issues, suggestions and official best practices advice.
1,736 topics in this forum
-
- 3 followers
- 1 reply
- 342 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
- 293 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, -
- 1 follower
- 1 reply
- 345 views
Hello, is it possible to add image on Subcategories in news?
Last reply by opentype, -
- 2 followers
- 25 replies
- 703 views
When doing a tab bar using the ajax method, I noticed some odd behavior when testing something. I had 2 tabs. Each tab had a Table\Db table in it. Tab 1 had 1 result. Tab 2 had 0 results and said "nothing to show", or something like that. Well, for some reason, if I click one tab then the other, back and forth between them several times, suddenly the row from Tab 1 shows up in tab 2. Tab 2 still has all of tab 2's proper column headers, but instead of saying nothing to show, the actual row from tab 1 shows under tab 2's column headers. Also, I am pretty sure that on other pages where I have tabs using the ajax, they don't have to reload every time I click …
Last reply by Midnight Modding, -
- 2 replies
- 337 views
Hello, system/Content/Content.php /** * @brief [Content\Item] Include this content type in user profiles */ public static $includeInUserProfiles = TRUE; How this should work? I think this should hide a tab in user profile and exclude items or comments or reviews from activity. But this works with items only. Partly. Hide all tabs only. Example I created new event, added comment and review I want to hide Event Comments tab and exclude event comments. I added in applications/calendar/sources/Event/Comment.php /** * @brief [Content\Item] Include this content type in user profiles */ public static $includeInUserProfil…
Last reply by newbie LAC, -
- 4 followers
- 8 replies
- 899 views
Hey all, I am displaying multiple Db/Tables on the same page which causes them to no work properly. I am assuming this is because the javascript functions are trying to be called on each table etc. How do I differentiate the tables so that the javascript only works on one table at a time and does not call the other one? Do I need to create separate table controllers for each of them? Thanks!
Last reply by Midnight Modding, -
- 1 follower
- 1 reply
- 296 views
Hi, On exporting a plugin I experience that it exports it with a double try/catch-block <?php public function commentFormElements() { try { try { // My code } catch ( \RuntimeException $e ) { if ( method_exists( get_parent_class(), __FUNCTION__ ) ) { return call_user_func_array( 'parent::' . __FUNCTION__, func_get_args() ); } else { throw $e; } } } catch ( \RuntimeException $e ) { if ( method_exists( get_parent_class(), __FUNCTION__ ) ) { return call_user_func_array( 'parent::' . __FUNCTION__, func_get_args() ); } else { throw $e; } } } How to avoid this? …
Last reply by bfarber, -
- 1 reply
- 361 views
Hey, there is some leftover debug code (only active IN_DEV so it isn't critical) in "system/Helpers/Form/FormAbstract.php" on line 303: if ( \IPS\IN_DEV ) { echo '<pre>'; var_dump( $e ); exit; } Best Regards, Ahmad E.
Last reply by bfarber, -
- 1 follower
- 4 replies
- 319 views
Hi, The password advice popup behaves a bit strange when a form uses tabs:
Last reply by Adriano Faria, -
- 1 follower
- 10 replies
- 386 views
Hi, After finally completing version 1 of my application, I installed it on my production site. Everything works fine, except for my images. They appear to have been added to my uploads/set_resources_2 folder, but they do not show up anywhere where they are supposed to show. The source of the page just shows this: <img src="">. It works fine on my development installation. Here's an example from one of my template files showing how I include the images: <img src='{resource="Skins\Skin_{$character->model}.png" app="charmanager" location="global"}'> Any ideas what's going on here?
Last reply by Adriano Faria, -
- 2 followers
- 2 replies
- 286 views
What is IPS recommended approach for supporting the fileStorage extension in plugins? I've used "core_Theme" in the past for 1 or 2 images but what should we do for plugins that will store quite a few images?
Last reply by bfarber, -
- 2 replies
- 594 views
Hello! I'm attempting to set up an Invision Power Board forum as an OAuth2 Authentication Server and have a few inquiries. When defining scope for an OAuth2 parse against the 4.3+ API, how are the parameters defined? E.g. in the following url; https://www.<ipbsuite>/oauth/authorize?response_type=code&client_id=<client_id>&scope=/core/me&state=<randomlygeneratedstring>&redirect_uri=http://localhost:8080/login/oauth2/code/ips4 scope is set = to /core/me (for identification purposes), however this URL in practice returns a 403 (redirect URI is correct for testing purposes and the secret key is being passed as part of the bod…
Last reply by Sean Kelly, -
- 1 reply
- 312 views
Hi, is there any way to overwrite default syntax highlighting system in post and use something better (like highlight.js) with auto language detection? Can I overwrite default system or it will be better to add new custom button that will put code in code tag's and conifgure highlight.js to highlight all code tag's?
Last reply by bfarber, -
- 1 reply
- 245 views
I was trying something with the Table\Db helper. I used my own table and rows templates for it. I then did the following in the template: {{foreach $table->filters as $k => $q}} <li data-action="tableFilter" data-ipsMenuValue='{$k}' class='ipsMenu_item {{if $k === $table->filter}}ipsMenu_itemChecked{{endif}}'> <a href='{url="$something"}'>{lang="{$table->langPrefix}{$k}"}</a> </li> {{endforeach}} I can't remember exactly what $something was (have changed it back now), but the bottom line is this... it was a valid url. When I went and hovered over my filters, they indeed showed this same url I put…
Last reply by bfarber, -
- 3 replies
- 358 views
This is an error where it's unable to load a node when reordering nodes. How could the nodes even be listed, which would have had to been done through load($id), but then when reordering throwing an out of range exception? This is in a situation where I have a subnode class. So maybe I didn't do some step, which needs to be done to avoid this? Or is it a bug in the system when using subnodes? I am trying top look into it and figure out what's going on.
Last reply by Midnight Modding, -
- 1 follower
- 1 reply
- 341 views
Hi, I added a "Upload" field that allows multiple image uploads. How can I get the thumbnail of the image in the display options? This is what I have and I'd like that the <img> src would be the thumbnail. {{foreach $value as $foto}} <a href="{$foto}" data-ipslightbox-group="galeria" data-fullurl="{$foto}" data-ipslightbox="" class="lightbox-galeria"> <img src="{$foto}"> </a> {{endforeach}} On the other hand, if there's no image uploaded (because I set it to be optional), {$value} returns the URL base of the uploads folder. How can I avoid it? Cheers, Ibai
Last reply by opentype, -
- 1 follower
- 2 replies
- 347 views
Hi, I developed a Block that is working fine for me (as administrator). However, Members and Guest are getting a "EX0" error. When I point to System Logs I see: Error: Class name must be a valid object or a string (0) #0 /home/fmsite/public_html/system/Content/Content.php(498): IPS\Node\_Model->modPermission('view_hidden', Object(IPS\Member), NULL) #1 /home/fmsite/public_html/system/Content/Item.php(5651): IPS\_Content::modPermission('view_hidden', Object(IPS\Member), Object(IPS\cms\Categories)) #2 /home/fmsite/public_html/applications/cms/sources/Records/Records.php(670): IPS\Content\_Item::canViewHiddenItems(Object(IPS\Member), Object(IPS\cms\Categories…
Last reply by Ibai, -
- 11 replies
- 523 views
What is the best way to do a validation check for one $value in relation to another when one may not even be on the form at all and someone could sneak it into the url to affect request data? function( $val ) use( $item, $leader ) { if( $leader == '2' && $val == \IPS\Request::i()->team_leader ) Notice I did that $leader check because that is the same check that determined if 'team_leader' was to show on the form at all. Are my only options repeating the same checks like that or unsetting request data they may have snuck into the url to affect the form? I haven't checked to see when the form data is put into request, either. If at the time of me doi…
Last reply by Midnight Modding, -
- 3 replies
- 335 views
This is for a form in the acp. $form = new \IPS\Helpers\Form; $number = 1; foreach( $js as $j ) { if( $number === 1 ) { // Tab 1 $form->addTab( 'something' ); } elseif( $number === 2 ) { // Tab 2 $form->addTab( 'somethingElse' ); } $number++; foreach( $px as $k => $v ) { $form->add( new \IPS\Helpers\Form\Number( 's_' . $k, $pD[$v['t']['j_id']][$row->la]['b_ks'], TRUE, array( 'min' => 2 ) ) ); } } if I do that, where it has 2 tabs, it shows none of the form inputs in them! It only has the save button in each tab and that's it. If I get rid of that elseif, where it only has 1 tab set,…
Last reply by Midnight Modding, -
- 1 follower
- 2 replies
- 420 views
Hi, I'm trying to access the Rest & OAuth menu in the ACP, but it's asking me to put a htacces file in the api directory. I did it and renamed it .htaccess as asked but I still get the screen asking me to download it and put it in the api directory. I have no idea how to resolve this. Best regards The problem might be that I use nginx which is not supporting htaccess files. Can I have some help to convert what's inside this file to nginx config ? I'm pretty new into nginx and that would help me a lot : <IfModule mod_setenvif.c> SetEnvIf Authorization .+ HTTP_AUTHORIZATION=$0 </IfModule> <IfModule mod_rewrite.c> Optio…
Last reply by phreezie, -
- 21 replies
- 581 views
For quite a while I have noticed, on and off, just when being anywhere on my site, I get an exception saying my class could not be loaded. This is not within my app. So what types of things are done in 4.x, that could be done anywhere in the forums, and be trying to load my class? A task, I am assuming? In the exception message it looks like my class is named properly and it's the same class successfully loaded throughout my app. I actually haven't evenb added tasks yet.... so all I can think of is some extension, but whatever it is, it's something that only does this occasionally. I think in the message it said IPS\. Maybe somewhere I needed to put \IPS\ a…
Last reply by Midnight Modding, -
- 1 follower
- 15 replies
- 477 views
Hi, I know I asked this back in 3.x days and was told no, but is there anything in 4.x similar to transactions where in the rare case of the server having an issue in-between updating multiple related tables, there would not be a nightmare? Is it a limitation of php or mysql that it's not done? If so, how does IPS handle this in important situations, such as ones involving payments in commerce, etc...? I have a situation where I am storing various totals in multiple rows and adding them together to store the totals in a different table. What I was currently doing is only selecting one row from the "many" part of that 1: many relationship, and when the totals for that…
Last reply by Midnight Modding, -
- 2 followers
- 8 replies
- 389 views
Thought I'd turn to here since I can't quite figure out why this keeps happening, but when trying to insert language into one of my objects using addToStack method, seen in the 'text' property, I am returned with the md5 hashes of the lang key rather than the language that is defined in my lang.php. It also occurs in the formatInterval method - the string that is returned is a md5 hash. However, if I use get(), I can retrieve the language strings defined in lang.php. Anyone know why this is happening? Is it because it is not apart of the output stack? Thanks! // Add the service record $record = new \IPS\perscom\Records\ServiceRecord; $record->date = time(); …
Last reply by KT Walrus, -
- 1 follower
- 8 replies
- 420 views
My app is now on the marketplace. How do I generate purchases for specific users who I want to get the application for free and so that they can leave reviews?
Last reply by Ryan Ashbrook, -
- 6 replies
- 709 views
Does the IPS use any kind of framework such as Symfony, Laravel, Yii? I suspect the answer is no but I see so many companies adopt frameworks. Could I also get people's opinion on how they feel about these kinds of frameworks? Thanks.
Last reply by Midnight Modding,