Changeset 7

Show
Ignore:
Timestamp:
2007-11-21 15:27:52 (5 years ago)
Author:
hannes
Message:

redirectors/uploadavatar.php added (ticket #3)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/admin/classes/pages/Permissions.php

    r1 r7  
    4646        $_exclude_pages = Array('Page', 'Category', 'Forum', 'Topic', 'Newpoll', 'Reply', 'Moderate', 'Newtopic'); 
    4747        // define special 'pseudo-pages' 
    48         $_pseudo_pages = Array('Markasread', 'Pollvote', 'Postinghelp', 'Preview', 'Attachments', 'Delete_Topic', 'Edit_Title', 'Lock', 'Merge', 'Move', 'Pin', 'Split', 'Unlock', 'Unpin', 'Showip', 'admin/'); 
     48        $_pseudo_pages = Array('Markasread', 'Pollvote', 'Postinghelp', 'Preview', 'Attachments', 'Delete_Topic', 'Edit_Title', 'Lock', 'Merge', 'Move', 'Pin', 'Split', 'Unlock', 'Unpin', 'Showip', 'Uploadavatar', 'admin/'); 
    4949        // define the forum-specific pages 
    5050        $_forum_pages = Array('Forum', 'Newpoll', 'Newtopic', 'Reply'); 
  • trunk/classes/pages/Editprofile.php

    r1 r7  
    308308                    while (FALSE !== ($file = @readdir($handle))) { 
    309309                        // only image files 
    310                         if ($file != '.' && $file != '..' && $file != 'index.htm') { 
     310                        if ($file != '.' && $file != '..' && (strtolower(substr($file, strlen($file) - 4)) == '.png' || strtolower(substr($file, strlen($file) - 4)) == '.gif' || strtolower(substr($file, strlen($file) - 4)) == '.jpg' || strtolower(substr($file, strlen($file) - 5)) == '.jpeg')) { 
    311311                            $_col1 .= '<option value="images/avatars/' . $file . '"'; 
    312312                            if ($m->getAvatar() == 'images/avatars/' . $file) { 
     
    319319                    @closedir($handle); 
    320320                } 
    321                 $_col1 .= '</select><br /><a href="javascript:void();" onclick="window.open(\'redirectors/uploadavatar.php\', \'uploadwindow\', \'width=350, height=200\');">' . $LANG['Upload_Avatar'] . '</a></td>'; 
     321                $_col1 .= '</select><br /><a href="javascript:void(0);" onclick="window.open(\'redirectors/uploadavatar.php\', \'uploadwindow\', \'width=350, height=200\');">' . $LANG['Upload_Avatar'] . '</a></td>'; 
    322322                $_col2 = '<td>'; 
    323323                /* it shouldn't really occur that the avatar is an empty string, 
  • trunk/db/spamboard.sql

    r1 r7  
    228228INSERT INTO "sb_rights" VALUES('Delete',3,0,0); 
    229229INSERT INTO "sb_rights" VALUES('Edit',3,0,0); 
     230INSERT INTO "sb_rights" VALUES('Uploadavatar',1,1,1); 
     231INSERT INTO "sb_rights" VALUES('Uploadavatar',2,1,1); 
     232INSERT INTO "sb_rights" VALUES('Uploadavatar',3,1,1); 
     233INSERT INTO "sb_rights" VALUES('Uploadavatar',4,1,1); 
     234INSERT INTO "sb_rights" VALUES('Uploadavatar',5,0,0); 
    230235 
    231236CREATE TABLE sb_rights_default ( 
     
    382387INSERT INTO "sb_rights_default" VALUES('Delete',3,0,0); 
    383388INSERT INTO "sb_rights_default" VALUES('Edit',3,0,0); 
     389INSERT INTO "sb_rights_default" VALUES('Uploadavatar',1,1,1); 
     390INSERT INTO "sb_rights_default" VALUES('Uploadavatar',2,1,1); 
     391INSERT INTO "sb_rights_default" VALUES('Uploadavatar',3,1,1); 
     392INSERT INTO "sb_rights_default" VALUES('Uploadavatar',4,1,1); 
     393INSERT INTO "sb_rights_default" VALUES('Uploadavatar',5,0,0); 
    384394 
    385395CREATE TABLE sb_usergroups ( 
  • trunk/includes/lang/en.php

    r5 r7  
    367367$LANG['welcome_mail'] = 'Hello and welcome to ' . $SETTINGS['forumname'] . "!\n\nYour initial password is %password%\n\nYou can now use it to log in and change your profile settings.\n\n" . $SETTINGS['forumadmin'] . "\nhttp://" . $_SERVER['SERVER_NAME'] . substr($_SERVER['PHP_SELF'], 0, strrpos($_SERVER[PHP_SELF], '/')); 
    368368$LANG['lost_password_mail'] = "%membername%,\n\nsomebody (hopefully you) has requested a new password for your account over at " . $SETTINGS['forumname'] . ".\n\nThis is said password: %password%\n\nUse it to log in and change it to whatever you like.\n\n" . $SETTINGS['forumadmin'] . "\nhttp://" . $_SERVER['SERVER_NAME'] . substr($_SERVER['PHP_SELF'], 0, strrpos($_SERVER[PHP_SELF], '/')); 
     369$LANG['upload_avatar_hints'] = "<ul><li>File size must be smaller or equal 50KB</li><li>Width and height of the image mustn't exceed " . $SETTINGS['maxavatarsize'] . " pixels each</li><li>Allow file types are PNG, JPEG and GIF</li></ul>"; 
     370$LANG['upload_avatar_success'] = 'Your avatar has been uploaded successfully. You can now safely close this window, then reload the page from which you opened it and the new file should appear in the list.'; 
    369371 
    370372/* error messages */ 
     
    411413$LANG['error_bans_file_not_writable'] = "Error: The bans file isn't writable. Please adjust the permissions accordingly."; 
    412414$LANG['error_mail_address_already_used'] = "Error: The e-mail address you entered has already been used to register another account. The board administrators have chosen to allow only one account per address."; 
     415$LANG['error_avatar_file_missing'] = "Error: It seems you didn't select a file to upload."; 
     416$LANG['error_avatar_filesize'] = "Error: The file you tried to upload is larger than 50KB."; 
     417$LANG['error_avatar_filetype'] = "Error: The file you uploaded is neither a PNG, a JPEG or a GIF."; 
     418$LANG['error_avatar_dimension'] = "Error: The file's width or height exceeds " . $SETTINGS['maxavatarsize'] . ' pixels.'; 
     419$LANG['error_avatar_filename'] = "Error: A file with the same name as the one you tried to upload already exists among the avatars. Please rename it and try again."; 
     420$LANG['error_avatar_move'] = "Error: Something unforseen went wrong with the upload. Please try again. If this error persists, contact the administrators."; 
    413421 
    414422?> 
  • trunk/redirectors/showip.php

    r1 r7  
    3838// formatting object 
    3939$F = new Format(); 
    40 require('../includes/lang/'.$SETTINGS['language'].'.php'); 
     40require('../includes/lang/' . $SETTINGS['language'] . '.php'); 
    4141// open database connection 
    4242$C = new Connection('../'); 
    4343require_once('../includes/session.php'); 
    4444if ($_SESSION['lang'] != '') { 
    45     include('../includes/lang/'.$_SESSION['lang'].'.php'); 
     45    include('../includes/lang/' . $_SESSION['lang'] . '.php'); 
    4646} 
    4747// translate passed variables to local identifiers 
     
    6262    $_style = $_SESSION['boardstyle']; 
    6363} 
    64 $_css->addAttribute('href', '../includes/styles/'.$_style); 
     64$_css->addAttribute('href', '../includes/styles/' . $_style); 
    6565// tell spiders not to index this 
    6666$_meta = $html->head->addChild('meta'); 
     
    7070$html->addChild('body'); 
    7171 
    72 // check if user has permission; required: read; independent from id 
     72// check if user has permission; required: read; dependent on id 
    7373if (Member::checkRights('Showip', 'read', $id)) { 
    7474    // permission granted 
     
    118118header('Pragma: no-cache'); 
    119119header('Cache-Control: no-cache, must-revalidate'); 
    120 header('Expires: '.gmdate('D, d M Y H:i:s').' GMT'); 
    121 header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); 
     120header('Expires: ' . gmdate('D, d M Y H:i:s').' GMT'); 
     121header('Last-Modified: ' . gmdate('D, d M Y H:i:s').' GMT'); 
    122122// send document to client 
    123123print(str_replace(Array('&amp;omicron;', '&amp;raquo;', '&amp;alpha;', '&amp;copy;', '&amp;nbsp;'), Array('&omicron;', '&raquo;', '&alpha;', '&copy;', '&nbsp;'), $html->asXML()));