Jump to content

oEmbed for topics


Spanner

Recommended Posts

Posted

If we have link:

https://invisioncommunity.com/forums/topic/451461-huge-increase-in-server-load-after-upgrading-to-44x/page/3/#comments

and when we embed it's /page/3/ was changed to ?page=3

 

 

Posted

Quick fix:

forum/applications/forums/sources/Topic/Topic.php

find and replace

/**
	 * Get content for embed
	 *
	 * @param	array	$params	Additional parameters to add to URL
	 * @return	string
	 */
	public function embedContent( $params )
	{
        $url = $this->url();

        if( isset( $params[ 'page' ] ) )
        {
            $url = $url->setPage( 'page', $params[ 'page' ] );
            unset( $params[ 'page' ] );
        }

		\IPS\Output::i()->cssFiles = array_merge( \IPS\Output::i()->cssFiles, \IPS\Theme::i()->css( 'embed.css', 'forums', 'front' ) );
		return \IPS\Theme::i()->getTemplate( 'global', 'forums' )->embedTopic( $this, $url->setQueryString( $params ) );
	}

 

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...