Jump to content

teraßyte

Clients
  • Posts

    33,434
  • Joined

  • Days Won

    47

 Content Type 

Downloads

Release Notes

IPS4 Guides

IPS4 Developer Documentation

Invision Community Blog

Development Blog

Deprecation Tracker

Providers Directory

Projects

Forums

Events

Store

Gallery

Posts posted by teraßyte

  1. On another note, the preSave function is not even included in the file added by the developer center when you add the extension from ACP. That's another thing that should be double-checked: update example files with all available functions and clearly indicate which ones are required.

     

    EDIT

    Nevermind, I actually mixed up ModeratorPermissions with ContentModeratorPermissions (that doesn't support preSave). It's still something that should be double-checked for all extensions anyway.

  2. Please keep the extension's behavior consistent across all the functions. Some extensions first check if the extension implements a certain function before calling it, while others expect the function to exist at all times and throw errors if they're missing.

     

    For example, the core/ModeratorPermissions currently has 4 functions available (preSave, getPermissions, onChange, onDelete) but only preSave checks if the function is available before calling it:

    /* Allow extensions an opportunity to inspect the values and make adjustments */
    foreach ( \IPS\Application::allExtensions( 'core', 'ModeratorPermissions', FALSE ) as $k => $ext )
    {
    	if( method_exists( $ext, 'preSave' ) )
    	{
    		$ext->preSave( $values );
    	}
    }

     

    The other functions instead are called without any check:

    foreach ( \IPS\Application::allExtensions( 'core', 'ModeratorPermissions', FALSE, 'core' ) as $k => $ext )
    {
    	foreach( $ext->getPermissions( array() ) as $name => $data )
    	{
    		// ...
    	}
    }
    
    ===
    
    foreach ( \IPS\Application::allExtensions( 'core', 'ModeratorPermissions', FALSE ) as $k => $ext )
    {
    	$ext->onChange( $current, $changed );
    }
    
    ===
    
    foreach ( \IPS\Application::allExtensions( 'core', 'ModeratorPermissions', FALSE ) as $k => $ext )
    {
    	$ext->onDelete( $current );
    }

     

    While I understand that getPermission() must be always implemented (the extension would have no meaning otherwise), the other 2 functions onChange() and onDelete() are completely optional and cause empty functions to be left around. For example, this code below comes from the Blog's extension:

    	/**
    	 * After change
    	 *
    	 * @param	array	$moderator	The moderator
    	 * @param	array	$changed	Values that were changed
    	 * @return	void
    	 */
    	public function onChange( $moderator, $changed )
    	{
    		
    	}
    	
    	/**
    	 * After delete
    	 *
    	 * @param	array	$moderator	The moderator
    	 * @return	void
    	 */
    	public function onDelete( $moderator )
    	{
    		
    	}
  3. No, there is no equivalent you can use in IF checks. What IPS does is include the multiple HTML blocks in the page output and then show/hide them with the CSS classes:

     

    With outputting all of them, it won't matter even if the size changes. For example, the browser's window can be resized on desktop, or you can use the web developer tools to emulate a phone/table.

  4. The only "built-in solution" I can think of would be to change the constant to send notifications in the background even when there's only 1 (the default is 5). That way you can bypass the delay.

    However, if your site is very active, you'll end up with a huge list of background processes in ACP, though. Not really ideal... 🙄

     

    This is the constant you need to add to your file in case you want to give it a try:

    \define( 'NOTIFICATION_BACKGROUND_THRESHOLD', 0 );

     

    Here's the guide on how to use the constants.php file if you've never used it:

     

  5. Reddit recently banned a huge batch of IP ranges. If you try to view that link in your screenshot directly from your server's IP you'll probably get a message like this:

    Quote

    whoa there, pardner!

    reddit's awesome and all, but you may have a bit of a problem.

    Make sure your User-Agent is not empty, is something unique and descriptive and try again. if you're supplying an alternate User-Agent string, try changing back to default as that can sometimes result in a block.

    If you're attemping to access Reddit via a hosting provider or private VPN, please either login at reddit.com/login/ or register/sign in with your developer credentials here.

    You can read Reddit's Terms of Service here.

    if you think that we've incorrectly blocked you or you would like to discuss easier ways to get the data you want, please contact us at this email address.

    when contacting us, please include your ip address which is: XXX.XXX.XXX.XXX and reddit account

    This is actually the message I'm getting right now with my current IP.

     

    The funny thing is that if I try to view the link using the old version (old.reddit.com) instead of the new one (www.reddit.com) there is no such error message. They're blocking the IPs only on the new UI. 😅

  6. 6 minutes ago, Aleksandr Timashov said:

    What custom? In IPS already present function to remove attachments by size. What problem recount the size of attachments and remove absent?

    There is no tool in Invision Community to do what you're asking for. That's why you require a separate custom modification.

  7. Looks like the problem is coming from the Clubs Enhancements application. Check with the author if they have an update available that fixes it, and If they don't, you'll have to disable it until it's fixed.

    There's also the option of manually fixing the hook since you have access to the files on the server, but the best option is to upgrade the application since there might be other errors.

  8. Oh, okay. If you need those additional filters then it's not possible because secondary groups are not listed in the advanced search form as you've already seen.

     

    You either need to manually run queries on the database to update the group value, or you can use the core/members REST API: https://invisioncommunity.com/developers/rest-api?endpoint=core/members/GETindex

    With the API you'll have to load all members with a specific group, then manually check their secondary groups, and update them based on the filters you mentioned.

×
×
  • Create New...