Blog This + IP.Content > Invisionize.eu - IP.Board (IPB) News
Kanał Rss Kanał Rss
Kanał Atom Kanał Atom

Blog This + IP.Content

wersja drukowalna wersja Microsoft Word wersja HTML

The blog this sharelinks plugin *mostly* works with IP.Content (after some fixes I just made), however there is one issue that I cannot resolve or work around within Content itself.

The blog this sharelinks plugin uses the following code to figure out what app is being called

   	 //-----------------------------------------
        // Nope? Okay Work out what app this URL belongs to
        //-----------------------------------------
        
        $_app = NULL;
        $furlRegex = NULL;
        
        $_url = str_replace( ipsRegistry::$settings['_original_base_url'], '', $url );
        $_url = str_replace( array( '/index.php/', '/index.php?/' ), '/', $_url );
        
        foreach ( ipsRegistry::$applications as $app )
        {    
            if ( file_exists( IPSLib::getAppDir( $app['app_directory'] ) . '/extensions/furlTemplates.php' ) )
            {
                $_SEOTEMPLATES = array();
                require( IPSLib::getAppDir( $app['app_directory'] ) . '/extensions/furlTemplates.php' );
                
                foreach ( $_SEOTEMPLATES as $k => $data )
                {
                    if ( preg_match( $data['in']['regex'], $_url ) )
                    {
                        $_app = $app['app_directory'];
                        $furlRegex = $data['in']['regex'];
                        break 2;
                    }
                }
            }
        }

This works fine when we run IP.Content from within the forums (using the IPB furl system), however when IP.Content runs outside of the forums the $_app isn't detected properly (and thus the extension file isn't loaded) because the URL does not match up with the FURL regex. It can't, as the admin is able to completely define the URL from start to finish.

I'm not sure the best way to handle this. A few options:
If you need an example:

My front end URL is (notice it is above /trunk): http://localhost/inv...-post-fine-r138
The sharelink URL ends up being: http://localhost/inv...IHBvc3QgZmluZT8,

czw, 02 luty 2012