Jump to content

Profile Backgrounds (Support Topic)

Featured Replies

@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

  • Replies 76
  • Views 8.6k
  • Created
  • Last Reply

Top Posters In This Topic

Most Popular Posts

  • TheJackal84
    TheJackal84

    I will look into it tonight. I know from previous support he uses custom divisions in his themes 

  • LiquidFractal
    LiquidFractal

    Thanks to @TheJackal84, who generously spent time and energy shuttling PMs back and forth with me and updating a patch so I could use the Profile Backgrounds plugin with @TAMAN's Magnum theme. Aw

  • @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 avail

Posted Images

On 1/29/2023 at 1:25 AM, teraßyte said:

some MySQL versions are picky and don't like double quotes in queries.

I will use IS NOT NULL instead, as NULL is used to save when the user removes the image. 👍

Recently Browsing 0

  • No registered users viewing this page.