Jump to content

Martin A.

Clients
  • Posts

    4,230
  • Joined

  • Last visited

  • Days Won

    21

 Content Type 

Downloads

Release Notes

IPS4 Guides

IPS4 Developer Documentation

Invision Community Blog

Development Blog

Deprecation Tracker

Providers Directory

Forums

Events

Store

Gallery

Posts posted by Martin A.

  1. What's your reason for adding all the entries to an array and then use that in a custom table, instead of 

    $table = new \IPS\Helpers\Table\Db( 'customtable_log', $url, $where );
    $table->selects = [ 'customtable_log.device', 'MAX(customtable_log.user_id) AS user_id'];
    $table->joins = [ [ 'select' =>  'GROUP_CONCAT(DISTINCT core_members.name SEPARATOR ", ") AS shared_by', 'from' => 'core_members', 'where' => 'customtable_log.user_id = core_members.member_id' ] ];
    $table->groupBy = 'COUNT(customtable_log.user_id) > 1';

     ?

    I haven't tested this, but you should be able to use the Db class even if you need to use a query out of the ordinary.

  2. That was the norm a couple of years ago, but it's not the practice anymore for speed and SEO reasons.

    https://levelup.gitconnected.com/all-about-script-87fea475b976

    Quote

    The best practice is to put JavaScript <script> tags just before the closing </body> tag rather than in the <head> section of your HTML.

    The reason for this is that HTML loads from top to bottom. The head loads first, then the body, and then everything inside the body. If we put our JavaScript in the head section, the entire JavaScript will load before loading any of the HTML, which could cause a few problems :

    1. If you have code in your JavaScript that alters HTML as soon as the JavaScript code loads, there won’t actually be any HTML elements available for it to affect yet, so it will seem as though the JavaScript code isn’t working, and you may get errors.
    2. If you have a lot of JavaScript, it can visibly slow the loading of your page because it loads all of the JavaScript before it loads any of the HTML.

    When you place your JavaScript at the bottom of your HTML body, it gives the HTML time to load before any of the JavaScript loads, which can prevent errors, and speed up website response time.

     

  3. 10 hours ago, teraßyte said:

    I completely failed to notice that line about the SQL Toolbox. I often use it on clients' sites to check data. They often give me no phpMyAdmin (or similar) access, either because they don't want to or simple because they don't know how.

    Do I have to make my own custom SQL Toolbox app so I can temporarily install it and get things done now...? 🙄

     

    9 hours ago, Adriano Faria said:

    You bet. Worst: pretty sure it won’t be accepted in marketplace. 

    I really miss more reactions. 👎

    Really wish there was a certain Slack channel where we could share things like this 🤔

    😉 

  4. 6 hours ago, cH@rG said:

    Hi there,

    Can I use the Community Map for Clubs only and not members?

    Yes, you can remove the posting permission in the pre-made "Members" category. That way you'll only get markers from the integrations you enable.

  5. 20 hours ago, kmk said:

    This app can be applied for Real States use case?

    1. Members choose place where the house is for Rent or Sale, add images and videos and all others informations fields that needed, submit it.

    2. The new place submitted need approved by admin or moderators, if it is approved that place or advert show author name indicated by admin, example "For Rent Deparment", that mean all places submitted will show site departments as author then customers will contact or take the deal directly to the site.

    That mean all members can submited real state advert, the business type is members submit adverts then is managed by site admin. The amount of transction will transfer by site credit wallet.

    @Martin A. this app can be modified for that use case? 

    Sounds like you want to transform this into something that acts like Airbnb. This will require way too much modification from its current state to make it worth it. Better to have something custom made for your specific needs.

  6. On 4/14/2022 at 4:21 AM, Hostingunlock said:

    have you tried to use nginx to see how it works for you

    This ^

    Nginx + PHP-FPM and Cloudflare will make wonders for your site. Moving uploads to S3 may help tremendously too. This must be done in combination with Cloudflare as most S3 providers doesn't have server locations in ZA, except for AWS. CF have two and these will cache your uploaded images for you. This will also free up space on your VPS and possibly lower the RAM usage as more than 50% of the requests will be handled by Cloudflare.

    If you reach out to @ASTRAPI he may be able to do a one-time optimization for you. I can assist you with moving your uploads to S3 should you need that. 

  7. 20 hours ago, Mark Spieker said:

    Thanks, ok now that is showing up, but when I go in as a user and save my location I get this

    communitymap_Unknown column 'mc_mc_country' in 'field list'

    But the marker is there, however when I try and move it, I get another error.

    A new version have been submitted that fixes this.

    @iacas This will also include the improved country selector 🙂

  8. 5 hours ago, Adriano Faria said:

    It was a hook in Members model before but I changed it to use Active Record a while ago (not sure when). So now you don't need to use the prefix.

    $membersCountryMember->country = mb_strtolower( $country );

    That should work.

    $membersCountryMember = \IPS\memberscountry\Member::load( $this->author()->member_id );
    $membersCountryMember->country 			= mb_strtolower( $country );
    $membersCountryMember->country_changed 	= 0;
    
    $membersCountryMember->save();

    Like this then?

  9. 9 hours ago, Mark Spieker said:

    Thanks, ok now that is showing up, but when I go in as a user and save my location I get this

    communitymap_Unknown column 'mc_mc_country' in 'field list'

    But the marker is there, however when I try and move it, I get another error.

    Sounds like you have "Member's Country" by Adriano installed.

    @Adriano Faria Have you made any changes to this recently? 

    $membersCountryMember = \IPS\memberscountry\Member::load( $this->author()->member_id );
    $membersCountryMember->mc_country = mb_strtolower( $country );

    I use the column prefix here. Have you added this to \IPS\memberscountry\Member::$databasePrefix instead now?

  10. 7 minutes ago, Mark Spieker said:

    Hello I don't see "add location" when logged in as a user, but I do as admin, I've made sure that group has permissions in the ACP/Applications module. Any ideas

    Make sure members have permission to add markers to the marker group "Members". That's the only thing that controls the visibility of that button.

  11. On 4/4/2022 at 9:07 PM, iacas said:

    Could this be made easier to use? It's a lot of countries (251?) in an un-resizable 5-line scrolling text field.

    I might like to select all countries from North America and Europe, and then a few select countries outside of that (New Zealand, Australia, and Japan for sure, South Africa probably, etc.).

    It would help things tremendously where someone types something like "Southwestern Texas" and they get some city on the map in some random country in Asia or something. (Not a specific example.)

    In the next release it will be changed to something like this instead
    1f1a70829dc122911bcc630b5d32792c.png

    That should be easier to navigate.

    Not pushing out an update just for this right now. It'll be part of an upcoming maintenance release.

  12. 5 hours ago, GolfSpy_THV said:

    Sorry if this has been answered previously, however I'm getting several members let us know that they are being placed or marked in areas they are not. Most all are US based, but we have a ton of members who after marking themselves are being placed all over europe and other places. Is this due to the profile sinc and potentially VPN or? I've disabled it for now, but will likely look to reset the whole thing and restart. 

    Thank you!

    Yes, this have been brought up before, but that's a long time ago.

    This is most likely caused by your members being too vague when writing their location in their profile. It's not a secret that a lot of (smaller) US cities and town have "stolen" their name from cities in Europe. 

    If they just write "London" or "Manchester", it may be obvious to you and your members that they mean London, Kentucky and Manchester, Tennessee. The search engine will however return the UK locations, as these are larger.

    Have a look at the "Limits the location search to specific countries" setting. You can set this to United States. Believe this will solve this issue for you.

    VPN is not an issue, as the IP is not taken into consideration.

  13. 21 hours ago, Nathan Explosion said:

    The code from the analytics 'integration' is added right at the start of the <head> so that will error.

    Hence

    22 hours ago, Martin A. said:

    Depending on where GA is added to the source you may have to wrap it in a DOM loaded event

            <script>
                document.addEventListener("DOMContentLoaded", function()
                {
                   console.log( ips.getSetting( 'member_formattedName' ) );
                });
            </script>

    Doesn't really help, as member_id and member_formattedName is something added by the online/active users blocks. Unless one of those blocks is on the page, those variables are unavailable.

    But there's always a way to get what you want.

    <script>
                document.addEventListener("DOMContentLoaded", function()
                {
                   const name = $( '#elUserLink' ).text();
                   const member_id = $( '#cUserLink' ).find( 'a[href*="/profile/"]' ).attr( 'href' ).match( /profile\/(\d+?)-/ )[1];
                });
            </script>

     

  14. Both member name and ID is available in JS. 

    ips.getSetting( 'member_formattedName' );
    
    ips.getSetting( 'member_id' );

    Depending on where GA is added to the source you may have to wrap it in a DOM loaded event as the above variables/settings are added quite a bit down in the page source.

  15. 1 minute ago, bassangler said:

    I'm seeing these errors in my log. I disabled Community Map and they went away. So it's caused by Community Map. What is the fix?

     

    I'd need to see more details. Open one of them and post the backtrace here or in a private message.

  16. 2 hours ago, Unlucky said:

    Hi,

    Is there a way to hide the main dscription field from a particular marker group or place the custom fields above it?

    Thanks,

    You can do that with a template edit. Let me know how you want it and in which category and I'll give you the complete instructions.

  17. 51 minutes ago, Unlucky said:

    Hi,

    We have enabled club extention

    The club shows on the map within the club

    But when we visit the main community map the club does not show.

    IE - https://www.walkingfootball.com/communitymap/?filter=showClub&clubId=126

    But it does not show on - https://www.walkingfootball.com/communitymap/

    Is this correct or is something wrong?

     

    Hello,

    Lots of clubs are showing up in your map now, including Barnet WFT 🙂 

    Guess this was a caching issue.

  18. 4 minutes ago, ZLTRGO said:

    Still planing on that? xD

    I hate the fact that I get logged out every 30 mins or so on ACP. I increased the timeout time in my php.ini, but it does not help for some reason.

    image.thumb.png.aa91b14ddbf227a85ed61e10528e0b25.png

    I want to increase it to 24h. 

    Yes I know it's 42h in seconds right now but that's just for testing. I still get logged out way too often.

    If you need this for development purposes you can use this constant

    define( 'DEV_DISABLE_ACP_SESSION_TIMEOUT', TRUE );

    That'll disable the timeout when IN_DEV.

  19. 1 hour ago, Jim M said:

    It was changed to outline next steps. Customers were getting confused and not knowing that the > meant more. You're welcome to post any suggestions for changes in the Feature Suggestion forum.

    They are gonna get more confused when you tell them to fix something that doesn't need fixing.
    One would think that everyone knows that a > either shows that this box is collapsed and/or you can click it to open and reveal more information. Even showing a magnifying glass would be better than "Fix This".

    That button text will also overflow if there's a lot of info, or smaller screen size, showing only "Fix ..." which is even more confusing.

  20. 20 hours ago, Lukazuki ❤ said:

    what? authors can't earn money on their resources without a renewal license even though the resources are compatible with the latest version of Invision Community, who asked for that?

    We did 🙂 Gotta spend some to earn some. If the income isn't enough to cover the cost you are either not here for the money, don't have a big enough demand, or not pricing it "correctly".

    Keep in mind that this also ensures that you can't purchase from someone who have left the "scene", leaving you with a file that will probably not be supported. Should it be taken over by someone else, you will most likely have to purchase it again.

    20 hours ago, Lukazuki ❤ said:

    Don't tell me that you have to rewrite plugins every time to be compatible with the latest version, because that's not true. The correctly made plugin is compatible with each version until major changes in the core.

    This is not true anymore. An app or plugin would be compatible with the entire major version ( 4.x ) in the beginning of the 4 series. In the past few years changes to a central method signature happens more often, breaking backwards compatibility, even if it's "correctly made". They are even introducing brand new functionality in the middle of a major version. So there could be stuff out there that is compatible with 4.6.x but not 4.6.y.
    This is stuff they wouldn't have done back in the days.

    This is why we, the 3rd party developers, have to keep our licenses up to date to keep up with these changes.

×
×
  • Create New...