TinyPortal

Development => Support => Topic started by: fangweile on December 13, 2011, 03:41:00 AM

Title: help in sql query
Post by: fangweile on December 13, 2011, 03:41:00 AM
I recently updated my tp to the latest version and i have a problem referred to this link
http://www.tinyportal.net/index.php?topic=34573.0

Now i want to run a sql query in phpmyadmin updating all my articles about its panel viewing options.
I want to uncheck this option "Display rightblocks" in all of my articles. I know that it can be achieved thru sql query and I really don't know how.

Any help is gladly appreciated
Thanks in advance.
Title: Re: help in sql query
Post by: IchBin on December 13, 2011, 07:24:02 PM
Make a backup before you do anything!

Make sure you substitute smf_ in the table name if you have a different prefix.

update `smf_tp_articles` set options = replace(options, ',rblock,rblockwidth,', ',rblockwidth,')

This should update all articles to remove the right block setting.
Title: Re: help in sql query
Post by: fangweile on December 14, 2011, 05:48:27 AM
thanks a lot IchBin, it works great.
Title: Re: help in sql query
Post by: fangweile on December 29, 2011, 05:49:44 AM
hello again,

I don't know what happen but when i viewed my articles today, it is showing the right block again.
I tried to run the sql query again but still the right blocks is showing.

thanks in advance
Title: Re: help in sql query
Post by: IchBin on December 29, 2011, 11:12:26 PM
And if you go into the article is the right block option turned on? Does it turn off if you uncheck the right block?
Title: Re: help in sql query
Post by: fangweile on December 30, 2011, 01:03:44 AM
when i go into the article, the right block is checked and when i uncheck it, the right blocks are turned off when i viewed the article..
Title: Re: help in sql query
Post by: IchBin on December 30, 2011, 05:47:08 PM
When you run the query, does it say that it's updated any rows?
Title: Re: help in sql query
Post by: fangweile on December 31, 2011, 12:43:23 AM
0 rows affected
Title: Re: help in sql query
Post by: IchBin on December 31, 2011, 02:30:17 AM
Don't know what to tell you. The query is running fine for me on my test site.
Title: Re: help in sql query
Post by: Lum-chan on January 16, 2012, 12:23:44 PM
Don't forget to check this for each category too. If an article has the option 'Use settings from category instead!' activated then the settings of the category apply over the settings of the article itself