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
- 11 replies
- 604 views
Is there a tutorial anywhere that goes through the entire process of creating an app from start to finish? I'm finding the documentation to be very poor.
Last reply by bfarber, -
- 1 follower
- 3 replies
- 285 views
I have created a custom field in database of type Upload (Allow multiple). I would like to display uploaded images in the Lightbox widget. In the description of Display custom field is stated: If using mulitple uploads, $value is an array of File Objects. However it seems to be an array of strings and not File Objects, as this code fails: Error: Call to a member function thumbnail() on string (0)
Last reply by Daniel F, -
- 1 follower
- 1 reply
- 358 views
I reviewed some changes between 4.4.7 and 4.4.9.2 and found the following change for Output.php, line 658 --- a/public/system/Output/Output.php +++ b/public/system/Output/Output.php @@ -658,9 +658,19 @@ class _Output } } + /* Allow this page to be cached by guests? */ + $allowGuestCache = FALSE; + if ( $httpStatusCode == 404 or $httpStatusCode == 403 and ! \IPS\Member::loggedIn()->isBanned() and ! \IPS\Request::i()->ipAddressIsBanned() ) + { + $allowGuestCache = TRUE; + } + + // Do not cache error page…
Last reply by bfarber, -
- 4 replies
- 388 views
Hello, I'm working on plugin and use \IPS\Helpers\Form\Node 'toggleIds' => array(), // Element IDs to toggle on when a node with 'togglePerm' permission IS selected - or, if togglePerm is NULL, an associtive array of elements to toggle when particular node IDs are selected if togglePerm is NULL, an associtive array of elements to toggle when particular node IDs are selected But this doesn't work \applications\core\dev\html\global\forms\nodeCascade.phtml {{if $togglePerm}}data-control="toggle" {{if $node->can( $togglePerm, NULL, $togglePermPBR )}}data-toggles="{expression="implode( ',', $toggleIds )"}"{{elseif !$togglePerm and iss…
Last reply by bfarber, -
- 1 follower
- 5 replies
- 313 views
I need to know how I can use a API or anything by which I can subscribe or unsubscribe for reply/comment of a topic. Also tell me if a user comment under a topic then will that user automatically will be subscribe for email notification for that topic for further comments? If anyone can tell me how it is stored on database that will be very helpful as i need use database table for custom code. Thanks
Last reply by RRK, -
- 1 follower
- 3 replies
- 380 views
I created a new type of profile field but I can't seem to find how to use my own template as it doesn't has a class on form helper due to that in CustomField model: /** * Build Form Helper * * @param mixed $value The value * @param callback $customValidationCode Custom validation code * @return \IPS\Helpers\Form\FormAbstract */ public function buildHelper( $value=NULL, $customValidationCode=NULL ) { $class = '\IPS\Helpers\Form\\' . $this->type; /* Hooks can add custom field types which are stored in the database. Toggling the hook can then stop the hook from loading the field class giving a class not found error */ if ( ! class_exists( …
Last reply by bfarber, -
- 1 follower
- 1 reply
- 392 views
I have a \IPS\Content\Item class that implements \IPS\Content\Searchable. I've successfully gotten it to display arbitrary content in the search snippet in expanded view: I have not, however, succeeded in getting anything in condensed view. Other content items have a "user posted a ___ in ___", but mine shows nothing: When I look at the other applications shown in this picture, this isn't stored in the snippet template. As far as I can tell, something's displaying the language item "x_created_(class)" or "x_created_(class)_in" here, but I don't know how to tell the system to do so for my content item. Simply making sure those language items exist isn…
Last reply by evandixon, -
- 1 follower
- 13 replies
- 456 views
I shall win the "weirdest bug found" award this year for this one! just watch the video, i am not going to be able to explain this one, you just gotta see it to believe it 🙂
Last reply by bfarber, -
- 2 followers
- 4 replies
- 397 views
I need to have a background task to replace some content in some posts. Example post: <blockquote class="ipsQuote" data-gramm="false" data-ipsquote="" data-ipsquote-contentapp="forums" data-ipsquote-contentclass="forums_Topic" data-ipsquote-contentcommentid="24552935" data-ipsquote-contentid="1819682" data-ipsquote-contenttype="forums" data-ipsquote-timestamp="1534422313" data-ipsquote-userid="278655" data-ipsquote-username="Slettet-lYlo5C"> <div class="ipsQuote_citation"> TSPbot2 skrev (På 16.8.2018 den 14.25): </div> <div class="ipsQuote_contents ipsClearfix" data-gramm="false"> <p> This is my post <a href="https://w…
Last reply by bfarber, -
- 2 replies
- 273 views
Hello, system/Task/Task.php if ( method_exists( $extensions[ $key ], 'preQueueData' ) ) { $class = new $extensions[ $key ]; $data = $class->preQueueData( $data ); if ( $data === NULL ) { return; } } Based on DocBlock the method preQueueData() should return an array /** * Parse data before queuing * * @param array $data * @return array */ public function preQueueData( $data ) Ok. You allow to return NULL as you do in some background tasks. But a queue will not be run (added into core_queue table) and the method postComplete() will not be executed. Examples - applications/core/extensions/core/Queue/Re…
Last reply by Daniel F, -
- 1 reply
- 279 views
I'm having a really frustrating experience with this "CSS selector" feature. I'm simply trying to disable the "Show results" button in polls. I can successfully control other elements of the poll's rendering, but anything "deep" doesn't seem to be targetable. I've tried the built in picker. I've tried manual selectors. I've verified in a browser that they select one and only one correct element. It simply doesn't do anything. What am I not understanding? Example #1: Replacing the entire pollcontents works div.ipsPad.ipsClearfix[data-role='pollContents'] Correct: Example #2: div.ipsPad.ipsClearfix[data-role='pollContents'] ol.ipsList…
Last reply by Matt Summers, -
- 5 replies
- 385 views
Hello, $form->add( new \IPS\Helpers\Form\Upload( 'video_test', null, false, array( 'allowedFileTypes' => array( 'mp4' ), 'storageExtension' => 'app_Extension' ) ) ); Uploaded video
Last reply by bfarber, -
- 1 reply
- 306 views
Hello, Simple abstract code $table = new \IPS\Helpers\Table\Db('app_records', \IPS\Http\Url::internal('app=app&module=module&controller=controller')); $table->exclude = array('record_id'); $table->advancedSearch = array( 'record_member_id' => \IPS\Helpers\Table\SEARCH_MEMBER, ); \IPS\Output::i()->output = $table; generates an error array_key_exists() expects parameter 2 to be array, null given File: \system\Helpers\Table\Db.php Line: if( ( ( $this->include !== NULL and !\in_array( $k, $this->include ) ) or ( $this->exclude !== NULL and \in_array( $k, $this->exclude ) ) ) and !array_key_exists( $k, $advan…
Last reply by bfarber, -
- 1 follower
- 2 replies
- 336 views
I discovered something while investigating an issue. When a post with a quote is submitted to the database it stores it like this: <blockquote class="ipsQuote" data-gramm="false" data-ipsquote="" data-ipsquote-contentapp="forums" data-ipsquote-contentclass="forums_Topic" data-ipsquote-contentcommentid="25160025" data-ipsquote-contentid="1840499" data-ipsquote-contenttype="forums" data-ipsquote-timestamp="1573983633" data-ipsquote-userid="58981" data-ipsquote-username="TSP"> <div class="ipsQuote_citation"> TSP skrev (Akkurat nå): </div> <div class="ipsQuote_contents ipsClearfix" data-gramm="false"…
Last reply by CoffeeCake, -
- 6 replies
- 375 views
Hello, I'm adding a send message button in the stock records display template in pages. I can't seem to get the message to display the article posters name when the message pop up comes up. I'm using this code here <a href='{url="app=core&module=messaging&controller=messenger&do=compose&to={$member->member_id}" seoTemplate="messenger_compose"}' data-ipsDialog data-ipsDialog-title='{lang="compose_new"}' data-ipsDialog-remoteSubmit data-ipsDialog-flashMessage="{lang="message_sent"}" class='ipsButton ipsButton_primary ipsButton_small'><i class='fa fa-envelope'></i> <span> {lang="message_send"}</span></a> …
Last reply by DesignzShop, -
- 1 reply
- 375 views
Everytime I update (since 4.4.6) it resets the default_theme on init.php: // Default theme ID // It isn't really possible to change this but we have it defined as a constant rather // than putting "1" everywhere in the code just in case. If you deleted theme ID 1 and attempt to // build a custom application as a developer, you may need to override this value to specify a new // default/unmodified theme. 'DEFAULT_THEME_ID' => 1, I'm already on theme ID 44 due to that and I have to edit it everytime I update the board.
Last reply by Ryan Ashbrook, -
- 3 followers
- 3 replies
- 358 views
It will certainly be my fault but I waste a lot of time to find the issues that are reported to me by whoops. In this case for example I have a warning generated in the FormAbstract.php that had never happened to me: // from: /Users/sviluppo/Documents/sites/44x.test/system/Helpers/Form/FormAbstract.php THIS IS THE ERROR: "var_dump(): Property access is not allowed yet" full stack report also a file in my app but with no comments. // from: /Users/sviluppo/Documents/sites/44x.test/system/Dispatcher/Controller.php Any advices on what and where to look?
Last reply by bfarber, -
- 1 follower
- 2 replies
- 317 views
I came over this by accident and not really sure what problems it'll cause, if any. But something seems very wrong to me, unless I'm missing something. The reason I came over it is because on this community we've never used the archive posts feature, and so I was investigating whether I could just delete the task for the \IPS\forums\Topic\ArchivedPost class. Which I at first ended up concluding I can do in theory, but then I discovered it actually changes values for rows in the reputation index anyway, even when the rows in question have already been changed for the queue task for the IPS\forums\Topic\Post-class. When upgrading from 3.4 to 4.4 you kick off tw…
Last reply by TSP, -
- 1 reply
- 405 views
The exception above has been recently reported to me, it can occur when using \IPS\Member\Group::groups() in tasks executed by cron. In \IPS\Member\Group::getStore() i found the following code: if ( !isset( \IPS\Data\Store::i()->groups ) ) { \IPS\Data\Store::i()->groups = iterator_to_array( \IPS\Db::i()->select( 'core_groups.*', 'core_groups', NULL, 'core_sys_lang_words.word_custom' )->join( 'core_sys_lang_words', array( "lang_id=? AND word_app=? AND word_key=CONCAT( 'core_group_', core_groups.g_id )", \IPS\Member::loggedIn()->language()->id, 'core' ) )->setKeyField( 'g_id' ) ); } # …
Last reply by bfarber, -
- 1 follower
- 1 reply
- 274 views
In background tasks and upgrade tasks you generally seem to like updating the database even though the values you'd like to update is the same. I can understand that this might make sense to do in some circumstances, but in cases where it's not much extra work to check if it's the same values, it could speed up the execution of background tasks and upgrade processes quite a bit. As an example of a background task that I saw benefit from this is: applications/forums/extensions/core/Queue/TopicStarterIds.php In the majority of cases the initial value will be correct, so it doesn't make sense to spend time updating every row. As an added note: t…
Last reply by bfarber, -
- 1 follower
- 4 replies
- 412 views
There was a thread saying we should not copy large part of the IPS core code. I agree, I do not like to copy something that already exists. I have asked several times before but have not get any answer. That's why I try again here. Is there any default templates we can use to output to the frontend: category nodes to browse through content items to browse through content item including moderation functions, report, follow buttons and so on. comments for the content item reviews for the content item I just need Yes/No answer for each list item above. And if Yes then what template to use. If No, then it would mean I have to copy large…
Last reply by Sonya*, -
- 9 replies
- 441 views
Hi, I only found one reference to TypeScript in the forums. I assume TypeScript is not supported or unpopular? I would like to port a complex Swift iPhone app ( https://www.PsychologyByNumber.com ) to a web-based application to support non-iPhone devices. The Javascript language is too simplistic. I need true class inheritance and Swift-like enum support. How have you solved around this problem? Thanks, Mike
Last reply by bfarber, -
- 1 follower
- 1 reply
- 392 views
Which Bootstrap is compatible with IP.Board 4.4.7?
Last reply by bfarber, -
- 1 reply
- 327 views
I've noticed a recurring template_error logged in ACP, after looking into it some more it seems to be thrown when someone replies to a status update on a profile and ES tries to index it. Here's the message and backtrace: TypeError: Argument 1 passed to IPS\Content\Search\Elastic\_Index::getIndexId() must implement interface IPS\Content\Searchable, instance of IPS\core\Statuses\Reply given, called in /public_html/system/Content/Search/Elastic/Index.php on line 888 and defined in /public_html/system/Content/Search/Elastic/Index.php:403 Stack trace: #0 /public_html/system/Content/Search/Elastic/Index.php(888): IPS\Content\Search\Elastic\_Index->getIndexId(Object(IPS\…
Last reply by Ryan Ashbrook, -
- 2 followers
- 3 replies
- 347 views
Hi, I'm going through the upgrade code for 3.4 -> 4.x. In applications/core/setup/upg_40000/upgrade.php I found what appears to be an unused variable. Around line 2410 you have the following code: <?php if( \is_array( $data ) AND $_decoded ) { $newPoll = array(); foreach( $data as $_key => $_data ) { if( isset( $_data['question'] ) ) { $data[ $_key ]['question'] = utf8_encode( $_data['question'] ); if( \is_array( $_data['choice'] ) ) { foreach( $_data['choice'] as $_idx => $_choice ) { $data[ $_key ]['choice'][ $_idx ] = utf8_encode( $_choice )…
Last reply by bfarber,