Jump to content


[[Template core/global/global/lkeyWarning does not exist. This theme may be out of date. Run the support tool in the AdminCP to restore the default theme.]]


Popular Content

Showing content with the highest reputation on 01/04/2019 in all areas

  1. 2 points
    I applied for Braintree long ago and they denied me with zero explanation. Only said my site was unfit. No option for appeal. They can kiss my ***
  2. 1 point

    Different theme for Mobile

    It would be great to be able to select one theme to work for mobile devices and one theme to work for desktop.
  3. 1 point

    Post to PM

    Hi, I install your plugin on IPS 4.3.6 Does it work on 4.3.6, if so can you tell me where to find the button to click for sending the Pm to the user? Thanks Ignore my post as I found it. The little envelope icon beside the report post button.
  4. 1 point
    If you type a few paragraphs of text as a club description, it displays as a single block of text on the club index. If you edit it again, the paragraphs are still present.
  5. 1 point

    CKEditor 5

    The answer to that is "No". Version 4.4 will use CKEditor 4.11.0 (see this post).
  6. 1 point

    Version 1.0.3


    Keeps track of the number of registered members that have visited your site in a custom duration and also records which day you set the record for the most members online in the same day all options done via the front settings and Admin CP. Features Show online users for how many hours ago. Who Can See. Show Stat. Limit Maximum Number of The List. Groups To Exclude From the Link. Order Users Link By. Sort Type. Show user photo. NEW User photo size. NEW


  7. 1 point

    External Links Rich Embed

    I don't use many plugins on my site, but this plugin is definitely a must-have plugin for any community. It works perfectly! 👍
  8. 1 point

    Future of 3 party apps

    This should independently be decided from case to case. Talking about the "money cows" and how to avoid them: The solution to this is imo to certify (and award and visually indicate) highly honored developers. Don't punish other developers and the community members if the reason for forbidding transfers is only to break a bad habit.
  9. 1 point
    Most of the classes you will work with while using Nodes and Content Items will extend \IPS\Patterns\ActiveRecord. Objects of this class represent a row in the database table. It is important that you use the methods provided by this class rather than calling the database directly, as when you add additional features to your content item, the methods will perform more complicated tasks. static load( int $id ) A factory method that retrieves record from the database and returns an object of your Content Item class. Results are cached so if you load the same item twice, a second database query will not be made and both calls will return the same object (the same object by reference - not a copy of the object). Example: $item = YourClass::load( 1 ); static constructFromData( array $data ) If, for some reason, you do need to select data directly from the database (for example, if you want to get the most recent record), and you have an array containing a row from the database, the constructFromData method allows you to create an object out of that data, without having to call load which would make another (unnecessary) database query. Example: $item = YourClass::constructFromData( \IPS\Db::i()->select(...)- >first() ); __get( mixed $key ) __set( mixed $key, mixed $value ) Though you do not call these methods directly - magic getters and setters allow you to get and set the values in the database row. A static property, $databasePrefix, can be set if all the columns in your database table start with the same prefix, then you do not need to included that. For example, let’s say your database table looks like this: item_id item_title item_author 1 Foo 1 2 Bar 1 6 item_id item_title item_author 3 Baz 1 You would set $databasePrefix: static $databasePrefix = 'item_'; You would load the first row like so (it will automatically look for columns called “id”): $item = YourClass::load( 1 ); And could then get the title like so: echo $item->title; If you want to override the behaviour for any particular column (for example, if you have a database column which stores a timestamp, and you want the getter/setter to handle \IPS \DateTime objects) you can define methods called get_<key> and set_<key>. In these methods the $_data property stores the raw values. For example: public function get_date() { return \IPS\DateTime::ts( $this->_data[‘date’] ); } public function set_date( $value ) { $this->data[‘date’] = $value->getTimestamp(); } save() After changing any properties, you must call the save method to actually save those changes to the database. Example: $item = YourClass::load( 1 ); $item->title = 'New Title'; $item->save(); delete() The delete method deletes the item from the database. Example: $item = YourClass::load( 1 ); $item->delete(); 7 __clone() A magic method exists to automatically adjust the primary key when you clone an item; Example: $item = YourClass::load( 1 ); $copy = clone $item; $copy->save(); echo $item->id; // 4 Bitwise Flags The ActiveRecord class provides special features to facilitate bitwise operation, allowing you to use one INT column in your database to store multiple binary values. To do this, you can define a static $bitOptions property in your class like so: public static $bitOptions = array( 'bitwise_column' => array( 'bitwise_column' => array( ), ), ); 'property_1' 'property_2' 'property_3' => 1, => 2, => 4, In this example, there is a database column (bitwise_column) storing bitwise data (if you needed to store more values than could be stored in a single INT field, you could add additional columns). This column stores 3 boolean values (property_1, property_2 and property_3). When defining properties, you must define them with the numeric value they will be represented by, so the number must double each time (1, 2, 4, 8, 16, etc.). The ActiveRecord will automatically provide an \IPS\Patterns\Bitwise object for this column, which implements \ArrayAccess. You can get and set values as if it was an array: /* Getting a value */ if ( $object->bitwise_column[‘property_1’] ) { // . . . } /* Setting a value */ $object->bitwise_column[‘property_2’] = FALSE; $object->save(); /* Getting database rows */ $rowsWithPropery1AsTrue = \IPS\Db::i()->select( ‘*’, ‘table’, \IPS \Db::i()->bitwiseWhere( \IPS\YourClass:: $bitOptions['bitwise_column'], 'property_1' ));
 8 Notes Class Definition When you create classes ion the IPS Community Suite, you will always define your class with a preceding underscore. Even though you do this, you do not call it with the preceding underscore. This is a technicality of how autoloading works. loadAndCheckPerms There is a method, loadAndCheckPerms( int $id ) which is common to all the classes worked with in this document, though it is not part of \IPS\Patterns\ActiveRecord. By default, it behaves the same as the load( int $id ) method provided by \IPS \Patterns\ActiveRecord, however, as you add additional features, it will check appropriate permissions. For example, once you implement front-end permissions, it will throw an OutOfRangeException if the currently logged in user does not have permission to view the object. Similarly, once you implement hiding content, it will throw an OutOfRangeException if used to load a hidden object and the currently logged in user does not have permission to view hidden objects. You should therefore always use this method over load( int $id ) when loading nodes, content items, comments and reviews on the front-end, or in any code called from the front-end.
  10. 0 points
    Joel R

    CKEditor 5

    I asked IPS about Ckeditor 5 because I liked the inline and balloon toolbars. @Mark slapped me down. Hard. My cheeks still sting from the slapdown LOL. Something about IPS would need to rewrite all of their plugins, we would lose some of the features that IPS needs, and current version is supported until 2023. So that's a hard no. Not until Invision Community 5 maybe or later.
  • Create New...