From: Eloi G. <ada...@us...> - 2004-09-15 19:29:50
|
Update of /cvsroot/phpwsbb/phpwsbb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16626 Modified Files: index.php Log Message: -Enabled use of the ImgLibrary Class -Code now allows PHPWS_MAN_ITEMS to work without the brackets, which breaks the link in e-mail messages. Index: index.php =================================================================== RCS file: /cvsroot/phpwsbb/phpwsbb/index.php,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** index.php 13 Sep 2004 21:41:54 -0000 1.11 --- index.php 15 Sep 2004 19:29:40 -0000 1.12 *************** *** 33,36 **** --- 33,40 ---- $CNT_phpwsbb['content'] = $_SESSION['translate']->it('Sorry, the bulletin board is currently down for maintenance.'); } else { + /* This'll let the module work without those brackets */ + if(isset($_REQUEST['PHPWS_MAN_ITEMS']) && is_numeric($_REQUEST['PHPWS_MAN_ITEMS'])) + $_REQUEST['PHPWS_MAN_ITEMS']=array($_REQUEST['PHPWS_MAN_ITEMS']); + if (isset($_REQUEST['PHPWSBB_MAN_OP'])) { $_SESSION['PHPWSBB_Manager']->action(); *************** *** 45,48 **** --- 49,93 ---- if (isset($_REQUEST['PHPWSBB_MESSAGE_OP']) && isset($_SESSION['PHPWSBB_Manager']->message)) $_SESSION['PHPWSBB_Manager']->message->action(); + + if (isset($_REQUEST['IMGLib_op']) && $_SESSION['OBJ_user']->user_id) { + /* If this just got called from the profile editing screen, save all data entered so far */ + if (isset($_REQUEST['PHPWSBB_MAN_OP'])) + $_SESSION['PHPWSBB_Manager']->_saveUserSettings(); + /* If an image was selected from the library... */ + if ($_REQUEST['IMGLib_op']=='select_image') { + $_POST['IMGLib_selected_image'] = pos($_POST['IMGLib_selected_image']); + $_SESSION['PHPWSBB_Manager']->_getUserSettings(); + return; + } + /* Handle gallery exit requests */ + if ($_REQUEST['IMGLib_op']=='exit') { + if ($_REQUEST['IMGLib_return_data']=='edit') + $_SESSION['PHPWSBB_Manager']->_getUserSettings(); + return; + } + /* Show the image galleries. linkBack, current_image, & current_gallery + * are already set as POSTs from the calling form. + */ + require_once PHPWS_SOURCE_DIR . 'core/ImgLibrary.php'; + $library = new PHPWS_IMGLib($_SESSION['OBJ_user']->allow_access('phpwsbb', 'edit_avatars') + , $_SESSION['OBJ_user']->allow_access('phpwsbb', 'edit_avatar_galleries') + , true, null, null, null, 'phpwsbb', 'library', 'CNT_phpwsbb', 'avatar' + , $_SESSION['PHPWSBB_Manager']->_max_avatar_size*1024 + , $_SESSION['PHPWSBB_Manager']->_max_avatar_height + , $_SESSION['PHPWSBB_Manager']->_max_avatar_width); + $library->action($_REQUEST['IMGLib_op']); + /* If an image was moved between galleries... */ + if ($_REQUEST['IMGLib_op']=='move_image' && $library->_done) { + $sql = 'UPDATE mod_phpwsbb_user_info SET avatar_dir="' + . $library->_base_dir.'/'.$_POST['IMGLib_selected_gallery'] + . '/" WHERE avatar_dir="' + . $library->_base_dir.'/'.$library->_current_view + . '/" AND avatar_file IN ("' + . implode('","', $_POST['IMGLib_selected_image']) + . '")'; + /* Change directory names in all relevant sections */ + $GLOBALS['core']->query($sql, true); + } + } } ?> |