[Phpbbproject-svn] SF.net SVN: phpbbproject: [281] trunk/phpbb3/root
phpBB download manager, mainly aimed at MOD authors
Status: Planning
Brought to you by:
lord_le_brand
From: <lor...@us...> - 2008-05-06 01:36:42
|
Revision: 281 http://phpbbproject.svn.sourceforge.net/phpbbproject/?rev=281&view=rev Author: lord_le_brand Date: 2008-05-05 18:36:46 -0700 (Mon, 05 May 2008) Log Message: ----------- This should now work... And should add some more transaction stuff... Modified Paths: -------------- trunk/phpbb3/root/includes/project/project_main.php trunk/phpbb3/root/project_install/install_install.php trunk/phpbb3/root/styles/prosilver/template/project_create.html Modified: trunk/phpbb3/root/includes/project/project_main.php =================================================================== --- trunk/phpbb3/root/includes/project/project_main.php 2008-05-06 00:23:24 UTC (rev 280) +++ trunk/phpbb3/root/includes/project/project_main.php 2008-05-06 01:36:46 UTC (rev 281) @@ -491,7 +491,7 @@ $template->assign_block_vars('project_description_row', array( 'ID' => $row['license_id'], - 'DESCRIPTION' => "<p>{$row['license_description']}</p>\n<p><a href=\"{$row['license_url']}\">{$row['license_url']}</a></p>", + 'DESCRIPTION' => '<p>' . str_replace(array('\'', "\n"), array('\\\'', '<br />'), $row['license_description']) . "</p><p><a href=\"{$row['license_url']}\">{$row['license_url']}</a></p>", )); } $db->sql_freeresult($result); Modified: trunk/phpbb3/root/project_install/install_install.php =================================================================== --- trunk/phpbb3/root/project_install/install_install.php 2008-05-06 00:23:24 UTC (rev 280) +++ trunk/phpbb3/root/project_install/install_install.php 2008-05-06 01:36:46 UTC (rev 281) @@ -157,10 +157,13 @@ 'user_email' => '', ); + $db->sql_transaction('begin'); + $bot_user_id = user_add($bot_userdata); if (!$bot_user_id) { + $db->sql_transaction('rollback'); trigger_error($user->lang['PROJECT_BOT_NOT_ADDED'], E_USER_WARNING); } @@ -178,6 +181,7 @@ if ($error_message_ary !== false) { + $db->sql_transaction('rollback'); trigger_error(implode("<br />\n", $error_message_ary)); } @@ -198,16 +202,16 @@ 'INSERT INTO ' . PROJECT_LICENSES_TABLE . " (license_title, license_acronym, license_description, license_text, license_url) VALUES ('Creative Commons ttribution 3.0', 'CC-BY 3.0', 'You are free: - * to Share \x97 to copy, distribute and transmit the work - * to Remix \x97 to adapt the work +* to Share - to copy, distribute and transmit the work +* to Remix - to adapt the work Under the following conditions: - * Attribution. You must attribute the work in the manner specified by the author or licensor (but not in any way that suggests that they endorse you or your use of the work). +* Attribution. You must attribute the work in the manner specified by the author or licensor (but not in any way that suggests that they endorse you or your use of the work). * For any reuse or distribution, you must make clear to others the license terms of this work. The best way to do this is with a link to this web page. * Any of the above conditions can be waived if you get permission from the copyright holder. -* Nothing in this license impairs or restricts the author's moral rights.', '$cc_by_text', 'http://creativecommons.org/licenses/by/3.0/legalcode')", +* Nothing in this license impairs or restricts the author''s moral rights.', '$cc_by_text', 'http://creativecommons.org/licenses/by/3.0/legalcode')", 'INSERT INTO ' . PROJECT_AUTHORS_TABLE . " (author_id, author_username, author_realname, author_email, author_website) VALUES ({$user->data['user_id']}, '{$user->data['username']}', '', '{$user->data['user_email']}', '{$user->data['user_website']}')", 'INSERT INTO ' . ACL_GROUPS_TABLE . " (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) @@ -223,9 +227,12 @@ if ($error_message) { + $db->sql_transaction('rollback'); trigger_error($error_message); } + $db->sql_transaction('commit'); + $template->assign_vars(array( 'INSTALL_TEXT' => $user->lang['PROJECT_INSTALL_CONFIG_TEXT'], 'U_NEXT' => append_sid("index.$phpEx", 'i=install&mode=modules'), Modified: trunk/phpbb3/root/styles/prosilver/template/project_create.html =================================================================== --- trunk/phpbb3/root/styles/prosilver/template/project_create.html 2008-05-06 00:23:24 UTC (rev 280) +++ trunk/phpbb3/root/styles/prosilver/template/project_create.html 2008-05-06 01:36:46 UTC (rev 281) @@ -3,11 +3,12 @@ <script type="text/javascript"> function project_set_description(element_id, description_id) { - var descriptions = array(); - <!-- BEGIN project_descriptions_row --> - descriptions[{project_descriptions_row.ID}] = '{project_descriptions_row.DESCRIPTION}';<!-- END project_descriptions_row --> + var descriptions = Array; + <!-- BEGIN project_description_row --> + descriptions[{project_description_row.ID}] = '{project_description_row.DESCRIPTION}'; + <!-- END project_description_row --> - var element = getElementById(element_id); + var element = document.getElementById(element_id); element.innerHTML = descriptions[description_id]; } </script> @@ -41,12 +42,13 @@ </dl> <dl> <dt><label for="project_license">{L_PROJECT_LICENSE}:</label></dt> - <dd><select tabindex="5" name="project_license" id="project_license" title="{L_PROJECT_LICENSE}" onchange="set_description('license_description', this.value)"> - {LICENSE_SELECT} - </select> - <!--noscript><input type="submit" name="license_description" value="{L_PROJECT_DISPLAY_LICENSE_DESC}" class="button2" /></noscript--> - <div id="license_description"><p>{LICENSE_DESCRIPTION}</p> - <p><a href="{LICENSE_URL}">{LICENSE_URL}</a></p></div></dd> + <dd><select tabindex="5" name="project_license" id="project_license" title="{L_PROJECT_LICENSE}" onchange="project_set_description('license_description', this.value)"> + {LICENSE_SELECT} + </select> + <!--noscript><input type="submit" name="license_description" value="{L_PROJECT_DISPLAY_LICENSE_DESC}" class="button2" /></noscript--> + <div id="license_description"><p>{LICENSE_DESCRIPTION}</p> + <p><a href="{LICENSE_URL}">{LICENSE_URL}</a></p></div> + </dd> </dl> <dl> <dt><label for="file_only">{L_PROJECT_FILE_ONLY}:</label><br /><span>{L_PROJECT_FILE_ONLY_EXPLAIN}</span></dt> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |