Jump to content

Profile Backgrounds (Support Topic)


Recommended Posts

@Adriano Faria In case you want to add it in a future version, here's the code I added right before the code to uninstall the plugin in order to convert old background data:

		# Plugin column available? Convert the background data
		if ( \IPS\Db::i()->checkForColumn( 'core_members', 'ProfileBackgroundImage' ) )
		{
			\IPS\Db::i()->insert( 'profilebackgrounds_data', \IPS\Db::i()->select( 'member_id, ProfileBackgroundImage', 'core_members', 'ProfileBackgroundImage IS NOT NULL' ) );
		}

 

 

Also, I had problems getting the image to display in the profile. I was receiving this error:

Unknown column '' in 'where clause'

 

After debugging, the problem is in the file /applications/profilebackgrounds/hooks/memberModel.php. The profileBackgroundImage() function currently uses this code to load the background data:

return \IPS\Db::i()->select( 'pb_location', 'profilebackgrounds_data', array( 'pb_location!="" AND pb_member_id=?', $this->member_id ) )->first();

Unfortunately, some MySQL versions are picky and don't like double quotes in queries. Once I swapped around single and double quotes in the WHERE parameter it started working properly:

array( "pb_location!='' AND pb_member_id=?", $this->member_id )

 

Edited by teraßyte
Link to comment
  • Recently Browsing   0 members

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