Jump to content



  • Posts

  • Joined

  • Last visited

  • Days Won


 Content Type 



IPS4 Providers

Release Notes

IPS4 Guides

IPS4 Developer Documentation

Invision Community Blog



Everything posted by Numbered

  1. upd2.: in older time my custom scripts worked good just because i like to use 'hummber' logic. When i call load member, which are not exist and cheked it by null value of member_id returned i set up $member->member id = $already_known_member_id (i already know who i want to load) and calling save with that 'hummer' which provide same result. But i was sure about just load and save will save right member_id which i called in load. I was wrong and it's strange in my mind) Sry for a lot of text. It's funny shock effect
  2. Just now i understand my wrong understanding of load method) if i try to load member by his id, which is not exist on forum ($member = \IPS\Member::load(123456789)->member_id - returned null), set some params $member->name = 'somename'; and call $member->save() - it will save with new member_id from auto_increment value. But i tried to load 123456789! Why it saved in other id filed value? I follow the code changes in ActiveRecord and Member classes and nothing changed finded . My older scripts set $member->member_id = 123456789; in older time before calling ->save(); just for reliability and all worked well. So here is my proposal for improvement. If we try to load member with some id and from catching OutOfRange exception with return new empty member object - may be better for return calling member_id in _new->member_id filed? It will be very logic. For make it we can simply change current that load method public static function load($id, $idField = null, $extraWhereClause = null) { try { if ($id === null OR $id === 0 OR $id === '') { $classname = get_called_class(); return new $classname; } else { $member = parent::load($id, $idField, $extraWhereClause); if ($member->restrict_post > 0 and $member->restrict_post <= time()) { $member->restrict_post = 0; $member->save(); } return $member; } } catch (\OutOfRangeException $e) { $classname = get_called_class(); return new $classname; } } to that: public static function load($id, $idField = null, $extraWhereClause = null) { try { if ($id === null OR $id === 0 OR $id === '') { $classname = get_called_class(); return new $classname; } else { $member = parent::load($id, $idField, $extraWhereClause); if ($member->restrict_post > 0 and $member->restrict_post <= time()) { $member->restrict_post = 0; $member->save(); } return $member; } } catch (\OutOfRangeException $e) { $classname = get_called_class(); $newMember = new $classname; if ($idField === null) { $idField = static::$databasePrefix . static::$databaseColumnId; } $newMember->$idField = $id; return $newMember; } } Extremely logic and good! Yep it's not a bussiness idea or something, which can provide happy to a lot of people. It's just little thing, which will make your powerful platform better. Current logic for example: $member = \IPS\Member::load(123456789); // this member_id is not exist $member->name = 'name'; $member->save(); echo $member->member_id; // return every time new auto_increment id, not 123456789 Newer logic: $member = \IPS\Member::load(123456789); // this member_id is not exist $member->name = 'name'; $member->save(); echo $member->member_id; // return 123456789 and next this calling return already exist member with member_id 123456789. Perfect! Thanks for your attension upd.: And all current scripts not broke by this update. Because newer member_id field puts on object _new part. Not directly. So some other scripts, which call $member = \IPS\Member::load(123456789); if (null !== $member->member_id) { // ... } still working right.
  3. On 4.2.6 fixed a bug with that. Message, when user should get a message 'reaction limit exceeded per day' is not worked. Did you update your community to 4.2.6? More info in my old topic: If you on 4.2.6 and got this message - show the response from ajax request of reaction set. This can help us to detect what data IPS response for that action.
  4. Confirmed in support. Will be fixed in dev branch of 4.3 (as said).
  5. Excellent! Can we wait same logic to MySQL connection for use master for write operations and slave for reading?
  6. I am sorry. My english understand (and write abilities too) is not good. So it's a misscommunication About PMA i can't help you clear. Not use it at all. Anyway somewhere it must has 'export' section, where you can choose a format (excel, csv, etc) to export. Not sure about specail column select param, but you can easy clear it after full export. Try to open that table on the left side. I think it shoud open some structure shown with a tabs, where may be exist some export buttons.
  7. Which source of that numbers 600 and 55k? You can count number of records in table with query 'select count(*) from core_members'. I think pma not show all and use pager with 600 rows per page, is'nt it? Anyway, i recommend just learn IPS architect - it will be positive for futher development. But with that knowing and without deep experience with the framework i recommend to didn't change anything directly in db from any source (hand, third party scripts, etc). For any your task better way to do anything with framework methods. For example - good way for create new member - call $member = \IPS\Member::load($id). If $member didn't have member_id - so it not exist on forum, else - present. After that change any params, like $member->email = 'some@example.com', change other params (i dream it's something sync updater) and after all call $member->save() - will save that new member (or change params on already exist member). I already said which way you need to prefer for learning to create data sync with other databases. Get it And of course ask anything if you get a trouble on some step. There are a lot of good and nice developers, which like to help (and make attenstion if you start doing something not good)
  8. Can be good choise for create clubs for specific languages here) But i think it never implement because it's a very huge part for some moderation works
  9. Primary answer for your question - table core_members. But better way for provide account data sync - create an application, which implement ProfileSync extension (may be with your cusom login handler).
  10. Checked in 4.2.6, confirmed bug. forums-front-topics-topic default template line 306 with condition haven't else statement, which could provide any error message about current post limit restriction. It placed inside condition and never execute. Of course IPS should fix them, but if somebody need fast hard solution - put this code before line 306 condition: {{if !$topic->commentForm()}} <a id='replyForm'></a> <div data-role='replyArea' class='cTopicPostArea ipsAreaBackground ipsPad cTopicPostArea_noSize ipsSpacer_top'> {template="commentUnavailable" group="forms" location="front" app="core" params="'posts_per_day_error', null, null"} </div> {{endif}} It will show: or same in russian:
  11. Can you write more about this please? Can we create much instances with nginx+php-fpm and on every node setup redis, which will be connected between nodes? For the cluster architect cache system compability now is not clear. I know only about data partitioning between redis instances. And not any about full data sharing. This little guide will be very useful! As example, we have 10 servers, where present nginx + php-fpm. Redis presents on each of them. But used only 1 for all nodes. So if some 'slave' nodes goes down - all be ok. But if 'master' mode go away - our duty engineers should push updated configs with new redis instance. Of course, i can create my own failover with extend cache class system and swith to secondary server if something happened with first. But it is not 'reliable hammer' by comparison with Redis from box solution. I know some 3rd pary scripts, which needed to compile on system and which are works as a 'proxy' between application and Redis instance. This proxy script make a virtual cluster replication (it send same data to other redis nodes). But it is looks very unstable. Thanks!
  12. As the gmetrix said - work with your upload folder. Most good solution for make them better - use storage service with cdn for uploaded files and theme css/resources. If you don't want to use other storage services or cdn you can create pseudo-storage service. For example, make a A-record, like cdn.bwgforums.com, which has an ip-address to the same server. Configure your web server for make root folder to this domain to /uploads (and not needed to create any php interpreter to that folder!). Of course add expire for any files inside that, may be good for make settings for clean any cookie return. Make a good gzip optimization to that domain. This one step will fix most low results from gmetrix (pagespeed and yslow). Second optimizations may be next steps. If you want to check primary answer speed - check you cache settings (and it's expire params). Make sure for any blocks are also cacheble. Dont' make any blocks, which get some unique params (based for session, for example) - it will create different cache for each user (not one for all) and don't make custom controllers inside that (or with some framework/database logics - try to provide all needed data without any addditions). Its a basic. Other things are not bad as metrics said. If after that tasks you site will work slow - than you need to go deeper (check hosting/host perfomance and simple page returns - find a bottleneck first) - and work on them. Hope it hepls )
  13. Not good solution, but may be it will solve you task (i believe it needed as temporary check and for futher work you'll use minefied version of highcharts js). So, you can upload your js to theme resources and put calling this js template from your template place (or in globaltemplate in header). This way didn't make you js minefied. Moreover, i think it is good point to create support ticket about that situation. Minefied script must make correct result, not broke it. So in this ticket IPS can find error and fix it - it will be most correct way (and if you need to do some checks with console - you can use chrome pretty print from minefied version for do any js checks)
  14. No. I have a special department in company, who watch that But you question provide to me other think. May be ips zip's different between together and different for each licence? So with that thay can return different md5 . Or it depends on some uniq key inside? Didn't want to check it (lazy) and didn't important )
  15. ACP -> Support tool -> Something works wrong - didn't solve that?
  16. Thanks TheJackal84. I used temporary hardcode //return [] for md5 check function for doing upgrades) Same as topic starter problem - md5 is not correct (but it downloaded from clientarea and just pasted to webroot folder). Didn't know why md5 is wrong. I checked deeply in check function - all is well (files exists, md5 of file same as md5 in downloaded zip archive, permissions are right, write ability is present). But not md5 of content. I think it depends for some special characters.. but didn't know why it's diffrent between ips md5 checksums. Platworm worked in docker (nginx official, php-fpm:7.1 with other..), webroot folder mounted to my host machine, md5 under docker is the same as in host md5 (and as i say in md5 in archive). Thanks for che constant - it will make my work on upgrades simplier It's one of question, which should be ask in support ticket) Here IPS can't public answer to you and support system is a special places for questions like that
  17. Can you share link to your forums?
  18. No, thanks for the link. Tried it on the test instance. Two moments bad - 3 lines (as i set in settings) cut to 2 lines. I think it depends on my template style. Not sure about that. Second part - not good visual of 'read more' button. I saw it's like a default cutted text wrapper, but this place is not good for that. Other side - plugin can't understand image height inside and image with height = ~10+ text lines not cut. Yep, may be it's only mine problems. From the box it's not good for us. But it'a a good start for make everything what i need by himself. Thanks again for link
  19. I think every forums got the situation, when some member quoted very big post with little answer. My proposal is add to the quote field option for hide all other quote (show only first 3-5 lines) with the button 'show all quoted content' in the bottom of the big quote. It can be as default for all quotes (all post quote, multiquotes, inline quote) - if content gets more then 5 lines - cut log part of them and show only first 3 lines. That numbers is for example can be optional - of course. If you have some troubles with logic of that function - we (me and other devs here) can provide good solutions of them. Thanks!
  20. Hello IPS. Big thanks for react_daily_exceeded error message fix, added to 4.2.6 (beta3). But i want to propose very simple improvement of this js clickReaction method: Current line 257: if( !_.isUndefined( jqXHR.responseJSON ) && jqXHR.responseJSON.error == 'react_daily_exceeded' ){ ips.ui.alert.show( { type: 'alert', icon: 'warn', message: ips.getString('reactDailyExceeded'), callbacks: {} }); } else { ips.ui.alert.show( { type: 'alert', icon: 'warn', message: ips.getString('reactError'), callbacks: {} }); } change to: if( !_.isUndefined( jqXHR.responseJSON ) && ips.getString(jqXHR.responseJSON.error) ) { ips.ui.alert.show( { type: 'alert', icon: 'warn', message: ips.getString(jqXHR.responseJSON.error), callbacks: {} }); } else { ips.ui.alert.show( { type: 'alert', icon: 'warn', message: ips.getString('reactError'), callbacks: {} }); } It will not change default worked system. But it will add clear solution for other dev's to provide any custom error message, if they provide other error thrown with other language key and other error message. For our special case we have that. We have custom reactions logic with two additional errors, which are thrown their error message. Of course i can create a mixin and redefine that method. But in future i need to check on every update some potencial changes in your default method for support them. If you aggree with me and implement this simple solution - than me (and may be others) can use that without mixins natively. It's very like to have. If somebody needs that now, i share my custom mixin, which implement my realization of that proposal. All it contain absolutely same code, as default, except two lines about returned message: ips.controller.mixin('clickReaction', 'core.front.core.reaction', true, function () { this.around('clickReaction', function (origFn, e) { e.preventDefault(); // If this is a single reaction, and we're active, then we'll treat it as an 'unreact' action if (this._singleReaction && this._reactButton.hasClass('ipsReact_reacted')) { this.unreact(null); return; } // Mobile support - check whether we've activated the flyout first // Or, if this is a single reaction, ignore the flyout and just proceed with reacting if (ips.utils.events.isTouchDevice() && ( !this._singleReaction && !this._reactTypeContainer.hasClass('ipsReact_types_active') )) { return; } var self = this; var reaction = $(e.currentTarget); var url = reaction.attr('href'); var currentButton = this.scope.find('[data-action="reactLaunch"] > [data-role="reaction"]'); var newReaction = ( !$(e.currentTarget).closest('[data-action="reactLaunch"]').length || !this._reactButton.hasClass('ipsReact_reacted') ); // Remove all 'active' classes to reset their states this._removeActiveReaction(); // Trigger a pulse animation on the selected reaction reaction.addClass('ipsReact_active'); // Add 'reacted' class to button this._reactButton.addClass('ipsReact_reacted'); // If this isn't the current button already... if (reaction.closest('[data-action="reactLaunch"]').length == 0) { var _complete = function () { // Clone and swap the current/new reaction var currentButtonCopy = currentButton.clone(); var reactionCopy = reaction.clone(); currentButton.replaceWith(reactionCopy.removeClass('ipsReact_active')); reaction.replaceWith(currentButtonCopy.removeClass('ipsReact_active')); // Show the x button, hide the flyout and remove active styles setTimeout(function () { self._reactClose.fadeIn(); }, 400); self.unlaunchReaction(); self._removeActiveReaction(); }; } else { var _complete = function () { // Show the x button, hide the flyout and remove active styles setTimeout(function () { self._reactClose.fadeIn(); }, 400); self.unlaunchReaction(); self._removeActiveReaction(); }; } // Use a timeout here to allow time for the 'pulse' animation to finish setTimeout(_complete, 400); // Only bother with an ajax request if we're updating the reaction if (newReaction) { // Fire our ajax request to actually react if (this._ajaxObj && _.isFunction(this._ajaxObj.abort)) { this._ajaxObj.abort(); } this._ajaxObj = ips.getAjax()(url) .done(function (response) { self._updateReaction(response); }) .fail(function (jqXHR, textStatus, errorThrown) { Debug.log('fail'); if (!_.isUndefined(jqXHR.responseJSON) && ips.getString(jqXHR.responseJSON.error)) { ips.ui.alert.show({ type: 'alert', icon: 'warn', message: ips.getString(jqXHR.responseJSON.error), callbacks: {} }); } else { ips.ui.alert.show({ type: 'alert', icon: 'warn', message: ips.getString('reactError'), callbacks: {} }); } // Undo all the hard work we did to make the reaction active :( self._reactButton.removeClass('ipsReact_reacted'); self._reactClose.remove(); }); } }); }); It worked well for me and return any my thown message, which key exist an $langjs file of app/plugin. Thanks for you work!
  21. This problem source - many ajax requests per every symbol, entering to password fiels. On every keypress IPS send current data to server for get answer about password strengh and fast show this meter to user. If your server configuration should be as current (limit connections speed) - then you can just disable this meter in ACP -> Overview -> Security -> Security Settings. Switch 'Show password strength meter' to 'off'
  22. Yes, you can . Just write your logic in that condition. As example: {{if (($comment->position - 1) % 5 === 0)}} // will show on 1, 6, 11, 16... every five post not depend on posts per page {{if (($comment->position) % 2 === 0)}} // will show on every second post: 2, 4, 6, 8, 10... {{if (true)}} // every post :D. perfect for money :) {{if (($comment->position + 1) % \IPS\Settings::i()->forums_posts_per_page === 0)}} // every last post on page (depends on number of posts per page setting) {{if (($comment->position - 1) % (\IPS\Settings::i()->forums_posts_per_page*2) === 0)}} // every fist post but only on 2, 4, 6.. pages write any condition what you want {{if (\IPS\Member::loggedIn()->member_id === 123)}} // show something only for specific toxic member :D <style>body { font-family: 'Comic Sans MS'; color: pink; }</style> {{endif}}
  23. May be somebody good to have redefine BULK_MAILS_PER_CYCLE to some value like 1 in constants (break mass synchronous sending) hook \IPS\core\extensions\core\Queue run method. copy all default code and just change MAX_EMAILS_PER_GO to any big value (10000) - be sure you use cron type of run task and it configured without execution time limits and you have enough memory for some big works all email will send at next minute started as much fast as possible Is it make sense? P.S. I am not check that solution (may be something missed in logic)
  • Create New...

Important Information

We use technologies, such as cookies, to customise content and advertising, to provide social media features and to analyse traffic to the site. We also share information about your use of our site with our trusted social media, advertising and analytics partners. See more about cookies and our Privacy Policy