Created
May 7, 2013 22:15
-
-
Save joshuaadickerson/5536600 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function toggleTopicSticky($topics) | |
| { | |
| global $smcFunc; | |
| $topics = is_array($topics) ? $topics : array($topics); | |
| $smcFunc['db_query']('', ' | |
| UPDATE {db_prefix}topics | |
| SET is_sticky = CASE WHEN is_sticky = 1 THEN 0 ELSE 1 END | |
| WHERE id_topic IN ({array_int:sticky_topic_ids})', | |
| array( | |
| 'sticky_topic_ids' => $topics, | |
| ) | |
| ); | |
| return $smcFunc['db_affected_rows'](); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I verify that this can be used by anyone for any purpose without attribution