1. 02 Jul, 2021 1 commit
    • SamJanis's avatar
      Post header sticks during editing · 2486eb1e
      SamJanis authored
      When editing long pages, the recipients field and cancel button were scrolled
      out of view. Now they have been placed in their own container (along with other
      post credits that show at the top of a post) and a class added during editing,
      keeping the container always visible, even when scrolling during editing a long
      Another bug was fixed where clicking a "Reply" link would crash the javascript
      if another post was being edited.
  2. 29 Jun, 2021 1 commit
    • SamJanis's avatar
      Modified editor permissions popup · 82297feb
      SamJanis authored
      The sections for age rating, and how replies to a post are viewed and sorted are
      now in their own popups.
      In the javascript code, responding to changes in permissions, age rating, or
      replies are more atomic (ie. they only change what is necessary) and have been
      tidied up.
      Also, username suggestions in the sign up form are all lowercase
  3. 20 Jun, 2021 2 commits
    • SamJanis's avatar
      Fixed bug accidentally removing closing div tag · d23c49a0
      SamJanis authored
      A minor bug where the closing tag for the container div for pinned posts was
      accidentally removed by being inside of a conditional block that did not
      relate to it. This caused other div blocks after it to break out of their
      usual containers. The bug for the closing div was restored by moving it out of
      the conditional block.
    • SamJanis's avatar
      Fixed pin post bugs · 4ae17dd1
      SamJanis authored
      A set of related bugs affecting how posts get pinned were fixed. The bugs
      prevented pinned posts from being unpinned, and didn't show the 'Pin Post'
      menu item for posts when in list view.
  4. 18 Jun, 2021 4 commits
    • SamJanis's avatar
      Fixd bug ratings icon not showing · aab131f0
      SamJanis authored
    • SamJanis's avatar
      Added permissions icons · 4845ce5b
      SamJanis authored
    • SamJanis's avatar
      Fixed bug affecting reply links · 2ae9e8ec
      SamJanis authored
    • SamJanis's avatar
      Expanded flagging features · 660c892f
      SamJanis authored
      Posts can now be flagged as requiring an age limit, copyright or trademark
      infringing, or as a violation of terms or possible illegal content. Previously,
      flagged posts were simply removed from view.Age limited content isn't flagged as
      violating "per se", but can only be viewed by accounts with a "confirmed age"
      such as above 15 or 18 years old. Also, copyright or trademark infringing
      content is flagged differently from illegal or a violation of terms, although
      they currently behave the same as each other.
      "Remove Flag" buttons are now available on all visible posts, instead of being
      on only the main "page" post.
      Bottom post edit controls now always visible and stick to bottom of screen when
      editing long posts. This includes pinned posts and inline replies.
      A bug was fixed where a post's title wouldn't be generated if it didn't contain
      <br> tags. The regexp used to extract title and description has been modified
      to always extract a title if one is given.
      Titles, short descriptions, and searchcache had ampersands (&) and other
      non-alphanumeric characters removed. They are now included.
      The sidepanel tree now show more parent nodes than child nodes. If a node has
      more than 5 child nodes (i.e. nodes without any children) it will display a
      "More..." link instead of showing the rest of the child nodes.
      Managing group members was made easier with confirmation dialogs shown when
      removing members or for members leaving groups.
      A set of related bugs with group members were also fixed. When a non-member
      attempts to join a group, their pending member entry would display "Undefined".
      Also, when the group owner or moderator would confirm a pending member's join
      request, it wouldn't update their pending status, which if clicked a second
      time would instead cancel their join request. Both bugs are fixed in this
      Placeholder divs have been added to all posts, allowing postflag and
      postpending events to have a place where they can be guaranteed output.
      The reply ladder for posts has been modified to always show user-added
      (javascript) replies at the bottom of the reply ladder.
      Modified: func.php index.php style.css pricing.php databases.sql
      alter table flags add column flagagerating int after flagreason;
  5. 14 Apr, 2021 1 commit
    • SamJanis's avatar
      Bug fixes inserting images and line breaks · 41510469
      SamJanis authored
      Two bugs affected usability with the editor; inserting images and adding line
      breaks with the Enter key.
      When inserting images, they were usually appended at the end of the post.
      This commit now inserts images at the cursor point (or overwrites any selection).
      The Enter key also broke when pressed at the end of a post. The cause was a
      function looking for the nextSibling to the cursor which, at end of the post,
      doesn't exist and caused javascript to temporarily halt. The nextSibling bugfix
      now checks to see if the nextSibling exists before proceeding.
      A possibly related bug is when inserted images become a child node of BR tags.
      We couldn't reproduce this bug have added code to collapse the selection before
      adding images.
  6. 09 Apr, 2021 1 commit
    • SamJanis's avatar
      Posts can set default sort mode · b37d6af8
      SamJanis authored
      Posts can now set the default sort mode for their replies. By default replies
      are sorted by date, but now they can be sorted by title, as well as in reverse.
      Users can override this by selecting the sort mode in the side panel if needed.
      Existing databases need to be modified with the following commands:
      alter table posts add column sortmode tinytext after viewmode;
      alter table posts add column sortreverse boolean after sortmode;
      FIXED BUG: Unsigned (anonymous) users could set invalid permissions, such as
      "only owner can edit" (which is impossible for a post with no owner). Now,
      invalid permissions are disabled in the post permissions dialog for unsigned
      FIXED BUG: Permission presets weren't shown for editing existing posts. The
      cause was 'agerating' was set to 0 instead of the minimum of 3.
      FIXED BUG: New posts couldn't upload non-image attachments. The AJAX call
      didn't honour NEWPOST as a valid id but assumed the post id was 0. Now, NEWPOST
      is preserved when editing new posts.
      FIXED BUG: Blank or irrational recipients appear in the recipients field when
      starting a new post or reply. This was caused by an empty string which parsed
      as an array with a single NULL entry.
  7. 28 Mar, 2021 1 commit
    • SamJanis's avatar
      Added List view. hover menus use click-to-show · aa08598b
      SamJanis authored
      An additional view is added, primarily for emails and going through long
      lists of posts. List view now works for pages with multiple items, as well
      as home page entries.
      A related bug is when thumbnail and listview didn't work on the homepage,
      profile page, or email pages. These have now been fixed.
      Member and post sidepanel entries now use click-to-show menus instead of
      CSS hover.  While the CSS hover effect was quick to respond, the memus
      that popped up when hovering over them did block other parts of the page
      when moving the mouse around the screen. Now, the interface is a bit more
      stable even if an extra click is needed to show the associated menu.
      Code cleanup: popupeditor now renamed to messager in php and css to
      avoid confusion.
      Fixed CSS styling where Reply / Reply by Email buttons didn't fit on
      small screens.
      Fixed bug when messaging didn't display parsed markdown, but plaintext
      markdown instead.
      Fixed bug where non-owner and non-moderating group members can see
      pending members
      Fixed bug setting new post recipient when viewing email page
      (eg 'mirrorislan.com/user@email.com')
  8. 08 Mar, 2021 2 commits
    • SamJanis's avatar
      Fixed padding bug on full post view · 21df68d0
      SamJanis authored
      A minor style bug caused full-view posts to not have any padding
      on the right side of the screen, causing elements to touch each other
      instead of having an 8px padding between them.
      This commit fixes that style bug.
    • SamJanis's avatar
      Added list view for posts · c76d313e
      SamJanis authored
      Posts can now be displayed in a list form, similar to how emails
      are displayed in a web-based email client.
      This can also be set as the default view mode for
      replies to a post.
  9. 28 Feb, 2021 1 commit
    • SamJanis's avatar
      Default View As per post can be set · ac01ed72
      SamJanis authored
      The default view for the replies to a post can now be set.
      Unless the user viewing the post has specifically chosen
      a view mode already, the post will use the specified
      view mode set in the permissions popup.
      Thumbnails show microdata instead of description snippet,
      if any microdata available. Currently, this is limited to
      price and quantity (itemprop size) only.
      Fixed bug where Ctrl+Enter added new line before saving. It now saves without adding a new line.
  10. 25 Feb, 2021 1 commit
    • SamJanis's avatar
      Show microdata in thumbnail view · 77cef5ba
      SamJanis authored
      When posts are viewed as thumbnails, microdata is now displayed
      below the thumbnail image, if available. Otherwise a short clip
      of the post's description is used instead.
      Other features/bug fixes with this commit include:
      - Banner images are now used as thumbnail, if available.
      - "View As" and "Sort By" options can be double-clicked to
        immediately apply.
      - Fixed bug where root-level title post wasn't displayed.
      alter table posts add column viewmode tinytext after tagpermissions;
  11. 24 Feb, 2021 1 commit
    • SamJanis's avatar
      Added thumbnail view · 766b2eda
      SamJanis authored
      Modified databases.sql, index.php, style.css
      Thumbnail view was added to allow multiple reply posts to be
      displayed in a responsive grid pattern.
      To make this possible we also added new table fields:
      shortdesc text, image tinytext to the database table 'posts'
      for thumbnail view, and later listview and opengraph integration.
      A minor bug was fixed where a post with a title was displayed out of
      order when its parent post doesn't have a title.
      Also added was a reduced set of CSS reset rules
      from Eric Meyer's "CSS Reset" project.
  12. 08 Feb, 2021 1 commit
    • SamJanis's avatar
      Added shortcut keys. Code Cleanup · 930e0a8d
      SamJanis authored
      Added basic shortcut keys to quickly post and search templates.
      - Ctrl+Enter starts a new post/post-reply, and saves posts when editing.
      - Ctrl+Space enters template search field.
      - Esc cancel edit post; this will need to be worked on as it probably interferes with the popup messenger.
      Simplified javascript "index_$" to just "$". We can now use things like:
      $('somedivname').innerHTML = '<h1>This</h1>';
      Replaced custom index_addClass/index_removeClass from code with native classList.add/.remove functions instead.
      New post id is "NEWPOST" instead of just "0".
  13. 06 Feb, 2021 1 commit
    • SamJanis's avatar
      Initial partial microdata support · bfdcbe60
      SamJanis authored
      Basic semantic microdata embedded in HTML via the 'itemprop' property is now supported.
      Currently microdata extracted is "price" and "size" (which is used for quantity).
      Minor code formatting and moving CSS to style was also added.
      Added new table:
      CREATE table `microdata` (
              `id` int(11) AUTO_INCREMENT PRIMARY KEY NOT NULL,
              `postid` int(11) DEFAULT NULL,
              `accountid` int(11) NOT NULL,
              `itemprop` tinytext DEFAULT NULL,
              `strval` tinytext DEFAULT NULL,
              `intval` int(11) DEFAULT NULL
      ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  14. 22 Jan, 2021 1 commit
    • SamJanis's avatar
      Added template index search functionality. · d816d34d
      SamJanis authored
      - Posts can now be started with HTML from an existing URI (feature called a 'template')
      - Added feature to search template index files for template URIs.
      - Template indexes can be disabled, re-enabled, or deleted from inside template search bar.
      - Added templates table.
      - Changed all 'id' columns to auto_increment where possible.
      - Added styles applying to template search elements.
  15. 19 Nov, 2020 1 commit
    • SamJanis's avatar
      Fixed bug: Personal messaging didn't work · 8e550d5d
      SamJanis authored
      Cause: Recipients weren't defined from the popup editor.
      Internally, a global javascript array named
      index_editpostrecipientsarray[] keeps track of recipients
      being added or removed.
      The popup editor didn't have this feature but relied on a text input
      field under the permissions popup to keep track of recipients.
      Posts (which are personal messages) sent through the popup editor
      still tried to get recipients from index_editpsotrecipientsarray[].
      The fix was to use the recipients input instead of the global
      A javascript global named index_editmessagerecipientsarray[]
      has been added but is not in use yet.
  16. 17 Nov, 2020 1 commit
    • SamJanis's avatar
      Fixed bugs; side panel emails and handling email pages · 1c813e47
      SamJanis authored
      Side panel emails were identified by first email id.
      This meant that new emails didn't show up in the sidepanel
      if an existing email was already marked as read.
      Now, all unread emails are properly acknowledged in the side panel.
      Fixed bug: listing emails triggers 403
      Usually, emails can be shown as a list of posts when entering their email
      address as a page. (e.g. www.mirrorisland.com/user@email.com).
      However, testing on different servers triggers a 403 Forbidden error when
      accessing a list of emails without a trailing slash.
      Apache observes the email address rewrite rule correctly, although it is
      *possible* that LiteSpeed or the test server sees a trailing ".com" as a
      security threat.
      One fix involves adding a trailing slash to the "View Emails" button in the
      profile popup.
  17. 13 Nov, 2020 1 commit
    • SamJanis's avatar
      List emails as posts when given email address. · b8f9de3e
      SamJanis authored
      Emails can be shown as a list of posts when entering their email address as a page. (e.g. www.mirrorisland.com/user@email.com)
      - Added line to handle email addresses, since the existing single-value RewriteRule didn't respond to values with full-stops in them. Now, "/user@address.com" correctly redirects to "/$page=user@address.com", with or without the trailing slash.
      - Increased $index_get_page from 255 to 1024 to allow for really long or multibyte email addresses.
      - Popup profile icon displays "View Emails" icon for email contacts.
  18. 11 Nov, 2020 1 commit
    • SamJanis's avatar
      Show emails in messager properly · 175d9f01
      SamJanis authored
      A separate query in index_php_ajax_get_messages() was added to fetch the emails as plaintext previews.
      Also, a incomplete function displayed a stray icon in the permissions popup button for age rating. The icon will be restored when age ratings have been completed.
  19. 07 Nov, 2020 1 commit
    • SamJanis's avatar
      Fixed popup editor bugs and recieving emails · a9cb1cf8
      SamJanis authored
      - Added redirect for attempting to access specific files. '/pricing.php' now redirects to '/pricing'
      - Added documentation line for $stripepublicapikey.
      - Fixed bug where popup editor would open from missing popupeditorpermissionstitle span.
      - Fixed bug parsing plaintext emails.
        A bug caused emailhandler.php to stop running when parsing plaintext emails. Originally, the email body was scanned line-by-line against an array of boundary strings. Plain text emails don't have a boundary string and caused the email parser to halt when trying to access an empty array of boundary strings. The fix was to check if the boundary string array was empty and assume plain text if so.
  20. 05 Nov, 2020 2 commits
  21. 03 Nov, 2020 1 commit
  22. 12 Sep, 2020 1 commit
    • SamJanis's avatar
      Added core stripe functionality · 01967d51
      SamJanis authored
      New files:
      - pricing.php
      - backend.php
      Changed files:
      - Added columns:
      	accounttype tinytext;
      	filespace bigint;
      	filesize int;
      	postsize int;
      	stripecustomerid tinytext;
      	stripesubscriptionid tinytext;
      	stripesubscriptioncurrentperiodstart datetime;
      	stripesubscriptioncurrentperiodend datetime;
      	stripesubscriptionpriceid tinytext;
      - Moved index_php_bytes() to func_php_bytes()
      - $index_activeuser[] is now an array containing account data.
      - stripped references to $activeuserid/$index_activeuserid.
      - Set filesize/filespace/postsize on insert into account.
      - core functionality for pricing/stripe payments.
      - Some changes affecting cosmetic appearance.
  23. 17 Mar, 2020 1 commit
    • SamJanis's avatar
      Code cleanup. Modified front page. · da0e9f3b
      SamJanis authored
      Before we start integrating payment systems, any redundant or inefficient code
      was cleaned up. Most examples include:
      Changed ($var != false) or ($var == true) or ($var != "")
      	to just ($var)
      Changed ($var == false) or ($var != true) or ($var == "")
      	to just (!$var)
      Changed double quotes (") to single quotes (') where string variables not used.
      Changed multiple PHP string concat dots with ${var} when inserting string
      variables. PHP's curly braces were mainly used to reduce the number of concat
      operations done per string.
      An example is ("pre".$var."post") becomes ("pre{$var}post") instead.
      Other than clean up, updates were done to the landing page section.
  24. 16 Mar, 2020 1 commit
    • SamJanis's avatar
      Modified landing page · d8cd1ef8
      SamJanis authored
      Other than adding opengraph meta tags in the header,
      no actual code changes have been made.
  25. 12 Feb, 2020 1 commit
    • SamJanis's avatar
      Cosmetic updates, DB now uses utf8mb4 · 546e6f47
      SamJanis authored
      Database changed to use utf8mb4 as its default character set.
      Cosmetic updates:
      - Trusted contacts displayed as "Starred".
      - Buttons are more consistent; green buttons go to a new page, silver buttons stay on the current page.
      - Changed to webfont: Robot-Regular-webfont.woff.
      - Extended sign-in session cookie length from 3 to 90 days.
  26. 24 Jan, 2020 1 commit
    • SamJanis's avatar
      Fixed scrape link · ab4d85b0
      SamJanis authored
      Certain links couldn't be crawled properly using the "scrape link" feature. The
      bug can also be triggered off when content delivery networks (CDNs) require a
      user-agent string. The fix in this commit provides a user agent, and also looks
      for additional meta data when generating scraped links.
  27. 19 Jan, 2020 1 commit
  28. 18 Jan, 2020 1 commit
    • SamJanis's avatar
      Permissions clarified. Fixed bugs; unsigned post origin, flagged unsigned post · 53cc4413
      SamJanis authored
      - Permissions clarified
      The user interface was modified to make permissions easier to understand.
      Previously, the permissions popup was hidden behind an icon that didn't
      indicate it was interactive in any way. Now, when starting or editing a post,
      the view permission button was changed to a button-like appearance, so the user
      has more chance of hovering the mouse over it.
      - Fixed bug: Unsigned posts origin
      (Unsigned posts have invalid origin for their "profile popup" in post credits)
      A bug didn't place a valid URI for posts from unsigned visitors. The link tries
      to generate "$urlhome/$username" in the post's title, which simply returns
      $urlhome if the post author wasn't signed in. The fix replaces $usersame with
      the post id, if the post was unsigned.
      - Fixed bug: Flagged unsigned posts
      (Flagged unsigned posts can be seen when visitors are not signed in)
      A bug compared the authorid of a flagged posts with the currently signed in
      user's account id. Since both unsigned post authors and visitors of the website
      that haven't signed in have the same accountid, a website visitor who isn't
      signed in can see the notification a post hasn'nt been signed in. The fix was
      to check if $index_activeuserid (set when somebody signs in) isn't zero.
  29. 17 Jan, 2020 1 commit
    • SamJanis's avatar
      Fixed bugs; root post error, and NULL fileuse value · 63fa4ba6
      SamJanis authored
      A bug from previous commit prevented users from posting at the root level. When
      starting a new post, the editor checks if the user has permissions to reply to
      that post. With replies to posts, a value returns. When trying to post at root
      level, the value returns NULL and this is assumed to be insufficient
      permissions. The fix skips this check if $parentid is 0.
      A second bug returned NULL for the current user's file use. In PHP this is
      acceptable. When this NULL value is passed to Javascript however, the browser
      assumes the NULL is the end of a statement, and stops executing javascript.
      The fix uses MySQL's IFNULL() function to force a numeric zero if no rows
  30. 15 Jan, 2020 1 commit
    • SamJanis's avatar
      Free space meter added. File size limits active. · f1b6b007
      SamJanis authored
      To share available disk space between users on this site, we have set quotas to
      each user. An experimental disk space meter is displayed on the top of the
      right-side user panel. The disk space is used for uploads, incoming email
      attachments, and images saved from web scrapes. A few changes were made in the
      back end to keep track of used and free space:
      In .htaccess the php_value settings are modified:
      - upload_max_filesize and post_max size are set at 200MiB.
      - max_execution_time and max_input_time are now 180
      In databases.sql the 'files' table was modified. You can run the following
      commands to keep the data in an existing database if you are already running an
      instance of Mirror Island:
      alter table files add column newpostsessionid int after accountid;
      alter table files add column filewidth int after filesize;
      alter table files add column fileheight int after filewidth;
      The column 'files'.'newpostsessionid' identifies images and attachments for a
      newly made post, and measures the combined size of files for that post.
      "Dangling" files (i.e. files that have been uploaded but not published) can be
      identified by having no 'updated' time set in their associated 'files' row, and
      are deleted when starting a new post or editing an existing one.
      A bar graph showing remaining free space is displayed.
      File limits are now enforced.
      Image width and height is saved (where possible)
  31. 03 Jan, 2020 2 commits
    • SamJanis's avatar
      Fixed bug local recipients being saved, email recipients not sending · 865ad9cf
      SamJanis authored
      A bug prevented recipients who were members of the server from being saved as a
      recipient. The server part of an email is compared with the current server
      name.  The bug happens if the username part is not a current member. This
      prevents non-member emails (such as admin@server.com or webmaster@example.com)
      from being sent, since they aren't being checked against the list of current
      members on the website, and a no-match should allow the email to be saved in
      full. The bug fix now allows non-member emails on the same server to be
      preserved and sent.
      Another bug fix allows emails in recipients to be sent again.
    • SamJanis's avatar
      Fixed bug email recipient disappear on save or edit · 577c8824
      SamJanis authored
      A critical bug caused email addresses in the recipients field to disappear
      when the post is saved for both new posts and existing edits. Even though the
      post was emailed to the correct recipient, preserving the email address itself
      is needed to show who the post was sent to.
      This fix keeps all recipients, distinguishes local and email recipients when
      saving, and preserves the order they were placed or edited in.
  32. 31 Dec, 2019 1 commit
  33. 17 Nov, 2019 1 commit
    • SamJanis's avatar
      Bug fixes for experimental mail function: · d8d7eebb
      SamJanis authored
      - When checking for view permissions, the typo "$permission" has been corrected
      to "$permissions". The typo caused view permission checking to always return
      FALSE when it should show 1 or greater for valid users.
      - When getting a list of files to include as attachments, $postid was
      accidentally omitted from the build query string, resulting in an
      "sprintf(): Too few arguments" error.
      - The $emailfrom address wasn't built properly in the function
      index_php_mail(). It is now passed on as a paramenter when calling the "_mail"
      - Filenames for attachments were obtained from a non-existant string when
      calling mb_encode_mimeheader(). They are now correctly read from the database