Compare commits

...

5107 Commits

Author SHA1 Message Date
6631e2cb6f Add Rin to homepage counter 2023-10-23 23:10:45 -07:00
James Shiffer
7040b1b8e5 Fembooru changes 2022-05-14 16:44:50 -07:00
Shish
c1068f1b2b bump 2020-06-24 16:14:49 +01:00
Shish
bb5614c5ef strip auth info from debug info dump 2020-06-24 15:09:53 +01:00
Shish
81417a5031 make info command match help text 2020-06-24 15:00:44 +01:00
Shish
2197b15012 Add core/sanitize_php.php
A small number of PHP-sanity things (eg don't silently ignore errors) to
be included right at the very start of index.php and tests/bootstrap.php
2020-06-24 14:54:46 +01:00
Shish
eecd35d175 turn 'Use of undefined constant' into an error 2020-06-24 13:00:46 +01:00
Shish
1c216e8d51 formatting 2020-06-24 12:44:35 +01:00
Shish
04987ea70e 'resize' support for static thumbnailer 2020-06-23 15:17:54 +01:00
Matthew Barbour
844ec8b53e Removed stump user config section 2020-06-23 15:15:55 +01:00
Matthew Barbour
72de50aa71 Added bulk download extension 2020-06-23 15:15:43 +01:00
Matthew Barbour
ac63992efa Added BulkActionException to allow clean error feedback from bulk actions 2020-06-23 15:15:10 +01:00
Matthew Barbour
7c32b1f7a8 Fixed issue where enabling bulk selection, then disabling it, resulted in subsequent bulk actions not applying to any items 2020-06-23 15:14:58 +01:00
Matthew Barbour
919a3039c4 Added user API key system 2020-06-23 15:14:04 +01:00
Matthew Barbour
ea34d9b756 Changes and bugfixes for bulk import extension 2020-06-23 15:12:26 +01:00
Matthew Barbour
30f62c2ff8 Fixed transaction issue between cron uploader and bulk import 2020-06-23 15:11:35 +01:00
Matthew Barbour
9b9f1d0341 Cleaned up some warnings in bulk import/export extension
Added transactions to bulk import
Renamed beginTransaction to begin_transaction for naming consistency
Updated cron uploader to handle bulk import transactions
2020-06-23 15:07:00 +01:00
Matthew Barbour
835c3b68a1 Added null return option 2020-06-23 15:06:26 +01:00
Matthew Barbour
b937ad6255 Added thumbnail scaling options
Changed ffmpeg thumbnailer to instead output a full-size png which is forwarded to the image thumbnailer, to allow it to take advantage of all available scaling options
2020-06-23 15:05:55 +01:00
Matthew Barbour
8e976fb812 Added "any" search option for private images 2020-06-23 15:03:44 +01:00
Matthew Barbour
dd08b936e3 Added skipped count to bulk import 2020-06-23 15:03:32 +01:00
Matthew Barbour
1fdd5bf575 New private image extension 2020-06-23 15:03:17 +01:00
Matthew Barbour
6d16c52367 New bulk import/export extension 2020-06-23 15:01:22 +01:00
Matthew Barbour
587735a866 Added terabyte support to the shorthand functions 2020-06-23 14:58:41 +01:00
Shish
a2fe0725f5 extra credit for Tag EditCloud 2020-06-22 18:14:07 +01:00
Shish
73660b376e
Merge pull request #732 from LaureeGrd/master
Tag EditCloud: Added category sorting and grouped tags.
2020-06-22 18:13:32 +01:00
Matthew Barbour
d243867b18 Removed errant colon 2020-06-22 18:07:45 +01:00
Matthew Barbour
fac2067069 Corrected issue with post title edit field width 2020-06-22 18:07:02 +01:00
Matthew Barbour
2f313b704a Making document ready events consistent 2020-06-22 18:06:35 +01:00
Matthew Barbour
8fe7038e73 Added option to BulkActionEvent to prevent redirect 2020-06-22 18:06:05 +01:00
Matthew Barbour
c171e98591 Changed int input field to type number 2020-06-22 18:03:40 +01:00
Matthew Barbour
edc8e5aa43 Added bulk import/export to gd suggestion 2020-06-22 18:03:13 +01:00
Matthew Barbour
f6923af8ab Added source logging to cron upload output when all sources are enabled 2020-06-22 18:03:03 +01:00
Matthew Barbour
18cd74f57d Changed a bunch of core extensions to be hidden since there's nothing to interact with 2020-06-22 18:02:47 +01:00
Matthew Barbour
4d69e7ce34 Added early 404 kill if requested image is not found 2020-06-22 18:02:21 +01:00
Matthew Barbour
04cde74226 Performance improvement for counting image category tags 2020-06-22 18:02:01 +01:00
Matthew Barbour
b2405166b3 Added git information to system info for telling what git commit a submission is for 2020-06-22 18:01:02 +01:00
Matthew Barbour
4d0b90921d Added missing AutoTaggerException 2020-06-22 18:00:23 +01:00
Shish
05d4a3a592
Merge pull request #734 from shish/pg-action
Fix postgres testing
2020-06-22 17:27:18 +01:00
Shish
b3fb923cd1 Fix postgres testing
Looks like github updated their default container, so now it contains
postgres and postgres-client by default - we just need to manually
launch the installed-but-disabled daemon
2020-06-22 16:19:11 +01:00
Shish
ad1e52bf05 DATABASE_TIMEOUT isn't set in the installer 2020-06-22 16:08:04 +01:00
LaureeGrd
549ec593bb Tag EditCloud: Added category sorting and grouped tags.
This change implements a simple category-based alphabetical sorting system that puts all tags containing ':' in front of general tabs. It also groups them together for easier styling into columns, grids, or even opening the door for drop-down categories in the edit menu. A much needed feature for me since I have hundreds of tags and I manage them all by my own.
2020-06-14 05:32:53 -03:00
Matthew Barbour
ed8a9fca52 Removed function stub 2020-06-03 20:02:55 +01:00
Matthew Barbour
ec290d8676 Added additional optional video formats to the video handler 2020-06-03 20:01:52 +01:00
Matthew Barbour
5446f29141 improved filetype error handling 2020-06-03 20:01:08 +01:00
Matthew Barbour
86f7a06ed0 New options for cron uploader:
Logging level
Including all logs in output
Stop on error instead of continuing
2020-06-03 20:00:54 +01:00
Matthew Barbour
e1aefb78ab Fix for cron uploader issue with root paths ending in a slash 2020-06-03 19:59:29 +01:00
Matthew Barbour
12c331cbd2 Removed extra tag set from cron uploader, no longer needed now that it runs as a user 2020-06-03 19:58:57 +01:00
Matthew Barbour
8b407e3df3 Changed video html element to use the image objects height and width, if available 2020-06-03 19:58:23 +01:00
Matthew Barbour
bccb206369 formatting pass 2020-06-03 19:58:13 +01:00
Matthew Barbour
2bb5f349f9 Added file type names
Formatted file
2020-06-03 19:57:47 +01:00
Matthew Barbour
007e07e507 Various changes to cron uploader:
Removed count limit, the cron job now checks the max PH execution time and auto-stops itself at 80% of that value.

Now skips os-specific image cache files like thumbs.db and the __macosx folder.

Changed failed folder re-deployment to allow re-deploying to populated queue, making it easier to re-process lots of failed batches all at once.

Changed page to output as a stream, allowing a long-running process to provide output as it runs rather than just at the very end.

Changed import loop to use the yield convention, allowing faster consumption of found files and lower memory use overall.
2020-06-03 19:57:27 +01:00
Matthew Barbour
63b2601e67 Mime type handling overhaul
Changed mime type map to deal with the reality that certain file types have multiple extensions and/or multiple mime types, as well as constants supporting all of the data. Created new functions using the updated mime type map to resolve mime types and extensions. Updated various items around the project that determine mime/extension to take advantage of the new functions.
2020-06-03 19:47:40 +01:00
Matthew Barbour
16c58e266b Added manual page mode to allow extensions to have direct control of the output 2020-06-03 19:40:43 +01:00
Matthew Barbour
6145ecc6f8 Updated post title extension to resolve set_title being removed from display image event
Resolves #724
2020-05-29 22:59:37 +01:00
Matthew Barbour
830915adf2 Fixed lite theme not showing image titles 2020-05-29 22:59:30 +01:00
Shish
06bd4589da option for admins to create new users 2020-05-19 19:33:51 +01:00
Shish
1e76fb239e s/fullrandom/dailyshuffle/, and run formatter 2020-05-13 13:03:49 +01:00
Shish
f7c6b662cd
Merge pull request #720 from MetallicAchu/master
Added a new search criteria "fullrandom"
2020-05-13 13:02:11 +01:00
MetallicAchu
00060c34c2
Merge pull request #1 from MetallicAchu/MetallicAchu-patch-1
Update main.php
2020-05-07 08:12:32 +03:00
MetallicAchu
10d46395d7
Update main.php
Added order[=|:]fullrandom so user doesn't need to choose a new seed every time.
Thus the list will change on a daily basis without user interaction, giving a more dynamic feel to the website
2020-05-07 08:10:15 +03:00
Shish
72645af9a4 refactor a bunch of weirdness in image replacement 2020-04-25 21:38:11 +01:00
Shish
2cae6cd273 format 2020-04-25 21:36:28 +01:00
Shish
0b2e36303d allow bypassing auth tokens in unit tests 2020-04-25 21:35:14 +01:00
Shish
b0cb46abca test a couple extra branches 2020-04-24 14:10:45 +01:00
Shish
78710166a1 add a extra escape, fixes #718 2020-04-20 09:53:44 +01:00
Shish
c146a9f53d don't double-escape 2020-04-12 12:45:19 +01:00
Shish
f6112d26a2 unify single and global history pages 2020-04-12 12:43:12 +01:00
Shish
b04b5af190
Merge pull request #717 from DanielOaks/add-logout-button
Add logout button to themes that use subnav bar
2020-04-06 16:54:48 +01:00
Daniel Oaks
02d42a01b4 Add logout button to themes that use subnav bar 2020-04-07 01:36:10 +10:00
Shish
0039aafe94 avoid excess ampersands 2020-04-02 22:38:50 +01:00
Shish
1d389f0156 make tests/router.php more like .htaccess 2020-04-02 22:31:57 +01:00
Shish
69cb67fe24 stagger thumbnail cache 2020-03-28 16:11:05 +00:00
Shish
5ea26a80cc nicetest without http vs https pain 2020-03-28 15:48:27 +00:00
Shish
126c629a1a test 2020-03-28 14:39:03 +00:00
Shish
ab4b745310 test 2020-03-28 14:33:48 +00:00
Shish
f47e35e4e5 make make_link more sane 2020-03-28 14:11:14 +00:00
Shish
fd359fb08c remove broken tagger extension 2020-03-28 00:56:54 +00:00
Shish
866b77ab19 set max-width / max-height for random and featured image blocks 2020-03-28 00:23:29 +00:00
Shish
b60e8ac5b4 make modify_url work better 2020-03-27 23:35:07 +00:00
Shish
70acc6015b drop support for ie6 2020-03-27 20:57:15 +00:00
Shish
a3a129df5f more niceurlness 2020-03-27 20:53:21 +00:00
Shish
02675609b4 more referer dedupe 2020-03-27 20:24:26 +00:00
Shish
85662575c5 stop warning for lack of referer / user-agent - not having those is now pretty normal 2020-03-27 19:42:46 +00:00
Shish
c16e3fd939 dedupe some referer handling 2020-03-27 19:41:34 +00:00
Shish
5ea7cc5b36 SCRIPT_NAME instead of PHP_SELF to find self for niceurl test 2020-03-27 19:03:46 +00:00
Shish
efde5e1edf bump 2020-03-27 14:56:59 +00:00
Shish
7b9c9dc208 Make SHM_FORM generate the correct targets 2020-03-27 14:46:55 +00:00
Shish
bc3de6a52a a bunch more testing and fixes for Pools 2020-03-27 14:41:24 +00:00
Shish
d85f4d3799 automatic version 2020-03-27 12:24:47 +00:00
Shish
880a702b42 dedupe page_number parsing 2020-03-27 00:23:29 +00:00
Shish
b5f0bc7621 a bunch of pools cleanup 2020-03-27 00:15:15 +00:00
Shish
599043baa5 whitespace 2020-03-27 00:06:55 +00:00
Shish
36a2125e90 basic tests for page nav 2020-03-26 21:28:36 +00:00
Shish
1f50f14672 basic tests for help pages 2020-03-26 21:28:23 +00:00
Shish
b0c5043892 test InitExt / DatabaseUpgrade 2020-03-26 19:06:30 +00:00
Shish
861ee946a9 typo 2020-03-26 19:03:34 +00:00
Shish
237f8148f3 a bunch of pools tests and fixes 2020-03-26 18:52:31 +00:00
Shish
17f3b44212 mention system_info in bug report form 2020-03-26 17:23:23 +00:00
Shish
511a82f2ba include database version in sys info 2020-03-26 16:57:08 +00:00
Shish
2d0b107adb convert pool IDs to ints 2020-03-26 16:50:16 +00:00
Shish
ecbf4f52a0 make sysinfo part of core, and use YAML for easier parsing 2020-03-26 16:46:09 +00:00
Shish
06e5b02874 streamline bug template 2020-03-26 15:20:46 +00:00
Shish
f819993685 remove nit 2020-03-26 15:16:30 +00:00
Shish
1b10d8583e missed a reference 2020-03-26 15:01:26 +00:00
Shish
e362f3bad2 stop depending on unmaintained tablesorter plugin 2020-03-26 14:57:38 +00:00
Shish
5f5b858175 allow images and thumbs to be cached when served in docker 2020-03-25 19:57:50 +00:00
Shish
168cf99188 shrink docker image from ~550MB to ~300MB 2020-03-25 19:43:28 +00:00
Shish
134fd7d919 xdebug only for unit-test image 2020-03-25 19:37:38 +00:00
Shish
ea637132bd named layers 2020-03-25 19:36:41 +00:00
Shish
566c92b780 make sure version is in core/sys_config 2020-03-25 15:31:28 +00:00
Shish
4e4deed889 bump 2020-03-25 15:27:50 +00:00
Shish
d4e05d947a bump 2020-03-25 15:20:55 +00:00
Shish
25248c089d inherit signup page from default on lite theme 2020-03-25 15:19:28 +00:00
Shish
0094d5c1a8 attempt 2 at auto-release 2020-03-25 13:53:21 +00:00
Shish
f0db4f9a02 first attempt at automated release 2020-03-25 13:40:54 +00:00
Shish
03806d0420 https a bunch of things 2020-03-25 11:47:00 +00:00
Shish
c3b67f346b Actually, let's have the docs in the wiki 2020-03-25 11:26:33 +00:00
Shish
edee8e7427 fix for EXIF with strict types 2020-03-25 10:50:32 +00:00
Shish
c794e457b1 + 2020-03-23 20:01:37 +00:00
Shish
1753cbd72b bump for cleaner install 2020-03-23 20:00:53 +00:00
Shish
8b1b4d257e stick a blank index.php in data/ just in case somebody left directory-indexing on 2020-03-23 19:56:05 +00:00
Shish
ea0e83abc9 clearer missing-vendor screen 2020-03-23 19:50:28 +00:00
Shish
bf4280461f upgrade docs 2020-03-23 19:01:37 +00:00
Shish
d0b00a72ce
Update INSTALL.md 2020-03-23 18:51:17 +00:00
Shish
d14819387e composer is a pain on windows 2020-03-23 18:50:45 +00:00
Shish
040bffa4f6 even the installer requires composer now, so check for that first 2020-03-23 18:47:18 +00:00
Shish
3f26013b28 the 'binary' releases are hugely out of date 2020-03-23 18:38:08 +00:00
Shish
a3f0c94ca2 version bump, and don't suggest that people should use old branches 2020-03-23 18:31:10 +00:00
Shish
9147b64625 more dev docs 2020-03-23 18:21:27 +00:00
Shish
9a21716f5e
Merge pull request #705 from DanielOaks/extend-wiki-tagcategories
Extend Wiki integration a bit
2020-03-23 14:22:41 +00:00
Daniel Oaks
0029aa5320 Add shortwiki entries when viewing a single tag 2020-03-23 22:48:38 +10:00
Daniel Oaks
deac369d26 Colour wiki titles using tag categories 2020-03-23 22:45:31 +10:00
Shish
4f04635cd8
Merge pull request #704 from DanielOaks/fix-futaba-strict
Fix Futaba theme with new strict types
2020-03-23 12:40:08 +00:00
Daniel Oaks
fc59fe6a3d Fix Futaba theme with new strict types 2020-03-23 22:29:34 +10:00
Shish
1d6ad6cb09
Merge pull request #703 from DanielOaks/more_tag_category_integration
More tag category integration
2020-03-23 12:14:13 +00:00
Daniel Oaks
a83c460b70 Fix double-escaping pointed out by Shish <3 2020-03-23 21:22:30 +10:00
Daniel Oaks
9484c9173c Colour tag categories in tag list+map 2020-03-23 15:02:09 +10:00
Daniel Oaks
b3e7d46351 Add tagcategories->getTagHtml helper 2020-03-23 15:01:24 +10:00
Shish
52a232d113 ... 2020-03-23 00:24:37 +00:00
Shish
92b000ed4e derp 2020-03-23 00:21:35 +00:00
Shish
d599ef4f22 hide redundant part 2020-03-23 00:15:20 +00:00
Shish
1fc75c0b18 Whenever we display an image for any reason, show the admin block, fixes #621 2020-03-23 00:06:43 +00:00
Shish
bfcefb97e7 docs 2020-03-22 15:52:03 +00:00
Shish
76b346b45d docs folder 2020-03-22 15:49:55 +00:00
Shish
fe874389ab change test name 2020-03-22 15:31:53 +00:00
Shish
ad9cca36b1 improvements to run inside docker 2020-03-22 15:23:23 +00:00
Shish
9d3939b87f derp 2020-03-22 14:01:27 +00:00
Shish
bbb8d8be4f docker docs 2020-03-21 22:47:34 +00:00
Shish
6308dfefac font size 2020-03-21 22:17:24 +00:00
Shish
718f72c42d case-insensitive username search 2020-03-21 22:17:24 +00:00
Shish
80354c99b5 cached docker builds, scheduled clean 2020-03-20 16:59:11 +00:00
Shish
f633f4abec order more 2020-03-19 15:10:50 +00:00
Shish
5c1925bc2d order regs 2020-03-19 15:02:47 +00:00
Shish
99c461e0e0 streamline docker build 2020-03-19 14:58:55 +00:00
Shish
6955053b87 fewer layers 2020-03-19 14:52:54 +00:00
Shish
4dda69df45 ... 2020-03-19 14:03:36 +00:00
Shish
345faeba8d ffffff yaml... 2020-03-19 14:02:49 +00:00
Shish
36f0024426 ffffff php... 2020-03-19 14:01:48 +00:00
Shish
15258657fc only publish after tests pass 2020-03-19 13:44:56 +00:00
Shish
adf4534816 base user all permissions disabled by default, and reg viewer 2020-03-19 13:37:14 +00:00
Shish
e672fbb343 security 2020-03-19 03:49:06 +00:00
Shish
fea8f90f68 backwards-compatible registry 2020-03-19 03:40:29 +00:00
Shish
c528cd9a42 extensions in stand-alone mode 2020-03-19 00:47:47 +00:00
Shish
2685ff150a
Merge pull request #701 from Mik-chan/master
Fixed Admin permissions
2020-03-18 23:18:56 +00:00
MikChan
cb275d3e3b
Fixed code style according to PSR-2 2020-03-19 01:15:25 +03:00
MikChan
a5f5b44798
Fixed Admin permissions 2020-03-19 01:06:55 +03:00
MikChan
e7c779796e
Merge pull request #2 from shish/master
Update
2020-03-19 01:02:11 +03:00
Shish
6fbdeb2b32 router working with niceurls 2020-03-18 20:27:52 +00:00
Shish
3206110cf4 InitExt / DatabaseUpgrade as part of the try/catch 2020-03-18 20:27:52 +00:00
Shish
df3660fbcf bbcode signup message 2020-03-18 17:29:08 +00:00
Shish
81c72b0a72 bumps 2020-03-18 17:24:06 +00:00
Shish
bd788582cf docker push 2020-03-17 20:15:36 +00:00
Shish
2da46ee484 start mysql 2020-03-16 15:22:22 +00:00
Shish
f67fcaf35d checkout v2 2020-03-16 15:06:12 +00:00
Shish
d261a7f76e show user list to anyone who can edit passwords, not the more-restricted classes 2020-03-13 10:08:23 +00:00
Shish
7fa9d11512 hard-code one bad case 2020-03-13 10:04:12 +00:00
Shish
5bebee7892 no need to update for mysql 2020-03-13 09:54:14 +00:00
Shish
8f3002f2d8 dot in special chars list 2020-03-13 09:47:43 +00:00
Shish
dede46374f avoid double-escape for upload collision error 2020-03-13 09:39:00 +00:00
Shish
1597eff082 lint fixing 2020-03-13 09:23:54 +00:00
Shish
591c21f3ce bumps, and add user ID columns 2020-03-09 23:54:00 +00:00
Shish
d18d25b3d1 most recent users first 2020-03-09 23:51:01 +00:00
Shish
7b59eebb0a
Merge pull request #698 from DanielOaks/um-whitespace-why
Weird... whitespace issue
2020-03-08 18:49:28 +00:00
Shish
07122f464b
Merge pull request #699 from DanielOaks/fix-danbooru-strict
Fix danbooru themes with new strict types
2020-03-08 18:46:52 +00:00
Shish
30a660cebb
Merge pull request #700 from DanielOaks/dockerfile-changes
Fix Dockerfile script not being marked as executable
2020-03-08 18:46:36 +00:00
Daniel Oaks
2c36dbef38 Mark the docker script as executable 2020-03-09 02:03:49 +10:00
Daniel Oaks
388a2545d1 Fix danbooru themes with new strict types 2020-03-09 01:49:36 +10:00
Daniel Oaks
373c6aca08 Fix... weird whitespace I guess? 2020-03-09 01:10:06 +10:00
Shish
135432b329 don't crash when docs are missing 2020-03-06 13:44:51 +00:00
Shish
f0f8242c3c allow extension documentation to contain raw HTML 2020-03-05 02:09:16 +00:00
Shish
3554d0e323 mark PHP as always using LF rather than CRLF, to be consistent with php-cs-fixer, fixes #694 2020-03-05 01:26:26 +00:00
Shish
04bfdf895f
Merge pull request #697 from sanmadjack/pull
Auto-tag extension and small changes
2020-03-05 01:19:41 +00:00
Shish
2e00b8c9ce scrollIntoView 2020-03-02 17:18:53 +00:00
Shish
5058e1f3fd standard jquery 2020-03-02 17:12:43 +00:00
Shish
ca462d86f1 initial cbz support 2020-03-02 16:04:29 +00:00
Matthew Barbour
8922966ddb Adjusted autotagger tests 2020-03-02 16:01:42 +00:00
Matthew Barbour
9ea2eeb831 Adjusted autotagger tests 2020-03-02 15:59:15 +00:00
Matthew Barbour
823c5d5610 Adjusted autotagger tests 2020-03-02 15:45:55 +00:00
Matthew Barbour
6947b726f0 Added exists function to database object 2020-03-02 15:42:28 +00:00
Matthew Barbour
ba599d5d1b Added count to alias editor import 2020-03-02 15:42:09 +00:00
Matthew Barbour
8ff52b9220 Removed rdundant bytes 2020-03-02 15:41:58 +00:00
Matthew Barbour
cff72263dc Added text to transcode message to indicate file size change 2020-03-02 15:41:43 +00:00
Shish
2f51c14afd fmt 2020-03-02 15:40:13 +00:00
Matthew Barbour
ec9244d553 Adjusted autotagger tests 2020-03-02 15:39:26 +00:00
Matthew Barbour
70560398e3 Adjusted autotagger tests 2020-03-02 15:34:25 +00:00
Matthew Barbour
b4bde94516 Added auto-tagger extension 2020-03-02 15:24:40 +00:00
Matthew Barbour
ac80ca8443 Added exists function to database object 2020-03-02 15:21:49 +00:00
Matthew Barbour
3fbbcdd473 Added count to alias editor import 2020-03-02 15:21:27 +00:00
Matthew Barbour
e159194737 Removed rdundant bytes 2020-03-02 14:24:08 +00:00
Matthew Barbour
546f0701a9 Added text to transcode message to indicate file size change 2020-03-02 14:24:08 +00:00
Shish
126412fb4b
Merge pull request #696 from shish/dependabot/composer/enshrined/svg-sanitize-0.13.1
Bump enshrined/svg-sanitize from 0.12.0 to 0.13.1
2020-03-02 10:08:40 +00:00
Shish
3844595bd1 modernish js 2020-03-02 09:33:56 +00:00
Shish
e50ff27510 === 2020-03-02 09:19:50 +00:00
Shish
05f0db73ff don't do prev/next on textarea 2020-03-02 09:19:17 +00:00
dependabot[bot]
22171806da
Bump enshrined/svg-sanitize from 0.12.0 to 0.13.1
Bumps [enshrined/svg-sanitize](https://github.com/darylldoyle/svg-sanitizer) from 0.12.0 to 0.13.1.
- [Release notes](https://github.com/darylldoyle/svg-sanitizer/releases)
- [Commits](https://github.com/darylldoyle/svg-sanitizer/compare/0.12.0...0.13.1)

Signed-off-by: dependabot[bot] <support@github.com>
2020-02-27 20:39:06 +00:00
Shish
ec7f63ee1f cache thumbs for 24h instead of forever 2020-02-26 10:42:08 +00:00
Shish
33731e8cb0 separate link formatting for URLs and for plain text 2020-02-25 12:26:56 +00:00
Shish
d97f492aaf format 2020-02-25 12:18:47 +00:00
Shish
b44a4de42c one return 2020-02-25 12:18:18 +00:00
Shish
89dd1a7658 create_scaled_image, for other uses 2020-02-25 12:04:37 +00:00
Shish
85731ebf65 file-accept 2020-02-25 12:04:37 +00:00
Shish
e2319769c6 Make ArchiveFileHandler inherit from DataHandlerExtension 2020-02-25 12:04:37 +00:00
Shish
d1374c021e theme-color 2020-02-24 22:47:23 +00:00
Shish
08acfd2ac4
Merge pull request #695 from sanmadjack/pull
Bugfixes
2020-02-24 15:01:04 +00:00
Matthew Barbour
ea96f415c5 Fixed replace creating a new image instead of replacing, fixed null source causing repalce error 2020-02-24 14:40:08 +00:00
Matthew Barbour
30761e6d1f Added mime check to svg check so that it doesn't try to load every upload into memory 2020-02-24 14:29:27 +00:00
Matthew Barbour
152e55b5db Changed Image::by_hash so that it isn't case-sensitive 2020-02-23 23:07:02 -06:00
Matthew Barbour
6d58fe9b32 Fix invalid type arg 2020-02-23 23:07:02 -06:00
Shish
e1e161759e rename handle_static to static_files - stop confusing it with file handlers 2020-02-23 18:48:25 +00:00
Shish
9dcc8b7da1 rename handle_404 to four_oh_four - stop confusing it with file handlers 2020-02-23 18:46:27 +00:00
Shish
174b87d0c4 info show types 2020-02-23 18:38:23 +00:00
Shish
b5e9daeab5 dedupe more data handling 2020-02-23 18:37:22 +00:00
Shish
674d3fc6fa dedupe create_image_from_data 2020-02-23 18:19:27 +00:00
Shish
394e57103c tidy 2020-02-23 18:14:35 +00:00
Shish
77fc510bb3 DataUploadEvent already asserts that file exist 2020-02-23 18:14:35 +00:00
Shish
c5d8585824 info command 2020-02-23 18:14:35 +00:00
Shish
4ade3452ee dedupe getSubclassesOf 2020-02-23 18:14:35 +00:00
Shish
9b6eb0e5e2 more bump 2020-02-23 11:23:58 +00:00
Shish
9b822e4132 bump 2020-02-23 11:22:15 +00:00
Shish
f53cd593c5 travis ci -> github actions in the README 2020-02-14 11:31:13 +00:00
Shish
43ab3088cf cache key 2020-02-13 20:54:59 +00:00
Shish
58346f8b49 stop fixing height / width of videos - that doesn't work well with max-width 2020-02-13 20:54:59 +00:00
Shish
9c47bdb100 users who can edit locks, can edit locked images 2020-02-13 20:54:45 +00:00
Shish
3a57817fc2 Spread ParseLinkTemplate work across relevant extensions 2020-02-09 19:22:25 +00:00
Shish
41a205d24a avoid having nice_urls as both system and admin setting 2020-02-09 16:36:22 +00:00
Shish
641fd5a16f remove CACHE_HTTP - client side page cache causes more problems than it solves 2020-02-09 16:25:17 +00:00
Shish
3c78b5685e remove runtime-coverage -- when we want coverage, we enable it at the PHP runtime level 2020-02-09 16:08:35 +00:00
Shish
d749784e95 remove redundant escaping and split load_balance_url into a separate function with testing 2020-02-09 16:02:37 +00:00
Shish
6087d31812 command to wipe thumb cache 2020-02-09 00:32:53 +00:00
Shish
9514075594 order=length 2020-02-09 00:32:38 +00:00
Shish
cc7a33b31f show lengths to 1/10th second 2020-02-09 00:32:20 +00:00
Shish
4b5becfb7f video length in thumb 2020-02-08 20:44:23 +00:00
Shish
fd7c774f5b handle_svg doesn't need to override ALL of onDataUpload 2020-02-08 20:44:23 +00:00
Shish
2f975eb6d4 don't crash if UA is empty 2020-02-08 11:55:06 +00:00
Shish
85cf801fb3 also msnbot 2020-02-08 11:43:04 +00:00
Shish
0b304bdf2e use Permissions for Favourites / Artist / Relationships, and also check image lock when sending ImageInfoSet instead of getting each receiver to check it 2020-02-08 00:24:42 +00:00
Shish
c6d50f417f note that caches are useful 2020-02-07 22:42:12 +00:00
Shish
5a8d2be90a some extra docs 2020-02-07 22:40:11 +00:00
Shish
45fc6758f0 didn't mean to commit the granular bootstrap tracing... 2020-02-07 22:10:26 +00:00
Shish
aac9cf1fe0 merge some self-contained bits from @sanmadjack's branch 2020-02-07 22:05:27 +00:00
Shish
45347279ce also bingbot and yandex don't need to see deep archives of weird searches 2020-02-06 12:49:11 +00:00
Shish
81ebc51257 actually, we don't really need weird combinations at all... 2020-02-06 03:11:21 +00:00
Shish
cdaecb3380 format 2020-02-06 03:10:30 +00:00
Shish
2b994d5c29 Merge branch 'master' of https://github.com/shish/shimmie2 2020-02-06 03:03:27 +00:00
Shish
c7a152df77 limit google a bit... 2020-02-06 02:59:44 +00:00
Shish
81880f7458 Make installer nice again 2020-02-06 02:19:51 +00:00
Shish
353f536698 UA in trace 2020-02-05 17:23:31 +00:00
Shish
adcd1b6b5e IP in slow log 2020-02-05 17:20:59 +00:00
Shish
03af4dd92f ??? 2020-02-05 09:01:22 +00:00
Shish
23943692ce formatting 2020-02-05 01:38:32 +00:00
Shish
342f30142b re-enable prefetch 2020-02-05 01:27:00 +00:00
Shish
ef82d5f1a1 account for missing tags 2020-02-05 01:26:18 +00:00
Shish
f7feb4075a order, order 2020-02-05 00:27:37 +00:00
Shish
1a07f84622 inline build_accurate_search_querylet 2020-02-05 00:16:47 +00:00
Shish
188d809ee7 trace all CLI commands 2020-02-05 00:16:30 +00:00
Shish
e971d10d41 we can also optimise one negative tag in the same way 2020-02-04 23:49:54 +00:00
Shish
b81a95129c faster search for getting deep into individual tag archives 2020-02-04 23:43:24 +00:00
Shish
c0bdb6b7f8 merge common stuff into build_search_querylet 2020-02-04 23:27:01 +00:00
Shish
aa5cf0e81b optimise counting number of results for one negative tag 2020-02-04 23:05:07 +00:00
Shish
9216be3c96 if we're past the searchable number of pages, don't bother counting the number of pages, just 404 2020-02-04 22:44:27 +00:00
Shish
7d4008bae8 remove email stuff that was never used 2020-02-04 21:09:58 +00:00
Shish
274f9fc7a8 typo 2020-02-04 02:00:26 +00:00
Shish
13f4de8c14 Have arrowkey nav use HTML next/prev links 2020-02-04 01:59:08 +00:00
Shish
015a597027 tighten up browser search 2020-02-04 01:45:45 +00:00
Shish
17c43ec7cc java in the browser is dead - RIP oekaki 2020-02-04 01:25:38 +00:00
Shish
35aca4fa9a separate calls for A and LINK?? 2020-02-04 01:22:26 +00:00
Shish
fdfae4f9c0 first/last links too 2020-02-04 01:18:04 +00:00
Shish
0f0cceae22 format 2020-02-04 01:15:25 +00:00
Shish
d13c91ff9a Merge branch 'master' of https://github.com/shish/shimmie2 2020-02-04 01:14:11 +00:00
Shish
ad905248e8 prev/next/preload links for any page with a paginator 2020-02-04 01:12:50 +00:00
Shish
c3088c57fe remove bulk_remove - it was never completed, and bulk_actions is better 2020-02-04 00:47:13 +00:00
Shish
e46b319295 set theme classes 2020-02-04 00:46:36 +00:00
Shish
116bd8d6e5 media logging 2020-02-02 17:01:17 +00:00
Shish
d880dc7997 don't fail to trace CLI 2020-02-02 17:00:55 +00:00
Shish
9d704183c7 actually do bulk actions from CLI 2020-02-02 17:00:33 +00:00
Shish
7cf5c2a28c bump size of index cli search 2020-02-02 15:53:20 +00:00
Shish
0452de1be9 flush stdout after each CLI logging call 2020-02-02 15:53:05 +00:00
Shish
81cd320928 don't trigger traces for slow uploads 2020-02-02 02:09:34 +00:00
Shish
ebea517c41 in speed mode, only support 10 pages of RSS for each query 2020-02-02 01:59:25 +00:00
Shish
84a4bb7f9a types 2020-02-01 23:50:42 +00:00
Shish
f70bce113d BASE_HREF is always defined, but sometimes defined as null 2020-02-01 23:42:40 +00:00
Shish
05b4cd96dc format 2020-02-01 23:40:05 +00:00
Shish
f5c402ad85 inline a one-use function 2020-02-01 23:37:20 +00:00
Shish
b6656e8141 more privacy 2020-02-01 23:30:19 +00:00
Shish
0bcbcb679e have navlinks as a utility methods that themes can call, if they want to 2020-02-01 23:23:23 +00:00
Shish
321eafa408 format 2020-02-01 23:04:40 +00:00
Shish
6d2c92575d tests for format_milliseconds 2020-02-01 23:03:23 +00:00
Shish
e91acbb2c2 remove unused scoreql parameters 2020-02-01 22:51:30 +00:00
Shish
40ab91f8ea remove redundant scoreql_to_sql 2020-02-01 22:44:50 +00:00
Shish
1589b42a10 test_truncate 2020-02-01 22:35:41 +00:00
Shish
ce8da04d3a dedupe BASE_URL / BASE_HREF 2020-02-01 22:26:08 +00:00
Shish
e9ab6aa802 drop redundant end-php tag 2020-02-01 21:42:47 +00:00
Shish
665d5db3f6 drop un-used, un-tested config variants 2020-02-01 21:40:35 +00:00
Shish
6f7e0e5b12 drop logging args that didn't get used in practice 2020-02-01 21:37:07 +00:00
Shish
3f689b68bc MockDatabase didn't get used 2020-02-01 21:32:38 +00:00
Shish
66bd27b0ee fix login for names with spaces 2020-02-01 21:21:27 +00:00
Shish
a5c7faeff7 move stream_file to its own function 2020-02-01 21:20:32 +00:00
Shish
1b4d06c8d2 explanation 2020-02-01 20:01:25 +00:00
Shish
43ea7fb70c replace array_{add,remove} with array_diff 2020-02-01 19:30:32 +00:00
Shish
deb26ff7d3 faster svg thumbs 2020-02-01 18:51:57 +00:00
Shish
89ca23a4fd cleanup 2020-02-01 18:44:54 +00:00
Shish
720470c948 updates 2020-02-01 18:36:30 +00:00
Shish
dcb1f862e6 types 2020-02-01 18:27:21 +00:00
Shish
7f2f5c342e r34 theme 2020-02-01 18:22:08 +00:00
Shish
f0f3cc7aa0 merge layout stuff into Page class 2020-02-01 18:11:11 +00:00
Shish
de0a7138d2 formatting 2020-02-01 11:59:39 +00:00
Shish
57cd550204 fix user deletion 2020-02-01 11:59:39 +00:00
Shish
ce22deea83 fucking php... 2020-02-01 11:59:39 +00:00
Shish
135b8db720 fix types in http_range support 2020-02-01 11:59:39 +00:00
Shish
fb4a07a3d6 name top level of trace after test class 2020-01-31 01:13:49 +00:00
Shish
e5cd9fa923 microcrud update 2020-01-30 22:55:28 +00:00
Shish
73310fa7d5 fix tag/source reverts 2020-01-30 22:33:43 +00:00
Shish
af733b53ca more encoding 2020-01-30 22:10:51 +00:00
Shish
da42b19d6b make it more explicit that caret/decaret are for encoding tags into URL paths 2020-01-30 21:50:30 +00:00
Shish
fb80509be9 also escape ? and & in tags 2020-01-30 21:24:16 +00:00
Shish
8651cc0d7a get_int for db_version 2020-01-30 21:11:56 +00:00
Shish
3ee05b21e2 cache CLI 2020-01-30 21:05:59 +00:00
Shish
81aef74715 config CLI 2020-01-30 21:05:43 +00:00
Shish
636e1da7d8 format 2020-01-30 14:50:38 +00:00
Shish
012f5d9da8 sqlite support for Approvals 2020-01-30 14:50:30 +00:00
Shish
5aa86963dd trash and rss comments work with sqlite 2020-01-30 14:45:32 +00:00
Shish
0ec305a886 stop using ? as a wildcard 2020-01-30 10:55:35 +00:00
Shish
c2231432f3 no make_link for forms 2020-01-30 10:31:11 +00:00
Shish
55b697c198 block type 2020-01-30 10:26:36 +00:00
Shish
02ec21cb16 weird tag test 2020-01-30 10:26:28 +00:00
Shish
831906681e fixes for mysql 2020-01-30 09:01:19 +00:00
Shish
f90c8cee3c SQL T_T 2020-01-29 20:36:25 +00:00
Shish
fb5bce69f8 SQL T_T 2020-01-29 20:34:02 +00:00
Shish
4e57e04ddf fix a lot of tests 2020-01-29 20:22:50 +00:00
Shish
86d93b2cc2 bool_escape('1') should be True 2020-01-29 20:20:17 +00:00
Shish
41ce16f1b8 ratings works with sqlite (unit tests pass, at least) 2020-01-29 11:30:52 +00:00
Shish
aa1637d128 format 2020-01-29 01:47:43 +00:00
Shish
6d3ca01424 format 2020-01-29 00:49:26 +00:00
Shish
e8a72b0291 clear in setUp 2020-01-29 00:37:31 +00:00
Shish
30bf856f98 test tracing 2020-01-28 23:57:43 +00:00
Shish
7472d6faf0 Add a secret 'static' media engine for fast unit testing 2020-01-28 22:23:03 +00:00
Shish
615da9e9d2 fix all the tests (for sqlite, php7.4, osx, at least) 2020-01-28 21:19:59 +00:00
Shish
ac1076b3f3 don't use string concatenation for sql 2020-01-28 00:49:51 +00:00
Shish
94635c0c00 add some tests 2020-01-28 00:47:30 +00:00
Shish
a887077ac8 remove redundant escapes 2020-01-28 00:16:22 +00:00
Shish
9ac8246fa2 fixes 2020-01-27 22:22:07 +00:00
Shish
95f4474b72 docket 2020-01-27 20:11:28 +00:00
Shish
d6c7857c6b syntax 2020-01-27 20:06:19 +00:00
Shish
9ea70b0055 separate VERSION for tests 2020-01-27 20:02:39 +00:00
Shish
af48aa504b stop ENABLED_MODS 2020-01-27 20:00:23 +00:00
Shish
59c89ee135 Stop failing to have a separate SCORE_VERSION 2020-01-27 19:57:07 +00:00
Shish
15d1e4ef17 Remove MIN_PHP_VERSION - that's not a thing that end users can change 2020-01-27 19:54:51 +00:00
Shish
22c7cab0cd Merge AUTO_DB_UPGRADE into SPEED_HAX 2020-01-27 19:52:54 +00:00
Shish
3c5e6f0746 delete search-accel stuff - built-in queries are faster now 2020-01-27 19:49:50 +00:00
Shish
87d1e21679 merge COMPILE_ELS into SPEED_HAX 2020-01-27 19:48:20 +00:00
Shish
88afc12c13 testing DSN from environment 2020-01-27 19:40:14 +00:00
Shish
d254b98780 more helpful installer exception 2020-01-27 19:37:28 +00:00
Shish
7080f8bc2a fix InstallerException 2020-01-27 19:31:38 +00:00
Shish
7e43e2e304 split www stuff to index.php and test things to tests/bootstrap.php 2020-01-27 19:28:58 +00:00
Shish
eb9d63c2a2 remove non-functional locking 2020-01-27 19:27:31 +00:00
Shish
fbe55ea531 remove non-functional locking 2020-01-27 19:27:20 +00:00
Shish
b0237ddd97 more stuff to util.php 2020-01-27 19:05:43 +00:00
Shish
b03eb861d4 AUTO_DB_UPGRADE define 2020-01-27 18:55:23 +00:00
Shish
fc6db3509a tracer_enabled is global 2020-01-27 18:36:29 +00:00
Shish
dba89e9d13 make all themes have a Page class, to simplify loading 2020-01-27 18:35:36 +00:00
Shish
903679dc53 more stuff into regular functions 2020-01-27 18:24:11 +00:00
Shish
9b50e98927 move some installer bits to util.php 2020-01-27 17:47:28 +00:00
Shish
2d20cf388e Merge branch 'master' of https://github.com/shish/shimmie2 2020-01-27 13:03:15 +00:00
Shish
5dab234630 create test users individually 2020-01-27 13:00:09 +00:00
Shish
88b592c6ef coverage as a separate step 2020-01-27 11:57:34 +00:00
Shish
10f99c45ee composer update, but with 7.3 2020-01-26 23:37:24 +00:00
Shish
50fb0da7bf composer update 2020-01-26 23:26:08 +00:00
Shish
4bd1d8b6ee forms 2020-01-26 23:23:15 +00:00
Shish
50f3d04f0c transload error log-ish 2020-01-26 23:23:01 +00:00
Shish
b98dd3dd76 typing 2020-01-26 22:58:59 +00:00
Shish
a83223f362 strict video 2020-01-26 21:14:50 +00:00
Shish
53d51b1cd1 another 2020-01-26 19:46:10 +00:00
Shish
cddf6e9d5f more types 2020-01-26 19:44:36 +00:00
Shish
f8499be286 plte 2020-01-26 18:53:04 +00:00
Shish
e0778f94f7 more types 2020-01-26 18:47:30 +00:00
Shish
235b976dbc databases... 2020-01-26 18:10:58 +00:00
Shish
f78edfcf99 warner 2020-01-26 17:50:35 +00:00
Shish
9d9532a215 warner 2020-01-26 17:47:41 +00:00
Shish
d3737c7a66 warner 2020-01-26 17:43:39 +00:00
Shish
06fffd6328 more 2020-01-26 17:39:55 +00:00
Shish
973a53c9bb fix 2020-01-26 16:43:41 +00:00
Shish
bb72edd15b tests 2020-01-26 16:40:52 +00:00
Shish
3631084afd format 2020-01-26 16:38:26 +00:00
Shish
60dda96fd2 nits 2020-01-26 16:38:13 +00:00
Shish
6cc7124069 ignore 2020-01-26 16:28:12 +00:00
Shish
9eb5acf2dc use strict types 2020-01-26 16:27:56 +00:00
Shish
f5ccffdaf4 shm_simple_form 2020-01-26 13:29:04 +00:00
Shish
1802b9c7f6 microhtml for blocks 2020-01-23 01:22:08 +00:00
Shish
d7a290b635 index prefetch 2020-01-19 19:13:05 +00:00
Shish
73c63e3477 microhtml for user page 2020-01-16 19:13:12 +00:00
Shish
2c2381d965 microhtml for user page 2020-01-12 16:28:59 +00:00
Shish
f85b43e17c autocomplete hints 2020-01-12 15:19:15 +00:00
Shish
485ad1e569 composer updates 2020-01-12 15:19:15 +00:00
Shish
ff7f456220
Merge pull request #692 from shish/dependabot/composer/enshrined/svg-sanitize-0.12.0
Bump enshrined/svg-sanitize from 0.8.2 to 0.12.0
2020-01-08 18:55:48 +00:00
dependabot[bot]
f27921e9ef
Bump enshrined/svg-sanitize from 0.8.2 to 0.12.0
Bumps [enshrined/svg-sanitize](https://github.com/darylldoyle/svg-sanitizer) from 0.8.2 to 0.12.0.
- [Release notes](https://github.com/darylldoyle/svg-sanitizer/releases)
- [Commits](https://github.com/darylldoyle/svg-sanitizer/compare/0.8.2...0.12.0)

Signed-off-by: dependabot[bot] <support@github.com>
2020-01-08 17:18:32 +00:00
Shish
9f4abdaf79 use the right keys for actions 2020-01-01 10:42:38 +00:00
Shish
5b5e9d8d7a fix #691 2019-12-26 17:08:29 +00:00
Shish
fb2fe58b57 fixes 2019-12-26 16:52:59 +00:00
Shish
057ccd65c3 Merge branch 'master' of https://github.com/shish/shimmie2 2019-12-26 16:37:37 +00:00
Shish
51628607d0 ...? 2019-12-26 16:33:08 +00:00
Shish
6516e5cc46 argh 2019-12-26 16:23:29 +00:00
Shish
8bc7d5d445 pg 2019-12-26 16:21:15 +00:00
Shish
f3cb70a06d Revert "inline some one-use vars"
This reverts commit 1c3d4ad5e3fe2a2f454109b8f00c5d200bc6e5b3.
2019-12-26 16:20:05 +00:00
Shish
bafdb1c769 crud update 2019-12-26 16:04:04 +00:00
Shish
67afe948bd format 2019-12-26 16:00:01 +00:00
Shish
b8dc0a880b if login fails with a space, try with underscore 2019-12-16 09:01:09 +00:00
Shish
daf43049a1 search user by join date 2019-12-16 09:00:41 +00:00
Shish
f6022e80fb Let's only have one Help link 2019-12-16 01:17:27 +00:00
Shish
50a3b23444 microcrud update 2019-12-16 00:12:05 +00:00
Shish
678b25d92b get flash from GET as early as possible 2019-12-16 00:06:04 +00:00
Shish
5d559dc654 fix typo 2019-12-16 00:02:34 +00:00
Shish
86d4f2eb82 permissions for sending & reading PMs, so that ghosts can have them revoked 2019-12-15 20:40:05 +00:00
Shish
70db0ce5bd flash_message -> page->flash, with no cookies 2019-12-15 19:47:18 +00:00
Shish
8740d83686 log ban type 2019-12-15 16:21:48 +00:00
Shish
0d6623c928 case-insensitive username search 2019-12-15 16:21:31 +00:00
Shish
1c3d4ad5e3 inline some one-use vars 2019-12-15 16:13:09 +00:00
Shish
090ff65109 replace ILIKE with the better-supported LOWER 2019-12-15 16:09:48 +00:00
Shish
d7a2ca9ddc remove SCORE_STRNORM - everyone supports LOWER now 2019-12-15 16:07:46 +00:00
Shish
7b7febea55 better validation 2019-12-15 16:01:32 +00:00
Shish
09b9901493 refer to users by name 2019-12-15 15:40:15 +00:00
Shish
d705578f79 formatting 2019-12-15 15:31:44 +00:00
Shish
f09d328b30 log_db search updates 2019-12-15 15:30:52 +00:00
Shish
a4376c9cf1 composer update 2019-12-15 15:29:37 +00:00
Shish
478e927019
Merge pull request #690 from GP32/patch-1
fixing "12 hours ago" error when using SQLite
2019-12-12 12:08:22 +00:00
GP32
e4400631a9
fixing "12 hours ago" error when using SQLite 2019-12-10 12:50:47 +09:00
Shish
cb29d07ecc get rid of exists(), because rowCount doesn't work consistently 2019-12-10 01:17:14 +00:00
Shish
431d6dd523 remove test for dead code 2019-12-09 18:31:57 +00:00
Shish
3c3e551db2 fix composer.lock 2019-12-09 18:18:38 +00:00
Shish
562a2c8fea use microhtml for ext_manager 2019-12-09 14:20:56 +00:00
Shish
5a7af0f083 remove delete-by-query - bulk actions does the same thing better 2019-12-09 14:19:07 +00:00
Shish
d1001b55de no sane defaults yet 2019-12-08 11:06:52 +00:00
Shish
3a15a679bc more custom stuff for log view 2019-12-08 10:52:00 +00:00
Shish
3e83e66d7c microcrud for log_db 2019-12-07 23:00:52 +00:00
Shish
151109ca0e allow adding URLs to get-page 2019-12-07 22:55:40 +00:00
Shish
7f041a9f93 have fatal_error print out a bunch more info when run from CLI 2019-12-07 22:53:59 +00:00
Shish
d6fe059b67 stringer() function, because php lacks a good repr() D: 2019-12-07 22:51:28 +00:00
Shish
0806b2e5f0 Give Event a default toString 2019-12-07 22:49:02 +00:00
Shish
7ca484972f remove Tag Categories page, because it is bad 2019-12-02 00:43:03 +00:00
Shish
3e408c0f28 allow dashes in block IDs 2019-12-01 23:41:10 +00:00
Shish
18be03997a composer update 2019-12-01 23:41:05 +00:00
Shish
ecb6266617 merge 2019-12-01 19:15:40 +00:00
Shish
0a330cd0ba merge 2019-12-01 18:58:13 +00:00
Shish
79e21cec7f microcrud for aliases 2019-12-01 01:02:18 +00:00
Shish
d2b50573c6 microcrud for user list 2019-12-01 00:46:54 +00:00
Shish
e926b15d5f only show current IP to self 2019-11-30 05:07:31 +00:00
Shish
a07220d29b typo fix 2019-11-29 18:16:31 +00:00
Shish
4e03d3cce3 Merge branch 'master' of https://github.com/shish/shimmie2 2019-11-29 18:13:54 +00:00
Shish
71941da552 custom primary keys 2019-11-29 02:21:00 +00:00
Shish
3ac3fcb711 fix whitespace 2019-11-29 02:20:48 +00:00
Shish
7d30aaf1ea microcrud for notatag 2019-11-29 02:07:12 +00:00
Shish
2deaeca133 use the right table 2019-11-29 02:04:14 +00:00
Shish
920bdd1884 microcrud for image hash bans 2019-11-29 01:52:33 +00:00
Shish
ae805be967 separate messages for ban types 2019-11-28 23:40:14 +00:00
Shish
5cc6a7cd68 show user's IP 2019-11-28 23:39:45 +00:00
Shish
a1e67e97b7 Don't cache ghost-ban announcement pages 2019-11-28 21:46:34 +00:00
Shish
efdc903263 fix typo 2019-11-28 21:35:43 +00:00
Shish
30b85f58db anon-ghost mode, and ghosts can't sign up for accounts 2019-11-28 21:32:18 +00:00
Shish
26e24c8988 ban message is not content 2019-11-28 18:10:58 +00:00
Shish
9cab604455 hook bans into UserLoginEvent instead of InitExtEvent 2019-11-28 18:01:21 +00:00
Shish
358f6d7abc ghost bans 2019-11-28 17:20:23 +00:00
Shish
3ed3ea7234 simplify ban fetching code 2019-11-28 16:49:21 +00:00
Shish
56b8d88ca4 install with composer.lock to make sure exact versions are installed 2019-11-28 16:42:59 +00:00
Shish
45351dd7d1 update microcrud 2019-11-28 15:27:36 +00:00
Shish
9e084cd615 support custom ban modes 2019-11-28 14:57:56 +00:00
Shish
7bf60542df script defer 2019-11-28 11:43:30 +00:00
Shish
33a32d2287 faster ip search in postgres 2019-11-28 11:43:30 +00:00
Shish
a9993b47a8 working microcrud for ipbans 2019-11-27 21:06:14 +00:00
Shish
1edc4a37bf remove sys_ip_bans 2019-11-27 19:55:25 +00:00
Shish
80a816de8c get-token and post-page 2019-11-27 16:10:12 +00:00
Shish
6b2304af93 format 2019-11-27 12:13:04 +00:00
Shish
21b983ac85 remove travis 2019-11-27 12:03:24 +00:00
Shish
33f564994d disambig 2019-11-27 11:51:23 +00:00
Shish
95ef5940fc consistently use colon parameters 2019-11-27 11:47:38 +00:00
Shish
861def1aa3 be explicit about using FFS-PHP's PDO not vanilla PDO 2019-11-26 10:26:38 +00:00
Shish
29994e9613 postgres now recommends IDENTITY over SERIAL 2019-11-25 00:24:45 +00:00
Shish
a175405210 replace ipban page with microcrud 2019-11-24 15:59:14 +00:00
Shish
56bb03f01a and tests 2019-11-24 13:25:41 +00:00
Shish
0de2f23ece be more CRUD 2019-11-24 13:24:42 +00:00
Shish
d8c4331c66 localhost 2019-11-23 12:15:16 +00:00
Shish
fb3a7c03e8 no host 2019-11-23 12:12:28 +00:00
Shish
bd1897ef9f auth 2019-11-23 12:09:18 +00:00
Shish
5ae8d02366 server 2019-11-23 12:00:45 +00:00
Shish
5ab54609b9 sudo 2019-11-23 11:54:54 +00:00
Shish
1fc0eb70e0 update 2019-11-23 11:51:01 +00:00
Shish
c638943eb8 install sqlite3 2019-11-23 00:09:15 +00:00
Shish
6f17f28194 mysql password 2019-11-22 23:03:34 +00:00
Shish
950d9c9fd3 set up db first 2019-11-21 17:42:31 +00:00
Shish
dde38ce403 ql 2019-11-21 17:35:41 +00:00
Shish
417f16079b more environment setup 2019-11-21 17:34:07 +00:00
Shish
17e2662d06 reduce CI CPU use while testing... 2019-11-21 17:30:19 +00:00
Shish
30df57eaf5 use php's database names 2019-11-21 17:28:13 +00:00
Shish
d00f0cdbe7 install pgsql driver 2019-11-21 17:25:05 +00:00
Shish
849d04bf7a more phpunit 2019-11-21 17:18:43 +00:00
Shish
1e4f08e9e9 updates for phpunit 8 2019-11-21 17:16:11 +00:00
Shish
4026181219 composer updates 2019-11-21 17:12:08 +00:00
Shish
d91e7fa136
testing github actions 2019-11-21 16:59:07 +00:00
Shish
659ef7dac9 update dependencies 2019-11-14 18:24:09 +00:00
Shish
962f6073ff sqlite requires limit/offset, offset/limit is treated as a syntax error 2019-11-11 16:53:11 +00:00
Shish
c94f289291 html_escape all exception messages - pass query out-of-band if we want it formatted 2019-11-11 16:43:42 +00:00
Shish
6486bb95da name_to_id 2019-11-11 16:43:42 +00:00
Shish
247cfcbd77 Avoid shadowing global variable
When we aren't referencing the current `global $user`, we should give it
a different name to avoid confusion
2019-11-11 16:43:42 +00:00
Shish
bde49c4f5e paged ip bans 2019-11-11 12:52:11 +00:00
Shish
418f5484ed show types 2019-11-08 18:54:32 +00:00
Shish
10b9e0ccbc fix page number logic 2019-11-08 17:34:06 +00:00
Shish
1a4a76c324 php... 2019-11-05 00:19:31 +00:00
Shish
15e61c5bf4 restore strtotime, for +4 months etc 2019-11-05 00:16:26 +00:00
Shish
c7d90c2df7 nits 2019-11-04 01:04:12 +00:00
Shish
7601140825 missed a spot 2019-11-04 01:03:47 +00:00
Shish
f79eafc91e format 2019-11-04 00:42:06 +00:00
Shish
d17e207984 Have get_arg never return null
90% of places assume it will never return null, and they will break in
weird ways if it does return null
2019-11-04 00:40:10 +00:00
Shish
fc7da5114f fixes 2019-11-03 23:43:35 +00:00
Shish
954158ad43 typo 2019-11-03 23:32:55 +00:00
Shish
503d93a28e syntax 2019-11-03 23:29:29 +00:00
Shish
bcf7947837 use timestamps for bans, consistency at last /o/ 2019-11-03 23:17:09 +00:00
Shish
f15a95b4de more version 2019-11-03 19:49:52 +00:00
Shish
539dd66fe8 ipban version 2019-11-03 19:43:39 +00:00
Shish
ee948352a5 defaults 2019-11-03 19:25:51 +00:00
Shish
0e660f5aba mysql... 2019-11-03 19:15:09 +00:00
Shish
c41378f0b9 text can't have default in mysql... 2019-11-03 19:11:48 +00:00
Shish
494ba15a70 log every ext version change 2019-11-03 19:04:57 +00:00
Shish
4f0ee38508 slightly more verbose docker install 2019-11-03 18:55:37 +00:00
Shish
0fa371c7b0 create tables before init 2019-11-03 18:32:50 +00:00
Shish
c58a13ae88 formatting 2019-11-03 18:28:38 +00:00
Shish
427acc55a0 Merge branch 'master' of https://github.com/shish/shimmie2 2019-11-03 18:28:16 +00:00
Shish
6bc33ee691 Drop SCORE_DATETIME/NOW - all the databases we care about now support TIMESTAMP/CURRENT_TIMESTAMP 2019-11-03 18:28:05 +00:00
Shish
e2cac352f5 start of ban types 2019-11-03 17:53:52 +00:00
Shish
0fab821d77 set DB timeout to a large number for upgrades 2019-11-03 17:53:41 +00:00
Shish
1210498e41 fix typo in image flag setting 2019-11-03 17:21:58 +00:00
Shish
2f23a11096 manual db upgrade command 2019-11-03 17:21:05 +00:00
Shish
031c441e47 split DatabaseUpgrade into a separate event from InitExt 2019-11-03 17:21:05 +00:00
Shish
ee3754ae79 Merge branch 'master' of https://github.com/shish/shimmie2 2019-11-03 16:28:00 +00:00
Shish
ac5546c6ef remove more old comments 2019-11-03 16:22:59 +00:00
Shish
b568933f45 remove extension metadata comments (we have metadata objects now) 2019-11-02 20:19:09 +00:00
Shish
55c6854003 formatting 2019-11-02 19:57:34 +00:00
Shish
aabc69033b
Merge pull request #687 from sanmadjack/pull
Various changes
2019-11-02 19:55:59 +00:00
Matthew Barbour
6b22f6da3f Cleanup 2019-11-01 23:55:23 -05:00
Matthew Barbour
6e320a090e Better help page nav system integration 2019-11-01 23:55:16 -05:00
Matthew Barbour
1565b8570b Added disapproving controls to approval extension 2019-11-01 23:55:08 -05:00
Matthew Barbour
4dfb2761ab More approval enable option consequences 2019-11-01 23:49:01 -05:00
Matthew Barbour
5f89420fab Approval enable option 2019-11-01 23:49:01 -05:00
Matthew Barbour
2b46ede098 approval permissions 2019-11-01 23:49:01 -05:00
Matthew Barbour
c2d6f1a5fa New "Approval" extension 2019-11-01 23:47:53 -05:00
Matthew Barbour
016fb6be65 Small fixes and corrections 2019-11-01 23:47:53 -05:00
Matthew Barbour
c17c84f15f Fixed searching issues on event log page 2019-10-18 16:36:06 +01:00
Matthew Barbour
ed8caa86bf Fix for random issue 2019-10-18 16:35:44 +01:00
Matthew Barbour
3efa76c6a2 Added set_timeout to database and engine 2019-10-18 16:34:12 +01:00
Matthew Barbour
702f098ea6 Added create_image permission check to upload menu code 2019-10-18 16:32:46 +01:00
Matthew Barbour
9907c02a11 Resolved transaction issue 2019-10-18 16:32:33 +01:00
Matthew Barbour
d1853ee1db Added scoreql option to database functions to make using scoreql less verbose
Added exists function to the database
2019-10-18 16:32:06 +01:00
Matthew Barbour
9139bbfd01 Added another lower() to a tag lookup 2019-10-18 16:31:38 +01:00
Matthew Barbour
0a30ec6cfa Added favorite bulk actions 2019-10-18 16:30:55 +01:00
Matthew Barbour
ed17a631d0 Added extension documentation link image 2019-10-18 16:30:30 +01:00
Matthew Barbour
51563017c8 Transcode config constants migrated to own file, added enabled option for future feature 2019-10-18 16:29:58 +01:00
Matthew Barbour
4897063adc Added trash link 2019-10-18 16:29:44 +01:00
Matthew Barbour
3a14857b40 Consolidated tag sanitization functions
Added more tag convenience functions
2019-10-18 16:29:04 +01:00
Matthew Barbour
04b1754893 Fixed bulk add's KEY 2019-10-18 16:27:32 +01:00
Matthew Barbour
aa5c8c81e0 Added lower() to some tag lookups
Removed a duplicate include line
2019-10-18 16:27:23 +01:00
Matthew Barbour
f594e9066e Added image flag 2019-10-18 16:27:04 +01:00
Matthew Barbour
6b030c00eb Constants for index config 2019-10-18 16:26:11 +01:00
Shish
de39f3e5d7
Merge pull request #686 from sanmadjack/cron_upload
Cron upload
2019-10-18 16:20:10 +01:00
Matthew Barbour
d605e0e572 Added cron_admin permission 2019-10-17 14:26:14 -05:00
Matthew Barbour
92a0afc15e Supporting function for cron uploader changes 2019-10-10 10:41:17 -05:00
matthew
40269a6f4a Cron uploader enhancements and bug fixes 2019-10-10 10:16:15 -05:00
Shish
b6b16b9804 media-rescan also accepts hash 2019-10-04 21:10:00 +01:00
Shish
5b2e9e44a2 note a TODO 2019-10-04 21:08:33 +01:00
Shish
134d2c029c limit results by default (ideally we'd have a --limit flag...) 2019-10-04 21:02:16 +01:00
Shish
32662af1ac start of bulk actions cli 2019-10-04 20:50:49 +01:00
Shish
fee0a845bb media-rescan CLI command 2019-10-04 20:50:36 +01:00
Shish
577d5c572a search from CLI for integration with other unix tools 2019-10-04 20:48:59 +01:00
Shish
4564fd4092 by_id_or_hash for more elegant CLI use 2019-10-04 20:48:21 +01:00
Shish
71c74e034b allow find_images without limit 2019-10-04 20:47:48 +01:00
Shish
cfa48deda1 consistent indent 2019-10-03 17:57:32 +01:00
Shish
30698fefdc remove a bunch of dead variables and things 2019-10-02 11:23:57 +01:00
Shish
e08cdb1638 make Cache its own thing, separate from Database 2019-10-02 10:49:32 +01:00
Shish
842df41951 make dbq html work 2019-10-02 10:23:35 +01:00
Shish
8f688fd2c6 lints 2019-10-02 10:10:47 +01:00
Shish
486c048950 typo 2019-10-02 09:06:00 +01:00
Shish
704cab4470 type fixes 2019-10-02 09:03:14 +01:00
Shish
785e5b67e6 assert for type checking 2019-10-02 08:35:54 +01:00
Shish
6ccf7b72e2 int for port numbers 2019-10-02 00:39:45 +01:00
Shish
c197d021bb Memcache hasn't been supported since php5 - we use Memcached now 2019-10-02 00:38:22 +01:00
Shish
f1c146b512 support set_int(foo, null) 2019-10-02 00:37:22 +01:00
Shish
14ca4f545d stub config so scrutinizer stops complaining about missing define()s 2019-10-01 13:28:38 +01:00
Shish
12d77da449 opt-in to new scrutinizer reports 2019-10-01 11:45:29 +01:00
Shish
c440682ae7 ignores 2019-10-01 11:40:57 +01:00
Shish
c98588d84c not using eclipse 2019-10-01 11:39:43 +01:00
Shish
08293bd32a remove hack for ancient php bug 2019-10-01 11:07:38 +01:00
Shish
d7b08d7b95 bump required versions based on Debian Stable 2019-10-01 11:06:40 +01:00
Shish
727fd921be remove references to develop 2019-10-01 10:51:13 +01:00
Shish
5183c52223 version bump 2019-10-01 10:45:07 +01:00
Shish
794e4ebb7d merge 2019-10-01 10:44:52 +01:00
Shish
7f8ee47eeb composer update 2019-10-01 10:31:31 +01:00
Shish
cea6e2b121 postgres has true / false 2019-09-30 18:05:35 +01:00
Shish
ce61b7dc40 truncate filenames to 64 chars at upload time 2019-09-30 18:05:35 +01:00
Shish
19c4fcaf34 even with EMULATE_PREPARES=false, sqlite still returns strings for int columns... 2019-09-30 10:40:15 +01:00
Shish
fd2d434c61 return native types (int, float) for mysql 2019-09-30 10:19:47 +01:00
Shish
a7bddb1dac get rid of is_admin, fixes #676 2019-09-29 19:01:09 +01:00
Shish
0f4a0275b5 use is_int instead of is_numeric if we want to reject numeric strings, should fix #681 2019-09-29 17:58:56 +01:00
Shish
160f673060 consistent class naming 2019-09-29 17:48:21 +01:00
Shish
1314c3990a
Merge pull request #684 from DanielOaks/develop+danbooru2-fixes
Minor danbooru2 theme fixes
2019-09-29 15:47:09 +01:00
Shish
54067f02a4 fix merge 2019-09-29 15:44:59 +01:00
Shish
ebe4075469 formatting 2019-09-29 14:43:47 +01:00
Shish
e6a402cd4e Merge branch 'custom_ratings' into develop 2019-09-29 14:41:14 +01:00
Shish
f5119b20a3 formatting 2019-09-29 14:32:51 +01:00
Shish
a6bb15d859 formatting 2019-09-29 14:30:55 +01:00
Shish
56e247faf5 remove duplicate import 2019-09-29 14:24:56 +01:00
Matthew Barbour
de68691fc3 ExtensionInfo for user config 2019-09-29 14:22:04 +01:00
Matthew Barbour
b43e425f95 Changed omitted related tags (like tagme) to be powered by a setting, allowing any performance-impacting (or just not useful in this context) tags to be omitted
Further tag list performance improvements
TagListConfig constants
2019-09-29 14:22:04 +01:00
matthew
cf8ed3b134 Added UserLoginEvent 2019-09-29 14:21:23 +01:00
Matthew Barbour
761834b6fa Updated tests to generate user config 2019-09-29 14:20:40 +01:00
Matthew Barbour
73b784266e Moved user config stuff into an extension 2019-09-29 14:20:40 +01:00
matthew
120cdb49a6 Added $user_config global based on existing config object for storing user-specific settings.
Added event to the user page so that extensions can hook into it, providing user-specific setting controls
2019-09-29 14:19:52 +01:00
Matthew Barbour
88e6e68d79 Changed omitted related tags (like tagme) to be powered by a setting, allowing any performance-impacting (or just not useful in this context) tags to be omitted
Further tag list performance improvements
TagListConfig constants
2019-09-26 15:46:28 +01:00
Matthew Barbour
8606c70437 Changed related tags queries to run more efficiently, filter out the starting tags, and filter out any tags starting with tagme, rather than just tagme. 2019-09-26 15:43:48 +01:00
Matthew Barbour
8f95d23828 Removed mass tagger extension 2019-09-26 15:41:51 +01:00
Shish
33fff87f39
Merge pull request #680 from sanmadjack/ext_info
Proposed extension info change to allow getting info for unloaded ext…
2019-09-26 15:37:16 +01:00
Daniel Oaks
0a8aa40a81 Fix header bar colours a bit 2019-09-16 11:08:33 +10:00
Daniel Oaks
dfd833d42d Update email addy 2019-09-16 11:08:33 +10:00
Daniel Oaks
d377fb1705 Fix minor link error, use more standard+simple method from the default theme 2019-09-16 11:08:21 +10:00
Shish
dbaf34f7c3
Merge pull request #682 from DanielOaks/develop+fix-sqlite-underscores
Fix SQLite underscore searching
2019-09-15 16:36:30 +01:00
Shish
c57cff7d5d
Merge pull request #683 from DanielOaks/develop+tiny_taglist_fix
Only show 'Tags' block when there's a tag to put in it
2019-09-15 16:34:55 +01:00
Daniel Oaks
05082c8f11 Only show 'Tags' block when there's a tag to put in it 2019-09-14 15:59:31 +10:00
Daniel Oaks
a1c276c840 Fix SQLite underscore searching (#619) 2019-09-14 13:46:39 +10:00
Matthew Barbour
651b1632b1
Update main.php 2019-09-09 08:13:25 -05:00
Shish
ba20d8d5af filter non-ascii domains 2019-09-08 17:13:20 +01:00
Shish
9341c408b9 allow randomness to be limited, because sql's OFFSET N is O(n) 2019-09-08 17:13:20 +01:00
Matthew Barbour
4dce3a2f07
Update theme.php 2019-08-14 09:07:45 -05:00
Matthew Barbour
d62386474d travis adjustment 2019-08-14 08:51:03 -05:00
Matthew Barbour
2fc0273d78 travis adjustment 2019-08-14 08:44:50 -05:00
Matthew Barbour
3b6ad05b6d Updated test extension test 2019-08-07 16:36:39 -05:00
Matthew Barbour
ac6ded877f Added dependency support for extensions
Separated a few extensions that had multiple extension classes in the same file
2019-08-07 16:32:44 -05:00
Matthew Barbour
744dcd63e1 EmoticonListInfo 2019-08-07 16:06:55 -05:00
Matthew Barbour
f4b647b6b8 Updated util for new extension methods 2019-08-07 15:59:06 -05:00
matthew
1e60c8720c Set unrated and unknown as reserved ratings 2019-08-07 15:50:37 -05:00
Matthew Barbour
0506adbf30 Adjusted rating setting migration 2019-08-07 15:50:37 -05:00
matthew
a019786895 Merge remote-tracking branch 'origin/bugfixes' into custom_ratings 2019-08-07 15:50:36 -05:00
Matthew Barbour
9bc5bb3374 Updated tests to generate user config 2019-08-07 15:50:35 -05:00
Matthew Barbour
85b883ed7a Moved user config stuff into an extension 2019-08-07 15:50:34 -05:00
matthew
0fa2adfdd5 Added $user_config global based on existing config object for storing user-specific settings.
Added event to the user page so that extensions can hook into it, providing user-specific setting controls
2019-08-07 15:50:02 -05:00
Matthew Barbour
ee3f53e108 Changed related tags queries to run more efficiently, filter out the starting tags, and filter out any tags starting with tagme, rather than just tagme. 2019-08-07 15:50:01 -05:00
Matthew Barbour
e065c8b789 Set column defaults 2019-08-07 15:50:00 -05:00
matthew
aa5a04fbd3 Further adjusting tests for user config
Renamed Rating to ImageRating to prevent test system from trying to make an extension of it
2019-08-07 15:49:59 -05:00
Matthew Barbour
3560a19f79 Updated tests to generate user config 2019-08-07 15:49:58 -05:00
Matthew Barbour
b2193cb6f1 Adjusted rating array usage 2019-08-07 15:49:57 -05:00
Matthew Barbour
5e87dff033 Adjustments to rating upgrade 2019-08-07 15:49:57 -05:00
Matthew Barbour
91b46d6598 Moved user config stuff into an extension 2019-08-07 15:49:56 -05:00
Matthew Barbour
40be8f045a Changed to use user_config extension 2019-08-07 15:49:27 -05:00
Matthew Barbour
68ee4d0e77 Custom rating support, user rating filter settings 2019-08-07 15:49:26 -05:00
Matthew Barbour
8f0aa8a4ca Added $user_config global based on existing config object for storing user-specific settings.
Added event to the user page so that extensions can hook into it, providing user-specific setting controls
2019-08-07 15:48:18 -05:00
matthew
8e3b8a7a1b Merge remote-tracking branch 'upstream/develop' into custom_ratings 2019-08-07 15:48:17 -05:00
Matthew Barbour
de98e86938 ExtensionInfo conversions what have I done 2019-08-07 15:40:01 -05:00
Matthew Barbour
3d1b964812 Proposed extension info change to allow getting info for unloaded extensions 2019-08-07 15:34:11 -05:00
Shish
e6411c32aa
Merge pull request #679 from sanmadjack/etc
Etc Commits
2019-08-06 17:45:24 -07:00
Matthew Barbour
a18589ee0a Help extension
Provides foundation for help pages that are generated from loaded extensions, starting with comprehensive search documentation. Addresses #522
2019-08-05 09:03:49 -05:00
Matthew Barbour
00464d2579 Implemented a nav link generating system so that extension power what shows up in the menus rather than being hard-coded in the themes. 2019-08-05 09:01:20 -05:00
Matthew Barbour
972b68bdd3 Setup constants 2019-08-05 09:00:23 -05:00
Matthew Barbour
5ceb6f4193
Update main.php 2019-08-01 08:40:15 -05:00
Matthew Barbour
fc294bfb3c add tracer_enabled check to the database class to prevent unnecessary memory build-up when tracer isn't outputting.
Globalized tracer_enabled to make it easier to access
2019-08-01 08:15:43 -05:00
Matthew Barbour
7d110f11b6 TagCategories config constant 2019-08-01 08:10:38 -05:00
Matthew Barbour
dd6c3b2321 Added window title option to post title extension 2019-08-01 08:10:30 -05:00
Matthew Barbour
c3f2d2e1bd New post titles extension, resolves #19 2019-08-01 08:10:24 -05:00
Matthew Barbour
45df025e7d Bulk action permission constant 2019-08-01 08:09:00 -05:00
Matthew Barbour
cb1e9c0075 Permissions to constants 2019-08-01 08:07:05 -05:00
matthew
d16dfe24f2 media extension adjustments 2019-07-31 15:08:56 +01:00
Shish
d57b624079 Merge commit '38cc05c' into develop 2019-07-31 14:58:24 +01:00
Shish
a0b1c82d0d function to clear event listeners 2019-07-19 10:25:07 +01:00
Shish
eb3cc73bce make pages >500 visible to logged-in users 2019-07-19 10:24:17 +01:00
Shish
c5aba18470 s/is_admin/can(perform_bulk_actions)/ 2019-07-08 20:35:10 +01:00
matthew
38cc05cf37 Fixed issue with merge's duplicate hash check 2019-07-08 08:07:18 -05:00
matthew
7991e981ca Revert "Update main.php"
This reverts commit 0eeede7977f69c1e3a60d778de771f08eed4fc38.
2019-07-08 08:07:17 -05:00
Matthew Barbour
f2496b99f6 fix for resize arg isssue 2019-07-08 08:07:17 -05:00
Matthew Barbour
9ce5a05840 Update main.php 2019-07-08 08:07:16 -05:00
Matthew Barbour
58948a90fb Fixed a constant reference 2019-07-08 08:07:15 -05:00
Matthew Barbour
d2d6c433e6 Make the media admin block look a little nicer 2019-07-08 08:07:14 -05:00
Matthew Barbour
8638a16694 Added table-building support to SetupBlock to allow easily building cleaner setup controls 2019-07-08 08:07:13 -05:00
Matthew Barbour
4065540f0e Added SCORE sql constants 2019-07-08 08:07:12 -05:00
Matthew Barbour
a0c0b6e3d1 Various fixes 2019-07-08 08:07:11 -05:00
Matthew Barbour
ae6126d388 Changed upgrade code to use SCORE stuff 2019-07-08 08:07:10 -05:00
Matthew Barbour
b1db833d51 Added additional media properties to the images table, video, audio, length, and lossless.
Added new event to handle fetching media properties like height, width, and the newly added fields, and admin controls to manually scan files for their properties.
Added a search terms content:video and content:audio to search for images that do (or do not) have those flags.
2019-07-08 08:07:09 -05:00
Matthew Barbour
a41e99d1af Renamed graphics extension to media extension 2019-07-08 08:07:08 -05:00
Matthew Barbour
0c16d3e78c Fixed some extension references 2019-07-08 08:07:08 -05:00
Matthew Barbour
7cc725fbc1 Moved graphics engine constants to their own class 2019-07-08 08:07:07 -05:00
Matthew Barbour
3753a1b6d6 Update main.php 2019-07-08 08:07:06 -05:00
Matthew Barbour
b0e12f6a6c Update main.php 2019-07-08 08:07:05 -05:00
Matthew Barbour
18656db7c8 Update main.php
Testing a CI issue
2019-07-08 08:07:04 -05:00
Matthew Barbour
e98e63f836 Adjusted graphic extension settings 2019-07-08 08:07:03 -05:00
Matthew Barbour
3859e27839 New Graphics extension
Added constants to several extensions
2019-07-08 08:07:02 -05:00
Shish
3dce134fe9 better error for >500 pages 2019-07-08 11:10:35 +01:00
Shish
bcf07946fb fix more pairs 2019-07-07 22:59:22 +01:00
Shish
38df37a9aa limit 500 pages of search results in speed hax mode 2019-07-07 19:23:48 +01:00
Shish
eb885c443c trim leading whitespace when logging queries 2019-07-07 19:22:44 +01:00
Shish
1bd7e1a547 better DISABLE_ACCEL 2019-07-07 17:40:24 +01:00
Shish
cf98e4bf43 remove one-positive-tag special case which is slower than the generic build_accurate_search_querylet 2019-07-07 17:13:56 +01:00
Shish
c22f0f6df8
Merge pull request #675 from shish/one-search
Remove build_ugly_search_querylet
2019-07-07 16:54:42 +01:00
Shish
ea802f4a24 Remove build_ugly_search_querylet
now that the accurate search doesn't use subqueries, perhaps mysql can
accept it
2019-07-07 16:50:55 +01:00
Shish
bd5ccd2800 remove ancient misleading description of the search code 2019-07-07 16:46:56 +01:00
Shish
e27ff02bb7 two columns 2019-07-07 16:02:33 +01:00
Shish
98f0375e94 make tracer not-null in installer 2019-07-07 15:57:06 +01:00
Shish
660ee2b249 make composer libs usable from the installer 2019-07-07 15:50:02 +01:00
Shish
b43ad07abe typo 2019-07-07 15:42:19 +01:00
Shish
1e1ede7db6 log which method was used to wrap db->execute 2019-07-07 15:12:51 +01:00
Shish
3c6b09110a Cache multiple flexihashes
otherwise get_thumb / get_image / get_thumb / get_image / ... will
have 100% cache miss rate
2019-07-07 14:26:45 +01:00
Shish
8ec3690f8e cache logging was getting hit/miss the wrong way round... forever? 2019-07-07 14:07:11 +01:00
Shish
c8563951ce tracing instead of cache debug log 2019-07-07 13:58:39 +01:00
Shish
bca74a0db5 drop DEBUG_SQL - all of that info is included in the trace file, fixes #674 2019-07-07 13:52:53 +01:00
Shish
4cadce1de0 merge slow-page-log into tracer, fixes #673 2019-07-07 13:51:19 +01:00
Shish
99646a4b00 bump tracer api 2019-07-07 13:30:50 +01:00
Matthew Barbour
f5a5352511 Correction to negative tag code 2019-07-07 11:17:21 +01:00
Shish
4136b1bb6b manually pull parts out of 57f2a50fb7 2019-07-07 11:16:47 +01:00
Shish
f8a08a7aae update tracer 2019-07-07 11:12:40 +01:00
matthew
c906df6956 Added iterator_map and iterator_map_to_array
Moved the path join/sanitize to pollyfills
2019-07-07 11:11:57 +01:00
matthew
490f1f97ed Updated pools bulk action for generator 2019-07-07 11:11:48 +01:00
Shish
3954f3d296 merge iterable queries with new count_time 2019-07-07 11:11:27 +01:00
matthew
d64603674e Added ability to use generators with database queries.
Adapted bulk actions to use generators.
2019-07-07 11:10:40 +01:00
Matthew Barbour
183f9bb897 Changed the image tag search query to run more efficiently on pgsql 2019-07-07 11:06:45 +01:00
Shish
b01f425a55 GET flag to skip cache 2019-07-07 10:29:00 +01:00
Shish
f4a98e7a9b GET flag to skip accelerator 2019-07-07 10:29:00 +01:00
Shish
68f3ebb2c6 Consistently say '<Type> Query' 2019-07-07 00:17:39 +01:00
Shish
b285acf70a tracer-complete needs start time 2019-07-06 23:01:22 +01:00
Shish
8ea78eed6a have database performance measured in three ways at once, instead of three separate ways 2019-07-06 21:41:48 +01:00
Shish
2935db9d6d take out category-autocomplete pending performance tweaks 2019-07-06 11:27:05 +01:00
Shish
c682670f64 derp 2019-07-06 10:38:18 +01:00
Shish
ccb9c493d5 s/Context/EventTracer/g 2019-07-05 20:49:47 +01:00
Shish
f0326dc3ab bootstrap as its own phase 2019-07-05 19:20:37 +01:00
Shish
b158901f53 add ban-reason to bulk actions delete 2019-07-05 19:20:37 +01:00
Shish
1ca5366ee2 ignore data dir 2019-07-05 19:20:10 +01:00
Shish
22f3532035 support for themes where .shm-thumb is not directly an A tag 2019-07-05 19:20:10 +01:00
matthew
dbfa995ba5 Changed create pool bulk action to default to the currently searched strings 2019-07-05 19:16:52 +01:00
Matthew Barbour
4116bda066 Adjusted admin delete by query to bypass trash 2019-07-05 19:02:18 +01:00
matthew
558d154e85 Fixed issue with trash item detection 2019-07-05 19:01:55 +01:00
Matthew Barbour
c4111cc948 Added shortcut-key support to bulk action extension 2019-07-05 18:37:25 +01:00
Matthew Barbour
a82fb56063 Added force flag to image deletion event to override trash extension 2019-07-05 18:31:31 +01:00
matthew
1bd9238b17 Additional trash stuff 2019-07-05 18:29:45 +01:00
Matthew Barbour
32d37254f7 New trash extension. For undelete-type stuff. 2019-07-05 18:29:44 +01:00
Matthew Barbour
92bb96049f Added SCORE sql constants 2019-07-05 17:41:29 +01:00
Matthew Barbour
02e2786cca Added missing constant 2019-07-05 17:39:25 +01:00
matthew
a7188a452b Fixed issue with setup block checkbox generator 2019-07-05 17:39:15 +01:00
Matthew Barbour
c16d55995b Added table-building support to SetupBlock to allow easily building cleaner setup controls 2019-07-05 17:38:12 +01:00
Matthew Barbour
9ca800d1c4 Added bulk action support to pools extension 2019-07-05 17:31:27 +01:00
Matthew Barbour
8794258072 pgsql automatically creates indexes on unique columns, so the manually created indexes on those columns are redundant on that database. This will remove tham. 2019-07-05 16:55:36 +01:00
Matthew Barbour
dfeb3bf5df Added a database upgrade that adds a tag_id,image_id index to image_tags, and lengthens the filename field to 255 characters. 64 was ridiculous.
Also added a substr to the filename for the merge code so it won't error when it's a long name
2019-07-05 16:55:25 +01:00
matthew
80e614b53e Added relationship set event.
Adjusted relationship set statements for betteer accuracy
2019-07-05 16:46:03 +01:00
matthew
639c896a16 Added join_path to cleanly join paths.
Added sanitize_path to normalize and deduplicate directory separators.
Changed warehouse_path to be able to scale up the number of octect pairs as much as desired.
2019-07-05 16:43:06 +01:00
Matthew Barbour
ac1196dee1 Added lower to tag_categories search 2019-07-05 16:25:03 +01:00
Matthew Barbour
8d567e9553 Changed autocomplete to escape _ and %, lowercase the tags, and also query for tag names that are preceded by categories to address #630 2019-07-05 16:25:03 +01:00
Matthew Barbour
aa9ce52f47 Adjustment to DATABASE_TIMEOUT 2019-07-05 16:25:03 +01:00
Matthew Barbour
3fc0ba3a63 Added DATBASE_TIMEOUT constant to allow customizing database wait time 2019-07-05 16:25:03 +01:00
Matthew Barbour
6a6d73168b Added function to database object for interpreting parameter values to ones that are database-appropriate. Specifically, to turn true/false into the correct values for a bool column. 2019-07-05 16:25:03 +01:00
Matthew Barbour
cb436cc182 Added transaction check before main rollback 2019-07-05 16:25:03 +01:00
Matthew Barbour
ae24b5c2e8 Moved transaction commit to above fastcgi_finish_request to prevent the page refreshing before the transaction actually commits. 2019-07-05 16:25:03 +01:00
Matthew Barbour
1a7fa4663e Added search_terms to the bulk action event 2019-07-05 16:25:03 +01:00
Matthew Barbour
af263bc2a5 Fix the flv mime type mapping 2019-07-05 16:25:03 +01:00
matthew
f12e2891e5 Added button element to input[button]-related css statements 2019-07-05 16:25:03 +01:00
Matthew Barbour
a7c978c8d2 Added poster attribute to video element so thumbnail can show until video is loaded 2019-07-05 16:25:03 +01:00
Matthew Barbour
de6d6a0515 Added new FILE page mode that allows sending files to the browser with these improvements:
Reads the file and outputs it in chunks rather than all at once, reducing the amount of memory needed to very little, even for very very large files.
Supports http request ranges so that only parts of the file will be returned if requested. This allows in-browser video players to seek to arbitrary points in the video without needing to download the whole file.
Makes use of flush during send to allow the browser to being receiving file data immediately, allowing streamable video formats to begin playing before the server has finished sending the data. This could also be used in the future to add a transmission rate limiter.
Has early-disconnect detection, to terminate sending file data if the client browser has disconnected or aborted (for instance, a user starts a video, then seeks to near the middle, the first request of data will be terminated rather than continuing to process the file).
2019-07-05 16:25:03 +01:00
Shish
ff28f34088
Merge pull request #671 from shish/phpunit-bump
bump phpunit to 7.x
2019-07-05 15:58:29 +01:00
Shish
97f8234778 bump phpunit to 7.x 2019-07-05 15:47:47 +01:00
Shish
c24a6e9b97 formatting pass 2019-06-21 09:12:44 +01:00
Shish
42a502953b
Merge pull request #663 from sanmadjack/bugfixes
Bugfixes and small changes
2019-06-21 09:11:52 +01:00
Shish
7e34a30a2f
Merge pull request #664 from sanmadjack/path_to_tags_enhancements
Path to tags enhancements
2019-06-21 08:45:52 +01:00
Matthew Barbour
1370afec72 Moved database driver constants to DatabaseDriver 2019-06-20 10:47:15 -05:00
Matthew Barbour
d128dfa78e Added lower indexes for postgresql to tags.tag and users.name to speed up queries for them using lower() 2019-06-20 10:07:43 -05:00
Matthew Barbour
a834d1f814 Resolved issue with bulk rater 2019-06-19 23:41:55 -05:00
Matthew Barbour
a2ac9776ff path tag corrections 2019-06-19 23:28:34 -05:00
Matthew Barbour
c951f7d13e Adjusted path-to-dir regex to prevent an error 2019-06-19 20:22:41 -05:00
matthew
27574cad76 Merge remote-tracking branch 'upstream/develop' into path_to_tags_enhancements 2019-06-19 20:21:47 -05:00
Matthew Barbour
921ec9a7bb Adjusted cron upload for new merged flag, and to make sure tags merge properly 2019-06-19 20:20:52 -05:00
Matthew Barbour
5eb4a66ab7 Added merged indicator to DataUploadEvent and ImageAddEvent
Changed merge process so that the ID of the merged image can make it back through the event chanin
2019-06-19 20:19:38 -05:00
Matthew Barbour
5a30ce1c83 Reverted removal of latter tag write 2019-06-19 18:59:51 -05:00
Matthew Barbour
826c623538 PageMode constants 2019-06-18 21:04:31 -05:00
matthew
123089bfbf Merge remote-tracking branch 'upstream/develop' into bugfixes
# Conflicts:
#	core/imageboard/image.php
2019-06-18 13:31:04 -05:00
Matthew Barbour
014a4c2cd2 Added extension constant lists to resize and rotate extensions so that they weren't rendering their controls ont he wrong image types 2019-06-18 13:25:45 -05:00
Shish
6313ebc339 LIMIT 1 when fetching a wiki page 2019-06-16 19:39:28 +01:00
Shish
1d10baa719 only sql-escape if we're going to the database, not the accelerator 2019-06-16 19:25:40 +01:00
Shish
e232811e8c silence errors from a broken client 2019-06-16 19:12:44 +01:00
Shish
6df1190501 Rename Tag/ImgQuerylet to Tag/ImgCondition
It was confusing because Tag/ImgQuerylet (an abstract condition to use
as part of image search filtering) were unrelated to Querylet (a
fragment of SQL)
2019-06-16 19:11:16 +01:00
Shish
6b9d18b52e Parse tags first, then check accelerator, then check database
Better than half-assed tag parsing in the accelerator then full parsing
in the database
2019-06-16 19:07:55 +01:00
Matthew Barbour
1fe18e7573 Missed a dir name 2019-06-15 12:52:22 -05:00
Matthew Barbour
8b531c04a2 removed SQLERROR escape from cron uploader, not necessary now that it is individualizing transactions.
Change cron uploader to use constants for dir and config names
2019-06-15 12:51:04 -05:00
Matthew Barbour
ab9389007f Changed key-generation process for cron upload so it doesn't endlessly generate new keys before the user first hits the same buttons in settings. 2019-06-15 11:51:03 -05:00
Matthew Barbour
ed9bd5e788 Fix in ExtensionAuthor 2019-06-15 11:29:35 -05:00
Matthew Barbour
37fe743f65 Changed "images" and "thumbs" usages to constants 2019-06-15 11:20:11 -05:00
Matthew Barbour
4ade0090cc Added float support to config 2019-06-15 11:20:01 -05:00
Matthew Barbour
0202597f88 Added lock file usage to cron uploader to prevent concurrent runs.
Changed extension manager to allow author to be a comma-separated list.
2019-06-15 11:19:51 -05:00
Matthew Barbour
e940d87c22 Added image_id null check to resize's data upload event, to prevent an error when merging is enabled 2019-06-15 11:19:38 -05:00
Matthew Barbour
6f501a6e74 Database driver constants 2019-06-14 13:38:47 -05:00
Matthew Barbour
444de26ce3 Added warning for webp thumbnails 2019-06-14 13:34:21 -05:00
Matthew Barbour
8950d27d64 Changed upload to detect unrecognized files so that it doesn't just blankly refresh when the type isn't handled 2019-06-14 13:01:49 -05:00
Matthew Barbour
58acb71282 Change imagemagick commands to return the error output
Added ico to transcode extension
2019-06-14 13:01:24 -05:00
Matthew Barbour
070429402b readme corrections 2019-06-14 13:01:11 -05:00
Matthew Barbour
ed4b6bc4a0 Updated handle_ico to use new common image thumbnailing and to inherit DataHandlerExtension 2019-06-14 13:00:59 -05:00
Matthew Barbour
85b6bba689 Changed path_to_tags to interpret ; as : and to allow inheriting categories from parent folders 2019-06-14 09:50:23 -05:00
Matthew Barbour
e854b6d884 Custom rating changes 2019-06-14 09:47:14 -05:00
Matthew Barbour
1b76366dd9 Cleaned up some of the new image processing code, added documentation 2019-06-14 09:41:55 -05:00
Matthew Barbour
b522d68736 Custom rating support 2019-06-14 08:05:30 -05:00
matthew
74965c383b Merge remote-tracking branch 'upstream/develop' into develop
# Conflicts:
#	ext/cron_uploader/main.php
2019-06-14 07:57:05 -05:00
Shish
44fcc3a1e9 rm some dead code 2019-06-14 13:52:27 +01:00
Shish
064b24ffc1 formatting pass 2019-06-14 13:47:50 +01:00
Shish
d1102cd635 Merge from sanmadjack:develop 2019-06-14 13:46:55 +01:00
Shish
f078b283bd pull a bunch of small fixes from #659 2019-06-14 13:16:58 +01:00
Matthew Barbour
5765978afd Changed to prevent writing duplicate image tag IDs 2019-06-14 12:52:58 +01:00
Matthew Barbour
edc05b2f72 Merge remote-tracking branch 'upstream/develop' into develop
# Conflicts:
#	ext/cron_uploader/main.php
2019-06-13 13:34:44 -05:00
Matthew Barbour
7c4356d788 Updated copyright notice 2019-06-13 18:19:18 +01:00
Matthew Barbour
5c48a5c6ee readme correction 2019-06-13 18:19:09 +01:00
Matthew Barbour
6006a83229 Added <label> to extension name in extension manager so the name can also be clicked to enable/disable an extension 2019-06-13 18:18:51 +01:00
Matthew Barbour
8cdab6623a Changed clamp function to allow null values 2019-06-13 18:17:38 +01:00
Matthew Barbour
68c3e5ea42 Changed cron upload so that an unrecognised file type results in an error instead of a success 2019-06-13 18:17:16 +01:00
Matthew Barbour
1aa0225652 Adjustments to transcoding to allow psd transcoding to actually work
Changed resize extension to run later in the extension stack
Little fixes
2019-06-13 11:45:34 -05:00
Shish
1d1536b1ee assert_options is deprecated for php7 2019-06-13 16:57:58 +01:00
Shish
10d8b352c1 allow tags with apostrophes to be accelerated 2019-06-13 16:57:23 +01:00
Matthew Barbour
3269d32378 Added transcode extension to allow admins to convert images to other types (for instance, converting PNG to more efficient lossless webps, not that I made this just so I could do that). It also allows uploading image formats that aren't compatible with the web, such as TIFF and PSD, by automatically transcoding them to a supported fele format. 2019-06-12 17:54:06 -05:00
Matthew Barbour
a1512975b6 This should have been checked in with the header bytes change, provides the actual type detection 2019-06-12 17:51:15 -05:00
Matthew Barbour
cb24ac69ab Changes to cron upload:
Added transaction handling so that subsequent errors don't result in images that have already moved to the uploaded folder from being wiped from the database.
Changed output folders to use subfolders based on the timestamp of the current run. This is to prevent writing over files in the error folder that happen to have the same name and path, effectively losing the data.
Added additional error and information logging, and a final count of imported/merged/failed.
2019-06-12 17:50:00 -05:00
Matthew Barbour
b27904a7e0 Changes to bulk actions, passing full ID arrays instead of chunked image arrays
Changed the bulk actions to have a separate identifier from the button name
2019-06-12 17:46:24 -05:00
Matthew Barbour
97f60b3ea5 Better error handling for GD code 2019-06-12 17:40:43 -05:00
Matthew Barbour
f9f4c3bd37 Updated copyright notice 2019-06-12 17:36:36 -05:00
Matthew Barbour
b1909ffed6 readme correction 2019-06-12 17:35:32 -05:00
Matthew Barbour
97abeb5254 Added option to detect file type based on header bytes 2019-06-12 17:35:11 -05:00
Matthew Barbour
8f73b35fbb Added OnTagTermParse to rating extension
Updated an install step to be pgsql compatible
2019-06-11 09:59:06 -05:00
Matthew Barbour
8f3c20134f Added <label> to extension name in extension manager so the name can also be clicked to enable/disable an extension 2019-06-11 09:08:16 -05:00
Matthew Barbour
f2fb040a5b Moved ImageResizeException to the core space so that the core space image resize code can use it 2019-06-11 09:06:47 -05:00
Matthew Barbour
b31a916477 Changed clamp function to allow null values 2019-06-11 09:05:54 -05:00
Matthew Barbour
e2d04ca58c Merge remote-tracking branch 'upstream/develop' into develop 2019-06-11 08:50:27 -05:00
Matthew Barbour
9d68c8e079
Merge pull request #2 from sanmadjack/custom
Custom
2019-06-09 14:24:54 -05:00
Matthew Barbour
b7945b098e Changed to prevent writing duplicate image tag IDs 2019-06-09 14:18:25 -05:00
Matthew Barbour
4410baeb9c Changed cron upload so that an unrecognised file type results in an error instead of a success 2019-06-09 14:17:13 -05:00
Matthew Barbour
eb4292316d Added webp upload and thumbnailing support
Bug fixes and consolidation of various thumbnail and resize functionality
Changed resize/rotate extensions to use replace image event
Added content-disposition header to image responses to provide a human-friendly filename when saving
Added more bulk thumbnail regeneration tools
Tweaks to bulk actions to correct totals when batching items
2019-06-09 14:14:04 -05:00
Shish
e77f7de7f9 Fixes for tag / source history 2019-06-09 08:32:01 +01:00
Matthew Barbour
49cb6f7233 Added thumb_scaling option for generating high-dpi thumbnails 2019-06-06 14:12:13 -05:00
Matthew Barbour
8612a07a5a cleanup 2019-06-05 19:37:07 -05:00
Matthew Barbour
66df295ec1 Bulk action extension 2019-06-05 18:16:15 -05:00
Shish
fad31ed38d
Merge pull request #655 from sanmadjack/develop
Enabled rating extension for pgsql
2019-06-05 15:14:54 +01:00
matthew
8741529590 Enabled rating extension for pgsql 2019-06-03 08:58:39 -05:00
Shish
abeb6299fc
Merge pull request #654 from sanmadjack/develop
Cron upload changes
2019-06-03 07:39:55 +01:00
matthew
aef455949b Added escape to cron upload to stop the process when a transaction-breaking error occurs. 2019-06-02 13:38:25 -05:00
matthew
38badf7e45 Changed cron import to output imported/failed files to subdirectories matching the imported file's original subdirectory 2019-06-02 13:34:24 -05:00
matthew
e651da03cc Changed path tag handling to merge path tags with filename tags
Added 0-9 to the filename tag regexp so that extensions like mp4 will be picked up as well.
2019-06-02 13:27:24 -05:00
Shish
a1297781d5
Merge pull request #653 from sanmadjack/develop
Fixes for various issues
2019-06-02 19:16:41 +01:00
matthew
5a2f893667 Changed cron upload new image tagging to work with tag event's requirement for tags to not be empty. 2019-06-01 12:17:38 -05:00
matthew
3e2a0ea3b5 Brought cron upload tag handling inline with everything else 2019-06-01 12:12:36 -05:00
matthew
e92ac10349 Removed unset line so it doesn't do it twice. 2019-06-01 12:08:07 -05:00
matthew
63a69e4258 Change to correct issue with my change to prevent cron uploader from throwing warnings. Now using array_pop so that position in the array doesn't matter. 2019-06-01 12:02:58 -05:00
matthew
99b51e65c1 Added array_unique to set_tags to prevent primary key violations when upload conflict is set to merge 2019-06-01 11:39:03 -05:00
matthew
42b39f20d7 Updated config interface as well 2019-06-01 10:50:53 -05:00
matthew
1eecf323f4 Changed set_int to accept a string, since it can accept shorthand strings like 1M. Casting it to an int was stripping out that information when settings would be submitted. 2019-06-01 10:47:11 -05:00
root
23392b6b91 Removed a test line 2019-06-01 10:07:01 -05:00
root
98bc7c7df1 Corrected issue preventing cron upload from generating key 2019-06-01 10:04:16 -05:00
root
76bd6d4238 Fixed an issue when null wueries were passed to some themes 2019-06-01 09:47:03 -05:00
Matthew Barbour
236904087b
Merge pull request #1 from shish/develop
Develop
2019-06-01 08:51:33 -05:00
Shish
d387469fdb Use RecursiveDirectoryIterator for cron_uploader consistently, should fix #652 2019-06-01 08:13:07 +01:00
Shish
8e90279c11 Fixes for cron uploader, fixes #650 2019-06-01 07:51:02 +01:00
Shish
da10859bb3 fixes 2019-05-29 19:50:12 +01:00
Shish
bf473f6d51 more lint fixes 2019-05-29 18:23:29 +01:00
Shish
8a49b1e80e remove unmaintained chatbox / amazon_s3 exts 2019-05-28 20:28:05 +01:00
Shish
2396ae2ef9 fix a bunch of lints 2019-05-28 20:27:23 +01:00
Shish
294f5845b1 defaults 2019-05-28 19:54:07 +01:00
Shish
1b114bfea8 url_escape handles null 2019-05-28 19:48:41 +01:00
Shish
f0aec21038 bump travis too 2019-05-28 19:20:21 +01:00
Shish
93cc732d39 fix tests 2019-05-28 19:00:23 +01:00
Shish
34b05cca7c PSR-2. I'm not a huge fan, but ugly consistency beats no consistency... 2019-05-28 17:59:38 +01:00
Shish
5ec3e89884 php7.1 all the things 2019-05-28 17:31:20 +01:00
Shish
189385ff61 forgot that php isn't python 2019-05-28 15:16:22 +01:00
Shish
4b4ff68729 decouple cache and db a little 2019-05-28 15:06:03 +01:00
Shish
445687111e Merge branch 'develop' of https://github.com/shish/shimmie2 into develop 2019-05-26 16:25:36 +01:00
Shish
b91f20875a put upload block on every page 2019-05-26 16:15:43 +01:00
Shish
f4c18930ce option to log slow pages 2019-05-26 10:42:58 +01:00
Shish
6175b36cc9 don't show uploader name in RSS feed, halve the number of queries 2019-05-26 10:37:26 +01:00
Shish
3d326344a9 don't show refine block for heavy queries 2019-05-26 10:35:26 +01:00
Shish
a0588bd8f8 empty list rather than 404 for invalid autocompletes 2019-05-21 23:12:52 +01:00
Shish
505877a330 support arbitrarily large accelerated search results 2019-04-28 09:55:28 +01:00
Shish
037b1f0f70 log mass deletion count in advance 2019-04-28 09:53:53 +01:00
Shish
bef1628b08 also block autocomplete for % / _ 2019-04-26 10:31:23 +01:00
Shish
bc45944ac9 flashier tnc 2019-04-26 10:15:32 +01:00
Shish
65dc3898c0 common tags / common source fields 2019-04-26 10:15:32 +01:00
Shish
b2b4317203 sync with python rss_images 2019-04-26 10:15:32 +01:00
Shish
80c84f3248 More detailed login logging 2019-04-26 10:15:32 +01:00
Shish
52dfa12df7 zend.assertions can't be set at runtime 2019-04-26 10:13:17 +01:00
Shish
629f155187 don't autocomplete searches with ==0 or >32 characters 2019-04-26 10:12:40 +01:00
Shish
4c70258352 typos 2019-04-16 20:41:13 +01:00
Shish
c2834aad96 regular implode() for shell commands 2019-02-24 08:29:33 +00:00
Shish
2acbba9d02 influxdb-friendly statsd format 2019-02-22 21:26:42 +00:00
Shish
ffd5fbb4af fully customisable IP ban 2019-02-22 21:24:53 +00:00
Shish
a588a0cfc5 show the right IPs 2019-02-22 21:05:53 +00:00
Shish
a8dfc9277b Show logged event IPs on user page 2019-02-22 21:04:09 +00:00
Shish
7abf1aa591 custom ipban message 2019-02-22 19:58:04 +00:00
Shish
d918f058bf core imageboard events 2019-02-22 19:57:55 +00:00
Shish
60a28af000 s/implode/Tag::implode/ 2019-02-02 12:07:33 +00:00
Shish
0aec16aa5b specify DB in docker env 2019-02-02 12:06:30 +00:00
Shish
eb24fa0b21 tweaks 2019-02-02 12:05:59 +00:00
Shish
bd7901eddf remove dead links 2019-01-06 11:56:31 +00:00
Shish
dd80363c61 remove dead links 2019-01-06 11:55:08 +00:00
Shish
ead3a5a588 php7 assertions, no strings 2019-01-06 10:40:39 +00:00
Shish
6f5cf4d865 jquery first 2018-11-11 17:41:28 +00:00
Shish
94af26fbf2 Merge branch 'develop' of https://github.com/shish/shimmie2 into develop 2018-11-11 17:38:43 +00:00
Shish
c9ccb22951 make handle_static its own extension 2018-11-11 17:38:32 +00:00
Shish
983b4d5d42 clean out old lib/vendor 2018-11-11 17:13:17 +00:00
Shish
e8bfba2098 Merge branch 'develop' of https://github.com/shish/shimmie2 into develop 2018-11-11 16:44:40 +00:00
Shish
b95cbe4666 skip r34 comic bits by default 2018-11-10 14:15:07 +00:00
Shish
8903d76e7e put style/script caches in their own dirs too 2018-11-10 13:32:10 +00:00
Shish
16d0abb546 Merge branch 'develop' of https://github.com/shish/shimmie2 into develop 2018-11-10 13:10:22 +00:00
Shish
cc23528459 subdirs for tag_list caches, as those get huge... 2018-11-10 13:10:14 +00:00
Shish
b38ec11b64 is this syntax? 2018-11-10 12:43:53 +00:00
Shish
c74bd58207 sort image reports by id (newest first) 2018-11-10 12:03:05 +00:00
Shish
de2a688b5a php... 2018-11-10 12:02:48 +00:00
Shish
1fb7e7b823 Merge branch 'develop' of https://github.com/shish/shimmie2 into develop 2018-11-10 12:01:55 +00:00
Shish
5c49b3631d un-bump php back to 7.0, because debian stable... 2018-11-10 12:01:26 +00:00
Shish
7a7dc86cfc Merge branch 'develop' of https://github.com/shish/shimmie2 into develop 2018-11-10 11:57:13 +00:00
Shish
379fcdfd20 docker instructions 2018-11-10 11:19:56 +00:00
Shish
bfa0c22b06 automatic sqlite name 2018-11-07 16:48:07 +00:00
Shish
65d2172ede move images and thumbs to data/ 2018-11-07 16:06:10 +00:00
Shish
f0c1baa3ed sqlite should pass 2018-11-07 15:24:15 +00:00
Shish
78258f7763 reduce diff between travis and docker 2018-11-07 15:12:13 +00:00
Shish
9e795f41a7 use vendor JS directly instead of copy-pasting 2018-11-07 15:12:13 +00:00
Shish
f772b30301 fix some tests 2018-11-07 15:12:09 +00:00
Shish
b01edb2aec copyright date update 2018-11-07 12:11:17 +00:00
Shish
a1aa0f9a62 A docker container for making testing easier 2018-11-07 00:43:01 +00:00
Shish
cefe1c0325 a bunch of installer tweaks 2018-11-07 00:25:43 +00:00
Shish
fc6fb3c6b8 use current protocol for niceurl test, see #632 2018-11-06 00:02:07 +00:00
Shish
9d3f4ea4b3 move ext-specific js into that ext 2018-11-05 23:12:18 +00:00
Shish
b2f10ea5ab split up files in core/ for saner management 2018-11-05 22:30:18 +00:00
Shish
3c5c44d75f PHP bump in travis and sys-config too 2018-11-05 20:55:50 +00:00
Shish
cdfc97d19b begin tests in core 2018-11-05 20:53:58 +00:00
Shish
5634ba6d97 fix a thing which doesn't seem like a syntax error but phpstorm flags it as a syntax error 2018-11-05 20:02:40 +00:00
Shish
c0699ce236 s/mime_content_type/getMimeType/, fixes #633 2018-11-05 19:52:55 +00:00
Shish
15f0847434 PHP bump, 7.2 is stable now, let's require at least 7.1 2018-11-05 19:47:22 +00:00
Shish
b93026ac1d dedupe 'og:' meta tags 2018-11-05 19:17:42 +00:00
Shish
0837b5f1ca Update issue templates 2018-11-05 19:10:06 +00:00
Shish
55e0e32395 Let the client choose the protocol for QR images (see #477) 2018-11-05 17:52:21 +00:00
Shish
96ed39c9e5 Check for mb_strlen during install (see #615) 2018-11-05 17:45:19 +00:00
Shish
6ae14e4921 https for theme links 2018-09-26 22:49:37 +01:00
Shish
4b37a38857 viewports argh 2018-09-09 10:58:18 +01:00
Shish
a7a7c0dd47 handle ffmpeg thumbnailing in a slightly more sane way 2018-09-09 10:57:28 +01:00
Shish
1ed888611a drop support for video without ffmpeg 2018-09-09 10:21:56 +01:00
Shish
38406ef33a block tags starting with minus 2018-08-22 21:56:27 +01:00
Shish
4da207106b add a .editorconfig 2018-08-15 21:50:54 +01:00
Shish
e2c46a4b00
Merge pull request #643 from ThePadawan/develop
Add missing escaping of ffmpeg shell command during video thumbnail generation
2018-08-14 10:29:58 +01:00
Rudolf M. Schreier
2ae760b62e Add missing escaping of ffmpeg shell command during video thumbnail generation 2018-08-14 11:23:09 +02:00
Shish
9f3bf7d2e1 force-desktop toggle 2018-07-26 00:28:08 +01:00
Shish
24276390b4 autocomplete only for search boxes again 2018-07-26 00:27:56 +01:00
Shish
bd6b2289b1 image-info box should avoid wrapping 2018-07-26 00:27:39 +01:00
Shish
dbc430e3d5 link to main and backup image 2018-07-26 00:26:46 +01:00
Shish
dd8a90414f leave it to the theme to link to the image 2018-07-26 00:26:23 +01:00
Shish
840915c9f0 support for picking n'th item from the consistent hash 2018-07-26 00:26:01 +01:00
Shish
97a03d8f83 paginated user list 2018-07-22 19:23:34 +01:00
Shish
413a742ca8 Merge branch 'develop' of https://github.com/shish/shimmie2 into develop 2018-07-22 15:09:18 +01:00
Shish
d48e34030d time and message searching in the log 2018-07-22 15:08:53 +01:00
Shish
f31dabce20 show number of up/down votes on user page 2018-07-20 01:29:38 +01:00
Shish
e809a72155 log autocomplete errors instead of alerting 2018-07-20 00:48:03 +01:00
Shish
639a1bc3cd format text for image reports 2018-07-20 00:37:43 +01:00
Shish
8ea25a4e90 .autocomplete_tags as the class to indicate we want tag autocompletion 2018-07-20 00:32:49 +01:00
Shish
c75e7060e6 hide by default 2018-07-19 22:17:19 +01:00
Shish
1b372b2575 typo 2018-07-19 20:09:36 +01:00
Shish
8768284602 add r34 ext 2018-07-19 19:55:28 +01:00
Shish
d91b0ec218 regen thumbnail from cli 2018-07-19 19:53:20 +01:00
Shish
64e2f7fe53 query accelerator failures should silently fall back to non-accelerated mode 2018-07-19 19:31:37 +01:00
Shish
9b0edcf449 also don't even follow links from deep search pages 2018-07-19 08:51:19 +01:00
Shish
71445fdf96 Merge branch 'develop' of https://github.com/shish/shimmie2 into develop 2018-07-17 01:15:27 +01:00
Shish
16a56f5e5b https for gravatars 2018-07-17 01:15:20 +01:00
Shish
d4b28d7c07 fixup alias non-recursion 2018-07-16 08:46:01 +01:00
Shish
4c73b27d1e tell google to stop indexing /post/list/-cake%20-pie/34342 2018-07-15 20:34:52 +01:00
Shish
b973705021 show source URL in query 2018-07-15 20:17:47 +01:00
Shish
8b2c580930 treat phpdbg the same as php-cli 2018-07-15 19:40:53 +01:00
Shish
2417b5b021 don't recursively expand aliaes, as that can create loops 2018-07-15 19:39:39 +01:00
Shish
9e3e37a209 accelerate counts as well as the actual results 2018-06-30 14:28:52 +01:00
Shish
c9d7bd1ae3 delete cached thumb blocks after replacing images 2018-06-20 03:08:40 +01:00
Shish
60c16a9139 dash in the middle of a tag isn't special, allow it to be accelerated 2018-06-20 02:40:52 +01:00
Shish
a6d84ad1d8 Merge branch 'master' of https://github.com/shish/shimmie2 2018-02-20 22:23:58 +00:00
Shish
419b53c2af version bump 2018-02-20 22:19:03 +00:00
Shish
da5d81dbb2 rebuild composer.lock with php7.0 instead of 7.1 2018-02-20 22:14:18 +00:00
Shish
60d693d323 use svg-sanitize to sanitize SVG files 2018-02-20 22:06:50 +00:00
Shish
bc68137797 use svg-sanitize to sanitize SVG files 2018-02-20 22:00:24 +00:00
Shish
18879ddc4c composer update 2018-02-20 21:44:21 +00:00
Shish
936ceac2ce composer update 2018-02-20 21:40:51 +00:00
Shish
09e3bd30a3 Merge branch 'master' of https://github.com/shish/shimmie2 2018-02-20 21:36:08 +00:00
Mik-chan
4721d1ee3a
Merge pull request #1 from shish/master
Keeping up to date
2018-02-20 00:33:12 +03:00
Shish
adaca87ca1 redis cache support 2017-10-28 20:28:31 +01:00
Shish
cf95e28144 firefox complains about invalid email in an email field 2017-10-28 20:28:23 +01:00
Shish
54da35f5db fix warning in local mode 2017-09-22 19:09:07 +01:00
Shish
4dead6837f Merge branch 'develop' of https://github.com/shish/shimmie2 into develop 2017-09-21 15:35:22 +01:00
Shish
7d478a809c this is PHP :( 2017-09-21 15:35:13 +01:00
Shish
c2b4210777 Merge branch 'develop' of https://github.com/shish/shimmie2 into develop 2017-09-21 14:08:14 +01:00
Shish
4ea721f681 underp 2017-09-21 14:04:53 +01:00
Shish
6aa704d04c better image counting 2017-09-21 05:49:10 +01:00
Shish
2628c2c5d9 Merge branch 'develop' of https://github.com/shish/shimmie2 into develop 2017-09-21 05:25:48 +01:00
Shish
6e914ff4e7 use just hash for flexihash lookup 2017-09-21 05:25:45 +01:00
Shish
977c3db1e3 PHP7 type annotations 2017-09-21 05:21:42 +01:00
Shish
c7ca2f4154 un-bundle context.php 2017-09-21 05:00:59 +01:00
Shish
df3f061533 PHPUnit 6 2017-09-21 04:16:36 +01:00
Shish
4dfad1dfbf also composer.json itself 2017-09-19 00:08:05 +01:00
Shish
8f577de08f travis too 2017-09-19 00:05:28 +01:00
Shish
117e018eb6 branch off 2.7 for php7 2017-09-19 00:04:51 +01:00
Shish
d8e75ddf7c bump 2017-09-18 23:57:03 +01:00
Shish
8a4616bc7d Merge branch 'develop' 2017-09-18 23:56:40 +01:00
Shish
4796ee9f00 rebuild composer.lock with php5.6 2017-09-18 23:51:34 +01:00
Shish
aef0d15783 Merge branch 'develop' 2017-09-18 23:40:46 +01:00
Shish
236b444ccd fix test 2017-09-17 19:38:44 +01:00
Shish
1566ff7eaa un-confuse phpunit 2017-09-17 19:37:30 +01:00
Shish
186ea55348 safety 2017-09-17 19:11:51 +01:00
Shish
5763b77e2b strnorm 2017-09-17 19:10:10 +01:00
Shish
2c0e49507e limit / offset 2017-09-17 19:06:10 +01:00
Shish
47ff7f185e Merge branch 'develop' of https://github.com/shish/shimmie2 into develop 2017-09-17 19:00:40 +01:00
Shish
860e828c3e Merge branch 'develop' of https://github.com/shish/shimmie2 into develop 2017-09-17 18:59:59 +01:00
Shish
a32bc6448c make user list slightly more useful 2017-09-17 18:59:48 +01:00
Shish
e1d6ff0f4e composer update 2017-09-17 18:16:07 +01:00
Shish
cdbb4e8c7b add resize/script.js 2017-09-17 15:09:25 +01:00
Shish
408b45e4cc Merge branch 'develop' of https://github.com/shish/shimmie2 into develop 2017-08-24 10:17:47 +01:00
Shish
abe473ffd6 count blank header as null 2017-08-24 10:17:39 +01:00
Shish
473c0f0bcb explicitly mark some block types as ignored when calculating 404ness 2017-08-24 10:17:24 +01:00
Shish
35bd51e513 use 'count()' + result->get_one() to count images, rather than 'select *' + result->rowcount()... 2017-08-23 00:42:19 +01:00
Shish
d875ab66a1 60 second post-list cache 2017-08-22 01:05:18 +01:00
Shish
5a6728209a improve cache logging 2017-08-22 01:04:33 +01:00
Shish
fe5b7cc760 Merge pull request #626 from im-mi/bookmarklet-fix
Fixed bookmarklets on imageboards running gelbooru
2017-08-11 21:37:08 +01:00
im-mi
08f1475007 Fixed bookmarklets on imageboards running gelbooru 2017-08-06 20:30:38 -04:00
Shish
3c3529a4cc don't respond to autocomplete requests for blank string 2017-07-20 23:29:17 +01:00
Shish
8fcf721045 use image link for video 2017-07-20 23:28:55 +01:00
Shish
2f083f7608 more useful memcached error messages 2017-06-08 09:37:38 +01:00
Shish
94ec37029a stub more mb_ functions 2017-06-08 09:37:21 +01:00
Shish
d105644d1b use php sorting for alphabetic tag list, as utf8 sort ignores punctuation 2017-06-08 09:36:59 +01:00
Shish
9f4caaddea remove some unused variables 2017-06-01 20:44:26 +01:00
Shish
53c6f6df30 bulk thumb regen 2017-06-01 20:44:17 +01:00
Shish
2666d83579 fix URL for video fallback flash player 2017-06-01 20:44:02 +01:00
Shish
2f557326df die if caching modules are missing, don't silently fall back to NoCache 2017-05-30 02:13:11 +01:00
Shish
4e5af70093 re-stub mb_strlen (see #615) 2017-05-29 11:09:28 +01:00
Shish
843d7fae24 merge 2017-05-29 10:19:55 +01:00
Shish
8828fdfd05 log SQL query times in DEBUG_SQL mode 2017-05-29 10:19:11 +01:00
Shish
51e165aecf Add separate memcached cache 2017-05-29 10:18:11 +01:00
Shish
684efedcfd Log what URL query caused invalid search queries 2017-05-29 10:16:32 +01:00
Shish
8440826f50 Merge pull request #616 from jgen/develop
Another location where $tags should be an array instead of a string.
2017-05-15 13:02:36 +01:00
jgen
fc7d96b530 Another location where $tags should be an array instead of a string. 2017-05-14 22:18:44 -07:00
Shish
511216f4e8 Merge pull request #614 from jgen/develop
Ensure that metadata['tags'] is always an array
2017-05-14 23:12:49 +01:00
jgen
cf5aacaddf Use empty array instead of array with empty string. (Thanks Shish!) 2017-05-14 14:00:20 -07:00
jgen
3ffb2da91c More checking to ensure tags is an array. 2017-05-13 23:18:47 -07:00
jgen
7ebe301ffd Check if already an array before exploding. 2017-05-13 18:01:31 -07:00
Jeff
dfc536807c Merge pull request #613 from jgen/develop
Fix issue with archive handler if there is no add_status() method for the theme.
2017-05-13 17:49:17 -07:00
jgen
f492c6c2c3 Ensure that the Image object tag_array and the metadata array tags are always arrays. 2017-05-12 00:57:50 -07:00
jgen
c0e87ae2ae Fix issue with archive handler if no add_status method. 2017-05-11 23:43:10 -07:00
Jeff
3183ef59b3 Merge pull request #611 from thomas-hori/develop
Fix error upon bulk add.
2017-05-11 23:23:17 -07:00
Thomas Hori
d1306cfb2d Move Tag::explode call into add_image call so that $result is unaffected. 2017-04-26 14:08:06 +01:00
Thomas Hori
1625bd68e3 Fix error upon bulk add.
Fixes "PHP Fatal error:  Uncaught TypeError: Argument 2 passed to
TagSetEvent::__construct() must be of the type array, string given"
upon bulk add.
2017-04-25 17:48:34 +01:00
Shish
d608b68387 Merge pull request #610 from Zimmedon/develop
bulk_add_csv: Run Tag::explode() on the tags
2017-04-23 10:33:12 -07:00
John Brooks
f934baa207 bulk_add_csv: Run Tag::explode() on the tags before passing them to handlers
Fixes #575
2017-04-23 02:21:39 +00:00
Jeff
dc3508560a Merge pull request #609 from jgen/develop
Develop
2017-03-29 21:42:54 -07:00
Shish
8ef13db69c bump develop 2017-03-27 18:15:16 +01:00
Shish
807d44d644 Version bump 2017-03-27 18:14:11 +01:00
Shish
6345db174b Merge pull request #608 from shish/develop
Merge from develop into master
2017-03-27 18:13:13 +01:00
Jeff
827cae6221 Merge branch 'develop' of https://github.com/shish/shimmie2 into develop 2017-03-25 01:08:23 -07:00
Jeff
015c7d6728 Merge pull request #607 from im-mi/gelbooru-bookmarklet-fix
Fixed bookmarklet when logged in on imageboards running gelbooru
2017-03-25 01:07:10 -07:00
Jeff
8ff24eb1c6 Revert "Bump the version number"
This reverts commit 277d80c4df41918a4b664ecdd88fa1a0b4f0be35.
2017-03-24 23:21:48 -07:00
im-mi
495776cac1 Fixed bookmarklet when logged in on imageboards running gelbooru 2017-03-23 20:46:30 -04:00
jgen
277d80c4df Bump the version number 2017-03-23 00:35:18 -07:00
Jeff
997f321741 Merge pull request #605 from DakuTree/develop
Fix SVG XSS
2017-03-22 23:54:10 -07:00
Daku
acba60e7aa remove extra newline 2017-03-18 00:49:08 +00:00
Daku
2b62cc8171 loading SVG via <img> instead of <object> to stop inline JS execution 2017-03-18 00:13:16 +00:00
Daku
e2272e7786 linting 2017-03-17 23:56:26 +00:00
Daku
cd7352ad9b only need to disable these on PHP5.3 and lower 2017-03-17 23:12:54 +00:00
Shish
ce5bb30113 Merge pull request #604 from jgen/scrutinizer-fixes
Some more linting
2017-03-15 09:42:15 +00:00
jgen
204ea1d239 And more linting. 2017-03-12 17:13:32 -07:00
Jeff
9a68d7ac98 Merge pull request #2 from jgen/scrutinizer-patch-1
Scrutinizer Auto-Fixes
2017-03-12 16:47:42 -07:00
Scrutinizer Auto-Fixer
1caef6d633 Scrutinizer Auto-Fixes
This commit consists of patches automatically generated for this project on https://scrutinizer-ci.com
2017-03-12 23:45:38 +00:00
jgen
b053be5d88 More linting. 2017-03-12 14:53:49 -07:00
jgen
a5a89dc08d mb_strlen and mb_internal_encoding have been in core PHP since version 4.0.6
mb_strtolower has been in core PHP since version 4.3.0
2017-03-12 14:43:19 -07:00
jgen
7bd581b530 Scrutinizer commets. 2017-03-12 14:29:35 -07:00
Shish
44bead8b92 Merge pull request #603 from jgen/develop
PHP Version check in the code should use a configurable value.
2017-03-12 16:13:02 +00:00
Shish
7968f336fd Merge pull request #601 from DakuTree/develop
Updated/removed various libs + tweaks
2017-03-12 16:12:01 +00:00
Shish
df6a91540c Merge pull request #602 from jgen/merge-from-master
Merge fixes from master into develop
2017-03-12 16:09:35 +00:00
jgen
ec4111430d More linting. 2017-03-12 00:29:10 -08:00
jgen
8de816d7dd Some more linting via PHPDoc comments. 2017-03-12 00:18:26 -08:00
jgen
fb3cc1832f Use triple equals, because PHP. 2017-03-11 23:19:37 -08:00
jgen
2691a6bbdc Change PHP version check to use a configuration constant, rather than a hardcoded version in the code.
(As it seems this hardcoded version number is easy to forget about, and then it doesn't actually get updated..)
2017-03-11 18:34:36 -08:00
jgen
ebab9eddeb Merge branch 'master' into merge-from-master
Conflicts:
	ext/tag_list/theme.php
2017-03-11 00:52:16 -08:00
Daku
f9d0c83d5b .audio > .audio_image (.audio is used for modernizr) 2017-03-10 19:18:35 +00:00
Daku
6fc3d51014 use HTML5 audio player, jsmediatags lib, default volume for audio/video 2017-03-10 19:16:54 +00:00
Daku
e07556c62d make sure video isn't bigger than container + linting 2017-03-10 18:26:07 +00:00
Daku
12d73c28a8 remove getID3 lib 2017-03-10 18:16:56 +00:00
Daku
84e86c4930 use mime_content_type instead of getID3 + use proper MP4 mimetype 2017-03-10 18:03:59 +00:00
Daku
256d09a3ec use multiline statements rather than multiple if statements 2017-03-10 16:39:12 +00:00
Daku
68d9ec50c3 specify composer phpunit 2017-03-10 16:21:07 +00:00
Shish
10863d4c4b import imageboard to avoid warnings 2017-03-10 16:15:31 +00:00
Shish
c208a3715c mark static functions as static 2017-03-10 16:14:56 +00:00
Daku
07d57f20e8 this is no longer needed 2017-03-10 16:10:48 +00:00
Daku
6006530b3d password_compat is not required on PHP 5.5+ 2017-03-10 16:10:28 +00:00
Daku
915acda6c7 update PHP-Akismet to PHP7 Compatable version 2017-03-10 15:56:09 +00:00
Daku
810ad041b7 update composer.lock 2017-03-10 15:55:09 +00:00
Daku
df38c7978c remove composer dependency on composer-asset-plugin & use asset-packagist instead
This works the exact same, but without the requirement of a globally installed plugin
This _may_ require a "composer global remove composer-asset-plugin remove" to work correctly.
2017-03-10 15:54:49 +00:00
Shish
55ee93fd27 Merge pull request #600 from jgen/develop
Bump PHP version up to 5.6 & Linting/fixes
2017-03-10 11:11:38 +00:00
jgen
ab9dc0c511 Move phpunit to require-dev in composer.json 2017-03-10 00:28:47 -08:00
jgen
9e7787de0c From Scrutinizer: The case 'r' would never be reached due to the default appearing before it. 2017-03-09 22:55:32 -08:00
jgen
d62304cf70 more linting 2017-03-09 22:28:48 -08:00
jgen
d0b0c7f93d More linting with PHPDoc comments 2017-03-09 21:58:14 -08:00
jgen
bd0310a699 Merge branch 'develop' of https://github.com/jgen/shimmie2 into develop 2017-03-09 21:23:05 -08:00
Jeff
8e7c6ee44e Merge pull request #1 from jgen/scrutinizer-patch-1
Scrutinizer Auto-Fixes for comments.
2017-03-09 20:43:19 -08:00
jgen
fef219c853 Add explicit phpunit dependency back 2017-03-09 10:32:00 -08:00
jgen
9cf325d195 Try global namespace 2017-03-09 01:31:41 -08:00
Scrutinizer Auto-Fixer
9a906d4ecf Scrutinizer Auto-Fixes
This commit consists of patches automatically generated for this project on https://scrutinizer-ci.com
2017-03-09 09:27:52 +00:00
jgen
c1e115e075 Test removing explict phpunit dependency from composer 2017-03-09 01:22:45 -08:00
jgen
ab27e2d2a5 Bump PHP version up to 5.6 2017-03-09 01:12:27 -08:00
jgen
9b7627dede PHP versions 5.5 is EOL now. 2017-03-09 01:09:34 -08:00
jgen
f21648b46d Add phpunit to composer dependencies & update composer 2017-03-09 00:54:48 -08:00
jgen
20455aa2fb Test using PHP 7.1 on Travis as well 2017-03-09 00:13:11 -08:00
jgen
ede2fcf4eb More linting and fixing 2017-03-08 23:52:31 -08:00
jgen
fc0945354d Merge remote-tracking branch 'shish/develop' into develop 2017-03-08 23:05:52 -08:00
jgen
17307820e8 Add some PHPdoc comments as suggested by Scrutinizier 2017-03-08 23:02:26 -08:00
Shish
72de620b42 Merge pull request #598 from jgen/develop
#597: Fix for XSS issue in chatbox extension.
2017-03-08 10:30:54 +00:00
jgen
c379420a1f #597: Fix for XSS issue in chatbox extension. 2017-03-08 01:14:11 -08:00
Shish
fefc922070 Create LICENSE.txt 2016-11-27 20:28:16 +00:00
Shish
4ed28e2db7 Merge branch 'im-mi-tag-tables' into develop 2016-10-10 14:20:10 +01:00
Shish
e43b1b3aed Merge branch 'tag-tables' of git://github.com/im-mi/shimmie2 into im-mi-tag-tables 2016-10-10 14:19:57 +01:00
Shish
4b9278d09b Merge branch 'develop' of https://github.com/shish/shimmie2 into develop 2016-10-09 22:33:25 +01:00
Shish
623d34f20b Merge pull request #589 from im-mi/searchable-random-list
Searchable random list
2016-10-09 22:26:28 +01:00
Shish
7548c66a0b Merge pull request #578 from im-mi/enhance-zoom
Enhance zoom
2016-10-09 22:21:39 +01:00
Shish
579cbf3467 Merge pull request #591 from im-mi/url-escape-tag-info-link-tag
url_escape tag info link tag
2016-10-09 14:45:00 +01:00
im-mi
d5fd6f6821 url_escape tag info link tag 2016-09-28 10:26:13 -04:00
Shish
3daa83223e Merge pull request #588 from im-mi/arrow-key-nav-ignore-modifiers
Ignore arrow key navigation when modifier keys held
2016-09-26 15:22:06 -05:00
Shish
af0aa98649 Merge pull request #586 from im-mi/image-info-tweaks
Image info tweaks
2016-09-26 15:21:46 -05:00
Shish
7e9cc0fb56 Merge pull request #590 from im-mi/fix-ico-size
Misc. Bugfixes
2016-09-26 15:20:07 -05:00
im-mi
8805f0dd18 Remove get_ico page
It's no longer needed because ICO now uses Image->get_image_link()
2016-09-26 11:18:06 -04:00
im-mi
e6dd1b492c Sanitize ratings 2016-09-25 15:26:36 -04:00
im-mi
d4fda00dd9 Check for existence of POST var tag_edit__owner before using it 2016-09-25 15:26:36 -04:00
im-mi
05da5d0b4f Use Image->get_image_link() on ICO files 2016-09-25 15:26:36 -04:00
im-mi
1dd0dfc591 Read ICO header with proper sign
Fixes width/height being read incorrectly when >= 128
2016-09-25 10:17:46 -04:00
Shish
9c062f3385 case-insensitive wiki pages 2016-09-24 16:17:14 +01:00
im-mi
f763fc1356 React appropriately when there are no random list search results 2016-09-23 12:31:02 -04:00
im-mi
3bebe77add Made the random list searchable 2016-09-23 12:21:40 -04:00
im-mi
891e52f4b9 Ignore arrow key navigation when modifier keys held 2016-09-23 12:09:40 -04:00
Shish
d9485bbb40 Merge pull request #587 from im-mi/fix-comment-delete-injection
Fix comment-delete injection
2016-09-14 17:12:01 -07:00
im-mi
a49c5745b0 Use html_escape instead of htmlspecialchars 2016-09-14 18:08:12 -04:00
im-mi
c1083bbea1 Fixed comment-delete code-injection vulnerability 2016-09-14 17:42:32 -04:00
im-mi
3e52e332de Only show image rater if user can rate 2016-09-13 02:10:48 -04:00
im-mi
4dcee0eede Removed trailing period from "Parent: None." for consistency 2016-09-11 23:42:34 -04:00
im-mi
001a1176cc Show image rating in image info box even when not logged in 2016-09-11 23:42:34 -04:00
im-mi
e110b558b8 Hide the rating editor outside of edit mode 2016-09-11 23:42:34 -04:00
Shish
7efff25dcc Merge pull request #585 from im-mi/pool-placeholder-text
Don't use javascript for pool search placeholder
2016-09-07 23:49:19 +01:00
im-mi
e8c6f655b0 Don't use javascript for pool search placeholder 2016-09-07 08:43:34 -04:00
Shish
d36338d4c4 Merge pull request #582 from im-mi/minor-html-fixes
Minor html fixes
2016-09-07 10:31:25 +01:00
Shish
0ef74bdd15 Merge pull request #584 from im-mi/remove-pool-index-link
Use generic NavBlock on pool pages (fixes a JS error)
2016-09-07 10:28:43 +01:00
im-mi
58096e10c8 Fix tag list clipboard spacing
This brings back the original behavior of having spaces between the columns when the tag list gets copied to the clipboard (tested in Chrome, Edge, and Firefox).

One caveat: Edge now adds multiple spaces.
2016-09-06 22:10:09 -04:00
im-mi
ab33652d70 Made tag list spacing more like it was before
It's still a few pixels off in some cases, but the difference is negligible now.
2016-09-06 22:05:34 -04:00
im-mi
73ff0e669d Use generic NavBlock instead of "Index" block on pool pages 2016-09-06 09:25:08 -04:00
im-mi
5919112477 Use tables for tag lists 2016-09-06 06:08:33 -04:00
im-mi
e5cfea028a Fixed mass source set's broken dialog 2016-09-03 14:43:56 -04:00
im-mi
91fea63319 Removed stray end tag 2016-09-03 14:26:24 -04:00
im-mi
ac53fe52de Removed obsolete language specification from <script> 2016-09-03 14:26:24 -04:00
im-mi
10d47409ad Added doctype to home page 2016-09-03 14:26:24 -04:00
im-mi
d39b084537 Properly end attribute list of tag on upload form 2016-09-03 14:26:24 -04:00
im-mi
d9903a969d Added zoom support to svg 2016-09-03 05:36:15 -04:00
im-mi
17f71094f2 Use the size of the outermost svg element
... in case there are nested svg elements.
2016-09-03 05:36:14 -04:00
Shish
3051334d8f be explicit that variables are variables 2016-09-02 16:19:02 +01:00
Shish
e96a5e1109 Merge pull request #579 from im-mi/fix-ico-256-256
Fix .ico when size is 256 x 256
2016-09-02 15:50:46 +01:00
Shish
bc0b37a21f Merge pull request #580 from im-mi/mass-tagger-fixes
Mass tagger fixes
2016-09-02 15:49:18 +01:00
im-mi
15ffdff387 Fix .ico when size is 256 x 256 2016-09-02 05:33:16 -04:00
im-mi
d2540a9619 Use CSS for mass tagger button styling 2016-09-02 05:30:00 -04:00
im-mi
49d6fa99da Clear the mass tagger's selection on load
.. in case it was autocompleted by the browser.
2016-09-02 05:29:59 -04:00
im-mi
35d2f8682c Don't save zoom mode cookie upon window resize 2016-09-02 01:14:53 -04:00
im-mi
84dbc3abff Re-apply zoom upon window resize 2016-09-02 01:12:35 -04:00
im-mi
f26fc5925b Added zoom support to ico 2016-09-02 01:12:34 -04:00
im-mi
eeb0c2b974 Only allow click-to-zoom on img 2016-09-02 01:12:33 -04:00
im-mi
b554e7505b Added zoom support to webm 2016-09-02 00:38:31 -04:00
Shish
29bdc5da22 Merge pull request #576 from im-mi/fix-pool-description-code-injection
Update pool description formatter (code injection vulnerability)
2016-09-01 11:18:37 +01:00
Shish
2258116a31 Merge pull request #577 from im-mi/fix-tag-list-starts-with-headings
Fix "starts-with" header in tag list when escaping required
2016-09-01 11:16:10 +01:00
im-mi
10e8fc50d3 Fix "starts-with" header in tag list when escaping required
This fixes the "starts-with" headers* on the tags/alphabetic page. Before, the headers would be wrong if they started with an escaped character.

This also escapes the resulting header so that it no longer generates invalid HTML in such cases.

* Note that these headers are only visible when paged tag lists is disabled.
2016-09-01 03:33:17 -04:00
im-mi
bb64d12d9d Use TextFormattingEvent instead of raw BBCode formatter 2016-09-01 00:35:52 -04:00
im-mi
834bc740a4 html_escape data-tags for tags that contain single quotes 2016-08-29 10:05:56 +01:00
Shish
bcef3fbc8f have tag sanitisation process ignore tags which are too long, fixes #565 2016-08-29 09:21:23 +01:00
im-mi
1bab0051f1 html_escape tag info link 2016-08-29 09:11:13 +01:00
Shish
5691d1c3ad Merge pull request #574 from im-mi/single-quotes-in-tags-fix
Fix tags not being escaped for HTML in some cases (code injection vulnerability)
2016-08-29 09:09:55 +01:00
im-mi
84b4ac3893 html_escape tag info link 2016-08-29 01:19:11 -04:00
im-mi
36b66f4c23 html_escape data-tags for tags that contain single quotes 2016-08-29 00:26:55 -04:00
Shish
a68407e12e Merge pull request #573 from im-mi/patch-2
Fix log info section name
2016-08-20 14:57:35 +01:00
Shish
98254ef5bd Merge pull request #572 from im-mi/video-playback-options
Added video playback options for autoplay and loop
2016-08-20 14:57:16 +01:00
Shish
61b86da5fe Merge pull request #571 from im-mi/develop
Clean up a few superficial errors
2016-08-20 14:56:18 +01:00
im-mi
980e3b686b Fix log info section name 2016-08-19 21:52:48 -04:00
im-mi
cce24f9e80 Added video playback options for autoplay and loop 2016-08-19 21:25:58 -04:00
im-mi
8fe9212882 Fixed assertion failure upon upload due to incorrect type check 2016-08-19 15:55:18 -04:00
im-mi
d8e1346b78 Replace deprecated DefaultType directive 2016-08-19 15:55:18 -04:00
Shish
e7403819a7 Merge pull request #570 from im-mi/master
Fix bookmarklets
2016-08-16 23:45:07 +01:00
im-mi
85a3cc0a7e Fall back to file extension from path 2016-08-16 11:34:01 -04:00
im-mi
3323a50ea5 Made a few parts less site-specific 2016-08-16 11:32:34 -04:00
im-mi
adf723ad23 Fixed bookmarklet on Danbooru2 2016-08-16 11:30:34 -04:00
im-mi
91d609a4c6 Make back button go to page bookmarklet was executed on 2016-08-16 11:29:26 -04:00
im-mi
b10144492a Added supported video file extensions to bookmarklet 2016-08-16 11:28:16 -04:00
im-mi
9ba6e3f7db Remove trailing variables from image address 2016-08-16 11:27:22 -04:00
im-mi
8f974fba73 Fixed uploading scaled images from Gelbooru when logged in 2016-08-16 11:26:32 -04:00
im-mi
b24977e110 Fixed tag corruption bug
If there was no newline at the end of the input, then the last tag would get corrupted.
2016-08-16 11:25:04 -04:00
Shish
89dffd569a and mass tagger 2016-07-30 23:41:42 +01:00
Shish
28c10d1748 unit tests are input too 2016-07-30 23:08:08 +01:00
Shish
26b2cd5c16 derp 2016-07-30 23:06:42 +01:00
Shish
bed04a1230 assert that metadata['tags'] is an array 2016-07-30 23:02:14 +01:00
Shish
ffce1a4683 more hinting 2016-07-30 22:54:42 +01:00
Shish
b81e8a2db8 also explode tags on transload input 2016-07-30 22:45:44 +01:00
Shish
7be951b271 Convert tags from user-supplied string to array once, on input
This results in a fuckton of refactoring and code cancelling out
other code -- we no longer have a whole bunch of places trying
to support string params and array params, and doing their own
esaping and unescaping, never being quite sure if the data they've
been passed is escaped or not.

Also adds a bunch of type hinting, since we can now know what
data we're dealing with better.
2016-07-30 22:11:49 +01:00
Shish
bc3e482247 more image report display options 2016-07-30 15:04:34 +01:00
Shish
b533a43428 Merge branch 'develop' of https://github.com/shish/shimmie2 into develop 2016-07-11 13:01:05 +01:00
Shish
c14a36079c add option to force a specific base url 2016-07-11 13:00:54 +01:00
Shish
b6ad316d20 linting 2016-07-03 12:07:54 +01:00
Shish
68d58a6f11 Merge branch 'develop' of https://github.com/shish/shimmie2 into develop 2016-07-03 11:48:16 +01:00
Shish
8c8106c6a9 fix index var access 2016-07-03 11:48:08 +01:00
Shish
17696f842c tiny readme tweak 2016-06-27 20:49:07 +01:00
Shish
bb35421b05 Load AutoComplete before Home, so that the headers show up 2016-06-26 18:57:53 +01:00
Shish
d2eb248538 extra cookie updates 2016-06-20 00:24:50 +01:00
Shish
cb73a0caa0 let's stop being php5.2 compatible 2016-06-19 23:23:34 +01:00
Shish
6febdec7b5 more explicit variable types 2016-06-19 23:05:57 +01:00
Shish
f8b7909426 ExtensionInfo isn't private 2016-06-19 22:15:46 +01:00
Shish
333c74ba35 typo 2016-06-19 17:48:10 +01:00
Shish
dc10a18086 lots of minor doc tweaks, type hints, etc 2016-06-19 17:41:40 +01:00
Shish
edd3e49a2f mark wildcard test incomplete on pgsql / sqlite 2016-06-19 14:06:26 +01:00
Shish
68f69dc1fe Merge pull request #559 from shish/re-fix-wildcards
re-fix wildcards for mysql
2016-06-19 14:00:00 +01:00
Shish
6d47eb1d91 Merge pull request #558 from DakuTree/cleanup
Few small fixes/changes
2016-06-19 13:59:31 +01:00
Shish
d185fd354b fix wildcard search for mysql 2016-06-19 12:14:44 +01:00
Shish
e0d3d53479 stub mb_ functions 2016-06-19 12:12:48 +01:00
Daku
a8d9f8ce5b make sure prev/next links aren't clipped outside the box 2016-06-19 11:56:41 +01:00
Daku
f973fcc9fa basic autocomplete support for metatags 2016-06-19 10:07:56 +01:00
Daku
03240220d4 make sure to get proper tag value + use selected tag if possible 2016-06-19 09:49:55 +01:00
Daku
ce10831137 this shouldn't be indented under matrix.. 2016-06-19 05:25:40 +01:00
Daku
862a84677f add docs column, showing what extensions have documentation
previously it made every ext name into a link to /ext_doc, regardless if it had docs or not
2016-06-19 05:05:12 +01:00
Daku
c0601640bf only show link if extension actually has documentation 2016-06-19 05:04:59 +01:00
Daku
5ae10473e3 closing tag is unneeded 2016-06-19 05:01:13 +01:00
Daku
6486a4757f js scrutinizer fixes 2016-06-19 05:00:09 +01:00
Daku
b75638cace get_last_insert_id requires param for pgsql support 2016-06-19 04:57:14 +01:00
Daku
66226b5ccf include code quality, code coverage imgs in readme
would be nice if this changed depending on the branch..
2016-06-19 04:56:27 +01:00
Daku
d4793db6a5 improve instructions 2016-06-19 04:55:32 +01:00
Daku
b70e24acde github apparently auto-numbers rows and ignores ours 2016-06-19 04:51:48 +01:00
Daku
311dd91a09 disable travis logs since they don't work 2016-06-19 04:45:33 +01:00
Daku
43f108d095 SQLite is currently experimental, move it to allowed failures 2016-06-19 04:26:43 +01:00
Daku
90cbd9fff8 Merge pull request #557 from shish/composer-lock
add composer.lock for scrutinizer-ci
2016-06-19 04:11:03 +01:00
Shish
730c2659ae add composer.lock for scrutinizer-ci 2016-06-18 19:43:04 +01:00
Shish
4577ff70ef more linty bits 2016-06-18 19:26:56 +01:00
Shish
cfd3a9d248 lint fixes 2016-06-18 19:00:56 +01:00
Shish
24973ada17 don't run linter on ext/*/lib/* 2016-06-18 19:00:53 +01:00
Shish
0fd96fcdae remove incomplete and unmaintained bookmarks ext, see #532 2016-06-18 18:26:11 +01:00
Shish
06ee5347c7 https support for gravatars 2016-06-18 15:56:24 +01:00
Shish
0ff6da6d3c Merge #555 2016-06-18 15:16:47 +01:00
Shish
15076f4981 Merge branch 'composer-new' of git://github.com/DakuTree/shimmie2 into DakuTree-composer-new 2016-06-18 15:16:10 +01:00
Daku
b5d56214cd fix case-insensitive autocomplete on postgres 2016-06-18 14:45:21 +01:00
Shish
20d0edb332 Merge pull request #556 from shish/html-headers
fix and use get_all_html_headers()
2016-06-18 14:05:44 +01:00
Daku
5d5b1d7059 this should be set to $res 2016-06-18 14:03:37 +01:00
Daku
56e5348470 autocomplete caching
see 7dce8da850d2b266ffc196a9e9c0aa9ee9314fe3
2016-06-18 13:20:07 +01:00
Daku
2546621c59 sort autocomplete by score + show score 2016-06-18 13:20:04 +01:00
Shish
cfc1268354 update non-layout.class.php uses of html_headers too 2016-06-18 12:49:46 +01:00
Shish
b76ee95c76 fix and use get_all_html_headers() 2016-06-18 12:25:54 +01:00
Daku
4bd9ee1c7f fix autocomplete search not looking correct on home page 2016-06-18 12:25:39 +01:00
Daku
6b6e4f04b6 html_headers should be properly sorted 2016-06-18 12:25:22 +01:00
Daku
2a747c8f2b move home css to style.css 2016-06-18 12:10:37 +01:00
Daku
559a4c7e40 move autocomplete js to script.js so it's cached 2016-06-18 11:58:41 +01:00
Daku
c59995c807 search button can sometimes be on same line as input 2016-06-18 11:47:04 +01:00
Daku
b6e181efb1 excess whitespace 2016-06-18 11:24:18 +01:00
Shish
029e6def94 remove excess whitespace 2016-06-18 11:21:54 +01:00
Daku
a9e3ef26be space should always create new tag 2016-06-18 08:06:59 +01:00
Daku
1db62901be disallow spaces in tags 2016-06-18 07:41:59 +01:00
Daku
09aaf72e5a vendor/swf should have a .gitkeep 2016-06-18 06:46:00 +01:00
Daku
7f4e96240b throw error if vendor/ doesn't exist 2016-06-18 06:42:52 +01:00
Daku
9ed1079942 asset-plugin needs to be installed.. 2016-06-18 06:29:06 +01:00
Daku
f3d56f5810 fix README 2016-06-18 06:29:04 +01:00
Daku
7673769621 composer install + moving some stuff about 2016-06-18 06:29:02 +01:00
Daku
4aa6278a58 indent 2016-06-18 06:29:00 +01:00
Daku
4e163a3027 check against 7.0 rather than nightly (since 7.0 is out now) 2016-06-18 06:28:58 +01:00
Daku
60dd9eeb90 temp solution to avoid removing modernizr lib 2016-06-18 06:28:53 +01:00
Daku
d73b6275eb leftover gif from old lib 2016-06-18 06:28:52 +01:00
Daku
861862a3e1 password compat lib is now autoloaded with composer 2016-06-18 06:28:48 +01:00
Daku
4c9bddd496 modernizr lib
sadly this can't installed via composer since we'd end up getting a bunch of functions that will never be used
2016-06-18 06:28:46 +01:00
Daku
78c2731a12 move notes libs to ext folder, fix a few bugs
it would be nice to take this out of beta, but it still has major issues with image resizing / unable to edit or delete notes
2016-06-18 06:28:33 +01:00
Daku
543600dc0e make sure main css/js files are always loaded after libs 2016-06-18 06:28:31 +01:00
Daku
acfed13634 <font> is deprecated 2016-06-18 06:28:28 +01:00
Daku
d42a792e8b safe_mode was removed in php 5.4 2016-06-18 06:28:25 +01:00
Daku
7eca12b495 replace remove_trailing_slash with a simple rtrim 2016-06-18 06:28:23 +01:00
Daku
f28e78b6f0 show install error if vendor folder does not exist
this should help deter non-dev users from installing shimmie from the master/dev branches
2016-06-18 06:28:21 +01:00
Daku
abababc57a use <pre> instead of <plaintext> since it's been deprecated since HTML2
SEE: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/plaintext
2016-06-18 06:28:17 +01:00
Daku
b161bbcf1b use a container div for padding + handle_db_errors function 2016-06-18 06:28:15 +01:00
Daku
d17de45965 don't use < or > to avoid showing broken comment if PHP isn't loaded 2016-06-18 06:27:55 +01:00
Daku
394acce635 use base64 favicon to avoid being cached
it's also unlike that ./favicon.ico will even exist yet during a new install
2016-06-18 06:27:53 +01:00
Daku
5c3236c0ef installer css is only used once, so let's just inline it instead 2016-06-18 06:27:51 +01:00
Daku
f6e1da349b added composer setup instructions
this assumes that all new releases will already have all vendor files downloaded
2016-06-18 06:27:49 +01:00
Daku
3ebf78e252 make sure lib/vendor folder is cleared on composer update
this stops old libs from still being cached by mistake
2016-06-18 06:27:47 +01:00
Daku
9e7c318df0 notes ext code cleanup
initial prep to fix & take the ext out of beta
2016-06-18 06:27:44 +01:00
Daku
b9893cbbda $_POST["tags"] isn't always set 2016-06-18 06:27:41 +01:00
Daku
caed53de6a jQuery.cookie is deprecated so use js-cookie instead (+ composer), some js tweaking too
Conflicts:
	ext/blotter/script.js
	ext/handle_pixel/script.js
	ext/index/script.js
	ext/pools/script.js
	lib/shimmie.js
2016-06-18 06:27:32 +01:00
Daku
951323abcf default handle_video thumbgen to ffmpeg if ffmpeg in path & is_executable 2016-06-18 06:20:52 +01:00
Daku
b0daab8766 move from Jaris > MediaElement for <video> fallback + use composer
also made it so the video element is no longer bigger than parent div
2016-06-18 06:20:49 +01:00
Daku
dd105e174e images aren't always jpg, so don't force jpg
all the handle_* exts use this as well, which can cause issues
2016-06-18 06:20:46 +01:00
Daku
2070034d0d move securimage to composer + update lib 2016-06-18 06:20:43 +01:00
Daku
428d1285e0 instead of including the entire jquery ui lib for a single function, just load the single function 2016-06-18 06:17:18 +01:00
Daku
ba6ab8fb16 move S3.lib to ext folder
toggleable exts should really keep any libs they use in their own dir
2016-06-18 06:17:15 +01:00
Daku
d5a58916f7 get recaptcha lib with composer + fixes #498 2016-06-18 06:17:07 +01:00
Daku
57fb4e0a34 grab tablesorter lib with composer 2016-06-18 06:17:04 +01:00
Daku
5f4ba46463 forgot to remove this 2016-06-18 06:17:01 +01:00
Daku
a2d9d14b6f there isn't any reason to grab both versions of the js lib 2016-06-18 06:16:37 +01:00
Daku
7b82ec3a00 grab jQuery.timeago lib with composer 2016-06-18 06:16:33 +01:00
Daku
516488a625 load akismet via composer
note: we should probably be using a more recent library for this, but there doesn't seem to be any general ones..
2016-06-18 06:16:31 +01:00
Daku
895df8c22b load flexihash via composer 2016-06-18 06:16:28 +01:00
Daku
d00d0ee4bb asset-plugin doesn't need to be required as it is installed globally instead 2016-06-18 06:16:26 +01:00
Daku
ef898394f0 autocomplete has moved to ext 2016-06-18 06:16:23 +01:00
Daku
f17812c64b working autocomplete 2016-06-18 06:16:21 +01:00
Daku
1bfec55690 tag lib for autocomplete
--not added autocomplete yet
2016-06-18 06:16:17 +01:00
Daku
baf8aa1b8c use composer to grab jquery
this requires composer-asset-plugin to be globally installed
2016-06-18 06:16:13 +01:00
Daku
36264d3f6e stop caching css/js from disabled exts 2016-06-18 06:16:10 +01:00
Daku
e740d03101 generate seperate css/js cache files for libs & core files 2016-06-18 06:16:08 +01:00
Daku
0b75b559a0 init composer 2016-06-18 06:16:02 +01:00
Daku
a7021e190e Merge pull request #554 from shish/js-cookie-update
migrate to a non-deprecated (and dependency-free) cookie library
2016-06-18 03:34:12 +01:00
Shish
7dce8da850 caching for autocomplete 2016-06-18 01:19:34 +01:00
Shish
79648b04d2 Merge branch 'develop' of https://github.com/shish/shimmie2 into develop 2016-06-18 01:18:29 +01:00
Shish
f3a3c76988 better test router 2016-06-18 00:45:58 +01:00
Shish
7bc9a73357 migrate to a non-deprecated (and dependency-free) cookie library 2016-06-18 00:00:02 +01:00
Shish
dda634b068 Merge branch 'develop' of https://github.com/shish/shimmie2 into develop 2016-06-17 23:42:20 +01:00
Shish
76c2815b2b unit test bettering 2016-06-17 23:42:12 +01:00
Shish
57fa354842 fnmatch has a string length limit :| 2016-06-17 22:51:30 +01:00
Shish
190d8bd7d7 log api stats seperately 2016-06-17 22:48:28 +01:00
Shish
1b53ecceb7 Merge pull request #553 from HungryFeline/patch-2
Set ffmpeg's "overwrite output files" switch (-y)
2016-06-16 17:40:01 +01:00
HungryFeline
94ba42fc70 Set ffmpeg's "overwrite output files" switch (-y)
Regenerate thumbnail doesn't work since the output file already exists and ffmpeg expects the user to decide wether to replace the file or not. With the -y switch set, ffmpeg does so without asking.

https://ffmpeg.org/ffmpeg.html#Main-options
2016-06-16 16:40:51 +02:00
Shish
3d05c2896a expand test cases 2016-06-07 01:56:05 +01:00
Shish
bfa1dc20c0 fix mysql 2016-06-07 01:50:56 +01:00
Shish
8e8a3da790 support single wildcard 2016-06-07 01:39:23 +01:00
Shish
dc83d4ace7 lots of deduping for searching 2016-06-07 01:34:38 +01:00
Shish
7f2609f727 dedupe searching a bit 2016-06-07 00:19:41 +01:00
Shish
525fd20540 Merge pull request #548 from DakuTree/fix-wildcards
Fix wildcard tag bugs
2016-06-06 23:18:51 +01:00
Shish
14c7743024 Merge pull request #552 from shish/search-test
Search tests
2016-06-06 23:07:22 +01:00
Shish
c41c9d680f search tests 2016-06-06 22:42:40 +01:00
Shish
43eed32958 Merge pull request #551 from shish/contact-link
Have contact_link support http: and mailto:
2016-06-06 12:37:27 +01:00
Shish
aeeaabb22e allow both http: and mailto: contact links 2016-06-06 12:12:25 +01:00
Daku
61acb24875 fixes #547 -> multi-tag searches not working with wildcard when wildcard matches more than 1 tag
is there a better way to do this?
2016-05-22 18:35:37 +01:00
Shish
8326ef631f Merge pull request #546 from DakuTree/fix-relationships
Fix relationships ext checking for TRUE/FALSE instead of Y/N
2016-05-22 18:11:57 +01:00
Daku
3b171ffc5a fix single tag wildcard searches returning duplicate results if image has more than one match 2016-05-22 17:58:09 +01:00
Daku
44876a58d9 we should be using bool_escape instead... 2016-05-22 16:17:31 +01:00
Shish
536cba980a update footer date 2016-05-22 16:13:38 +01:00
Shish
3e57f725d3 update ban message 2016-05-22 16:12:43 +01:00
Daku
a3296e18ae create index for has_children 2016-05-11 14:49:22 +01:00
Daku
32dbdccd00 has_children uses Y/N, not TRUE/FALSE 2016-05-10 21:15:50 +01:00
Shish
4609549a4b Merge pull request #538 from dali99/Material_-_Home
Material - home extension
2016-04-04 11:37:44 +01:00
Shish
dc8efcb680 Merge pull request #543 from sanmadjack/develop
Fixes for bulk add results
2016-04-01 10:47:13 +01:00
Matthew Barbour
c0fb36e4c8 Merge remote-tracking branch 'sanmadjack/develop' into develop 2016-03-21 18:17:53 -05:00
Matthew Barbour
898bcfae94 Fixes for bulk add results 2016-03-21 18:14:48 -05:00
Shish
cfad6087ab Merge pull request #541 from DakuTree/patch-constraints
Fix constraint violations when mass-editing an image that already contains the new tag
2016-01-25 11:16:25 +00:00
Daku
9235025165 fix integrity constraint violations when mass-editting an image that already contains the new tag 2016-01-24 09:56:47 +00:00
Daniel Løvbrøtte Olsen
ba66f653d6 Removes data-clink-sel="" in the sidebar links
It's unused as far as I can see
2016-01-08 10:22:58 +01:00
Daniel Løvbrøtte Olsen
2cd649b719 That's what I get for copiying and pasting 2016-01-07 13:13:50 +01:00
Daniel Løvbrøtte Olsen
ac264c4040 Stylesheet and js not from other hosts anymore 2016-01-06 23:21:55 +01:00
Daniel Løvbrøtte Olsen
a9a3af9a88 It works!!!!1!!!111!one111!!! 2016-01-06 22:58:27 +01:00
Daniel Løvbrøtte Olsen
8da4d73d82 Online tool says this should work 2016-01-06 15:27:53 +01:00
Daniel Løvbrøtte Olsen
f2af07e3d1 O.o why didn't that work? 2016-01-06 15:22:38 +01:00
Daniel Løvbrøtte Olsen
0b74b5630f How to regex 2016-01-06 15:14:33 +01:00
Daniel Løvbrøtte Olsen
7a0cb4bddc Oooops, that's kiiiinda important 2016-01-06 15:10:26 +01:00
Daniel Løvbrøtte Olsen
c36cc25cd5 This should add the correct class 2016-01-06 15:00:54 +01:00
Daniel Løvbrøtte Olsen
f8a7156371 derp 2015-12-30 13:29:14 +01:00
Daniel Løvbrøtte Olsen
05656618db Updated mdl and added license 2015-12-29 19:27:32 +01:00
Daniel Løvbrøtte Olsen
a267516b77 Made navgation links reside inside nav - "I identify as navbarkin" 2015-12-28 18:42:55 +01:00
Daniel Løvbrøtte Olsen
90b306184f weird &ndash;es 2015-12-28 18:12:37 +01:00
Daniel Løvbrøtte Olsen
ddc3b844d1 Olds CSS rules begone! 2015-12-28 18:09:06 +01:00
Daniel Løvbrøtte Olsen
eceef2a56f Added links 2015-12-28 03:22:42 +01:00
Daniel Løvbrøtte Olsen
5761148d0a fixed search - wow i was stoopid 2015-12-28 03:01:12 +01:00
Daniel Løvbrøtte Olsen
2afdbfc2d1 fixed search 2015-12-28 02:51:10 +01:00
Daniel Løvbrøtte Olsen
d8f18df3ec more testing 2015-12-28 02:45:24 +01:00
Daniel Løvbrøtte Olsen
d21e86aeb0 Cheated a bit to test it out ;) 2015-12-28 02:37:05 +01:00
Daniel Løvbrøtte Olsen
a8ca54db0b ported search, counter, foot and title to php 2015-12-27 16:10:45 +01:00
Daniel Løvbrøtte Olsen
de87bdbb0d Merge pull request #1 from shish/develop
MERGE ALL THE THINGS
2015-12-17 11:26:51 +01:00
Shish
b328196d94 Merge pull request #534 from DakuTree/patch-sqlspeed
Subquery optimization on MySQL < 5.6
2015-12-04 14:52:35 +00:00
Daku
6d1c7c414b mysql < 5.6 has terrible subquery optimization, using EXISTS / JOIN fixes this 2015-12-04 11:38:44 +00:00
Shish
57e5d8e538 Merge pull request #519 from terokorp/feature/apache2.4_htaccess
Adding support for apache 2.4
2015-10-26 19:23:28 +00:00
Shish
ac9dc1b8d8 Merge pull request #523 from DakuTree/patch-tagevent
Move tag sanitization, alias resolving & tag parsing from set_tags > TagSetEvent
2015-10-26 19:22:08 +00:00
Shish
c946daf152 Merge pull request #530 from CrandellWS/hotfix-chatbox-relative-urls
hotfix-chatbox-relative-urls
2015-10-26 19:19:11 +00:00
William Crandell
7b8d8c2a2d chatbox bugfix
might cause new bugs checking into this now
2015-10-26 11:22:57 -04:00
Shish
ffac680588 Merge pull request #529 from CrandellWS/hotfix-bad-blotter-id
Hotfix block id character stripping
2015-10-26 13:51:01 +00:00
Shish
28e1cb30ea Merge pull request #528 from CrandellWS/develop
merge start of material theme
2015-10-26 13:49:56 +00:00
William Crandell
5ebd11717f Hotfix block id character stripping
Example problem is ext/blotter uses:

  $page->add_block(
     new Block(
     "Welcome to the Blotter Editor!", <-- SEE --> !
      $html, "main", 10));
2015-10-26 09:44:01 -04:00
William Crandell
b7114a142e Hotfix for better block id character filtering 2015-10-26 09:20:09 -04:00
William Crandell
4af1199ff3 Hotfix flash message
maybe other issues not sure
2015-10-26 09:10:32 -04:00
William Crandell
6fb43eab19 On Develop branch
Sorry about that
2015-10-26 08:51:02 -04:00
Shish
b9f6b44301 bump 2015-10-26 12:14:36 +00:00
Shish
7b0933ea54 merge develop, fix conflicts, bump 2015-10-26 12:13:17 +00:00
Shish
f8cb2e96e4 only check min < val < max if min and max are defined 2015-10-19 07:19:53 +01:00
Shish
0855c7e9c4 Merge branch 'develop' of https://github.com/shish/shimmie2 into develop 2015-10-19 07:11:47 +01:00
Shish
4971fa9337 empty bool = false 2015-10-19 07:11:41 +01:00
Shish
e9a1bebe76 how did this ever not break everything? x_x 2015-10-19 06:58:47 +01:00
Shish
3e0dc69766 Merge pull request #524 from DanielOaks/fix-notes-for-sqlite
Fix the notes extension to work properly on SQLite
2015-10-15 09:26:50 -07:00
Daniel Oaks
144ac6bd89 Fix the notes extension to work properly on dbs other than MySQL 2015-10-15 19:31:39 +10:00
Shish
3aed2abec7 don't complain if one image in a bulk revert doesn't exist 2015-10-12 19:17:16 +01:00
Daku
600011219f update docs 2015-10-08 19:25:38 +01:00
Daku
de761c11d7 speed: don't check tag for metatag if doesn't contain : or = 2015-10-08 19:20:40 +01:00
Daku
43d0a297b8 move metatag parsing to after set_tags is sent, rather than before 2015-10-08 18:58:52 +01:00
Daku
b11041898b Tag::explode instead of explode
this fixes the off chance that an empty tag could be passed
2015-10-08 18:28:00 +01:00
Daku
744989a983 Tag::explode should now remove duplicate tags 2015-10-08 18:25:03 +01:00
Daku
6ff80ab2c8 move tag sanitization, alias checking & tag parsing to TagSetEvent 2015-10-08 18:22:20 +01:00
Daku
23b9d7d8da improved metatag regex 2015-10-08 18:03:45 +01:00
Shish
d30665d274 more deduping 2015-09-27 21:09:27 +01:00
Thasan
993bedc10c Changing to use IfModule instead of IfVersion 2015-09-27 22:48:30 +03:00
Shish
1ac88e8923 more comments 2015-09-27 12:38:48 +01:00
Shish
80f5a016c2 or else 2015-09-27 11:01:59 +01:00
Shish
cdcd762a52 more comments 2015-09-27 02:17:44 +01:00
Shish
78c44c7067 more tidying shimmie api and user page 2015-09-27 02:00:02 +01:00
Shish
793bc3614b loooooooads of artists refactoring and tidying 2015-09-27 01:03:58 +01:00
Shish
5d188a94cf one sample? 2015-09-26 22:58:34 +01:00
Shish
81ce7082f4 require fewer samples, should still be ok 2015-09-26 22:54:51 +01:00
Shish
b9a0278f6e clean up danbooru api code 2015-09-26 22:50:05 +01:00
Shish
937106c0d7 merge coverages 2015-09-26 21:07:06 +01:00
Shish
ff13e58f8f clamp to a valid value 2015-09-26 20:03:30 +01:00
Shish
e482f97955 more clamping 2015-09-26 19:53:15 +01:00
Shish
5a8df90fd9 splitting up huge functions in ext/comment 2015-09-26 19:14:11 +01:00
Shish
6a94ae4aaf spacing 2015-09-26 17:53:02 +01:00
Shish
47b9a6966a no access needed for public repo 2015-09-26 17:45:58 +01:00
Shish
c93b085ca5 update secure 2015-09-26 17:41:59 +01:00
Shish
5947220930 code coverage for scrutinizer 2015-09-26 17:23:52 +01:00
Shish
8c1e3bc92a mark tests as public 2015-09-26 11:17:13 +01:00
Shish
85e5c7250b mark tests as public 2015-09-26 11:11:26 +01:00
Thasan
b92dfd6718 Adding support for apache 2.4
This requires mod_version installed, but many distributions ship it by default
2015-09-25 23:06:56 +03:00
Shish
7f20b0527e remove trailing commas from schema definitions in create_table() 2015-09-24 23:16:51 +01:00
Shish
c54e336695 mark tests as incomplete rather than commenting them out 2015-09-24 23:16:38 +01:00
Shish
c337abe280 skip tests for extensions who don't support the current db 2015-09-21 10:05:32 +01:00
Shish
98d71f527d test fix 2015-09-20 23:24:26 +01:00
Shish
6919431c49 performance 2015-09-20 23:20:51 +01:00
Shish
82ab2a8305 faster tests 2015-09-20 23:10:33 +01:00
Shish
fc2bbefcb9 test all the things 2015-09-20 22:40:04 +01:00
Shish
13dfb8861f more tests 2015-09-20 21:20:28 +01:00
Shish
2600ef042b setup tests 2015-09-20 20:44:34 +01:00
Shish
7bfc959547 upload tests 2015-09-20 20:28:27 +01:00
Shish
ff8da5be8e word filter tests 2015-09-20 20:18:55 +01:00
Shish
90cd823ece fix liveness testing, and comments tests 2015-09-20 20:05:06 +01:00
Shish
c9036a91d5 remove dead code 2015-09-20 20:04:25 +01:00
Shish
0617079afb test 2015-09-20 20:04:16 +01:00
Shish
9f10f923fe chdir() in phpunit bootstrap 2015-09-20 20:04:16 +01:00
Shish
49a6083b8b fix 2015-09-20 20:04:16 +01:00
Shish
83a1336b76 more test 2015-09-20 20:04:16 +01:00
Shish
ec484c1144 more phpunit-ing 2015-09-20 20:04:13 +01:00
Shish
2d622cf908 put test svg in a file 2015-09-20 20:03:29 +01:00
Shish
8fa2fadd44 add sqlite to travis 2015-09-20 20:03:29 +01:00
Shish
9af5995dcc PHPUnit proof of concept 2015-09-20 20:03:29 +01:00
Shish
e3959e5ec8 remove simpletest 2015-09-20 20:03:29 +01:00
Shish
5a466bfac3 include config modification data in JS/CSS caches 2015-09-20 20:02:39 +01:00
Shish
ba3a61052f timeout on varnish purger 2015-09-20 20:02:36 +01:00
Shish
ffc636515f remove dead code 2015-09-20 20:02:34 +01:00
Shish
147b47a78c add comment style 2015-09-20 20:02:30 +01:00
Shish
e4b4bf2c8f better sql logging 2015-09-20 20:02:24 +01:00
Shish
1fc5fb755a handle null in tag_editcloud 2015-09-20 13:20:26 +01:00
Shish
ca1782ff68 Merge pull request #512 from JarJak/develop
fixed declaration of CustomCommentListTheme::comment_to_html
2015-09-20 12:32:34 +01:00
JarJak
446397b5ad fix 2015-09-20 12:14:56 +02:00
Shish
35a4f385b3 phpstorm tidying 2015-09-12 11:43:28 +01:00
Shish
6c304420a6 Merge pull request #506 from DakuTree/bugfixes
Fixes #505 & other small fixes
2015-08-12 10:41:00 +01:00
Daku
a55306f4be don't throw no handler error if empty directory / directory doesn't exist 2015-08-12 06:58:44 +01:00
Daku
9490e4aae2 fix endless loop when checking for subdirectory
is there any reason why this was only checking for "." & ".." ?
2015-08-12 06:43:38 +01:00
Daku
b2d8b41388 spaces > tabs 2015-08-12 06:12:53 +01:00
Daku
ef6a7289bb if alias is negative and has multiple tags, make sure each tag becomes negative 2015-08-12 06:11:21 +01:00
Daku
ebfcf9389e using links as block title doesn't play nice with .js, so specify ID
blocks use title as ID, which will break if the title is a link
2015-08-10 00:45:06 +01:00
Shish
4e79cbdc18 installer exit codes
Conflicts:
	install.php
2015-08-09 15:42:05 +01:00
Shish
e5511ec801 wtf, php 2015-08-09 15:40:57 +01:00
Shish
9ff2ef390d make handle_404 handle blotter 2015-08-09 13:40:34 +01:00
Shish
d043852785 php7 compat 2015-08-09 13:40:34 +01:00
Shish
e415bd3fca more database support 2015-08-09 12:20:43 +01:00
Shish
0ef8db8371 not all requests have remote_addr 2015-08-09 12:20:37 +01:00
Shish
a70ca33f96 fix typo 2015-08-08 23:04:36 +01:00
Shish
df56213ec3 allow exts to mark themselves as not supporting sqlite 2015-08-08 22:23:27 +01:00
Shish
a7d0158848 more sqlite support 2015-08-08 22:19:10 +01:00
Shish
65289ed9c8 skip to latest db 2015-08-08 22:18:54 +01:00
Shish
cef7257ec8 abstract unique index creation 2015-08-08 22:18:38 +01:00
Shish
45d090054b set_default_bool should take a bool, always 2015-08-08 22:18:25 +01:00
Shish
fa2f17817e scrutinizing 2015-08-04 13:53:58 +01:00
Shish
d2d2a9b73a try checking for property of object rather than class? 2015-08-04 12:37:35 +01:00
Shish
654b282ab7 allow BASE_HREF to be defined explicitly 2015-08-03 15:49:38 +01:00
Shish
7762b2c703 do InitExtEvent in bootstrap, before user exists 2015-08-03 15:49:38 +01:00
Shish
83435e3266 set cookies on Page object 2015-08-03 15:49:36 +01:00
Shish
eb246ef1ee count_execs is legacy code from adodb anyway... remove another global 2015-08-02 21:31:55 +01:00
Shish
ec5d9bb6f4 more sensible naming 2015-08-02 21:23:45 +01:00
Shish
6e56224b8d rename final private global 2015-08-02 21:19:22 +01:00
Shish
669fd800d0 move all event stuff together 2015-08-02 20:54:41 +01:00
Shish
3ad8fe4a93 inline add_event_listener to save some layers and loops 2015-08-02 20:43:53 +01:00
Shish
18490ed488 more global removal 2015-08-02 20:39:41 +01:00
Shish
c17250b6b9 there is no more purge unused tags 2015-08-02 19:41:06 +01:00
Shish
e2b6f2c2dd global management 2015-08-02 19:41:06 +01:00
Shish
c6cf4fa339 hiphop is no more, hhvm can handle defines 2015-08-02 19:40:57 +01:00
Shish
90e86b99ae page->set_code() to set HTTP status 2015-08-02 19:40:57 +01:00
Shish
94244d762b include the right jquery in install.php 2015-08-02 19:40:57 +01:00
Shish
0b385d05af wibble init into a separate bootstrap file, for more unit-testability 2015-08-02 19:40:57 +01:00
Shish
f68102b267 also test php7 2015-08-01 18:40:28 +01:00
Shish
4f413e7386 using system php-fpm always gets us php5.3 ~_~ 2015-08-01 17:43:57 +01:00
Shish
21a1b176c6 separate router from index.php 2015-08-01 16:36:07 +01:00
Shish
3d5172e235 stand-alone router mode 2015-08-01 16:23:33 +01:00
Shish
e3cb33efb9 remove single-use var 2015-08-01 16:22:42 +01:00
Shish
aed08d3c12 revert a little 2015-08-01 16:15:36 +01:00
Shish
ab4c558126 php cli server uses its own request thing 2015-08-01 15:24:58 +01:00
Shish
53f19120d2 check for set vars in get_base_href 2015-08-01 14:55:53 +01:00
Shish
ac5f0f611c also install sqlite driver 2015-08-01 14:12:58 +01:00
Shish
cb9cc07d30 add test-info 2015-08-01 14:05:42 +01:00
Shish
9bba2a0f5b update travis too 2015-08-01 13:44:37 +01:00
Shish
35d762bc32 Also update programatic check 2015-08-01 13:42:40 +01:00
Shish
78bbaa04de PHP 5.3 has been EOL for a year now, Postgres 8 too 2015-08-01 13:41:47 +01:00
Shish
e5e7f891e2 scrutinizer suggestions 2015-07-21 01:20:53 +01:00
Shish
9508bec8d3 whyyyyy 2015-07-21 01:00:13 +01:00
Shish
7064e9ffcd merge 2015-07-20 23:49:33 +01:00
Shish
f3c9f57e62 Merge pull request #491 from shish/more_https
More https
2015-07-20 23:28:21 +01:00
Shish
2b6f3b7266 better asserting 2015-07-19 19:04:35 +01:00
Shish
90539a32bc validate_input() function 2015-07-19 14:46:28 +01:00
Shish
06d8c7a879 Merge branch 'develop' of https://github.com/shish/shimmie2 into develop 2015-07-12 22:40:34 +01:00
Shish
feecdd4d13 support for changing usernames 2015-07-12 22:14:57 +01:00
Shish
1907dc29bc cache event log size for 600 seconds, not cache the value '600' forever... 2015-07-12 22:12:37 +01:00
Shish
88fead6ba6 connect to search accelerator for 2-100x speedup on heavy queries 2015-07-12 22:12:05 +01:00
Shish
9f9f2735f4 case-insensitive autocomplete 2015-07-04 12:26:29 +01:00
Shish
cabc600207 show all html headers on the front page, so autocomplete can work 2015-07-04 12:25:23 +01:00
Shish
10e7dd27d4 remove trailing commas from schema definitions in create_table() 2015-07-02 12:38:33 +01:00
Shish
8f7e4bab3c Merge pull request #492 from jgen/develop
Fix issue with "Fit to Width" and other "Fit to .." options not working.
2015-06-02 12:14:25 +01:00
jgen
0ebe510db1 Javascript IIFE (immediately invoked function expressions) need semicolon. 2015-06-01 18:27:00 -07:00
jgen
f73e0e6884 argh 2015-06-01 18:00:46 -07:00
jgen
4bf56364eb Missed one use of $headers. Was used in only one other place. Also, change the function so that if anyone else uses it in the future it doesn't throw warnings. 2015-06-01 17:57:34 -07:00
jgen
6a6480181d Move zoom function inside closure so it isn't potentially knocked out by other functions (with same name) in global scope. 2015-06-01 15:38:04 -07:00
jgen
8a8a26e23a Merge branch 'develop' of git://github.com/shish/shimmie2 into develop 2015-06-01 15:31:27 -07:00
Shish
1aaaeb69fb fix merge 2015-06-01 16:00:03 +01:00
Shish
4ebcf449e2 Merge pull request #488 from jgen/master
Only examine response headers if we actually have them & remove duplicate 'class' attribute.
2015-06-01 15:58:36 +01:00
Shish
4fd3d1a024 argh php 2015-06-01 11:23:04 +01:00
Shish
8d2b97b72f more https support, and dedupe get_image/thumb_link 2015-06-01 11:09:19 +01:00
Shish
21d96db771 remove unused var 2015-06-01 10:50:26 +01:00
jgen
1c43fd9dc4 Remove duplicate 'class' attribute on html element. Fixed tag edit box so that auto complete works again. 2015-06-01 02:39:08 -07:00
jgen
56b9117a20 Merge branch 'master' into develop 2015-05-31 22:43:49 -07:00
jgen
edc9e07919 Only examine the headers if we actually have them. 2015-05-31 21:39:22 -07:00
jgen
718cfa0bcf Scrutinizer-ci has fixed this now. 2015-05-31 21:28:11 -07:00
Shish
2aea79ac35 merge common parts of handle_archive and bulk_add 2015-05-24 16:08:46 +01:00
Shish
9a28f0f51a split vote recounting on user deletion into chunks 2015-05-18 23:40:21 +01:00
Shish
1779f97cac strip RTL from tags 2015-04-26 15:32:04 +01:00
Shish
bb490ac413 stop comment info from concealing comments 2015-04-26 12:54:54 +01:00
Shish
98c1c763aa show when tags/sources were set on the history pages 2015-04-26 12:45:32 +01:00
Shish
9a63322b2f manually merge Daku's get/post q thing, somehow automatic merge failed 2015-04-18 10:45:47 +01:00
Daku
598df41b1d set default in display, not build to avoid errors 2015-04-18 10:42:08 +01:00
Daku
be18140944 added option to hide random link on paginator (only post/list should show now) 2015-04-18 10:41:32 +01:00
Daku
a7de21523f user confirm on mass source set 2015-04-18 10:40:02 +01:00
Daku
83c0c284ac fix first setup block positioning 2015-04-18 10:39:56 +01:00
Daku
05cfbde372 .tables only works with the SQLite3 CLI program
http://www.sqlite.org/faq.html#q7
2015-04-18 10:39:48 +01:00
Daku
b1ec0c434e move tag category css to it's own file 2015-04-18 10:39:42 +01:00
Daku
8c2d8df81d use html5 input types
we would use type='url' for source but non-urls can be used as source too
2015-04-18 10:39:34 +01:00
Daku
7166259cc5 autocomplete='off' for tag input
this disables autocomplete/captilize on "most" mobile keyboards
autocompletejs still works with this off
2015-04-18 10:39:22 +01:00
Daku
845543b2ba fixes #478 - import now uses AddAliasEvent rather than manually adding itself 2015-04-18 10:39:09 +01:00
Daku
6289402f2e make sure aliases.csv is downloaded, and not opened in browser
SEE: http://stackoverflow.com/questions/6468517
2015-04-18 10:38:57 +01:00
Daku
b81d457bf7 DEBUG_SQL isn't defined during install, use quotes to avoid errors 2015-04-18 10:38:39 +01:00
Shish
55c3fd8f38 show PHP version (particularly useful when debugging php vs hhvm) 2015-04-18 10:31:24 +01:00
Shish
926e3ff5c0 turn off auto-select-first-item in autocomplete, apparently power users find it annoying? o.o 2015-04-18 10:31:24 +01:00
Shish
97a0aa7e4c give unread PM count a class, so custom themes can make it red if they wish 2015-04-18 10:31:24 +01:00
Shish
1703cd9caa bump 2015-03-13 09:49:25 +00:00
Shish
f5c4321322 bump 2015-03-13 09:48:54 +00:00
Shish
519749559f Merge pull request #481 from jgen/develop
Fix XSS in arrowkey extension
2015-03-13 08:37:08 +00:00
jgen
adec7e1763 Fix XSS vulnerability. 2015-03-12 23:12:27 -07:00
jgen
3511711008 Should be consistent about using the int_escape method. 2015-03-12 23:12:06 -07:00
Shish
bdbf95f2fa Merge branch 'develop' of https://github.com/shish/shimmie2 into develop 2015-02-08 04:28:03 +00:00
Shish
f92f286fa0 remove all reports from user 2015-02-08 04:27:54 +00:00
Shish
610b144fb2 minor CSS tweak 2015-02-07 22:29:07 +00:00
Shish
1c50616cdb Merge pull request #479 from jgen/develop
Change generated links to be aware of HTTPS.
2015-02-02 08:14:41 -08:00
jgen
8e3fc1da9f Change generated links to be aware of HTTPS. 2015-02-02 00:13:05 -08:00
Shish
d523781481 Merge branch 'develop' of https://github.com/shish/shimmie2 into develop 2015-01-30 03:54:31 +00:00
Shish
52dc36cfa6 str_getcsv rather than explode, for handling quotes 2015-01-30 03:53:58 +00:00
Shish
99be9c2fdb Merge branch 'master' into develop 2015-01-25 23:00:07 +00:00
Shish
09d03d9036 allow dashes and underscores in static files, for apple-touch-icon 2015-01-25 22:58:25 +00:00
Shish
86716082e1 32x32 favicon 2015-01-25 22:57:49 +00:00
Shish
0d2d7eedd7 minor opt-in class to style 2015-01-25 06:55:37 +00:00
Shish
eae385f4c0 bump 2015-01-24 17:11:25 +00:00
Shish
cbbc0bab26 version bump 2015-01-24 17:10:23 +00:00
Shish
8eee2c0c92 logstash logger 2015-01-24 16:57:28 +00:00
Shish
67628816a4 Finally commit ext for purging varnish on-demand 2015-01-24 16:54:18 +00:00
Shish
b47e4aacb1 Merge branch 'develop' of https://github.com/shish/shimmie2 into develop 2015-01-24 16:44:33 +00:00
Shish
edde7848b8 add mp3 to thumbless filetypes, see #454 2015-01-24 16:44:27 +00:00
Shish
67fc50e6c3 Merge pull request #475 from Diftraku/ouroboros_api
Fix duplicate handling
2015-01-24 08:41:06 -08:00
Shish
8dc27c6b97 home page mobile tweaks 2015-01-08 23:31:24 +00:00
Diftraku
3af95b5ebe Fix duplicate handling
Now with 17% less fat:
* Moved validation logic into OuroborosPost for sanity
* Added sanity checks for OuroborosPost values
* Changed defaults to be more sane (mainly tags)
* OuroborosPost now accepts an MD5 hash along the metadata (like it
should!)
* Fixed dupe handling logic
2015-01-05 13:47:53 +02:00
Shish
92bc8b0709 Merge branch 'develop' of https://github.com/shish/shimmie2 into develop 2014-12-31 13:16:24 +00:00
Shish
217559dc22 set statement_timeout for postgres 2014-12-31 13:16:00 +00:00
Shish
1cb0f13820 Merge pull request #471 from ElementAB/develop
Fixed information box link generation
2014-12-29 12:35:33 +00:00
ElementAB
b555fab819 Fixed information box link generation
Fixed issue where the information box would generate an incorrect link for the image source if the source was given as https:// instead of http://.
2014-12-25 01:38:51 -06:00
ElementAB
3d17310581 Fixed information box link generation
Fixed issue where the information box would generate an incorrect link for the image source if the source was given as https:// instead of http://.
2014-12-25 01:36:18 -06:00
ElementAB
9ee2250e63 Fixed information box link generation
Fixed issue where the information box would generate an incorrect link for the image source if the source was given as https:// instead of http://.
2014-12-24 12:34:32 -06:00
Shish
0fcfa49e75 Merge branch 'develop' of https://github.com/shish/shimmie2 into develop 2014-12-18 14:38:37 +00:00
Shish
be4ae9da32 fix missing global (how did this pass tests? o.o) 2014-12-18 14:38:22 +00:00
Shish
caa2691bb9 Merge pull request #468 from jgen/develop
Allow Shimmie to work with older versions of FFmpeg
2014-12-17 13:44:25 +00:00
Shish
7bcf2fc29e Merge pull request #465 from shish/min_space_config
Turn MIN_FREE_SPACE into a userspace config option
2014-12-17 13:41:55 +00:00
Shish
c0279565f4 Merge pull request #462 from shish/bypass_comment_checks
Allow admins to bypass comment checks (rate limit etc)
2014-12-17 13:40:06 +00:00
jgen
d878526487 Button should say "Regenerate Thumbnail" for clarity. 2014-12-14 16:07:00 -08:00
jgen
95b94bd115 Some minor linting. 2014-12-14 16:06:31 -08:00
jgen
433d67453c This fixes issue #466. You can now optionally generate thumbnails for videos with the newer versions of FFmpeg that take into account the aspect ratio. 2014-12-14 15:22:44 -08:00
jgen
5012b15ce9 Comment as to why the default is to ignore the aspect ratio. 2014-12-14 15:20:47 -08:00
jgen
2ff036d250 Remove unused variables. 2014-12-14 15:19:59 -08:00
jgen
02efa180de Add a default option to ignore aspect ratio when creating a thumbnail with FFmpeg. 2014-12-13 16:54:21 -08:00
Shish
e1a7986239 Merge remote-tracking branch 'origin/master' into develop 2014-12-13 01:52:34 +00:00
Shish
b71c96a130 Merge pull request #467 from terokorp/hotfix/ratingsearchfix
Fixing "rating=safe" search bug
2014-12-13 01:51:08 +00:00
Thasan
f2fc69cef4 Fixing "rating=safe" search bug 2014-12-13 03:23:44 +02:00
Shish
40734ef711 turn MIN_FREE_SPACE into a userspace config option 2014-12-07 13:54:47 +00:00
Shish
9abcadffb6 throw Ex() -> throw new Ex(); 2014-12-07 13:20:36 +00:00
Shish
316f7ff858 Give a better error if User::class has been screwed up somehow 2014-12-07 03:44:17 +00:00
Shish
88f1df9ca6 HIPHOP is no longer supported (it's HHVM now, and HHVM supports PDO params anyway) 2014-12-07 01:10:12 +00:00
Shish
5d099c06f9 remove references to unused cache values 2014-12-06 23:51:58 +00:00
Shish
5ab8f9e5e2 log sets and deletes in CACHE_DEBUG mode 2014-12-06 23:50:56 +00:00
Shish
4d6e6ade1c version bump 2014-12-06 23:48:03 +00:00
Shish
b3931dd403 version bump 2014-12-06 23:47:17 +00:00
Shish
1bf3fba756 Merge branch 'develop' 2014-12-06 23:46:14 +00:00
Shish
8c1eb60367 Remove twitter_soc; any twitter ext will need to be different, fixes #395 2014-12-01 14:16:53 +00:00
Shish
a3880e2b49 Merge pull request #463 from shish/user_list_link
add a link to the user list, fixes #460
2014-12-01 14:04:04 +00:00
Shish
fcb7166b0c Merge pull request #461 from shish/dbtime
Log time spent in database (and some other minor performance debugging tweaks)
2014-12-01 14:03:28 +00:00
Shish
7f22f99aaa add a link to the user list, fixes #460 2014-11-30 15:42:43 +00:00
Shish
8511399076 bypass ban_words too 2014-11-30 13:52:29 +00:00
Shish
010b0620df add a user flag for bypassing comment checks 2014-11-30 13:52:29 +00:00
Shish
e4be2c24c6 update lib/context.php 2014-11-30 12:49:08 +00:00
Shish
c0dfd9adc0 a little extra consistency in cache variable names 2014-11-26 13:09:49 +00:00
Shish
4721d666cd log time spent waiting for database queries 2014-11-26 13:09:22 +00:00
Shish
1c60942730 log hit/miss when DEBUG_CACHE is on 2014-11-26 13:07:30 +00:00
Shish
dfba656355 die more explicitly when memcache is missing (PHP is terrible) 2014-11-24 02:21:45 +00:00
Shish
a846c16bd7 Merge pull request #457 from shish/show_bad_word_bans
Show when a banned regex is invalid
2014-11-10 23:57:17 +00:00
Shish
565b466721 Merge pull request #450 from DakuTree/patch-zipcheck
Hide "Download All Images" if ZipArchive doesn't exist/not enabled - Fixes #441
2014-10-15 18:33:30 +01:00
Shish
824d078ece Show when a banned regex is invalid 2014-10-15 18:31:06 +01:00
Shish
63a619d295 Merge branch 'develop' of https://github.com/shish/shimmie2 into develop 2014-10-10 22:20:29 +01:00
Shish
ccfc22aa8b make block placement more explicit 2014-10-10 22:19:54 +01:00
Shish
a066c5ac0e regex for word filtering 2014-10-10 22:19:20 +01:00
Shish
8c7257eb54 Merge pull request #452 from DakuTree/patch-fix451
Fix "Image Only" not working with nice_urls disabled - Fixes #451
2014-09-04 22:05:39 +01:00
Daku
693b18f50c fix "Image Only" not working with nice_urls disabled 2014-09-02 17:06:39 +01:00
Daku
1cb59572f9 Merge pull request #445 from shish/bbcode_anchor
[anchor] bbcode tag, to make linking to parts of a page easier
2014-08-30 13:37:01 +01:00
Shish
c651845401 make anchors visible in the page, not just in the markup 2014-08-30 13:18:14 +01:00
Daku
ab3366e518 Hide "Download All Images" if ZipArchive doesn't exist/not enabled 2014-08-26 16:16:15 +01:00
Daku
9719464c8b Merge pull request #448 from shish/theme_breakdown
Make IndexTheme a little easier to customise
2014-08-26 15:51:41 +01:00
Daku
0744b50a71 Merge pull request #446 from shish/simplify_uceu
simplify user_can_edit_user -- many nested if/else's to one if
2014-08-26 15:19:27 +01:00
Daku
5efe1ddb36 Merge pull request #444 from shish/check_handler_exists
Check handler exists
2014-08-26 13:47:32 +01:00
Shish
fc4bd27529 simplify user_can_edit_user -- many nested if/else's to one if 2014-08-24 20:43:12 +01:00
Shish
9c71f59061 [anchor] bbcode tag, to make linking to parts of a page easier 2014-08-24 16:55:00 +01:00
Shish
50d40c1c81 give IndexTheme:display_page some sub-functions to make them easier to customise 2014-08-24 16:29:32 +01:00
Shish
f873d2304d Check event handler exists before calling it, in case the cache is out of date. Fixes #442 2014-08-24 11:33:05 +01:00
Shish
d6eb3892e2 Merge pull request #435 from geosohh/master
Fixes for mass_tagger extension
2014-08-02 17:48:21 +01:00
Shish
b1d634a8de Merge pull request #434 from DakuTree/patch-tagfix
Fix for tags exceeding char limit returning error + Bumped tag char limit to 255.
2014-08-02 17:47:14 +01:00
Geosohh
3185af3280 Remove tags from images using mass_tagger
Using negative tags removes them from the selected images.
2014-07-29 19:11:29 -03:00
Geosohh
3d2c55a9d5 Fixed mass_tagger bug when selecting images with similar ids
The mass_tagger extension behaves incorrectly if the id of an image is
the same as the ending of the id of another image.

Example:
Select image 143: var string == "143:"
Select image 113: var string == "143:113:"
Select image 43: var string == "1113:"
So either the wrong image will be tagged, or it will cause an error if
that image doesn't exist.
2014-07-29 18:02:50 -03:00
Daku
14f682da75 avoid errors if tag exceeds limit + flash message showing the problem tag 2014-06-20 00:39:29 +01:00
Daku
b89dd52b47 bumped the tag char limit to 255
there wasn't really much reason to have this so low, and this puts it to the same limit as other booru software
2014-06-19 23:14:11 +01:00
Shish
9069b0c1fb Merge pull request #429 from DakuTree/patch-misc
Pool updates + other misc tweaks.
2014-06-09 21:05:19 +01:00
Shish
d067545969 Merge pull request #432 from DakuTree/patch-sqlfix
Fix for #431 - Fix negative tags not working if they don't exist.
2014-06-09 20:59:11 +01:00
Matthew Barbour
d9d4137735 Merge pull request #2 from DakuTree/patch-sqlfix
fixes negative tags not working if they don't exist
2014-06-09 12:55:15 -05:00
Matthew Barbour
92f3ba480a Merge pull request #1 from shish/develop
Develop
2014-06-09 12:52:50 -05:00
Shish
196e4d5300 Merge pull request #433 from muhkuh2005/master
Added check to initialize tags, when only categorized tags are available...
2014-06-09 16:32:34 +01:00
Pascal 'muhkuh2005' Borkenhagen
3468480864 Added check to initialize tags, when only categorized tags are available for image 2014-06-09 14:07:24 +00:00
Daku
5bd7369d7c Merge pull request #427 from shish/bcrypt
Use bcrypt for password storage
2014-06-05 18:00:19 +01:00
Daku
72fbafc271 fixes negative tags not working if they don't exist
fixes #431
2014-06-04 00:52:01 +01:00
Daku
24f2741a50 rating_to_name no longer exists
was removed in commit eadf1d9e87419a3f570cc9e7e77082358a9af0db
2014-06-01 21:56:33 +01:00
Daku
90232b0a4c rename "index" to "pool index" to help differentiate between the two index links 2014-05-31 18:20:57 +01:00
Daku
183a2c7ae6 docs + added pool:lastcreated metatag which uses the ID of the last pool created by the user 2014-05-30 16:04:12 +01:00
Daku
df6b9245ec optional setting to set pool order with the pool metatag
example: pool:10:3 (pool #10 with order 3)
2014-05-30 15:21:42 +01:00
Daku
77769d2c17 allow setting of image_order via add_post() 2014-05-30 15:21:32 +01:00
Daku
bca4fdffa5 make sure pool nav & manage pool show when needed 2014-05-30 14:41:03 +01:00
Daku
6a14360e7a option to use autoincrementing pool order when post is added
rather than having everything default to 0 order
2014-05-30 13:12:34 +01:00
Daku
1dc668ca41 main.php shouldn't be generating HTML.. 2014-05-30 11:55:53 +01:00
Daku
f228a8eb4f pools css should be in it's own folder, not the themes 2014-05-30 00:23:12 +01:00
Daku
1dada97adc prev link for pools 2014-05-30 00:22:04 +01:00
Daku
77607e0c02 keep aspect ratio when created video thumbnail 2014-05-29 18:40:17 +01:00
Daku
aa0cf27e7e add theme name to cached css/js filename to avoid loading cached files of old theme after theme change 2014-05-29 18:37:49 +01:00
Shish
e259b8cd5a bcrypt had bugs before 5.3.7 2014-05-24 10:51:09 +01:00
Shish
a3f9e12ea0 octal for permissions 2014-05-24 10:18:44 +01:00
Shish
1b655704f3 Merge remote branch 'yaoifox/patch-1' into develop 2014-05-24 10:18:10 +01:00
Shish
d5c5cfd428 Merge pull request #426 from DakuTree/patch-notesfix
Fix for #422 + Fix Note Positioning
2014-05-24 10:12:58 +01:00
Shish
eb51a9b639 migrate to bcrypt for password storage 2014-05-24 09:47:42 +01:00
Daku
36713803e3 Merge pull request #418 from jgen/develop
Even more linting and cleaning!
2014-05-23 23:24:32 +01:00
Daku
ae0a4725a0 avoid loading imgnotes until image is fully loaded 2014-05-23 21:46:13 +01:00
Daku
3d11df44a9 fix various bugs with notes ext 2014-05-23 20:48:11 +01:00
Shish
8d75968ab0 Merge pull request #425 from DakuTree/patch-headerfix
Fix for #423 - Check for lowercase header if camelcase header doesn't exist
2014-05-20 07:48:12 +01:00
Daku
64e2565236 check for lowercase header if camelcase header doesn't exist
fixes #423
2014-05-19 07:32:16 +01:00
YaoiFox
349d7bfa4d curl --silent now
curl --silent now
2014-05-07 07:10:23 +02:00
YaoiFox
f5f48d8a0b Update main.php 2014-05-07 05:38:12 +02:00
YaoiFox
5f0642f349 some bug fixes to cron uploader 2014-05-07 05:30:44 +02:00
jgen
a58bdbdc62 More PHP Doc comments. 2014-04-29 17:45:13 -04:00
jgen
2bf4c667a7 Some more comments. 2014-04-29 01:51:13 -04:00
jgen
317028a63b More PHP Doc comments. 2014-04-29 01:33:03 -04:00
jgen
3b1513f791 Adding some more PHP Doc comments. 2014-04-28 20:37:31 -04:00
jgen
c682ccef69 Adding more PHP Doc comments to the config classes. 2014-04-28 20:12:31 -04:00
jgen
eb18790dc9 More comments. 2014-04-28 19:50:01 -04:00
jgen
b3f9925839 PHPDoc all the things! 2014-04-28 18:22:57 -04:00
jgen
2a9f76d2f0 More comments, removing dead code, fixing small bugs. 2014-04-28 17:36:52 -04:00
jgen
86612bb1ff Adding more PHP Doc comments. 2014-04-28 17:36:11 -04:00
jgen
eadf1d9e87 Remove dead code. 2014-04-28 17:18:51 -04:00
jgen
9f838c0c11 Clean all the things. 2014-04-28 03:32:43 -04:00
jgen
b56e390676 Lots of linting again. 2014-04-28 03:26:35 -04:00
jgen
158819cb28 Linting: These actually were bugs. 2014-04-28 03:16:09 -04:00
jgen
d4ac6ca451 Such linting, such wow. Much clean. 2014-04-28 02:56:58 -04:00
jgen
8fd532e5a8 More linting and removing dead code. 2014-04-28 02:43:49 -04:00
jgen
3cd8c33ed1 Convert Spaces -> Tabs 2014-04-28 02:24:19 -04:00
jgen
e37c5cb9d0 More linting! 2014-04-28 02:23:45 -04:00
jgen
022c162f40 More linting and fixing of comments and PHP Doc, types, etc. 2014-04-28 01:26:22 -04:00
jgen
a0a39784d4 Make webm videos auto-loop by default. 2014-04-28 00:57:49 -04:00
jgen
76fd27f87c Fixing/Cleaning more PHP Doc related issues. 2014-04-28 00:56:19 -04:00
jgen
8a2eb4b121 Fixing more PHP Doc related issues. 2014-04-27 19:29:36 -04:00
jgen
03b3cdcbd2 Updating/Fixing/Adding more comments with the PHP Doc style. 2014-04-27 18:59:01 -04:00
Jeff Genovy
07cd38d34c Merge pull request #415 from jgen/master
Bump the version number.
2014-04-27 15:46:35 -04:00
jgen
a703bb9854 Bump the version number. 2014-04-27 15:45:22 -04:00
jgen
4f51e942be Updating/Fixing/Adding more comments with the PHP Doc style. 2014-04-27 15:33:57 -04:00
jgen
024e7eac8d Fix underling. 2014-04-26 17:52:31 -04:00
jgen
b707081b33 Cleaning up the README. 2014-04-26 17:47:14 -04:00
jgen
c37ba07de0 Convert the README.txt file into Markdown format. 2014-04-26 17:43:13 -04:00
jgen
b1d123c960 Add more escaping to the shell command for ffmpeg. 2014-04-26 17:09:18 -04:00
jgen
26e8db1fdc Add the Travis-CI build status icon image to the Readme. ;) 2014-04-26 17:01:01 -04:00
jgen
2e4b53c3f4 Merge branch 'code_removal' of github.com:jgen/shimmie2 into develop 2014-04-26 16:55:11 -04:00
jgen
1ecf33e39d Merge branch 'video_thumb' of git://github.com/shish/shimmie2 into develop 2014-04-26 16:54:28 -04:00
jgen
86b6d12819 Merge branch 'linting' of github.com:jgen/shimmie2 into code_removal 2014-04-26 16:50:14 -04:00
Shish
e9d8ae7f5b Merge pull request #413 from jgen/linting
Lots o' Linting
2014-04-26 12:00:35 +01:00
jgen
95ba85ee43 This js file relies on functions defined in 'shimmie.js' which is all globed together when rendering a page. Adding an ignore line to scrutinizer to prevent false-positives. 2014-04-26 05:32:15 -04:00
jgen
4e9e5ca2be Fixing/adding/cleaning up the PHP Doc comments. 2014-04-26 05:01:49 -04:00
jgen
a8dd045586 Combine these if statements into one to reduce the cyclomatic complexity. 2014-04-26 03:56:06 -04:00
jgen
42407116a8 Removing this file. 2014-04-26 03:33:20 -04:00
jgen
013222e4ee Code Removal: PHP has had JSON support directly baked into the language since 5.2.0 - there is no need to rely on an external library from 2006 for json support. 2014-04-26 03:31:02 -04:00
jgen
efb5038b20 This file no longer exists. 2014-04-26 03:15:44 -04:00
jgen
298344048c Make these functions public to prevent scrutinizer from complaining. 2014-04-26 00:27:16 -04:00
jgen
e6b1d514d1 Some more type hinting via the comments. 2014-04-25 23:22:34 -04:00
jgen
24371d8c34 Fix the PHP Doc comments. 2014-04-25 23:19:18 -04:00
jgen
1ca3865a1c Removing the closing PHP "?>" tag as per style guidelines. (Also see: https://stackoverflow.com/questions/4410704/why-would-one-omit-the-close-tag ) 2014-04-25 22:54:51 -04:00
jgen
8f60467848 This code doesn't seem to actually be used by anything at all. 2014-04-25 22:33:57 -04:00
jgen
5f2be45f68 Fix the PHPDoc comments on these. 2014-04-25 21:42:52 -04:00
jgen
3e899710d7 Stop scrutinizer from complaining here. 2014-04-25 17:40:42 -04:00
jgen
c85630198f These variables where never defined depending on the execution path. 2014-04-25 17:40:14 -04:00
jgen
6f685ca227 Use the method from core/util to parse the bool from the DB instead. 2014-04-25 17:39:46 -04:00
jgen
3a1197256a Need to pull in the global $page variable for this method. 2014-04-25 17:39:06 -04:00
jgen
1e15c5e47a Explicitly declare this class variable 2014-04-25 17:38:25 -04:00
jgen
bcd3f991de Removing the closing PHP "?>" tag as per style guidelines. 2014-04-25 17:34:20 -04:00
jgen
b4e6c0b743 Explicitly check if we can actually find the image by Id. 2014-04-25 16:08:00 -04:00
jgen
5b5fd955b7 New exception type. 2014-04-25 16:07:30 -04:00
jgen
9acf6c7f19 Rename these class functions to prevent warnings from scrutinizer. 2014-04-25 15:57:23 -04:00
jgen
141ec53236 Rename these class functions to prevent warnings from scrutinizer. 2014-04-25 15:55:31 -04:00
jgen
478eb3a4cc Linting: Check for null return value, and throw an exception if null. 2014-04-25 15:39:00 -04:00
jgen
7ef68b15f9 Fix indentation. 2014-04-25 15:38:15 -04:00
jgen
6724f2b75a Make these functions public to prevent scrutinizer from complaining. 2014-04-25 14:17:44 -04:00
jgen
dcadfc395a Move this code back down. 2014-04-25 14:14:22 -04:00
jgen
a7faefc5e0 Spelling. 2014-04-24 22:35:01 -04:00
jgen
b241390fa4 Removing the closing PHP "?>" tag as per style guidelines. 2014-04-24 22:34:45 -04:00
jgen
50686ac61e More linting, fix PHPDoc style. 2014-04-24 22:29:29 -04:00
jgen
daee99c1bc Removing the closing PHP "?>" tag as per style guidelines. 2014-04-24 22:28:53 -04:00
jgen
860af25550 Need to pull in the global $user variable. 2014-04-24 22:22:45 -04:00
jgen
4ec5a7ce52 Removing the closing PHP "?>" tag as per style guidelines. 2014-04-24 22:22:16 -04:00
jgen
780d5f8709 More linting. Explicitly declare these class variables, as well as comment out dead code. 2014-04-24 22:13:00 -04:00
jgen
6e4ae229ef Explicitly declare this class variable 2014-04-24 19:13:41 -04:00
jgen
b3077d5bcd Removing the closing PHP "?>" tag as per style guidelines. 2014-04-24 19:13:20 -04:00
jgen
2706f72ce4 Update and fix the PHPDoc comments. 2014-04-24 19:08:23 -04:00
jgen
4cc31df737 Update the comments to PHPDoc style guidelines. 2014-04-24 19:02:43 -04:00
jgen
ab3f9850e4 Removing the closing PHP "?>" tag as per style guidelines. 2014-04-24 19:01:47 -04:00
jgen
286e75bef0 Scrutinizer complains that these functions aren't defined, yet they really are. 2014-04-24 18:45:54 -04:00
jgen
709366b70c Explicitly declare these class variables. 2014-04-24 18:44:46 -04:00
jgen
7b90331f02 Add missing semi-colon. 2014-04-24 16:56:04 -04:00
jgen
993aacaea5 Update comment to reflect that a bug has been filed with PHP-analyzer. 2014-04-24 16:55:34 -04:00
jgen
c4dcba1e91 Explicitly check for the existence of these properties before attempting to use them. 2014-04-24 05:37:26 -04:00
jgen
7e41194b7f Shish you are too clever for scrutinizer-ci. 2014-04-24 05:29:02 -04:00
jgen
ce524e8729 This variable does exist, it is actually pulled from the database. Making it explicit for the linter. 2014-04-24 05:25:12 -04:00
jgen
e2f5c7a6ec Check for null, just in case. 2014-04-24 05:09:38 -04:00
jgen
0501e05cff Comment out dead code/vars. 2014-04-24 05:09:16 -04:00
jgen
332c8538b7 Change the function syntax to quiet JSHint. 2014-04-24 04:46:23 -04:00
jgen
868f8c9225 Commenting out dead variables and dead code. 2014-04-24 04:44:28 -04:00
jgen
f9c8a1720e Comment out dead variables. 2014-04-24 04:41:13 -04:00
jgen
f67220f64b From stack-overflow: The 'var' keyword is for declaring class variables in PHP4. It works in PHP5 but can raise an E_STRICT warning in from version 5.0.0 up to version 5.1.2, as it has been deprecated.
Changing to public as that is really what these variables are anyways.
2014-04-24 04:36:05 -04:00
jgen
67c087c30f From stack-overflow: The 'var' keyword is for declaring class variables in PHP4. It works in PHP5 but can raise an E_STRICT warning in from version 5.0.0 up to version 5.1.2, as it has been deprecated.
Changing to public as that is really what these variables are anyways.
2014-04-24 04:30:58 -04:00
jgen
dbe30ad37d Rename variable to make it more clear. 2014-04-24 01:36:30 -04:00
jgen
afc01fda5f Prevent scrutinizer-ci from complaining about these fall-thoughs. 2014-04-24 01:36:04 -04:00
jgen
506e699f8a Not sure if we really need the triple equals. 2014-04-24 01:15:30 -04:00
jgen
866d39a68e The 'tags' box actually has a different ID. 2014-04-24 01:15:03 -04:00
jgen
51c145d5c9 Some more linting on the bookmarklet.js file. 2014-04-24 01:08:47 -04:00
jgen
4b90faf89d Even more linting of JS files. 2014-04-24 00:55:14 -04:00
jgen
a105090039 Some more JS linting. 2014-04-23 23:39:09 -04:00
jgen
887f963e17 Add the jshint comment to alter how scrutinzer-ci deals with the js. 2014-04-23 23:38:53 -04:00
jgen
31501e48fe More JS linting. 2014-04-23 23:31:20 -04:00
jgen
2dc6e054c8 These sorts are necessary on the header arrays, otherwise the relative priority of certain headers is not respected. 2014-04-23 23:28:05 -04:00
jgen
b775c007cd Give these HTML headers some slight priority over the default value of 50. 2014-04-23 23:07:10 -04:00
jgen
a0ab3864c0 Push the headers for the chatbox even further down to make sure that jQuery is already loaded. 2014-04-23 23:01:51 -04:00
jgen
8cdf919827 More linting. This time of the JavaScript for the chat-box extension. 2014-04-23 22:43:42 -04:00
jgen
0bd031a269 Merge branch 'develop' of github.com:jgen/shimmie2 into linting
Manually resolved conflicts:
	ext/chatbox/js/yshout.js
2014-04-23 22:42:30 -04:00
jgen
5eaa637bbb Merge branch 'develop' of git://github.com/shish/shimmie2 into develop 2014-04-23 22:23:53 -04:00
Shish
44d0e56c97 Merge pull request #406 from jgen/video_thumb
Video thumbnails
2014-04-20 11:25:24 +01:00
Shish
ef3daaf388 Merge pull request #411 from jgen/develop
Chatbox is broken on develop branch
2014-04-20 11:21:43 +01:00
jgen
21e1359b86 Avoid short open tag for PHP. 2014-04-20 05:07:26 -04:00
jgen
60980c8839 One more jQuery reference. 2014-04-20 05:04:45 -04:00
jgen
a7ba0f887b Again, the chatbox needs help from the jQuery migrate plugin. 2014-04-20 05:00:59 -04:00
jgen
2df54b911a Don't use short open tags for PHP as they are not turned on by default in production environments. 2014-04-20 05:00:34 -04:00
jgen
e2516fa5cf Chatbox should be fixed now.
The chatbox extension actually needs some functionality that was removed from jQuery versions 1.9 and up. When Shimmie's version of jQuery was bumped up to 1.11 this actually broke the chatbox.
2014-04-20 04:51:19 -04:00
jgen
880840623a Need to ensure that this html header is added last. 2014-04-20 04:36:25 -04:00
jgen
717401ccab Removing this as jQuery is already included in Shimmie now. 2014-04-20 04:35:33 -04:00
jgen
8b698e1b6f Revert this commit. 2014-04-20 04:29:11 -04:00
jgen
54362a49c6 Fix the broken chatbox issue. 2014-04-20 04:25:08 -04:00
jgen
57a390eaab Massive linting! 2014-04-19 23:38:42 -04:00
jgen
ff722906b7 Holy shit, this is really really nasty old JS code. I would love to dump this if possible. 2014-04-19 23:06:48 -04:00
Shish
dc6653d3be Merge pull request #407 from jgen/hotfix/downtime_theme_edits
Hotfix/downtime theme edits
2014-04-20 00:30:57 +01:00
Shish
75c3d8e453 Merge pull request #409 from jgen/linting
Linting
2014-04-20 00:29:53 +01:00
jgen
e838fc2a03 Comment this in case someone else wonders why its there. 2014-04-19 04:17:58 -04:00
jgen
c527ae91d6 More linting and cleanup. 2014-04-19 04:17:28 -04:00
jgen
be385deaab Clean up this js file as well. 2014-04-19 02:58:36 -04:00
jgen
28d83fda0d Even more linting and cleaning. 2014-04-19 02:33:34 -04:00
jgen
2da8c19a07 More linting! 2014-04-19 01:36:18 -04:00
jgen
bdf49b33cb Some more linting thanks to scrutinizer-ci 2014-04-19 01:18:49 -04:00
jgen
505a3e5233 Merge branch 'develop' of git://github.com/shish/shimmie2 into hotfix/downtime_theme_edits 2014-04-18 20:25:36 -04:00
jgen
71d7474476 Add <section> tags to the downtime page so that theme render correctly. 2014-04-18 20:21:50 -04:00
jgen
7fd655fc4e Added conditional message for IE users to download plugin from Google for webm. 2014-04-18 18:47:14 -04:00
jgen
b5d005710c Fix indentation (spaces -> tabs) 2014-04-18 02:10:10 -04:00
jgen
2f380f5d59 Video thumbs are working for webm files now. 2014-04-18 02:06:12 -04:00
jgen
273d386d22 Working on thumbnail support for video files. 2014-04-18 01:37:27 -04:00
Shish
b360914db7 Merge pull request #402 from justinbrewer/cloud-patch
Tag Edit Cloud patch
2014-04-12 11:08:00 +01:00
Shish
98b6d0a6ff Merge pull request #403 from jgen/gitignore
Update the gitignore file to exclude operating system detritus and such.
2014-04-12 10:50:27 +01:00
jgen
4deb7e1775 Update the gitignore file to exclude operating system detritus and such. 2014-04-12 03:25:18 -04:00
Justin Brewer
f243092634 count("") == 1 2014-04-11 23:55:30 -04:00
Shish
6c9a4a3b86 A start on video thumbnailing; see #400
Almost certainly not working yet; not tested, just committing so that
other people have something to work with and we aren't duplicating
effort
2014-04-10 08:15:00 +01:00
Jeff Genovy
3a0da5df5a Merge pull request #399 from Diftraku/ouroboros_api
Special chars in tags barf filter_var
2014-04-09 22:33:05 -04:00
Diftraku
7ac61f4234 Special chars in tags barf filter_var
Due to how FILTER_SANITIZE_STRING works, if you had special chars in
your tags (eg. <3 or !) the string would be cut before the offending
character(s) and in worst case, result in no tags passing to the API
2014-04-10 04:11:43 +03:00
Shish
d247713311 Merge pull request #397 from jgen/develop
Manual Merge of More Linting #391
2014-04-10 00:15:02 +01:00
jgen
3c6b8b6fe6 Merge branch 'linting' of git://github.com/shish/shimmie2 into develop
Conflicts:
	ext/resize/main.php
2014-04-09 15:04:18 -04:00
Shish
f72bfbb050 fix indentation 2014-04-06 20:47:01 +01:00
Daku
f88ba20319 Merge pull request #393 from shish/resize_tweak
pass already fetched image object into resize()
2014-04-04 17:38:08 +01:00
Daku
2d25d43ecf Merge pull request #389 from HungryFeline/patch-1
Redirect to default page if referer isn't set
2014-04-04 17:30:19 +01:00
Shish
a0d1948a4f pass already fetched image object into resize(), rather than passing the ID to be re-fetched 2014-04-02 08:49:13 +01:00
Shish
745f91e939 Merge pull request #392 from jgen/develop
Resizing images actually was broken, how nobody noticed I don't know.
2014-04-02 08:39:11 +01:00
jgen
1e49cc9122 More comments and fix undefined variables. 2014-04-01 22:02:36 -04:00
jgen
9b1c3db400 Slight re-word of the exception error message. 2014-04-01 21:43:12 -04:00
jgen
18b8e7912f Fix warning generated when an image doesn't have bits or channel info (and use sane defaults). 2014-04-01 21:42:40 -04:00
jgen
225d197790 Remove duplicate code. 2014-04-01 21:41:57 -04:00
jgen
749f846b79 Fix typo. 2014-04-01 20:33:36 -04:00
jgen
a442fbe409 Resizing images actually was broken, how nobody noticed I don't know. 2014-04-01 19:29:31 -04:00
jgen
737f96b8bb Merge remote-tracking branch 'shish/master' 2014-04-01 17:27:08 -04:00
Shish
c8aa3327a1 A bunch of small changes from scrutinizer-ci; some tidying, some actual bug fixes 2014-03-30 13:26:48 +01:00
Shish
db5aa56300 remove a bunch of dead code 2014-03-29 11:44:34 +00:00
HungryFeline
c215d6991a Redirect to default page if referer isn't set
Instead of displaying `You should be redirected to <a href=""></a>`
2014-03-27 09:57:43 +01:00
Shish
7a95325a5f Merge pull request #388 from DakuTree/patch
Fixes issues 233 & 234.
2014-03-26 10:41:31 +00:00
Daku
7837362711 make sure source is still used if provided 2014-03-26 08:26:21 +00:00
Daku
994652c3f7 make sure mass_tag_edit reads high > low id if default order is different 2014-03-26 08:05:05 +00:00
Daku
37b21e7fcb Merge pull request #387 from shish/linting
Use new-style constructors everywhere
2014-03-26 04:04:47 +00:00
Shish
7b68d8ebfd use new-style constructors everywhere 2014-03-22 09:00:59 +00:00
Daku
61764e7f9d Merge pull request #386 from shish/linting
A few fixes for things scrutinizer-ci found
2014-03-18 01:34:52 +00:00
Shish
da29912646 tidy up a bunch of lint errors 2014-03-17 22:05:37 +00:00
Shish
6f0d898c28 Merge pull request #385 from justinbrewer/scrutinizer-config
Scrutinizer-CI
2014-03-16 09:10:42 +00:00
Justin Brewer
6ad530fd49 Scrutinizer config file 2014-03-14 13:10:12 -05:00
Daku
76526f371c Add option to use transloaded URL as source
fixes #234
2014-03-14 16:54:14 +00:00
Daku
5f3ff8db86 don't add "tagme" when trying to mass-edit to null
fixes #233
2014-03-13 23:29:47 +00:00
Shish
208e8de7f0 Merge pull request #382 from DakuTree/patch
New metatags, fixes various PostgreSQL errors & misc tweaks.
2014-03-08 15:33:58 +00:00
Daku
4351dc53c5 make sure all existing exts are converted to lowercase 2014-03-08 15:27:39 +00:00
Daku
258fda188e use different selector rather than hardcoding url 2014-03-08 15:20:50 +00:00
Shish
cf7f79194e Merge branch 'master' into develop 2014-03-07 08:28:03 +00:00
Shish
fa5ad5b77d bump the minimum PHP version, the README was updated but not the version check in the code. Fixes #383 2014-03-07 08:27:34 +00:00
Shish
faec25226a 'x ?: y' is a new PHP thing? 2014-03-06 09:14:03 +00:00
Daku
ddb6d32e29 fix fourm errors under postgresql 2014-03-02 21:59:19 +00:00
Daku
87065d08f6 use elseif 2014-03-02 21:58:45 +00:00
Daku
524ead8344 PostgreSQL doesn't return trimmed results for CHAR columns, so use VARCHAR instead 2014-03-02 21:07:25 +00:00
Daku
a863072bfb DATETIME > SCORE_DATETIME
fixes #354
2014-03-02 18:50:46 +00:00
Daku
53a7e23b64 various autocomplete tweaks
* made limit for /api/internal/tag_list/complete optional (as this breaks the autocomplete on dbs with lots of tags)
* removed delay + minChars = 1 again (due to above change)
* first autocomplete tag is selected by default
* tab now works as a select button
* autocompleted tags will now be followed by a space (so the next tag can be instantly autocompleted)
2014-02-28 02:03:41 +00:00
Daku
e78ddc69f3 fix strict standard errors 2014-02-25 21:51:52 +00:00
Daku
34e90c1cfc updated date/links in footer 2014-02-25 17:56:51 +00:00
Shish
63a71c239c Merge pull request #381 from jgen/master
Automated Tests via Travis-CI
2014-02-25 00:17:02 +00:00
Daku
df29537e74 use default minchars again
the tag list only returns a max of 10 results, and is only called once per autocomplete, making it harder to autocomplete longer tags
2014-02-24 20:07:05 +00:00
Daku
d675827173 order[=|:]random_#### metatag
possible replacement for random_list ext?
2014-02-24 19:54:15 +00:00
Daku
320a92289b have query use EXISTS rather than IN
preferably we would have a table with image tag counts, but this works for now
2014-02-24 01:50:31 +00:00
Daku
790cb0d7a9 [.+]tags metatag for tag_categories
This is nowhere as near as fast as I'd like. Need to find a better query.
2014-02-24 01:40:35 +00:00
Daku
58c5746e9b speed: use isset rather than identical 2014-02-23 22:32:15 +00:00
Daku
bdb3255116 speed: lowercase ext on image insert
avoids having to lowercase every build_thumb_html call
most extensions tend to match against their lowercase versions anyway
2014-02-23 22:27:52 +00:00
jgen
cebc197fba Merge branch 'develop' of git://github.com/shish/shimmie2 2014-02-23 03:11:09 -05:00
jgen
55603a0acb Yay, the Travis tests are working now! Let's increase the number of PHP versions to test with. 2014-02-23 03:07:19 -05:00
jgen
6f59de4d45 Prevent an internal server error occurring when mincount is less than 1. 2014-02-23 02:51:33 -05:00
jgen
2b4ffb1e60 Argh. 2014-02-23 02:18:45 -05:00
jgen
38b494125c Postgres requires you to include the GROUP BY column in the SELECT columns. Should be okay since we don't care about other columns though. 2014-02-23 02:15:19 -05:00
jgen
e2fa6d316e Realpath isn't used anymore. 2014-02-22 23:36:08 -05:00
jgen
cf35bf82a8 Postgres doesn't support the DATETIME field. 2014-02-22 23:30:58 -05:00
jgen
e30520a5ef Fixing typo. 2014-02-22 23:23:23 -05:00
jgen
9892d1f7fd PostgreSQL does not support INDEX() inside the CREATE TABLE method. You must create the index as a separate query. Fortunately MySQL also support this way of doing things as well. 2014-02-22 23:02:11 -05:00
jgen
5effee4812 Remove these indexes as we are creating them manually. 2014-02-22 22:13:26 -05:00
jgen
72ea1acf1d Forgot to remove the comma 2014-02-22 22:06:33 -05:00
jgen
1c6b306ac6 Fixing the installer to work with Postgres. 2014-02-22 22:04:14 -05:00
jgen
668de39626 Remove the debugging. 2014-02-22 19:45:53 -05:00
jgen
6da5f27447 Make sure we install the php5 postgres drivers. 2014-02-22 19:44:50 -05:00
jgen
8bbaf85114 Need to figure out why the Post data differs from what is specified on the command line. 2014-02-22 19:10:18 -05:00
jgen
aca6caa91a More debugging. 2014-02-22 18:52:23 -05:00
jgen
13e844a2f7 Output the DSN. 2014-02-22 18:32:42 -05:00
jgen
c5b265b177 No need to drop the database as the VM is reset every time. 2014-02-22 16:42:12 -05:00
jgen
532557bdc8 Output the DATABASE_DSN when a PDO exception occurs during install. 2014-02-22 16:37:55 -05:00
jgen
ce21fcd17c Enable logging of all PostgreSQL queries. 2014-02-22 16:32:14 -05:00
jgen
8ade958dd1 Working on getting PostgreSQL to work on Travis. 2014-02-22 16:04:04 -05:00
jgen
affb44c153 Enable TravisCI for Postgres. 2014-02-22 15:51:17 -05:00
jgen
7eb2bd9112 Trimming trailing blank space. 2014-02-22 15:42:09 -05:00
jgen
3d1217a1be Trim trailing blank space. 2014-02-22 15:36:52 -05:00
jgen
96358f0bc0 Nevermind, it doesn't work. 2014-02-22 15:33:55 -05:00
jgen
2d0edde2b2 We can check that admin users see the "Add" button though. 2014-02-22 15:25:25 -05:00
jgen
d6f0213a9f Commenting out the alias tests due to consistent failing on TravisCI. 2014-02-22 15:19:06 -05:00
jgen
6efe56eddf Well, lets try this. 2014-02-22 03:10:59 -05:00
jgen
b229e114c2 Dump all the post data on failure. 2014-02-22 03:06:09 -05:00
jgen
f1aed15f32 die doesn't support commas 2014-02-22 02:59:17 -05:00
jgen
cbfc0580f6 Temporary for debugging. 2014-02-22 02:35:56 -05:00
jgen
e6057c656f Re-order the events to ensure InitExtEvent() is fired off both with and without users. 2014-02-22 01:22:14 -05:00
jgen
ba0aef4f30 The Database class should really throw an error here. This will likely break the existing tests. 2014-02-22 00:40:14 -05:00
jgen
74639cd6b2 Missing bracket. 2014-02-21 20:49:17 -05:00
jgen
43f59cc4c0 Fix un-necessary PHP Notices being generated in the error log files. 2014-02-21 20:36:19 -05:00
jgen
e0bf45788e Dump all the mysql related log files. 2014-02-21 20:04:12 -05:00
jgen
bdc89814a3 Changed due to the default log location for MySQL on Ubuntu. 2014-02-21 16:35:49 -05:00
jgen
3fd0142d00 This command line option doesn't work. 2014-02-21 15:37:33 -05:00
jgen
4b36ae2936 Enable logging of all MySQL queries for debugging. 2014-02-21 14:26:44 -05:00
jgen
bbfba90ad4 Merge pull request #380 from DakuTree/patch-3
Misc tweaks/fixes 2 (fixes #349)
2014-02-21 13:40:52 -05:00
jgen
f4f94e6273 Merge pull request #379 from DakuTree/patch-2
Misc tweaks/fixes (fixes/closes issue 17 & 323)
2014-02-21 13:40:15 -05:00
jgen
e8cba99111 Merge pull request #378 from DakuTree/patch
Post Relationships ext + TagTermParseEvent
2014-02-21 13:32:33 -05:00
jgen
9255c861f7 Cleaning up. 2014-02-19 20:50:00 -05:00
jgen
0dd9c19bca Need to escape the dollar signs to prevent BASH from thinking they are vars. 2014-02-19 18:49:56 -05:00
jgen
bbaa9fc6f1 Change the nginx config. 2014-02-19 18:45:28 -05:00
jgen
f3c379b8db Rename the file. 2014-02-19 18:36:38 -05:00
jgen
dd18377f93 First remove the quotes, then the whitespace, then the trailing slash. 2014-02-19 18:26:01 -05:00
jgen
4e0d7d14ae Forgot the brackets. 2014-02-19 18:19:56 -05:00
jgen
eea4d34978 We can actually push the trim functions to when we create the define, less overhead. 2014-02-19 18:17:26 -05:00
jgen
141be8768f Better detection of running on the command line. 2014-02-19 18:10:40 -05:00
jgen
5a49bb59e4 Check that regular users can't add aliases. 2014-02-19 17:03:35 -05:00
jgen
1a7cbc9b2a Check the actual http response code. 2014-02-19 16:40:28 -05:00
jgen
f1a516ef18 Extra debugging when Alias fails. 2014-02-19 16:24:47 -05:00
jgen
7d90c20297 Cleaning up. 2014-02-19 16:16:01 -05:00
jgen
bdbb280064 Fixing the alias test cases. 2014-02-19 04:27:29 -05:00
jgen
61bf9b9b3e Put the database into auto commit mode. 2014-02-19 04:19:17 -05:00
jgen
55f07d0cfd Fix the tag_edit tests. 2014-02-19 04:15:00 -05:00
jgen
a717f5a0bd Remove the auto-run. 2014-02-19 03:42:18 -05:00
jgen
8b0ac0e9c1 The location of the webserver should be configurable in the travis file. 2014-02-19 03:29:12 -05:00
jgen
cb135d4763 Fix the Notice being generated. 2014-02-19 03:11:46 -05:00
jgen
a90f5bed8e This would be a good idea. 2014-02-19 02:50:10 -05:00
jgen
5b9107339a Let's just do it directly. 2014-02-19 02:39:13 -05:00
jgen
b570ef1573 Forgot a bracket. 2014-02-19 02:17:23 -05:00
jgen
2ca74a3b33 Expose methods to allow users of the database class to control when transactions occur. 2014-02-19 02:12:56 -05:00
jgen
6bc9315955 Need to commit the new users to the database. 2014-02-19 01:32:51 -05:00
jgen
0013ef923e We don't want to auto run these tests as we need to load and setup things first. 2014-02-19 01:24:53 -05:00
Daku
fe6b83412f use jQuery instead of JS + change spacing to tabs
this should fix IE/browser problems (see: #349)
2014-02-19 06:23:08 +00:00
Daku
5df6c09da6 reset_image_ids should properly change id for all possible tables 2014-02-19 05:48:20 +00:00
jgen
a5907c5a79 Cleaning up a bit. 2014-02-19 00:40:16 -05:00
jgen
b4819e4b33 We need to create these users before running the tests. 2014-02-19 00:00:18 -05:00
jgen
57b9d418c9 No idea how that got there. 2014-02-18 23:26:42 -05:00
jgen
156b178b35 Let try multiple script lines. 2014-02-18 23:18:59 -05:00
jgen
e7918cc372 Re-work travis config file. 2014-02-18 23:02:10 -05:00
jgen
a210cc9e9e Looks like we are going to have to install, then run the tests. 2014-02-18 22:54:53 -05:00
jgen
4eab3daef4 Typo 2014-02-18 22:42:37 -05:00
jgen
39bec6b666 Wait for the config file to be written. 2014-02-18 22:35:25 -05:00
jgen
62f0be7b92 So, the config file appears to take longer to write out to the file system. 2014-02-18 22:21:14 -05:00
jgen
7d3650555f Remove the catch and just let the exception bring the test down. 2014-02-18 21:35:18 -05:00
jgen
ced3006915 At its finest. 2014-02-18 21:25:08 -05:00
jgen
892b323c4d 21st century debugging 2014-02-18 20:58:08 -05:00
jgen
741eb0f739 I too like to live dangerously. 2014-02-18 20:49:20 -05:00
jgen
7f6672a2d3 Dump out the exception. 2014-02-18 20:34:39 -05:00
jgen
491069540e Output the shimmie config on failure. 2014-02-18 20:08:23 -05:00
jgen
6c8d519859 The order of these includes matter. 2014-02-18 19:37:07 -05:00
jgen
4936432d83 Copy the setup from index.php for All tests. 2014-02-18 19:24:10 -05:00
jgen
0b06477fd0 The tests are set to Auto Run. 2014-02-18 17:36:21 -05:00
jgen
83d034653e Forgot the include. 2014-02-18 17:22:45 -05:00
jgen
2935a87073 Refactoring: Move the installer related test case into another file. 2014-02-18 17:18:25 -05:00
jgen
66f32e63cf These tests for Mass tagger only work with NiceURLs enabled. Commenting them out for now. 2014-02-18 17:02:41 -05:00
jgen
8193b82735 Explicitly call out MariaDB in the README. 2014-02-18 17:02:08 -05:00
jgen
a94006e3c5 Add link to Shish's site. 2014-02-18 17:01:35 -05:00
jgen
f2c26bde1a Update the copyright notices. 2014-02-18 16:59:07 -05:00
jgen
dc8d1b4f49 Check for the correct text if the install succeeds. 2014-02-18 16:58:31 -05:00
jgen
74748d55c0 Use a constant instead. 2014-02-18 16:28:43 -05:00
jgen
cc88a33088 PHP doesn't call it is_empty, but it does have is_null. Yay consistency. 2014-02-18 16:14:57 -05:00
jgen
f12b32b5d9 Fail if there is no database defined. 2014-02-18 15:41:42 -05:00
jgen
689621a7ed The username for the database doesn't seem to be working. 2014-02-18 13:10:19 -05:00
jgen
cfc663de44 Output the HTML when the install fails. 2014-02-18 12:57:32 -05:00
jgen
f1608d39f1 Dump more logs and change the database username. 2014-02-18 12:22:52 -05:00
Daku
daad8d00d5 fix download all images not working 2014-02-18 12:33:10 +00:00
jgen
bc98d284c7 Dump logs on failure. 2014-02-18 03:42:59 -05:00
jgen
222d82b3c3 Test the installer. 2014-02-18 03:32:05 -05:00
Daku
5a4b089a61 fix database_dump regex not working with no password 2014-02-18 08:20:52 +00:00
Daku
857f7e4041 don't force hellban ext + add [Beta] tags 2014-02-18 07:24:26 +00:00
jgen
3564784236 Let's just remove these. 2014-02-18 01:41:40 -05:00
jgen
104711a30e Well lets try this again. 2014-02-18 01:30:27 -05:00
jgen
dcff694c42 Bash arguments start at 1. 2014-02-18 01:11:39 -05:00
jgen
94991bd14a More logging on failure. 2014-02-18 01:02:11 -05:00
jgen
ad3c865716 Explicitly listen on localhost. 2014-02-18 00:50:57 -05:00
jgen
20ce8451f4 Default is a unix socket. 2014-02-18 00:37:07 -05:00
jgen
3e52a1df03 Errors 2014-02-18 00:29:26 -05:00
jgen
3097de938d Need to know the default config for nginx 2014-02-18 00:18:19 -05:00
jgen
ec3804ceb8 Fix the nginx config. 2014-02-18 00:06:58 -05:00
jgen
b56f006b28 Forgot the semicolon. :( 2014-02-17 23:23:20 -05:00
jgen
6a10d66e2d Move the chmod to the script file. 2014-02-17 23:18:00 -05:00
jgen
ac4c0da9a9 Removing unneeded file. 2014-02-17 22:56:32 -05:00
jgen
cc1ed20fc2 Come on Travis 2014-02-17 22:45:03 -05:00
Daku
0065852fc7 lower delay & minChars for autocomplete 2014-02-18 03:32:05 +00:00
jgen
d2349216b5 I can totally spell environment correctly. 2014-02-17 21:37:56 -05:00
jgen
09fe543a4b Push the test environment setup into a separate shell script. 2014-02-17 21:26:06 -05:00
jgen
173e8ef164 These commands need to be done as root. 2014-02-17 20:11:26 -05:00
jgen
5e13a01ffd The config file is in the test folder. 2014-02-17 17:42:40 -05:00
jgen
8974c2cbc7 Change the apt-get commands. 2014-02-17 17:12:01 -05:00
jgen
dbb90465df Derp, forgot a dash. 2014-02-17 16:59:54 -05:00
jgen
58474d4bd3 We actually need a webserver in order to use SimpleTest. 2014-02-17 16:57:46 -05:00
jgen
6f057028b7 Test cases should start with 'test'. 2014-02-17 15:53:22 -05:00
jgen
48932af7c5 Working on testing the installer. 2014-02-17 15:45:42 -05:00
jgen
630f5c2c77 This include is necessary. 2014-02-17 15:03:27 -05:00
jgen
4b6b283f02 Can we assume that the server is 127.0.0.1? 2014-02-17 15:00:04 -05:00
jgen
8a700a34fc No idea why it was set to use the directory "2.Xm" 2014-02-17 14:46:00 -05:00
jgen
fe83e3d343 Adding comments to help explain the simpletest setup. 2014-02-17 13:59:41 -05:00
jgen
c05b4719d6 Fix the tests for the Alias extension. 2014-02-17 01:52:30 -05:00
jgen
807b0c7037 Commenting this out as it assumes Nice URLs, and fails if they are not enabled. 2014-02-17 01:51:40 -05:00
jgen
073813d0ea Fix the warning that these variables aren't defined. 2014-02-17 01:49:16 -05:00
jgen
5f0b7e989e PHP's getopt function on allows single character arguments. 2014-02-17 01:44:54 -05:00
Daku
7c36902537 updated js libs
jQuery 1.7.1 > 1.11.0
jQuery UI custom (highlight effect) 1.10.3 > 1.10.4
jQuery autocomplete 1.1 > 2.4.4
jQuery imgareaselect 0.4 > 1.0.0
jQuery imgnotes 0.2 > 1.0
jQuery tablesorter ? > 2.0.5
jQuery timeago 1.1.1 > 1.3.1
Modernizer 2.5.3 > 2.7.1
2014-02-17 03:02:14 +00:00
jgen
3cb79f0e8a SimpleTest works now. 2014-02-16 19:36:52 -05:00
Daku
c51d1388c0 remove lazyload lib + make random list ext more readable
lazyload is no longer used, see: 7c959813191a8fb4d17ec7b21b33d88c834dd0e6
2014-02-16 23:24:05 +00:00
Daku
1909f9072e use mt_rand() instead of rand()
rand() isn't so random on windows: http://tjl.co/blog/code/followup-php-rand-vs-mt_rand/
mt_rand() is also slightly faster
2014-02-16 04:43:38 +00:00
Daku
c065e38145 adds widget/thumb option to random_thumb ext (for #323)
this code was suggested in the comments, but never actually added
2014-02-16 04:38:58 +00:00
Daku
e8607ab6f2 cleaned up popular_by pages
my old code was so messy :<
2014-02-16 02:29:16 +00:00
Daku
eb16ab09ed order images sorted by score
this is solution for issue #17 (Method to sort by top scored images in numeric_score module)
2014-02-16 02:28:39 +00:00
Daku
16bb38f343 onSearchTermParse regex should be case insensitive 2014-02-15 21:26:31 +00:00
Daku
7b8395b341 have pool description use BBcode 2014-02-15 21:04:26 +00:00
Daku
50c2271ca6 complete rewrite of the update ext (again)
much cleaner than previous version
affixed the [beta] tag since this still has a few issues (mainly error checking/displaying etc.)
2014-02-15 03:44:53 +00:00
jgen
d069c7b50a Argh, PHP. 2014-02-10 00:54:27 -05:00
jgen
0a8abc54df Rename the class. 2014-02-10 00:46:43 -05:00
jgen
8d8ebddadc Change the include to the SimpleTest files. 2014-02-10 00:44:30 -05:00
jgen
c3835ceea9 Playing around with Travis-ci. 2014-02-10 00:33:57 -05:00
Shish
134f9082fd fix typo 2014-02-08 11:53:45 +00:00
Shish
88432215ce make image deletion message work, fixes #368 2014-02-08 11:53:35 +00:00
Daku
b7a4de90e4 updated docs with new metatags 2014-02-05 14:11:13 +00:00
Daku
c4150c15ce make sure source/parent isn't set twice if metatag is used 2014-02-05 14:11:12 +00:00
Daku
6e54580f56 check for permissions 2014-02-05 14:11:03 +00:00
Daku
629f9940c3 thumbnail border-color for post relationships
also removed build_thumb_html from themes (mostly old versions of the default base function)
2014-02-04 18:41:40 +00:00
Daku
13cdb9ba5f Post Relationship ext 2014-02-03 16:55:42 +00:00
Daku
d19e7fff7b vote[=|:](up|down|remove) metatag 2014-02-01 09:54:33 +00:00
Daku
2ffb9e9b8a option for add_post & remove_post to log history
(for use with TagTermParse)
also make navbox show on pool history page
2014-02-01 09:36:23 +00:00
Daku
6a1a57b1a2 make "source[=|:]none" null the source 2014-02-01 09:36:17 +00:00
Daku
b7778b54c9 add TagTermParseEvent for parsing tags during tagging 2014-02-01 09:36:10 +00:00
Shish
711ad775da Merge branch 'master' of https://github.com/shish/shimmie2 2014-01-29 21:38:07 +00:00
Shish
cbe5f27eb6 in-place tag renaming when possible, rather than mass editing thousands of images 2014-01-29 21:37:51 +00:00
jgen
5b0f0b4bef Merge branch 'master' of git://github.com/shish/shimmie2 2014-01-28 20:35:33 -05:00
Shish
d7ce075a43 Merge pull request #367 from DakuTree/patch
Metatag tweaks + Fix for issue 359 & 362.
2014-01-25 06:58:35 -08:00
Shish
851b33ec1d Merge pull request #369 from Diftraku/master
Fix EXIF data throwing a notice when showing an image
2014-01-25 06:54:56 -08:00
Daku
c07dc2e0ab use resolve_aliases rather than resolve_alias 2014-01-16 03:28:23 +00:00
Diftraku
85303d232e Fixing stuff with API output being output twice
Also some code formatting and a redirect from post/show for clients such
as CartonBox so you can actually view the image after opening it in the
browser on the client.
2014-01-15 23:28:40 +02:00
Diftraku
b856b13235 Fix EXIF data throwing a notice when showing an image 2014-01-15 23:06:27 +02:00
Daku
b5f70de496 change source metatag regex to allow searching for URLs 2014-01-14 07:52:45 +00:00
Daku
55ff224ac0 added any/none options to the source/pool metatags 2014-01-14 06:27:12 +00:00
Daku
ce256f5bf4 added pool & pool_by_name search metatags 2014-01-14 06:12:34 +00:00
Daku
ae4da2b410 add option for getMimeType to return list of extensions 2014-01-13 10:03:38 +00:00
Daku
325da11119 artist/comment/numeric_score metatags now work using :
also updated docs
2014-01-13 09:13:56 +00:00
Daku
7d49e21792 readability + moved stuff 2014-01-13 08:19:12 +00:00
Daku
152f5fbf26 add config option for default order 2014-01-13 08:19:11 +00:00
Daku
2c2f27ca64 add order metatag
not too happy with how this works...but it does work
2014-01-13 08:19:11 +00:00
Daku
9cae856df7 use the Content-Disposition header for filename & Content-Type for
extension
if either doesn't exist, it will fallback to using pathinfo
2014-01-13 08:19:01 +00:00
Daku
9f06a5c565 fix search not working properly for aliases to multiple tags
fix issue 359
2014-01-13 08:04:26 +00:00
Shish
952594cdce Merge pull request #365 from HungryFeline/patch-2
Don't silently ignore invalid URLs
2014-01-05 03:14:01 -08:00
Daku
14899e79ad added height & width metatags 2014-01-02 14:10:08 +00:00
Daku
25c286b71f add support for using : as a metatag seperator + updated docs 2014-01-02 14:00:24 +00:00
HungryFeline
7cf79171a8 Update extension.class.php
Fix my previous commit. Also put the results of the tests into variables so we don't need to check them again.
2014-01-01 18:25:28 +01:00
HungryFeline
fde6558a6f Don't silently ignore invalid URLs
Scenario: Providing an invalid url via $_GET (wrong/missing extension or file isn't an image (also happens on download errors))
Behavior before: Silently redirect to index
Behavior after: Display error message
2014-01-01 01:41:11 +01:00
Daku
85880804d2 have theme.php manage block creation
so themes can move/remove if they wish
2013-12-31 08:22:58 +00:00
Shish
2d40fcc92d Merge pull request #364 from DakuTree/patch
Pools ext tweaks/additions.
2013-12-30 02:49:06 -08:00
Daku
c892386bcb remove backticks 2013-12-30 10:36:32 +00:00
Shish
de6ad33e12 Merge pull request #356 from Diftraku/master
Bumping Ouroros API to v0.2: now with XML support and post creation!
2013-12-30 02:20:43 -08:00
Shish
bc2100940d Merge pull request #360 from DakuTree/master
bookmarklet.js support for danbooru2 + fixed most issues with other sites
2013-12-30 02:16:35 -08:00
Shish
7d3d331272 Merge pull request #358 from jgen/master
PHP Notice being generated in comment.php
2013-12-30 02:15:06 -08:00
Daku
fd6f2ddb43 show pool navigation box on pool/view pages 2013-12-30 08:42:29 +00:00
Daku
3dd3101995 added option to set pool & source via tag 2013-12-30 08:15:10 +00:00
Daku
9eaebfd1c2 if cookie doesn't exist, default to "created" 2013-12-30 06:52:17 +00:00
Daku
9511569ed4 added option to edit pool description to pool edit page 2013-12-30 06:51:47 +00:00
Daku
b79a042bdc added option to order pool list by created date/last updated/title/count 2013-12-30 06:47:29 +00:00
Daku
3e240fa78d return error when pool title exists + fix pool error reporting 2013-12-30 06:46:41 +00:00
Daku
59eb6d7ec2 pool title should be unique 2013-12-30 06:46:34 +00:00
jgen
f96a815288 Merge branch 'master' of git://github.com/shish/shimmie2 2013-12-08 13:48:33 -05:00
Daku
453d9a453b bookmarklet now supports danbooru2 + fixed issues with other sites 2013-12-08 15:05:27 +00:00
Shish
63aa4c6330 avoid possibility of infinite loop in bbcode parsing 2013-12-08 10:52:59 +00:00
Shish
caa6d59a87 log base was changed years ago, comment never got updated 2013-12-08 10:52:59 +00:00
jgen
4635f333ae This should have been moved earlier in the fix for Issue 346. 2013-12-07 23:16:20 -05:00
jgen
794cc648be Merge branch 'master' of git://github.com/shish/shimmie2 2013-12-05 19:51:20 -05:00
jgen
1c8d07983e Fix for PHP Notice being generated.
"PHP Notice:  Trying to get property of non-object in /comment/main.php on line 325"
Details: We don't need to try and get comments for images that don't exist. This might also help speed things up a bit as it should eliminate an unnecessary database query.
2013-12-05 19:50:21 -05:00
Shish
c0603d3b4b Merge pull request #357 from jgen/master
Fix for issue 346 - "Only first page of comments is shown"
2013-12-03 16:08:47 -08:00
jgen
a7ab12abdd Fix for issue 346 - "Only first page of comments is shown" 2013-12-03 14:39:12 -05:00
Shish
6dc345085f Merge pull request #353 from jgen/master
Fix for issue 330 - "Tag list does not handle non-english text correctly"
2013-12-03 11:05:27 -08:00
Diftraku
1a25014564 Derp, forgot I was actually giving the post[file] to OuroborosPost, making assert fail for null 2013-12-03 05:51:55 +02:00
Diftraku
095f743d57 Checking if the user can actually create new posts, seems the base DataHandlerExtension doesn't do this. Also forgot to update documentation! 2013-12-03 01:07:27 +02:00
Diftraku
6a4031dfd5 Bumping Ouroros API to v0.2: now with XML support and post creation! 2013-12-03 00:45:07 +02:00
jgen
049108e6ca Fix for issue 330 - "Tag list does not handle non-english text correctly". 2013-11-30 15:19:41 -05:00
Shish
9cdc529c13 Merge pull request #352 from Diftraku/master
Adding basic Ouroboros API
2013-11-30 07:39:35 -08:00
Shish
0a4c8a0931 Merge pull request #351 from jgen/master
Cleaning up the installer
2013-11-30 07:36:17 -08:00
Diftraku
9237c78f55 Adding basic Ouroboros API 2013-11-29 01:09:05 +02:00
jgen
13ea386b0e Fixed some spelling typos. 2013-11-28 00:34:31 -05:00
jgen
a5ea9ed743 Lets comment this rather tricky function. 2013-11-28 00:31:46 -05:00
jgen
bf4d434c86 Fixes for the installer. Display error messages on failures, as well as actually check for tables before installing. 2013-11-28 00:31:09 -05:00
Shish
9430ddc374 Merge pull request #350 from jgen/master
Fixed bookmarklet.js to allow uploading from Gelbooru. (was broken before)
2013-11-27 00:29:40 -08:00
Shish
0e90d58d85 Don't crash if no relevant tags are found, see #324 2013-11-27 08:28:07 +00:00
jgen
9d8bcbce37 Fixed bookmarklet.js to allow uploading from Gelbooru. (was broken before) 2013-11-24 14:54:10 -05:00
Shish
4fd58019e5 Merge pull request #324 from justinbrewer/editcloud_revamp
Tag Edit Cloud improvements
2013-11-24 09:07:43 -08:00
Shish
383fee2dab Merge pull request #345 from tkorpe/master
Fixing rating= search
2013-11-06 01:07:49 -08:00
Thasan
b16be279a8 ext\rating documentation 2013-11-06 00:32:27 +02:00
Thasan
fe84c8d9dd Also checking rating permissions 2013-11-06 00:11:17 +02:00
Thasan
5aa2f823d8 Fixing rating= search 2013-11-05 22:43:46 +02:00
Shish
81d44cbb4f lower tags before checking for mass replacement 2013-10-25 09:26:25 +01:00
Shish
5e556829d7 ignore vim undo files 2013-10-25 09:24:54 +01:00
Shish
ae3ee1fe79 Merge pull request #341 from jgen/master
More small tweaks
2013-10-14 05:29:47 -07:00
Shish
70a67afa5e Merge pull request #342 from NuckChorris/fix-rating-ext
Fix rating circumvention issue
2013-10-14 05:29:16 -07:00
Peter Lejeck
0e4717ecae Unify two regexes used in rating searches, intersect with user privs
Fixes issue with unpriveleged users being able to circumvent the ratings
they could see, just by searching for it.  Also makes code much much
prettier.
2013-10-06 04:38:34 -07:00
jgen
5b1a99d0c5 Fixing missing $. (Thanks Shish!) 2013-10-05 14:28:02 -04:00
jgen
b01ca89220 Some more small speed related tweaks. 2013-10-04 17:53:26 -04:00
jgen
0512858bd4 Some more small tweaks for speed. 2013-10-04 17:17:42 -04:00
Shish
dd58c35f8a Merge pull request #340 from jgen/master
Some small tweaks/changes
2013-10-04 01:17:05 -07:00
jgen
70428b2b5d Its better to pass to the right function. (Side note, this is why you always test your code) 2013-10-03 21:19:19 -04:00
jgen
393a9e60df No need to have HTML in the image thumb title. Derp. 2013-10-03 21:17:15 -04:00
jgen
2d041d468f Adding ability to specify the 'date' in the image thumbnail title (when you hover over the thumbnail). 2013-10-03 21:09:41 -04:00
jgen
234b8c4f51 Removing this line as this file does not exist and simply causes 404 errors. 2013-10-03 21:08:13 -04:00
jgen
1db371345e Merge branch 'master' of git://github.com/shish/shimmie2 2013-10-03 20:33:47 -04:00
Justin Brewer
8c5987a6b2 Fixed tags with quotes killing the Javascript
Of course not.
2013-09-26 10:47:37 -05:00
Justin Brewer
7be1f9e637 Properly escape tags while building query
Could it really be that easy?
2013-09-25 23:39:40 -05:00
Justin Brewer
55bfa4cfd7 Use API calls 2013-09-25 22:59:08 -05:00
Shish
827ce2e0fe merge cron_uploader changes manually 2013-09-23 13:43:39 +01:00
YaoiFox
a7c39105e7 Cron Uploader: Link to install guide & info from board config. And now i'm going to sleep before I want to change more... 2013-09-23 13:41:43 +01:00
YaoiFox
5afeeb0991 Cron Uploader: Fixed documentation & added page /cron_upload with info & install guide if user is admin. 2013-09-23 13:41:36 +01:00
DrudexSoftware
f4b9c8aca2 Cron Uploader: Board Config wasn't getting the right root directory. 2013-09-23 13:41:30 +01:00
DrudexSoftware
455b94c4fa Cron Uploader Extension added that allows automatic image uploading from an image queue using cron jobs. 2013-09-23 13:41:25 +01:00
Shish
835361b272 make tags in the image info box clickable (#336) 2013-09-23 13:09:47 +01:00
Shish
b0b0324ee7 image only button 2013-09-19 19:30:50 +01:00
Shish
ff330d542d Merge pull request #335 from vomitcuddle/image_hash_ban_patch
[image_hash_ban] Fix confusing button label
2013-09-18 08:13:00 -07:00
vomitcuddle
ea21e0657b [image_hash_ban] Fix confusing button label 2013-09-18 09:28:07 +01:00
Shish
67c026e8d8 unique request ID, for associating several log entries with one request 2013-09-12 16:29:38 +01:00
Shish
bf8b085de6 fix being logged in after changing password 2013-09-12 16:29:20 +01:00
Shish
76c7da0161 add hellban support to PMs 2013-09-09 13:47:42 +01:00
Shish
4584bf603a finally got that zero... 2013-09-09 13:46:47 +01:00
Shish
1b73dd4ddc add 'hellbanned' user class, with support from the comments extension 2013-09-09 13:41:08 +01:00
Shish
7c95981319 load thumbnails on demand is more trouble than it's worth 2013-09-08 23:21:06 +01:00
Shish
07304861f3 log IDs of things 2013-08-30 00:19:46 +01:00
Shish
7c140680b7 log args 2013-08-30 00:19:46 +01:00
Shish
12bc4a90f7 core-image -> core_image, for elasticsearch's sake 2013-08-30 00:19:46 +01:00
Justin Brewer
e93785339f Fix another corner case
If $counter == $def_count and the next tag in the list is a used tag, the
tagcloud_extra div would be printed twice, breaking the list.

This solution feels ugly, perhaps there's a better way to do this?
2013-08-26 23:32:44 -05:00
Shish
47abed28c3 Merge pull request #326 from Madoushi90/archive_fixes
handle_archive extension fixes
2013-08-22 04:47:08 -07:00
Justin Brewer
946dec9415 readdir is not guaranteed to be in order
readdir's ordering is filesystem-dependent. On many systems, that means it
might as well be random. People uploading archives will reasonably expect the
files to appear in alphabetical order, so we should make sure they do.
2013-08-11 17:52:38 -05:00
Justin Brewer
305e25f676 Fix incorrect DataUploadEvent creation, triggering an assertion failure
I guess this one slipped through the cracks when $user was made global.
2013-08-11 17:38:50 -05:00
Justin Brewer
8732f1a9ef Extra-switch fixes
Wrong variable name, and don't do the math unless we have to.
Fixed the diplayed number being wrong.
Also fixed a corner case where number of tags in the cloud equals number to
display. Would display "[show 0 more tags]".
2013-08-10 16:19:03 -05:00
Justin Brewer
fa1fb45c1e Polish 2013-08-07 16:08:05 -05:00
Justin Brewer
03e78bd19f Tag Category integration 2013-08-07 15:58:58 -05:00
Justin Brewer
e133138be2 Config option for which tags to ignore 2013-08-07 15:25:11 -05:00
Justin Brewer
905dc2df31 Relevance sorting method 2013-08-07 14:47:44 -05:00
Justin Brewer
d27079ca9f Cleanup build_tag_map
Millions of temp variables. Assuming there's only two sorting methods. Grammar.
[show 100 more problems]
2013-08-07 14:15:04 -05:00
Shish
194b68e046 show when a ban was added, fixes #250 2013-08-05 20:46:54 +01:00
Shish
44deff21a8 Merge branch 'master' of https://github.com/shish/shimmie2 2013-08-05 20:37:40 +01:00
Shish
390db4d6f4 have setup 'Help' link link to github wiki, fixes #303 2013-08-05 20:34:50 +01:00
Shish
4fc1f2f217 save cached config when saving database config, fixes #311 2013-08-05 20:21:57 +01:00
Shish
8bbf7e2171 hide https variable warning 2013-08-05 20:10:54 +01:00
Shish
e50d9c4dbb only sanitise when saving tags - when searching, '*' is important 2013-08-04 18:21:52 +01:00
Shish
8b22652aa0 resolve negative aliases 2013-08-04 18:19:23 +01:00
Shish
2b628a395f resolve_list -> resolve_aliases, to better describe what it actually does 2013-08-04 18:13:50 +01:00
Shish
7e89481105 have Tag::resolve_list always take an array 2013-08-04 18:11:02 +01:00
Shish
9c70d1bd3f ban from mass delete 2013-08-04 18:03:31 +01:00
Shish
f98e0d1927 remove debugging logs from js 2013-08-04 02:20:28 +01:00
Shish
2ef76708c5 untag table titles 2013-08-04 02:20:28 +01:00
Shish
097655e7f7 Merge pull request #322 from HungryFeline/patch-3
use upload_tmp_dir as temp place, see #297
2013-07-21 01:48:41 -07:00
HungryFeline
e9b0553876 use upload_tmp_dir as temp place, see #297
We changed a line like this some time ago in upload/main
2013-07-21 02:10:17 +02:00
Shish
1c5d717d27 put untags in the database 2013-07-13 09:35:34 +01:00
Shish
00e297c7d4 Merge pull request #317 from HungryFeline/patch-1
Let the admin define how much space should be free
2013-07-07 03:28:44 -07:00
Shish
39753fe7a9 Finish the process of removing $query from thumb links. (Forgot to remove $query from the thumb links) 2013-07-07 10:34:19 +01:00
HungryFeline
33712ee5c2 Merge pull request #1 from HungryFeline/patch-2
Update main.php
2013-07-07 00:17:30 -07:00
HungryFeline
17efb92b4e Update main.php 2013-07-07 09:13:14 +02:00
HungryFeline
9edbaf2ec7 Let the user define how much space should be free 2013-07-07 09:08:50 +02:00
Shish
b9a00e4c28 this doesn't work 2013-07-07 03:24:21 +01:00
Shish
bc253eef04 load list of voters in-place with ajax 2013-07-06 10:42:25 +01:00
Shish
48e40a6712 trim whitespace when adding aliases 2013-07-06 10:42:25 +01:00
Shish
589bda1b00 Merge pull request #316 from HungryFeline/patch-5
Fixing csv upload form
2013-07-06 01:53:29 -07:00
Shish
a212013d9d Merge pull request #314 from vomitcuddle/rm_dup_ext
Remove duplicate arrow key navigation extension
2013-07-06 01:50:38 -07:00
HungryFeline
03b0c82887 Better CSV validation
When uploading a CSV, check every entry before executing the INSERT. The checks are the same as with the normal add except that no errors are shown.
2013-07-06 00:33:31 +02:00
HungryFeline
db64370815 Fixing csv upload form
The 2nd argument of make_form is the method. Also, I don't see any point in defining the $multipart variable. Just true as argument is enough. C&P mistake?!
2013-07-06 00:12:25 +02:00
Shish
47c1b5d094 move query-string-passing to JS rather than embedding in the HTML, so that the HTML can be commonised and cached better 2013-07-05 22:32:16 +01:00
Shish
e4bfa7df70 further breakdown for page stats 2013-07-05 22:32:16 +01:00
Shish
30886b3a69 cache lookup debugging 2013-07-05 22:32:16 +01:00
Shish
47447ee982 generate rss thumbs in a different function, with cache 2013-07-05 22:32:16 +01:00
vomitcuddle
b8cf3562b0 Remove duplicate arrow key navigation extension 2013-07-04 01:30:48 +01:00
Shish
dbc0548bdc Merge pull request #310 from HungryFeline/patch-4
Checking if mod_headers is loaded before trying to set Cache-Control headers
2013-07-03 11:39:31 -07:00
HungryFeline
a87aedcef9 Checking if mod_headers is loaded before trying to set Cache-Control headers 2013-07-03 10:21:21 +02:00
Shish
3febf0e443 Merge pull request #309 from HungryFeline/patch-3
Don't check the certificate when transloading
2013-07-02 05:41:48 -07:00
Shish
79ff722d10 Merge pull request #307 from HungryFeline/patch-1
Allow transload from urls with query string
2013-07-02 05:36:38 -07:00
Shish
912b0b40d9 Merge pull request #308 from HungryFeline/patch-2
Look for the source in _GET and not in _POST when uploading via _GET
2013-07-02 05:34:56 -07:00
HungryFeline
65fcbcb9ba Actually set the cookie prefix
When COOKIE_PREFIX was not shm (the default) the script tried to read cookies prefixed with the new prefix but the script was setting the old default prefix from before the constants were implemented.
2013-07-02 06:46:54 +02:00
HungryFeline
616aa3300a Don't check the certificate when transloading
This allows the download of images via https even if the cert is self-signed.
2013-07-02 04:44:27 +02:00
HungryFeline
71117cf8fa Look for the source in _GET and not in _POST when uploading via _GET 2013-07-02 04:35:18 +02:00
HungryFeline
cbd927ffa2 Allow transload of image urls with querystrings
And remove them from the filename and fileext
2013-07-02 04:31:06 +02:00
Shish
e547b1362f Update theme.php 2013-07-01 09:45:32 +01:00
Shish
e6146d82ea Update theme.php 2013-07-01 08:05:30 +01:00
Shish
752d36476a Merge pull request #300 from DanielOaks/dan2
Danbooru2 theme, tag categories extension, tag list update/rework
2013-06-30 06:05:23 -07:00
Daniel Oaks
2a51a9d6ba Fixed things Shish pointed out 2013-06-23 16:57:25 +10:00
Daniel Oaks
bf0146cc41 Danbooru2 theme, initial tag categories extension, tag list update/rework 2013-06-23 09:42:15 +10:00
Shish
1264ec5b35 Merge pull request #298 from aki--aki/master
Add reset_image_ids from shish/shimmie2-utils to the admin extension
2013-06-22 06:31:55 -07:00
Aki Jenkinson
e5e12220b3 Made reset image IDs button only appear on MySQL 2013-06-22 18:30:10 +12:00
Shish
5c13fcac62 resolve aliases on input as well, so the target shows in the url 2013-06-20 22:59:42 +01:00
Shish
4a2c47459c Chatbox 2013-06-19 20:59:59 +01:00
Drudex Software
a3486f9b29 Bulk Remove 2013-06-19 20:59:37 +01:00
Drudex Software
668ebdcb2e Arrowkey Navigation 2013-06-19 20:56:19 +01:00
Daniel Oaks
06dd72fe66 Danbooru2 theme 2013-06-19 20:09:22 +01:00
Shish
c64a43eb2b Merge pull request #301 from vomitcuddle/dapi
Danbooru API changes
2013-06-19 11:37:50 -07:00
vomitcuddle
35f7ccb3ba Include thumbnail dimensions 2013-06-18 22:31:24 +01:00
vomitcuddle
911caadc84 Support Gelbooru API page offsets 2013-06-18 22:31:16 +01:00
vomitcuddle
619382d1b9 Include image count and offset in root tag 2013-06-18 22:31:09 +01:00
Shish
b6235695da unique IDs for 'posted' search params 2013-06-16 12:20:53 +01:00
Shish
c8b12a0459 update comment 2013-06-15 19:57:15 +01:00
Shish
e7ddd2960b use upload_tmp_dir as temp place for transloading, see #297 2013-06-15 19:54:00 +01:00
Zarek Jenkinson
f2d0bc6cfa Merge branch 'master' of https://github.com/shish/shimmie2 2013-06-13 23:47:47 +12:00
Shish
2859d58191 regex and trimming updates for danbooru and lite themes 2013-06-13 12:42:30 +01:00
Shish
df2f90016f trim leading slashes more efficiently 2013-06-13 12:20:27 +01:00
Shish
19c0868b2c sqlite got case sensitive by default at some point - lowercase strings for comparing them 2013-06-13 10:34:47 +01:00
Shish
e01b9b22c4 don't try to set tags / source if they aren't sent 2013-05-30 14:19:03 +01:00
Shish
51ab897655 need a tiny bit of jquery UI for flashing... 2013-05-30 10:18:23 +01:00
Shish
b562de3e94 redirect to referrer after adding image hash ban 2013-05-30 10:21:11 +01:00
Zarek Jenkinson
ac764d0e9c protect reset_image_ids & move protected checkbox 2013-05-29 23:00:01 +12:00
Zarek Jenkinson
344e8afd98 Add reset_image_ids from shish/shimmie2-utils to the admin extension 2013-05-29 19:59:41 +12:00
Shish
261dee5a7c hacky source history 2013-05-18 13:52:11 +01:00
Shish
c530e41335 new jquery.timeago with cutoff 2013-05-18 13:46:27 +01:00
Shish
5a9f69afbe Numeric type and aspect keeping - #281 2013-05-18 10:20:08 +01:00
Shish
f4a49b2fb1 Current size as default for resize, if default is otherwise 0 - #281 2013-05-18 10:20:08 +01:00
jgen
cc95eb5deb Some more small speed tweaks. 2013-05-13 20:40:01 -04:00
Shish
dcb51ba4ff Merge pull request #290 from jgen/master
Fix for Image View error
2013-05-12 07:29:08 -07:00
jgen
bf49c7ce19 Fix for Enabling Image View count extension causes fatal error. 2013-05-11 22:49:36 -04:00
Shish
18b94a801d allow custom themelets to call TagEditTheme::format_source() 2013-05-07 09:13:26 +01:00
Shish
7701758959 log old source in event log when changing source 2013-05-07 09:13:03 +01:00
Shish
44e9714d88 logging for delete user 2013-04-28 07:48:42 +01:00
Shish
bb0ebc5d42 first version of pm_trigger ext 2013-04-26 17:27:22 +01:00
Shish
a103672a6d Merge pull request #288 from opensorcerer/nicetest-over-https
Allow Nice URLs when served via HTTPS
2013-04-24 00:02:18 -07:00
Bill Garrett
861e04d85f Use ['HTTPS'] to construct the nicetest URL, allowing Shimmie to use nice URLs when served over HTTPS 2013-04-23 21:48:32 -07:00
Shish
8d77d251a5 Merge pull request #285 from kenshiros/fixvoteslistlinks
fix numeric_score to use make_link for user profile links
2013-04-07 05:33:51 -07:00
Shish
7c0666ad9a Merge pull request #284 from kenshiros/fixhomelinks
fix pools link on home page to point at site://pool and not site://pools
2013-04-07 05:33:31 -07:00
kenshiros
455bf795de fix numeric_score to use make_link for user profile links 2013-04-07 07:30:38 -04:00
kenshiros
519cff827f fix pools link on home page to point at site://pool and not site://pools 2013-04-07 07:06:20 -04:00
Shish
2e5a51bc8d Merge pull request #282 from DrudexSoftware/master
Random Images List & Modified Page Title
2013-03-16 12:50:03 -07:00
DrudexSoftware
014975884b - Custom page titles rewritten, can now only use website title as prefix or suffix. This is done so admins can use this feature without too much difficulty or without it being bugged. 2013-03-10 09:38:06 +01:00
DrudexSoftware
a89d417546 a few more minor changes 2013-03-10 08:56:58 +01:00
DrudexSoftware
a4b29f0254 - Setup block added for Random Images List 2013-03-10 08:43:50 +01:00
DrudexSoftware
8e6fe9f7e3 - Random list page now has a title<br>
- Custom Html Headers extension now allows admin to set title prefix & suffix for all pages
2013-03-10 08:24:15 +01:00
DrudexSoftware
e54c8439cb Random List now displays actual random images...
Also arrowkey navigation extension now supports Random List extension
2013-03-10 07:53:09 +01:00
DrudexSoftware
8251133270 Amount of randoms displayed = images per page / 2 2013-03-10 07:35:35 +01:00
DrudexSoftware
fccd5d249d Merge branch 'master' of https://github.com/shish/shimmie2.git 2013-03-10 07:01:28 +01:00
DrudexSoftware
41709e419b Added extension allowing users to view a random page at www.website.com/random 2013-03-10 07:00:24 +01:00
Shish
3175e605da Merge branch 'master' of https://github.com/shish/shimmie2 2013-03-07 03:25:23 +00:00
Shish
e49e90f9ab fff, php 2013-03-07 03:23:35 +00:00
Shish
7ff0ae51a1 fixup wildcards 2013-03-03 18:34:27 +00:00
Shish
e013d86b56 disallow aliases to other aliases 2013-03-03 18:32:56 +00:00
Shish
d5bc06835d reserve block slot #0 for site announcements 2013-03-03 18:27:06 +00:00
Shish
72a82c7487 saner wildcard handling, and only handle '*' 2013-03-03 18:26:47 +00:00
DrudexSoftware
7155804505 Cleaned up code in some of my extensions
Removed function testImage in ext/chatbox/test.php because it no longer applies (there is a cache now)
2013-03-01 17:29:28 +01:00
Shish
a55c5efc4f Merge pull request #280 from DrudexSoftware/master
Image View Counter, Arrow Navigation, and Custom HTML Headers
2013-02-25 05:50:27 -08:00
Drudex Software
a03e4d5102 Custom HTML Headers added
I may also expand it to allow headers specific pages later
2013-02-25 01:59:43 +01:00
DrudexSoftware
cf9e0eae8c oops, forgot something 2013-02-24 01:26:48 +01:00
DrudexSoftware
937eefcb50 /post/view now also supports things like /post/view/4#search=tag1 2013-02-24 01:05:50 +01:00
DrudexSoftware
c55c984cfc also correctly handle post/list without a page ID given 2013-02-23 23:34:32 +01:00
DrudexSoftware
069b7ee9ea arrowkey navigation on post/list now supports tags 2013-02-23 23:26:08 +01:00
DrudexSoftware
13d8b0831e Fixed problems from notes by shish
Added arrowkey navigator to post/list as well
arrowkey navigator also works with tags on post/list now
2013-02-23 22:17:20 +01:00
DrudexSoftware
dfd7157cd2 arrow key navigation through images
allows visitors to use left-right keyboard keys to navigate to different images using post/next/(id) and post/prev/(id)
2013-02-23 08:00:59 +01:00
DrudexSoftware
b88f7a4d6b image_view_counter: also saving with user ID with addview() for later use 2013-02-23 07:17:58 +01:00
DrudexSoftware
93a431dce7 image_view_counter:
- now displays views below image (only if it's okay with the admin settings)
- comment changed
2013-02-23 06:47:06 +01:00
DrudexSoftware
1a38a152e6 image_view_counter:
- added view counter
- only adds view every hour from same person
- no way to display to user/admin yet (todo)
2013-02-23 06:21:00 +01:00
Shish
636e540674 Merge pull request #278 from DrudexSoftware/master
Upgraded Sitemap & User extensions
2013-02-19 23:56:28 -08:00
DrudexSoftware
4c170110e8 Moved sitemap file to /data/cache/sitemap.xml
Sitemap creation time now determined by filemtime instead of via config
2013-02-20 00:31:52 +01:00
Drudex Software
4b4d08c854 Merge pull request #12 from shish/master
Merged shimmie2 changes
2013-02-14 20:03:39 -08:00
Drudex Software
e64f1f0bcb Update ext/sitemap/main.php
- Added setup block to choose between generating full sitemap or smaller sitemap
- Added sitemap caching, regenerating at most every day
2013-02-15 04:31:31 +01:00
Drudex Software
52893d0f04 Update ext/sitemap/main.php
- Added setup block to choose between generating full sitemap or smaller sitemap
2013-02-15 03:04:58 +01:00
Drudex Software
c90689a63e Update ext/user/main.php
- Added board config option for user login forwarding
- Set user_loginshowprofile default to 0
- now only applies when user is on a page containing post/ in its url (to avoid weird messages)
2013-02-15 02:22:09 +01:00
Drudex Software
55b0919465 Update ext/user/main.php
Also don't return to same page if page is "user_admin/login". 
Otherwise it can occur if user first failed to log in with the correct credentials
2013-02-14 23:54:23 +01:00
Drudex Software
62ad4c0ecb Update ext/user/main.php
Site owners can now choose in board config what page users will go to when logging in:
- Previous page (default)
- My Profile (old default)
2013-02-14 22:34:43 +01:00
Shish
9fbc31dbf2 Merge branch 'master' of https://github.com/shish/shimmie2 2013-02-11 08:16:06 +00:00
Shish
9d5fed4a94 sneaky update 2013-02-11 08:15:28 +00:00
DrudexSoftware
59ec209c4a Caching not working properly for various reasons, removed for now 2013-02-11 08:43:06 +01:00
Drudex Software
b7b8786f18 Remade the sitemap extension
- now makes full sitemap with specific with higher priorities for newer/more popular content
- Sitemap is cached for 6 hours
several things still need to be added
2013-02-10 17:41:19 +01:00
Shish
69cdece64a Merge pull request #277 from DrudexSoftware/master
Google Analytics
2013-02-09 07:47:54 -08:00
Shish
5056ac2789 make sortable tables slightly more obvious 2013-02-09 10:36:58 +00:00
Shish
ffdca16b30 read-ness column on PM table, for sorting 2013-02-09 10:35:59 +00:00
Shish
4366d3e3e9 Merge branch 'master' of https://github.com/shish/shimmie2 2013-02-09 10:28:14 +00:00
Shish
e69b72dfd3 only use >> quotes at the start of lines 2013-02-09 10:27:37 +00:00
Shish
4fe7855a70 nicer formatting for tag history log 2013-02-09 10:27:25 +00:00
Shish
279c3dd61a max-width 100% for images inside comments 2013-02-09 10:26:55 +00:00
Shish
ff39a1df91 explicit sorting for PM list 2013-02-09 10:26:30 +00:00
Drudex Software
c0e51b5f0c unnecessary code removed 2013-02-08 22:18:19 +01:00
DrudexSoftware
c709e12440 Google Analytics Integration
allows users to optionally use google analytics tracking in shimmie by
simply entring the analytics id in the board config.
2013-02-07 21:41:01 +01:00
Shish
dbfd747dd3 remove more slashes 2013-02-06 08:36:30 +00:00
Shish
6dc39fe39f show some extra help if there are no DB engines available 2013-02-06 08:24:01 +00:00
Shish
c9491ad714 Get SQLite:scoreql_to_sql to return something 2013-01-31 08:07:19 +00:00
Shish
06832bae48 Actually, that causes warnings in other versions; use the static version 2013-01-24 10:52:35 +00:00
Shish
7768e94c7c Merge pull request #275 from DrudexSoftware/patch-1
Invalid operator causing error
2013-01-24 02:47:04 -08:00
Stijn Raeymaekers
160bdb3553 Replaced invalid operator
Caused all images and some other pages to get the following error:
syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM
2013-01-24 11:08:34 +01:00
Shish
471bc1805a escape title too 2013-01-04 22:40:16 +00:00
Shish
1664f932fe Merge pull request #269 from pachuco/master
Comment extension
2013-01-04 14:43:52 -08:00
Shish
17cd89455d Merge pull request #270 from Diftraku/master
Fix PHP errors about Strict Standards
2012-12-31 13:08:58 -08:00
Shish
78442e96c3 add daily cache breakage to gravatars 2012-12-30 18:08:58 +00:00
Shish
6a5b92502b Log user creation with created user 2012-12-30 16:04:05 +00:00
Shish
da11cc5d05 better error handling for report image 2012-12-30 16:00:55 +00:00
Shish
35a3986c35 compatible declrations for danbooru theme 2012-12-30 15:46:25 +00:00
Diftraku
09a18b8710 Fix errors about PHP complaining of strict standards, Pools extension needs an overhaul due to display errors being different in BaseThemelet than it is in the ext/pools/main.php 2012-12-26 20:35:00 +02:00
pachuco
15de0f7732 Added page title. 2012-12-19 01:18:30 +02:00
Shish
9ef73748de Merge pull request #268 from pachuco/master
Comment extension fix
2012-12-18 11:03:17 -08:00
pachuco
ef8c60f032 Things were fetched from the currently logged user instead of the viewed one. My bad. 2012-12-18 17:29:07 +02:00
Shish
31cfb00b15 readme update 2012-12-11 00:10:27 +00:00
Shish
cebebcd975 Merge branch 'master' of https://github.com/shish/shimmie2 2012-12-10 21:28:44 +00:00
Shish
5a3b4dae49 normalise usernames 2012-12-10 21:28:41 +00:00
Shish
80bdc565dd truncate filenames on insert 2012-11-24 20:01:14 +00:00
Shish
acbbad2f80 Merge pull request #266 from pachuco/master
Comment extension fixes
2012-11-24 11:46:43 -08:00
pachuco
cfe3fabd6d *Index link fixed in uaser and site comment navigators
*No bloody idea why I added the assertions in display_all_user_comments();
*Commented out some doohickey thing that did something and borke other stuff
*Added index link and paginator in user comment list
2012-11-24 20:36:00 +02:00
pachuco
f6f2638003 *Total number of pages correctly calculated for user comments
*Page number sanity checks for both user comments and site comments
2012-11-24 20:28:49 +02:00
Shish
f30e34861d Merge pull request #264 from green-ponies/master
Fix for Issue 263 - Reversed ReCaptcha keys
2012-11-04 01:00:25 -08:00
green-ponies
ef44d6ccf3 Fix for issue 263 - ReCAPTCHA private and public keys reversed. 2012-11-03 13:49:10 -04:00
Shish
fff8318f1f offset after limit 2012-10-17 00:05:48 +01:00
Shish
d8c670eaa6 move yet more stuff out of index.php 2012-10-16 23:05:11 +01:00
Shish
b141632785 some mock objects, for testing (coming soon, maybe) 2012-10-16 22:58:47 +01:00
Shish
38fea60056 handle CLI_LOG_LEVEL not being set 2012-10-16 22:58:24 +01:00
Shish
073b21aaa1 split up event listener loading, so parts can be called individually 2012-10-16 22:31:50 +01:00
velocity37
44bcf6f322 Handle MP3: Use getID3() for validation, Fuzzy MP3 Detection + ID3 Reader 2012-10-16 21:42:21 +01:00
velocity37
afd75f1134 getID3: Boolean to force MP3 check
Apparently MP3 encoders can muck up an MP3 file pretty bad. getID3 can
read these files, but it takes extra work and thus is only done if the
file carries a relevant extension. Shimmie's files don't have an
extension, so a boolean was added to analyze() in order to force this
check.
2012-10-16 21:42:20 +01:00
velocity37
c9bacdf56d Handle Video: Flash/HTML5 video player
Requires getID3() and Jaris FLV Player
2012-10-16 21:42:20 +01:00
Shish
6cbf1b7865 requirement bump, 5.3 should be common by now 2012-10-16 21:24:39 +01:00
velocity37
1a55d997e3 Bulk_add_csv: add note about custom thumbnails 2012-10-16 19:52:08 +01:00
velocity37
c42cc57977 Bulk_add_csv: add custom thumbnail support 2012-10-16 19:36:55 +01:00
velocity37
52718b0590 util.inc: Default to static extension lookup
Magic can return invalid results for video files, breaking their playback. Default to the static extension lookup to avoid this problem but still return application/octet-stream if nothing works.
2012-10-16 18:56:39 +01:00
velocity37
0663bf54a0 Grr... 2012-10-16 18:55:43 +01:00
velocity37
1bd6f9f0ba Update core/util.inc.php 2012-10-16 18:55:38 +01:00
velocity37
fcdf784acc Update static thumb + bug fix
Add videos to static thumb and make Shimmie compare lowercase extensions.
2012-10-16 18:55:23 +01:00
velocity37
412dcd05af Add video MIME types 2012-10-16 18:55:00 +01:00
Shish
112130b8ad the start of full per-user comment history 2012-10-15 21:48:55 +01:00
Shish
0ae4ef4110 get source from POST[source], if set 2012-10-15 20:21:09 +01:00
Shish
14da124fdb this should be here, I presume 2012-10-15 19:05:25 +01:00
Shish
c6e5a4046a Merge branch 'master' of github.com:shish/shimmie2 2012-10-15 19:04:09 +01:00
Shish
3e516e143c cleaner image hash ban handling, allow specifying hash or ID 2012-10-15 19:03:59 +01:00
Shish
936c1a65ca fix off-by-ones 2012-10-06 15:59:13 +01:00
Shish
1acf839902 Merge pull request #260 from pachuco/master
Forum extension updates.
2012-10-06 07:58:11 -07:00
Shish
6abf65c062 option for making samefags public 2012-10-03 21:28:29 +01:00
Shish
e00299b376 autofocus for search box on front page 2012-09-25 23:20:52 +01:00
Shish
f59ea82e0e Merge pull request #259 from Agasa/patch-1
Update MassTagger redirect to reload page
2012-09-25 10:51:06 -07:00
pachuco
d333345a2c *Cosmetic changes to thread posts.
*Return link to forum index in thread page.
*Fixed pesky undefined $oe in theme.php.
*Reordered paginator for accessability
*Numbered posts.
2012-09-25 20:37:20 +03:00
pachuco
1db92e6f2a Some CSS love. 2012-09-25 20:34:50 +03:00
pachuco
9cebef5a50 *Inexistent threads are no longer accesible.
*Pages outside index cut to last one(thread index and threads).
*Return to last page in thread after posting reply.
2012-09-25 20:33:56 +03:00
Shish
e3d385aee5 Merge branch 'master' of github.com:shish/shimmie2 2012-09-24 22:36:28 +01:00
Shish
ac812b4a2a danbooru api updates 2012-09-24 22:36:09 +01:00
Agasa
af9d5ed185 Update MassTagger redirect to reload page
Modified Mass Tagger extension to make it so that instead of redirecting to post/list it reloads the page instead, unburdening the user from a click on Back and manually reloading.
2012-09-24 12:02:22 +03:00
Shish
65ce0ff4e4 check filename extension by lowercased version of itself 2012-09-22 23:24:19 +01:00
Shish
06426bdfe6 when checking mime types, use the filename.ext from the DB, not the (non-existent) .ext on disk 2012-09-22 23:15:25 +01:00
Shish
bbe2b1dc46 don't need to load the file into memory if we're responding with '304 not modified'... 2012-09-22 23:10:29 +01:00
Shish
5c30eab6ad merge Agasa's mass tagger work (replace tags mode, as opposed to the default of adding) 2012-09-22 22:58:56 +01:00
Shish
01aacdb19c admin function for fixing tag cases 2012-09-03 12:06:11 +01:00
Shish
c57801bce7 wildcards aren't regular tags either 2012-09-03 11:13:08 +01:00
Shish
da0bb2d65e Merge branch 'master' of github.com:shish/shimmie2 2012-09-03 10:49:35 +01:00
Shish
11340ca6da regen thumbs permission hack 2012-08-25 20:28:34 +01:00
Shish
35ad3057bd Merge pull request #257 from velocity37/master
merge bulk_add_csv extension
2012-08-25 09:56:05 -07:00
velocity37
86402f681c bulk_add_csv: bulk_add with metadata
Imports a CSV with:
path,tags,source,rating

It is basically bulk_add with an fgetcsv loop instead of a foreach glob.
I wanted an easy way to import tagged data from other sources.
2012-08-23 17:03:46 -07:00
Shish
902d0adbd7 Merge pull request #256 from velocity37/master
Resolution for Issue #254 (path to `convert` binary accidentally hardcoded)
2012-08-22 01:00:24 -07:00
velocity37
624468851e Only show thumb_convert_path if using ImageMagick 2012-08-21 19:00:25 -07:00
velocity37
a2e1edded5 Actually use thumb_convert_path
The check would always fail even on Windows, resulting in thumb_convert_path never being used. See:
https://github.com/shish/shimmie2/issues/254
2012-08-21 18:51:20 -07:00
velocity37
10fadb27d1 Make thumb_convert_path not Windows-specific 2012-08-21 18:46:34 -07:00
velocity37
d154b38680 Add thumb_convert_path to Board Config 2012-08-21 18:42:14 -07:00
Shish
99e431598c streamline rotation 2012-08-18 21:12:44 +01:00
Shish
7ec7ca623b rotate ext from Agasa 2012-08-18 21:10:35 +01:00
Shish
0d2c78939e streamline resize image process 2012-08-18 21:09:40 +01:00
Shish
216dada347 somehow ImageIOTheme wasn't extending Themelet, and things mostly worked... 2012-08-18 20:56:35 +01:00
Shish
b538fd4e27 make the forum not *completely* broken... 2012-08-18 20:43:55 +01:00
Shish
82d74b5719 report SCore errors as errors... 2012-08-18 20:36:54 +01:00
Shish
c1fbf128c9 hackily fix non-niceurl'ed tests 2012-08-18 20:31:13 +01:00
Shish
27c06f02ce remove debugging thing 2012-08-18 20:29:45 +01:00
Shish
0fd8157e5e part way towards running tests from the CLI 2012-08-18 20:27:12 +01:00
Shish
89a0308007 a terrible hack, because subclasses can't add optional extra params... 2012-08-18 19:55:52 +01:00
Shish
68e2ca798e make futaba:view:display_page make ext:view:display_page 2012-08-18 19:48:51 +01:00
Shish
5ddd358d5f don't user build_thumb_html statically 2012-08-18 19:47:57 +01:00
Shish
7dd929e5a8 remove a whole load of event->user variables that weren't used -- things should be using global user 2012-08-18 19:45:39 +01:00
Shish
f3aad43fa3 merge the two List Controls blocks 2012-08-18 19:23:11 +01:00
Shish
6fcdf4717e Merge branch 'js-classes' 2012-08-15 21:26:56 +01:00
Shish
5022d2b965 more tags, more opera glitch workarounds 2012-08-15 21:19:51 +01:00
Shish
887c746e35 mass tagger -> shm-*, specify what data tags shm-thumb has, now it works with all themes 2012-08-15 21:05:08 +01:00
Shish
6394cd8100 make shm-thumb use consistent across themes, with data-tags and data-post-id 2012-08-15 20:42:56 +01:00
Shish
8c39c29528 make tag hiding a little more consistent 2012-08-15 20:22:25 +01:00
Shish
ec16baecfe make some over-eager CSS more controlled 2012-08-15 20:20:26 +01:00
Shish
d22d8e033e playing with eclipse... 2012-08-15 20:11:10 +01:00
Shish
d6f15527e2 playing with eclipse... 2012-08-15 20:08:16 +01:00
Shish
4470d937a4 handle_pixel -> shm-* 2012-08-15 19:46:51 +01:00
Shish
f5d787efbf while we're here, fix the blotter in general... 2012-08-15 19:46:36 +01:00
Shish
61e9909327 hardcoded config too (unrelated) 2012-08-15 18:31:28 +01:00
Shish
fd4e801756 convert blotter to use ui-* and shm-* 2012-08-15 11:13:25 +01:00
Shish
6717639caa update readme to clarify ui-* and shm-* 2012-08-15 10:43:28 +01:00
Shish
fed253dc18 sort bans by add date 2012-07-28 12:07:55 +01:00
Shish
112422a2ca time and timestamp are incompatible 2012-07-28 12:07:46 +01:00
Shish
7e8cf48b08 and trigger the update... 2012-07-28 11:59:11 +01:00
Shish
acf285bd68 IPs are variable length 2012-07-28 11:57:22 +01:00
Shish
49a1ae94b6 ban IP as an inet type 2012-07-28 11:56:55 +01:00
Shish
442e1a0de1 stricter data for ban adding 2012-07-28 11:42:07 +01:00
Shish
0a73424679 Merge branch 'master' of github.com:shish/shimmie2 2012-07-28 11:12:40 +01:00
Shish
ee52d582c4 image replacing simplicity 2012-07-28 11:12:05 +01:00
Shish
a9bfd1bcdc break 2012-07-24 20:38:10 +01:00
Shish
8b83b90b53 make tags required in the HTML form 2012-06-27 11:13:36 +01:00
Shish
53ad7d4a2f more sqlite, and indexes 2012-06-27 00:08:51 +01:00
Shish
685c1248d9 use PDO to check PDO drivers 2012-06-26 23:51:05 +01:00
Shish
02a286cba0 sqlite updates 2012-06-26 23:46:38 +01:00
Shish
3a8269baf3 lots of installer improvements 2012-06-26 23:37:29 +01:00
Shish
b85387208e remove non-functional repair console 2012-06-26 22:21:45 +01:00
Shish
19ca8b7b9f Merge branch 'master' of github.com:shish/shimmie2 2012-06-26 20:24:58 +01:00
Shish
951da261e8 Use the same 'create new image' block for post/list and oekaki pages 2012-06-26 20:00:38 +01:00
Shish
7391dcf0b6 configuarable oekaki size, and more consistent creation 2012-06-26 19:58:35 +01:00
Shish
80673b73ec re-arrange oekaki bits for better permissions 2012-06-26 19:47:40 +01:00
Shish
756de7b023 Merge pull request #243 from pachuco/master
Oekaki extension tweaks
2012-06-26 11:43:18 -07:00
Shish
cd693630a3 width: 100% + shadows fails 2012-06-26 19:41:20 +01:00
Shish
b82fd133fc Merge branch 'master' of github.com:shish/shimmie2 2012-06-26 19:38:53 +01:00
Shish
a3d77c6f42 firefox ignores file upload width attribute :| 2012-06-26 19:38:22 +01:00
Shish
287cea7959 >> = quote... 2012-06-26 19:38:02 +01:00
pachuco
6453c767ef Added ability to input resolution both in post index and oekaki page, as well as a little warning about losing canvas contents. 2012-06-24 23:25:46 +03:00
pachuco
6b6f60faca Authors of updated iconset credited.
Icons taken from https://github.com/CatoTH/ChibiPaint-Animexx-Edition
2012-06-24 23:22:14 +03:00
pachuco
e1c04facdb Users with insufficient privileges are now unable to use oekaki. 2012-06-24 23:21:22 +03:00
pachuco
4535299b2a Replaced icons with something actually bearable.
Updated internal readme to credit authors.
Taken from https://github.com/CatoTH/ChibiPaint-Animexx-Edition
2012-06-24 23:19:06 +03:00
Shish
f9008a70a6 refactoring fail 2012-06-24 07:13:53 +01:00
Shish
0bc4ebafa5 somewhat excessive caching for index pages 2012-06-24 02:07:59 +01:00
Shish
8dfeb7cda3 longer cache timings, with better invalidation 2012-06-24 01:57:12 +01:00
Shish
6c4fd0d14d remove ancient non-comment 2012-06-24 01:49:53 +01:00
Shish
9ca07641d2 build_thumb_html can't be called statically 2012-06-24 01:13:24 +01:00
Shish
a640de5283 a little extra error checking 2012-06-24 01:11:07 +01:00
Shish
38f7555d98 get rid of direct references to Database's engine 2012-06-24 00:57:55 +01:00
Shish
d313cea8a7 create the DB connection on demand; some pages don't require one at all thanks to caching 2012-06-24 00:50:13 +01:00
Shish
98e7acc529 let database class handle transactions, index.php need not know about database->db 2012-06-24 00:27:53 +01:00
Shish
dd505e556e avoid using magic internal database->db value 2012-06-24 00:27:21 +01:00
Shish
bcfcca7cda checking the engine can trigger a database init... 2012-06-24 00:25:47 +01:00
Shish
008cc4253b wibble database / cache connection functions, make them repeatable, and set persistant DB connections as an option 2012-06-23 23:57:34 +01:00
Shish
63437d1e09 cache user sessions 2012-06-23 23:38:28 +01:00
Shish
1c5bf478d9 initialise global _execs, else we get 'page used queries' when we want 'page used 0 queries' 2012-06-23 23:37:41 +01:00
Shish
d87e53ab90 cache reported image count 2012-06-23 23:28:38 +01:00
Shish
5a93e650c1 make sure featured image object is fully populated before caching, else it still lazy-queries tags each time 2012-06-23 23:25:53 +01:00
Shish
ee1162309a block caching 2012-06-23 23:21:04 +01:00
Shish
d3e2653002 some cached values are often zero (eg unread PMs), 'zero' is still a cache hit though, only 'false' is miss 2012-06-23 23:17:17 +01:00
Shish
1daf0416bd optionally run jpegoptim on newly created thumbs 2012-06-23 23:02:02 +01:00
Shish
f61b4b3fcb proper setup bits for livefeed 2012-06-22 22:30:22 +01:00
Shish
16f1c06734 more livefeed tweaks - put the URL first for consistency 2012-06-22 20:04:12 +01:00
Shish
6181d59975 that slash needs to be there >_< 2012-06-22 20:02:53 +01:00
Shish
64e2b88b0a remove theme dependencies on private _get_internal_parts 2012-06-22 19:37:23 +01:00
Shish
2e897e097d live feed tweaks 2012-06-22 19:32:41 +01:00
Shish
8dcd56e0ec udp log_net, because it's faster and more elegant 2012-06-22 19:19:13 +01:00
Shish
7ed7f4bbb8 Merge branch 'master' of github.com:shish/shimmie2 2012-06-22 19:14:15 +01:00
Shish
9291601a30 livefeed extension 2012-06-22 19:13:57 +01:00
Shish
029719cafe statsd ext, for trivially making graphs of site activity 2012-06-22 18:34:23 +01:00
Shish
4b2cba4642 bulk add uses tags from filename if filename is '123 - tag1 tag2 tag3.ext' folder name otherwise 2012-06-21 09:11:26 +01:00
Shish
e7df4edbee slashes are removed already 2012-06-21 09:07:52 +01:00
Shish
3c710289b7 fff, javascript object model >_< 2012-06-21 09:06:58 +01:00
Shish
2a18da523c the define wibbling for hiphop seems to work now 2012-06-18 01:23:31 +01:00
Shish
fd5b4c5910 more re-organisation for create_monolith / hiphop friendliness 2012-06-18 01:06:36 +01:00
Shish
553aad8a36 cache vars do nothing 2012-06-18 00:51:09 +01:00
Shish
78d701dd53 move stuff about to make create_monolith simpler 2012-06-18 00:45:32 +01:00
Shish
8173a7cafd clear event listener cache when exts change 2012-06-18 00:29:41 +01:00
Shish
a9b3ffe0eb start of command-line ext manager 2012-06-18 00:27:58 +01:00
Shish
930de7fc8c remove built-in full-page caching; it doesn't do much any more, and everything it does do can be done better by Varnish 2012-06-18 00:07:12 +01:00
Shish
5519c3a320 lots of tidying and removal of duplicate code 2012-06-18 00:00:21 +01:00
Shish
082e6fa31b nice, event-based command line support; try 'php index.php' for info 2012-06-17 20:06:02 +01:00
Shish
427175983b don't pre-populate the ban lists with fake data, things get confused 2012-06-17 18:50:46 +01:00
Shish
1065a1915d bold for *unread* PMs 2012-06-10 18:40:30 +01:00
Shish
4a6f9f3245 say who a PM is from 2012-06-10 18:18:50 +01:00
Shish
f8cc785560 flashes for user changes 2012-06-10 18:13:22 +01:00
Shish
97d280501c image ban messages 2012-06-10 17:57:57 +01:00
Shish
8c1e495ab7 better IP Ban logging 2012-06-10 17:49:17 +01:00
Shish
b0c46b63ca make flash a common element 2012-06-10 17:46:47 +01:00
Shish
239e028662 flash messages everywhere~ 2012-06-10 04:21:03 +01:00
Shish
61754b8dfe add a type arg, even if it's not used yet 2012-06-10 01:05:03 +01:00
Shish
37b3dd60b6 flash_message(str) function and support in themes 2012-06-09 17:00:25 +01:00
Shish
a38aaba328 postgres has microseconds, which is overkill to display 2012-06-09 16:25:51 +01:00
Shish
82cc77817a delete comments by IP 2012-06-09 16:08:29 +01:00
Shish
5186601805 wording 2012-06-09 16:08:15 +01:00
Shish
b1e5ba794b update comment styles for new classes 2012-06-09 15:52:28 +01:00
Shish
2542051bc4 show user classes 2012-06-09 15:25:07 +01:00
Shish
16f557954d slow down crawlers to 1/3 hit/s; nginx will 503 if more than 1/2 hit/s 2012-06-05 13:12:58 +01:00
Shish
8de1bd0c56 different classes for different types of comment list 2012-06-05 13:11:15 +01:00
Shish
e89c14c72c Merge branch 'master' of github.com:shish/shimmie2 2012-06-05 13:09:31 +01:00
Shish
d167d25942 don't add navblock if there is already one 2012-05-28 10:03:17 +01:00
Shish
5d431b9b03 apparently 'false' is an object with length, and the length is 1. Fuck PHP. 2012-05-28 09:55:55 +01:00
Shish
a809e95ff1 anonymous functions are php 5.3, shimmie aims for 5.2.6 2012-05-28 09:46:16 +01:00
Shish
4f8332f3f7 use the global and well tested make_http() rather than local hostify() 2012-05-23 11:50:04 +01:00
Shish
5fdb54c9ec missed a couple of big globs 2012-05-23 11:35:30 +01:00
Shish
bfd4ddea17 check for classes being loaded, not files existing 2012-05-23 10:39:21 +01:00
Shish
2e76add61b enhance zglob to allow really long patterns 2012-05-22 12:46:56 +01:00
Shish
cb8b4f3329 have a single var for memory limit 2012-05-22 12:26:47 +01:00
Shish
61f3a9d372 Merge branch 'master' of github.com:shish/shimmie2 2012-05-22 12:15:14 +01:00
Shish
2d451224dd only one of tags/image-specific-tags needs filling 2012-05-22 12:14:46 +01:00
Shish
545f5234bb less nesting, 25% speed gain 2012-05-16 07:36:20 +01:00
Shish
708b117b2a caching for related tags 2012-05-16 06:33:04 +01:00
Shish
4cbd00c039 Merge branch 'master' of github.com:shish/shimmie2 2012-05-16 05:32:56 +01:00
Shish
fd725d3363 merge image ID lists before scanning the images table, not after 2012-05-16 05:12:19 +01:00
Shish
2347b1fab8 fff. 2012-05-14 11:12:50 +01:00
Shish
f7e25daeb5 move getMimeType to utils 2012-05-14 06:43:23 +01:00
Shish
e07bf2500b warm setup theme 2012-05-12 10:10:58 +01:00
Shish
23fe15e8cd clear CSS cache on theme changes 2012-05-12 10:04:17 +01:00
Shish
854a5d9833 ratings is not necessarily installed... 2012-05-12 09:50:55 +01:00
Shish
1ae3c8e0ba Merge branch 'master' of github.com:shish/shimmie2 2012-05-08 18:45:41 +01:00
Shish
216d137064 when uploading an archive, say the file was handled 2012-05-08 18:32:55 +01:00
Shish
495a7bcaec Merge pull request #218 from DakuTree/master
Small Bug Fix
2012-05-03 09:57:33 -07:00
Shish
93281b17c2 example of anon with comments 2012-05-03 14:55:13 +01:00
Daku
3618c2dbb9 forgot to removing testing :x 2012-05-02 21:13:37 +01:00
Daku
d6de529ca5 should work properly with lite theme now.. 2012-05-02 20:48:39 +01:00
Shish
3082266a94 Merge branch 'master' of github.com:shish/shimmie2 2012-04-28 11:02:40 +01:00
Shish
1c7bb653de example of a moderator class 2012-04-28 11:02:12 +01:00
Shish
18e8300647 Merge pull request #214 from green-ponies/master
3 for 1
2012-04-20 15:29:53 -07:00
green-ponies (jgen)
3902036477 Avoid breaking things. 2012-04-18 02:20:42 -04:00
green-ponies (jgen)
2fcc271f3d Small typo. 2012-04-18 01:17:44 -04:00
green-ponies (jgen)
1615f79be4 Examine integers separately. Also, don't break search. >_< 2012-04-18 00:56:11 -04:00
green-ponies (jgen)
caec1ac824 Support multiple databases as well. 2012-04-18 00:55:39 -04:00
green-ponies (jgen)
dd88127c30 Undoing this commit: Removing unnecessary call to int_escape(). Simply cast to int inline, saving function call overhead. 2012-04-18 00:54:18 -04:00
green-ponies (jgen)
f8832a5024 Merge branch 'filter_var' 2012-04-16 16:46:38 -04:00
green-ponies (jgen)
3b6e113e8b Merge branch 'mime_types' 2012-04-16 16:46:27 -04:00
green-ponies (jgen)
a79875c1eb The idn_to_ascii() function is only supported by PHP version 5.3 and up. 2012-04-16 16:42:32 -04:00
green-ponies (jgen)
540e82a27a Actually use the mime type. 2012-04-15 20:00:27 -04:00
green-ponies (jgen)
0c37be79a0 Actually get the proper mime type for a given file.
(FIXME: now we handle more than just images)
2012-04-15 19:55:06 -04:00
green-ponies (jgen)
a0a0ba5bbc A better version of bool_escape() that uses filter_var if possible.
Also removed undb_bool() as it was basically a copy of the old bool_escape function.
2012-04-15 19:28:27 -04:00
green-ponies (jgen)
372f4fad7c Use filter_var for function url_escape($input). 2012-04-15 18:59:23 -04:00
green-ponies (jgen)
a82f9382d1 Removing unnecessary call to int_escape(). Simply cast to int inline, saving function call overhead. 2012-04-15 18:40:06 -04:00
green-ponies (jgen)
8aff5c39ce Fix for mass_tagger when Nice URLs are enabled. 2012-04-15 18:24:25 -04:00
green-ponies (jgen)
a2b94b31dd Collect information on the Thumbnail engine as well. 2012-04-09 17:11:03 -04:00
green-ponies (jgen)
5cacf852e2 Check if the database has any existing tables before installing. 2012-04-09 16:43:12 -04:00
Shish
f81fa08077 source search 2012-04-05 17:33:50 +01:00
Shish
df4ab51dd9 ban bad phrases from appearing in tags and source too 2012-04-05 17:22:06 +01:00
Shish
fdb6727f41 don't fail at multiple searches on the same param (eg 'id>=X id<=Y') 2012-04-05 16:18:41 +01:00
Shish
2a8643d06e Merge branch 'master' of github.com:shish/shimmie2 2012-04-05 15:20:38 +01:00
Shish
03795e7d1c if user has no votes, don't delete all their votes 2012-04-05 15:20:04 +01:00
Shish
6991bb9462 tag_editcloud breaks 'for i in array' 2012-04-03 03:52:17 +01:00
Shish
14770e4733 show stats *after* gathering them 2012-04-01 20:47:59 +01:00
Shish
e24b144acb test updates 2012-04-01 18:47:14 +01:00
Shish
2831f61489 clean up even if the mass delete fails 2012-04-01 18:17:33 +01:00
Shish
678215e4bd width / height were never used individually, now just have images 2012-04-01 17:47:39 +01:00
Shish
84cdd21e09 don't try to load notes if there are no notes 2012-04-01 17:32:02 +01:00
Shish
d80d81ea78 move jquery libs to lib/ 2012-04-01 17:09:46 +01:00
Shish
2fc4292cef expiring images is advanced, and also rarely used as people should have niceurls 2012-04-01 16:58:42 +01:00
Shish
19fb6a16ae image zoom isn't an admin option any more 2012-04-01 16:53:47 +01:00
Shish
d1a4c32ef6 only test enabled exts 2012-04-01 16:45:12 +01:00
Shish
cf5e35bd2d simpletest updates broke things... 2012-04-01 16:41:05 +01:00
Shish
070ba8c276 test improvements 2012-04-01 16:37:38 +01:00
Shish
664e6fa509 *image_ad* is blocked by opera, which makes use of image_admin a pain... 2012-04-01 16:06:11 +01:00
Shish
ab128b4b24 make non-nice images work 2012-04-01 15:55:48 +01:00
Shish
17c85ba549 remove jquery-ui, drops the JS bundle size by ~40% 2012-04-01 15:50:07 +01:00
Shish
7ad3ae55f9 inet = char(45) in mysql, to fit IPv6 addrs 2012-04-01 15:44:43 +01:00
Shish
74efe26e19 Merge branch 'master' of github.com:shish/shimmie2 2012-04-01 14:58:21 +01:00
Shish
eb05458c9f change user class / delete user separate from admin 2012-03-31 19:25:27 +01:00
Shish
4a95f502f8 fix includes 2012-03-31 19:07:45 +01:00
Shish
75abdc7c04 store enabled exts in a config file, rather than moving directories around 2012-03-31 19:07:05 +01:00
Shish
67f1c1c51d store enabled exts in a config file, rather than moving directories around 2012-03-31 18:59:28 +01:00
Shish
15df989f72 nicer error reporting 2012-03-31 17:07:11 +01:00
Shish
55d8d16ee8 suggest a perm when dev typos 2012-03-31 17:06:53 +01:00
Shish
81c7ac0120 mass source set perm 2012-03-31 16:31:10 +01:00
Shish
ac692cfff7 whitespace 2012-03-31 16:28:54 +01:00
Shish
1d648d0d32 remove redundant code 2012-03-31 15:54:29 +01:00
Shish
1673e8e7ef et perm 2012-03-31 15:48:29 +01:00
Shish
38802c61cf more perms 2012-03-31 15:47:00 +01:00
Shish
9cebbae6b8 show delete link if user can delete comments 2012-03-31 15:46:21 +01:00
Shish
5a2a2fa7e4 more removal of distinct classes 2012-03-31 15:43:25 +01:00
Shish
e6c8fb2de4 installer style 2012-03-31 13:56:06 +01:00
Shish
b17d8b2244 typo 2012-03-31 13:19:11 +01:00
Shish
567755a185 Merge branch 'master' of github.com:shish/shimmie2 2012-03-31 12:38:44 +01:00
Shish
11372366ad gravatar note 2012-03-31 12:38:39 +01:00
Shish
4856af9c49 more perms 2012-03-31 12:33:55 +01:00
Shish
7ef52c853f more perms 2012-03-31 12:28:34 +01:00
Shish
f7f70b8600 more perms 2012-03-30 20:54:33 +01:00
Shish
45772b9b7e Merge branch 'master' of github.com:shish/shimmie2 2012-03-30 20:28:20 +01:00
Shish
62e13eda96 always create 2012-03-30 20:28:09 +01:00
Shish
c2de49c248 tag list caches in data/cache 2012-03-30 18:35:05 +01:00
Shish
7cbb62c8cc move data to data folder 2012-03-30 18:21:35 +01:00
Shish
29cebb44f9 event_listeners is a bit of cached data 2012-03-30 18:07:40 +01:00
Shish
a989743849 put imgdump in a writable folder 2012-03-30 18:05:59 +01:00
Shish
596d7e6537 unignore bits, these should be in data 2012-03-30 18:05:02 +01:00
Shish
fd094050fc move config file to data 2012-03-30 18:03:55 +01:00
Shish
bf39c8f09f coalesce on remove individual vote too 2012-03-30 17:48:03 +01:00
Shish
094002c442 remove blank lines 2012-03-30 17:44:59 +01:00
Shish
447d42d454 more layout bits 2012-03-30 17:20:15 +01:00
Shish
7bf273a1ee event log layout 2012-03-30 17:18:01 +01:00
Shish
72b7586c10 Merge branch 'master' of github.com:shish/shimmie2 2012-03-30 16:41:42 +01:00
Shish
e210fe739b more spaced out priorities 2012-03-30 16:41:25 +01:00
Shish
e538181fa1 add alias after finishing the mass tag edit 2012-03-30 16:40:14 +01:00
Shish
51a59fef07 Tag::implode / explode 2012-03-30 16:29:52 +01:00
Shish
036939eea4 Merge pull request #195 from DakuTree/master
API/Theme compatability.
2012-03-30 07:15:53 -07:00
Daku
a825c1cd46 this seemed to cause the info block to move above the image.. 2012-03-30 05:18:08 +01:00
Daku
546b7ea21e blocked tags will also set thumbblock div to 0 if theme is lite 2012-03-30 05:05:16 +01:00
Daku
7bb769917f lite should now work a bit better with blocked tags 2012-03-30 05:04:40 +01:00
Daku
2d22887c34 user should be able to calculate uploads/comments perday with data provided, so no need to include in api 2012-03-30 03:04:00 +01:00
Daku
44ce23208a tags in tag history now have links to search 2012-03-30 03:03:59 +01:00
Daku
45365f7eb5 less errors 2012-03-30 03:03:59 +01:00
Daku
60666f9300 getuser now returns latest 5 images 2012-03-30 03:03:58 +01:00
Shish
e7fc084f44 log mass tag edits 2012-03-29 21:31:04 +01:00
Shish
d7578e754f test for mass tag edit 2012-03-29 21:12:24 +01:00
Shish
761c733c57 coalsce when cleaning votes 2012-03-29 19:18:00 +01:00
Shish
7a6ef55114 bleh, source validation. Anything is allowed and it's only linked on output if appropriate 2012-03-25 04:45:47 +01:00
Shish
893afe5b61 Merge branch 'master' of github.com:shish/shimmie2 2012-03-25 04:12:31 +01:00
Shish
f2f5ec720d debugging 2012-03-25 04:11:40 +01:00
Shish
cd8ec7bf41 sort alias CSV file the same way as the table 2012-03-25 03:32:32 +01:00
Shish
b628bcfa86 user deletion event, with vote deletion 2012-03-25 02:41:33 +01:00
Shish
ed4dc632e6 Ugh, PDO doesn't support arrays... 2012-03-25 02:29:45 +01:00
Shish
266f3c4a9a quotes on single lines 2012-03-25 02:20:51 +01:00
Shish
5efdbdeb91 set zoomer val on shotcut too 2012-03-24 23:34:00 +00:00
Shish
1d4836e6c4 toggle zoom on click 2012-03-24 23:30:19 +00:00
Shish
8336fbfce5 and update the select box from cookie 2012-03-24 11:48:44 +00:00
Shish
0b45042161 ui- prefix for UI cookies 2012-03-24 11:23:06 +00:00
Shish
31b3113d49 ui cookie 2012-03-24 11:19:24 +00:00
Shish
eb705d29f5 image scaling cookie 2012-03-24 11:17:09 +00:00
Shish
ecad3b9891 only refresh if needed 2012-03-22 16:35:44 +00:00
Shish
f993b3c19d js cookie expires 2012-03-22 16:28:57 +00:00
Shish
cfe0547755 force reflow after hiding some thumbs 2012-03-22 15:44:04 +00:00
Shish
898df24dd9 function for selecting blocks 2012-03-22 14:19:46 +00:00
Shish
2226bc9f15 hide thumbnails with given tags 2012-03-22 13:40:13 +00:00
Shish
da786ee3c1 tags on thumb element 2012-03-22 13:18:15 +00:00
Shish
1085925504 css=style, js=script 2012-03-22 12:30:02 +00:00
Shish
45beb5a925 lack of semicolon breaks script combining 2012-03-22 12:28:32 +00:00
Shish
88767b4c96 syntax 2012-03-22 12:15:03 +00:00
Shish
b156d4f380 no need for 'load files in a good way' to be optional, just do it 2012-03-21 15:04:17 +00:00
Shish
033540e6f8 if this->count is checked inside event->pri, then checking again for count *is* necessary... 2012-03-19 22:25:57 +00:00
Shish
e4e95a3a85 suppress the flood of 'suppressing flood' messages... 2012-03-19 21:19:54 +00:00
Shish
d1e8bfb749 Merge branch 'master' of github.com:shish/shimmie2 2012-03-19 21:16:09 +00:00
Shish
465fd7a123 limit to 10 irccat messages per page 2012-03-19 21:15:54 +00:00
Shish
52d0d4fd72 better log message 2012-03-19 20:59:37 +00:00
Shish
f092690945 bulk tag revert bettering 2012-03-19 20:57:50 +00:00
Shish
2677a597c9 Merge branch 'master' of github.com:shish/shimmie2 2012-03-19 20:25:22 +00:00
Shish
b9476c1ff4 put the bulk rater on the search results 2012-03-19 20:16:40 +00:00
Shish
0834dad48f SO MUCH RATING 2012-03-19 20:12:15 +00:00
Shish
58c06893e1 if the comment succeeds, we still want to set the 'user tried to comment' cookie :P 2012-03-19 20:05:19 +00:00
Shish
713c3db01a remove trailing slashes from displayed sources 2012-03-19 19:48:03 +00:00
Shish
49c0d09281 mass source setter 2012-03-19 19:42:52 +00:00
Shish
31f70251bb Merge branch 'master' of github.com:shish/shimmie2 2012-03-19 19:18:18 +00:00
Shish
8a0ce8e068 colspan for blocks' add 2012-03-19 19:18:07 +00:00
Shish
dea9747a3c if a heading is in the middle of a row, pad left too 2012-03-19 19:17:17 +00:00
Shish
57d687a7e1 give images priority 10 2012-03-19 19:09:52 +00:00
Shish
e71cf291a9 hide empty bits, not just null 2012-03-19 19:00:25 +00:00
Shish
76579ad32f default to post/list including front page 2012-03-19 18:58:50 +00:00
Shish
1a711eca83 log info 2012-03-19 18:57:33 +00:00
Shish
e3f00166a7 remove whitespace 2012-03-19 18:51:25 +00:00
Shish
d3967e5938 news ext was just a subset of blocks ext 2012-03-19 18:50:37 +00:00
Shish
02dff7fc12 docs 2012-03-19 18:43:20 +00:00
Shish
a69d80d950 generic blocks, now with database storage 2012-03-19 18:40:37 +00:00
Shish
1bfe2d3f34 notes 2012-03-19 17:48:42 +00:00
Shish
5ca1cf44ec move dangerous admin bits to util scripts package 2012-03-19 17:43:37 +00:00
Shish
cadc99ae90 delete image after adding it, not after not-adding it 2012-03-19 14:27:04 +00:00
Shish
671d5fe2ae delete the image /after/ using it... 2012-03-19 14:26:39 +00:00
Shish
f515d2b186 use score redirection 2012-03-19 14:26:16 +00:00
Shish
4db92471e1 404 for no images 2012-03-19 14:25:43 +00:00
Shish
e8b0e36b48 typo 2012-03-19 13:40:11 +00:00
Shish
ea90e21d86 wiki perms 2012-03-19 13:21:59 +00:00
Shish
ee4b223f65 comment_anon bool -> create_comment perm 2012-03-19 13:17:47 +00:00
Shish
bca3dd919d upload_anon bool -> create_image perm 2012-03-19 12:59:02 +00:00
Shish
f99c186ee5 use valid bbcode, and no need for default 2012-03-19 12:11:44 +00:00
Shish
0300065b9d default anon can do nothing 2012-03-19 11:42:56 +00:00
Shish
45bff3ff31 inherit the class, not the name 2012-03-19 11:33:06 +00:00
Shish
50a6013569 nicer custom classes 2012-03-19 11:27:01 +00:00
Shish
1a34557da7 if image replacement is unwanted, don't allow users to replace images 2012-03-19 11:07:13 +00:00
Shish
87c59ead29 more sane defaults, fewer unnecessary choices 2012-03-19 10:53:06 +00:00
Shish
a7a548f6cc remove more config options that do nothing 2012-03-19 10:43:54 +00:00
Shish
907f958f42 use user classes 2012-03-19 10:42:32 +00:00
Shish
b4140fd77b after activating an extension, there is a config option to enable it? confused 2012-03-19 10:42:16 +00:00
Shish
9004c8d555 use user classes 2012-03-19 10:41:07 +00:00
Shish
fda6fb09fa don't show options that don't do anything... 2012-03-19 10:33:42 +00:00
Shish
a826a9c81a expiration only applies without niceurls 2012-03-19 10:25:36 +00:00
Shish
b4c74c5768 Merge branch 'master' of github.com:shish/shimmie2 2012-03-19 10:21:11 +00:00
Shish
c906a6422c disk space is cheaper than rebuilding history, default to -1 2012-03-19 10:21:03 +00:00
Shish
bc4a011bff Merge pull request #188 from Yhonay/master
Fixed not loading styles
2012-03-18 10:46:23 -07:00
Onivis Yhonay d'Izeworudi
f72b8babc0 Load style.css from theme when autocache is enabled 2012-03-18 16:59:13 +01:00
Shish
154070a739 Merge branch 'master' of github.com:shish/shimmie2 2012-03-16 02:04:58 +00:00
Shish
5a3bd51b2a no fade, for speed 2012-03-16 02:04:34 +00:00
Shish
c7bc014364 log better 2012-03-15 19:30:02 +00:00
Shish
f518c608d9 lazy loading for thumbs 2012-03-15 19:26:16 +00:00
Shish
d21b9e58ab Merge branch 'master' of github.com:shish/shimmie2 2012-03-15 06:19:16 +00:00
Shish
a23498a8d7 more recently updated comments 2012-03-15 06:17:19 +00:00
Shish
537ae6de18 remove jquery deletion
jquery deletion was deleting the wrong image if there were multiple
delete buttons on one page (eg, on the report image page); also it
stands out awkwardly being the only bit of jquery UI on the site.
Moving to jquery UI across the site might happen later, but for now
I just want to get a release out...
2012-03-15 05:49:24 +00:00
Shish
6f4f4f3235 redirect back to report list after deleting, if that's where we came from 2012-03-15 05:48:42 +00:00
Shish
1a8ea4eb08 some windowses are not NT? 2012-03-15 05:34:55 +00:00
Shish
95c4d809a9 ... missed two globals >_> 2012-03-14 20:40:03 +00:00
Shish
144c1afcbc ffffff, PHP, doing something weird rather than having a userful error message 2012-03-14 20:35:15 +00:00
Shish
3acf53a32a default style:width:100% overrides width:100%. Use a local style 2012-03-14 20:28:15 +00:00
Shish
0be4f83e4e don't allow showing of metadata at all if exif_read_data is undefined 2012-03-14 20:24:34 +00:00
Shish
d820f9a927 missed a global 2012-03-14 20:21:14 +00:00
Shish
6632521218 permission name tweaks 2012-03-14 19:24:10 +00:00
Shish
cf7d1dded5 Merge branch 'master' of github.com:shish/shimmie2 2012-03-14 19:17:56 +00:00
Shish
16af27e6b7 only display editors for editable fields 2012-03-14 19:17:52 +00:00
Shish
6204046be5 upgrade notes 2012-03-14 18:16:23 +00:00
Shish
7a6741d202 TYPE -> ENGINE 2012-03-14 18:11:46 +00:00
Shish
9373b26625 In jquery, $("#foo") is always true (an empty object) 2012-03-14 15:06:30 +00:00
Shish
e67d679194 regexes are fun and pleasant to work with, in the same way that oranges are purple 2012-03-14 03:15:35 +00:00
Shish
b57a3be442 warn for mass deletions 2012-03-14 00:51:05 +00:00
Shish
fa89b166d4 Merge branch 'master' of github.com:shish/shimmie2 2012-03-13 17:53:01 +00:00
Shish
b4fb667eaa use URLs for linking to comments 2012-03-13 16:04:50 +00:00
Shish
e31b6af28b site:// protocol support 2012-03-13 16:01:13 +00:00
Shish
c887580074 with no more wordwrap, there's no need for unwrap 2012-03-13 16:01:03 +00:00
Shish
d11dad3055 sup/sub support in bbcode 2012-03-13 16:00:25 +00:00
Shish
0ac7f802bb have PM link link directly to the section 2012-03-13 15:33:58 +00:00
Shish
d6227ef1b3 #c123 is now the comment element directly, no need for parent() 2012-03-13 15:25:04 +00:00
Shish
8b78fce982 more forminess 2012-03-13 15:23:56 +00:00
Shish
947fbfd820 comment index -> comment/list, not post/list 2012-03-13 09:28:05 +00:00
Shish
953403f968 Merge branch 'master' of github.com:shish/shimmie2 2012-03-13 08:39:43 +00:00
Shish
1c5f4916b1 actually add shimmie.css... 2012-03-13 08:38:19 +00:00
Shish
bdf24c1f2a Merge branch 'master' of github.com:shish/shimmie2 2012-03-13 08:09:41 +00:00
Shish
5dd2886b53 common shimmie styles 2012-03-13 08:03:53 +00:00
Shish
8f020993ac forminess 2012-03-13 07:53:41 +00:00
Shish
028457ec32 parsing 2012-03-13 07:34:39 +00:00
Shish
9a0228720a truncate as a function, which works 2012-03-13 07:01:27 +00:00
Shish
d54580e453 PLT is used by tooltips too... 2012-03-13 07:01:15 +00:00
Shish
69f4928916 remove excess html 2012-03-13 07:01:01 +00:00
Shish
dde5d4c9b5 html5 validation 2012-03-13 06:33:21 +00:00
Shish
b12872d75e Merge branch 'master' of github.com:shish/shimmie2 2012-03-13 06:11:25 +00:00
Shish
8b72409763 tag history reverter updates 2012-03-13 06:09:39 +00:00
Shish
ba46af2045 Merge branch 'master' of github.com:shish/shimmie2 2012-03-13 06:04:57 +00:00
Shish
f5c4c20f4b mass edit as its own test 2012-03-13 06:04:52 +00:00
Shish
efd05179f3 better log for owner change 2012-03-13 04:55:49 +00:00
Shish
16b232c857 user needs perm /and/ the image needs to be unlocked 2012-03-13 04:48:18 +00:00
Shish
4b59c79fed handle test error 2012-03-12 23:27:24 +00:00
Shish
a5ba9279c4 modification dates on CSS/JS links 2012-03-12 23:17:20 +00:00
Shish
70e488a165 malformed sidebar cookie was breaking JS 2012-03-12 18:04:46 +00:00
Shish
f67b049176 allow logout from link 2012-03-12 18:04:06 +00:00
Shish
2ed73f9a68 user signup form 2012-03-12 18:03:46 +00:00
Shish
34d42d27f4 delete with images / with comments, and check auth token 2012-03-12 17:44:07 +00:00
Shish
357b298122 Merge branch 'master' of github.com:shish/shimmie2 2012-03-12 17:33:48 +00:00
Shish
02428a17f5 note of perms 2012-03-12 17:30:33 +00:00
Shish
0e262f5500 change_X -> edit_X for consistency 2012-03-12 17:29:03 +00:00
Shish
9f79e70f73 Merge branch 'master' of github.com:shish/shimmie2 2012-03-12 16:12:28 +00:00
Shish
05f8d0d23e justify~ 2012-03-12 15:43:18 +00:00
Shish
8ba40b091e actually, the inherent padding is enough 2012-03-12 15:42:55 +00:00
Shish
f15fa1c635 a newline so source is less cramped 2012-03-12 15:06:07 +00:00
Shish
41971f907f missed a bit 2012-03-12 05:36:39 +00:00
Shish
78d13ff214 many theme updates 2012-03-12 05:31:19 +00:00
Shish
3eb1f1c2ab move move common code into base classes 2012-03-12 05:08:40 +00:00
Shish
15777b3bb5 move common themelt parts into a base class 2012-03-12 05:04:29 +00:00
Shish
a455b804e3 pagination 2012-03-12 04:59:56 +00:00
Shish
aaf9280ee4 more styling 2012-03-12 04:56:30 +00:00
Shish
f2dfbb9080 no background for image-list 2012-03-12 04:41:57 +00:00
Shish
c638af1d76 consistent block rendering 2012-03-12 04:39:04 +00:00
Shish
a5c8b132e7 remove a little whitespace 2012-03-12 03:43:14 +00:00
Shish
11ab2a1e14 move 'view tag history' to image controls 2012-03-12 03:39:37 +00:00
Shish
98310df9ee nothing actually used this... 2012-03-12 03:28:24 +00:00
Shish
40b09c8ee1 less divvy comments 2012-03-12 03:28:08 +00:00
Shish
5d6cf955af refactoring styles 2012-03-12 03:06:14 +00:00
Shish
15dba9a5e3 get sidebar hiding working again 2012-03-12 02:53:41 +00:00
Shish
7d027494b6 toggle-id -> toggle-sel 2012-03-12 02:50:41 +00:00
Shish
7bdc00ac4e downtime css -> downtime file 2012-03-12 02:47:37 +00:00
Shish
c6c4f06de8 html5iness 2012-03-12 02:45:39 +00:00
Shish
dfd38b1b84 style tweaks 2012-03-12 02:17:38 +00:00
Shish
c1f73c6258 HTML5 elements 2012-03-11 16:18:37 +00:00
Shish
6cb31e1299 remove ancient unmaintained themes 2012-03-11 16:02:33 +00:00
Shish
5803920bcc more forms 2012-03-11 15:53:19 +00:00
Shish
b7006e90db Merge branch 'master' of github.com:shish/shimmie2 2012-03-11 15:50:04 +00:00
Shish
4c0b2dcb39 Merge branch 'master' of github.com:shish/shimmie2 2012-03-11 15:49:52 +00:00
Shish
c78ad128bf forms 2012-03-11 15:49:40 +00:00
Shish
071b783f56 forms 2012-03-11 15:49:25 +00:00
Shish
652984adc1 trim comma from tags as well as whitespace 2012-03-11 14:54:14 +00:00
Shish
f04704e3e9 'tags' might not exist yet, use get_tag_array() 2012-03-11 14:37:04 +00:00
Shish
e10cc4fa99 test searches 2012-03-11 14:33:49 +00:00
Shish
752597385e start of danbooru API tests 2012-03-11 14:28:29 +00:00
Shish
fb4870e4da stub artists test 2012-03-11 14:28:18 +00:00
Shish
47bb844acc admin tweaks 2012-03-11 14:02:00 +00:00
Shish
358f191be2 view/edit for author 2012-03-11 04:50:44 +00:00
Shish
e4c95d5b56 Merge branch 'master' of github.com:shish/shimmie2 2012-03-11 04:33:23 +00:00
Shish
cf907237c6 with 5.2.1, we have an accurate, peak memory use 2012-03-11 04:33:24 +00:00
Shish
f0a05164d1 'Warning:' is picked up by simpletest 2012-03-11 02:27:16 +00:00
Shish
733ffe4ca9 use the right pool FK 2012-03-11 02:17:16 +00:00
Shish
390759cd0b pools FKs 2012-03-11 02:13:25 +00:00
Shish
8b69e056b4 notes FKs 2012-03-11 02:13:18 +00:00
Shish
9f4c5c1d93 artists FKs 2012-03-11 02:09:33 +00:00
Shish
9c1f544343 forum FKs 2012-03-11 02:03:28 +00:00
Shish
9e65732ea1 mysql ignores the FK names anyway, so all they were doing was bothering me ~_~ 2012-03-11 01:52:25 +00:00
Shish
f9a9290318 don't upgrade twice 2012-03-11 01:41:33 +00:00
Shish
7c3554a8eb fk names 2012-03-11 01:20:45 +00:00
Shish
778c3e8805 named constraints 2012-03-11 01:04:25 +00:00
Shish
32387dd845 saving cache data and profiling data to disk can happen after the client gets the page 2012-03-11 00:37:08 +00:00
Shish
1b30aea557 compressed coverage logs 2012-03-11 00:36:57 +00:00
Shish
2eceb19bcf favicon moved 2012-03-11 00:18:10 +00:00
Shish
3e8614967e admin tests 2012-03-11 00:17:09 +00:00
Shish
97eb527714 named constraints 2012-03-10 19:38:50 +00:00
Shish
89efc3b524 Merge branch 'master' of github.com:shish/shimmie2 2012-03-10 19:13:42 +00:00
Shish
6c459c8323 make it so 2012-03-10 19:13:41 +00:00
Shish
a2d2ceb015 foreign keys delete comments now 2012-03-10 19:07:40 +00:00
Shish
f62edc3e83 add FKs for comments 2012-03-10 19:07:02 +00:00
Shish
37672bc1ee comment schema wibbles 2012-03-10 18:57:35 +00:00
Shish
a6dbe3b7f2 Image::locked should always be a boolean 2012-03-10 18:53:42 +00:00
Shish
82414b279d delete by query on admin page -> delete these images on search results 2012-03-10 18:50:10 +00:00
Shish
3801ce1bec hash ban test 2012-03-10 17:51:56 +00:00
Shish
582c49ee0e hash ban test 2012-03-10 17:40:11 +00:00
Shish
0a435449b9 feature testing 2012-03-10 17:39:38 +00:00
Shish
d4d2afdd24 ico testing 2012-03-10 15:29:42 +00:00
Shish
4c204a2bc1 bookmarks test 2012-03-10 15:28:18 +00:00
Shish
ee976ed23b better blocks testing 2012-03-10 14:30:49 +00:00
Shish
0bd01e56e2 return x again 2012-03-10 14:11:14 +00:00
Shish
96cfda4a93 admin buttons 2012-03-10 13:48:56 +00:00
Shish
df4e4050a0 admin wibbles 2012-03-10 12:57:13 +00:00
Shish
25bab5d672 if(x == true) return true else return false? return x :P 2012-03-10 12:53:23 +00:00
Shish
924eb98238 API tests 2012-03-10 09:52:52 +00:00
Shish
b34cb84e92 Merge branch 'master' of github.com:shish/shimmie2 2012-03-10 02:21:53 +00:00
Shish
1bfa656e35 another unused function 2012-03-10 02:21:42 +00:00
Shish
77b99adca7 remove more unused bits 2012-03-10 02:19:12 +00:00
Shish
5c36d996e0 test 404 handler's static files too 2012-03-10 02:19:04 +00:00
Shish
b451f90b47 ip2color() was never used 2012-03-10 02:14:33 +00:00
Shish
bab3145fbc plural() was never used 2012-03-10 02:13:50 +00:00
Shish
91393e003a un-typo a test 2012-03-10 02:09:29 +00:00
Shish
1c4a029564 basic oekaki test 2012-03-10 02:08:01 +00:00
Shish
04bdbeb740 test that viewing the log doesn't crash horribly immediately 2012-03-10 02:06:25 +00:00
Shish
b5bca91bee toggler in default setup theme 2012-03-10 02:04:15 +00:00
Shish
e5f4b5ffa1 test tweeter 2012-03-10 01:57:47 +00:00
Shish
a20245ff70 Merge branch 'master' of github.com:shish/shimmie2 2012-03-10 01:07:02 +00:00
Shish
2943750822 upgrade simpletest library, hopefully get rid of deprecation warnings... 2012-03-09 23:08:58 +00:00
Shish
91a97f2b00 no pages for one image 2012-03-09 22:49:26 +00:00
Shish
a7a50cb78f start at page 1 2012-03-09 22:48:17 +00:00
Shish
f9910ba98f whitespace consistency 2012-03-09 22:27:12 +00:00
Shish
eb8c15b9a0 whitespace 2012-03-09 22:08:55 +00:00
Shish
90f27cf7fd argh 2012-03-09 22:05:16 +00:00
Shish
788f25a12d Merge pull request #168 from DakuTree/master
Shimmie API
2012-03-09 14:02:12 -08:00
Shish
591a6cdb76 GET doesn't work due to auth token check 2012-03-09 21:57:35 +00:00
Shish
9608feffa6 make PM reading work 2012-03-09 21:54:09 +00:00
Shish
15acbc08bd whitespace 2012-03-09 21:52:18 +00:00
Shish
f6bd6dc057 fixing tag reversion 2012-03-09 21:44:39 +00:00
Shish
b1a8a82bf2 there is another test image now 2012-03-09 21:34:03 +00:00
Shish
37ba0348cc ignore editcloud 2012-03-09 21:10:46 +00:00
Shish
eaa46d7385 split out data 2012-03-09 21:10:26 +00:00
Daku
3c11feae1c changing back to api/shimmie & allow $_GET or args while using api 2012-03-09 21:09:15 +00:00
Shish
1f07a273f6 move copy & pasted transload code into a shared function 2012-03-09 21:07:21 +00:00
Daku
f76955123f update source & rating if &update is set 2012-03-09 20:46:26 +00:00
Daku
4a51c73435 some more api docs 2012-03-09 20:46:26 +00:00
Daku
2acd983570 get user info via json api 2012-03-09 20:46:25 +00:00
Shish
126ed2ee78 example.com changed... 2012-03-09 20:01:51 +00:00
Shish
266a0d7c25 more test fixes 2012-03-09 19:53:55 +00:00
Shish
36226d3b15 normalised source display 2012-03-09 19:18:20 +00:00
Shish
5d3d4e8d76 test fixes 2012-03-09 18:56:06 +00:00
Shish
bbbc92418d add missing test data 2012-03-09 18:50:23 +00:00
Shish
5d8169c577 bbcode test fixes 2012-03-09 18:15:58 +00:00
Shish
d7d2bf7418 user test updates 2012-03-09 18:15:03 +00:00
Shish
79ce40abd0 less code 2012-03-09 18:14:14 +00:00
Shish
fb111803c7 save a warning 2012-03-09 18:12:46 +00:00
Shish
22f65a9a54 database can throw exceptions 2012-03-09 18:03:10 +00:00
Shish
ac51d364b9 die, mysql. die. 2012-03-09 16:13:33 +00:00
Shish
dc6c85975b working navigation for tag history 2012-03-09 15:55:17 +00:00
Shish
8996c95a47 Merge branch 'master' of github.com:shish/shimmie2 2012-03-09 15:55:12 +00:00
Shish
461bd6bf61 IP ban from tag history page 2012-03-09 15:34:41 +00:00
Shish
e35c1dca74 Merge branch 'master' of github.com:shish/shimmie2 2012-03-09 14:44:15 +00:00
Shish
40bcfafc66 tag_history paging 2012-03-09 14:44:02 +00:00
Shish
f03af6cfcb tag histories should be deleted by foreign key now 2012-03-09 13:00:32 +00:00
Shish
c7e2ef74f8 if username or password are blank, exit early (saves logging the failed attempt) 2012-03-08 04:35:52 +00:00
Shish
c260f707fd only retroactively create history when the image has old tags and no log - if it is a new image (no old tags) then don't double-log it 2012-03-08 04:07:46 +00:00
Shish
f2c98bec4d a little nicer log format 2012-03-08 03:42:48 +00:00
Shish
5f6a454734 importance as a number is silly, and section is implied by the context of the description 2012-03-08 03:39:48 +00:00
Shish
9ebe425520 Merge branch 'master' of github.com:shish/shimmie2 2012-03-08 03:35:17 +00:00
Shish
285b78c185 image specific tags on mass upload form 2012-03-08 03:34:57 +00:00
Shish
569e93cd6b postgres requires a sequence name to be passed to get_last_insert_id 2012-03-08 02:55:04 +00:00
Shish
58d533ceb9 put a snippet of each comment in the event log 2012-03-08 02:36:21 +00:00
Shish
eb9b29b7b4 'blocked image' really means 'attempted to upload a blocked image', make the words reflect that 2012-03-08 01:37:42 +00:00
Shish
f928d178f4 Merge branch 'master' of github.com:shish/shimmie2 2012-03-08 01:30:38 +00:00
Shish
34a7a558b3 IP searching in postgres, hackishly (compare text(address) to username, rather than comparing address to inet(username)) 2012-03-08 01:30:08 +00:00
Shish
f1eaa4f751 about an hour ago -> an hour ago; the 'about' takes up too much space... 2012-03-08 01:28:43 +00:00
Shish
0ce9aa02a2 'false' == true. Convert the first param from DB value to real bool, and also use triple equals 2012-03-08 01:27:59 +00:00
Shish
1db23314b8 only toggler for hidable element 2012-03-06 21:25:45 +00:00
Shish
90347a08dd extent rather than crop and repage 2012-03-06 20:30:41 +00:00
Shish
21ddbb90d9 Merge branch 'master' of github.com:shish/shimmie2 2012-03-06 19:29:44 +00:00
Shish
6991e6e4a0 Merge branch 'master' of github.com:shish/shimmie2 2012-03-06 15:39:15 +00:00
Shish
232991979c upload page wibbling 2012-03-06 15:38:53 +00:00
Shish
e4c97ee80e witchcraft 2012-03-06 15:38:42 +00:00
Shish
24c64b50b4 make bookmarlet code more readable 2012-03-06 12:22:08 +00:00
Shish
5a6f146444 more detailed docs 2012-03-05 18:42:05 +00:00
Shish
88ee6ea148 get_theme_object is only used once, move it closer to where it's used 2012-03-05 14:21:41 +00:00
Shish
171a4b7c85 php syntax 2012-03-05 13:58:04 +00:00
Shish
383dd0088e documentation updates 2012-03-05 13:56:36 +00:00
Shish
ba0dd8e9f2 doxygen config updates 2012-03-05 13:56:29 +00:00
Shish
cba1e76b1f only force-wrap comments 2012-03-05 10:24:01 +00:00
Shish
4245cd268c if user has no js, default to showing info editor 2012-03-05 10:22:55 +00:00
Shish
03cfb5bc24 html5 boilerplate header 2012-03-05 10:14:58 +00:00
Shish
530d545a2d javascript/css updates and compression, and add modernizr 2012-03-05 10:10:04 +00:00
Shish
8448a4cee1 don't overwrite global $user... 2012-03-05 09:55:11 +00:00
Shish
b17fe7e7bd make bookmarklet.js easier to read 2012-03-05 09:52:48 +00:00
Shish
8b62ad281a if upload_collision_handler is set to 'don't merge tags', then don't merge tags 2012-03-05 09:32:08 +00:00
Shish
e56bd7b276 Merge pull request #157 from DakuTree/master
Fixes/Features
2012-03-05 01:28:22 -08:00
Daku
0dd7d086f2 option to sort taglists alphabetically rather than by tag count 2012-03-04 22:18:03 +00:00
Daku
e5e27a7804 bookmarklet should now play nice with tags that contain + 2012-03-04 22:18:03 +00:00
Daku
74e307b55f update tags if image already exists 2012-03-04 22:18:02 +00:00
Daku
8e4ae87c65 fix for image pages not loading for danbooru/lite themes 2012-03-04 22:18:02 +00:00
Shish
a0d8f20dbc Merge pull request #154 from dgz/fix-wordwrap
Fix issue #62: wordwrap in CSS rather than PHP
2012-03-03 12:31:29 -08:00
Josh Sutinen
4f37b48070 Apply word-wrap: break-word; to all body contents to force reallylongunbreakablestrings to be broken per the theme's dimensions rather than the arbitrary 80 characters set by the bbcode extension 2012-03-03 12:43:04 -05:00
Josh Sutinen
fa77d999eb Wordwrapping BEFORE applying bbcode breaks long links
Wordwrapping AFTER breaks the HTML generated by bbcode when using PHP's wordwrap(), better not to hard wordwrap at all and just do it with CSS
2012-03-03 12:39:24 -05:00
Shish
a789cb5708 Merge branch 'master' of github.com:shish/shimmie2 2012-03-02 23:57:46 +00:00
Shish
15fdd2e0b7 replace lots of javascript with a little jquery 2012-03-02 23:57:27 +00:00
Shish
74f0d38c04 comment snippets should link to the specific comment 2012-03-02 21:15:04 +00:00
Shish
0487bbe1bd count the messages properly, and show them... 2012-03-02 18:03:34 +00:00
Shish
8bab5b1c0a Merge branch 'master' of github.com:shish/shimmie2 2012-03-02 17:42:11 +00:00
Shish
b6b4122952 PM count 2012-03-02 17:41:25 +00:00
Shish
42af88ded9 Merge pull request #152 from Madoushi90/master
Regex for PDO DSN
2012-03-02 09:05:29 -08:00
Justin Brewer
9ac45f5363 Regex for PDO DSN
Old regex matched ADOdb URI. Also, this regex allows the user, pass, host and database information
to appear in any order.
2012-03-02 10:17:13 -06:00
Shish Moom
3fc4060ef6 Merge pull request #149 from green-ponies/master
Typo
2012-03-01 03:52:28 -08:00
Shish Moom
a3323e9047 Merge pull request #150 from Madoushi90/master
Fixed Popular Tags List
2012-03-01 03:52:07 -08:00
green-ponies (jgen)
af33a36c89 Typo in SQL 2012-02-29 14:56:05 -05:00
Justin Brewer
8f49922556 Fixed Popular Tags List
All the links pointed to /post/list/$link
2012-02-27 17:37:09 -06:00
Shish
9e394957b6 Merge branch 'master' of github.com:shish/shimmie2 2012-02-26 15:26:49 +00:00
Shish
409a3b9b23 network logging, for irccat 2012-02-26 15:24:37 +00:00
Shish
1ff0703a91 Merge branch 'master' of github.com:shish/shimmie2 2012-02-26 15:24:30 +00:00
Shish
dadcb809ba don't log for null->null 2012-02-26 15:24:02 +00:00
Shish
df72e4580b userclass docs 2012-02-22 21:08:57 +00:00
Shish
ff30b54130 better solution, replace /post/view/123#456 with #456 if #456 exists 2012-02-22 15:13:05 +00:00
Shish
11c804b347 only need to view the image page if the linked-to comment doesn't already exist on the current page 2012-02-22 14:46:47 +00:00
Shish
a4f2c417ec CSS3 powarr 2012-02-22 14:27:56 +00:00
Shish
2e66ca44d7 temporary old-syntax support; also, parent() makes sense for default and r34 themes 2012-02-22 14:14:40 +00:00
Shish
169ae5f590 installer fails 2012-02-22 13:58:55 +00:00
Shish
f9de9ece21 replace comment links with usernames 2012-02-22 13:49:57 +00:00
Shish
0351ffcd28 commit_hash is unknown by default 2012-02-22 13:33:35 +00:00
Shish
6222c0d093 redirect to the bottom of the thread when commenting 2012-02-22 13:25:03 +00:00
Shish
833ef69ec4 reliability 2012-02-22 13:21:37 +00:00
Shish
e03537f89b missed a char 2012-02-22 13:18:51 +00:00
Shish
f8fec8a036 prefix comment ID with c, so it isn't just a random number 2012-02-22 13:07:04 +00:00
Shish
aaceb99aa5 rather than <a name=foo>, stick an ID on the comment 2012-02-22 13:05:17 +00:00
Shish
eccea620ba only admins can change user classes, and they should be protected from moderators 2012-02-22 12:32:54 +00:00
Shish
cf621c066c remove duplicate code 2012-02-22 10:18:07 +00:00
Shish
0e6b20f286 apple touch icon 2012-02-22 10:14:19 +00:00
Shish
5e8560facb move static files into lib/static, and allow different themes to override them 2012-02-22 09:54:49 +00:00
Shish
6110be6af9 Merge branch 'master' of github.com:shish/shimmie2 2012-02-22 09:38:01 +00:00
Shish Moom
1ad4ae2850 Merge pull request #144 from green-ponies/master
Icons
2012-02-22 01:37:45 -08:00
Shish
4d2a066717 user classes in the installer 2012-02-21 18:37:36 +00:00
green-ponies (jgen)
fe37ee1eac Converted the ico to a png for portability. 2012-02-18 23:47:20 -05:00
Shish
7b6112dc2c and document it 2012-02-17 01:45:55 +00:00
Shish
a6f8ce2a14 better search by date 2012-02-17 01:43:49 +00:00
Shish
f77c66848f DB exception -> SCoreException 2012-02-16 16:58:39 +00:00
Shish
42016b2f9b Merge branch 'master' of github.com:shish/shimmie2 2012-02-16 16:58:33 +00:00
Shish
d4accf09de REQUEST_URI is undefined from the CLI 2012-02-16 16:15:25 +00:00
Shish
6410199a84 basic CLI support 2012-02-16 16:10:31 +00:00
Shish
af7704825b use HTTP status codes with error messages 2012-02-16 15:37:05 +00:00
Shish
5fc7d6e574 Merge branch 'master' of github.com:shish/shimmie2 2012-02-16 15:20:36 +00:00
Shish Moom
17b3972356 Merge pull request #142 from DakuTree/master
PNG/GIF Autoresizing + Other stuff
2012-02-16 07:16:51 -08:00
Daku
bbb9d6bd4c update ext now grabs extra info via JSON 2012-02-16 07:50:28 +00:00
Daku
6ba66789e4 highlight comment on >> click (this seems like the wrong way of doing this) 2012-02-16 04:44:23 +00:00
Daku
097b6d9ddb highlight comment on reply click 2012-02-16 04:43:05 +00:00
Daku
78a16885e5 this should be here to stop it using any ext >_< 2012-02-16 03:03:36 +00:00
Daku
d33853cee0 resize ext will now check if gif is animated 2012-02-15 23:46:42 +00:00
Daku
47785b8ac0 enabled png autoresizing as it seems to be fixed 2012-02-15 17:21:35 +00:00
Shish
c2bf42ef5a less passing of $page 2012-02-15 08:59:24 +00:00
Shish
c70d81c97d Merge branch 'master' of github.com:shish/shimmie2 2012-02-15 08:54:02 +00:00
Shish
8af44574fd 403 is more appropriate 2012-02-15 08:51:13 +00:00
Shish
662c5e8778 More ban explanations, and un-cacheable 2012-02-15 08:23:00 +00:00
Shish
e79d26ae8c check against the class /name/... 2012-02-14 21:15:19 +00:00
Shish
ff40907fe3 and commit the file... 2012-02-14 21:11:23 +00:00
Shish
3c1b20e05b user classes 2012-02-14 20:38:19 +00:00
Shish
629e998f45 more work on user classes 2012-02-14 06:41:45 +00:00
Shish
809e1c22d6 Merge branch 'master' of github.com:shish/shimmie2 2012-02-14 06:34:28 +00:00
Shish
85fb34e20f allow failed upgrades 2012-02-14 06:33:59 +00:00
Shish
92701045ac global DSN -> define()'d DSN 2012-02-13 21:09:34 +00:00
Shish
519e46578d more notation for which strings are HTML safe and which aren't 2012-02-13 20:51:34 +00:00
Shish Moom
9af3a765b4 Merge pull request #136 from green-ponies/master
Memory calculation adjustments
2012-02-13 02:56:54 -08:00
green-ponies (jgen)
f345fde006 Fixing function to get PHP's memory limit. 2012-02-12 19:48:07 -05:00
green-ponies (jgen)
6a061c83d0 Changed how the resize extension calculates required memory usage. 2012-02-12 19:45:37 -05:00
green-ponies (jgen)
f1367ecf6e Added some more comments / documentation. 2012-02-12 14:56:21 -05:00
green-ponies (jgen)
edf5059ef4 Silly tabs. 2012-02-12 14:42:37 -05:00
green-ponies (jgen)
3bf1af44bd Better spacing on the ASCII art. 2012-02-12 14:40:38 -05:00
Shish
b1c7c79b2c <green-ponies> I put an event in your event , so you can listen while you lis... okay that's terrible 2012-02-12 17:08:25 +00:00
Shish
a54ab11205 all_events isn't used any more 2012-02-12 17:06:23 +00:00
Shish
f5ec708066 searching for negative scores 2012-02-12 14:38:37 +00:00
Shish
6691681a3d ypto >_< 2012-02-12 13:58:33 +00:00
Shish
7ab867cc79 remove the extra </div> 2012-02-12 12:40:07 +00:00
Shish
1a737bcbb8 only show vote remover if the user can use it... 2012-02-12 12:18:12 +00:00
Shish
2da52689cf upload box style 2012-02-12 12:00:19 +00:00
Shish
766cc9e959 this function was only referenced once 2012-02-12 11:45:18 +00:00
Shish
9472a1014c html5 does this now 2012-02-12 11:44:22 +00:00
Shish
0984ebd062 Revert "group the scripts". Apparently this is bad.
This reverts commit 59a17792f5cd1c05e9c4e5c8dc7cb4b9332f1318.
2012-02-12 11:43:26 +00:00
Shish
59a17792f5 group the scripts 2012-02-12 11:40:36 +00:00
Shish
8527da445e per-theme favicon possibilities 2012-02-12 11:40:00 +00:00
Shish
5241ed24b5 more style to file 2012-02-12 11:37:12 +00:00
Shish
7f6d60fe93 ignore not_a_tag 2012-02-12 11:31:05 +00:00
Shish
4555d35cdb Content-Type is specified in the page headers, specifying in the HTML too is unnecessary 2012-02-12 11:30:41 +00:00
Shish
5eab692a97 have themes/x/style.css auto-loaded, and put it after the ext/*/style.css so it can override them 2012-02-12 11:29:41 +00:00
Shish
6c29ccee40 split extension styles, so other themes can use them better 2012-02-12 11:25:58 +00:00
Shish
67623246e9 leave sizes to css 2012-02-12 11:14:04 +00:00
Shish
40eb00519e argh browsers 2012-02-12 10:19:40 +00:00
Shish
94eb1fab88 variable size longtext config fields 2012-02-12 10:19:35 +00:00
Shish
84fae296e5 this seems more reliable 2012-02-12 10:05:26 +00:00
Shish
294d24ad4b html standard placeholder 2012-02-12 09:55:47 +00:00
Shish
a2459da61b even better columns: CSS 2012-02-12 09:51:25 +00:00
Shish
830105193d better settings columning 2012-02-12 09:22:11 +00:00
Shish
c640b4ce71 Merge branch 'master' of github.com:shish/shimmie2 2012-02-12 07:47:49 +00:00
Shish
4d0b3e69bd give a count of reported images in the admin's userbox 2012-02-12 07:47:53 +00:00
Shish
f8a5828b80 lower case for comparisons 2012-02-12 07:36:43 +00:00
Shish
1dcda150f7 nicer whitespace for upload settings 2012-02-12 07:30:29 +00:00
Shish
edbb8943d2 count pages by the aliased-to tag, not what the user typed 2012-02-12 07:30:16 +00:00
Shish
4133c72727 not-a-tag extension 2012-02-12 06:56:00 +00:00
Shish
fbce628e04 note who has already reported an image 2012-02-12 06:41:10 +00:00
Shish
6635c69e05 Merge branch 'master' of github.com:shish/shimmie2 2012-02-11 11:04:01 +00:00
Shish
3077cb596a working, styled info box for default theme 2012-02-11 11:02:08 +00:00
Shish
e535b1f002 only show samefag ID if showing regular IDs 2012-02-11 10:37:50 +00:00
Shish Moom
6f03ecfe2c Merge pull request #130 from green-ponies/tag_history_fixes
Tag history fixes
2012-02-11 01:26:25 -08:00
Shish Moom
6da4da8060 Merge pull request #129 from green-ponies/master
Type hints
2012-02-11 01:22:43 -08:00
Shish
1035309f2c comment info in the default theme 2012-02-11 08:34:07 +00:00
Shish
9aa5644504 colours don't scale either D: numbers then... 2012-02-11 08:33:09 +00:00
Shish
ce5db719c3 coloured anons 2012-02-11 08:18:51 +00:00
Shish
d83c596c01 consistent width for comment list tables 2012-02-11 04:27:00 +00:00
Shish
0a4a211c2b wider info box 2012-02-11 02:30:59 +00:00
Shish
9f3c347b6c wibble the ip ban layout, and make all tables with the 'sortable' class sortable 2012-02-11 01:48:07 +00:00
Shish
a4617b0efc border-box makes sense for input elements 2012-02-11 01:47:43 +00:00
Shish
0013d67a80 actually, go back to consistency; inconsistency can be a customisation 2012-02-11 01:34:24 +00:00
Shish
4b0bcf44f8 Merge branch 'master' of github.com:shish/shimmie2 2012-02-11 00:55:39 +00:00
Shish
f1c4684ac0 Merge branch 'master' of github.com:shish/shimmie2 2012-02-11 00:52:59 +00:00
Shish
a93247327a editable tags by default, and hide .edit by default 2012-02-11 00:52:42 +00:00
green-ponies (jgen)
551a0f0a76 Note for other people. 2012-02-10 00:37:52 -05:00
green-ponies (jgen)
c34656563c Fix for tag history not recording first set of tags.
Issue #111
2012-02-10 00:19:08 -05:00
green-ponies (jgen)
a95766c410 More type hints. 2012-02-10 00:08:03 -05:00
green-ponies (jgen)
30eb5ddd8b More type hints! 2012-02-09 23:04:37 -05:00
Shish
77fc6f22b2 colour anons by IP address, for easier samefag spotting (commented out atm though) 2012-02-10 02:16:44 +00:00
Shish
0b26eba141 gaaah inconsistent database schema 2012-02-10 01:55:33 +00:00
Shish
c627e564c4 Merge branch 'master' of github.com:shish/shimmie2 2012-02-10 01:29:49 +00:00
Shish
34fd9751db username CSS, so that the name can be consistent even when it's a non-linked anon 2012-02-10 01:29:31 +00:00
Shish Moom
f9db22a005 Merge pull request #127 from green-ponies/master
Typos
2012-02-09 17:27:15 -08:00
Shish
01b89c2a1b function for showing IPs with ban button 2012-02-09 22:51:41 +00:00
Shish
f8af5c0e07 link to IP ban page from comments and images 2012-02-09 22:21:54 +00:00
Shish
d26afae583 ban_ip ability 2012-02-09 22:18:51 +00:00
Shish
589b47868c allow IP-ban fields to be pre-filled, and addition form to be linked to 2012-02-09 22:18:31 +00:00
green-ponies (jgen)
a8c228186a bugs~ 2012-02-09 15:37:40 -05:00
green-ponies (jgen)
983c0d96b8 Fixing bug with installer. (thanks RainbowDash) 2012-02-09 15:33:40 -05:00
green-ponies (jgen)
01306712b7 Shish you broke this~ 2012-02-09 15:10:53 -05:00
Shish
410c4ff1a0 default gravatar url needs urlencoding 2012-02-09 17:37:41 +00:00
Shish
d15c3010c8 clearer terminology 2012-02-09 17:35:42 +00:00
Shish
db9a1cc7d8 only show edit / set if the user can edit tags 2012-02-09 17:29:04 +00:00
Shish
5f4f941444 half-logged-in only for one day 2012-02-09 17:11:03 +00:00
Shish
912f096d8c give nocache cookies to people who /attempt/ to post on old forms, not just those who succeed 2012-02-09 17:07:36 +00:00
Shish
fbbdc898b0 Move image uploader info into the image info editor, make it editable 2012-02-09 17:03:39 +00:00
Shish
7ced04d0d0 separate uploader info 2012-02-09 15:35:59 +00:00
Shish
6e8970b15d functioning 2012-02-09 15:17:11 +00:00
Shish
f9c1f8229c remove non-functional bits 2012-02-09 15:06:35 +00:00
Shish
1303a5aa7b move giant notes inline script into its own file 2012-02-09 15:00:33 +00:00
Shish
b8ac8b7710 syntax 2012-02-09 15:00:15 +00:00
Shish
339f2b0497 more jquery magic, less inline scripting 2012-02-09 14:45:18 +00:00
Shish
8d15ae8c0a more js to lib/shimmie.js 2012-02-09 14:38:32 +00:00
Shish
efa7f4f17c autocomplete on a class name 2012-02-09 14:34:29 +00:00
Shish
82f2d10f75 with the good code in place, the bad code can go 2012-02-09 14:29:42 +00:00
Shish
3291e0c302 Merge branch 'master' of github.com:shish/shimmie2 2012-02-09 14:22:19 +00:00
Shish
c86786a69c missed another 'Event' 2012-02-09 14:22:08 +00:00
Shish Moom
937016d104 Merge pull request #124 from green-ponies/master
Pools Fixes
2012-02-09 04:24:46 -08:00
Shish
4f892cad22 Confused as to whether InitExtEvent belongs in Initialisation or Page Generation, so I removed the distinction 2012-02-09 11:51:48 +00:00
Shish
1c89632ab2 missed a word 2012-02-09 10:51:24 +00:00
green-ponies (jgen)
793b49a054 For HTML correctness. 2012-02-09 01:42:45 -05:00
green-ponies (jgen)
a43b407c41 Change to empty string. 2012-02-09 01:33:23 -05:00
green-ponies (jgen)
06e648d3e4 Fixing shared HTML ID for Random extension. 2012-02-09 01:01:36 -05:00
green-ponies (jgen)
969be8a228 Merge branch 'master' into pools_fixes
Conflicts:
	contrib/rating/main.php
2012-02-09 00:58:51 -05:00
green-ponies (jgen)
e227965802 Converting Ratings to new Extension (simple extension). 2012-02-09 00:40:01 -05:00
green-ponies (jgen)
562ba3585a Should this be a global? 2012-02-08 23:32:22 -05:00
green-ponies (jgen)
7bb971cef0 Merge remote-tracking branch 'remotes/shish/master' into pools_fixes 2012-02-08 23:25:52 -05:00
Shish
3584f40551 Merge branch 'master' of github.com:shish/shimmie2 2012-02-09 01:07:21 +00:00
green-ponies (jgen)
b4a384c2b1 Added some minuscule theming the default theme. 2012-02-08 16:57:29 -05:00
green-ponies (jgen)
7cfad30bb3 Reduce redundant database queries, re-use the pool array. 2012-02-08 16:51:10 -05:00
green-ponies (jgen)
050a9a17df Added config option for Next image. 2012-02-08 16:42:29 -05:00
green-ponies (jgen)
98e7359c6e Show a link for the Next image in a pool. 2012-02-08 16:32:41 -05:00
green-ponies (jgen)
bbdce53a67 Cleaning up HTML code and such. 2012-02-08 15:06:58 -05:00
green-ponies (jgen)
7044a6074f Need to remove this. 2012-02-08 14:52:24 -05:00
green-ponies (jgen)
c30743d22d Cleaning up the code and adding type hints. 2012-02-08 14:49:52 -05:00
green-ponies (jgen)
d2be97d446 Fixed while loops.
Also added some type hints and more comments.
2012-02-08 14:39:01 -05:00
green-ponies (jgen)
44d7fe2689 Change to $pool_id 2012-02-08 14:14:11 -05:00
green-ponies (jgen)
2da3cb2812 Changing from GET to POST. 2012-02-08 14:10:33 -05:00
green-ponies (jgen)
795160f8eb Need to have $this, also changed is_null to empty. 2012-02-08 11:21:35 -05:00
green-ponies (jgen)
ca21d6e3f9 Fixed issue with rating module. 2012-02-08 11:12:33 -05:00
green-ponies (jgen)
755136dcd7 Small fix for duplicate ID with Random image. 2012-02-08 10:48:31 -05:00
Shish
0698b780f9 remove regular Extension, have SimpleExtension take its place, optimise the event system based on SimpleExtension methods 2012-02-08 12:07:01 +00:00
Shish
2b85e2d2fd all the extensions are simple now 2012-02-08 11:45:35 +00:00
Shish
4697e21fcd HINT ALL THE TYPES. SIMPLE ALL THE EXTENSIONS. 2012-02-08 11:24:25 +00:00
Shish
be1036e319 put Event in the function name again... 2012-02-08 07:05:58 +00:00
Shish Moom
3b99605521 Merge pull request #116 from green-ponies/speed_tweaks
More Speed tweaks
2012-02-07 21:53:00 -08:00
Shish Moom
1b5f1dcafb Merge pull request #107 from DakuTree/master
Reset Image ids & Download all images
2012-02-07 20:32:28 -08:00
green-ponies (jgen)
d69fa6ae9d Merge branch 'master' into speed_tweaks 2012-02-07 23:21:56 -05:00
green-ponies (jgen)
76c6031b04 Working on fixing the Pools extension. 2012-02-07 23:15:23 -05:00
Shish Moom
617caa7341 Merge pull request #108 from green-ponies/master
More comments on functions.
2012-02-07 19:57:30 -08:00
green-ponies (jgen)
2d443f0be9 Mostly just adding the Link to comments. 2012-02-07 21:52:11 -05:00
green-ponies (jgen)
0cdc303397 Just more comments. 2012-02-07 20:25:05 -05:00
green-ponies (jgen)
ac1b3d00e2 Some more comments. 2012-02-07 20:13:58 -05:00
green-ponies (jgen)
5af54bb9e0 Added some more comments and type hints. 2012-02-07 20:05:38 -05:00
Shish
9707c1f7ce we already have a global jquery install... 2012-02-08 00:29:01 +00:00
Shish
5c1f028249 more type hints 2012-02-07 19:55:31 +00:00
Shish
763c00ccdf clean PMs first 2012-02-07 19:30:51 +00:00
Shish
37bffe0689 actually, ext-specific DB changes should live in that ext... 2012-02-07 19:26:40 +00:00
Shish
25b8193191 db_version starts at 10 2012-02-07 19:20:58 +00:00
Shish
1455956f18 putting foreign key additions into auto-upgrade ext 2012-02-07 19:18:58 +00:00
Shish Moom
1409eef470 Merge pull request #106 from green-ponies/master
Changes to the Install script
2012-02-07 10:54:43 -08:00
Shish
d715b3d8a6 brain-o 2012-02-07 18:27:53 +00:00
Shish
0589f9d72e fine grained permission bits 2012-02-07 15:15:18 +00:00
Shish
bff5a8453f start of fine-grained permissions 2012-02-07 13:44:54 +00:00
Shish
bb49c09279 jquery does lots now 2012-02-07 11:36:28 +00:00
Shish
ab7c62515e move JS bits into static files 2012-02-07 11:33:42 +00:00
Shish
2162dbebdd base_href variable for javascript, to avoid generating dynamic JS with PHP 2012-02-07 11:33:27 +00:00
Shish
3b205d98eb charset 2012-02-07 10:56:46 +00:00
Shish
7211b0a30b vary cookie only with CACHE_HTTP 2012-02-07 10:17:37 +00:00
Daku
cca3ce513a added confirm/warning to resetting image ids 2012-02-07 00:02:53 +00:00
Daku
e92d4f6809 fixes gelbooru with bookmarklet 2012-02-07 00:02:53 +00:00
Daku
80970f924e this should be here >_< 2012-02-07 00:02:52 +00:00
Daku
07e786101d download all images function for admin 2012-02-07 00:02:52 +00:00
Daku
1fd565fa87 can't check if rating is null if it doesn't exist... 2012-02-07 00:02:51 +00:00
Daku
94d2f99df2 this should fix bookmarklet not working with nice urls 2012-02-07 00:02:51 +00:00
Daku
9efce5378c small fix for bookmarklet image url 2012-02-07 00:02:50 +00:00
Daku
6e602aa430 forgot to remove this... 2012-02-07 00:02:50 +00:00
Daku
1f871a69e1 fixing flash again :x 2012-02-07 00:02:49 +00:00
Daku
a25f405470 bookmarklet now supports sankaku and konachan 2012-02-07 00:02:49 +00:00
Daku
26b688fe9b bookmarklet now supports oreno.imouto 2012-02-07 00:02:48 +00:00
Daku
d3d395c347 reset image id function for admin
this basically grabs all the image_id's > sets them all from 1-whatever (so it would be like you never deleted an image)
2012-02-07 00:02:48 +00:00
Shish
0e25c82fc5 Merge branch 'master' of github.com:shish/shimmie2 2012-02-06 14:42:49 +00:00
Shish
a9ec9b6b70 comment info box 2012-02-06 14:42:38 +00:00
Shish
aa2696ca07 only add ellipsis if the comment actually is too long 2012-02-06 14:42:07 +00:00
Shish
b20fd1b3e3 js function for inserting comment links 2012-02-06 14:41:36 +00:00
Shish
e38f9e720f CSS has odd/even built-in now 2012-02-06 12:24:13 +00:00
Shish
d2d03396af info box 2012-02-06 12:23:56 +00:00
Shish
9fd10fb6d2 more explicit credit for the shimmie team :3 2012-02-06 05:34:06 +00:00
Shish
e1c8145bdc Merge branch 'master' of github.com:shish/shimmie2 2012-02-06 05:25:18 +00:00
Shish
4bf42acdd1 database_dsn (lowercase) is no more 2012-02-06 05:22:51 +00:00
green-ponies (jgen)
a78ca78c9b More changes to the install script.
More error checking, better formating, etc..
2012-02-05 16:35:34 -05:00
green-ponies (jgen)
8db3546c8d Changes to the install script for Issue 101. 2012-02-05 12:11:56 -05:00
green-ponies (jgen)
15929f7264 Merge branch 'master' of git://github.com/shish/shimmie2 2012-02-05 11:32:48 -05:00
Shish
7a25fad4b0 link to specific comments 2012-02-05 07:37:20 +00:00
Shish
9db912d996 now that the cache key has changed, the invalidation needs updating... 2012-02-05 06:59:55 +00:00
Shish
2d334e08ea How did this typo get back in here? :/ 2012-02-05 05:06:55 +00:00
Shish
4e1300631b Merge branch 'master' of github.com:shish/shimmie2 2012-02-05 04:25:58 +00:00
Shish
0b13db8ed7 hide anonymous's user page - having made a million comments, it was taking upwards of 60 seconds to process that one page, triggering the DOS defences... 2012-02-05 04:25:50 +00:00
Shish
a55eca4462 so many bots crawling the infinite search space... 2012-02-05 04:21:03 +00:00
Shish
5843aae4f2 random unused global o_O 2012-02-05 04:20:42 +00:00
green-ponies (jgen)
9e67e531aa How is this typo still in here? 2012-02-04 23:16:50 -05:00
Shish Moom
5b741feb9f Merge pull request #105 from green-ponies/master
Collect the Database engine as well
2012-02-04 15:31:04 -08:00
green-ponies (jgen)
3b028696a0 Rewind arrays before foreach loops over all the elements.
(fixed a small typo as well)
2012-02-04 15:35:21 -05:00
green-ponies (jgen)
cd1f5d9ed0 Missed a semicolon. 2012-02-04 14:49:48 -05:00
green-ponies (jgen)
68e9bd694e Storing copies of config variables outside of for loops. 2012-02-04 14:17:52 -05:00
green-ponies (jgen)
0a1e8f2af4 Store config values that are used inside a loop. 2012-02-04 12:20:49 -05:00
green-ponies (jgen)
1a8c2d31c7 Also collect the database engine shimmie is using. 2012-02-04 10:55:37 -05:00
Shish
aac7ce6e78 update sysinfo to handle the new event listener format 2012-02-02 16:49:02 +00:00
Shish
ee94aca3cd missed a bit 2012-02-02 16:08:49 +00:00
Shish
dab85e5f26 merge type hints 2012-02-02 14:16:14 +00:00
Shish
cc8f1f35a5 more type hints 2012-02-02 14:14:33 +00:00
Shish
52ff412b38 hiphop type hint placeholders 2012-02-02 13:58:48 +00:00
Shish
bbb51b60f8 typos~ 2012-02-02 08:09:48 +00:00
Shish
dc6c173efd type hints for hiphop 2012-02-02 08:07:57 +00:00
Shish
ec0fab54d8 these are magicked now 2012-02-02 07:53:27 +00:00
Shish
baa409eb98 special PDO init for hiphop 2012-02-02 07:43:43 +00:00
Shish
465011a68c hiphop chokes on this 2012-02-02 05:27:40 +00:00
Shish
7a40132e83 params were unused 2012-02-02 05:25:17 +00:00
Shish
b3d5878ce8 use the param 2012-02-02 05:24:06 +00:00
Shish
d5527d6dc8 missed a global 2012-02-02 05:23:55 +00:00
Shish
16745aadc6 only require flexihash once 2012-02-02 04:35:26 +00:00
Shish
f198128f06 config.php might not exist, eg in monolith mode 2012-02-02 03:53:18 +00:00
Shish
699087cd98 database_dsn is a constant now 2012-02-02 03:53:03 +00:00
Shish
2a375e7129 standard syntax 2012-02-01 17:01:41 +00:00
Shish
93540faca8 a note for the future 2012-02-01 17:00:44 +00:00
Shish
e049ea874d require php 5.2.6 (debian-old's oldest version), get rid of ancient compat 2012-02-01 16:51:38 +00:00
Shish
e6d7e0c1d6 changes for easier monolithing 2012-02-01 16:41:18 +00:00
Shish
a70484be31 moving big functions out of index.php 2012-02-01 15:07:03 +00:00
Shish
45d5a30f8a default TIMEZONE to null, to pick up the server default 2012-01-31 20:59:03 +00:00
Shish
1be336ad23 merge 2012-01-31 15:32:45 +00:00
Shish
04ed07a0df some image links are absolute for good reason (eg they point to a CDN with a different hostname) 2012-01-31 15:11:06 +00:00
Shish Moom
61483aced2 Merge pull request #104 from DakuTree/master
Update ext & fixes
2012-01-31 07:05:16 -08:00
Daku
450b4b4fc1 url_escape for mp3 filename 2012-01-31 15:00:06 +00:00
Daku
a1cc88cade this should fix custom image links 2012-01-31 14:58:55 +00:00
Daku
899bc22538 my favorites/feed tab should only show if ext is enabled 2012-01-31 14:58:54 +00:00
Daku
f76c0a4ff7 popular_by_day/month/year should now work better with other date formats 2012-01-31 14:58:53 +00:00
Daku
a590bf5e15 cleaned up update ext 2012-01-31 14:58:52 +00:00
Daku
bab893bbda really ugly update ext
(although it works, the code is a mess :x)
2012-01-31 14:58:52 +00:00
Daku
4780483d7b fixes the random_image block not keeping the image in the sidebar on certain themes 2012-01-31 14:58:51 +00:00
Daku
4312aeca8f ipban now logs when ip is banned 2012-01-31 14:58:50 +00:00
Daku
42bac78bf0 image_hash_ban should now logged when hash is banned 2012-01-31 14:58:49 +00:00
Daku
c05cef6ab3 added option to use custom home links, should now use default links instead 2012-01-31 14:58:49 +00:00
Daku
74478297f2 contact link only shows if set 2012-01-31 14:58:48 +00:00
Daku
2c1a94c734 xspf_player now uses filename as song title 2012-01-31 14:58:47 +00:00
Daku
56f3ca6c10 fixes the featured block not keeping the image in the sidebar on certain themes 2012-01-31 14:58:46 +00:00
Daku
c5468bd938 centering downtime text 2012-01-31 14:58:46 +00:00
Daku
a5de1fd9f0 fixes popular_by_month/year not working due to "number of bound variables does not match number of tokens" error 2012-01-31 14:58:45 +00:00
Shish
75b9bc2650 typo in merged code 2012-01-31 14:46:19 +00:00
Shish
41ccdfb499 remove some blanks 2012-01-31 14:29:53 +00:00
Shish
853ea10fea merge mass tagger 2012-01-31 14:28:34 +00:00
Shish
fe85b2b5ee Merge remote branch 'zshall/master' 2012-01-31 14:00:41 +00:00
Shish
6f22207603 merge pdo fixes 2012-01-31 13:55:12 +00:00
Shish
aed5e1a30e hand merge of speed tweaks 2012-01-31 13:20:43 +00:00
Shish
db609745d3 Merge remote branch 'snowstrypes/error_wdir' 2012-01-31 12:59:19 +00:00
Shish
1cd4f867b5 don't die if [/code] comes before [code] 2012-01-31 12:24:29 +00:00
Shish
f0fa99ed10 Merge branch 'master' of github.com:shish/shimmie2 2012-01-31 12:17:38 +00:00
Shish
6e6138793b DEBUG_SQL can be null for user-defined 2012-01-31 12:16:47 +00:00
Shish
4da56c12db missed a var 2012-01-31 12:16:34 +00:00
Shish
c2689ba519 set remote addr in postgres connection 2012-01-31 12:16:19 +00:00
Shish
8192f278d5 different sql for different databases :( 2012-01-31 12:15:25 +00:00
Shish Moom
62e34c9b7c Merge pull request #103 from green-ponies/master
Fix for installer failing
2012-01-31 01:53:52 -08:00
green-ponies (jgen)
5a63ad05b5 Fix for installer failing with new DSN define. 2012-01-31 00:35:20 -05:00
Shish
07aac04d44 Merge branch 'master' of github.com:shish/shimmie2 2012-01-30 05:01:08 +00:00
Shish
55447d1aa8 toggle for sql debugging 2012-01-30 05:00:21 +00:00
Shish
8623ab2917 _count_execs actually works nicely for PDO, if called... 2012-01-30 04:56:08 +00:00
Shish
f6567d17d5 Merge branch 'master' of github.com:shish/shimmie2 2012-01-30 03:49:52 +00:00
Shish
444fdb1f04 tag history -> simpleext 2012-01-30 03:46:38 +00:00
Shish
0ea3ff5af3 wordfilter -> simpleext 2012-01-30 03:39:00 +00:00
Shish
18d6fa317c adminpage -> simpleext 2012-01-30 03:22:41 +00:00
Shish
47bfbd7102 downtime -> simpleext 2012-01-30 02:24:22 +00:00
Shish
39e8e8b733 downtime -> simpleext 2012-01-30 02:24:17 +00:00
Shish
7af442855d this isn't so necessary with latest upstream changes 2012-01-30 02:18:16 +00:00
Shish
112fb0841d named placeholders for numeric score 2012-01-30 02:03:15 +00:00
Shish
3d582dc0d9 protip: don't break everything 2012-01-27 19:08:17 +00:00
Shish
38937ebb94 Merge branch 'master' of github.com:shish/shimmie2 2012-01-27 18:53:50 +00:00
Shish
66a5bc2d9e compile event listener table 2012-01-27 18:53:59 +00:00
Shish
ff9e4192ce Merge branch 'master' of github.com:shish/shimmie2 2012-01-27 18:21:09 +00:00
Shish
c664e8d872 missing a bit 2012-01-27 18:17:55 +00:00
Shish
6e64857936 wibble towards being totally SimpleExtension based, as that's easier to programatically optimise 2012-01-27 18:16:46 +00:00
Shish
c1aa6f4fbb how did this ever work o_O 2012-01-27 17:29:59 +00:00
Shish
21904794ea Upload to simpleext 2012-01-27 17:12:08 +00:00
Shish
7aeb0ec097 tag list needs no manual adding 2012-01-27 17:06:29 +00:00
Shish
cb1b45e4ad code formatting consistency 2012-01-27 17:05:02 +00:00
Shish
2d49d9b103 use the right inheritance 2012-01-27 17:02:36 +00:00
Shish
f5eadb9011 Tag List to simpleext 2012-01-27 17:02:08 +00:00
Shish
5c2140a028 Tag Editor to simpleext 2012-01-27 16:58:48 +00:00
Shish
eedfc5e6b4 sys info to simpleext 2012-01-27 16:52:12 +00:00
Shish
ee40a9aad3 merge 2012-01-27 16:49:35 +00:00
Shish
7a5f87572c an image already knows what its own details are, it doesn't need to be passed them... 2012-01-27 16:27:02 +00:00
Shish
50bc229ad7 only rollback the database if there is a database connection 2012-01-27 12:24:48 +00:00
Shish
f3014e4e1e less regex 2012-01-27 12:24:38 +00:00
Shish
583b0b5eb4 sort IP bans into (specific addresses, networks) and check each list individually in an optimised way; 20x speedup /o/ 2012-01-27 11:05:18 +00:00
Shish
93c2aa2084 only show IP list to admin and self-user, and don't show anon's list 2012-01-27 10:17:44 +00:00
Shish
c837239326 stop including config.php by hand 2012-01-26 18:19:28 +00:00
Shish
ad9dcfe926 make sure s is set 2012-01-26 18:03:04 +00:00
Shish
96b8253b38 term can be empty to start with >_< 2012-01-26 17:56:48 +00:00
Shish
ae56e591e9 sometimes, there is no token :O 2012-01-26 17:36:22 +00:00
Shish
70fc4b5a54 Currently SCore is pretty behind-the-scenes 2012-01-26 17:32:30 +00:00
Shish
2fd204f8c0 note how to change system-level settings 2012-01-26 17:32:12 +00:00
Shish
f1d4fc700e persist connections 2012-01-26 17:24:56 +00:00
Shish
85af28c0b5 return after error, don't handle the bad data 2012-01-26 17:16:57 +00:00
Shish
4530efc1e0 minus on its own was being turned into 'negative null-tag', which confused things 2012-01-26 17:16:06 +00:00
Shish
717024d464 explicit no-cache stops varnish from caching 2012-01-26 16:53:59 +00:00
Shish
52bbb36af4 shm_user breaks varnish cache 2012-01-26 16:51:24 +00:00
Shish
c46f03bf8f convert mysql functions + direct query building -> sql standards + paramaters 2012-01-26 16:20:26 +00:00
Shish
ab9b4e9123 limit x,y isn't standard SQL; use limit x offset y 2012-01-26 16:06:45 +00:00
Shish
c30cb55504 log to 'resize' rather than 'core-image' 2012-01-26 16:03:10 +00:00
Shish Moom
38aa55dafd Merge pull request #99 from DakuTree/master
Auto resize on upload + Popular by Day/Month/Year
2012-01-26 08:01:37 -08:00
Shish
1877aa9973 Merge branch 'master' of github.com:shish/shimmie2 2012-01-26 15:26:08 +00:00
Shish
54031fcb90 still bail on assert failures even when debug is off 2012-01-26 15:26:00 +00:00
Shish
98f09695b6 sometimes tags are set with no images id... 2012-01-26 15:16:52 +00:00
Daku
4dc4ed45a4 this should stop any possible errors 2012-01-26 10:27:34 +00:00
Daku
9f92e7badf popular by day/month/year now has navigation 2012-01-26 10:27:33 +00:00
Daku
3477fe8c22 png resizing is broken 2012-01-26 10:27:33 +00:00
Daku
4400b385b3 this should get rid of the Call to ftp://ftp. function error 2012-01-26 10:27:32 +00:00
Daku
e10f863f1c fixed problem with random image tab not showing
popular by day/month/year should only show if ext is enabled
2012-01-26 10:27:32 +00:00
Daku
4e01a116ad this should be lowercase 2012-01-26 10:27:31 +00:00
Daku
229f181370 popular by should use current date if date not se 2012-01-26 10:27:31 +00:00
Daku
77ac43e261 added popular by day/month/year to sublinks 2012-01-26 10:27:31 +00:00
Daku
12f70776d5 popular by day/month/year feature for numeric_score ext 2012-01-26 10:27:30 +00:00
Daku
e9d7157d22 this should be rating 2012-01-26 10:27:30 +00:00
Daku
a1b920777b pools link should now show in menubar 2012-01-26 09:56:35 +00:00
Daku
772fcfa7f5 checks if user is owner of pool before deleting 2012-01-26 09:56:34 +00:00
Daku
cd1087b7a7 oops, forgot to remove class used for lite theme :x 2012-01-26 09:56:34 +00:00
Daku
9f3da77ea9 added random image button to the sublinks bar + help link should now either use the wiki or ext_doc/index 2012-01-26 09:56:33 +00:00
Daku
2cab5ec247 autoresize on upload feature for resize ext 2012-01-26 09:56:32 +00:00
Daku
5142901bca fixes the undefined rating property error 2012-01-26 09:56:32 +00:00
Daku
602f76da53 lite/danbooru themes now show rating in statistics box 2012-01-26 09:56:31 +00:00
Daku
5a2326614a delete by query confirm now uses jquery 2012-01-26 09:56:30 +00:00
Daku
a470bda95e updated jquery libary 2012-01-26 09:56:29 +00:00
Daku
0565568e5c source should log now when uploading 2012-01-26 09:56:29 +00:00
Shish
771eef75d8 Merge branch 'master' of github.com:shish/shimmie2 2012-01-26 02:22:13 +00:00
Shish
ad686975b7 Merge branch 'master' of github.com:shish/shimmie2 2012-01-26 02:15:12 +00:00
Shish
a208d5c6bc lock logging fix 2012-01-26 02:15:06 +00:00
Shish
0d8124af3b consistency for key names 2012-01-24 16:48:28 +00:00
Shish
f38b45e2a9 there are some odd cases where anonymous is not user #1, so use the anon_id variable 2012-01-24 16:40:36 +00:00
Shish
33606444ca these should be ignored as full directories; if they aren't, some other problem needs fixing 2012-01-24 16:35:35 +00:00
Shish Moom
fc25427ca1 Merge pull request #97 from NaGeL182/master
User Deletion
2012-01-24 08:32:42 -08:00
NaGeL
36a04fd62c put DBupdate.php into the install.php under Shimmie Repair Console. 2012-01-23 15:24:23 +01:00
Shish
6d57af0243 beta oekaki ext 2012-01-23 05:42:52 +00:00
Shish
2f565c66d3 ignore oekaki 2012-01-23 05:40:00 +00:00
Shish
96b3b5c72a subfolders in data/ 2012-01-23 05:39:47 +00:00
NaGeL
9009ab2c95 named the foreign keys. 2012-01-22 20:20:26 +01:00
NaGeL
ddd3f99835 deleting the user withouth images delete resulted in image deletion too: the DB entriy gets removed but the image stays on the Hard drive.
this is fixed.
also the Foreign key needs to be manually updated in images table.
named the foreign keys in install.php for easier altering in the future.
2012-01-22 20:14:35 +01:00
NaGeL
023384149f User deletion (Deletes the user with comments, favorites and private messages)
User deletion with uploaded images ( all above plus the images the user uploaded)
Also the Database fix that is all needed for this in DBupdate.php
2012-01-22 18:55:52 +01:00
NaGeL
1ccc26ebd4 Merge branch 'master' of git://github.com/shish/shimmie2 2012-01-22 16:30:12 +01:00
Shish
03204859c1 merge~ 2012-01-22 15:11:39 +00:00
Shish
ddf61714f6 argh sql syntaxes 2012-01-22 14:54:03 +00:00
Shish
565b15c91e access the start time too... 2012-01-22 14:48:06 +00:00
Shish
f3c0c0e637 allow a configurable timezone 2012-01-22 14:40:41 +00:00
Shish
da45389c42 have autodate include hours and minutes 2012-01-22 14:40:25 +00:00
Shish Moom
0300ee79c6 Merge pull request #93 from DakuTree/master
Holiday ext + Fixes
2012-01-22 06:12:04 -08:00
Daku
f589ee3f80 git ignore update 2012-01-21 13:13:10 +00:00
Daku
3338ff0420 tags/source/rating/locked should only update/log if different than current 2012-01-21 00:17:07 +00:00
Daku
7049b3bf4d rating/source/locked now log info when set 2012-01-20 23:04:28 +00:00
NaGeL
b219d79a22 A database update, for user deletion
now user_favorites clean itself too.
And a DBfix for those who installed shimmie before this date.
2012-01-20 22:08:19 +01:00
Daku
eeaa27133a fixed rating with bookmarklet 2012-01-20 12:45:43 +00:00
Daku
53211aa0a7 delete with jquery should no longer hide under flash 2012-01-20 12:45:43 +00:00
Daku
471e3d057a fixed bookmarklet on danbooru flash pages again.. 2012-01-20 12:45:42 +00:00
Daku
dc10fa22af change email form now shows in lite theme 2012-01-20 12:45:41 +00:00
Daku
38e2f961fb holiday ext should work properly now 2012-01-20 12:45:41 +00:00
Daku
9a35401666 image replace form now uses jquery 2012-01-20 12:45:40 +00:00
Daku
df20a75271 removing holiday feature from lite theme 2012-01-20 12:45:39 +00:00
Daku
fd9ab64132 Holiday ext 2012-01-20 12:45:39 +00:00
Daku
79b4adf1d1 renamed style.css for the upload ext to avoid autoloading 2012-01-20 12:45:38 +00:00
Shish
208320f072 Reeeeeeally old bug that nobody cared about: getrusage returns CPU time used by the current process, not by the current page. PHP-FPM has many pages per process 2012-01-20 05:45:09 +00:00
Shish
f5edb4fb4e the 24 hour limit can apply to the page count too, making that also 70x faster 2012-01-20 05:24:29 +00:00
Shish
9b96b44d64 tag cache is glitchy, too many things might update it 2012-01-20 05:16:40 +00:00
Shish
4c2adce744 limiting by date at the database level is ~70x faster than limiting by page at the PHP level 2012-01-20 04:34:06 +00:00
Shish
f100e6a9d4 5 may have been a little extreme 2012-01-20 04:05:54 +00:00
Shish
49e7bfa1b2 tidy up some ancient base_href / data_href messes; base_href as a config variable is no longer used 2012-01-20 03:29:29 +00:00
Shish
18e36f9b31 Rather than three levels of configuration, let's have two (define()'d values in config.php for system-level stuff, the web-editable config table for user-level stuff). Basically switches database_dsn from a global variable to a defined constant. 2012-01-20 03:15:58 +00:00
Shish
36e443e07d the algorithm for listing old comments pages is *really* inefficient; the first few pages are quick, page 100 can take a few seconds to generate... rule34 has over 100,000 pages of comments. Limit to the first few pages for now, as I don't know anyone who even goes past the front page. 2012-01-20 03:12:48 +00:00
NaGeL
8eaaa6a7ca Added user deletion.
User is deleted from database
the Comments are deleted too, unknown reason for me
Noting else is deleted so far.
2012-01-19 18:23:43 +01:00
NaGeL
557a82e7be Fixed linking bug in admin_user/list page. 2012-01-19 16:43:20 +01:00
Shish
8ba22d8fbc same for user-agent 2012-01-19 15:28:55 +00:00
NaGeL
520fb08652 just gitignore update 2012-01-19 16:28:16 +01:00
Shish
b8bdbd3533 after detecting an error, don't carry on processing the bad data... 2012-01-19 15:23:44 +00:00
Shish
7608107232 lib/askismet expects the referrer to either be set manually, or exist; if it doesn't exist we need to set it manually 2012-01-19 15:20:32 +00:00
Shish
a75d8744c9 Merge branch 'master' of github.com:shish/shimmie2 2012-01-18 18:00:10 +00:00
Shish
b1d1d71093 author search from nagel 2012-01-18 17:53:52 +00:00
NaGeL
b52651c558 added [align=(left|center|right)] BBcode which aligns text naturally. 2012-01-18 17:49:29 +00:00
Shish
bdf274074c some people like heading to the image after an image that isn't there (mostly robots with old URLs) 2012-01-18 03:13:27 +00:00
NaGeL
3c6217fa4c added [align=(left|center|right)] BBcode which aligns text naturally. 2012-01-17 22:45:24 +01:00
NaGeL
46776bf853 added author=<name> search tag. 2012-01-17 22:43:16 +01:00
Shish
e46c22a228 weighted CDN targets 2012-01-17 15:47:58 +00:00
Shish
153e3ca3db Merge branch 'master' of github.com:shish/shimmie2 2012-01-17 15:33:53 +00:00
Shish
940b95c9e6 searching for image hash bans 2012-01-17 15:33:42 +00:00
Shish Moom
dff8aa06fe Merge pull request #92 from DakuTree/master
Bookmarklet update + Holiday feature for lite theme.
2012-01-17 07:14:08 -08:00
Daku
a336944b11 uploader fixes 2012-01-17 10:56:52 +00:00
Daku
a45c09b2b6 Bookmarklet now checks if ext is supported/filesize is lower than limit before attempting to upload. 2012-01-17 07:57:58 +00:00
Daku
433197e187 Bookmarklet seems to work fine with Gelbooru now... 2012-01-17 04:57:14 +00:00
Daku
9f5465c0e5 Bookmarklet now asks if you want to use current/new tags again. 2012-01-17 04:28:45 +00:00
Daku
fcb8307f58 Booru bookmarklet now works with shimmie sites + is now loaded via .js script on the site. 2012-01-17 04:03:32 +00:00
Daku
7759700160 fixes tag_edit__locked/locked errors 2012-01-17 03:58:28 +00:00
Daku
5ac53ceb84 Small holiday feature for lite theme. Loads extra stylesheet on certain holidays. 2012-01-17 03:52:38 +00:00
Shish
c3aa7f14dd named placeholder for rating search 2012-01-16 22:53:14 +00:00
Shish Moom
17b5268452 Merge pull request #91 from green-ponies/master
Additional fix for notes.
2012-01-16 14:37:23 -08:00
green-ponies (jgen)
211e191b50 Removing unnecessary and incorrect mysql_real_escape_string() calls. 2012-01-16 17:30:06 -05:00
Shish
9a4ea2bc77 merge green-ponies/master 2012-01-16 21:19:10 +00:00
green-ponies (jgen)
ce303d4fe3 Needs to have the get_base_href() first. 2012-01-16 16:11:53 -05:00
Shish
7045b21b44 uploader javascript fixes from jgen (copy & paste is easier than fixing merge conflicts >.>;;) 2012-01-16 21:10:51 +00:00
green-ponies (jgen)
46960eed48 Fix for Notes missing js files. 2012-01-16 16:06:05 -05:00
Shish
6ca81cb636 Merge branch 'master' of github.com:shish/shimmie2 2012-01-16 20:59:00 +00:00
Shish
cc3bda38f0 attempt to hand-merge jgen's revert by IP vits 2012-01-16 20:58:55 +00:00
green-ponies (jgen)
d46244f926 Display message if no comments. 2012-01-16 20:54:34 +00:00
green-ponies (jgen)
fdca5e4662 Patch for displaying error message when disk full. 2012-01-16 20:52:26 +00:00
Shish Moom
40c3861bc9 Merge pull request #76 from tkorpe/master
Bulk add faster
2012-01-16 12:41:56 -08:00
Shish
8f56b9ae2c argh php, syntax that used to be required is now deprecated... 2012-01-16 19:58:03 +00:00
green-ponies (jgen)
cd7de93a0a Changing for-loops to use pre-calculated values.
Rather than calculating the value each time.
2012-01-16 00:07:04 -05:00
green-ponies (jgen)
8252534cff Small changes with quotes. 2012-01-15 23:03:27 -05:00
Shish
9bde42d452 consistent hashing for multiple data mirrors 2012-01-16 02:53:38 +00:00
green-ponies (jgen)
d1495050ab Merge remote-tracking branch 'remotes/shish/master' into speed 2012-01-15 21:35:11 -05:00
green-ponies (jgen)
ab4e1db0b8 Merge remote-tracking branch 'remotes/shish/master' into revert_by_ip 2012-01-15 21:34:47 -05:00
green-ponies (jgen)
5ab776d1ef Merge remote-tracking branch 'remotes/shish/master' 2012-01-15 21:33:14 -05:00
Shish
5b9c8b736d remove debug 2012-01-16 01:50:44 +00:00
Shish
f0105125d1 Merge branch 'master' of github.com:shish/shimmie2 2012-01-16 01:35:44 +00:00
Shish
6d88e3f4d8 twitter feed ext 2012-01-16 01:35:36 +00:00
green-ponies (jgen)
342600cb40 This code is not used in the master branch.
Moved into separate branch 'revert_by_ip'.
2012-01-15 12:02:54 -05:00
green-ponies (jgen)
daf51d5477 Feature to Revert Tag changes by IP address.
Allows you to revert all edits made by a specific ip during a specified timeframe.
2012-01-15 11:57:32 -05:00
Shish
9d36a6a1bb sometimes when looking for next/prev the image doesn't exist 2012-01-14 14:38:45 +00:00
Thasan
aa452bf8eb Added $force to vars 2012-01-14 11:15:13 +02:00
Shish
0a4e8e05f0 quieten notices of overwritten things 2012-01-14 01:51:44 +00:00
green-ponies (jgen)
7195d3d1f3 Changes using empty instead of strlen. 2012-01-12 23:07:14 -05:00
green-ponies (jgen)
2c6b5128c6 More tweaks for minor speed gains. 2012-01-12 21:17:37 -05:00
green-ponies (jgen)
3f7646bc8b typo 2012-01-12 20:30:26 -05:00
green-ponies (jgen)
aa9c8c2097 Small change to index. 2012-01-12 20:28:16 -05:00
green-ponies (jgen)
fc12bbbfe5 More small changes to help save a few microseconds. 2012-01-12 15:46:34 -05:00
green-ponies (jgen)
d7ff1b96ab More stupid typos. Gah. 2012-01-12 15:13:38 -05:00
green-ponies (jgen)
c739e5b2e8 Silly typo. 2012-01-12 15:06:32 -05:00
green-ponies (jgen)
ea6f853891 Changes to the index file as well. 2012-01-12 14:47:24 -05:00
green-ponies (jgen)
2e0e8475a1 A few more small changes for speed. 2012-01-12 14:46:58 -05:00
Thasan
cd34879cf1 oops, forgot debug code 2012-01-12 03:59:58 +02:00
Thasan
9f8a49483f check if thumbnail already exists before regenerating it, way to force regen. 2012-01-12 03:54:27 +02:00
green-ponies (jgen)
26d383198a More small changes for speed. 2012-01-11 15:57:00 -05:00
green-ponies (jgen)
ea15574226 Changes and tweaks for speed.
Because every microsecond counts! :P
These changes are based on information from:
http://phpbench.com/
http://stackoverflow.com/questions/482202/is-there-a-performance-benefit-single-quote-vs-double-quote-in-php
2012-01-11 15:08:27 -05:00
green-ponies (jgen)
0b03f91f1c Fixed the new upload form.
Changed it over to use jQuery since shimmie has that already.
Works with FF, Chrome, and IE 7 now.
2012-01-09 20:45:30 -05:00
green-ponies (jgen)
f7fc253075 Display message if no comments. 2012-01-08 22:18:17 -05:00
green-ponies (jgen)
dcf96456f1 Fixed issue with Cancelling Transloads.
Also added some features to the Bookmarklet.
2012-01-08 16:50:35 -05:00
green-ponies (jgen)
57da47c93a using the new uploader 2012-01-08 13:36:39 -05:00
green-ponies (jgen)
f93b86261e Small feature for uploading using a bookmark. 2012-01-08 13:23:39 -05:00
green-ponies (jgen)
db59cb14af Working on Reverting Changes by specific IP. 2012-01-08 13:23:03 -05:00
Shish
8cfa72d7cf copyright bumps 2012-01-01 20:36:51 +00:00
Shish
5b717870d1 case sensitivity blargh 2012-01-01 17:13:50 +00:00
Shish
0c96603861 Merge branch 'master' of git@github.com:shish/shimmie2 2012-01-01 16:58:01 +00:00
Shish
beff330a37 Merge branch 'master' of github.com:shish/shimmie2 2012-01-01 16:54:58 +00:00
Shish
56a780bfd3 in per-letter mode, don't separate a and A 2012-01-01 16:54:44 +00:00
Shish Moom
6e66c10d4b Merge pull request #67 from DakuTree/0d93f29bce
More Stuff!
2011-12-31 07:59:15 -08:00
Shish
c39697a40f stub for comment time-ago 2011-12-31 14:21:02 +00:00
Daku
0d93f29bce Delete by Query now requires you to enable the form, aswell as confirm the deletion. 2011-12-31 14:18:56 +00:00
Daku
dff1eef51a make_form now has a onsubmit option 2011-12-31 14:18:55 +00:00
Daku
dc4d156e1a contact link should now properly link to email 2011-12-31 14:18:54 +00:00
Daku
b9bd4db41e Tag list should now show under the search block, instead of under every other block 2011-12-31 14:18:53 +00:00
Daku
12d4fcf813 related block should now change title depending on what tag list is set to 2011-12-31 14:18:52 +00:00
Daku
d9e1b935b0 +/- buttons should now work in FF, instead of directing you to blank page 2011-12-31 14:18:51 +00:00
Daku
c2ad8322ef fixed downloading flash with bookmarklet + added comments 2011-12-31 14:18:50 +00:00
Daku
3b73013d1d This should fix the "Undefined variable" error. 2011-12-31 14:18:48 +00:00
Shish
ad2bb8b8b6 switch timeago to a javascript implementation 2011-12-31 14:12:34 +00:00
Shish
e8791d0759 Merge branch 'master' of git@github.com:shish/shimmie2 2011-12-31 13:57:56 +00:00
Shish
1857075bd9 show comments made by user 2011-12-31 13:54:32 +00:00
Shish
636b5fc119 debugging off by default 2011-12-27 20:00:56 +00:00
Shish
77b4bd8d46 Merge branch 'master' of git@github.com:shish/shimmie2 2011-12-27 19:27:05 +00:00
Shish
cfbeddde9f HTTP level caching, so we can stick varnish in front of the web pages 2011-12-27 19:23:37 +00:00
Shish
9b93df4e22 make apache cache-control/expires settings only apply to static files; shimmie will take care of the web pages 2011-12-27 18:12:56 +00:00
Shish
009b7ccbbb stick the tag list paging option in the right place, and PDO/PG compat 2011-12-25 23:14:13 +00:00
Shish
082730f29a get the tag initials from the database itself 2011-12-25 22:34:20 +00:00
Shish
8887ffe101 make paging optional 2011-12-25 18:23:00 +00:00
Shish
b7bd74055d PHP is officially the worst web API ever 2011-12-25 17:57:15 +00:00
Shish
e05d4619db Also I hate PHP on a personal level. 2011-12-25 17:07:55 +00:00
Shish
e9fedb570a PHP is shit. MySQL is also shit. 2011-12-25 16:59:13 +00:00
Shish
b57a2d2121 paged tag lists backend, and speed hax 2011-12-25 16:42:05 +00:00
Shish
67e0c87b20 create a generic bool_escape function, use that 2011-12-25 15:11:26 +00:00
Shish
d167849ffc huge if block is correct, but unnecessary - we can just take the first letter and the even system will validate it 2011-12-25 14:47:54 +00:00
Shish
3e6d5cec6f rating event rather than database access 2011-12-25 14:35:55 +00:00
Shish Moom
d25ef4e6f6 Merge pull request #63 from DakuTree/master
Few new features + More fixes
2011-12-25 06:31:36 -08:00
Shish
ba02e589b0 IP isn't an int 2011-12-25 12:38:07 +00:00
Shish
070aeff199 search images by uploader IP 2011-12-25 12:31:28 +00:00
Shish
cd609141f4 optional warehouse split levels 2011-12-25 11:24:20 +00:00
Daku
66484a8e68 Thumbs should now be centered. 2011-12-25 10:04:07 +00:00
Daku
c645fb4b0e Title should now always stay as site name, to avoid tag hell for images with loads of tags. 2011-12-25 09:47:34 +00:00
Daku
394f4518a3 More improvements to the uploader. 2011-12-24 23:28:33 +00:00
Shish
2f9979c790 include config.php before define()ing settings, so that config.php can control them 2011-12-24 21:56:26 +00:00
Shish
6d3cdb208c those functions aren't /called/ unless coverage is set ._.;; 2011-12-24 21:55:33 +00:00
Shish
883c73c9ff even if xdebug is installed, only run coverage when told to 2011-12-24 21:51:48 +00:00
Shish
b5f5c861c4 quality in imagemagick mode 2011-12-24 21:30:54 +00:00
Daku
ee1fc7e3ae Admin can now lock image while transloading. 2011-12-24 20:18:00 +00:00
Shish
5121e99dbe speed hax and niceurl forcing from r34 2011-12-24 14:49:55 +00:00
Daku
42b902ecb5 Bookmarklet should now grab the rating, aswell as the image page link for source. 2011-12-23 21:28:47 +00:00
Daku
cd11e75e40 Can now set rating/external source while uploading via the bookmarklets. 2011-12-23 21:27:38 +00:00
Shish
913bb09cc6 PDO compat woo 2011-12-23 14:34:42 +00:00
Shish
002df1a7ba keywords for images with lite theme 2011-12-23 14:28:42 +00:00
Shish
11881c9993 specify content-type for home page 2011-12-23 14:22:38 +00:00
Shish Moom
990dbe5fd1 Merge pull request #59 from DakuTree/master
More fixes!
2011-12-21 14:29:08 -08:00
Daku
660f9ca4b0 Changed "'thumb_width', 'thumb_height'" > "$config->get_int('thumb_width'), $config->get_int('thumb_height')" 2011-12-21 20:52:06 +00:00
Daku
9a2d694b6a Made the replace form look similar to the new upload form. 2011-12-21 02:40:30 +00:00
Daku
c37569f3d4 Fixed reCaptcha. 2011-12-21 02:28:39 +00:00
Daku
dab67ea1bb Updated recaptcha. 2011-12-20 21:56:07 +00:00
Daku
c125c4ba92 Making the upload form look a bit nicer. 2011-12-19 01:43:46 +00:00
Daku
fbe0df29ed Fixed scaling with the theme patch. 2011-12-16 21:35:30 +00:00
Daku
c7852423d4 Added a feature which removes the size tag from mp3 tooltips. 2011-12-16 21:29:46 +00:00
Daku
56931b0eaa Changed the 192x192 default to use the max thumbnail size. Made this work with SVG aswell. 2011-12-16 18:36:08 +00:00
Daku
a38327b6d3 Made flash thumbnails have a default 192x192 resolution. 2011-12-16 16:34:23 +00:00
Shish Moom
986d010f8e Merge pull request #57 from DakuTree/master
Few small fixes
2011-12-14 02:22:22 -08:00
Daku
583de3fe6a Small update to include the code by green-ponies in issue #51. 2011-12-14 07:53:48 +00:00
Daku
2b717063eb Updated the bookmarklet to give you an option to use either the your own or the current tags. 2011-12-14 07:36:01 +00:00
Daku
0e4f93a42f Added a separate option for popular tags length. 2011-12-14 06:45:35 +00:00
Shish Moom
233f01052e Merge pull request #56 from DakuTree/master
Just a simple bookmarklet!
2011-12-12 01:20:25 -08:00
Daku
ac9e1c73cf Adding a simple Danbooru>Shimmie bookmarklet. 2011-12-11 06:13:00 +00:00
Shish
c6682b9069 make_link for numeric score votes, and put in theme.php, fixes issue #50 2011-11-08 11:23:38 +00:00
Shish
a89c5943d8 error details when the file copy fails 2011-11-08 11:02:04 +00:00
green-ponies (jgen)
7bfe30e0c5 Patch for displaying error message when disk full. 2011-11-04 01:00:45 -04:00
green-ponies (jgen)
12a480ed8b Fixed small bug with transloading images. (If clean_urls were not enabled) 2011-11-03 16:55:04 -04:00
Shish
054a92a979 Merge branch 'master' of github.com:shish/shimmie2 2011-10-25 16:17:57 +01:00
Shish
8cb95ceb98 also allow https sources 2011-10-25 16:17:44 +01:00
Shish Moom
d5d2bf66af Merge pull request #48 from green-ponies/master
Small commit
2011-10-24 02:28:51 -07:00
green-ponies (jgen)
ef61a4cb4a Small patch for Blotter extension, and also added Version to debug output. 2011-10-23 21:54:04 -04:00
Shish
9361032cb6 user page needs current user 2011-10-20 18:12:14 +01:00
Shish
ac3bf33402 tag_n wasn't used by accurate search, but was by ugly 2011-10-18 22:32:04 +01:00
Shish
5a6501f2be log event handlers as well as events 2011-10-09 17:08:13 +01:00
Shish
eb7927b3b1 Merge branch 'master' of github.com:shish/shimmie2 2011-10-09 12:10:22 +01:00
Shish
4b86497816 support for Context profiling 2011-10-09 12:01:48 +01:00
Shish Moom
fc45aa2752 Merge pull request #42 from green-ponies/master
Automatic Caching of CSS and Javascript
2011-10-06 16:41:51 -07:00
green-ponies (jgen)
589f218d1f Small changes to disable the checkboxes by default. 2011-10-06 15:31:56 -04:00
green-ponies (jgen)
bba4301bfa Disabled option for Minifying CSS and JavaScript. (not currently supported) 2011-10-06 15:23:49 -04:00
Yaro
9e2522f86f fixed unpredictable working directory inside register_shutdown_function 2011-10-04 17:03:53 +04:00
green-ponies (jgen)
c1df2653a8 Cleaned up the comments a bit. 2011-09-25 14:16:20 -04:00
green-ponies (jgen)
944f3bdf3d Fixed caching from not outputing JS if only CSS is enabled. 2011-09-25 14:00:56 -04:00
green-ponies (jgen)
97d137f365 Working on Automatic Caching feature for CSS and JS files.
Added config options to main Shimmie config.
2011-09-25 13:40:34 -04:00
Shish
a1da59804e Merge branch 'master' of github.com:shish/shimmie2 2011-09-25 12:45:59 +01:00
Shish
5b09467310 fix for alisaing suggested by Diftraku 2011-09-25 12:45:08 +01:00
Shish Moom
189b8192e0 Merge pull request #37 from Madoushi90/master
Fix for Issue #35
2011-09-17 01:29:14 -07:00
Justin Brewer
32a7ce2739 PDO Fix 2011-09-16 17:17:37 -05:00
Justin Brewer
cadb3f08ca If an image has no history, make one with the old tags so the new tags can be reverted. 2011-09-16 17:12:27 -05:00
Shish Moom
d37a2bfdd4 Merge pull request #34 from green-ponies/master
CSS & JS caching and Fix for Issue 22
2011-09-13 03:00:30 -07:00
green-ponies (jgen)
2e276a095e Fix for Issue 22 from HungryFeline. 2011-09-11 21:41:46 -04:00
green-ponies (jgen)
864e823447 Small change to headers for efficiency.
These two headers are always sent and do not need
to be added to the header queue. (wastes time)
2011-09-11 21:26:23 -04:00
green-ponies (jgen)
6e7789c40b Added feature to try and cache the CSS and Javascript files by default.
This reduces the total number of HTTP requests (and hopefully
allows the site to load faster).
2011-09-11 21:24:18 -04:00
Shish Moom
d61b7b7712 Merge pull request #33 from green-ponies/master
Incoming Code!
2011-09-09 13:56:37 -07:00
green-ponies (jgen)
808e477f34 Admins can configure the browser Image Expiration now.
Also renamed the config option for jQuery image delete.
2011-09-05 14:47:30 -04:00
green-ponies (jgen)
1c8ba8dc26 Wrong brackets. 2011-09-04 14:24:14 -04:00
green-ponies (jgen)
c2ef8736b8 Fixed a typo. 2011-09-04 14:19:06 -04:00
green-ponies (jgen)
c30c898c4e Changing files to use the $page->add_http_header() method instead. 2011-09-04 14:06:50 -04:00
green-ponies (jgen)
bd31bcd79a The page class now supports both HTML headers and HTTP headers.
From the comment:
FIXME: should be $page->blah
2011-09-04 14:06:44 -04:00
green-ponies (jgen)
19a3a5a6f9 Working on changed $page to support http headers as well as html headers. 2011-09-04 14:06:39 -04:00
green-ponies (jgen)
fca286913e Working on moving header() inside of the global $page data structure. 2011-09-04 14:06:34 -04:00
green-ponies (jgen)
bf035c247d Slight changes to how the Replace & Resize forms are displayed. 2011-09-04 13:46:12 -04:00
green-ponies (jgen)
8422e0050a Another small change to reduce PHP notices. 2011-09-04 11:52:34 -04:00
green-ponies (jgen)
be6e6e2933 Small change to reduce PHP notice. 2011-09-04 11:41:25 -04:00
green-ponies (jgen)
d05344d5e3 Image resize is working now! (uses the GD library only for now)
Moved resize into contrib folder.
2011-09-04 11:17:14 -04:00
green-ponies (jgen)
ad850ad0d6 Fixed a small typo. 2011-09-04 10:30:20 -04:00
green-ponies (jgen)
14bfa8b323 Working on Image Resize feature. 2011-09-03 23:13:41 -04:00
green-ponies (jgen)
100dd6438e Added more comments and changed others for better doxygen support. 2011-09-03 19:34:46 -04:00
green-ponies (jgen)
9c8da62ba0 This function needs the global $config. 2011-09-03 17:01:27 -04:00
green-ponies (jgen)
e6e9aced1c This function doesn't need the global $user now. 2011-09-03 16:48:33 -04:00
green-ponies (jgen)
3cfe182ad3 Typo, Renamed. 2011-09-03 16:45:56 -04:00
green-ponies (jgen)
7ee0407ba8 Oops, forgot to rename. 2011-09-03 16:42:12 -04:00
green-ponies (jgen)
8e68d650a1 Cleaned up how the Image Replace html is made. 2011-09-03 16:03:21 -04:00
green-ponies (jgen)
cc1545188c Merge branch 'master', remote-tracking branch 'origin/master' 2011-08-31 20:37:25 -04:00
Shish
309a2f497f only admins should replace images (possibly people should be allowed to replace their own too? I'm erring on the side of caution for now though) 2011-09-01 00:36:38 +01:00
Shish Moom
f5d08f1585 Merge pull request #32 from green-ponies/master
Image Replace
2011-08-31 16:34:29 -07:00
green-ponies (jgen)
c44ed439f8 Extra checking for the user being an admin before allowing image replacement.
Also removed some duplicated code for efficiency.
2011-08-30 13:57:14 -04:00
green-ponies (jgen)
17999cade8 Image Replace feature working, just needs more testing. 2011-08-25 21:35:59 -04:00
green-ponies (jgen)
b02c747ac1 Working on image replace.
Getting unknown 404 errors.
2011-08-24 23:55:44 -04:00
green-ponies (jgen)
0d863c898e These files are needed for the jQuery UI library.
Modified the git ignore file accordingly.
2011-08-24 21:57:32 -04:00
green-ponies (jgen)
62cc7e0e5e Working on Replace Image feature.
Added link to page, fixed foreach loop.
2011-08-24 21:23:18 -04:00
green-ponies (jgen)
f3b6fde7a5 Working on adding a "Replace Image" feature. 2011-08-24 20:53:53 -04:00
Shish
684193848a fix typo 2011-08-24 10:40:32 +01:00
Shish
2049754ef2 Merge branch 'master' of github.com:shish/shimmie2 2011-08-24 09:05:10 +01:00
Shish
db142a2be8 PDO pools 2011-08-24 09:01:43 +01:00
Shish Moom
e700673b66 Merge pull request #29 from green-ponies/master
Patch for File Uploads
2011-08-17 01:34:09 -07:00
green-ponies (jgen)
eb5ff191c6 Confirm image delete with jQuery UI modal dialog.
Added config option for jQuery delete as well.
2011-08-16 23:14:30 -04:00
green-ponies (jgen)
80ff538b73 Updated the jquery library and added ui library. 2011-08-16 21:14:01 -04:00
green-ponies (jgen)
73c887e30f The default theme actually does use this file. 2011-08-16 19:42:51 -04:00
green-ponies (jgen)
e9b862b560 Better error checking when uploading files.
Also, displays PHPs limit on the setup page.
2011-08-16 16:31:23 -04:00
Shish Moom
b201098ef9 Merge pull request #28 from green-ponies/master
Issue #5 - Confim Delete
2011-08-14 13:56:01 -07:00
green-ponies (jgen)
53c10ecddf Confirm image delete operation with javascript. 2011-08-12 22:02:41 -04:00
green-ponies (jgen)
3a4aea45d5 Small addition for giving forms unique IDs. Mainly so that javascript has
something to hook onto.
2011-08-12 21:56:48 -04:00
green-ponies (jgen)
6c3e91e01c changed script tags to include language 2011-08-12 21:40:51 -04:00
Shish
4f864c6a80 remove quotes from convert.exe in some cases 2011-08-08 13:01:35 +01:00
Shish
71e07bd13f pdo wikiness 2011-08-01 10:52:02 +01:00
Shish Moom
5dd4c29d56 Merge pull request #26 from Madoushi90/master
Fix for nice url test
2011-08-01 02:35:43 -07:00
Shish
69701c671c pdo syntax for blotter 2011-07-28 12:17:11 +01:00
Justin Brewer
98e170cd86 Fixed Nice URL test for servers not running on port 80.
HTTP_HOST will contain the full host name used to access the site, including
the optional port number. However, on some misconfigured servers, HTTP_HOST
will not be defined, in which case the script will attempt to reconstruct the
host name from SERVER_NAME, and if necessary, SERVER_PORT.
2011-07-27 22:38:02 -05:00
Shish
9d9a960d1b type->engine for mysql 5.5 2011-07-14 10:12:39 +01:00
Shish Moom
c05cb0d54e Merge pull request #20 from szalwia/master
Fix for mySQL>=5.1
2011-05-13 02:01:28 -07:00
a5f3a36fa4 fix for mySQL>5.1 - should remain compatible with versions prior to 5.1 2011-05-12 12:32:34 -07:00
Shish
7118e5fe40 button to remove all votes by user 2011-03-28 22:31:45 +01:00
Shish
1abb96159b PDO returns 'false' for no rows, but various parts of the code expect it to return 'null'; for now, emulate the old behaviour 2011-03-24 14:27:11 +00:00
Shish
ae17700a30 half support for caching giant tag maps 2011-03-23 13:21:14 +00:00
Shish
3d0cdfff56 mark users who have commented as interacting 2011-03-23 11:40:32 +00:00
Shish
b481db493c cache recent comments and comment page count 2011-03-23 11:37:46 +00:00
Shish
0539df80a9 remove votes on image 2011-03-23 11:31:12 +00:00
Shish
bc49df35c1 only check event type once 2011-03-23 11:30:36 +00:00
Shish
cd86859f08 cache anon, it gets looked up a lot 2011-03-23 11:26:11 +00:00
Shish
811f9e0f66 cd variable for sites who want /ab/cb/abcd 2011-03-23 11:19:34 +00:00
Shish
7b59be6fa0 DNP action, for one-click bans 2011-03-23 11:17:19 +00:00
Shish
d8a31ce75c caching for featured image 2011-03-23 11:15:39 +00:00
Shish
54e30183cc give auth token for image featuring 2011-03-23 11:12:55 +00:00
Shish
e279e69f96 fix single-tag searches 2011-03-14 14:20:30 +00:00
Shish
c554a12be0 hacky fix for searching, make sure query variables are unique 2011-03-14 12:44:58 +00:00
Shish
e92813bfee no need for auth for extenal submit 2011-03-12 18:08:36 +00:00
Shish
9db12f54f9 opengraph metadata on images 2011-03-07 23:57:56 +00:00
Shish
eda0d66bac make CommentList::get_hash static, for calling from other places 2011-03-06 12:44:38 +00:00
Diftraku
fb65286863 Critical change to deltree, it seems Windows version of PHP does not consider symlinks to be links when checked with is_link(). 2011-03-06 03:17:40 +02:00
Diftraku
3d66c7ce41 "Fix'd" the execute query to pass args array without binding, assuming the first value is at index 0 and the query uses questionmarks. 2011-03-05 03:11:29 +02:00
Diftraku
065102016a Git ignore for artists extension 2011-03-05 02:44:27 +02:00
Diftraku
d6acd31028 Quick fix to danbooru theme 2011-03-05 02:43:34 +02:00
Diftraku
cc4b8d7d83 Added blocks and bookmarks to .gitignore, removed dupe notes 2011-03-03 17:18:51 +02:00
Diftraku
93e2110056 Because Windows... shitty OS is shitty. Added a Windows-only fix to the extension symlink and deltree.
Windows will nag about file info not found on relative paths with symlink (php bug?).
Also, when deleting a symlink on Windows, it needs to be rmdir'd, no unlink'd (kept throwing permission denied for unlink).
2011-03-03 11:40:34 +02:00
Shish
9a1e8dc4b1 trim spaces at the start too 2011-03-02 17:11:06 +00:00
Shish
467eed75d1 'list of tags applied to this image' should not be limited like 'related tags' is 2011-03-02 11:53:38 +00:00
Shish
3e504f8815 Generic Blocks extension 2011-03-02 10:50:22 +00:00
Shish
f8d88c2c67 log image votes 2011-02-28 11:28:42 +00:00
Shish
128f43ca14 bump dependencies, and there should be no need to justify PHP5 any more 2011-02-24 08:53:19 +00:00
Shish
17fa6a933c missed one 2011-02-23 20:27:29 +00:00
Shish
d4b8d29e6a split->explode for simpletest 2011-02-23 18:44:04 +00:00
Shish
1982740386 downtime theme needs access to user global 2011-02-23 15:20:09 +00:00
Josh Sutinen
c89eb46800 alias_editor: More PDO compatibility 2011-02-22 17:35:07 -05:00
Josh Sutinen
f66dd4f089 pm: PDO compatibility 2011-02-22 17:29:31 -05:00
Josh Sutinen
0661f95fbb numeric_score: PDO compatibility 2011-02-22 17:24:00 -05:00
zshall
57972632e4 Added admin setting ability back where it belongs in lite and danbooru themes. 2011-02-22 17:37:25 +00:00
Shish
66e6cdd0a1 hopefully fix search by ID range, and related bits 2011-02-22 15:03:16 +00:00
Shish
34b19c7738 Merge branch 'fix_installer_pdo' of https://github.com/dgz/shimmie2 into dgz-fix_installer_pdo 2011-02-22 10:40:26 +00:00
Josh Sutinen
671aed2876 installer: Make PDO compatible 2011-02-21 22:06:55 -05:00
Shish
5aa380594f GetArray -> get_all 2011-02-21 12:24:51 +00:00
Shish
f92e402c14 fix adding of bans 2011-02-21 12:15:37 +00:00
Shish
b1cb655adc hopefully fix signup for PDO 2011-02-21 11:57:50 +00:00
Shish
ce0d30e0db count() rather than RecordCount 2011-02-13 13:16:49 +00:00
Shish
8495a1ac89 typo fix 2011-02-13 13:10:55 +00:00
Shish
68585bb8c8 PDO compat for comments 2011-02-13 12:44:33 +00:00
Shish
8e2f2a4600 actually fffff 2011-02-13 11:51:32 +00:00
Shish
1e8b94478e GetArray is get_col with the new database API 2011-02-13 11:44:53 +00:00
Shish
b37a5dd840 make the favorites extension PDO compatible 2011-02-13 11:40:10 +00:00
Shish
20cc4cc165 don't have super-thin / super-short thumbs 2011-02-13 11:18:23 +00:00
zshall
39778db1b5 Added admin setting ability back where it belongs in lite and danbooru themes. 2011-02-11 19:02:44 -05:00
zshall
cc6b9753bb Added email extension. 2011-02-11 17:43:18 -05:00
Shish
3cf72af8cd remove extra debug 2011-01-26 17:20:46 +00:00
Shish
46b01c4042 make sure thumbnails have a max ratio of 5:1 2011-01-26 17:09:45 +00:00
Shish
a008a9e34e PDO syntaxing 2011-01-26 14:56:26 +00:00
Shish
10d033b14b username is sometimes null o_O? 2011-01-26 14:55:44 +00:00
Shish
4b5795cc5b fucking php, this took an hour to debug because it just dies with no error message -_- 2011-01-26 12:19:18 +00:00
Shish
0fe86a6291 missed a global 2011-01-23 11:34:27 +00:00
Shish
996183a2d3 cache popular tags 2011-01-22 17:38:41 +00:00
Shish
fc7eb0609e warn on login failure 2011-01-22 16:10:07 +00:00
Shish
3896c71a9a strnorm bits 2011-01-22 15:51:55 +00:00
Shish
141e8fa106 remove the list of acceptable filetypes, as we accept more than just image/* now 2011-01-10 16:39:46 +00:00
Shish
ee3c24117b more pdo compat, database bits 2011-01-03 15:18:24 +00:00
Shish
732c9644ec note about branches 2011-01-03 15:17:45 +00:00
seinoxygen
e6913ad3a2 split is deprecated in php5.3 2011-01-01 19:23:13 +00:00
seinoxygen
d892e59966 user names no longer have spaces 2011-01-01 19:21:31 +00:00
seinoxygen
115d992ff0 merged image zoom 2011-01-01 19:19:18 +00:00
Shish
0d73aa7692 remove mysql-adodb specific function #2 2011-01-01 19:01:38 +00:00
Shish
b0dae2497e remove mysql-adodb specific function 2011-01-01 19:00:30 +00:00
Shish
06a3be4941 Merge branch 'pdo' 2011-01-01 18:47:55 +00:00
Shish
27056f369f sort tags when imploding / exploding 2011-01-01 18:40:21 +00:00
Shish
122885e267 readme updates 2011-01-01 17:04:09 +00:00
Shish
76286686e3 traces are appearing wrong 2011-01-01 17:00:06 +00:00
Shish
2532091ae8 PDO DSN handling (PS. PHP is retarded) 2011-01-01 16:59:41 +00:00
Shish
d6baeab977 more pdo compat 2011-01-01 16:28:04 +00:00
Shish
7684def0f8 add get_pairs 2011-01-01 16:27:56 +00:00
Shish
07959b1fc8 mime_type or ext, not type 2011-01-01 16:23:00 +00:00
Shish
df1142b493 new year 2011-01-01 15:58:44 +00:00
Shish
8d978aa06a more pdo compat 2011-01-01 15:58:09 +00:00
Shish
9e00675900 pdo compat 2011-01-01 15:28:38 +00:00
Shish
175ceac490 PDO compat 2011-01-01 15:28:30 +00:00
Shish
8b2e3262fe clean up database API for completeness and sensibleness 2011-01-01 15:27:24 +00:00
Shish
6b557983c4 more PDO compat 2010-12-31 20:25:03 +00:00
Shish
ffb1762280 Insert_ID -> lastInsertId 2010-12-31 20:00:59 +00:00
Shish
d90016b932 run each page view inside a transaction 2010-12-31 19:59:22 +00:00
Shish
8e63827c0f PDO exceptions for error handling 2010-12-31 19:56:28 +00:00
Shish
1d7b929871 convert parts of core/database to pdo 2010-12-31 19:29:15 +00:00
Shish
5fc6cd4464 remove adodb 2010-12-31 19:05:35 +00:00
Shish
7403fd7c87 Revert "checks for files without extensions, from AtomicDryad"
This seems to break something, such that uploading a jpeg results
in image size 0x0 (other bits seem to work though o_O)

Will take a look at what's up and re-commit later...

This reverts commit ead87d3934ad7d29394fd39e309bd75f5eb78fbb.
2010-12-24 20:44:38 +00:00
Shish
726dd80662 delete by query 2010-12-23 14:00:50 +00:00
Shish
d8c88d373f merge of AD's updates (now with real git-merge, rather than patching by hand; apologies if the hand-patches broke anything) 2010-12-23 01:12:31 +00:00
atomicdryad
70abb80429 TagEditCloud: Typos are not nice. 2010-12-22 19:04:52 -06:00
atomicdryad
323f0953bc TagEditCloud: Now with options. 2010-12-22 18:59:44 -06:00
atomicdryad
d09c1f88cc Extension: tag_editcloud: Add or remove tags to the editor via clicking 2010-12-23 00:47:42 +00:00
atomicdryad
46f1746337 Extension: tag_editcloud: Add or remove tags to the editor via clicking 2010-12-22 17:10:24 -06:00
Shish
20987de933 several themes used the same script.js, and several extensions depend upon these scripts -- move all the functions to a single .js file in lib 2010-12-22 22:40:26 +00:00
Shish
ead87d3934 checks for files without extensions, from AtomicDryad 2010-12-22 21:43:00 +00:00
Shish
6ddd0b3e6f Danbooru API fixes from AtomicDryad 2010-12-22 21:38:04 +00:00
Shish
5f00999f87 use google charts for QR code generation, save 7MB 2010-12-14 20:34:01 +00:00
Shish
1c68d34c22 what the fuck, php? this should not be necessary :/ 2010-10-11 12:21:04 +01:00
Shish
dfef932463 use config.php as CSRF salt 2010-10-07 21:26:28 +01:00
Shish
1e04df7765 <form> -> make_form(), or add auth token manually 2010-10-07 21:26:27 +01:00
Shish
18403a3fa6 csrf-proofing for extensions 2010-10-07 21:26:27 +01:00
Shish
6cd53fed8a csrf functions 2010-10-07 21:26:15 +01:00
Christian Walde
d41370d854 renamed mass tagger files so shimmie recognizes them automatically 2010-09-09 20:14:46 +02:00
Christian Walde
3fdcddcdd0 mass tagger js makes use of new helper function 2010-09-09 20:14:46 +02:00
Christian Walde
02e738d384 amended parameter passing 2010-09-09 20:14:46 +02:00
Christian Walde
6c42842cb4 mass tagger now loads the correct base directories for its static components 2010-09-09 20:14:46 +02:00
Christian Walde
49d4f36071 added first version of mass tagger 2010-09-09 20:14:45 +02:00
Christian Walde
0396ec5283 added jquery helper function file 2010-09-09 20:13:23 +02:00
Christian Walde
52f5a265fa changed the windows coverage fix from closure to parameter passing, since older phps can't do that 2010-09-09 20:10:37 +02:00
Christian Walde
e5b3afb31c this makes coverage dumping work on windows; on windows the cwd is changed to the apache executable's path by the time the coverage end is reached, changing the coverage end function to a closure that gives back a function with the actual shimmie cwd stored fixes this 2010-09-09 20:10:24 +02:00
Christian Walde
e9cabb30b3 simplified install logic 2010-09-09 20:09:49 +02:00
Christian Walde
cd6015203e replaced deprecated split with explode 2010-09-09 20:09:37 +02:00
Shish
c6f358a8fc split is deprecated in php5.3, use explode instead 2010-07-30 15:36:33 +01:00
Shish
10dbe650e2 external CSS comes before external JS 2010-07-30 13:39:11 +01:00
Shish
9660d2f157 specify image size in HTML rather than CSS; chrome claims it loads faster 2010-07-30 13:25:12 +01:00
Shish
a5fa809335 another 2010-07-26 23:29:07 +01:00
Shish
41cc80df34 more url_escape 2010-07-26 23:10:43 +01:00
Shish
c78aa580c0 not all imageinfoset events have favorite_action 2010-07-26 23:06:12 +01:00
Shish
c9ce99bc96 only vote for valid images 2010-07-26 23:00:08 +01:00
Shish
95cf12bd38 only favourite valid images 2010-07-26 22:59:18 +01:00
Shish
9bd19fe320 curl might not be installed 2010-07-26 22:48:15 +01:00
Shish
c0cebccb27 escape more data, fix an XSS hole 2010-07-26 17:21:29 +01:00
Shish
faf313d5ba repeat of GET forms breaking on sites without niceurls 2010-07-26 11:18:07 +01:00
Shish
59ba74d623 hide metadata on windows 2010-07-19 13:57:27 +01:00
Shish
49f860683f more themes, more updates 2010-07-19 13:53:12 +01:00
Shish
7abb4742a5 hack 2010-07-19 13:35:10 +01:00
Shish
d6392dfd44 adodb updates 2010-07-19 13:09:32 +01:00
Shish
1f44bed8d3 ignore it too 2010-07-19 13:05:35 +01:00
Shish
3cfaa82a1b and the S3 library 2010-07-19 13:04:05 +01:00
Shish
d3b430b7b2 S3 mirroring 2010-07-12 22:27:27 +01:00
Shish
6eec2a369d api safety 2010-07-09 13:50:26 +01:00
Shish
06b9eebe49 start of the api 2010-07-09 13:18:07 +01:00
Shish
b92de7410b note the docs in the readme 2010-07-07 13:02:27 +01:00
Shish
f6486d332d hide disk_free_space errors 2010-06-27 17:32:08 +01:00
Shish
a71bf287dd blargh 2010-06-17 19:44:05 +01:00
Shish
77fe23c5a6 file extension to confuse android less 2010-06-17 19:42:17 +01:00
Shish
ee407dd9cb the right class... 2010-05-28 13:36:36 +01:00
Shish
3ab35d4d9d sometimes we want test uploads to fail 2010-05-28 13:24:57 +01:00
Shish
da449245de Convert some Extensions to SimpleExtensions with priorities 2010-05-28 13:06:31 +01:00
Shish
d80ccbe497 SimpleExtension priority framework 2010-05-28 13:06:18 +01:00
Shish
23cc49592d nullify score button 2010-05-28 11:58:26 +01:00
Shish
a62ed8f5eb note that bulk_add requires admin 2010-05-28 11:39:10 +01:00
Shish
c6e61b096b timeline function for profiling 2010-05-27 11:48:29 +01:00
Josh Sutinen
f1d3bec16d Paginator link code was ugly, if no filter criteria were set it would dump "&&&" at the end of the query string. This makes it look prettier. (v2 of fix) 2010-05-23 22:03:36 +01:00
Shish
1ddadc37ea selectFirst is still a whore 2010-05-16 15:27:34 +01:00
Shish
ef0158568f hack to allow hardcoded database_dsn in hiphop 2010-05-15 16:24:11 +01:00
Shish
23216d7549 for compiling under hiphop 2010-05-15 14:53:37 +01:00
Shish
e731b59676 final one? 2010-05-15 14:24:02 +01:00
Shish
26727dde64 these are redundant too 2010-05-15 14:22:44 +01:00
Shish
97db78d29e get rid of extra bits 2010-05-15 14:20:40 +01:00
Shish
0d7efd0256 class type hints for hiphop's benefit 2010-05-15 12:17:32 +01:00
Shish
629c03036c more numeric_score tests 2010-05-13 10:44:47 +01:00
Shish
46ce762949 A bunch of testing / fixes 2010-05-05 14:16:24 +01:00
Shish
c94e16f814 selectfirst is annoying 2010-04-28 11:21:02 +01:00
Shish
ba814aebaa mysql can go choke on a bucket of cocks 2010-04-27 11:36:07 +01:00
Shish
a4fe003878 we want these to be cached 2010-04-26 06:27:33 +01:00
Shish
e1f9d77271 turns out that this was necessary o_O 2010-04-26 06:07:34 +01:00
Shish
f5f49fa4e7 subtitle is ugly in this theme 2010-04-26 06:05:24 +01:00
Shish
c8b7d639df a bunch of autocompletion 2010-04-26 06:00:41 +01:00
Shish
f3c9ca3e65 tag completion internal api 2010-04-26 05:49:11 +01:00
Shish
a4772a209b shimmie already uses ?q= 2010-04-26 05:48:16 +01:00
Shish
91f4fadd07 jquery versions; use a custom autocomplete plugin rather than jquery-ui's 2010-04-26 05:47:33 +01:00
Shish
65962a591a Revert "search field autocomplete"
This reverts commit 29d9c7ae1600abd8f0136776daef16c9a23d2b8b.

zshall has already done this, better >_<
2010-04-26 05:03:58 +01:00
Shish
29d9c7ae16 search field autocomplete 2010-04-26 04:56:45 +01:00
Shish
062f30abe7 Merge branch 'pagevent' 2010-04-26 04:53:31 +01:00
Shish
0bd1108933 new jquery 2010-04-26 04:52:28 +01:00
Shish
e211207ac5 event -> this 2010-04-26 03:39:02 +01:00
Shish
1c5fa146d7 rss extension 2010-04-26 02:37:05 +01:00
Shish
a92a91dedb index extension 2010-04-26 02:36:05 +01:00
Shish
5a83a18df3 add the functions 2010-04-26 02:35:53 +01:00
Shish
756c91cbf7 [postgres] remove warnings about overly-committed transactions 2010-04-23 16:18:36 +01:00
Shish
8a08571325 'offset ? limit ?' is supported by more than 'limit ?, ?' 2010-04-23 16:10:46 +01:00
Shish
509486e690 [postgres] offset/limit 2010-04-23 16:04:21 +01:00
Shish
2c1fa2fd7f move warehouse directory creation into a single place 2010-04-23 05:46:07 +01:00
Shish
ee292c2a25 crudely hide explicit images from the comment list of anons 2010-04-23 04:08:22 +01:00
Shish
dbf529825c double-escape backslashes as well as forward 2010-04-23 03:31:10 +01:00
Shish
27f0f2c971 link to ext_doc rather than ext_manager, for non-admins 2010-04-21 18:03:54 +01:00
Shish
3eee6f313e avatar options 2010-04-21 17:56:01 +01:00
Shish
0816e6bb67 in theory, selectable avatar hosts 2010-04-21 17:32:32 +01:00
Shish
0b2bc99a9d Merge branch 'alltags' 2010-04-21 17:10:24 +01:00
Shish
9caa3ca560 test mincount param 2010-04-21 17:09:58 +01:00
Shish
0799c13faf remove shadow 2010-04-20 16:42:02 +01:00
Shish
4e05d77484 link to all 2010-04-20 02:59:41 +01:00
Shish
92695ae495 note for later 2010-04-20 02:59:41 +01:00
Shish
e82ff7d3fb mincount paramater 2010-04-20 02:59:41 +01:00
Shish
444d1aa3d5 opera = standards :O 2010-04-20 02:51:38 +01:00
Shish
6db60d1cb3 new default 2010-04-20 02:25:37 +01:00
Shish
4b4fd150c4 html5 theme 2010-04-20 02:25:37 +01:00
Shish
38c3038ecb border cancelling; somewhat of an ugly hack... 2010-04-19 20:41:38 +01:00
Shish
b9f21571eb remove error marker >_< 2010-04-11 13:13:58 +01:00
Zach Hall
2a243b6a45 Removed some junk text from the lite theme. 2010-04-11 13:12:09 +01:00
Erik Youngren
75b8790054 Propogate 375c73d to the rest of the default themes. 2010-04-08 14:01:32 +01:00
Erik Youngren
981293a556 Key sort page headers. 1000 should not be first. 2010-04-08 13:59:48 +01:00
Zach Hall
ac141b21c5 Err... forgot one line, but now it's finished. 2010-04-08 13:23:16 +01:00
Zach Hall
2c767706fa Titlebar updates - current page links 2010-04-08 13:23:16 +01:00
Shish
124fbc8f6f Merge branch 'lite_theme' 2010-04-07 13:41:39 +01:00
Shish
77934a7733 Comment::get_owner() function, as an official way to access user data (eg User::get_avatar()) 2010-04-07 13:38:44 +01:00
Shish
ec5b08f659 timestamped comments 2010-04-07 13:25:46 +01:00
Zach Hall
7fa0e9eed8 Attribution updates to Lite theme, as well as blockquote fixing. 2010-04-07 12:43:42 +01:00
Zach Hall
f4bbc5ce04 Fixed a few theme glitches... everything should left-align now. 2010-04-07 12:43:32 +01:00
Zach Hall
9ca0652c13 Unnecessary files cleanup 2010-04-07 12:43:28 +01:00
Zach Hall
57d4041fe9 Minor tweaks 2010-04-07 12:43:24 +01:00
Zach Hall
e9818e8b42 Lite theme updates. Incorporated more Danbooru custom themes to get
the aligning right.
2010-04-07 12:43:19 +01:00
Zach Hall
556b3866a6 Initial commit of 'Lite' theme 2010-04-07 12:43:08 +01:00
Shish
cd3976821c test another couple of branches 2010-04-06 14:44:41 +01:00
Shish
95393af219 minor tidyness 2010-04-06 14:44:34 +01:00
Shish
cf6a533c74 test random image block 2010-04-06 14:44:27 +01:00
Shish
f0b9f8909d test another path 2010-04-06 14:44:19 +01:00
Shish
1ede4443fc test wildcards 2010-04-06 14:44:13 +01:00
Josh Sutinen
a8e7389afe Fix bookmarklet using relative url into absolute url with make_http magic 2010-03-29 03:58:32 +01:00
Shish
9ab6fec30a remove carridge returns when parsing alias CSVs 2010-03-27 04:01:29 +00:00
Shish
9cb7946d69 make memcachecache pay attention to the URI 2010-03-25 10:53:02 +00:00
Shish
69bfc1868e show user ID number 2010-03-25 10:51:30 +00:00
Shish
7efc4a0dfe if necessary 2010-03-25 10:37:52 +00:00
Shish
20edd68093 avoid double escapes 2010-03-24 18:24:47 +00:00
Shish
ba85899d60 _end_coverage as a shutdown function, so that it still gets called on 'exit;' 2010-03-24 12:45:45 +00:00
Shish
973da3cb0f browser search test 2010-03-24 12:36:37 +00:00
Shish
b39a0d7ede admin tools tests 2010-03-24 12:32:04 +00:00
Shish
43533973a7 save a query 2010-03-24 04:44:36 +00:00
Zach Hall
ee4e7a4471 If a user doesn't have permission to view an image, not only will we hide it from the search results, we'll also disallow them access, redirecting them to post/list. 2010-03-24 04:40:57 +00:00
Shish
eaca520f75 more banned words by default 2010-03-24 02:27:54 +00:00
Shish
0ba232694d tidy up 2010-03-23 04:30:33 +00:00
Shish
4b0c2bb1f5 remove redundantness 2010-03-23 01:08:10 +00:00
Shish
6071fb5e88 make this work? 2010-03-22 15:36:44 +00:00
Shish
e49bb14aaf more coverage 2010-03-22 14:47:37 +00:00
Shish
4416343425 more code coverage 2010-03-22 14:42:23 +00:00
Shish
991a66edf0 case sensitivity? 2010-03-22 04:30:07 +00:00
Shish
e3c0b3fbc2 two comments should exist now 2010-03-22 04:00:26 +00:00
Shish
7a56a9c819 only show extension docs if the extension exists 2010-03-22 03:58:14 +00:00
Shish
f4cbd8b24f AHA! This bug took ages to track down, as the trigger was in a completely different system to the error message... Many, many thanks to zshall for managing to reproduce the error, then narrowing it down to a single line \o/ 2010-03-21 02:20:09 +00:00
Shish
5abee51db7 recovery console 2010-03-15 05:30:37 +00:00
Shish
7a5be72cbd build warehouse directories on demand 2010-03-15 04:31:28 +00:00
Shish
d0d3e72b74 two references to trac, both are old 2010-03-15 03:31:53 +00:00
Shish
35b1972b90 test unicode comments 2010-03-14 20:51:15 +00:00
Shish
86a6b09cb0 ... yeah 2010-03-14 02:19:12 +00:00
Shish
2c710bb654 make captchas optional and off by default, some people are having problems 2010-03-14 02:14:28 +00:00
Shish
1e10f286a2 this uses post_image 2010-03-12 20:30:49 +00:00
Shish
4c24f44af8 more tests for search methods 2010-03-12 18:55:03 +00:00
Shish
1a3fa68ade image ext tests 2010-03-12 18:48:30 +00:00
Shish
9a04bce8d1 more ext manager tests 2010-03-12 18:44:14 +00:00
Shish
4422715278 ul and ol tags 2010-03-12 18:39:08 +00:00
Shish
9b9ef1a9ea tips tests 2010-03-12 18:34:37 +00:00
Shish
56446b867f test generation of the actual map 2010-03-12 17:57:21 +00:00
Shish
5238fdc13f no author edit for anon 2010-03-11 13:33:44 +00:00
Shish
e14f9a8b39 this link is broken v.v 2010-03-10 19:26:52 +00:00
Shish
718ad58282 avoid breakage when multiple extensions are installed alongside log_db 2010-03-08 21:56:31 +00:00
Shish
f42468e6eb test source editing 2010-03-08 21:23:16 +00:00
Shish
e7cbb00191 actually, we can use this 2010-03-08 18:29:53 +00:00
Shish
893ee38e60 next/prev with query test 2010-03-08 18:25:23 +00:00
Shish
a7dd45b4e7 note for updaters from 2.0 and 2.1 2010-03-02 02:48:11 +00:00
Shish
7f741f6b99 search votes by IDs, in case of username weirdness 2010-03-01 00:14:32 +00:00
Shish
278b2ef510 indentation 2010-02-27 02:41:52 +00:00
Shish
1574330a88 found a bug 2010-02-27 02:41:10 +00:00
Shish
ffb625fde5 doc fix 2010-02-27 02:09:10 +00:00
Shish
5cf58a4d6b no need for datadict 2010-02-23 09:14:34 +00:00
Shish
1c4b935abe need page for error 2010-02-18 16:26:07 +00:00
Shish
1b83656365 403, not 503 2010-02-18 16:24:31 +00:00
Shish
7683d23df8 test blotter denial 2010-02-18 16:22:10 +00:00
Shish
54b398d08e spell 2010-02-18 15:59:04 +00:00
Shish
b72d5254d0 more blotter testing 2010-02-18 15:58:23 +00:00
Shish
75f7b7ad6a more ignorance 2010-02-18 14:35:29 +00:00
Shish
86f80f2b9c blotter test 2010-02-18 14:34:44 +00:00
Shish
4313375e3b html typo 2010-02-18 14:23:56 +00:00
Shish
3ef9f2aae1 SQL niceness 2010-02-18 14:20:32 +00:00
Shish
7cfadd606a a bit more 2010-02-18 14:14:33 +00:00
Shish
7e303dc73d whitespace consistency 2010-02-18 14:12:52 +00:00
Zach Hall
d3c921e8f3 Blotter Extension 2010-02-18 14:05:34 +00:00
Shish
161a2d1757 postgres is true too 2010-02-17 15:09:00 +00:00
Shish
9c26f9efb4 image locking 2010-02-17 14:16:20 +00:00
Shish
6c85ed3ba0 paginated logs 2010-02-12 17:22:19 +00:00
Shish
5d0c9d3fa3 ipban: delete the cache after changing the data 2010-02-11 11:12:27 +00:00
Shish
f7f411e1f6 regex for homepage links, hopefully less brokenness than the hand written parser 2010-02-11 11:07:57 +00:00
Shish
9b98e6c90a Use Image::count_images() rather than SQL, to take advantage of advanced features and caching 2010-02-11 11:06:30 +00:00
Shish
c31faa3936 fortmatted report text 2010-02-11 10:50:50 +00:00
Shish
2b21471441 the final bit? 2010-02-09 10:08:08 +00:00
Shish
a214856481 post/view?search -> post/view#search for better caching 2010-02-09 10:06:21 +00:00
Shish
5f88ba906f post/view?search -> post/view#search for better caching 2010-02-09 10:05:57 +00:00
Shish
0d95bcb0b3 take next/prev from hash rather than query 2010-02-09 10:04:20 +00:00
Shish
320877f80b URI based hash, for nginx compatability 2010-02-09 07:42:21 +00:00
Shish
b33aa49f00 a technical explanation of build_accurate_search_querylet 2010-02-09 02:07:19 +00:00
Shish
36dac77e5d link to tag changes 2010-02-03 23:55:01 +00:00
Shish
c22f28072f correct some seemingly innocent behaviour, and thus fix a corner case in another extension 2010-02-03 23:54:43 +00:00
Shish
937a430a50 only optimise this case for regular tags 2010-02-03 22:03:46 +00:00
Shish
ca8fc63bf2 comment IDs to link to 2010-02-03 16:01:00 +00:00
Shish
e3fc8cf782 reset anon IDs on the comment/list too 2010-02-03 15:22:54 +00:00
Shish
8b93b0644c postgres barfs if you try to compare a string to an inet_addr 2010-02-03 14:29:55 +00:00
Shish
5e4f387983 searchable event log 2010-02-03 13:57:39 +00:00
Shish
3b2941a5bc if the search is for one tag, then 'count(tag)' (expensive function) = 'tag.count' (index lookup) 2010-02-02 18:19:55 +00:00
Shish
e96e350ccb ID's anons 2010-02-02 18:15:05 +00:00
Shish
74693f9d9f make apc not warn 2010-02-02 18:14:31 +00:00
Shish
387e13f9f0 activate caches if cache_dsn is set 2010-02-02 17:34:45 +00:00
Shish
892214a0c7 APC cache mechanism, faster than memcache? 2010-02-02 17:12:40 +00:00
Shish
a295c210a2 limit/offset incompatability blah 2010-02-02 13:15:24 +00:00
Shish
43486ab5fa make IP bans work better 2010-02-02 11:52:39 +00:00
Shish
16738093e4 make ip_bans work without mysql specific code 2010-02-02 11:52:30 +00:00
Shish
a28a3ffcb9 case-insensitive search 2010-02-02 11:52:24 +00:00
Shish
efac91598c SCORE_STRNORM = lowercase-if-necessary-for-comparison 2010-02-02 02:13:45 +00:00
Shish
8733249a80 no ha 2010-02-02 01:56:00 +00:00
Shish
b34dc57f9e this uses the warehouse too 2010-02-02 01:55:18 +00:00
Shish
0d81fb0538 more warehouse_path use 2010-02-02 01:06:54 +00:00
Shish
e779a880ca link to image in the event log 2010-02-02 00:56:58 +00:00
Shish
898f1e1f73 typo 2010-02-02 00:56:28 +00:00
Shish
155f3cf9e8 lowercase match for pgsql 2010-02-02 00:45:15 +00:00
Shish
f7f3057278 some only have concat, some only have pipes... 2010-02-02 00:43:10 +00:00
Shish
05150706cc wtf git 2010-02-02 00:34:44 +00:00
Shish
6a75857b72 more ignores 2010-02-01 23:47:30 +00:00
Shish
4df08e9477 more sanity checks 2010-02-01 23:30:37 +00:00
Shish
acadaa29ec pgsql fails at db->Insert_ID() 2010-02-01 23:18:10 +00:00
Shish
1d9af46e5f link to user's profile from the event log 2010-02-01 23:10:42 +00:00
Shish
2f9642dc89 log the right variable 2010-02-01 18:34:07 +00:00
Shish
b292bc7a6c postgres requires separate 'offset' aside from 'limit' 2010-02-01 16:19:38 +00:00
Shish
b0bec98243 database-neutral table creation 2010-02-01 16:18:31 +00:00
Shish
9ca5fcd51a MemCache is already used... 2010-02-01 16:17:12 +00:00
Shish
69001a375c no concat in postgres, use pipes 2010-02-01 16:15:53 +00:00
Shish
ad83c7634c 'PRAGMA foreign_keys' is SQLite-specific 2010-02-01 16:13:24 +00:00
Shish
9d40eda409 make memcaching work for pages, and log if DEBUG is set 2010-02-01 16:11:26 +00:00
Zach Hall
acb2a923a0 "Change e-mail" was missing in the danbooru theme. 2010-02-01 00:16:36 +00:00
Zach Hall
fcf2ed252f CAPTCHA in Danbooru user signup form. 2010-01-28 13:35:21 +00:00
Shish
facff9bd5b fix pixel thumb gen 2010-01-27 12:25:19 +00:00
Shish
5ddaed8e28 Turn the QR Code extension into a SimpleExtension, trim the boilerplate 2010-01-26 13:38:08 +00:00
Zach Hall
4ad7232abd QR Code extension 2010-01-26 13:11:22 +00:00
Shish
4db27bb937 tag_history logging 2010-01-23 18:07:31 +00:00
Shish
7d63e08eaf non-admins are allowed to see the extension list now (read-only) 2010-01-23 13:20:32 +00:00
Shish
d715c38341 disable captchas when debugging from localhost 2010-01-23 12:48:43 +00:00
Shish
4361bb0645 put the captcha in the table 2010-01-23 12:40:03 +00:00
Shish
c7eb0cd99d redundant declaration 2010-01-23 12:39:27 +00:00
Shish
90a48abbec make convert.exe findable on windows 2010-01-22 17:42:00 +00:00
Shish
a086b9b7fc strip metadata in a single imagemagick command 2010-01-21 16:11:31 +00:00
Shish
ccaeca19eb make make_http not break with '' as an argument 2010-01-18 08:29:35 +00:00
Shish
a1589ee722 wider danbooru margin 2010-01-18 08:21:22 +00:00
Shish
4a71eb82da dupe function name 2010-01-17 09:54:01 +00:00
Shish
5ba28817a8 try to recognise the DB engine *before* trying to connect... 2010-01-17 09:43:49 +00:00
Shish
13fb551fb3 SQLite now supports foreign keys (3.6.19 onwards) 2010-01-17 09:42:35 +00:00
Shish
b599fc22b6 fix note pagination 2010-01-17 09:19:52 +00:00
Shish
af36f37902 documentation updates 2010-01-12 15:01:34 +00:00
Shish
ef43fc1e57 haaaack 2010-01-11 15:19:04 +00:00
Shish
863932e4ec Copyright notice updates 2010-01-11 15:10:07 +00:00
Shish
4e7f135024 htmlable t&c 2010-01-05 19:06:04 +00:00
Shish
62862994db set user creation to use the generic captcha api 2010-01-05 17:57:10 +00:00
Shish
cbfab3ba5d paginated image bans 2010-01-05 17:31:25 +00:00
Shish
18c0fa7df8 more documentation, and set some extensions to be hidden from the user docs list 2010-01-05 13:13:11 +00:00
Shish
843e2b2cc9 admin extension is no longer core 2010-01-05 11:08:32 +00:00
Shish
f5122af7bd move image deletion function to ImageIO 2010-01-05 11:07:13 +00:00
Shish
f4a74c4d4c better logging 2010-01-05 10:52:23 +00:00
Shish
44c8461f3b Show all extensions in the extension list 2010-01-05 10:32:39 +00:00
Shish
7a60e6fae5 lots of extension docs 2010-01-05 10:11:53 +00:00
Shish
31201aeab9 documentation 2010-01-05 09:40:26 +00:00
Shish
6c5e917864 search by number of tags 2010-01-05 09:05:16 +00:00
Shish
bd42beded8 update extensions links 2010-01-04 12:44:20 +00:00
Shish
c7b4cf8ead documentation updates 2010-01-04 12:41:04 +00:00
Shish
5dc5701ea5 give comments their own subnav 2010-01-04 11:52:07 +00:00
Shish
8e676abd62 for the danbooru subnav bar, assume that the front page = post/list 2010-01-04 11:24:48 +00:00
Shish
8803a58991 type checking for FavoriteSetEvent 2010-01-03 10:05:27 +00:00
Shish
3305cb758f style tips on danbooru 2010-01-03 09:57:38 +00:00
Shish
2a924a1840 add subheading support to all themes 2010-01-03 09:56:07 +00:00
Shish
15f78d9883 don't halt the page load while waiting for this 2010-01-03 09:51:06 +00:00
Shish
ed4b62dc71 make the version string ungooglable 2010-01-03 09:41:31 +00:00
Shish
612332a1a7 more danbooru updates 2010-01-03 09:36:53 +00:00
Shish
d7ae768168 and add the securimage library 2010-01-03 08:57:08 +00:00
Shish
ce6e8aa9ae updates for the danbooru theme 2010-01-03 08:55:43 +00:00
Shish
3bb3ee2e86 securimage support as an alternative captcha 2010-01-03 08:15:52 +00:00
Shish
6ae4c69358 view and download featured 2010-01-02 10:16:49 +00:00
Shish
440fdb88c2 don't redirect-to-image if this is a single image on the last page of several pages 2009-12-30 09:29:25 +00:00
Shish
f3cd5d03a4 email bbcode tag 2009-12-30 09:13:57 +00:00
Shish
830635c5a9 preliminary image locking 2009-12-30 08:54:04 +00:00
Shish
c9283ef010 make sure all tables are innodb, for foreign keys to work 2009-12-30 08:48:40 +00:00
Shish
c9c4843e43 don't show explicit features to those who aren't allowed 2009-12-30 08:17:46 +00:00
Shish
63277a0864 gah 2009-12-30 08:17:33 +00:00
Shish
55f2f770e7 this doesn't work yet 2009-12-30 08:11:24 +00:00
Shish
be72482232 update name and description 2009-12-30 08:09:31 +00:00
Shish
694200d9f8 proper logging 2009-12-30 07:59:40 +00:00
Shish
96c3cf73e5 a load more pools work 2009-12-30 07:07:10 +00:00
Shish
c7408d3445 make danbooru aware of specific extensions 2009-12-30 07:00:47 +00:00
Shish
d65adf1dab Content-Length header for data pages 2009-12-26 01:00:38 +00:00
Shish
16d409583b more tidying 2009-12-26 00:56:53 +00:00
Shish
53f990bce8 pools checked and tidied again 2009-12-26 00:31:02 +00:00
Shish
6c42cf73c7 indentation 2009-12-25 23:05:57 +00:00
Shish
12745b9309 dos2unix and some other changes... 2009-12-24 07:36:09 +00:00
Shish
1c7ce5a3ac get the THUMB link... *headdesk* 2009-12-24 07:34:29 +00:00
Shish
3e67bbebf5 into a clean folder 2009-12-24 07:08:53 +00:00
Shish
b68f37cf5b ignore orphanned comments 2009-12-22 17:05:21 +00:00
Shish
80d8f4cfb0 this breaks on windows? 2009-11-29 09:38:26 +00:00
Shish
578a1e46fb more dos2unix 2009-11-24 14:12:20 +00:00
Shish
95eadbdd1f dos2unixification 2009-11-24 14:07:18 +00:00
Shish
4e95149c4b updates from sein 2009-11-24 13:57:37 +00:00
Shish
a14b2a8a63 how did nobody spot this? x_x 2009-11-20 11:51:51 +00:00
Shish
6818e598e5 forgot to replace this 2009-11-15 12:09:09 +00:00
Shish
7f47c594c8 handle the case of the SQL log failing to open 2009-11-15 10:26:17 +00:00
Shish
50cf3baca9 security stuffs 2009-11-15 06:33:15 +00:00
Shish
4a20b3915c Merge branch 'pools_test' 2009-11-15 06:31:59 +00:00
Shish
57b2a4df9e some escapes 2009-11-15 06:31:18 +00:00
Shish
a5711d3408 a load of testing 2009-11-15 06:23:42 +00:00
Shish
63d186d8c9 publicise Ratings functions because Pools wants to do the same thing 2009-11-15 05:45:50 +00:00
Shish
43dbf5baea test file 2009-11-15 05:34:30 +00:00
Shish
b797b97595 some checks 2009-11-15 05:32:14 +00:00
Shish
e61b1fe954 pools coding standards 2009-11-15 05:00:24 +00:00
Shish
14b48d5599 fixed? 2009-11-12 09:30:41 +00:00
Shish
b428a56e5f fail 2009-11-12 09:27:09 +00:00
Shish
0c7c90f2cd hash_ab and hash_cd templates for image URLs 2009-11-12 09:23:47 +00:00
Shish
8b7f327440 sorted advanced options, easier to browse 2009-11-12 09:13:21 +00:00
Shish
fb0513561f recaptcha signup link including domain 2009-11-10 04:36:05 +00:00
Shish
3dccde13d1 allow authenticated find_posts in danbooru api 2009-11-10 03:54:03 +00:00
Shish
7a46a9a962 html tooltip for autodates 2009-11-10 03:49:56 +00:00
Shish
ab4f69eb88 months and years for autodate 2009-11-10 03:36:39 +00:00
Shish
9a400645a2 use avatar API rather than hardcoded gravatar 2009-11-10 03:31:32 +00:00
Shish
9f37a50256 signup captcha 2009-11-10 03:21:02 +00:00
Shish
02a5e828ea this line is jarringly long... 2009-11-10 03:11:29 +00:00
Shish
23cc4ea146 better layout 2009-11-10 03:09:44 +00:00
Shish
247d2b0637 remote api keys in their own block 2009-11-10 03:07:40 +00:00
Shish
6bee15164f make recaptcha work 2009-11-10 03:01:20 +00:00
Shish
76393c2c59 recaptcha support 2009-11-10 03:55:17 +00:00
Shish
31ef1e0213 togglable setup blocks 2009-11-10 03:43:37 +00:00
Shish
7db5a2808a noscript link to a larger upload form 2009-10-26 12:08:54 +00:00
Shish
abf69c8137 and remove the setting 2009-10-26 11:42:19 +00:00
Shish
1d46dbbe18 this setting is used before the database is connected to... 2009-10-26 11:39:53 +00:00
Shish
07178e0c4d Merge branch 'master' of git://git.shishnet.org/shimmie2 2009-10-26 10:50:56 +00:00
Shish
083d1e51f7 set comment limits higher 2009-10-26 10:50:48 +00:00
Shish
3f759619f3 test the right thing... 2009-10-26 10:49:07 +00:00
Shish
7d96035f02 fix for bug #779 2009-10-23 14:26:49 +01:00
Shish
2e24246984 test for bug #779 2009-10-23 14:26:40 +01:00
Shish
6ec72e7ac2 optional word wrapping 2009-10-18 00:27:12 +01:00
Shish
dd65b63be9 avatar css 2009-10-10 01:52:39 +01:00
Shish
075b7298b7 spelling 2009-10-09 13:30:21 +01:00
Shish
f7ef2c2771 but it is old 2009-10-09 13:12:18 +01:00
Shish
d1d2f525b9 add old tips extension for the record 2009-10-09 13:11:42 +01:00
Shish
0d3e7e0acc import of submitted pools extension 2009-10-09 13:10:58 +01:00
Shish
9145d7460c import of submitted notes extension 2009-10-09 13:10:47 +01:00
Shish
325ecb5cbb import of submitted forum extension 2009-10-09 13:10:39 +01:00
Shish
daa19b8b6a import of submitted artists extension 2009-10-09 13:10:27 +01:00
Shish
a7389970e2 close #774 2009-10-09 12:41:29 +01:00
Shish
cd8b7c40da test to confirm bug #774 2009-10-09 12:27:13 +01:00
Shish
4c86f6842c not /all/ input elements should be 100% wide 2009-10-09 12:07:35 +01:00
Shish
a0f06c23d5 a handy thing from the danbooru theme 2009-10-09 12:07:13 +01:00
Shish
6baf616692 truthomatic 2009-10-08 17:44:25 +01:00
Shish
71999a3065 find truth 2009-10-08 17:43:18 +01:00
Shish
89e72b0f02 how did this work in the first place? x_x 2009-10-08 14:22:18 +01:00
Shish
a7caf1e060 prefixed cookies 2009-10-08 13:59:12 +01:00
Shish
0e2a0b6f68 add test case to confirm #761 2009-10-08 12:47:44 +01:00
Shish
159a862c02 configurability for avatars 2009-10-08 12:40:52 +01:00
Shish
82bf804fad fix avatar display on user page 2009-10-08 12:32:01 +01:00
Shish
6ed28c8a43 User::get_avatar_html() 2009-10-08 02:58:58 +01:00
Shish
9695c6b45b scaled category thumbnails 2009-10-08 02:51:49 +01:00
Shish
0d5b2ecab1 Merge branch 'master' of ssh://shish@marigold.shishnet.org/git/shimmie2 2009-10-08 02:44:03 +01:00
Shish
ee149ac3d1 easier to style quotes 2009-10-08 02:41:35 +01:00
Shish
91cb704daa more testing 2009-09-27 15:48:38 +01:00
Shish
304c479dba make debugging and coverage separate settings 2009-09-27 14:04:27 +01:00
Shish
9257decc50 tips extension 2009-09-27 14:00:29 +01:00
Shish
2182a39648 wide textareas in tables too 2009-09-27 12:34:58 +01:00
Shish
08cf14c479 Merge branch 'master' of ssh://shish@marigold.shishnet.org/git/shimmie2 2009-09-27 12:34:46 +01:00
Shish
9a3efd592a more testes 2009-09-20 04:10:34 +01:00
Shish
39e1a56a94 test that comments work in the comment RSS 2009-09-20 03:58:50 +01:00
Shish
619401dd4a test that this doesn't crash 2009-09-20 03:53:24 +01:00
Shish
7d88689c2b another test 2009-09-20 03:50:32 +01:00
Shish
3aa7424b12 nobody should be linking to pages like this any more... 2009-09-20 03:48:52 +01:00
Shish
c7a9c4b92c not finished, but add to test coverage 2009-09-20 03:48:24 +01:00
Shish
0f0bf5ff69 test blank lines 2009-09-20 03:47:04 +01:00
Shish
3a9b82ab1e this isn't slow any more 2009-09-19 23:07:39 +01:00
Shish
281c34d64e more testing 2009-09-19 23:03:47 +01:00
Shish
846801b76d test spoiler code 2009-09-19 20:23:48 +01:00
Shish
d7038a0098 test the next and prev buttons 2009-09-19 20:19:09 +01:00
Shish
6726f13603 test the emoticon list 2009-09-19 20:18:46 +01:00
Shish
bb4085972b code coverage stuff 2009-09-19 20:13:37 +01:00
Shish
cb4ce32a28 subheading section in the default theme 2009-09-19 15:31:09 +01:00
Shish
6b60b6f58b ignore more stuff 2009-09-19 15:22:02 +01:00
Shish
ac85a520d7 link to target of alias 2009-09-15 18:42:42 +01:00
Shish
6f64055096 don't code while asleep -_- 2009-09-15 18:35:24 +01:00
Shish
f71a0e4390 configurable autodate format 2009-09-15 18:29:22 +01:00
Shish
ea215fbff2 split() is deprecated in php5.3 2009-09-14 21:19:13 +01:00
Shish
d5d7f08f01 extra unit testing note 2009-08-25 18:39:42 +01:00
Shish
a69d1086ec paginated aliases 2009-08-25 02:36:00 +01:00
Shish
15d7a76799 meta keywords with commas 2009-08-24 06:49:40 +01:00
Shish
d3697b35d5 Merge branch 'master' of ssh://marigold.shishnet.org/git/shimmie2 2009-08-24 05:34:06 +01:00
Shish
18fea9d968 remove the whitespace 2009-08-24 05:33:51 +01:00
Shish
30ee7f4129 zebra styling 2009-08-24 03:57:18 +01:00
Shish
8a53cecbd7 odd/even comments 2009-08-24 03:43:10 +01:00
Shish
0f950f4716 Merge branch 'master' of ssh://marigold.shishnet.org/git/shimmie2 2009-08-24 03:34:04 +01:00
Shish
d5dea776c5 ignore duplicate tag history entries 2009-08-24 03:33:51 +01:00
Shish
39f7688888 allow themes to override this function 2009-08-24 03:00:42 +01:00
Shish
3e1edae90d home page updates 2009-08-24 02:15:08 +01:00
Shish
036732edf8 bleh 2009-08-24 01:56:04 +01:00
Shish
f87b34400e extension documentation updates 2009-08-20 23:37:32 +01:00
Shish
8ea67db1fa correct docs 2009-08-20 20:51:25 +01:00
Shish
087444b841 did I mention 'aaaaaaargh php'? 2009-08-19 05:53:27 +01:00
Shish
e7582cb6d9 sometimes these return values are used 2009-08-19 05:04:13 +01:00
Shish
b41d38e64c this does need to be at the top, but not double star started... 2009-08-19 04:57:24 +01:00
Shish
e8ef3902c3 more testing docs 2009-08-19 02:13:48 +01:00
Shish
b26ac06c3b hand-port from 2.3 2009-08-19 01:33:00 +01:00
Shish
1946e3c943 consistent naming for test functions 2009-08-19 01:28:48 +01:00
Shish
62afcfe38c a start on testing docs, and some underscore-camelcase maps 2009-08-19 01:26:26 +01:00
Shish
2720272a5f tags as page keywords 2009-08-19 00:51:13 +01:00
Shish
a1725f7fe3 only show the recent few comments on each image (for the long comment list) 2009-08-19 00:33:18 +01:00
Shish
685d079da8 use_autodate option 2009-08-18 23:06:15 +01:00
Shish
8e2b5d7c1e zebraify reported images table 2009-08-18 22:39:10 +01:00
Shish
39bd7a763f update other themes 2009-08-18 22:33:36 +01:00
Shish
b1bcb8252f extendable user stats rather than hardcoded with assumptions of extensions 2009-08-18 22:30:52 +01:00
Shish
f058d5dd5b fix the tests.. 2009-08-16 20:19:09 +01:00
Shish
9af0c260c3 minmal rating tests 2009-08-13 21:42:48 +01:00
Shish
afa1f4a583 don't force the user to set a rating 2009-08-13 20:10:48 +01:00
Shish
d6b3da3461 danbooru theme updates by zshall <http://seemslegit.com> 2009-08-13 19:41:55 +01:00
Shish
b53cc65958 test it 2009-08-13 19:28:20 +01:00
Shish
28fd3e311f replace numeric_score 'favorite' with 'upvoted_by=name' (and add the same for downvote) 2009-08-13 19:28:14 +01:00
Shish
9aa54af90a fix this test 2009-08-13 19:01:34 +01:00
Shish
44e3abe16e test searching by score 2009-08-13 17:48:28 +01:00
Shish
4b3fb0de86 test deleting one comment at a time 2009-08-12 15:45:13 +01:00
Shish
f9b987a7ce make comment deletion do something... 2009-08-12 15:40:13 +01:00
Shish
ffe6bc3597 missed a spot 2009-08-12 15:35:30 +01:00
Shish
76a9090ded settable email field 2009-08-11 17:07:03 +01:00
Shish
2e8eff8f38 gravatar on user page 2009-08-11 15:44:26 +01:00
Shish
dc6dafd817 default to showing user links in danbooru submenu 2009-08-11 15:37:56 +01:00
Shish
fe9dd98387 slightly less strict filename sanitising, for the unicode users 2009-08-11 15:12:48 +01:00
Shish
940687a8ac missed a spot 2009-08-10 21:51:04 +01:00
Shish
51dab939ea if hit on disk, reload into memcache 2009-08-10 13:33:08 +01:00
Shish
b1df14ca4a only cache gets 2009-08-10 11:46:47 +01:00
Shish
81987f0e79 make image metadata optional 2009-08-09 22:00:59 +01:00
Shish
a9a9318c41 better caching code 2009-08-09 13:11:54 +01:00
Shish
1e8e5adbbf load config.php sooner 2009-08-09 13:10:59 +01:00
Shish
d95855411d emoticon list 2009-08-08 17:43:18 +01:00
Shish
512503799d fix comment page count 2009-08-04 17:58:26 +01:00
Shish
1849910b2f make user email accessable to comment themers 2009-08-04 17:51:43 +01:00
Shish
b6dc2d461d this went in the wrong theme 2009-08-04 17:48:49 +01:00
Shish
7555ada953 comment theme API changes 2009-08-04 17:45:09 +01:00
Shish
c506030acd ignore more 2009-08-04 17:19:12 +01:00
Shish
e73abc1545 remove minimal theme, it is full of ugly 2009-08-04 17:18:02 +01:00
Shish
9a79f77deb better looking downtime message, and login box 2009-08-03 19:58:24 +01:00
Shish
ceb4019588 sitemap test file 2009-08-03 18:35:32 +01:00
Shish
e87734ce72 sitemap extension from Sein Kraft 2009-08-03 18:26:07 +01:00
Shish
4b589c120a ignore that too 2009-08-03 12:08:18 +01:00
Shish
b1f708342a case 2009-08-03 12:07:47 +01:00
Shish
a8faf5fbe9 bbcode img tag support, and unwrap wordwrapped urls 2009-08-03 12:37:49 +01:00
Shish
920b61a707 wiki diff on conflict 2009-08-03 11:24:02 +01:00
Shish
057ed92e90 wiki updates 2009-08-03 11:04:57 +01:00
Shish
63be20458d themable user links 2009-08-03 10:46:40 +01:00
Shish
43d9161d6b only show uploader to admins 2009-08-03 10:24:32 +01:00
Shish
0f784f0a8d bulk upload / zip upload betterness 2009-08-03 10:19:42 +01:00
Shish
db7708b6e3 search images by comment metadata 2009-08-03 10:18:59 +01:00
Shish
f57e67e6e9 xspf player is bsd, and why did we have the full size version instead of slim? 2009-08-02 14:45:11 +01:00
Shish
62ba59a421 glob rather than readdir, sorts too 2009-08-02 09:36:16 +01:00
Shish
f58fec3094 any search for a rating will override the default 2009-08-02 09:24:37 +01:00
Shish
7c790414b5 update this too 2009-08-02 09:10:28 +01:00
Shish
fddbe0f605 everything else only has add boxes at the bottom 2009-08-02 09:09:09 +01:00
Shish
92217f0435 test that too 2009-08-02 08:59:19 +01:00
Shish
e340927b07 also allow search by 'md5=' 2009-08-02 08:58:32 +01:00
Shish
556d3b50ec search for ratings with full words 2009-08-02 08:43:00 +01:00
Shish
6f67a134ff this needs autoblanking too 2009-08-02 08:33:20 +01:00
Shish
5fe8ca4c9c bulk image rater 2009-08-02 08:19:43 +01:00
Shish
4f0bd7935e crushed pngs 2009-08-01 09:15:14 +01:00
Shish
a7572a2a0b Revert "load scripts at the bottom of the page" - inline scripts require jquery >_<
This reverts commit 9cc79e3ea825a5b7a3034f2ec6ba9c99cdab4e42.
2009-08-01 09:03:57 +01:00
Shish
6acf02624d not in this theme 2009-08-01 09:00:21 +01:00
Shish
9cc79e3ea8 load scripts at the bottom of the page 2009-08-01 08:58:12 +01:00
Shish
1614248c35 compressed cached pages 2009-08-01 08:57:28 +01:00
Shish
03d73f6ce2 off by default 2009-08-01 02:32:40 +01:00
Shish
bdcca24f8d static file caching 2009-08-01 02:31:49 +01:00
Shish
8e4d6583f5 give a better label to flash things 2009-07-30 05:12:56 +01:00
Shish
4a4546c427 bring back X blah per day 2009-07-30 03:47:43 +01:00
Shish
33a7fde1a4 make search by favourite count work 2009-07-30 03:27:51 +01:00
Shish
a3f57c8fd6 make autodate work, and use it a bit 2009-07-28 23:56:46 +01:00
Shish
3dc3f5e8cb long line splitter 2009-07-28 23:42:39 +01:00
Shish
57884973f5 link to help 2009-07-28 23:22:08 +01:00
Shish
a79b9047fb danbooru theme updates 2009-07-28 23:07:44 +01:00
Shish
310c7b0da0 link to site needs httpisation too 2009-07-28 21:13:07 +01:00
Shish
5f106b0950 favorites testing and tweak 2009-07-28 11:45:35 +01:00
Shish
77368cb03b make favorites work with 2.3 2009-07-28 11:21:41 +01:00
Shish
68cb8b0b2d initial import of favorites extension 2009-07-28 11:20:50 +01:00
Shish
ce8915ba07 not only for admins 2009-07-28 11:18:09 +01:00
Shish
2fce06d8e8 a ton of wiki improvements 2009-07-28 09:41:21 +01:00
Shish
d02c803d60 a bunch of wiki fixes 2009-07-28 04:50:21 +01:00
Shish
2a36504b4f make testing work again... 2009-07-28 04:46:06 +01:00
Shish
b50199d5f3 wiki updates (broken atm) 2009-07-28 02:06:51 +01:00
Shish
213722095b escape it 2009-07-28 01:31:54 +01:00
Shish
df6e714f04 show wiki page title 2009-07-28 01:30:29 +01:00
Shish
5107f34b20 add label for tag_history 2009-07-28 01:25:11 +01:00
Shish
2f045fd944 mysql fails at count() = 0 2009-07-28 01:19:40 +01:00
Shish
d850a562db updateses 2009-07-28 01:09:00 +01:00
Shish
a16b3db48c somewhat updated danbooru comment theme 2009-07-28 00:54:47 +01:00
Shish
759ee2fe30 exif ifd0 info in the sidebar 2009-07-28 00:20:22 +01:00
Shish
02320af307 here too 2009-07-24 08:09:24 +01:00
Shish
ecef1edb14 make_http function 2009-07-24 08:08:29 +01:00
Shish
52ba270e78 site description keywords 2009-07-24 04:35:45 +01:00
Shish
aa77becbf6 show tag count, rather than calculated count 2009-07-24 03:07:03 +01:00
Shish
b30ed5b375 new theme 2009-07-23 02:32:45 +01:00
Shish
a601c5b9ed no need for extra dir 2009-07-23 02:32:21 +01:00
Shish
70e9103e20 one transparent circle, rather than a colour per rect 2009-07-22 22:09:55 +01:00
Shish
8835a8eb2f doc path 2009-07-21 06:41:32 +01:00
Shish
0a0bd6403b add doxygen config file 2009-07-21 07:41:15 +01:00
Shish
977cb305f8 custom page is custom 2009-07-21 07:39:49 +01:00
Shish
572f84511a lots of docs, and some internal changes 2009-07-21 07:38:53 +01:00
Shish
2471a8e2eb docs 2009-07-21 07:38:46 +01:00
Shish
5857b60c2e more tests... 2009-07-20 07:31:54 +01:00
Shish
aa7969cdde MOAR TESTING. 2009-07-20 06:51:51 +01:00
Shish
4cb59929d3 hide user stats from anonymous 2009-07-20 06:42:26 +01:00
Shish
1c27df0dd0 disk stats for et 2009-07-20 04:27:34 +01:00
Shish
fd5242d1ad more tests, and make link to image work better 2009-07-19 19:36:11 +01:00
Shish
099b70bcad use the current favicon rather than a hardcoded one 2009-07-19 18:05:07 +01:00
Shish
d959c174a1 more tests, more fixes 2009-07-19 18:00:16 +01:00
Shish
f574d0d81d more tests and fixes 2009-07-19 17:39:24 +01:00
Shish
8875422bed someone else is defining these... 2009-07-19 17:22:01 +01:00
Shish
6799f436ee res_limit testing and fixing 2009-07-19 17:18:29 +01:00
Shish
d8c394c7a5 bug fixing & tidying 2009-07-19 08:56:38 +01:00
Shish
627ecdbf4c lots of docs 2009-07-19 08:38:27 +01:00
Shish
24b715424b make images in the nav bar break less 2009-07-19 07:33:08 +01:00
Shish
9f40fe689f make the featured image extension work again 2009-07-19 07:29:14 +01:00
Shish
d8e027b776 a load more tests 2009-07-19 04:49:14 +01:00
Shish
fd044838f3 more testing 2009-07-19 01:55:07 +01:00
Shish
f54c41aa83 allow people to view images rated 'unknown'... 2009-07-19 01:54:59 +01:00
Shish
bc3c2d5a5b sqlite returns column names as table.name, not just name 2009-07-17 13:10:42 +01:00
Shish
678910fb13 sqlite fails at count distinct 2009-07-17 13:09:56 +01:00
Shish
bb9e3f08cb sqlite compat for ipbans 2009-07-17 02:44:15 +01:00
Shish
be5ed6272c merge both log functions into one; simply saying that they take different numbers of arguments isn't enough... 2009-07-17 01:56:40 +01:00
Shish
b609dfc19c save some bandwidth by removing a load of decimal places 2009-07-17 00:36:35 +01:00
Shish
bde744826e only hidablise relevant things, and make the whole block clickable 2009-07-16 21:05:12 +01:00
Shish
6ff1e542b9 make sure 0 is printed 2009-07-16 20:56:52 +01:00
Shish
d3305d87cb rename an ambiguous column 2009-07-16 20:51:47 +01:00
Shish
b512d93c91 re-initialise the database after re-opening the connection (allows sqlite to use now()) 2009-07-16 20:45:18 +01:00
Shish
27b6f56e01 yet more tests 2009-07-16 20:22:00 +01:00
Shish
4abf2ac7dd more tests 2009-07-16 20:21:28 +01:00
Shish
96e69c4f20 aaaaaaaargh dates and times in sql 2009-07-16 00:05:25 +01:00
Shish
dd650a6a4e more reliable self finding 2009-07-16 00:05:21 +01:00
Shish
46b0526496 remove the auto install file after using it 2009-07-16 00:05:18 +01:00
Shish
717209e8f0 warn about missing mysql 2009-07-16 00:05:11 +01:00
Shish
aa3657c158 actually that doesn't work v_v 2009-07-15 19:07:39 +01:00
Shish
028ee4b462 more tests 2009-07-15 17:10:19 +01:00
Shish
c88ecebb7b A ton of tests, figured out how to test uploads \o/ 2009-07-15 02:43:14 +01:00
Shish Moom
8dac266af4 minor fix 2009-07-14 12:52:55 -07:00
Shish Moom
e23b80f822 start of password recovery 2009-07-11 05:38:52 -07:00
Shish Moom
d9b97996ca store arrays in config, edit in setup with add_multichoice_option 2009-07-11 04:43:18 -07:00
Shish Moom
84e4420332 margiiiiin~ 2009-07-09 12:50:35 -07:00
Shish Moom
c66d72685c tweaks for fresh install 2009-07-07 08:52:24 -07:00
Shish Moom
2eea8b22f2 .htaccess updates, expires and compression headers 2009-07-07 08:33:25 -07:00
Shish Moom
4040fb5d58 no more trac 2009-07-07 08:08:00 -07:00
Shish Moom
6870a0d145 these don't work either 2009-07-07 07:57:52 -07:00
Shish Moom
ce91cde9c7 contact details 2009-07-07 07:55:11 -07:00
Shish Moom
6f85628482 these are long dead... 2009-07-07 07:53:00 -07:00
Shish Moom
e0d72d5795 get rid of shimmie's JS lib, use jquery 2009-07-07 07:40:59 -07:00
Shish Moom
52f7e01599 remove table border 2009-07-07 07:01:29 -07:00
Shish Moom
f070bbe69e auto-include library scripts 2009-07-07 06:48:59 -07:00
Shish Moom
7f73a1f87e jquery start 2009-07-07 05:42:34 -07:00
Shish Moom
0d58b58523 more theme niceness 2009-07-06 08:51:34 -07:00
Shish Moom
91aeada8aa smaller font for setup boxes 2009-07-06 05:07:57 -07:00
Shish Moom
e68f929055 more niceness 2009-07-06 04:57:08 -07:00
Shish Moom
7d99ef3e92 hide the whole block 2009-07-06 04:47:42 -07:00
Shish Moom
f3105ed1df textarea tweak 2009-07-06 04:44:52 -07:00
Shish Moom
5a692586e9 new default theme 2009-07-06 04:31:45 -07:00
Shish Moom
1d96ae3089 move old default 2009-07-06 04:31:24 -07:00
Shish Moom
b0448eba6f theme changes 2009-07-06 04:29:55 -07:00
Shish Moom
4163432e32 another simpleextnsion 2009-07-01 16:52:24 -07:00
Shish Moom
8a5afdcee5 regen_thumb still had event->page 2009-07-01 16:46:22 -07:00
Shish Moom
57b2a13a62 no need for hostname 2009-07-01 05:17:09 -07:00
Shish
0b83a9d786 don't break when base_href='' 2009-06-29 19:02:25 -07:00
Shish Moom
9e1c144f57 fix login... 2009-06-06 12:04:33 -07:00
Shish Moom
2d63534374 allow null as navigation 2009-06-06 12:00:45 -07:00
Erik Youngren
4bbb3569eb You know that feeling you've done something the hard way? Yeah. Replacing theme_redirect with a three line function in core/utils.inc.php 2009-06-06 06:08:26 -07:00
Shish Moom
f77c6e64cd array_contains -> in_array 2009-06-05 12:53:00 -07:00
Shish Moom
de0164647e update links 2009-06-05 09:55:58 -07:00
Shish Moom
2c7819b9f3 wiki fixes 2009-05-30 06:49:39 -07:00
Shish Moom
413a0ede91 basic user list 2009-05-30 06:47:57 -07:00
Shish Moom
c5e9788358 fetch a block of users 2009-05-30 06:47:35 -07:00
Shish
4765e51e7c explanation and credit 2009-05-15 01:52:55 -07:00
JJS
74b62a1b38 Fix bug in Source: link in danbooru theme 2009-05-12 03:12:31 -07:00
JJS
412750dec2 Bugfix: $c->get_string to $config->get_string 2009-05-12 03:11:01 -07:00
Shish
389eed5867 make things use SimpleExtension 2009-05-11 14:09:24 -07:00
Shish
8dd3f8cbc0 SimpleExtension, like Extension but with more Magic 2009-05-11 14:08:32 -07:00
Shish
6a5b8bd46d allow this to be turned on via config 2009-05-11 12:53:55 -07:00
Shish
9ae557c250 a couple of fixes 2009-05-11 07:48:18 -07:00
Shish
465726691c typo 2009-05-11 07:14:09 -07:00
Shish
bb84a735a2 requestcontext stuff is messy, go back to globals :( 2009-05-11 07:04:33 -07:00
Shish
e592ee4c59 this is blah 2009-05-11 05:54:42 -07:00
Shish
47fd679354 ugly mysql thing from 2.3 2009-05-11 03:52:48 -07:00
Shish
fec1c016c4 php has a constant for this 2009-05-08 21:14:22 -07:00
Shish
4b4d80f523 how did that get there? 2009-05-08 07:03:04 -07:00
Shish
575ce067bc more 2009-05-08 05:19:52 -07:00
Shish
f592167c6a comment out example thingy 2009-05-08 04:45:23 -07:00
Shish
561c9fdbb7 punctuations 2009-05-08 04:43:45 -07:00
Shish
5609976164 no need for formatting 2009-05-08 04:41:03 -07:00
Shish
7648d3db67 newline 2009-05-08 04:07:46 -07:00
Shish
415f6901da logging things 2009-05-08 03:52:29 -07:00
Shish
989fc72e5a test the right filter :/ 2009-05-08 03:05:15 -07:00
Shish
dd9ced7b28 for searches with a single result, view the result 2009-04-21 22:43:54 -07:00
Shish
45fef32fbf search for upvoted images 2009-04-21 20:30:24 -07:00
Shish
7cedd4735c only search for prev/next when asked for 2009-04-21 15:02:23 -07:00
Shish
8cbeb21092 make the first letter show up 2009-03-28 12:02:15 -07:00
Shish
a9ca976afd call assert() from the right place 2009-01-25 09:19:24 -08:00
Shish
63a4ca2587 preliminary hash ban testing 2009-01-25 09:19:15 -08:00
Shish
68967b0fa2 more bbcode tests 2009-01-25 09:19:07 -08:00
Shish
4e551cf9c5 move shimmie-specific sqlite things out of adodb and into shimmie's database engine 2009-01-25 09:18:58 -08:00
Shish
2d46a5c269 more functions that sqlite needs 2009-01-25 09:18:48 -08:00
Shish
4af20a3cb5 basic word filter test 2009-01-25 09:18:07 -08:00
Shish
171d7d3a29 strip metadata from thumbnails 2009-01-25 09:16:48 -08:00
Shish
24ea454f2e easier to read logic 2009-01-24 12:02:58 -08:00
Shish
bb752d6fd1 tag_explode -> Tag::explode 2009-01-24 11:05:29 -08:00
Shish
5600e00de9 fixes 2009-01-24 10:59:00 -08:00
Shish
d8e3ba6f4d preliminary work for image locking 2009-01-24 03:59:51 -08:00
Shish
cfd1b72b86 logical mass tag edit, works correctly, even in the advanced cases 2009-01-24 03:33:43 -08:00
Shish
394cff1909 move tag functions into the tag class 2009-01-24 03:32:48 -08:00
Shish
a77feff4af wrap long titles 2009-01-24 02:25:50 -08:00
Shish
1100b20497 nestable lists 2009-01-24 01:30:50 -08:00
Shish
e36530a731 allow many block-level elements inside a comment, style them all 2009-01-24 01:20:31 -08:00
Shish
aa0d57486a [code] magic 2009-01-24 01:16:49 -08:00
Shish
54e3eef69c don't try to post a comment without input 2009-01-24 00:15:33 -08:00
Shish
bf0ef6ce05 readme updates 2009-01-23 11:33:28 +00:00
Shish
abf448cdc8 old bits 2009-01-22 10:23:15 -08:00
Shish
33fa2f9b28 xmlschema was fail 2009-01-22 10:21:31 -08:00
Shish
35cc1aad48 more sqlite fixes 2009-01-22 09:08:33 -08:00
Shish
4e4f0be4e5 more sqlite niceness 2009-01-22 07:51:50 -08:00
Shish
f3a3d50f95 sqlite love 2009-01-22 07:08:37 -08:00
Shish
8619be809e sqlite engine 2009-01-22 05:53:30 -08:00
Shish
d98962a30e a bunch of fixes 2009-01-22 05:42:44 -08:00
Shish
bda38bff6c did I mention that mysql devs can go choke on a bucket of cocks? Well they can. (Two ways to specify foreign keys, one works, one is silently ignored; wtf?) 2009-01-22 05:03:51 -08:00
Shish
46c3989ce5 automated installation 2009-01-22 05:02:22 -08:00
Shish
fb7e14ad21 fixes 2009-01-22 04:14:38 -08:00
Shish
e37531f26a mysql too 2009-01-22 04:12:15 -08:00
Shish
f347384a50 php developers can go choke on a bucket of cocks 2009-01-22 04:11:43 -08:00
Shish
44ac62e1ae get rid of xmlschema 2009-01-22 04:05:55 -08:00
Shish
64fb261b87 simpler table creation function 2009-01-22 03:22:55 -08:00
Shish
a342ed8890 preliminary bookmarks extension 2009-01-22 03:22:41 -08:00
Shish
6667ac553d niceurl magic 2009-01-22 02:49:22 -08:00
Shish
81a4e0fa76 more normal words 2009-01-22 02:49:01 -08:00
Shish
0db255d76d welcome to the future 2009-01-22 02:36:12 -08:00
Shish
34f8f4a3b8 when a tag is used and removed, it hangs around with count=0; don't show these as popular 2009-01-22 02:21:06 -08:00
Shish
3086f7393d this looks silly in a fresh install 2009-01-22 02:16:10 -08:00
Shish
3af5caf523 make things work 2009-01-22 02:14:16 -08:00
Shish
b336b5296f delayed user creation 2009-01-22 01:39:44 -08:00
Shish
cffbaac039 'unrated' rating 2009-01-21 23:21:56 -08:00
Shish
0ff11d71ed make use of this 2009-01-21 23:21:03 -08:00
Shish
2c37ce9a8d match better, so user_id=123 doesn't hit id=123 2009-01-21 23:04:29 -08:00
Shish
ddaa85583e how was this not noticed? 2009-01-21 22:41:44 -08:00
Shish
69efd181c2 no days... 2009-01-21 22:41:24 -08:00
Shish
0e34bab864 Merge branch 'caching_engines' 2009-01-20 03:56:21 -08:00
Shish
12cccde8f8 move extension specific parts out of user and into extensions 2009-01-20 03:56:13 -08:00
Shish
fcca11f20c make cache engines work <_< 2009-01-20 03:54:43 -08:00
Shish
03bee56193 move extension specific parts out of user and into extensions 2009-01-20 03:24:35 -08:00
Shish
6e6a6bdd16 scoreyness 2009-01-20 03:17:49 -08:00
Shish
776a42d519 cache objects 2009-01-20 02:47:20 -08:00
Shish
5e75ad3cd4 start of cache engines 2009-01-20 02:34:17 -08:00
Shish
f9dffb96cb brain fart 2009-01-20 02:33:34 -08:00
Shish
954edd9610 cache ip bans 2009-01-19 10:53:09 -08:00
Shish
be696e46de cache the config table (this is the most common sql query) 2009-01-19 10:47:33 -08:00
Shish
6e44111e0e clean up tags when deleting an image 2009-01-19 10:28:03 -08:00
Shish
066474c5c5 use caching for image tags 2009-01-19 10:27:53 -08:00
Shish
e9cacebc95 type safety and fixes 2009-01-18 06:58:49 -08:00
Shish
bb20f927eb hackery to deal with escaping slashes 2009-01-18 06:58:32 -08:00
Shish
94c0ab0255 make tag setting work 2009-01-17 17:07:06 -08:00
Shish
4a8034cabe zebra improvements 2009-01-16 20:53:11 -08:00
Shish
1b77120699 hide old bans by default (and make them work at all <_<;;) 2009-01-16 20:42:20 -08:00
Shish
a2e5ad707b lots of zebras! 2009-01-16 20:24:43 -08:00
Shish
34857c4d25 non-vital information moved to the extension documentation page 2009-01-16 20:00:52 -08:00
Shish
bab82b914d zebra tables 2009-01-16 19:27:18 -08:00
Shish
5ca0110a23 another display mode 2009-01-16 18:49:15 -08:00
Shish
078d246396 separate links for info and help 2009-01-16 18:25:39 -08:00
Shish
c3769a1958 Merge branch 'selfdoc' 2009-01-16 00:20:15 -08:00
Shish
8414082c8a random image block 2009-01-16 00:19:47 -08:00
Shish
17ad021cca contrib documentation 2009-01-16 00:18:41 -08:00
Shish
68159753d4 random image block 2009-01-16 00:18:15 -08:00
Shish
b271d9dccb typo 2009-01-15 23:02:05 -08:00
Shish
873e3c3911 eol 2009-01-15 23:01:30 -08:00
Shish
53ff09ece2 code style 2009-01-15 22:34:03 -08:00
Shish
b9284b44d9 allow long tags to start on a new line 2009-01-15 22:04:50 -08:00
Shish
fd38860c95 layout 2009-01-15 22:00:05 -08:00
Shish
17152bd0b1 whitespace 2009-01-15 21:57:30 -08:00
Shish
93ef3abbee link to the doc by default 2009-01-15 21:43:09 -08:00
Shish
ab64f4721f support for a documentation tag 2009-01-15 21:41:59 -08:00
Shish
2ba285a005 allow extension links to link to internal pages 2009-01-15 21:39:13 -08:00
Shish
aca8a039e1 link to page 1, newest first 2009-01-14 16:22:31 -08:00
Shish
5c47715978 note section name in block IDs 2009-01-14 12:18:49 -08:00
Shish
8a1c51e46f specify exact column widths, for the benefit of crap browsers (ie, IE) 2009-01-13 22:07:12 -08:00
Shish
ee5eef02f8 don't hide anything by default 2009-01-13 22:05:15 -08:00
Shish
d8ce9d71c8 blank fold .-. 2009-01-04 12:26:12 -08:00
Shish
e429a0a6ef another one... 2009-01-04 12:04:55 -08:00
Shish
eeda4d6ab3 very classy 2009-01-04 11:54:16 -08:00
Shish
d709f1566e whitespace 2009-01-04 11:42:28 -08:00
Shish
0bfafe0e9a classy 2009-01-04 11:41:03 -08:00
Shish
f94a41c3df more global removal 2009-01-04 11:39:07 -08:00
Shish
738fa3ef1e whitespace... 2009-01-04 11:38:47 -08:00
Shish
11873e9601 remove EOL whitespace 2009-01-04 11:18:37 -08:00
Shish
966180aef5 fewer globals 2009-01-04 10:46:18 -08:00
Shish
33d24b2f5c new events 2009-01-04 10:43:44 -08:00
Shish
98b0a55dcb show the right user 2009-01-04 10:41:14 -08:00
Shish
df594aee6d tag functions in a tag class 2009-01-04 10:39:11 -08:00
Shish
820f60d5e8 make the user extension work again 2009-01-04 10:31:54 -08:00
Shish
63cc962457 add the exceptions library that's being used... 2009-01-04 09:39:40 -08:00
Shish
cdde0e072c scorify the PM extension 2009-01-04 09:38:23 -08:00
Shish
85c8875ffe scorify the site_description extension 2009-01-04 08:37:08 -08:00
Shish
8dfb7e5ed3 scorify the news extension 2009-01-04 08:35:39 -08:00
Shish
fc9eddd08b scorify the emoticons extension 2009-01-04 08:33:32 -08:00
Shish
737d2f4268 scorify the downtime extension 2009-01-04 08:30:46 -08:00
Shish
0c628f2c10 score-style index 2009-01-04 08:24:06 -08:00
Shish
7f90fdbf97 pass config to get_session_ip, so it knows what mask to use 2009-01-04 08:17:41 -08:00
Shish
93b7467fdd a bunch of image functions moved to the image class 2009-01-04 08:15:00 -08:00
Shish
b6480f076e days_old should be calculated 2009-01-04 08:01:01 -08:00
Shish
0770b19b04 more scoreyness 2009-01-04 07:57:54 -08:00
Shish
8acb6ae01e classy 2009-01-04 06:40:35 -08:00
Shish
842be2696c multiple types of config 2009-01-04 06:38:48 -08:00
Shish
b693e5f772 whitespace matching 2009-01-04 06:37:11 -08:00
Shish
2ef6491ecf we can use exceptions \o/ 2009-01-04 06:34:27 -08:00
Shish
1c8094cabf replace the veto system with exceptions 2009-01-04 06:01:59 -08:00
Shish
76f79668b5 move imageboard specific bits to their own file 2009-01-04 05:53:14 -08:00
Shish
672390a289 share the error message, shimmie is based on score now after all... 2009-01-03 15:16:18 -08:00
Shish
cc0bd18c4f tidying, moving to score 2009-01-03 13:06:36 -08:00
Shish
bca8221609 move extension-specific events into their extensions 2009-01-03 13:00:09 -08:00
Shish
2f8cf7c08e die, globals 2009-01-03 12:32:57 -08:00
Shish
f1f0fca60a new api 2009-01-01 06:02:26 -08:00
Shish
0b0e713aa1 minimum tag size 2008-12-31 12:59:14 -08:00
Shish
1e5b2ac6aa search by post date 2008-12-31 12:41:57 -08:00
Shish
9908a617b3 source ip and time check on anon comments, and rearrange to have heavier checks later in the process 2008-12-30 14:20:42 -08:00
Shish
fa94f51a61 no new lines in javascript 2008-12-27 02:56:51 -08:00
Shish
1d7578f052 semi-automagic niceurls? 2008-12-27 02:17:53 -08:00
Shish
6f499ad940 human filesize 2008-12-26 22:36:51 -08:00
Shish
0629c6e116 danbooru-style image stats in the danbooru theme 2008-12-26 22:31:45 -08:00
Erik Youngren
7c7d6b6b14 Related Tag Count per skxxl311 request. 2008-12-25 23:10:51 -08:00
Shish
f9a64f72d3 actually, order by id, which is somewhat chronological 2008-12-15 22:10:06 -08:00
Shish
0a93c3c5ed ordered bans 2008-12-15 22:01:43 -08:00
Shish
646cf1decb make the image info editor only visible when relevant 2008-12-15 21:29:48 -08:00
Shish
58971bacd0 save a few lines 2008-12-15 21:19:44 -08:00
Shish
c8e89c4940 bulk upload presentation tweak 2008-12-15 15:18:21 -08:00
Shish
fd9443cf84 human readable error when file too large 2008-12-15 14:55:56 -08:00
Shish
f735936a7d don't bother listing upload dirs without files 2008-12-15 14:55:51 -08:00
Shish
cf698d6712 trunk readme 2008-12-14 16:00:29 -08:00
Shish
dfa7c32a22 revert SCM screwup 2008-12-14 15:57:26 -08:00
Shish
69eab596b4 mailto 2008-12-14 15:43:41 -08:00
Shish
a0bea5255c too much whitespace 2008-12-14 15:22:31 -08:00
Shish
66479bff53 ignorance is bliss 2008-12-14 15:00:34 -08:00
shish
890fe3706b label the readme
git-svn-id: file:///home/shish/svn/shimmie2/trunk@1142 7f39781d-f577-437e-ae19-be835c7a54ca
2008-12-14 22:08:58 +00:00
shish
a9cb92e163 extra stuff
git-svn-id: file:///home/shish/svn/shimmie2/trunk@1140 7f39781d-f577-437e-ae19-be835c7a54ca
2008-12-13 04:14:30 +00:00
shish
c166630b57 paginatied hash bans
git-svn-id: file:///home/shish/svn/shimmie2/trunk@1139 7f39781d-f577-437e-ae19-be835c7a54ca
2008-12-13 04:14:13 +00:00
shish
eba8322a6d updates for new api
git-svn-id: file:///home/shish/svn/shimmie2/trunk@1138 7f39781d-f577-437e-ae19-be835c7a54ca
2008-12-13 04:13:44 +00:00
shish
b9b3f540e2 ignore activated extensions
git-svn-id: file:///home/shish/svn/shimmie2/trunk@1137 7f39781d-f577-437e-ae19-be835c7a54ca
2008-12-13 04:12:00 +00:00
shish
ef496da3e3 ignore install-specific things
git-svn-id: file:///home/shish/svn/shimmie2/trunk@1136 7f39781d-f577-437e-ae19-be835c7a54ca
2008-12-13 04:11:44 +00:00
shish
87830b7fe0 copyright notice for this year <_<
git-svn-id: file:///home/shish/svn/shimmie2/trunk@1132 7f39781d-f577-437e-ae19-be835c7a54ca
2008-12-12 19:45:55 +00:00
shish
aa45a94dd5 image bans on their own page
git-svn-id: file:///home/shish/svn/shimmie2/trunk@1129 7f39781d-f577-437e-ae19-be835c7a54ca
2008-12-12 19:23:42 +00:00
shish
ecfc4489ce brain fail
git-svn-id: file:///home/shish/svn/shimmie2/trunk@1126 7f39781d-f577-437e-ae19-be835c7a54ca
2008-12-10 02:35:09 +00:00
shish
3ff15a1395 veto is still used a lot
git-svn-id: file:///home/shish/svn/shimmie2/trunk@1122 7f39781d-f577-437e-ae19-be835c7a54ca
2008-12-08 20:40:01 +00:00
shish
ff8400641e fix in danbooru theme
git-svn-id: file:///home/shish/svn/shimmie2/trunk@1120 7f39781d-f577-437e-ae19-be835c7a54ca
2008-12-08 20:34:43 +00:00
shish
6d5dfea492 only allow two consecutive newlines
git-svn-id: file:///home/shish/svn/shimmie2/trunk@1115 7f39781d-f577-437e-ae19-be835c7a54ca
2008-11-27 07:17:52 +00:00
shish
ae477a6d88 nor in trunk
git-svn-id: file:///home/shish/svn/shimmie2/trunk@1114 7f39781d-f577-437e-ae19-be835c7a54ca
2008-11-19 22:55:04 +00:00
shish
63cd950031 allow a failed but non-fatal get_theme_object
git-svn-id: file:///home/shish/svn/shimmie2/trunk@1107 7f39781d-f577-437e-ae19-be835c7a54ca
2008-11-07 14:20:31 +00:00
shish
24461ad4ca Image::by_random fix from artanis
git-svn-id: file:///home/shish/svn/shimmie2/trunk@1106 7f39781d-f577-437e-ae19-be835c7a54ca
2008-11-07 11:46:34 +00:00
shish
26e3fb8e34 make piclens happy
git-svn-id: file:///home/shish/svn/shimmie2/trunk@1103 7f39781d-f577-437e-ae19-be835c7a54ca
2008-10-27 16:55:02 +00:00
shish
039bd7a57d image rss pages
git-svn-id: file:///home/shish/svn/shimmie2/trunk@1101 7f39781d-f577-437e-ae19-be835c7a54ca
2008-10-27 16:31:23 +00:00
shish
c1545526ad fix for the futaba theme
git-svn-id: file:///home/shish/svn/shimmie2/trunk@1100 7f39781d-f577-437e-ae19-be835c7a54ca
2008-10-20 18:53:54 +00:00
shish
b37e9e859f numbered and searched rss results
git-svn-id: file:///home/shish/svn/shimmie2/trunk@1099 7f39781d-f577-437e-ae19-be835c7a54ca
2008-10-18 11:43:44 +00:00
shish
a7189cbe74 deny this too
git-svn-id: file:///home/shish/svn/shimmie2/trunk@1098 7f39781d-f577-437e-ae19-be835c7a54ca
2008-10-18 10:51:05 +00:00
shish
721c720f19 denied.
git-svn-id: file:///home/shish/svn/shimmie2/trunk@1097 7f39781d-f577-437e-ae19-be835c7a54ca
2008-10-18 10:49:16 +00:00
shish
98f6800f9d configurable testing URL
git-svn-id: file:///home/shish/svn/shimmie2/trunk@1096 7f39781d-f577-437e-ae19-be835c7a54ca
2008-10-18 10:34:15 +00:00
shish
99954fe6ae mime~
git-svn-id: file:///home/shish/svn/shimmie2/trunk@1095 7f39781d-f577-437e-ae19-be835c7a54ca
2008-10-18 10:11:16 +00:00
shish
5f2e364e49 more tests
git-svn-id: file:///home/shish/svn/shimmie2/trunk@1094 7f39781d-f577-437e-ae19-be835c7a54ca
2008-10-18 10:00:34 +00:00
shish
f093eece2f how has this gone so long without being included o_O;;;
git-svn-id: file:///home/shish/svn/shimmie2/trunk@1093 7f39781d-f577-437e-ae19-be835c7a54ca
2008-10-18 06:40:34 +00:00
shish
5ca37d6009 another couple of test sets
git-svn-id: file:///home/shish/svn/shimmie2/trunk@1092 7f39781d-f577-437e-ae19-be835c7a54ca
2008-10-18 06:40:12 +00:00
shish
f17318921d more appropriate name
git-svn-id: file:///home/shish/svn/shimmie2/trunk@1091 7f39781d-f577-437e-ae19-be835c7a54ca
2008-10-18 06:39:46 +00:00
shish
b24bc26ebb give thumbnails IDs for easier automated clicking
git-svn-id: file:///home/shish/svn/shimmie2/trunk@1090 7f39781d-f577-437e-ae19-be835c7a54ca
2008-10-18 06:39:19 +00:00
shish
45ab91c054 link properly...
git-svn-id: file:///home/shish/svn/shimmie2/trunk@1089 7f39781d-f577-437e-ae19-be835c7a54ca
2008-10-18 06:23:42 +00:00
shish
bf1354bde1 querylets are addable
git-svn-id: file:///home/shish/svn/shimmie2/trunk@1088 7f39781d-f577-437e-ae19-be835c7a54ca
2008-10-18 06:08:41 +00:00
shish
e124a9512d test from the command line
git-svn-id: file:///home/shish/svn/shimmie2/trunk@1087 7f39781d-f577-437e-ae19-be835c7a54ca
2008-10-18 06:05:53 +00:00
shish
58b80f5a72 denied.
git-svn-id: file:///home/shish/svn/shimmie2/trunk@1086 7f39781d-f577-437e-ae19-be835c7a54ca
2008-10-18 06:05:26 +00:00
shish
a124addf96 test specific extensions
git-svn-id: file:///home/shish/svn/shimmie2/trunk@1085 7f39781d-f577-437e-ae19-be835c7a54ca
2008-10-18 06:05:06 +00:00
shish
8b1ce21465 add_header is for html headers, not http...
git-svn-id: file:///home/shish/svn/shimmie2/trunk@1084 7f39781d-f577-437e-ae19-be835c7a54ca
2008-10-18 06:04:03 +00:00
shish
5fb279c545 test meta-search
git-svn-id: file:///home/shish/svn/shimmie2/trunk@1083 7f39781d-f577-437e-ae19-be835c7a54ca
2008-10-18 06:03:26 +00:00
shish
cecd961e66 bbcode tests
git-svn-id: file:///home/shish/svn/shimmie2/trunk@1082 7f39781d-f577-437e-ae19-be835c7a54ca
2008-10-18 06:03:01 +00:00
shish
f7cfa13e23 fix the error message (still a hack)
git-svn-id: file:///home/shish/svn/shimmie2/trunk@1081 7f39781d-f577-437e-ae19-be835c7a54ca
2008-10-17 20:38:21 +00:00
shish
1ac68b6a74 quit whining and deal with the problem
git-svn-id: file:///home/shish/svn/shimmie2/trunk@1080 7f39781d-f577-437e-ae19-be835c7a54ca
2008-10-17 20:34:48 +00:00
shish
dba8e76830 working ratings
git-svn-id: file:///home/shish/svn/shimmie2/trunk@1079 7f39781d-f577-437e-ae19-be835c7a54ca
2008-10-17 20:18:38 +00:00
shish
13fb0356c2 this is allowed to be null
git-svn-id: file:///home/shish/svn/shimmie2/trunk@1078 7f39781d-f577-437e-ae19-be835c7a54ca
2008-10-17 19:59:15 +00:00
shish
422bd084b5 typo
git-svn-id: file:///home/shish/svn/shimmie2/trunk@1077 7f39781d-f577-437e-ae19-be835c7a54ca
2008-10-17 19:58:37 +00:00
shish
4e901afce0 build_search_querylet builds the same query, but it does it smarter
git-svn-id: file:///home/shish/svn/shimmie2/trunk@1076 7f39781d-f577-437e-ae19-be835c7a54ca
2008-10-17 19:57:56 +00:00
shish
aca9cad432 default search, and search context
git-svn-id: file:///home/shish/svn/shimmie2/trunk@1075 7f39781d-f577-437e-ae19-be835c7a54ca
2008-10-17 19:57:18 +00:00
jjs
c3732aaa84 [danbooru api] Properly escape source attribute
git-svn-id: file:///home/shish/svn/shimmie2/trunk@1074 7f39781d-f577-437e-ae19-be835c7a54ca
2008-10-14 01:06:14 +00:00
shish
bf32003200 fix, make uploads work...
git-svn-id: file:///home/shish/svn/shimmie2/trunk@1073 7f39781d-f577-437e-ae19-be835c7a54ca
2008-10-12 01:10:33 +00:00
shish
c68df68195 test files for various extensions
git-svn-id: file:///home/shish/svn/shimmie2/trunk@1070 7f39781d-f577-437e-ae19-be835c7a54ca
2008-10-11 07:09:42 +00:00
shish
a0cb32f4b2 simpletest unit testing framework
git-svn-id: file:///home/shish/svn/shimmie2/trunk@1068 7f39781d-f577-437e-ae19-be835c7a54ca
2008-10-11 07:05:24 +00:00
shish
3ec1f4d677 this is no longer the database
git-svn-id: file:///home/shish/svn/shimmie2/trunk@1067 7f39781d-f577-437e-ae19-be835c7a54ca
2008-10-09 14:47:45 +00:00
shish
40431f4c26 wildcard search, and remove the lower() stuff (it scares mysql)
git-svn-id: file:///home/shish/svn/shimmie2/trunk@1066 7f39781d-f577-437e-ae19-be835c7a54ca
2008-10-09 05:56:48 +00:00
shish
bf8f2e847f this is no longer the database (and we have a where started too)
git-svn-id: file:///home/shish/svn/shimmie2/trunk@1063 7f39781d-f577-437e-ae19-be835c7a54ca
2008-10-09 03:41:39 +00:00
shish
1d8999bf9c reorganising
git-svn-id: file:///home/shish/svn/shimmie2/trunk@1061 7f39781d-f577-437e-ae19-be835c7a54ca
2008-10-09 03:31:34 +00:00
shish
028896650a some image functions which weren't in the 'image' section...
git-svn-id: file:///home/shish/svn/shimmie2/trunk@1060 7f39781d-f577-437e-ae19-be835c7a54ca
2008-10-09 03:28:58 +00:00
shish
2e48f233b5 changed this too
git-svn-id: file:///home/shish/svn/shimmie2/trunk@1059 7f39781d-f577-437e-ae19-be835c7a54ca
2008-10-09 03:23:12 +00:00
shish
072b22ee8f Image code moved to image class
git-svn-id: file:///home/shish/svn/shimmie2/trunk@1058 7f39781d-f577-437e-ae19-be835c7a54ca
2008-10-09 03:21:18 +00:00
shish
8eef694168 port the lovely search code from postgres; overall it's much better, though mysql chokes on it in extreme cases :S
git-svn-id: file:///home/shish/svn/shimmie2/trunk@1057 7f39781d-f577-437e-ae19-be835c7a54ca
2008-10-09 02:54:17 +00:00
shish
c5f9918977 remove posted_timestamp
git-svn-id: file:///home/shish/svn/shimmie2/trunk@1055 7f39781d-f577-437e-ae19-be835c7a54ca
2008-10-09 01:58:22 +00:00
shish
b9e5f424d2 there is no veto, an exception should be here, if anything
git-svn-id: file:///home/shish/svn/shimmie2/trunk@1051 7f39781d-f577-437e-ae19-be835c7a54ca
2008-09-18 05:29:54 +00:00
jjs
bbb4de4bac [danbooru api] bugfix for page_name -> page_matches
git-svn-id: file:///home/shish/svn/shimmie2/trunk@1050 7f39781d-f577-437e-ae19-be835c7a54ca
2008-09-18 03:14:36 +00:00
shish
73c88716a8 this wasn't meant to be ported here yet <_<
git-svn-id: file:///home/shish/svn/shimmie2/trunk@1049 7f39781d-f577-437e-ae19-be835c7a54ca
2008-09-18 02:48:12 +00:00
shish
bacd459b62 a start towards moving debug info out of search engines' path
git-svn-id: file:///home/shish/svn/shimmie2/trunk@1046 7f39781d-f577-437e-ae19-be835c7a54ca
2008-09-09 09:21:22 +00:00
shish
94fe6f5a70 to the trunk-mobile /o/
git-svn-id: file:///home/shish/svn/shimmie2/trunk@1045 7f39781d-f577-437e-ae19-be835c7a54ca
2008-09-09 09:20:39 +00:00
shish
d2b251aea8 make sure there's something to click on...
git-svn-id: file:///home/shish/svn/shimmie2/trunk@1041 7f39781d-f577-437e-ae19-be835c7a54ca
2008-09-09 09:14:52 +00:00
shish
c52cad5637 back to trunk
git-svn-id: file:///home/shish/svn/shimmie2/trunk@1040 7f39781d-f577-437e-ae19-be835c7a54ca
2008-09-08 19:38:09 +00:00
shish
d5955e97a8 add the ability to send PMs (and make it an event, so other extensions can send them)
git-svn-id: file:///home/shish/svn/shimmie2/trunk@1033 7f39781d-f577-437e-ae19-be835c7a54ca
2008-09-07 13:55:28 +00:00
shish
2511b79935 private messaging system
git-svn-id: file:///home/shish/svn/shimmie2/trunk@1032 7f39781d-f577-437e-ae19-be835c7a54ca
2008-09-07 05:57:28 +00:00
shish
4a0830cfdb another bit of compat
git-svn-id: file:///home/shish/svn/shimmie2/trunk@1031 7f39781d-f577-437e-ae19-be835c7a54ca
2008-09-07 04:57:10 +00:00
shish
5f05f4543d IPs should be varchars
git-svn-id: file:///home/shish/svn/shimmie2/trunk@1030 7f39781d-f577-437e-ae19-be835c7a54ca
2008-09-07 04:52:40 +00:00
shish
ebe226584b category organisation
git-svn-id: file:///home/shish/svn/shimmie2/trunk@1029 7f39781d-f577-437e-ae19-be835c7a54ca
2008-09-06 20:46:05 +00:00
shish
96a37605e4 port page_matches from score to trunk
git-svn-id: file:///home/shish/svn/shimmie2/trunk@1028 7f39781d-f577-437e-ae19-be835c7a54ca
2008-09-06 17:48:03 +00:00
shish
7030727a6d another badly named theme
git-svn-id: file:///home/shish/svn/shimmie2/trunk@1025 7f39781d-f577-437e-ae19-be835c7a54ca
2008-09-06 17:11:57 +00:00
shish
a6adfa85cd upload handlers have themes too...
git-svn-id: file:///home/shish/svn/shimmie2/trunk@1024 7f39781d-f577-437e-ae19-be835c7a54ca
2008-09-06 17:10:27 +00:00
shish
d822d4f41f stricter get_theme_object
git-svn-id: file:///home/shish/svn/shimmie2/trunk@1023 7f39781d-f577-437e-ae19-be835c7a54ca
2008-09-06 17:08:29 +00:00
shish
4e143e9f05 gah, inconsistent naming
git-svn-id: file:///home/shish/svn/shimmie2/trunk@1021 7f39781d-f577-437e-ae19-be835c7a54ca
2008-09-06 17:05:21 +00:00
shish
f8f7470e61 much friendlier get_theme_object
git-svn-id: file:///home/shish/svn/shimmie2/trunk@1019 7f39781d-f577-437e-ae19-be835c7a54ca
2008-09-06 16:59:02 +00:00
shish
1f0e363645 html escape config values before putting them in text boxes
git-svn-id: file:///home/shish/svn/shimmie2/trunk@1013 7f39781d-f577-437e-ae19-be835c7a54ca
2008-09-01 13:22:14 +00:00
shish
af3cbba180 realpath() should make things work better on windows
git-svn-id: file:///home/shish/svn/shimmie2/trunk@1009 7f39781d-f577-437e-ae19-be835c7a54ca
2008-09-01 12:54:58 +00:00
shish
31573f5ff9 how did I miss these o_O?
git-svn-id: file:///home/shish/svn/shimmie2/trunk@1008 7f39781d-f577-437e-ae19-be835c7a54ca
2008-08-27 20:24:21 +00:00
shish
432e0c4dc6 move image functions to the image class
git-svn-id: file:///home/shish/svn/shimmie2/trunk@1007 7f39781d-f577-437e-ae19-be835c7a54ca
2008-08-26 09:11:40 +00:00
shish
1eee417f0a mailto urls
git-svn-id: file:///home/shish/svn/shimmie2/trunk@1005 7f39781d-f577-437e-ae19-be835c7a54ca
2008-08-26 09:04:51 +00:00
shish
aee1af4e0e move user stuff into the user class
git-svn-id: file:///home/shish/svn/shimmie2/trunk@1004 7f39781d-f577-437e-ae19-be835c7a54ca
2008-08-23 12:49:47 +00:00
shish
434fab2dc5 and make the extensions match
git-svn-id: file:///home/shish/svn/shimmie2/trunk@1003 7f39781d-f577-437e-ae19-be835c7a54ca
2008-08-23 12:08:19 +00:00
shish
1e4d7d1938 merge some useful parts of SCore
git-svn-id: file:///home/shish/svn/shimmie2/trunk@1002 7f39781d-f577-437e-ae19-be835c7a54ca
2008-08-23 12:05:24 +00:00
shish
a9c8d7c6ec PHP4 is dead \o/ \o/ \o/
git-svn-id: file:///home/shish/svn/shimmie2/trunk@1000 7f39781d-f577-437e-ae19-be835c7a54ca
2008-08-23 11:18:57 +00:00
shish
2a6c087179 and another one
git-svn-id: file:///home/shish/svn/shimmie2/trunk@999 7f39781d-f577-437e-ae19-be835c7a54ca
2008-08-23 11:09:24 +00:00
shish
d43edb8c7f fix this bug in danbooru too
git-svn-id: file:///home/shish/svn/shimmie2/trunk@998 7f39781d-f577-437e-ae19-be835c7a54ca
2008-08-23 06:44:10 +00:00
shish
8074be77a7 another loose global
git-svn-id: file:///home/shish/svn/shimmie2/trunk@995 7f39781d-f577-437e-ae19-be835c7a54ca
2008-08-22 13:10:22 +00:00
shish
09b2be6830 PHP4 is dead \o/ \o/ \o/ (Part 1, make use of instanceof)
git-svn-id: file:///home/shish/svn/shimmie2/trunk@994 7f39781d-f577-437e-ae19-be835c7a54ca
2008-08-22 09:41:30 +00:00
shish
24a775678c neater
git-svn-id: file:///home/shish/svn/shimmie2/trunk@993 7f39781d-f577-437e-ae19-be835c7a54ca
2008-08-22 08:19:15 +00:00
shish
a72fb78ee0 this wasn't used either
git-svn-id: file:///home/shish/svn/shimmie2/trunk@992 7f39781d-f577-437e-ae19-be835c7a54ca
2008-08-22 08:17:18 +00:00
shish
e2d84517fa this was never used
git-svn-id: file:///home/shish/svn/shimmie2/trunk@991 7f39781d-f577-437e-ae19-be835c7a54ca
2008-08-22 08:09:16 +00:00
shish
0cbc905e7c give the report image extension some love
git-svn-id: file:///home/shish/svn/shimmie2/trunk@983 7f39781d-f577-437e-ae19-be835c7a54ca
2008-08-12 02:37:48 +00:00
shish
e3701f3916 tidying up
git-svn-id: file:///home/shish/svn/shimmie2/trunk@982 7f39781d-f577-437e-ae19-be835c7a54ca
2008-08-12 01:36:39 +00:00
shish
89e8805fc8 sql uses >= not =>
git-svn-id: file:///home/shish/svn/shimmie2/trunk@981 7f39781d-f577-437e-ae19-be835c7a54ca
2008-08-12 00:31:59 +00:00
shish
cb63e8d605 index a column which exists
git-svn-id: file:///home/shish/svn/shimmie2/trunk@980 7f39781d-f577-437e-ae19-be835c7a54ca
2008-08-12 00:22:05 +00:00
shish
4940e3cd6f some changes from r34
git-svn-id: file:///home/shish/svn/shimmie2/trunk@979 7f39781d-f577-437e-ae19-be835c7a54ca
2008-08-12 00:04:10 +00:00
shish
12b02f155c db specific initialisation
git-svn-id: file:///home/shish/svn/shimmie2/trunk@976 7f39781d-f577-437e-ae19-be835c7a54ca
2008-08-11 20:27:24 +00:00
shish
3c91224e8b standard sql
git-svn-id: file:///home/shish/svn/shimmie2/trunk@962 7f39781d-f577-437e-ae19-be835c7a54ca
2008-07-29 21:09:43 +00:00
shish
c741ea216f pull a bunch of r34 tweaks intro trunk
git-svn-id: file:///home/shish/svn/shimmie2/trunk@959 7f39781d-f577-437e-ae19-be835c7a54ca
2008-07-29 19:43:34 +00:00
shish
8ac2428820 update image_hash_ban to the 2.2 APIs
git-svn-id: file:///home/shish/svn/shimmie2/trunk@940 7f39781d-f577-437e-ae19-be835c7a54ca
2008-07-27 15:55:45 +00:00
shish
19ea54ad21 numeric, php fails at int...
git-svn-id: file:///home/shish/svn/shimmie2/trunk@938 7f39781d-f577-437e-ae19-be835c7a54ca
2008-07-26 06:39:15 +00:00
shish
2b51c7bc14 be more assertive
git-svn-id: file:///home/shish/svn/shimmie2/trunk@936 7f39781d-f577-437e-ae19-be835c7a54ca
2008-07-25 17:42:24 +00:00
shish
e6ec382aee and the other bit <_<
git-svn-id: file:///home/shish/svn/shimmie2/trunk@932 7f39781d-f577-437e-ae19-be835c7a54ca
2008-07-25 11:55:55 +00:00
shish
304ef0351f avoid the use of an SQL keyword
git-svn-id: file:///home/shish/svn/shimmie2/trunk@930 7f39781d-f577-437e-ae19-be835c7a54ca
2008-07-25 11:30:47 +00:00
shish
1f242d873e another bit
git-svn-id: file:///home/shish/svn/shimmie2/trunk@928 7f39781d-f577-437e-ae19-be835c7a54ca
2008-07-24 16:18:14 +00:00
shish
8f39ae6d3f more standard sqlness
git-svn-id: file:///home/shish/svn/shimmie2/trunk@926 7f39781d-f577-437e-ae19-be835c7a54ca
2008-07-24 15:07:39 +00:00
shish
b75dc2b2bc thank god they both have *some* log function in common...
git-svn-id: file:///home/shish/svn/shimmie2/trunk@925 7f39781d-f577-437e-ae19-be835c7a54ca
2008-07-24 14:21:10 +00:00
shish
4f020ed7ea for postgres support
git-svn-id: file:///home/shish/svn/shimmie2/trunk@923 7f39781d-f577-437e-ae19-be835c7a54ca
2008-07-24 14:05:40 +00:00
shish
14dc15c7bd disk full warnings
git-svn-id: file:///home/shish/svn/shimmie2/trunk@921 7f39781d-f577-437e-ae19-be835c7a54ca
2008-07-24 07:50:31 +00:00
shish
2c3b82a2fb <= and =>
git-svn-id: file:///home/shish/svn/shimmie2/trunk@919 7f39781d-f577-437e-ae19-be835c7a54ca
2008-07-23 10:57:40 +00:00
shish
797e644c1f actually, this works better as a block of it's own...
git-svn-id: file:///home/shish/svn/shimmie2/trunk@916 7f39781d-f577-437e-ae19-be835c7a54ca
2008-07-21 15:16:48 +00:00
shish
051389606e make more things use move_upload_to_archive(), and make that function quieter
git-svn-id: file:///home/shish/svn/shimmie2/trunk@914 7f39781d-f577-437e-ae19-be835c7a54ca
2008-07-21 11:13:25 +00:00
shish
3061cb3f23 turn on output buffering
git-svn-id: file:///home/shish/svn/shimmie2/trunk@912 7f39781d-f577-437e-ae19-be835c7a54ca
2008-07-21 11:04:05 +00:00
shish
9b515faf34 Specify who banned a person on the ban list
git-svn-id: file:///home/shish/svn/shimmie2/trunk@910 7f39781d-f577-437e-ae19-be835c7a54ca
2008-07-17 08:13:52 +00:00
shish
87f99dee99 *headdesk*
git-svn-id: file:///home/shish/svn/shimmie2/trunk@909 7f39781d-f577-437e-ae19-be835c7a54ca
2008-06-25 00:25:22 +00:00
shish
fc8cdce2fd piclenslite button
git-svn-id: file:///home/shish/svn/shimmie2/trunk@908 7f39781d-f577-437e-ae19-be835c7a54ca
2008-06-25 00:18:26 +00:00
shish
a59072a663 add a couple of mediarss tags
git-svn-id: file:///home/shish/svn/shimmie2/trunk@907 7f39781d-f577-437e-ae19-be835c7a54ca
2008-06-25 00:05:19 +00:00
shish
bb9534073e say when a ban ends
git-svn-id: file:///home/shish/svn/shimmie2/trunk@904 7f39781d-f577-437e-ae19-be835c7a54ca
2008-06-19 14:55:32 +00:00
shish
1f11bbc7c1 I swear this worked before I looked at it and realised it couldn't possibly work o_O
git-svn-id: file:///home/shish/svn/shimmie2/trunk@902 7f39781d-f577-437e-ae19-be835c7a54ca
2008-06-16 11:28:10 +00:00
shish
c5ed35fba7 typo fix
git-svn-id: file:///home/shish/svn/shimmie2/trunk@901 7f39781d-f577-437e-ae19-be835c7a54ca
2008-06-16 01:08:28 +00:00
shish
5e710361c4 this is useful
git-svn-id: file:///home/shish/svn/shimmie2/trunk@899 7f39781d-f577-437e-ae19-be835c7a54ca
2008-06-14 18:45:00 +00:00
shish
8f252df282 merge image admin buttons into a single block
git-svn-id: file:///home/shish/svn/shimmie2/trunk@897 7f39781d-f577-437e-ae19-be835c7a54ca
2008-06-14 11:36:19 +00:00
shish
fab31bcb53 rely on PHP rather than using my own function (hmmm...)
git-svn-id: file:///home/shish/svn/shimmie2/trunk@896 7f39781d-f577-437e-ae19-be835c7a54ca
2008-06-14 11:18:41 +00:00
shish
8a4524378c well that was remarkably simple...
git-svn-id: file:///home/shish/svn/shimmie2/trunk@894 7f39781d-f577-437e-ae19-be835c7a54ca
2008-06-09 11:21:44 +00:00
shish
8d547d0ad5 another function for cli scripts
git-svn-id: file:///home/shish/svn/shimmie2/trunk@893 7f39781d-f577-437e-ae19-be835c7a54ca
2008-06-09 11:21:11 +00:00
shish
89a250b7f7 whitespace
git-svn-id: file:///home/shish/svn/shimmie2/trunk@889 7f39781d-f577-437e-ae19-be835c7a54ca
2008-06-08 15:11:01 +00:00
shish
f0f9ee8b61 move some stuff from index.php to core/util, to make alternative bootstrappers easier (eg, cli)
git-svn-id: file:///home/shish/svn/shimmie2/trunk@887 7f39781d-f577-437e-ae19-be835c7a54ca
2008-06-08 15:04:57 +00:00
shish
2cbc4669ff documentation for some extensions with non-obvious functionality
git-svn-id: file:///home/shish/svn/shimmie2/trunk@885 7f39781d-f577-437e-ae19-be835c7a54ca
2008-05-28 22:36:39 +00:00
shish
91f0e8dc4d and compressed file support :3
git-svn-id: file:///home/shish/svn/shimmie2/trunk@883 7f39781d-f577-437e-ae19-be835c7a54ca
2008-05-26 22:02:23 +00:00
shish
2f34a0f153 flash file dimentions (uncompressed files only)
git-svn-id: file:///home/shish/svn/shimmie2/trunk@882 7f39781d-f577-437e-ae19-be835c7a54ca
2008-05-26 21:56:06 +00:00
shish
babef089bb Make the hide rare tags setting make sense and be accurate
git-svn-id: file:///home/shish/svn/shimmie2/trunk@880 7f39781d-f577-437e-ae19-be835c7a54ca
2008-05-25 23:04:42 +00:00
shish
b2a47ce0d7 filename for data files
git-svn-id: file:///home/shish/svn/shimmie2/trunk@879 7f39781d-f577-437e-ae19-be835c7a54ca
2008-05-25 23:02:17 +00:00
shish
c74bcaf121 database content download button
git-svn-id: file:///home/shish/svn/shimmie2/trunk@877 7f39781d-f577-437e-ae19-be835c7a54ca
2008-05-22 20:41:46 +00:00
shish
97b7deb1da just in case the featured image is deleted
git-svn-id: file:///home/shish/svn/shimmie2/trunk@875 7f39781d-f577-437e-ae19-be835c7a54ca
2008-05-20 19:20:58 +00:00
shish
782b57724f this should never need to be set by hand
git-svn-id: file:///home/shish/svn/shimmie2/trunk@874 7f39781d-f577-437e-ae19-be835c7a54ca
2008-05-20 19:18:40 +00:00
shish
3db3c53a6d Obvious bug is obvious, and a complete bastard to find -_-
git-svn-id: file:///home/shish/svn/shimmie2/trunk@870 7f39781d-f577-437e-ae19-be835c7a54ca
2008-05-20 03:06:44 +00:00
shish
f2212af9a6 document why this is, as it confused me when I read it :3
git-svn-id: file:///home/shish/svn/shimmie2/trunk@869 7f39781d-f577-437e-ae19-be835c7a54ca
2008-05-20 02:42:59 +00:00
shish
a658019697 Slightly major rework of the search code internals, makes things more sane and fixes a couple of bugs
git-svn-id: file:///home/shish/svn/shimmie2/trunk@867 7f39781d-f577-437e-ae19-be835c7a54ca
2008-05-19 15:59:58 +00:00
shish
2c1c605f12 Coding at 4am isn't always a great idea <_< typo fixed
git-svn-id: file:///home/shish/svn/shimmie2/trunk@865 7f39781d-f577-437e-ae19-be835c7a54ca
2008-05-19 13:05:47 +00:00
shish
1f9f306cb2 random image download extension
git-svn-id: file:///home/shish/svn/shimmie2/trunk@864 7f39781d-f577-437e-ae19-be835c7a54ca
2008-05-19 03:30:56 +00:00
shish
8cae5831a9 random image function, at last
git-svn-id: file:///home/shish/svn/shimmie2/trunk@863 7f39781d-f577-437e-ae19-be835c7a54ca
2008-05-19 03:17:31 +00:00
shish
1fba968ffe featured image extension
git-svn-id: file:///home/shish/svn/shimmie2/trunk@861 7f39781d-f577-437e-ae19-be835c7a54ca
2008-05-19 02:19:46 +00:00
shish
3c0d687bf6 back, moderator; get back from whence thee came!
git-svn-id: file:///home/shish/svn/shimmie2/trunk@859 7f39781d-f577-437e-ae19-be835c7a54ca
2008-05-19 01:56:02 +00:00
shish
1cb91a9e4b titled wiki links
git-svn-id: file:///home/shish/svn/shimmie2/trunk@858 7f39781d-f577-437e-ae19-be835c7a54ca
2008-05-19 01:52:12 +00:00
shish
62f6354368 remove use of sql date types (different databases have wildly different support for them; storing integer times is easier...)
git-svn-id: file:///home/shish/svn/shimmie2/trunk@856 7f39781d-f577-437e-ae19-be835c7a54ca
2008-05-18 03:32:28 +00:00
shish
d5b21bf8f2 remove xmldb stuff from comment too...
git-svn-id: file:///home/shish/svn/shimmie2/trunk@853 7f39781d-f577-437e-ae19-be835c7a54ca
2008-05-18 02:25:31 +00:00
shish
9026856a91 backing off of xmldb D:
git-svn-id: file:///home/shish/svn/shimmie2/trunk@852 7f39781d-f577-437e-ae19-be835c7a54ca
2008-05-18 02:17:16 +00:00
shish
e7b7fc0d24 db abstraction blargh
git-svn-id: file:///home/shish/svn/shimmie2/trunk@851 7f39781d-f577-437e-ae19-be835c7a54ca
2008-05-18 02:14:51 +00:00
shish
5a4fc6d1fe more futaba tweaks
git-svn-id: file:///home/shish/svn/shimmie2/trunk@850 7f39781d-f577-437e-ae19-be835c7a54ca
2008-05-18 01:04:26 +00:00
shish
a07d0771b1 sidebar fails in this theme
git-svn-id: file:///home/shish/svn/shimmie2/trunk@849 7f39781d-f577-437e-ae19-be835c7a54ca
2008-05-16 22:27:58 +00:00
shish
ff2e3cf035 hide the tag-based search some more, making this a very minimalist theme :3
git-svn-id: file:///home/shish/svn/shimmie2/trunk@848 7f39781d-f577-437e-ae19-be835c7a54ca
2008-05-16 22:26:02 +00:00
shish
cfb80945f0 a couple of other tweaks
git-svn-id: file:///home/shish/svn/shimmie2/trunk@847 7f39781d-f577-437e-ae19-be835c7a54ca
2008-05-16 22:11:27 +00:00
shish
2181c233e5 make everything except comment/list less broken
git-svn-id: file:///home/shish/svn/shimmie2/trunk@846 7f39781d-f577-437e-ae19-be835c7a54ca
2008-05-16 21:54:21 +00:00
shish
d5255bbb1a a little more
git-svn-id: file:///home/shish/svn/shimmie2/trunk@845 7f39781d-f577-437e-ae19-be835c7a54ca
2008-05-16 21:12:49 +00:00
shish
26fc96bf83 some fixes
git-svn-id: file:///home/shish/svn/shimmie2/trunk@844 7f39781d-f577-437e-ae19-be835c7a54ca
2008-05-16 20:50:54 +00:00
shish
4e3ecd9458 hax~
git-svn-id: file:///home/shish/svn/shimmie2/trunk@843 7f39781d-f577-437e-ae19-be835c7a54ca
2008-05-16 20:38:30 +00:00
shish
2ab8e256eb :3
git-svn-id: file:///home/shish/svn/shimmie2/trunk@842 7f39781d-f577-437e-ae19-be835c7a54ca
2008-05-16 19:39:29 +00:00
shish
be5cced8c5 mysql fails at indexing long columns; shorten some of them
git-svn-id: file:///home/shish/svn/shimmie2/trunk@840 7f39781d-f577-437e-ae19-be835c7a54ca
2008-05-04 20:59:52 +00:00
shish
16cf014d90 trunk also
git-svn-id: file:///home/shish/svn/shimmie2/trunk@839 7f39781d-f577-437e-ae19-be835c7a54ca
2008-04-30 12:39:40 +00:00
shish
2f2a00b58a better for prepared statements
git-svn-id: file:///home/shish/svn/shimmie2/trunk@834 7f39781d-f577-437e-ae19-be835c7a54ca
2008-04-30 11:44:49 +00:00
shish
3c46aa5335 memcache api
git-svn-id: file:///home/shish/svn/shimmie2/trunk@833 7f39781d-f577-437e-ae19-be835c7a54ca
2008-04-30 11:26:12 +00:00
shish
d0a9ba3d05 epeg thumbnail generator function
git-svn-id: file:///home/shish/svn/shimmie2/trunk@831 7f39781d-f577-437e-ae19-be835c7a54ca
2008-04-29 22:52:06 +00:00
shish
811bf0e16b bbcode list
git-svn-id: file:///home/shish/svn/shimmie2/trunk@830 7f39781d-f577-437e-ae19-be835c7a54ca
2008-04-20 15:29:40 +00:00
shish
3bb3a42e75 bbcode strikethrough
git-svn-id: file:///home/shish/svn/shimmie2/trunk@829 7f39781d-f577-437e-ae19-be835c7a54ca
2008-04-20 15:13:15 +00:00
shish
361bbafea7 ob_start in install.php
git-svn-id: file:///home/shish/svn/shimmie2/trunk@827 7f39781d-f577-437e-ae19-be835c7a54ca
2008-04-19 18:57:43 +00:00
shish
41d1b4c653 oh no it isn't :3
git-svn-id: file:///home/shish/svn/shimmie2/trunk@826 7f39781d-f577-437e-ae19-be835c7a54ca
2008-04-16 10:30:31 +00:00
shish
09079f6e72 multi-line extension descriptions
git-svn-id: file:///home/shish/svn/shimmie2/trunk@824 7f39781d-f577-437e-ae19-be835c7a54ca
2008-04-16 10:00:34 +00:00
jjs
4621b5e16f [danbooru api] forgot $this so last update was broken
git-svn-id: file:///home/shish/svn/shimmie2/trunk@821 7f39781d-f577-437e-ae19-be835c7a54ca
2008-04-15 04:03:10 +00:00
shish
d4bc3ace03 fix javascript error in ie
git-svn-id: file:///home/shish/svn/shimmie2/trunk@819 7f39781d-f577-437e-ae19-be835c7a54ca
2008-04-14 11:21:05 +00:00
shish
7edf906065 manually set the mime type when serving .ico files
git-svn-id: file:///home/shish/svn/shimmie2/trunk@817 7f39781d-f577-437e-ae19-be835c7a54ca
2008-04-14 10:50:46 +00:00
jjs
411b933b72 [danbooru api] Properly escape returned tags, other minor cleanup
git-svn-id: file:///home/shish/svn/shimmie2/trunk@816 7f39781d-f577-437e-ae19-be835c7a54ca
2008-04-14 03:20:25 +00:00
shish
cc3767c1b8 get SVG size
git-svn-id: file:///home/shish/svn/shimmie2/trunk@814 7f39781d-f577-437e-ae19-be835c7a54ca
2008-04-11 06:56:31 +00:00
shish
62d0f3df7c allow ban for '1 week' etc instead of specifying end time
git-svn-id: file:///home/shish/svn/shimmie2/trunk@812 7f39781d-f577-437e-ae19-be835c7a54ca
2008-04-11 06:26:13 +00:00
shish
ccde7b6cab missed a couple
git-svn-id: file:///home/shish/svn/shimmie2/trunk@810 7f39781d-f577-437e-ae19-be835c7a54ca
2008-04-11 06:12:50 +00:00
shish
2b723fe525 Extension meta-info tidyups
git-svn-id: file:///home/shish/svn/shimmie2/trunk@809 7f39781d-f577-437e-ae19-be835c7a54ca
2008-04-11 06:12:07 +00:00
shish
9a54cf6d0d tidy ups in the extension manager
git-svn-id: file:///home/shish/svn/shimmie2/trunk@808 7f39781d-f577-437e-ae19-be835c7a54ca
2008-04-11 06:04:22 +00:00
shish
4e19a29dd0 ip ban isn't essential either
git-svn-id: file:///home/shish/svn/shimmie2/trunk@806 7f39781d-f577-437e-ae19-be835c7a54ca
2008-04-11 05:46:06 +00:00
shish
c51f35b3d5 core_scripts didn't really do much, and what it did was really theme stuff
git-svn-id: file:///home/shish/svn/shimmie2/trunk@805 7f39781d-f577-437e-ae19-be835c7a54ca
2008-04-11 05:40:20 +00:00
shish
59a0979d7f marge admin utils into admin
git-svn-id: file:///home/shish/svn/shimmie2/trunk@804 7f39781d-f577-437e-ae19-be835c7a54ca
2008-04-11 05:36:36 +00:00
shish
ff199a7c63 Now that the extension manager is working, the non-essential extensions can be made optional
git-svn-id: file:///home/shish/svn/shimmie2/trunk@803 7f39781d-f577-437e-ae19-be835c7a54ca
2008-04-11 05:28:36 +00:00
shish
f7218a677d IP Ban list on its own page
git-svn-id: file:///home/shish/svn/shimmie2/trunk@801 7f39781d-f577-437e-ae19-be835c7a54ca
2008-04-11 05:23:11 +00:00
shish
de09735e69 neatness
git-svn-id: file:///home/shish/svn/shimmie2/trunk@800 7f39781d-f577-437e-ae19-be835c7a54ca
2008-04-11 05:17:51 +00:00
shish
7a6ccf11de filename search
git-svn-id: file:///home/shish/svn/shimmie2/trunk@799 7f39781d-f577-437e-ae19-be835c7a54ca
2008-04-11 05:06:37 +00:00
shish
09f768afdd handle icons as objects in the hope of making ie7 happy
git-svn-id: file:///home/shish/svn/shimmie2/trunk@797 7f39781d-f577-437e-ae19-be835c7a54ca
2008-04-11 01:49:18 +00:00
shish
4803c6f5d2 trunk also
git-svn-id: file:///home/shish/svn/shimmie2/trunk@796 7f39781d-f577-437e-ae19-be835c7a54ca
2008-04-09 01:10:56 +00:00
shish
337dbb340e .ico handler, by request
git-svn-id: file:///home/shish/svn/shimmie2/trunk@792 7f39781d-f577-437e-ae19-be835c7a54ca
2008-04-08 21:58:17 +00:00
shish
dee164edf1 All the upload handlers use this function, put it somewhere common
git-svn-id: file:///home/shish/svn/shimmie2/trunk@791 7f39781d-f577-437e-ae19-be835c7a54ca
2008-04-08 21:56:37 +00:00
shish
c1238af7db don't die when no ratio limits are specified
git-svn-id: file:///home/shish/svn/shimmie2/trunk@790 7f39781d-f577-437e-ae19-be835c7a54ca
2008-04-08 21:55:59 +00:00
shish
3a2538ad96 fix error messages for failed trasload
git-svn-id: file:///home/shish/svn/shimmie2/trunk@789 7f39781d-f577-437e-ae19-be835c7a54ca
2008-04-08 21:55:07 +00:00
shish
ffe6b2ab7c search by score
git-svn-id: file:///home/shish/svn/shimmie2/trunk@787 7f39781d-f577-437e-ae19-be835c7a54ca
2008-04-08 17:16:29 +00:00
shish
b28c77b32d bug fix
git-svn-id: file:///home/shish/svn/shimmie2/trunk@785 7f39781d-f577-437e-ae19-be835c7a54ca
2008-04-08 16:58:04 +00:00
shish
c736f6b7b6 theme change for image info editor
git-svn-id: file:///home/shish/svn/shimmie2/trunk@783 7f39781d-f577-437e-ae19-be835c7a54ca
2008-04-08 16:54:13 +00:00
shish
a885d1481e working numeric score
git-svn-id: file:///home/shish/svn/shimmie2/trunk@782 7f39781d-f577-437e-ae19-be835c7a54ca
2008-04-08 16:53:48 +00:00
shish
811887d06a there are some things that we don't want to be wide
git-svn-id: file:///home/shish/svn/shimmie2/trunk@781 7f39781d-f577-437e-ae19-be835c7a54ca
2008-04-08 16:52:44 +00:00
shish
c88a35b58c session IP mask, for users with varying IPs; mostly from a patch in #303
git-svn-id: file:///home/shish/svn/shimmie2/trunk@779 7f39781d-f577-437e-ae19-be835c7a54ca
2008-04-08 16:02:43 +00:00
shish
fba18e10fc case insensetive file type detection for svg / swf / mp3
git-svn-id: file:///home/shish/svn/shimmie2/trunk@777 7f39781d-f577-437e-ae19-be835c7a54ca
2008-04-08 15:41:11 +00:00
shish
a649cfffc0 regex rather than two str_replaces, works better for some people
git-svn-id: file:///home/shish/svn/shimmie2/trunk@776 7f39781d-f577-437e-ae19-be835c7a54ca
2008-04-08 15:35:08 +00:00
shish
935c235e63 same for archive handler
git-svn-id: file:///home/shish/svn/shimmie2/trunk@774 7f39781d-f577-437e-ae19-be835c7a54ca
2008-04-07 23:17:30 +00:00
shish
d55f97c81f case insensetive 'can we handle it?' check
git-svn-id: file:///home/shish/svn/shimmie2/trunk@773 7f39781d-f577-437e-ae19-be835c7a54ca
2008-04-07 23:11:47 +00:00
shish
4553bf00b8 and fix the home extension too
git-svn-id: file:///home/shish/svn/shimmie2/trunk@772 7f39781d-f577-437e-ae19-be835c7a54ca
2008-04-06 22:01:37 +00:00
shish
5b15ae1f47 force /post/list to appear in the list of GET arguments
git-svn-id: file:///home/shish/svn/shimmie2/trunk@771 7f39781d-f577-437e-ae19-be835c7a54ca
2008-04-06 21:49:58 +00:00
shish
f0ab3ee7a5 archive handler can use the system temp dir
git-svn-id: file:///home/shish/svn/shimmie2/trunk@770 7f39781d-f577-437e-ae19-be835c7a54ca
2008-04-06 21:38:32 +00:00
shish
129c8f0d69 Advanced setup page
git-svn-id: file:///home/shish/svn/shimmie2/trunk@768 7f39781d-f577-437e-ae19-be835c7a54ca
2008-04-06 21:03:13 +00:00
shish
73ba66fbc8 integrate spoiler into bbcode
git-svn-id: file:///home/shish/svn/shimmie2/trunk@766 7f39781d-f577-437e-ae19-be835c7a54ca
2008-04-06 18:41:36 +00:00
shish
7b1eed5ce0 extension manager enabled by default \o/
git-svn-id: file:///home/shish/svn/shimmie2/trunk@763 7f39781d-f577-437e-ae19-be835c7a54ca
2008-04-06 17:54:07 +00:00
shish
d866d0fd46 Various extension manager improvements from Christian Walde, and a recursive copy if symlink() isn't defined (ie, windows)
git-svn-id: file:///home/shish/svn/shimmie2/trunk@761 7f39781d-f577-437e-ae19-be835c7a54ca
2008-04-06 17:43:03 +00:00
shish
52639e6c3a image_hash_ban whitespacing
git-svn-id: file:///home/shish/svn/shimmie2/trunk@759 7f39781d-f577-437e-ae19-be835c7a54ca
2008-04-06 16:47:05 +00:00
shish
7db7096b2e variable
git-svn-id: file:///home/shish/svn/shimmie2/trunk@758 7f39781d-f577-437e-ae19-be835c7a54ca
2008-04-06 16:43:09 +00:00
shish
c3ab69d234 sys_get_temp_dir requires util.inc.php
git-svn-id: file:///home/shish/svn/shimmie2/trunk@756 7f39781d-f577-437e-ae19-be835c7a54ca
2008-04-06 16:37:49 +00:00
shish
3a9063b02b trunk also <_<
git-svn-id: file:///home/shish/svn/shimmie2/trunk@755 7f39781d-f577-437e-ae19-be835c7a54ca
2008-04-04 22:41:45 +00:00
shish
df8efa475e start of requestcontext work
git-svn-id: file:///home/shish/svn/shimmie2/trunk@753 7f39781d-f577-437e-ae19-be835c7a54ca
2008-04-04 12:07:38 +00:00
shish
c88ec5fe54 ie7 fails at css
git-svn-id: file:///home/shish/svn/shimmie2/trunk@750 7f39781d-f577-437e-ae19-be835c7a54ca
2008-04-04 10:36:44 +00:00
shish
0b59c40865 remove user enable / disable, as the feature was ass, and better handled elsewhere :|
git-svn-id: file:///home/shish/svn/shimmie2/trunk@749 7f39781d-f577-437e-ae19-be835c7a54ca
2008-04-02 20:07:52 +00:00
shish
89df1557f0 IP range ban
git-svn-id: file:///home/shish/svn/shimmie2/trunk@746 7f39781d-f577-437e-ae19-be835c7a54ca
2008-04-01 10:57:18 +00:00
shish
e469ebcb38 option to show only an image's given tags, saves database processing and some people prefer it
git-svn-id: file:///home/shish/svn/shimmie2/trunk@744 7f39781d-f577-437e-ae19-be835c7a54ca
2008-04-01 10:13:51 +00:00
shish
6ced0304dd and add a compatability function, because php only contains the one I need as of 5.2.1 -_-
git-svn-id: file:///home/shish/svn/shimmie2/trunk@743 7f39781d-f577-437e-ae19-be835c7a54ca
2008-04-01 10:12:27 +00:00
shish
797f515b16 temp data goes in a temp folder
git-svn-id: file:///home/shish/svn/shimmie2/trunk@742 7f39781d-f577-437e-ae19-be835c7a54ca
2008-04-01 10:11:36 +00:00
shish
dced16a8c4 ordered bans
git-svn-id: file:///home/shish/svn/shimmie2/trunk@740 7f39781d-f577-437e-ae19-be835c7a54ca
2008-03-31 02:58:54 +00:00
shish
bec46a910e ban to a date, not a datetime
git-svn-id: file:///home/shish/svn/shimmie2/trunk@739 7f39781d-f577-437e-ae19-be835c7a54ca
2008-03-31 02:56:28 +00:00
shish
fe8ab42901 download all bans, then compare in PHP; saves DB effort and allows more flexible ban matching
git-svn-id: file:///home/shish/svn/shimmie2/trunk@738 7f39781d-f577-437e-ae19-be835c7a54ca
2008-03-31 02:49:40 +00:00
shish
abc2fe278a ordered alias list
git-svn-id: file:///home/shish/svn/shimmie2/trunk@737 7f39781d-f577-437e-ae19-be835c7a54ca
2008-03-31 02:39:08 +00:00
shish
986e8228bb readme updates
git-svn-id: file:///home/shish/svn/shimmie2/trunk@734 7f39781d-f577-437e-ae19-be835c7a54ca
2008-03-29 04:13:23 +00:00
shish
0356a84a6e make extra-sure that only valud file types are handled (.bmp renamed to .jpg used to sneak though)
git-svn-id: file:///home/shish/svn/shimmie2/trunk@732 7f39781d-f577-437e-ae19-be835c7a54ca
2008-03-29 03:59:34 +00:00
shish
77e818c4aa revert this; seems to break mysql-4.1
git-svn-id: file:///home/shish/svn/shimmie2/trunk@729 7f39781d-f577-437e-ae19-be835c7a54ca
2008-03-29 03:37:16 +00:00
shish
975251ed42 enforced whitespace around metainfo editor
git-svn-id: file:///home/shish/svn/shimmie2/trunk@728 7f39781d-f577-437e-ae19-be835c7a54ca
2008-03-24 04:05:42 +00:00
shish
499d752ca9 make rating use the new image metainfo editor api
git-svn-id: file:///home/shish/svn/shimmie2/trunk@727 7f39781d-f577-437e-ae19-be835c7a54ca
2008-03-24 04:03:34 +00:00
shish
d0483bcc2a get the user to change their pass
git-svn-id: file:///home/shish/svn/shimmie2/trunk@726 7f39781d-f577-437e-ae19-be835c7a54ca
2008-03-15 21:53:17 +00:00
shish
c5349db306 check file size properly
git-svn-id: file:///home/shish/svn/shimmie2/trunk@725 7f39781d-f577-437e-ae19-be835c7a54ca
2008-03-02 16:31:35 +00:00
jjs
430163c29d [danbooru api] fixed for trunk, hopefully
git-svn-id: file:///home/shish/svn/shimmie2/trunk@724 7f39781d-f577-437e-ae19-be835c7a54ca
2008-03-02 01:11:52 +00:00
shish
7948202337 cache_execute was removed for lack of use
git-svn-id: file:///home/shish/svn/shimmie2/trunk@723 7f39781d-f577-437e-ae19-be835c7a54ca
2008-02-25 16:48:25 +00:00
shish
979ab9a013 don't load custom themes without base themes
git-svn-id: file:///home/shish/svn/shimmie2/trunk@722 7f39781d-f577-437e-ae19-be835c7a54ca
2008-02-17 09:25:49 +00:00
shish
c7c33a1a8d fix tag editing with danbooru theme, hopefully in a more permanant way
git-svn-id: file:///home/shish/svn/shimmie2/trunk@721 7f39781d-f577-437e-ae19-be835c7a54ca
2008-02-17 02:39:43 +00:00
shish
04fe9ad03a import aliases from file
git-svn-id: file:///home/shish/svn/shimmie2/trunk@720 7f39781d-f577-437e-ae19-be835c7a54ca
2008-02-16 03:58:05 +00:00
shish
c828ce5cfe move user search to user extension, and search by ID
git-svn-id: file:///home/shish/svn/shimmie2/trunk@719 7f39781d-f577-437e-ae19-be835c7a54ca
2008-02-16 03:14:38 +00:00
shish
86f805a088 blank folder for ATG
git-svn-id: file:///home/shish/svn/shimmie2/trunk@718 7f39781d-f577-437e-ae19-be835c7a54ca
2008-02-07 20:48:18 +00:00
shish
8b517a6a7c search for images with given ratings
git-svn-id: file:///home/shish/svn/shimmie2/trunk@717 7f39781d-f577-437e-ae19-be835c7a54ca
2008-02-07 20:28:07 +00:00
shish
5bae3dc733 graphical glitch
git-svn-id: file:///home/shish/svn/shimmie2/trunk@716 7f39781d-f577-437e-ae19-be835c7a54ca
2008-02-07 20:23:52 +00:00
shish
7f752180bf various minor bugs showed up in debug mode
git-svn-id: file:///home/shish/svn/shimmie2/trunk@715 7f39781d-f577-437e-ae19-be835c7a54ca
2008-02-06 17:33:08 +00:00
shish
fb62229634 move md5: to danbooru api
git-svn-id: file:///home/shish/svn/shimmie2/trunk@714 7f39781d-f577-437e-ae19-be835c7a54ca
2008-02-06 17:27:45 +00:00
shish
2948a4435e extensible search v1
git-svn-id: file:///home/shish/svn/shimmie2/trunk@713 7f39781d-f577-437e-ae19-be835c7a54ca
2008-02-06 17:24:08 +00:00
shish
0effe70b6f option to merge tags in the event of hash collision
git-svn-id: file:///home/shish/svn/shimmie2/trunk@712 7f39781d-f577-437e-ae19-be835c7a54ca
2008-02-06 16:20:43 +00:00
shish
5ebc559595 make res_limit work with the new upload system, and have a ratio limit
git-svn-id: file:///home/shish/svn/shimmie2/trunk@710 7f39781d-f577-437e-ae19-be835c7a54ca
2008-02-06 15:54:50 +00:00
shish
21ee529256 copy & paste artefact
git-svn-id: file:///home/shish/svn/shimmie2/trunk@709 7f39781d-f577-437e-ae19-be835c7a54ca
2008-01-27 17:18:56 +00:00
shish
1ca6064d3b remove debug thingy
git-svn-id: file:///home/shish/svn/shimmie2/trunk@708 7f39781d-f577-437e-ae19-be835c7a54ca
2008-01-27 17:07:27 +00:00
shish
8bec513d62 no need for session stuff
git-svn-id: file:///home/shish/svn/shimmie2/trunk@707 7f39781d-f577-437e-ae19-be835c7a54ca
2008-01-27 17:03:15 +00:00
shish
1defaf78b0 sqlite installation works \o/ not much else though...
git-svn-id: file:///home/shish/svn/shimmie2/trunk@706 7f39781d-f577-437e-ae19-be835c7a54ca
2008-01-27 16:54:58 +00:00
shish
97e72fa2af more installer niceness
git-svn-id: file:///home/shish/svn/shimmie2/trunk@705 7f39781d-f577-437e-ae19-be835c7a54ca
2008-01-27 16:25:17 +00:00
shish
4fb0092742 xml schema for installer
git-svn-id: file:///home/shish/svn/shimmie2/trunk@704 7f39781d-f577-437e-ae19-be835c7a54ca
2008-01-27 15:33:59 +00:00
shish
980ebd5189 use xml schemas to create tables
git-svn-id: file:///home/shish/svn/shimmie2/trunk@703 7f39781d-f577-437e-ae19-be835c7a54ca
2008-01-27 15:32:35 +00:00
shish
2608bafa41 adodb xml schema support
git-svn-id: file:///home/shish/svn/shimmie2/trunk@702 7f39781d-f577-437e-ae19-be835c7a54ca
2008-01-27 15:30:44 +00:00
shish
a5af8fecd2 opera 9.5 on linux works, on windows doesn't o_O. Go for pixels now then...
git-svn-id: file:///home/shish/svn/shimmie2/trunk@701 7f39781d-f577-437e-ae19-be835c7a54ca
2008-01-26 14:38:32 +00:00
shish
6434a60210 more user friendly installation, and check that they aren't opening the php files from the local hard drive...
git-svn-id: file:///home/shish/svn/shimmie2/trunk@700 7f39781d-f577-437e-ae19-be835c7a54ca
2008-01-26 13:14:30 +00:00
shish
8829f770ae remove upgrade from 0.8.X support, and allow sqlite to be used as a database
git-svn-id: file:///home/shish/svn/shimmie2/trunk@699 7f39781d-f577-437e-ae19-be835c7a54ca
2008-01-26 12:13:37 +00:00
shish
bf4a49a285 destroy thumbnail image objects, and a more verbose error message
git-svn-id: file:///home/shish/svn/shimmie2/trunk@698 7f39781d-f577-437e-ae19-be835c7a54ca
2008-01-26 11:40:50 +00:00
shish
1bdfb285c1 replace words
git-svn-id: file:///home/shish/svn/shimmie2/trunk@697 7f39781d-f577-437e-ae19-be835c7a54ca
2008-01-19 17:21:33 +00:00
shish
f38da63bca tag_history should check if anon is allowed to revert tags
git-svn-id: file:///home/shish/svn/shimmie2/trunk@695 7f39781d-f577-437e-ae19-be835c7a54ca
2008-01-19 17:14:13 +00:00
shish
0e4e5f02c8 filter html before anything else
git-svn-id: file:///home/shish/svn/shimmie2/trunk@694 7f39781d-f577-437e-ae19-be835c7a54ca
2008-01-12 07:44:08 +00:00
shish
52bdd38cfd more readable spoilers
git-svn-id: file:///home/shish/svn/shimmie2/trunk@693 7f39781d-f577-437e-ae19-be835c7a54ca
2008-01-12 07:30:50 +00:00
shish
3e25a08db2 safety wrapper for db->GetAll
git-svn-id: file:///home/shish/svn/shimmie2/trunk@690 7f39781d-f577-437e-ae19-be835c7a54ca
2008-01-05 00:22:19 +00:00
shish
0c639c1861 hack so that searching for 'a' doesn't list 'A' as an addable tag
git-svn-id: file:///home/shish/svn/shimmie2/trunk@689 7f39781d-f577-437e-ae19-be835c7a54ca
2008-01-05 00:17:12 +00:00
shish
4f58884187 update tag counts after bulk replace
git-svn-id: file:///home/shish/svn/shimmie2/trunk@688 7f39781d-f577-437e-ae19-be835c7a54ca
2008-01-04 23:39:47 +00:00
shish
c2d9f39e7e bookmarklet for direct transload
git-svn-id: file:///home/shish/svn/shimmie2/trunk@686 7f39781d-f577-437e-ae19-be835c7a54ca
2008-01-03 00:05:53 +00:00
shish
8ceac6ee19 fix transload in 2.2
git-svn-id: file:///home/shish/svn/shimmie2/trunk@685 7f39781d-f577-437e-ae19-be835c7a54ca
2008-01-03 00:05:11 +00:00
shish
7ae38e9ef6 check for javascript returning null
git-svn-id: file:///home/shish/svn/shimmie2/trunk@684 7f39781d-f577-437e-ae19-be835c7a54ca
2008-01-02 23:45:00 +00:00
shish
cecbfea5aa direct transload
git-svn-id: file:///home/shish/svn/shimmie2/trunk@683 7f39781d-f577-437e-ae19-be835c7a54ca
2008-01-02 23:20:20 +00:00
shish
b632c92d25 wget option for transloading
git-svn-id: file:///home/shish/svn/shimmie2/trunk@682 7f39781d-f577-437e-ae19-be835c7a54ca
2008-01-02 23:12:39 +00:00
shish
19d80a244f several SQLite compatability improvements, as suggested by naikoto on the forums
git-svn-id: file:///home/shish/svn/shimmie2/trunk@680 7f39781d-f577-437e-ae19-be835c7a54ca
2008-01-02 21:49:12 +00:00
shish
bcca76969e make get_base_href work better on windows
git-svn-id: file:///home/shish/svn/shimmie2/trunk@678 7f39781d-f577-437e-ae19-be835c7a54ca
2008-01-02 21:46:14 +00:00
shish
1f1987131d Don't die on deleted images, fixes #252
git-svn-id: file:///home/shish/svn/shimmie2/trunk@676 7f39781d-f577-437e-ae19-be835c7a54ca
2007-12-30 12:17:12 +00:00
shish
70b3d791d8 2.1 code moved to 2.1 branch
git-svn-id: file:///home/shish/svn/shimmie2/trunk@675 7f39781d-f577-437e-ae19-be835c7a54ca
2007-12-30 12:11:51 +00:00
shish
43dc8a6710 block name seeding
git-svn-id: file:///home/shish/svn/shimmie2/trunk@673 7f39781d-f577-437e-ae19-be835c7a54ca
2007-12-30 12:03:05 +00:00
shish
aa998fcc06 Argh PHP
git-svn-id: file:///home/shish/svn/shimmie2/trunk@671 7f39781d-f577-437e-ae19-be835c7a54ca
2007-12-30 11:49:58 +00:00
shish
ab682e87ee stars for list items
git-svn-id: file:///home/shish/svn/shimmie2/trunk@670 7f39781d-f577-437e-ae19-be835c7a54ca
2007-12-20 10:33:02 +00:00
shish
06aa7a266c as of php 5.2.5, no custom themelets = false, not array of length zero -_-
git-svn-id: file:///home/shish/svn/shimmie2/trunk@668 7f39781d-f577-437e-ae19-be835c7a54ca
2007-12-19 10:56:08 +00:00
shish
f580a8f922 no need to append
git-svn-id: file:///home/shish/svn/shimmie2/trunk@666 7f39781d-f577-437e-ae19-be835c7a54ca
2007-12-19 10:39:44 +00:00
shish
23dd70ae26 make sure the image exists when posting a comment to it...
git-svn-id: file:///home/shish/svn/shimmie2/trunk@664 7f39781d-f577-437e-ae19-be835c7a54ca
2007-12-18 14:04:56 +00:00
shish
efa7da6c1c layout
git-svn-id: file:///home/shish/svn/shimmie2/trunk@663 7f39781d-f577-437e-ae19-be835c7a54ca
2007-12-17 03:41:22 +00:00
shish
51f8d0891c comments needs some indexes
git-svn-id: file:///home/shish/svn/shimmie2/trunk@661 7f39781d-f577-437e-ae19-be835c7a54ca
2007-12-14 01:00:53 +00:00
shish
b2ef2502db proper tags, no need for loader hack?
git-svn-id: file:///home/shish/svn/shimmie2/trunk@660 7f39781d-f577-437e-ae19-be835c7a54ca
2007-12-13 23:27:22 +00:00
shish
b31a0fd1ac imagemagick SVG thumbnailing, but needs more version check...
git-svn-id: file:///home/shish/svn/shimmie2/trunk@659 7f39781d-f577-437e-ae19-be835c7a54ca
2007-12-11 22:47:55 +00:00
shish
c894fd2752 SVG handler
git-svn-id: file:///home/shish/svn/shimmie2/trunk@658 7f39781d-f577-437e-ae19-be835c7a54ca
2007-12-11 18:40:44 +00:00
shish
d1793a02ae CSS for blockquote
git-svn-id: file:///home/shish/svn/shimmie2/trunk@657 7f39781d-f577-437e-ae19-be835c7a54ca
2007-12-11 18:37:23 +00:00
shish
5b543e46ca comment
git-svn-id: file:///home/shish/svn/shimmie2/trunk@656 7f39781d-f577-437e-ae19-be835c7a54ca
2007-12-11 18:37:11 +00:00
shish
a811504a14 block quotes, arrow quotes, h1-4, ul, ol, li
git-svn-id: file:///home/shish/svn/shimmie2/trunk@654 7f39781d-f577-437e-ae19-be835c7a54ca
2007-12-10 08:51:54 +00:00
shish
c83ba877d3 word banning extension
git-svn-id: file:///home/shish/svn/shimmie2/trunk@653 7f39781d-f577-437e-ae19-be835c7a54ca
2007-12-09 05:18:13 +00:00
shish
babe924921 database dump part 1
git-svn-id: file:///home/shish/svn/shimmie2/trunk@646 7f39781d-f577-437e-ae19-be835c7a54ca
2007-12-08 18:44:52 +00:00
shish
7981e4014d much tag_history rearrangement, and a global history page
git-svn-id: file:///home/shish/svn/shimmie2/trunk@645 7f39781d-f577-437e-ae19-be835c7a54ca
2007-12-08 18:10:44 +00:00
shish
f0615591ec RSS for search results
git-svn-id: file:///home/shish/svn/shimmie2/trunk@644 7f39781d-f577-437e-ae19-be835c7a54ca
2007-12-08 17:30:17 +00:00
shish
64b9e1e25a Archive handler configurability
git-svn-id: file:///home/shish/svn/shimmie2/trunk@643 7f39781d-f577-437e-ae19-be835c7a54ca
2007-12-08 17:13:15 +00:00
shish
91e3eeff8d force tags to string
git-svn-id: file:///home/shish/svn/shimmie2/trunk@642 7f39781d-f577-437e-ae19-be835c7a54ca
2007-12-08 05:40:28 +00:00
shish
eef425f7bd make sure TagSetEvent is always referring to an array of tags, no matter the input
git-svn-id: file:///home/shish/svn/shimmie2/trunk@641 7f39781d-f577-437e-ae19-be835c7a54ca
2007-12-08 05:33:15 +00:00
shish
0634cdd73d ignore symlinks in bulk add, stops recursion
git-svn-id: file:///home/shish/svn/shimmie2/trunk@640 7f39781d-f577-437e-ae19-be835c7a54ca
2007-12-08 04:30:11 +00:00
shish
11c906b3fc save user ID and IP in tag change history
git-svn-id: file:///home/shish/svn/shimmie2/trunk@639 7f39781d-f577-437e-ae19-be835c7a54ca
2007-12-08 04:12:49 +00:00
shish
c697694c13 double underscore as tag separator
git-svn-id: file:///home/shish/svn/shimmie2/trunk@638 7f39781d-f577-437e-ae19-be835c7a54ca
2007-12-08 04:08:29 +00:00
shish
6d90231d50 Limit length of recent IP lists on user info page
git-svn-id: file:///home/shish/svn/shimmie2/trunk@637 7f39781d-f577-437e-ae19-be835c7a54ca
2007-12-08 03:23:53 +00:00
shish
cfb1bcb9e0 Use PHP's file handling functions rather than shell_exec
git-svn-id: file:///home/shish/svn/shimmie2/trunk@636 7f39781d-f577-437e-ae19-be835c7a54ca
2007-12-08 03:18:35 +00:00
shish
c85b5e0742 support .zip uploads, similar to bulk upload (ie, folder names used as tags)
git-svn-id: file:///home/shish/svn/shimmie2/trunk@635 7f39781d-f577-437e-ae19-be835c7a54ca
2007-12-08 03:10:07 +00:00
shish
4c495d80d9 Make bulk add use the generic data upload API
git-svn-id: file:///home/shish/svn/shimmie2/trunk@634 7f39781d-f577-437e-ae19-be835c7a54ca
2007-12-08 02:51:52 +00:00
shish
292c6a73a6 handle errors in the add-to-database part of uploads (eg hash collisons)
git-svn-id: file:///home/shish/svn/shimmie2/trunk@633 7f39781d-f577-437e-ae19-be835c7a54ca
2007-12-08 02:48:50 +00:00
shish
6c20105aff Vetoing a CommentPostedEvent should display veto reason as an error message
git-svn-id: file:///home/shish/svn/shimmie2/trunk@632 7f39781d-f577-437e-ae19-be835c7a54ca
2007-12-06 19:15:45 +00:00
shish
e7d7aa500f mp3 handler
git-svn-id: file:///home/shish/svn/shimmie2/trunk@631 7f39781d-f577-437e-ae19-be835c7a54ca
2007-12-06 11:53:43 +00:00
shish
1879898ab4 no need for core/*/*.php
git-svn-id: file:///home/shish/svn/shimmie2/trunk@630 7f39781d-f577-437e-ae19-be835c7a54ca
2007-12-06 11:16:59 +00:00
shish
db582a2d46 more documentation for code in core
git-svn-id: file:///home/shish/svn/shimmie2/trunk@629 7f39781d-f577-437e-ae19-be835c7a54ca
2007-12-06 11:01:18 +00:00
shish
60e89ef893 remove redundant code
git-svn-id: file:///home/shish/svn/shimmie2/trunk@628 7f39781d-f577-437e-ae19-be835c7a54ca
2007-12-06 10:47:09 +00:00
shish
87c31f432b move all events into event.class.php for neatness and more controlled load order
git-svn-id: file:///home/shish/svn/shimmie2/trunk@627 7f39781d-f577-437e-ae19-be835c7a54ca
2007-12-06 10:21:23 +00:00
shish
3662b38db4 note that this isn't The Right Way yet
git-svn-id: file:///home/shish/svn/shimmie2/trunk@626 7f39781d-f577-437e-ae19-be835c7a54ca
2007-12-06 03:21:30 +00:00
shish
02830d58b8 didn't notice the utility function needed moving too
git-svn-id: file:///home/shish/svn/shimmie2/trunk@625 7f39781d-f577-437e-ae19-be835c7a54ca
2007-12-06 03:09:42 +00:00
shish
18934b481c flash file handler
git-svn-id: file:///home/shish/svn/shimmie2/trunk@624 7f39781d-f577-437e-ae19-be835c7a54ca
2007-12-06 03:06:59 +00:00
shish
a5a6f4781c generic file handler support :)
git-svn-id: file:///home/shish/svn/shimmie2/trunk@623 7f39781d-f577-437e-ae19-be835c7a54ca
2007-12-06 02:26:34 +00:00
shish
0d126084ce move subclass to below main class, for consistency with later work
git-svn-id: file:///home/shish/svn/shimmie2/trunk@622 7f39781d-f577-437e-ae19-be835c7a54ca
2007-12-04 22:24:58 +00:00
shish
24e149428a standardise contrib extension meta-info headers
git-svn-id: file:///home/shish/svn/shimmie2/trunk@621 7f39781d-f577-437e-ae19-be835c7a54ca
2007-12-04 18:20:46 +00:00
shish
8398a1076b branch switcher UI (no functionality yet...)
git-svn-id: file:///home/shish/svn/shimmie2/trunk@620 7f39781d-f577-437e-ae19-be835c7a54ca
2007-12-04 18:18:13 +00:00
shish
18b97444d4 functionality
git-svn-id: file:///home/shish/svn/shimmie2/trunk@619 7f39781d-f577-437e-ae19-be835c7a54ca
2007-12-04 18:14:14 +00:00
shish
cf68910da1 Extension Manager part 1
git-svn-id: file:///home/shish/svn/shimmie2/trunk@618 7f39781d-f577-437e-ae19-be835c7a54ca
2007-12-02 17:50:03 +00:00
shish
6bfde75600 update from SVN button
git-svn-id: file:///home/shish/svn/shimmie2/trunk@617 7f39781d-f577-437e-ae19-be835c7a54ca
2007-12-02 17:09:29 +00:00
shish
614f11d910 One True Image Info Editor
git-svn-id: file:///home/shish/svn/shimmie2/trunk@616 7f39781d-f577-437e-ae19-be835c7a54ca
2007-11-14 10:11:56 +00:00
atg
078043b9bf Alright, this time it should actually work with RCx. It now requires a different theme file for RCx.
git-svn-id: file:///home/shish/svn/shimmie2/trunk@614 7f39781d-f577-437e-ae19-be835c7a54ca
2007-11-06 20:59:15 +00:00
atg
7958f19800 We're now using RC3 rather than RC2; however, this should be good for all (current) RCs.
git-svn-id: file:///home/shish/svn/shimmie2/trunk@613 7f39781d-f577-437e-ae19-be835c7a54ca
2007-11-06 20:20:22 +00:00
atg
8c78ca64f6 Added the option to display thumbnails, moved the reported image list to it's own page, and checked to make sure the user is an admin before letting them delete / view reported images.
git-svn-id: file:///home/shish/svn/shimmie2/trunk@612 7f39781d-f577-437e-ae19-be835c7a54ca
2007-11-06 20:17:14 +00:00
shish
ac2af2d1c0 ParseLinkTemplateEvent, and handlers for text_score, numeric_score and rating
git-svn-id: file:///home/shish/svn/shimmie2/trunk@611 7f39781d-f577-437e-ae19-be835c7a54ca
2007-11-04 08:16:41 +00:00
shish
d880c8cac0 massive user management cleanup, part 1
git-svn-id: file:///home/shish/svn/shimmie2/trunk@610 7f39781d-f577-437e-ae19-be835c7a54ca
2007-11-04 03:51:41 +00:00
shish
a2c08dfee6 apparently this works in safari, and the old version didn't
git-svn-id: file:///home/shish/svn/shimmie2/trunk@608 7f39781d-f577-437e-ae19-be835c7a54ca
2007-11-03 05:40:13 +00:00
shish
7af10fe562 new print_obj function from artanis
git-svn-id: file:///home/shish/svn/shimmie2/trunk@607 7f39781d-f577-437e-ae19-be835c7a54ca
2007-11-03 05:26:59 +00:00
shish
637712d72c dupe comment blocker
git-svn-id: file:///home/shish/svn/shimmie2/trunk@606 7f39781d-f577-437e-ae19-be835c7a54ca
2007-11-03 05:23:01 +00:00
Artanis
90c70bf7b3 Tagger v2 - 20071031 1430
- SQL escape broke matching. Fixed.

git-svn-id: file:///home/shish/svn/shimmie2/trunk@605 7f39781d-f577-437e-ae19-be835c7a54ca
2007-10-31 21:48:10 +00:00
Artanis
cf00965f26 Tagger v2 - 20071031 1430
- Add/Remove/Applied tag indicator images.
 - Rewrote JS to be neater.
 - Removed overly complicated and not-quite-functional search limiter in favor of slightly delaying query.
 - SQL escaping moved to PHP for safety.
 - Added option "Enable Tagger." Defaults false.
 - Added option "Delay queries by [$int] milliseconds." Delays AJAX using timeouts, waits for additional characters. Default 250.
 - Added option "Limit queries returning more than [$int] tags to [$int]." Limits server hit and client-side memory overhead. Defaults 30 and 30.

git-svn-id: file:///home/shish/svn/shimmie2/trunk@604 7f39781d-f577-437e-ae19-be835c7a54ca
2007-10-31 21:30:41 +00:00
shish
b97a7bf912 also apply that to trunk
git-svn-id: file:///home/shish/svn/shimmie2/trunk@603 7f39781d-f577-437e-ae19-be835c7a54ca
2007-10-28 18:10:29 +00:00
shish
1f3cb09c8d set version to 'trunk'
git-svn-id: file:///home/shish/svn/shimmie2/trunk@601 7f39781d-f577-437e-ae19-be835c7a54ca
2007-10-28 18:02:22 +00:00
shish
3a78f3f451 separate source_edit_anon from tag_edit_anon
git-svn-id: file:///home/shish/svn/shimmie2/trunk@598 7f39781d-f577-437e-ae19-be835c7a54ca
2007-10-28 17:59:56 +00:00
shish
0245870868 allow dots at the start of tags, as long as they're followed by letters; (for .hack)
git-svn-id: file:///home/shish/svn/shimmie2/trunk@596 7f39781d-f577-437e-ae19-be835c7a54ca
2007-10-28 17:49:45 +00:00
shish
bd69bd88b9 input validation for bulk tag replace (no spaces)
git-svn-id: file:///home/shish/svn/shimmie2/trunk@594 7f39781d-f577-437e-ae19-be835c7a54ca
2007-10-28 17:40:58 +00:00
shish
2d88fb75c2 mass tag replace: update -> update ignore + delete ignored
git-svn-id: file:///home/shish/svn/shimmie2/trunk@593 7f39781d-f577-437e-ae19-be835c7a54ca
2007-10-28 17:36:29 +00:00
shish
1e76d9de9d use WikiUpdateEvent
git-svn-id: file:///home/shish/svn/shimmie2/trunk@591 7f39781d-f577-437e-ae19-be835c7a54ca
2007-10-28 17:20:25 +00:00
shish
b48cd81da5 ignore wildcard-only searches
git-svn-id: file:///home/shish/svn/shimmie2/trunk@589 7f39781d-f577-437e-ae19-be835c7a54ca
2007-10-28 17:07:29 +00:00
shish
e6891f7da9 event counter
git-svn-id: file:///home/shish/svn/shimmie2/trunk@588 7f39781d-f577-437e-ae19-be835c7a54ca
2007-10-28 01:48:11 +00:00
shish
5199b9dc60 stricter tag sanitising
git-svn-id: file:///home/shish/svn/shimmie2/trunk@586 7f39781d-f577-437e-ae19-be835c7a54ca
2007-10-28 01:30:26 +00:00
shish
47dd9abeff only strip slashes on get, post, and cookie...
git-svn-id: file:///home/shish/svn/shimmie2/trunk@584 7f39781d-f577-437e-ae19-be835c7a54ca
2007-10-28 00:07:33 +00:00
shish
d2c1ec66a9 if source is empty, set it to null
git-svn-id: file:///home/shish/svn/shimmie2/trunk@582 7f39781d-f577-437e-ae19-be835c7a54ca
2007-10-27 23:53:48 +00:00
shish
25509b15b8 set default theme to 'default'
git-svn-id: file:///home/shish/svn/shimmie2/trunk@580 7f39781d-f577-437e-ae19-be835c7a54ca
2007-10-27 23:40:19 +00:00
shish
501ecb1201 Don't show comments section if zero comments and no postbox
git-svn-id: file:///home/shish/svn/shimmie2/trunk@578 7f39781d-f577-437e-ae19-be835c7a54ca
2007-10-27 23:32:39 +00:00
atg
5bf7298e0a This should work now. Be sure to read the header for both files, depending on what version of Shimmie you're using.
git-svn-id: file:///home/shish/svn/shimmie2/trunk@577 7f39781d-f577-437e-ae19-be835c7a54ca
2007-10-27 23:15:25 +00:00
atg
6703079fa4 Now with support for Shimmie2 RC2 (and perhaps earlier versions)
git-svn-id: file:///home/shish/svn/shimmie2/trunk@576 7f39781d-f577-437e-ae19-be835c7a54ca
2007-10-27 23:01:41 +00:00
atg
aeee6636fd Initial version of the Browser Search plugin (with search suggestions\!)
git-svn-id: file:///home/shish/svn/shimmie2/trunk@575 7f39781d-f577-437e-ae19-be835c7a54ca
2007-10-27 22:17:53 +00:00
shish
862e5276ec adding a blank folder for ATG's browser search
git-svn-id: file:///home/shish/svn/shimmie2/trunk@574 7f39781d-f577-437e-ae19-be835c7a54ca
2007-10-27 19:42:38 +00:00
shish
56d05dbd8d tidy up index.php, and fix magic quotes
git-svn-id: file:///home/shish/svn/shimmie2/trunk@572 7f39781d-f577-437e-ae19-be835c7a54ca
2007-10-27 19:38:13 +00:00
Artanis
3aaf13887b Tagger v2
git-svn-id: file:///home/shish/svn/shimmie2/trunk@571 7f39781d-f577-437e-ae19-be835c7a54ca
2007-10-26 02:55:40 +00:00
shish
1cacc2d247 make build_thumb_html be part of the themelet class
git-svn-id: file:///home/shish/svn/shimmie2/trunk@570 7f39781d-f577-437e-ae19-be835c7a54ca
2007-10-26 01:35:53 +00:00
atg
13383a56fe Fixed SQL issue
git-svn-id: file:///home/shish/svn/shimmie2/trunk@569 7f39781d-f577-437e-ae19-be835c7a54ca
2007-10-24 23:52:44 +00:00
atg
e4e9c34297 Initial version of report_image extention
git-svn-id: file:///home/shish/svn/shimmie2/trunk@568 7f39781d-f577-437e-ae19-be835c7a54ca
2007-10-24 21:45:38 +00:00
shish
917609636e blank folder for ATG's report_image
git-svn-id: file:///home/shish/svn/shimmie2/trunk@567 7f39781d-f577-437e-ae19-be835c7a54ca
2007-10-24 21:02:38 +00:00
shish
f4a41d0b58 Separate database support error from table creation error; give a more appropriate message when the database isn't supported
git-svn-id: file:///home/shish/svn/shimmie2/trunk@566 7f39781d-f577-437e-ae19-be835c7a54ca
2007-10-24 18:16:54 +00:00
shish
c47e15c01b filetype search from ATravelingGeek
git-svn-id: file:///home/shish/svn/shimmie2/trunk@564 7f39781d-f577-437e-ae19-be835c7a54ca
2007-10-24 18:09:41 +00:00
Artanis
c98f61496c Tagger v2 20071023 1603 - Dragging enabled
git-svn-id: file:///home/shish/svn/shimmie2/trunk@563 7f39781d-f577-437e-ae19-be835c7a54ca
2007-10-23 23:03:41 +00:00
Artanis
ae947698cd Removing old files
git-svn-id: file:///home/shish/svn/shimmie2/trunk@562 7f39781d-f577-437e-ae19-be835c7a54ca
2007-10-23 22:08:46 +00:00
Artanis
5d273e6879 Tagger 20071023 1507 - Moving alpha2 to RC - still no dragging
git-svn-id: file:///home/shish/svn/shimmie2/trunk@561 7f39781d-f577-437e-ae19-be835c7a54ca
2007-10-23 22:08:22 +00:00
Artanis
bcb5eecc56 git-svn-id: file:///home/shish/svn/shimmie2/trunk@560 7f39781d-f577-437e-ae19-be835c7a54ca 2007-10-23 20:52:53 +00:00
Artanis
ecf4ae1030 git-svn-id: file:///home/shish/svn/shimmie2/trunk@559 7f39781d-f577-437e-ae19-be835c7a54ca 2007-10-23 20:38:02 +00:00
shish
8c2001ef6f and working for anonymous...
git-svn-id: file:///home/shish/svn/shimmie2/trunk@558 7f39781d-f577-437e-ae19-be835c7a54ca
2007-10-22 03:17:08 +00:00
jjs
68efee3e22 [danbooru api] now danbooruup 0.3.2 should actually work
git-svn-id: file:///home/shish/svn/shimmie2/trunk@557 7f39781d-f577-437e-ae19-be835c7a54ca
2007-10-22 02:09:32 +00:00
shish
24c2311cba md5: search for danbooru compatability
git-svn-id: file:///home/shish/svn/shimmie2/trunk@556 7f39781d-f577-437e-ae19-be835c7a54ca
2007-10-22 00:40:10 +00:00
shish
e2127e9ca9 brain fail
git-svn-id: file:///home/shish/svn/shimmie2/trunk@554 7f39781d-f577-437e-ae19-be835c7a54ca
2007-10-22 00:33:00 +00:00
atg
2ec655e162 Initial commit
git-svn-id: file:///home/shish/svn/shimmie2/trunk@553 7f39781d-f577-437e-ae19-be835c7a54ca
2007-10-22 00:13:57 +00:00
shish
cd176f9b19 use default theme if selected theme doesn't exist
git-svn-id: file:///home/shish/svn/shimmie2/trunk@551 7f39781d-f577-437e-ae19-be835c7a54ca
2007-10-22 00:04:41 +00:00
shish
380d13f3c9 add an empty folder for atg's image_hash_ban extension
git-svn-id: file:///home/shish/svn/shimmie2/trunk@550 7f39781d-f577-437e-ae19-be835c7a54ca
2007-10-21 23:58:03 +00:00
shish
8d991a14e8 remove bans by ID. Also, show who banned whom
git-svn-id: file:///home/shish/svn/shimmie2/trunk@548 7f39781d-f577-437e-ae19-be835c7a54ca
2007-10-21 23:31:23 +00:00
shish
2c43a4f420 clean up votes when images are deleted
git-svn-id: file:///home/shish/svn/shimmie2/trunk@547 7f39781d-f577-437e-ae19-be835c7a54ca
2007-10-21 23:12:49 +00:00
shish
c11d39f5b7 no need for admin
git-svn-id: file:///home/shish/svn/shimmie2/trunk@546 7f39781d-f577-437e-ae19-be835c7a54ca
2007-10-21 23:04:48 +00:00
shish
1192a6d123 mysql-specificness :<
git-svn-id: file:///home/shish/svn/shimmie2/trunk@545 7f39781d-f577-437e-ae19-be835c7a54ca
2007-10-21 22:59:47 +00:00
shish
8719156d61 wrong column
git-svn-id: file:///home/shish/svn/shimmie2/trunk@544 7f39781d-f577-437e-ae19-be835c7a54ca
2007-10-21 22:45:12 +00:00
shish
a2551cf3eb Anonymous toggle for voting things
git-svn-id: file:///home/shish/svn/shimmie2/trunk@543 7f39781d-f577-437e-ae19-be835c7a54ca
2007-10-21 22:43:35 +00:00
shish
252bea060d things work now
git-svn-id: file:///home/shish/svn/shimmie2/trunk@542 7f39781d-f577-437e-ae19-be835c7a54ca
2007-10-21 22:35:47 +00:00
shish
a9d1671d17 more score stuff
git-svn-id: file:///home/shish/svn/shimmie2/trunk@541 7f39781d-f577-437e-ae19-be835c7a54ca
2007-10-21 22:29:54 +00:00
shish
c537a2f5ae rename
git-svn-id: file:///home/shish/svn/shimmie2/trunk@540 7f39781d-f577-437e-ae19-be835c7a54ca
2007-10-21 22:21:12 +00:00
shish
7b289c3354 splitting
git-svn-id: file:///home/shish/svn/shimmie2/trunk@539 7f39781d-f577-437e-ae19-be835c7a54ca
2007-10-21 22:20:31 +00:00
shish
7b621d6a8e two score extensions
git-svn-id: file:///home/shish/svn/shimmie2/trunk@538 7f39781d-f577-437e-ae19-be835c7a54ca
2007-10-21 22:06:34 +00:00
shish
c52f24e988 moo
git-svn-id: file:///home/shish/svn/shimmie2/trunk@537 7f39781d-f577-437e-ae19-be835c7a54ca
2007-10-21 22:05:32 +00:00
shish
437262951b rename column to stop conflict with search_score
git-svn-id: file:///home/shish/svn/shimmie2/trunk@536 7f39781d-f577-437e-ae19-be835c7a54ca
2007-10-21 17:18:31 +00:00
shish
dc9181fc24 re-inline error_check, since it only works inline...
git-svn-id: file:///home/shish/svn/shimmie2/trunk@535 7f39781d-f577-437e-ae19-be835c7a54ca
2007-10-21 17:13:57 +00:00
Artanis
94b26de5b1 Tagger v2-alpha 20071021 0113
git-svn-id: file:///home/shish/svn/shimmie2/trunk@534 7f39781d-f577-437e-ae19-be835c7a54ca
2007-10-21 08:13:37 +00:00
jjs
e89234db75 danbooru api: remove extra newline at end of file
git-svn-id: file:///home/shish/svn/shimmie2/trunk@533 7f39781d-f577-437e-ae19-be835c7a54ca
2007-10-20 04:33:35 +00:00
jjs
b3212c2872 danbooru api: #211 partial compatibility update
git-svn-id: file:///home/shish/svn/shimmie2/trunk@532 7f39781d-f577-437e-ae19-be835c7a54ca
2007-10-19 21:59:16 +00:00
shish
98a0154db2 alias csv export fixed
git-svn-id: file:///home/shish/svn/shimmie2/trunk@530 7f39781d-f577-437e-ae19-be835c7a54ca
2007-10-18 02:35:01 +00:00
shish
6344c8f3e2 more features, more todos
git-svn-id: file:///home/shish/svn/shimmie2/trunk@529 7f39781d-f577-437e-ae19-be835c7a54ca
2007-10-18 02:29:39 +00:00
shish
0e937d4af0 RatingSetEvent
git-svn-id: file:///home/shish/svn/shimmie2/trunk@528 7f39781d-f577-437e-ae19-be835c7a54ca
2007-10-18 02:04:22 +00:00
shish
46ba77fa67 Score extension
git-svn-id: file:///home/shish/svn/shimmie2/trunk@527 7f39781d-f577-437e-ae19-be835c7a54ca
2007-10-18 01:21:55 +00:00
shish
a7ea9bb397 Add a new set of counters created by PandaKnickers, and made officially available for everyone to use
git-svn-id: file:///home/shish/svn/shimmie2/trunk@525 7f39781d-f577-437e-ae19-be835c7a54ca
2007-10-18 00:51:58 +00:00
Artanis
5c86676560 git-svn-id: file:///home/shish/svn/shimmie2/trunk@524 7f39781d-f577-437e-ae19-be835c7a54ca 2007-10-17 03:01:17 +00:00
Artanis
2519b01bf5 Tagger v2-alpha 20071016 1955
git-svn-id: file:///home/shish/svn/shimmie2/trunk@523 7f39781d-f577-437e-ae19-be835c7a54ca
2007-10-17 02:57:06 +00:00
Artanis
bd07cd618b git-svn-id: file:///home/shish/svn/shimmie2/trunk@522 7f39781d-f577-437e-ae19-be835c7a54ca 2007-10-07 09:50:41 +00:00
Artanis
f216ddd1b6 Tagger v2-alpha-2 20071007 0015
Tag listing should work in Safari/Konq

git-svn-id: file:///home/shish/svn/shimmie2/trunk@521 7f39781d-f577-437e-ae19-be835c7a54ca
2007-10-07 07:16:33 +00:00
Artanis
8728191b69 Tagger v2 alpha 20071005 0102
git-svn-id: file:///home/shish/svn/shimmie2/trunk@520 7f39781d-f577-437e-ae19-be835c7a54ca
2007-10-05 08:02:45 +00:00
Artanis
8aa36195d4 Tagger v2 alpha 20071004 2359
git-svn-id: file:///home/shish/svn/shimmie2/trunk@519 7f39781d-f577-437e-ae19-be835c7a54ca
2007-10-05 07:00:14 +00:00
shish
af6f7f00fc compat with stable
git-svn-id: file:///home/shish/svn/shimmie2/trunk@518 7f39781d-f577-437e-ae19-be835c7a54ca
2007-10-02 23:44:50 +00:00
shish
bd1ba12cfc version number
git-svn-id: file:///home/shish/svn/shimmie2/trunk@517 7f39781d-f577-437e-ae19-be835c7a54ca
2007-10-02 23:37:04 +00:00
shish
7dda59a4d9 options
git-svn-id: file:///home/shish/svn/shimmie2/trunk@516 7f39781d-f577-437e-ae19-be835c7a54ca
2007-10-02 23:20:23 +00:00
Artanis
b8fbd4671d Tagger 20071002 1526
git-svn-id: file:///home/shish/svn/shimmie2/trunk@515 7f39781d-f577-437e-ae19-be835c7a54ca
2007-10-02 22:51:00 +00:00
shish
5b6ca92d4f more misc work
git-svn-id: file:///home/shish/svn/shimmie2/trunk@514 7f39781d-f577-437e-ae19-be835c7a54ca
2007-10-02 22:29:32 +00:00
Artanis
c30fee9f0b Tagger 20071002 1526
git-svn-id: file:///home/shish/svn/shimmie2/trunk@513 7f39781d-f577-437e-ae19-be835c7a54ca
2007-10-02 22:27:09 +00:00
shish
1e44f93c1f allow people to add columns to the images table, then use them
git-svn-id: file:///home/shish/svn/shimmie2/trunk@511 7f39781d-f577-437e-ae19-be835c7a54ca
2007-10-02 22:23:29 +00:00
shish
0466bdd66d most of the rating-setting code done
git-svn-id: file:///home/shish/svn/shimmie2/trunk@510 7f39781d-f577-437e-ae19-be835c7a54ca
2007-10-02 21:59:20 +00:00
shish
96a09f014a ratings -> scores, so ratings can be something else
git-svn-id: file:///home/shish/svn/shimmie2/trunk@509 7f39781d-f577-437e-ae19-be835c7a54ca
2007-10-02 21:06:33 +00:00
Artanis
4716ebe79d Tagger 20071002 1144
git-svn-id: file:///home/shish/svn/shimmie2/trunk@508 7f39781d-f577-437e-ae19-be835c7a54ca
2007-10-02 18:44:29 +00:00
Artanis
49606dad70 Tagger 20071001 1235 - Stupid mistake fix
git-svn-id: file:///home/shish/svn/shimmie2/trunk@507 7f39781d-f577-437e-ae19-be835c7a54ca
2007-10-01 19:36:28 +00:00
Artanis
341182efb2 Tagger : 20070930 1232 - fixed DOM scripting
git-svn-id: file:///home/shish/svn/shimmie2/trunk@506 7f39781d-f577-437e-ae19-be835c7a54ca
2007-09-30 19:32:40 +00:00
Artanis
ced91f14dd Tagger: 20070930 0153
git-svn-id: file:///home/shish/svn/shimmie2/trunk@505 7f39781d-f577-437e-ae19-be835c7a54ca
2007-09-30 08:53:47 +00:00
shish
6f69f52614 comment this out, just to make sure it's not used
git-svn-id: file:///home/shish/svn/shimmie2/trunk@504 7f39781d-f577-437e-ae19-be835c7a54ca
2007-09-29 22:53:42 +00:00
shish
7a936d41cf set curl user agent and referrer
git-svn-id: file:///home/shish/svn/shimmie2/trunk@502 7f39781d-f577-437e-ae19-be835c7a54ca
2007-09-29 22:48:33 +00:00
shish
ef1a82043d fix bulk add, from ATravelingGeek
git-svn-id: file:///home/shish/svn/shimmie2/trunk@499 7f39781d-f577-437e-ae19-be835c7a54ca
2007-09-29 00:14:00 +00:00
Artanis
773b51fce7 Tagger: 20070928 1426
git-svn-id: file:///home/shish/svn/shimmie2/trunk@498 7f39781d-f577-437e-ae19-be835c7a54ca
2007-09-28 21:26:59 +00:00
Artanis
ef0e4190cc Tagger 20070927 2209
+onload.gif because I needed window.onload and core_scripts/scripts.js hogged it. Getting by with img.onload.

git-svn-id: file:///home/shish/svn/shimmie2/trunk@497 7f39781d-f577-437e-ae19-be835c7a54ca
2007-09-28 05:10:44 +00:00
Artanis
e365e945a8 Tagger: 20070927 1106
git-svn-id: file:///home/shish/svn/shimmie2/trunk@496 7f39781d-f577-437e-ae19-be835c7a54ca
2007-09-27 18:06:58 +00:00
Artanis
bc42c756b1 Tagger: 20070927 0150
git-svn-id: file:///home/shish/svn/shimmie2/trunk@495 7f39781d-f577-437e-ae19-be835c7a54ca
2007-09-27 08:52:10 +00:00
Artanis
27473f272a Tagger 20070926 0240
git-svn-id: file:///home/shish/svn/shimmie2/trunk@494 7f39781d-f577-437e-ae19-be835c7a54ca
2007-09-26 09:40:51 +00:00
Artanis
aa2d6537de [ext | tagger]
git-svn-id: file:///home/shish/svn/shimmie2/trunk@493 7f39781d-f577-437e-ae19-be835c7a54ca
2007-09-26 07:23:16 +00:00
Artanis
de599ea131 [Tagger] Update
git-svn-id: file:///home/shish/svn/shimmie2/trunk@492 7f39781d-f577-437e-ae19-be835c7a54ca
2007-09-25 21:28:09 +00:00
shish
b9b36f3205 adding tagger extension
git-svn-id: file:///home/shish/svn/shimmie2/trunk@491 7f39781d-f577-437e-ae19-be835c7a54ca
2007-09-25 10:16:26 +00:00
shish
f981b8cc79 shimmie and schema versions
git-svn-id: file:///home/shish/svn/shimmie2/trunk@489 7f39781d-f577-437e-ae19-be835c7a54ca
2007-09-18 09:21:58 +00:00
jjs
a3cec6cac9 danbooru api: fix #174, also fix for changed UploadingImageEvent
git-svn-id: file:///home/shish/svn/shimmie2/trunk@488 7f39781d-f577-437e-ae19-be835c7a54ca
2007-08-30 14:01:36 +00:00
shish
5c73eca9ed this fixes things :3
git-svn-id: file:///home/shish/svn/shimmie2/trunk@487 7f39781d-f577-437e-ae19-be835c7a54ca
2007-08-27 23:52:33 +00:00
shish
3a04d47416 fix for downtime
git-svn-id: file:///home/shish/svn/shimmie2/trunk@485 7f39781d-f577-437e-ae19-be835c7a54ca
2007-08-27 23:43:20 +00:00
shish
825db240de foreach ftw
git-svn-id: file:///home/shish/svn/shimmie2/trunk@483 7f39781d-f577-437e-ae19-be835c7a54ca
2007-08-27 23:24:57 +00:00
shish
e910df8e6b patch from Shuugo; Danbooru theme uses CSS rather than a table
git-svn-id: file:///home/shish/svn/shimmie2/trunk@482 7f39781d-f577-437e-ae19-be835c7a54ca
2007-08-27 23:02:03 +00:00
shish
24f94fe84d whitspace fix
git-svn-id: file:///home/shish/svn/shimmie2/trunk@481 7f39781d-f577-437e-ae19-be835c7a54ca
2007-08-27 22:59:58 +00:00
shish
88336cc323 less global user, more event->user
git-svn-id: file:///home/shish/svn/shimmie2/trunk@478 7f39781d-f577-437e-ae19-be835c7a54ca
2007-08-24 22:29:34 +00:00
shish
6993bc2fdf html_escape for log messages, just in case...
git-svn-id: file:///home/shish/svn/shimmie2/trunk@477 7f39781d-f577-437e-ae19-be835c7a54ca
2007-08-24 22:28:00 +00:00
shish
fcbe91e1fa log image uploads
git-svn-id: file:///home/shish/svn/shimmie2/trunk@476 7f39781d-f577-437e-ae19-be835c7a54ca
2007-08-24 17:17:52 +00:00
shish
9def895268 log comment posts
git-svn-id: file:///home/shish/svn/shimmie2/trunk@475 7f39781d-f577-437e-ae19-be835c7a54ca
2007-08-24 17:03:04 +00:00
shish
f78094ebc5 CommentPostingEvent
git-svn-id: file:///home/shish/svn/shimmie2/trunk@474 7f39781d-f577-437e-ae19-be835c7a54ca
2007-08-24 17:02:45 +00:00
shish
d90004469f filtering
git-svn-id: file:///home/shish/svn/shimmie2/trunk@473 7f39781d-f577-437e-ae19-be835c7a54ca
2007-08-24 13:54:51 +00:00
shish
e98e4e31d5 better sorting
git-svn-id: file:///home/shish/svn/shimmie2/trunk@472 7f39781d-f577-437e-ae19-be835c7a54ca
2007-08-24 13:41:43 +00:00
shish
2240262205 table reorganised, larger font, sorting
git-svn-id: file:///home/shish/svn/shimmie2/trunk@471 7f39781d-f577-437e-ae19-be835c7a54ca
2007-08-24 13:35:48 +00:00
shish
2834a7bb48 user names
git-svn-id: file:///home/shish/svn/shimmie2/trunk@470 7f39781d-f577-437e-ae19-be835c7a54ca
2007-08-23 22:48:33 +00:00
shish
0c2ed967f8 event log extension
git-svn-id: file:///home/shish/svn/shimmie2/trunk@469 7f39781d-f577-437e-ae19-be835c7a54ca
2007-08-23 18:49:59 +00:00
shish
4191df847f danbooru theme to 2.1
git-svn-id: file:///home/shish/svn/shimmie2/trunk@467 7f39781d-f577-437e-ae19-be835c7a54ca
2007-08-23 11:15:18 +00:00
shish
862e647365 theme engine 2.1
git-svn-id: file:///home/shish/svn/shimmie2/trunk@466 7f39781d-f577-437e-ae19-be835c7a54ca
2007-08-23 11:14:03 +00:00
shish
619238308f php4 compat
git-svn-id: file:///home/shish/svn/shimmie2/trunk@465 7f39781d-f577-437e-ae19-be835c7a54ca
2007-08-22 10:40:00 +00:00
shish
a41bf10142 php4 compat
git-svn-id: file:///home/shish/svn/shimmie2/trunk@464 7f39781d-f577-437e-ae19-be835c7a54ca
2007-08-22 10:39:17 +00:00
shish
6780ebf6d2 Licence note in README
git-svn-id: file:///home/shish/svn/shimmie2/trunk@461 7f39781d-f577-437e-ae19-be835c7a54ca
2007-08-15 12:15:26 +00:00
shish
316bc49cb2 rss indent
git-svn-id: file:///home/shish/svn/shimmie2/trunk@459 7f39781d-f577-437e-ae19-be835c7a54ca
2007-08-15 11:47:43 +00:00
shish
e7a7617ae6 rss generator string
git-svn-id: file:///home/shish/svn/shimmie2/trunk@458 7f39781d-f577-437e-ae19-be835c7a54ca
2007-08-15 11:45:36 +00:00
shish
3404d137bc version number
git-svn-id: file:///home/shish/svn/shimmie2/trunk@456 7f39781d-f577-437e-ae19-be835c7a54ca
2007-08-14 03:17:50 +00:00
shish
8009aa3fa8 make multi tag search not break on space
git-svn-id: file:///home/shish/svn/shimmie2/trunk@454 7f39781d-f577-437e-ae19-be835c7a54ca
2007-08-08 06:24:25 +00:00
shish
5444810cae cache tag map data
git-svn-id: file:///home/shish/svn/shimmie2/trunk@453 7f39781d-f577-437e-ae19-be835c7a54ca
2007-08-08 06:17:15 +00:00
shish
0b555d0926 error check for cache query
git-svn-id: file:///home/shish/svn/shimmie2/trunk@452 7f39781d-f577-437e-ae19-be835c7a54ca
2007-08-08 06:16:13 +00:00
shish
ea65ce6605 cacheyness
git-svn-id: file:///home/shish/svn/shimmie2/trunk@451 7f39781d-f577-437e-ae19-be835c7a54ca
2007-08-08 05:47:23 +00:00
shish
ad283be35f exact match for ip ban
git-svn-id: file:///home/shish/svn/shimmie2/trunk@450 7f39781d-f577-437e-ae19-be835c7a54ca
2007-08-08 05:18:54 +00:00
shish
5e041c1136 only check IP ban once per page load
git-svn-id: file:///home/shish/svn/shimmie2/trunk@449 7f39781d-f577-437e-ae19-be835c7a54ca
2007-08-08 05:16:16 +00:00
shish
b64ac2128e enable adodb caching
git-svn-id: file:///home/shish/svn/shimmie2/trunk@448 7f39781d-f577-437e-ae19-be835c7a54ca
2007-08-08 04:53:55 +00:00
shish
ff6d0781d2 LIMIT ?,? -> LIMIT ? OFFSET ? -- more compatability
git-svn-id: file:///home/shish/svn/shimmie2/trunk@447 7f39781d-f577-437e-ae19-be835c7a54ca
2007-08-06 23:59:27 +00:00
shish
8f2cf32193 Postgres install code
git-svn-id: file:///home/shish/svn/shimmie2/trunk@446 7f39781d-f577-437e-ae19-be835c7a54ca
2007-08-06 23:55:47 +00:00
shish
1a7895f835 postgres driver seems to use this :3
git-svn-id: file:///home/shish/svn/shimmie2/trunk@445 7f39781d-f577-437e-ae19-be835c7a54ca
2007-08-06 23:10:58 +00:00
shish
4880bc645d embedded style for installer
git-svn-id: file:///home/shish/svn/shimmie2/trunk@444 7f39781d-f577-437e-ae19-be835c7a54ca
2007-08-06 23:09:13 +00:00
shish
810fd0148a this should have been gone a while ago :S
git-svn-id: file:///home/shish/svn/shimmie2/trunk@442 7f39781d-f577-437e-ae19-be835c7a54ca
2007-08-06 21:27:55 +00:00
shish
18cd7d0097 postgres adodb drivers
git-svn-id: file:///home/shish/svn/shimmie2/trunk@441 7f39781d-f577-437e-ae19-be835c7a54ca
2007-08-06 21:03:58 +00:00
shish
2fd0313840 linky~
git-svn-id: file:///home/shish/svn/shimmie2/trunk@440 7f39781d-f577-437e-ae19-be835c7a54ca
2007-08-06 19:36:56 +00:00
shish
4573150131 left-align tables properly
git-svn-id: file:///home/shish/svn/shimmie2/trunk@436 7f39781d-f577-437e-ae19-be835c7a54ca
2007-08-06 19:24:42 +00:00
shish
461e56eb00 commas~
git-svn-id: file:///home/shish/svn/shimmie2/trunk@435 7f39781d-f577-437e-ae19-be835c7a54ca
2007-08-06 19:16:34 +00:00
shish
db2125866b left align for source / tag edit in danbooru theme
git-svn-id: file:///home/shish/svn/shimmie2/trunk@434 7f39781d-f577-437e-ae19-be835c7a54ca
2007-08-06 19:13:15 +00:00
shish
aba5089ee4 remove whitespace
git-svn-id: file:///home/shish/svn/shimmie2/trunk@433 7f39781d-f577-437e-ae19-be835c7a54ca
2007-08-06 19:02:37 +00:00
shish
e6d3bb0e13 check that source is some sort of url
git-svn-id: file:///home/shish/svn/shimmie2/trunk@432 7f39781d-f577-437e-ae19-be835c7a54ca
2007-08-06 18:45:27 +00:00
shish
4d626b59e5 shorthand ints for display~
git-svn-id: file:///home/shish/svn/shimmie2/trunk@431 7f39781d-f577-437e-ae19-be835c7a54ca
2007-08-06 18:37:12 +00:00
shish
86e21c3840 turn debug off
git-svn-id: file:///home/shish/svn/shimmie2/trunk@428 7f39781d-f577-437e-ae19-be835c7a54ca
2007-08-05 22:18:28 +00:00
shish
f6c4f405ef readme
git-svn-id: file:///home/shish/svn/shimmie2/trunk@427 7f39781d-f577-437e-ae19-be835c7a54ca
2007-08-05 22:18:12 +00:00
shish
61d188753f 2.1-rc1
git-svn-id: file:///home/shish/svn/shimmie2/trunk@425 7f39781d-f577-437e-ae19-be835c7a54ca
2007-08-05 22:03:56 +00:00
shish
0e25e00d92 argh. 20 ways of finding the install folder, and none of them work -_-
git-svn-id: file:///home/shish/svn/shimmie2/trunk@424 7f39781d-f577-437e-ae19-be835c7a54ca
2007-08-05 22:03:43 +00:00
shish
1b80e80aa8 left aligned comments, again
git-svn-id: file:///home/shish/svn/shimmie2/trunk@423 7f39781d-f577-437e-ae19-be835c7a54ca
2007-08-03 17:15:52 +00:00
shish
064bd7fd01 Use the veto error message, not adding blocks from within main.php
git-svn-id: file:///home/shish/svn/shimmie2/trunk@422 7f39781d-f577-437e-ae19-be835c7a54ca
2007-08-02 20:49:25 +00:00
shish
15ee93bf9b make sure source is something sensible
git-svn-id: file:///home/shish/svn/shimmie2/trunk@421 7f39781d-f577-437e-ae19-be835c7a54ca
2007-08-02 20:38:46 +00:00
shish
25b1ebad8b search user rather than poster; everything else refers to 'user'
git-svn-id: file:///home/shish/svn/shimmie2/trunk@420 7f39781d-f577-437e-ae19-be835c7a54ca
2007-08-02 19:57:40 +00:00
shish
4fdecf9677 unix line endings
git-svn-id: file:///home/shish/svn/shimmie2/trunk@419 7f39781d-f577-437e-ae19-be835c7a54ca
2007-08-02 17:10:17 +00:00
shish
61bfd795b3 php also fails at various other things
git-svn-id: file:///home/shish/svn/shimmie2/trunk@418 7f39781d-f577-437e-ae19-be835c7a54ca
2007-08-02 17:08:48 +00:00
shish
5d1541efe0 php4 fails at heredoc
git-svn-id: file:///home/shish/svn/shimmie2/trunk@417 7f39781d-f577-437e-ae19-be835c7a54ca
2007-08-02 17:07:26 +00:00
shish
1c8619d9e9 Image and comment counts not shown for user #0
git-svn-id: file:///home/shish/svn/shimmie2/trunk@416 7f39781d-f577-437e-ae19-be835c7a54ca
2007-08-02 15:10:09 +00:00
shish
87722ff98a proper link
git-svn-id: file:///home/shish/svn/shimmie2/trunk@415 7f39781d-f577-437e-ae19-be835c7a54ca
2007-08-01 17:31:30 +00:00
shish
e171fc98de danbooru theme tweaks
git-svn-id: file:///home/shish/svn/shimmie2/trunk@414 7f39781d-f577-437e-ae19-be835c7a54ca
2007-08-01 17:24:34 +00:00
shish
ff5f41c91e optional user links on user page
git-svn-id: file:///home/shish/svn/shimmie2/trunk@413 7f39781d-f577-437e-ae19-be835c7a54ca
2007-08-01 17:11:46 +00:00
shish
f36c783868 source url editor
git-svn-id: file:///home/shish/svn/shimmie2/trunk@412 7f39781d-f577-437e-ae19-be835c7a54ca
2007-08-01 16:58:50 +00:00
shish
19ef368480 hide 404 error, we'll deal with it elsewhere
git-svn-id: file:///home/shish/svn/shimmie2/trunk@411 7f39781d-f577-437e-ae19-be835c7a54ca
2007-08-01 16:26:56 +00:00
shish
6a38e7f6f2 One True Debug Switch
git-svn-id: file:///home/shish/svn/shimmie2/trunk@410 7f39781d-f577-437e-ae19-be835c7a54ca
2007-08-01 16:24:34 +00:00
shish
278ce1e71a hax
git-svn-id: file:///home/shish/svn/shimmie2/trunk@409 7f39781d-f577-437e-ae19-be835c7a54ca
2007-08-01 16:21:14 +00:00
shish
0c1ccb73ca default links moved to initextevent
git-svn-id: file:///home/shish/svn/shimmie2/trunk@408 7f39781d-f577-437e-ae19-be835c7a54ca
2007-08-01 16:19:25 +00:00
shish
3641010de1 bad defaults
git-svn-id: file:///home/shish/svn/shimmie2/trunk@407 7f39781d-f577-437e-ae19-be835c7a54ca
2007-08-01 16:16:10 +00:00
shish
c6d99464aa default base_href set in initext
git-svn-id: file:///home/shish/svn/shimmie2/trunk@406 7f39781d-f577-437e-ae19-be835c7a54ca
2007-08-01 16:12:34 +00:00
shish
7b9a8f83eb empty email = NULL
git-svn-id: file:///home/shish/svn/shimmie2/trunk@405 7f39781d-f577-437e-ae19-be835c7a54ca
2007-08-01 16:01:33 +00:00
shish
96953c55b2 fix search for whitespace
git-svn-id: file:///home/shish/svn/shimmie2/trunk@404 7f39781d-f577-437e-ae19-be835c7a54ca
2007-08-01 15:52:46 +00:00
shish
b8483ba015 rss triggered by PostListBuilding
git-svn-id: file:///home/shish/svn/shimmie2/trunk@403 7f39781d-f577-437e-ae19-be835c7a54ca
2007-08-01 15:48:07 +00:00
shish
57f7f82074 image_tip is a general image option
git-svn-id: file:///home/shish/svn/shimmie2/trunk@402 7f39781d-f577-437e-ae19-be835c7a54ca
2007-08-01 15:46:31 +00:00
shish
1137fe7025 default tac
git-svn-id: file:///home/shish/svn/shimmie2/trunk@401 7f39781d-f577-437e-ae19-be835c7a54ca
2007-08-01 15:08:40 +00:00
shish
951e4bbf66 formatted terms & conditions
git-svn-id: file:///home/shish/svn/shimmie2/trunk@400 7f39781d-f577-437e-ae19-be835c7a54ca
2007-08-01 15:02:05 +00:00
shish
72937d5e62 actually, 2.2
git-svn-id: file:///home/shish/svn/shimmie2/trunk@399 7f39781d-f577-437e-ae19-be835c7a54ca
2007-08-01 14:57:16 +00:00
shish
b70e282d9d move wiki to core extensions
git-svn-id: file:///home/shish/svn/shimmie2/trunk@398 7f39781d-f577-437e-ae19-be835c7a54ca
2007-08-01 14:54:03 +00:00
jjs
2e78d1689a danbooru api: fix uploaded filename, other small stuff
git-svn-id: file:///home/shish/svn/shimmie2/trunk@397 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-29 20:25:34 +00:00
shish
cbb1dc4be9 themable home page
git-svn-id: file:///home/shish/svn/shimmie2/trunk@396 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-28 20:47:54 +00:00
shish
0b7c038f52 much theme docs, and some display_my_foo_error replaced with generic display_error
git-svn-id: file:///home/shish/svn/shimmie2/trunk@395 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-28 20:30:01 +00:00
shish
29829efc66 use display_error
git-svn-id: file:///home/shish/svn/shimmie2/trunk@394 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-28 20:00:05 +00:00
shish
c742614828 these are set in ext/setup's initextevent handler
git-svn-id: file:///home/shish/svn/shimmie2/trunk@393 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-28 19:59:17 +00:00
shish
0ee06bc1fd and some defaults
git-svn-id: file:///home/shish/svn/shimmie2/trunk@392 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-28 19:58:15 +00:00
shish
d6f5b3fb79 split front_page into front_page and main_page
git-svn-id: file:///home/shish/svn/shimmie2/trunk@391 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-28 19:33:16 +00:00
shish
619d18c8f3 a somewhat nicer error message for can't connect to DB
git-svn-id: file:///home/shish/svn/shimmie2/trunk@390 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-28 14:15:03 +00:00
shish
86561be3ec one less global
git-svn-id: file:///home/shish/svn/shimmie2/trunk@389 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-28 13:53:31 +00:00
shish
f26bd31f7a hide IP list from anon
git-svn-id: file:///home/shish/svn/shimmie2/trunk@388 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-28 13:45:12 +00:00
shish
06f59cca08 argh
git-svn-id: file:///home/shish/svn/shimmie2/trunk@387 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-27 15:35:32 +00:00
shish
c77dfdfe0d version string visible in danbooru theme
git-svn-id: file:///home/shish/svn/shimmie2/trunk@386 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-27 13:12:49 +00:00
shish
6ceb65c49b user admin things moved to user_admin, user/* is now usernames only
git-svn-id: file:///home/shish/svn/shimmie2/trunk@385 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-27 13:05:48 +00:00
shish
63777446bf brain fail
git-svn-id: file:///home/shish/svn/shimmie2/trunk@384 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-27 03:41:09 +00:00
shish
2434a6ddb1 mysql 4.x fix
git-svn-id: file:///home/shish/svn/shimmie2/trunk@383 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-27 02:31:15 +00:00
shish
77701054ba forward search= to post/view
git-svn-id: file:///home/shish/svn/shimmie2/trunk@382 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-27 01:57:57 +00:00
shish
7c9740e4d3 themeyness
git-svn-id: file:///home/shish/svn/shimmie2/trunk@381 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-27 00:49:03 +00:00
shish
7ffbde97dc limit usernames
git-svn-id: file:///home/shish/svn/shimmie2/trunk@380 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-27 00:42:22 +00:00
shish
e2264e60b4 allow default page to have a slash
git-svn-id: file:///home/shish/svn/shimmie2/trunk@379 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-27 00:20:12 +00:00
shish
8552727d52 message
git-svn-id: file:///home/shish/svn/shimmie2/trunk@378 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-26 15:44:27 +00:00
shish
eddfaeb59b hide the PHP error, we'll deal with it ourselves
git-svn-id: file:///home/shish/svn/shimmie2/trunk@377 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-26 15:42:40 +00:00
shish
dbf31ce80c delete image -> post/list
git-svn-id: file:///home/shish/svn/shimmie2/trunk@376 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-26 15:30:16 +00:00
shish
785e1dcd59 / = post/list unless set otherwise
git-svn-id: file:///home/shish/svn/shimmie2/trunk@375 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-26 13:23:38 +00:00
shish
96a870790e that should've been post/list
git-svn-id: file:///home/shish/svn/shimmie2/trunk@374 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-26 13:20:53 +00:00
shish
2e8e839f5c make_link with no args links to default page
git-svn-id: file:///home/shish/svn/shimmie2/trunk@373 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-26 13:19:39 +00:00
shish
ccf45ef91f escape / as //
git-svn-id: file:///home/shish/svn/shimmie2/trunk@372 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-26 13:11:25 +00:00
shish
a4b467ec8f actually use the escaped tag <_<
git-svn-id: file:///home/shish/svn/shimmie2/trunk@371 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-26 13:10:31 +00:00
shish
7fbacc7ffd id-based refine search
git-svn-id: file:///home/shish/svn/shimmie2/trunk@370 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-26 12:15:53 +00:00
shish
5feb68f23a minor tidy while doing other things that eventually got removed again
git-svn-id: file:///home/shish/svn/shimmie2/trunk@369 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-26 12:14:55 +00:00
shish
d166a88e8d view page -> post list
git-svn-id: file:///home/shish/svn/shimmie2/trunk@368 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-26 11:54:34 +00:00
shish
446c3a3579 don't send UPBE for null user
git-svn-id: file:///home/shish/svn/shimmie2/trunk@367 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-26 11:49:52 +00:00
shish
25a355a51a upload should go to post/list
git-svn-id: file:///home/shish/svn/shimmie2/trunk@366 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-26 11:45:23 +00:00
shish
031dc61ba2 integer thumbnail dimentions
git-svn-id: file:///home/shish/svn/shimmie2/trunk@365 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-25 17:29:09 +00:00
shish
e0029a83fe properly support null ends
git-svn-id: file:///home/shish/svn/shimmie2/trunk@364 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-24 13:25:11 +00:00
shish
101bbeecee check for no data during transload
git-svn-id: file:///home/shish/svn/shimmie2/trunk@363 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-24 13:04:47 +00:00
jjs
e06a63c955 Fix returned url on successful add_post
Maybe fixed error response on failure


git-svn-id: file:///home/shish/svn/shimmie2/trunk@362 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-23 23:08:40 +00:00
jjs
9464d9b2ee "very basic danbooru api"
git-svn-id: file:///home/shish/svn/shimmie2/trunk@361 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-23 22:38:02 +00:00
shish
7e3011f049 width and height mixed up
git-svn-id: file:///home/shish/svn/shimmie2/trunk@360 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-23 18:22:18 +00:00
shish
c5b3d38277 an empty folder for jjs to work in~
git-svn-id: file:///home/shish/svn/shimmie2/trunk@359 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-23 13:59:41 +00:00
shish
fe28f1abff sort ip lists properly
git-svn-id: file:///home/shish/svn/shimmie2/trunk@358 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-23 13:51:41 +00:00
shish
6e02af258d IP list is only for admins
git-svn-id: file:///home/shish/svn/shimmie2/trunk@357 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-23 13:48:52 +00:00
shish
069d96d282 saner danbooru pagination
git-svn-id: file:///home/shish/svn/shimmie2/trunk@356 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-23 04:10:28 +00:00
shish
269154c54c post list links to itself without search GET
git-svn-id: file:///home/shish/svn/shimmie2/trunk@355 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-23 04:05:31 +00:00
shish
bcc9b612c1 if a tag has no matches, error
git-svn-id: file:///home/shish/svn/shimmie2/trunk@354 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-23 00:52:24 +00:00
shish
f948ae8720 if source is empty, set it to null in the database
git-svn-id: file:///home/shish/svn/shimmie2/trunk@353 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-23 00:30:44 +00:00
shish
bd91945c76 more event->page
git-svn-id: file:///home/shish/svn/shimmie2/trunk@352 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-22 11:07:07 +00:00
shish
98258b9a64 danbooruish paginator
git-svn-id: file:///home/shish/svn/shimmie2/trunk@351 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-21 15:19:02 +00:00
shish
0f8654db93 themable paginator
git-svn-id: file:///home/shish/svn/shimmie2/trunk@350 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-21 15:02:14 +00:00
shish
9a8708f62b more danbooru
git-svn-id: file:///home/shish/svn/shimmie2/trunk@349 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-21 12:23:16 +00:00
shish
18cd6fbd99 danbooru theme work
git-svn-id: file:///home/shish/svn/shimmie2/trunk@348 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-21 12:11:41 +00:00
shish
e4e4e5a04c commit this...
git-svn-id: file:///home/shish/svn/shimmie2/trunk@347 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-20 23:25:22 +00:00
shish
21c500027f and the rest..
git-svn-id: file:///home/shish/svn/shimmie2/trunk@346 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-20 23:24:32 +00:00
shish
ce4d47b9bc if there's an error, don't continue...
git-svn-id: file:///home/shish/svn/shimmie2/trunk@345 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-20 12:30:07 +00:00
shish
bfc76da943 and another
git-svn-id: file:///home/shish/svn/shimmie2/trunk@344 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-20 12:19:01 +00:00
shish
0df5cf59cf minor bug
git-svn-id: file:///home/shish/svn/shimmie2/trunk@343 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-20 09:43:53 +00:00
shish
f75af6a908 fixes
git-svn-id: file:///home/shish/svn/shimmie2/trunk@342 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-20 09:34:31 +00:00
shish
16df65cf35 assign the file pointer to something
git-svn-id: file:///home/shish/svn/shimmie2/trunk@341 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-19 22:18:50 +00:00
shish
2a48e009eb comment spacing
git-svn-id: file:///home/shish/svn/shimmie2/trunk@340 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-19 18:00:09 +00:00
shish
52128a30af themable comment to html
git-svn-id: file:///home/shish/svn/shimmie2/trunk@339 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-19 17:57:35 +00:00
shish
0e608bdd45 upload link, and utf8
git-svn-id: file:///home/shish/svn/shimmie2/trunk@338 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-19 17:52:20 +00:00
shish
0fe7ee9f07 \o/ Transload \o/
git-svn-id: file:///home/shish/svn/shimmie2/trunk@337 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-19 17:47:07 +00:00
shish
08f4d99659 links~
git-svn-id: file:///home/shish/svn/shimmie2/trunk@336 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-19 15:46:36 +00:00
shish
059f1f1af7 neatness
git-svn-id: file:///home/shish/svn/shimmie2/trunk@335 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-19 14:43:57 +00:00
shish
83b3f099d9 the last of the theme 2.0 work?
git-svn-id: file:///home/shish/svn/shimmie2/trunk@334 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-19 14:41:42 +00:00
shish
ef7044ce48 user themed
git-svn-id: file:///home/shish/svn/shimmie2/trunk@333 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-19 14:32:25 +00:00
shish
1008c36180 comment themed
git-svn-id: file:///home/shish/svn/shimmie2/trunk@332 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-19 14:02:18 +00:00
shish
43ff2c2569 use to_shorthand_int
git-svn-id: file:///home/shish/svn/shimmie2/trunk@331 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-19 12:54:49 +00:00
shish
852412ddf2 wiki themed
git-svn-id: file:///home/shish/svn/shimmie2/trunk@330 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-19 12:51:12 +00:00
shish
05ab9e5468 and another
git-svn-id: file:///home/shish/svn/shimmie2/trunk@329 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-19 12:25:32 +00:00
shish
f50b13499e remove nonthemes
git-svn-id: file:///home/shish/svn/shimmie2/trunk@328 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-19 12:24:25 +00:00
shish
d9af472e6f fix
git-svn-id: file:///home/shish/svn/shimmie2/trunk@327 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-19 12:20:48 +00:00
shish
6c8617d087 forgot this
git-svn-id: file:///home/shish/svn/shimmie2/trunk@326 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-19 12:19:55 +00:00
shish
505d9db0f8 tag_edit themed
git-svn-id: file:///home/shish/svn/shimmie2/trunk@325 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-19 12:19:05 +00:00
shish
35d47b972b setup themed
git-svn-id: file:///home/shish/svn/shimmie2/trunk@324 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-19 12:13:46 +00:00
shish
0e49266a01 admin page themed
git-svn-id: file:///home/shish/svn/shimmie2/trunk@323 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-19 12:08:42 +00:00
shish
a09a7aa1b0 search should link to niceurl'd page
git-svn-id: file:///home/shish/svn/shimmie2/trunk@322 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-19 11:46:43 +00:00
shish
47a7eaec09 upgrade to new tag schema
git-svn-id: file:///home/shish/svn/shimmie2/trunk@321 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-19 11:46:06 +00:00
shish
d406f9b4a4 more generic match
git-svn-id: file:///home/shish/svn/shimmie2/trunk@320 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-18 09:17:31 +00:00
shish
dd0c4692ce array() != null
git-svn-id: file:///home/shish/svn/shimmie2/trunk@319 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-17 18:10:38 +00:00
shish
73c437758a news, upload, comment, and tag_list now respond to PostListBuildingEvents rather than PageRequestEvent(index)
git-svn-id: file:///home/shish/svn/shimmie2/trunk@318 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-17 18:07:18 +00:00
shish
91f1ae986a add_x_block -> add_block
git-svn-id: file:///home/shish/svn/shimmie2/trunk@317 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-17 17:57:13 +00:00
shish
d0cbdf0b8c Wait a minute... I don't support php4 :3
git-svn-id: file:///home/shish/svn/shimmie2/trunk@316 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-17 17:09:44 +00:00
shish
0e20a2554f for people who only have php as cgi
git-svn-id: file:///home/shish/svn/shimmie2/trunk@315 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-17 17:08:13 +00:00
shish
6a86f5f0e8 db, not database
git-svn-id: file:///home/shish/svn/shimmie2/trunk@314 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-17 16:44:32 +00:00
shish
83da08313f explicitly say pixels...
git-svn-id: file:///home/shish/svn/shimmie2/trunk@313 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-17 10:06:26 +00:00
shish
0c5f7244db consistency
git-svn-id: file:///home/shish/svn/shimmie2/trunk@312 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-17 07:45:35 +00:00
shish
b782b3e970 argh, another one
git-svn-id: file:///home/shish/svn/shimmie2/trunk@311 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-17 02:23:24 +00:00
shish
c908131da8 get_base_href fixed to work in root web folder
git-svn-id: file:///home/shish/svn/shimmie2/trunk@310 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-17 02:02:57 +00:00
shish
55b604b908 minor tweak to layout algo
git-svn-id: file:///home/shish/svn/shimmie2/trunk@309 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-16 22:12:25 +00:00
shish
24756c2a12 go by _type_foo rather than _config_foo, since _config_foo doesn't exist for unchecked checkboxes
git-svn-id: file:///home/shish/svn/shimmie2/trunk@308 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-16 22:08:59 +00:00
shish
4fea47dbbe start deprecating image_slink, and move image_ilink and image_tlink from view to image
git-svn-id: file:///home/shish/svn/shimmie2/trunk@307 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-16 22:00:58 +00:00
shish
6187d9a89f fix for new layout engine
git-svn-id: file:///home/shish/svn/shimmie2/trunk@306 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-16 21:46:41 +00:00
shish
b7ec475b6c pretty
git-svn-id: file:///home/shish/svn/shimmie2/trunk@305 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-16 21:32:51 +00:00
shish
f5ec3f861e removal of data_href config variable -- it should be auto detected
git-svn-id: file:///home/shish/svn/shimmie2/trunk@304 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-16 21:30:28 +00:00
shish
e614634cf9 remove non-themes
git-svn-id: file:///home/shish/svn/shimmie2/trunk@303 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-16 19:49:29 +00:00
shish
b57ea27f19 a bit more themey
git-svn-id: file:///home/shish/svn/shimmie2/trunk@302 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-16 19:47:25 +00:00
shish
4e5d7ff7b3 UserPageBuildingEvent
git-svn-id: file:///home/shish/svn/shimmie2/trunk@301 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-16 19:38:12 +00:00
shish
3bfe8ef56b Madness? ... This is A TYPO!
git-svn-id: file:///home/shish/svn/shimmie2/trunk@300 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-16 18:41:09 +00:00
shish
ccb01e60cb oh dear :(
git-svn-id: file:///home/shish/svn/shimmie2/trunk@299 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-16 16:48:35 +00:00
shish
1e284e0239 tweakage
git-svn-id: file:///home/shish/svn/shimmie2/trunk@298 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-16 15:28:00 +00:00
shish
79aa14ee57 haaaaax
git-svn-id: file:///home/shish/svn/shimmie2/trunk@297 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-16 15:25:13 +00:00
shish
2a85e6b17c actually theme'd, and image source
git-svn-id: file:///home/shish/svn/shimmie2/trunk@296 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-16 14:36:29 +00:00
shish
086d13ac34 theme engine'd
git-svn-id: file:///home/shish/svn/shimmie2/trunk@295 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-16 14:35:49 +00:00
shish
3084446c2e goodbye, global config defaults~
git-svn-id: file:///home/shish/svn/shimmie2/trunk@294 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-16 14:09:12 +00:00
shish
da30c88776 more set_default
git-svn-id: file:///home/shish/svn/shimmie2/trunk@293 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-16 13:15:56 +00:00
shish
b4e93df363 set_default
git-svn-id: file:///home/shish/svn/shimmie2/trunk@292 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-16 12:40:44 +00:00
shish
dc23b3bdb4 remove tags_min and tags_default from config class
git-svn-id: file:///home/shish/svn/shimmie2/trunk@291 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-16 12:17:43 +00:00
shish
e2dc8c065d and a couple more
git-svn-id: file:///home/shish/svn/shimmie2/trunk@290 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-16 07:44:35 +00:00
shish
efcb4f9d55 name, not id
git-svn-id: file:///home/shish/svn/shimmie2/trunk@289 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-16 07:42:31 +00:00
shish
36e819ec41 html_escape the links before putting them into textboxes
git-svn-id: file:///home/shish/svn/shimmie2/trunk@288 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-16 07:29:14 +00:00
shish
c8186776a4 Spoiler filter
git-svn-id: file:///home/shish/svn/shimmie2/trunk@287 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-16 07:25:53 +00:00
shish
11a7e6dca4 use Image's link template parser
git-svn-id: file:///home/shish/svn/shimmie2/trunk@286 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-16 06:52:31 +00:00
shish
2b31199c6a url escape parts of link templates
git-svn-id: file:///home/shish/svn/shimmie2/trunk@285 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-16 06:50:36 +00:00
shish
68172f94b6 give all blocks an ID, not just those which toggle
git-svn-id: file:///home/shish/svn/shimmie2/trunk@284 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-16 06:43:49 +00:00
shish
2e574edef6 only zoom out when necessary
git-svn-id: file:///home/shish/svn/shimmie2/trunk@283 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-16 06:34:57 +00:00
shish
061ed4a3fe wait, no
git-svn-id: file:///home/shish/svn/shimmie2/trunk@282 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-15 19:09:57 +00:00
shish
6dd48c2335 Image->get_x_link functions should return escaped urls
git-svn-id: file:///home/shish/svn/shimmie2/trunk@281 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-15 18:46:28 +00:00
shish
6505109597 more /post/list
git-svn-id: file:///home/shish/svn/shimmie2/trunk@280 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-15 18:09:42 +00:00
shish
f54c81bde7 and another
git-svn-id: file:///home/shish/svn/shimmie2/trunk@279 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-15 18:09:11 +00:00
shish
5891589d27 new url
git-svn-id: file:///home/shish/svn/shimmie2/trunk@278 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-15 17:56:16 +00:00
shish
2bd965cebb /post/list, and /post/list/search tags here/pagenum
git-svn-id: file:///home/shish/svn/shimmie2/trunk@277 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-15 17:48:24 +00:00
shish
d66030f35f redundancy
git-svn-id: file:///home/shish/svn/shimmie2/trunk@276 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-15 17:29:05 +00:00
shish
9861e13f8e removed set_extension_version; everyone was using config anyway ;3
git-svn-id: file:///home/shish/svn/shimmie2/trunk@275 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-15 17:17:59 +00:00
Artanis
b010709e2d 0.3.0
git-svn-id: file:///home/shish/svn/shimmie2/trunk@274 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-13 19:11:45 +00:00
shish
8a2c7283a9 resolution limiter
git-svn-id: file:///home/shish/svn/shimmie2/trunk@273 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-12 08:59:23 +00:00
shish
ceb82b16e4 renamed _live to \!vetoed
git-svn-id: file:///home/shish/svn/shimmie2/trunk@272 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-12 08:58:19 +00:00
shish
cbb09958c4 more $page-ry
git-svn-id: file:///home/shish/svn/shimmie2/trunk@271 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-12 08:57:29 +00:00
shish
c1dd2b6009 better variable names
git-svn-id: file:///home/shish/svn/shimmie2/trunk@270 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-12 08:50:32 +00:00
shish
a9908508d0 veto API
git-svn-id: file:///home/shish/svn/shimmie2/trunk@269 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-12 08:39:13 +00:00
shish
b8b968ab56 ability to veto events
git-svn-id: file:///home/shish/svn/shimmie2/trunk@268 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-12 08:30:51 +00:00
shish
45343a8ce9 hidden options are silly :3
git-svn-id: file:///home/shish/svn/shimmie2/trunk@267 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-12 08:29:03 +00:00
shish
d39a45b62d remove old functions (which will break things if used :S)
git-svn-id: file:///home/shish/svn/shimmie2/trunk@266 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-12 08:15:34 +00:00
shish
5a4d6f7277 remove ConfigSaveEvent handlers
git-svn-id: file:///home/shish/svn/shimmie2/trunk@265 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-12 08:14:37 +00:00
shish
40eb4699b8 privatise this
git-svn-id: file:///home/shish/svn/shimmie2/trunk@264 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-12 07:50:08 +00:00
shish
c6b7c9bb83 remove ambiguous database->get_user(...)
git-svn-id: file:///home/shish/svn/shimmie2/trunk@263 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-12 07:37:32 +00:00
shish
3e0d983102 more marking as internal
git-svn-id: file:///home/shish/svn/shimmie2/trunk@262 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-12 07:33:53 +00:00
shish
34d95d594d make this look more like an internal function
git-svn-id: file:///home/shish/svn/shimmie2/trunk@261 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-12 07:26:50 +00:00
shish
e4657006d3 rename an argument
git-svn-id: file:///home/shish/svn/shimmie2/trunk@260 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-12 07:22:26 +00:00
shish
8837e50a8e fix subheadings
git-svn-id: file:///home/shish/svn/shimmie2/trunk@259 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-12 07:00:14 +00:00
shish
5873029fed how did I not notice these errors? <_<
git-svn-id: file:///home/shish/svn/shimmie2/trunk@258 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-11 06:12:29 +00:00
shish
4bc53455ed index themed
git-svn-id: file:///home/shish/svn/shimmie2/trunk@257 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-10 22:33:49 +00:00
shish
c9f3cf1787 I object
git-svn-id: file:///home/shish/svn/shimmie2/trunk@256 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-10 21:55:53 +00:00
shish
6e93425fe5 remove some globals
git-svn-id: file:///home/shish/svn/shimmie2/trunk@255 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-10 21:16:49 +00:00
shish
0b46cc98d8 and remove the dir
git-svn-id: file:///home/shish/svn/shimmie2/trunk@254 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-10 19:44:31 +00:00
shish
16448bf36c no longer any need for core extensions per se
git-svn-id: file:///home/shish/svn/shimmie2/trunk@253 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-10 19:43:36 +00:00
shish
e8d9523ba8 send page along with image
git-svn-id: file:///home/shish/svn/shimmie2/trunk@252 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-10 19:42:03 +00:00
shish
f459de3176 after adding / removing aliases, redirect to alias/list rather than admin
git-svn-id: file:///home/shish/svn/shimmie2/trunk@251 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-10 05:39:45 +00:00
shish
a06b38f038 removing colons looks worse
git-svn-id: file:///home/shish/svn/shimmie2/trunk@250 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-09 01:06:08 +00:00
shish
a37c0c7f9b add a reference for the bug
git-svn-id: file:///home/shish/svn/shimmie2/trunk@249 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-08 21:58:07 +00:00
shish
2204711880 PHP bug: using a global array in a foreach doesn't work recursively
git-svn-id: file:///home/shish/svn/shimmie2/trunk@247 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-08 21:39:44 +00:00
shish
c52b584f3d ordered extensions
git-svn-id: file:///home/shish/svn/shimmie2/trunk@246 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-08 20:30:26 +00:00
shish
dafaa1933c contrib docs
git-svn-id: file:///home/shish/svn/shimmie2/trunk@245 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-08 20:21:21 +00:00
shish
96ae672063 word filter extension
git-svn-id: file:///home/shish/svn/shimmie2/trunk@244 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-08 20:14:34 +00:00
shish
ef412f6efd emoticons formatter
git-svn-id: file:///home/shish/svn/shimmie2/trunk@243 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-08 19:57:57 +00:00
shish
ffcf86df17 and the event
git-svn-id: file:///home/shish/svn/shimmie2/trunk@242 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-08 19:40:14 +00:00
shish
8ad916c136 bbcode support moved to a generic text formatting extension
git-svn-id: file:///home/shish/svn/shimmie2/trunk@241 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-08 18:56:29 +00:00
shish
9298649c30 make zoom work standalone
git-svn-id: file:///home/shish/svn/shimmie2/trunk@240 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-07 17:57:44 +00:00
shish
69ca13fa50 update tag counts on set_tags / delete_tags_from_image
git-svn-id: file:///home/shish/svn/shimmie2/trunk@239 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-07 02:52:33 +00:00
shish
fa49bf13f3 add status messages during bulk_add
git-svn-id: file:///home/shish/svn/shimmie2/trunk@238 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-06 17:21:17 +00:00
shish
660ca7f8aa debugging stuff
git-svn-id: file:///home/shish/svn/shimmie2/trunk@237 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-06 17:02:52 +00:00
shish
264931a8ee typo
git-svn-id: file:///home/shish/svn/shimmie2/trunk@236 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-06 16:51:09 +00:00
shish
f0168d6160 wildcard searches. This may be faster, as the big query uses IDs rather than tags? needs testing~
git-svn-id: file:///home/shish/svn/shimmie2/trunk@235 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-06 07:28:42 +00:00
shish
a46fcb8463 allow parts of the upload process to say 'no, not ok!'
git-svn-id: file:///home/shish/svn/shimmie2/trunk@234 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-06 06:41:13 +00:00
shish
e0d279f347 utf8 support
git-svn-id: file:///home/shish/svn/shimmie2/trunk@233 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-06 05:57:24 +00:00
shish
cec93d8a4d actually, they are different -- array_add checks for uniqueness
git-svn-id: file:///home/shish/svn/shimmie2/trunk@232 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-06 04:47:01 +00:00
shish
7638c8de70 database schema upgrader
git-svn-id: file:///home/shish/svn/shimmie2/trunk@231 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-06 04:02:24 +00:00
shish
4a755da2c0 it *was* in the core API :P
git-svn-id: file:///home/shish/svn/shimmie2/trunk@230 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-05 21:53:52 +00:00
shish
56d63355dd IM memory limit broken?
git-svn-id: file:///home/shish/svn/shimmie2/trunk@229 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-05 21:44:51 +00:00
shish
4364e5079f specify images.id rather than id (could be tags.id)
git-svn-id: file:///home/shish/svn/shimmie2/trunk@228 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-05 21:41:13 +00:00
shish
b6809c3b0a tags(image_id,tag) split into image_tags(image_id,tag_id) and tags(id,tag,count)
git-svn-id: file:///home/shish/svn/shimmie2/trunk@227 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-05 21:30:37 +00:00
shish
9d6becdb6c re-layout of tag list, and better white space
git-svn-id: file:///home/shish/svn/shimmie2/trunk@226 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-05 20:18:11 +00:00
shish
46d0150e61 danbooru theme updates for theme engine 2
git-svn-id: file:///home/shish/svn/shimmie2/trunk@225 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-05 20:17:29 +00:00
shish
bf579ae048 this needs proper theming
git-svn-id: file:///home/shish/svn/shimmie2/trunk@224 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-05 20:16:25 +00:00
shish
cedddcd1c5 make get_memory_limit use the global rather than the GD limit
git-svn-id: file:///home/shish/svn/shimmie2/trunk@223 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-05 20:16:10 +00:00
shish
1ecb6b688c limit next / prev to 1 row
git-svn-id: file:///home/shish/svn/shimmie2/trunk@221 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-05 18:05:54 +00:00
shish
431b6a653e memory limit for IM too
git-svn-id: file:///home/shish/svn/shimmie2/trunk@220 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-05 17:14:27 +00:00
shish
8e261f03b2 style stuff to css
git-svn-id: file:///home/shish/svn/shimmie2/trunk@219 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-05 03:31:15 +00:00
shish
c8bc08f7da optimise the common case, but speak slowly and use simple words, so that mysql can understand
git-svn-id: file:///home/shish/svn/shimmie2/trunk@217 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-04 15:29:40 +00:00
shish
2fcb9e168e allow single tag wildcards
git-svn-id: file:///home/shish/svn/shimmie2/trunk@216 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-04 02:31:15 +00:00
shish
fe5264c3b1 turn off sql logging
git-svn-id: file:///home/shish/svn/shimmie2/trunk@214 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-04 01:21:32 +00:00
shish
14a8c16d04 fix single-tag + image metadata search
git-svn-id: file:///home/shish/svn/shimmie2/trunk@213 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-04 01:21:08 +00:00
shish
a92b2fdcab optimise a very common (99%) case
git-svn-id: file:///home/shish/svn/shimmie2/trunk@210 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-04 00:56:02 +00:00
shish
a917073fee default MIME type in .htaccess
git-svn-id: file:///home/shish/svn/shimmie2/trunk@209 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-01 18:45:59 +00:00
shish
d3aa734e9d make thumbnails be single frame jpegs
git-svn-id: file:///home/shish/svn/shimmie2/trunk@207 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-01 18:12:19 +00:00
shish
e8fb34c690 'install folder' is ambiguous
git-svn-id: file:///home/shish/svn/shimmie2/trunk@206 7f39781d-f577-437e-ae19-be835c7a54ca
2007-07-01 16:23:04 +00:00
shish
e1c7aa4996 and remove the link...
git-svn-id: file:///home/shish/svn/shimmie2/trunk@205 7f39781d-f577-437e-ae19-be835c7a54ca
2007-06-30 01:42:18 +00:00
shish
b07465042b tag history extension from bzchan, with some minor holes plugged, and add_x_block -> add_block. Now committing files rather than a symlink \o/
git-svn-id: file:///home/shish/svn/shimmie2/trunk@204 7f39781d-f577-437e-ae19-be835c7a54ca
2007-06-30 01:41:56 +00:00
shish
63c02c4a6c tag history extension from bzchan, with some minor holes plugged, and add_x_block -> add_block
git-svn-id: file:///home/shish/svn/shimmie2/trunk@203 7f39781d-f577-437e-ae19-be835c7a54ca
2007-06-30 01:41:01 +00:00
shish
fcfc7e5767 send a tag_set event when tags are set, and correct parentheses when creating a block
git-svn-id: file:///home/shish/svn/shimmie2/trunk@202 7f39781d-f577-437e-ae19-be835c7a54ca
2007-06-30 01:39:30 +00:00
shish
a625fcd787 the bulk of theme engine 2.0; it's still rough, but it works
git-svn-id: file:///home/shish/svn/shimmie2/trunk@201 7f39781d-f577-437e-ae19-be835c7a54ca
2007-06-30 01:19:11 +00:00
shish
d06f0ef30f add default theme, so it works with blanked settings
git-svn-id: file:///home/shish/svn/shimmie2/trunk@166 7f39781d-f577-437e-ae19-be835c7a54ca
2007-06-26 18:23:54 +00:00
shish
464b5ab4ec added 'home' extension from bzchan
git-svn-id: file:///home/shish/svn/shimmie2/trunk@165 7f39781d-f577-437e-ae19-be835c7a54ca
2007-06-26 18:01:12 +00:00
shish
3c1916f428 giving extensions numeric IDs in an array does not put them in numeric order; do an explicit sort...
git-svn-id: file:///home/shish/svn/shimmie2/trunk@164 7f39781d-f577-437e-ae19-be835c7a54ca
2007-06-26 11:58:47 +00:00
shish
927199430f if $tags is an empty array, $tag_array is never created...
git-svn-id: file:///home/shish/svn/shimmie2/trunk@163 7f39781d-f577-437e-ae19-be835c7a54ca
2007-06-26 11:47:30 +00:00
shish
f25ed214c6 search by hash, from artanis
git-svn-id: file:///home/shish/svn/shimmie2/trunk@162 7f39781d-f577-437e-ae19-be835c7a54ca
2007-06-25 16:40:47 +00:00
shish
baf57f5c74 nofollow on tag refine links
git-svn-id: file:///home/shish/svn/shimmie2/trunk@161 7f39781d-f577-437e-ae19-be835c7a54ca
2007-06-14 12:34:17 +00:00
shish
9bab5f0c29 nicety
git-svn-id: file:///home/shish/svn/shimmie2/trunk@160 7f39781d-f577-437e-ae19-be835c7a54ca
2007-06-04 04:48:36 +00:00
shish
b87c304ed9 more alias list things
git-svn-id: file:///home/shish/svn/shimmie2/trunk@159 7f39781d-f577-437e-ae19-be835c7a54ca
2007-06-04 03:31:52 +00:00
shish
c6661ce84b Only show tag lists if there's something to be shown
git-svn-id: file:///home/shish/svn/shimmie2/trunk@158 7f39781d-f577-437e-ae19-be835c7a54ca
2007-06-04 03:09:25 +00:00
shish
14e300378c Show a sensible message for no search results
git-svn-id: file:///home/shish/svn/shimmie2/trunk@157 7f39781d-f577-437e-ae19-be835c7a54ca
2007-06-04 03:01:36 +00:00
shish
d6647255ed link back to index
git-svn-id: file:///home/shish/svn/shimmie2/trunk@156 7f39781d-f577-437e-ae19-be835c7a54ca
2007-06-04 03:00:25 +00:00
shish
b1a2f5eea4 404 handler
git-svn-id: file:///home/shish/svn/shimmie2/trunk@155 7f39781d-f577-437e-ae19-be835c7a54ca
2007-06-04 02:57:21 +00:00
shish
b5b5e56f01 csv export for aliases
git-svn-id: file:///home/shish/svn/shimmie2/trunk@154 7f39781d-f577-437e-ae19-be835c7a54ca
2007-06-04 02:43:58 +00:00
shish
979b0f936a alias list / edit moved to its own page
git-svn-id: file:///home/shish/svn/shimmie2/trunk@153 7f39781d-f577-437e-ae19-be835c7a54ca
2007-06-04 02:35:28 +00:00
shish
81ef3dc356 List user's IPs
git-svn-id: file:///home/shish/svn/shimmie2/trunk@152 7f39781d-f577-437e-ae19-be835c7a54ca
2007-06-03 10:40:00 +00:00
shish
1c81f2311e show uploader IP
git-svn-id: file:///home/shish/svn/shimmie2/trunk@151 7f39781d-f577-437e-ae19-be835c7a54ca
2007-06-03 10:27:15 +00:00
shish
2c0264095b upload is better now
git-svn-id: file:///home/shish/svn/shimmie2/trunk@150 7f39781d-f577-437e-ae19-be835c7a54ca
2007-06-01 22:11:53 +00:00
shish
a23966c90c upload doesn't need to be in core
git-svn-id: file:///home/shish/svn/shimmie2/trunk@149 7f39781d-f577-437e-ae19-be835c7a54ca
2007-06-01 21:51:07 +00:00
shish
1fe43b8d7a Set header to 503, avoids indexing and such
git-svn-id: file:///home/shish/svn/shimmie2/trunk@148 7f39781d-f577-437e-ae19-be835c7a54ca
2007-06-01 21:11:38 +00:00
Artanis
5450237869 == Version 0.2.0 ==
* Changed the HTML generation to use a prototype theme engine. All HTML generation is now contained within {{{link_image.html.php}}}, which may be copied to the current theme folder and edited from there.

git-svn-id: file:///home/shish/svn/shimmie2/trunk@147 7f39781d-f577-437e-ae19-be835c7a54ca
2007-05-29 20:02:18 +00:00
Artanis
53e5d9419a == Version 0.2.0 ==
* Changed the HTML generation to use a prototype theme engine. All HTML generation is now contained within {{{link_image.html.php}}}, which may be copied to the current theme folder and edited from there.

git-svn-id: file:///home/shish/svn/shimmie2/trunk@146 7f39781d-f577-437e-ae19-be835c7a54ca
2007-05-29 20:02:11 +00:00
shish
7d1e30413f initial import of misc admin utils
git-svn-id: file:///home/shish/svn/shimmie2/trunk@145 7f39781d-f577-437e-ae19-be835c7a54ca
2007-05-29 02:53:07 +00:00
shish
f92d611238 link to user
git-svn-id: file:///home/shish/svn/shimmie2/trunk@144 7f39781d-f577-437e-ae19-be835c7a54ca
2007-05-29 02:36:27 +00:00
shish
9df0e2ea46 a little more cssery
git-svn-id: file:///home/shish/svn/shimmie2/trunk@143 7f39781d-f577-437e-ae19-be835c7a54ca
2007-05-29 02:35:19 +00:00
shish
ec108c5493 better CSS support
git-svn-id: file:///home/shish/svn/shimmie2/trunk@142 7f39781d-f577-437e-ae19-be835c7a54ca
2007-05-29 02:07:38 +00:00
shish
ea393ca985 allow paginator to be styled separately
git-svn-id: file:///home/shish/svn/shimmie2/trunk@141 7f39781d-f577-437e-ae19-be835c7a54ca
2007-05-29 02:03:13 +00:00
shish
93bb05abaf IP ban expiry times
git-svn-id: file:///home/shish/svn/shimmie2/trunk@140 7f39781d-f577-437e-ae19-be835c7a54ca
2007-05-28 23:22:37 +00:00
shish
3be41b687a wiki:default is used as content for blank pages
git-svn-id: file:///home/shish/svn/shimmie2/trunk@139 7f39781d-f577-437e-ae19-be835c7a54ca
2007-05-28 23:12:43 +00:00
shish
241a048b38 fix ImageIO -- it doesn't take , it takes .
git-svn-id: file:///home/shish/svn/shimmie2/trunk@138 7f39781d-f577-437e-ae19-be835c7a54ca
2007-05-28 21:40:26 +00:00
shish
aedbb8d9f6 url escape uses different concatenator
git-svn-id: file:///home/shish/svn/shimmie2/trunk@137 7f39781d-f577-437e-ae19-be835c7a54ca
2007-05-27 18:52:03 +00:00
shish
28b0431922 reduce image's domain
git-svn-id: file:///home/shish/svn/shimmie2/trunk@136 7f39781d-f577-437e-ae19-be835c7a54ca
2007-05-25 07:40:26 +00:00
shish
574583bb48 add a default
git-svn-id: file:///home/shish/svn/shimmie2/trunk@135 7f39781d-f577-437e-ae19-be835c7a54ca
2007-05-25 07:40:14 +00:00
shish
bb19755625 per-page locking
git-svn-id: file:///home/shish/svn/shimmie2/trunk@134 7f39781d-f577-437e-ae19-be835c7a54ca
2007-05-23 23:37:29 +00:00
shish
f91d777045 execute should have default args arg
git-svn-id: file:///home/shish/svn/shimmie2/trunk@133 7f39781d-f577-437e-ae19-be835c7a54ca
2007-05-23 23:26:11 +00:00
shish
83ab72332e remove silly space
git-svn-id: file:///home/shish/svn/shimmie2/trunk@132 7f39781d-f577-437e-ae19-be835c7a54ca
2007-05-23 23:19:35 +00:00
shish
c6e94ef393 disallow anon / non-admin edits
git-svn-id: file:///home/shish/svn/shimmie2/trunk@131 7f39781d-f577-437e-ae19-be835c7a54ca
2007-05-23 23:17:45 +00:00
shish
fcfa03b3d8 Wiki works on a basic level, lacks many handy features though...
git-svn-id: file:///home/shish/svn/shimmie2/trunk@130 7f39781d-f577-437e-ae19-be835c7a54ca
2007-05-23 22:53:35 +00:00
shish
6c26fa0fc1 use wrapped database execute function
git-svn-id: file:///home/shish/svn/shimmie2/trunk@129 7f39781d-f577-437e-ae19-be835c7a54ca
2007-05-23 22:19:12 +00:00
shish
6bbe00304b don't show related tags block if list length is 0
git-svn-id: file:///home/shish/svn/shimmie2/trunk@128 7f39781d-f577-437e-ae19-be835c7a54ca
2007-05-23 22:06:32 +00:00
shish
593f7d55de ordered tags (and use the wrapped execute function)
git-svn-id: file:///home/shish/svn/shimmie2/trunk@127 7f39781d-f577-437e-ae19-be835c7a54ca
2007-05-23 03:51:20 +00:00
shish
e6668f53d7 Sometimes URL escaping is more appropriate than HTML escaping
git-svn-id: file:///home/shish/svn/shimmie2/trunk@126 7f39781d-f577-437e-ae19-be835c7a54ca
2007-05-23 03:44:15 +00:00
shish
e188a49c58 adding bzchan's danbooru theme
git-svn-id: file:///home/shish/svn/shimmie2/trunk@125 7f39781d-f577-437e-ae19-be835c7a54ca
2007-05-22 14:36:58 +00:00
shish
d0b92590d8 add cache control header to regen_thumb output, in the hope of refreshing the cached thumb image
git-svn-id: file:///home/shish/svn/shimmie2/trunk@124 7f39781d-f577-437e-ae19-be835c7a54ca
2007-05-21 23:52:19 +00:00
shish
4f849016ba login memory changed to default to a year, and removed from visible options
git-svn-id: file:///home/shish/svn/shimmie2/trunk@123 7f39781d-f577-437e-ae19-be835c7a54ca
2007-05-18 18:10:32 +00:00
shish
63472081a3 check for safe mode before check for imagemagick
git-svn-id: file:///home/shish/svn/shimmie2/trunk@121 7f39781d-f577-437e-ae19-be835c7a54ca
2007-05-18 16:44:31 +00:00
shish
bf46c2fd54 Dear PHP,
You suck
 
 Yours sincerely,
   Shish


git-svn-id: file:///home/shish/svn/shimmie2/trunk@120 7f39781d-f577-437e-ae19-be835c7a54ca
2007-05-18 16:43:36 +00:00
shish
7415578674 link to search by user from their page
git-svn-id: file:///home/shish/svn/shimmie2/trunk@119 7f39781d-f577-437e-ae19-be835c7a54ca
2007-05-18 01:33:47 +00:00
shish
c486fe279c search by poster name
git-svn-id: file:///home/shish/svn/shimmie2/trunk@118 7f39781d-f577-437e-ae19-be835c7a54ca
2007-05-18 01:12:50 +00:00
shish
0c30124dbd BBCode URL support
git-svn-id: file:///home/shish/svn/shimmie2/trunk@117 7f39781d-f577-437e-ae19-be835c7a54ca
2007-05-18 00:55:47 +00:00
shish
89b54ad6c7 default win32 LAMP doesn't set this. Note .php5 before .php as some hosts require it, and it does no harm
git-svn-id: file:///home/shish/svn/shimmie2/trunk@116 7f39781d-f577-437e-ae19-be835c7a54ca
2007-05-17 15:15:58 +00:00
shish
fc49861fcb make rewrite conditional on the module being loaded
git-svn-id: file:///home/shish/svn/shimmie2/trunk@115 7f39781d-f577-437e-ae19-be835c7a54ca
2007-05-17 14:37:24 +00:00
shish
54acefbb99 include .htaccess by default
git-svn-id: file:///home/shish/svn/shimmie2/trunk@114 7f39781d-f577-437e-ae19-be835c7a54ca
2007-05-17 14:27:46 +00:00
shish
5031a181f3 slightly more descriptive feed title
git-svn-id: file:///home/shish/svn/shimmie2/trunk@113 7f39781d-f577-437e-ae19-be835c7a54ca
2007-05-17 04:01:15 +00:00
shish
775079b56f set default when asking for config value
git-svn-id: file:///home/shish/svn/shimmie2/trunk@112 7f39781d-f577-437e-ae19-be835c7a54ca
2007-05-17 04:00:47 +00:00
shish
51d0ee5f0c minor assertion
git-svn-id: file:///home/shish/svn/shimmie2/trunk@111 7f39781d-f577-437e-ae19-be835c7a54ca
2007-05-17 03:59:48 +00:00
shish
98c93148b9 database uses it's own method
git-svn-id: file:///home/shish/svn/shimmie2/trunk@110 7f39781d-f577-437e-ae19-be835c7a54ca
2007-05-17 03:52:50 +00:00
shish
f372173431 support code tag, and checks in get_user
git-svn-id: file:///home/shish/svn/shimmie2/trunk@109 7f39781d-f577-437e-ae19-be835c7a54ca
2007-05-17 03:49:23 +00:00
shish
4feb6c7742 removed redundant defaults
git-svn-id: file:///home/shish/svn/shimmie2/trunk@108 7f39781d-f577-437e-ae19-be835c7a54ca
2007-05-17 03:48:58 +00:00
shish
8aa30d3ed2 error-handling execute function
git-svn-id: file:///home/shish/svn/shimmie2/trunk@107 7f39781d-f577-437e-ae19-be835c7a54ca
2007-05-17 03:48:34 +00:00
shish
70cab73782 auto-detect imagemagick
git-svn-id: file:///home/shish/svn/shimmie2/trunk@105 7f39781d-f577-437e-ae19-be835c7a54ca
2007-05-17 01:01:31 +00:00
shish
16444c0891 mysql 4.0.X compatability
git-svn-id: file:///home/shish/svn/shimmie2/trunk@103 7f39781d-f577-437e-ae19-be835c7a54ca
2007-05-16 23:50:51 +00:00
shish
ec8b66e9c4 initial import of rss for comments
git-svn-id: file:///home/shish/svn/shimmie2/trunk@102 7f39781d-f577-437e-ae19-be835c7a54ca
2007-05-16 22:59:40 +00:00
shish
9961eada31 config values are noise; have them there but commented out
git-svn-id: file:///home/shish/svn/shimmie2/trunk@101 7f39781d-f577-437e-ae19-be835c7a54ca
2007-05-16 21:28:56 +00:00
shish
d798c1fc96 List loaded extensions
yay for using secret globals \o/


git-svn-id: file:///home/shish/svn/shimmie2/trunk@100 7f39781d-f577-437e-ae19-be835c7a54ca
2007-05-16 21:23:01 +00:00
shish
6c071f95c9 confirm when deleting comments
git-svn-id: file:///home/shish/svn/shimmie2/trunk@99 7f39781d-f577-437e-ae19-be835c7a54ca
2007-05-16 20:51:48 +00:00
Artanis
b1f655f04d git-svn-id: file:///home/shish/svn/shimmie2/trunk@98 7f39781d-f577-437e-ae19-be835c7a54ca 2007-05-15 05:57:40 +00:00
Artanis
1433c4a2ae git-svn-id: file:///home/shish/svn/shimmie2/trunk@97 7f39781d-f577-437e-ae19-be835c7a54ca 2007-05-15 05:57:34 +00:00
Artanis
b18b8901ad git-svn-id: file:///home/shish/svn/shimmie2/trunk@96 7f39781d-f577-437e-ae19-be835c7a54ca 2007-05-15 05:52:43 +00:00
Artanis
be5b9e1962 "Text Link Fomrat:" to "Text Link Format: "
I've not a clue what a fomrat is. Sounds rodenty, though.

git-svn-id: file:///home/shish/svn/shimmie2/trunk@95 7f39781d-f577-437e-ae19-be835c7a54ca
2007-05-13 07:59:39 +00:00
Artanis
5fd0506ecc typo
git-svn-id: file:///home/shish/svn/shimmie2/trunk@94 7f39781d-f577-437e-ae19-be835c7a54ca
2007-05-10 21:56:48 +00:00
Artanis
10d3c786c1 git-svn-id: file:///home/shish/svn/shimmie2/trunk@93 7f39781d-f577-437e-ae19-be835c7a54ca 2007-05-10 21:55:29 +00:00
Artanis
fc4e906aba git-svn-id: file:///home/shish/svn/shimmie2/trunk@92 7f39781d-f577-437e-ae19-be835c7a54ca 2007-05-09 18:14:25 +00:00
shish
ffbb867b58 html whitespace
git-svn-id: file:///home/shish/svn/shimmie2/trunk@91 7f39781d-f577-437e-ae19-be835c7a54ca
2007-05-09 03:37:32 +00:00
shish
070bdaf6ce pretty print
git-svn-id: file:///home/shish/svn/shimmie2/trunk@90 7f39781d-f577-437e-ae19-be835c7a54ca
2007-05-09 03:01:34 +00:00
Artanis
501ccf5128 git-svn-id: file:///home/shish/svn/shimmie2/trunk@89 7f39781d-f577-437e-ae19-be835c7a54ca 2007-05-09 02:29:39 +00:00
Artanis
9047ac80c0 git-svn-id: file:///home/shish/svn/shimmie2/trunk@88 7f39781d-f577-437e-ae19-be835c7a54ca 2007-05-09 02:27:03 +00:00
Artanis
8b56b018d8 git-svn-id: file:///home/shish/svn/shimmie2/trunk@87 7f39781d-f577-437e-ae19-be835c7a54ca 2007-05-09 02:23:13 +00:00
Artanis
26b3680baa git-svn-id: file:///home/shish/svn/shimmie2/trunk@86 7f39781d-f577-437e-ae19-be835c7a54ca 2007-05-09 02:23:00 +00:00
Artanis
0c7ea6b113 put it back how it was
git-svn-id: file:///home/shish/svn/shimmie2/trunk@85 7f39781d-f577-437e-ae19-be835c7a54ca
2007-05-09 02:07:12 +00:00
Artanis
5b1fb99c3f test
git-svn-id: file:///home/shish/svn/shimmie2/trunk@84 7f39781d-f577-437e-ae19-be835c7a54ca
2007-05-09 01:57:35 +00:00
Artanis
b4926062ec test
git-svn-id: file:///home/shish/svn/shimmie2/trunk@83 7f39781d-f577-437e-ae19-be835c7a54ca
2007-05-09 01:55:22 +00:00
Artanis
45b8827752 test
git-svn-id: file:///home/shish/svn/shimmie2/trunk@82 7f39781d-f577-437e-ae19-be835c7a54ca
2007-05-09 01:51:21 +00:00
shish
e2e7d29b66 scripts moved to an extension
git-svn-id: file:///home/shish/svn/shimmie2/trunk@81 7f39781d-f577-437e-ae19-be835c7a54ca
2007-05-08 21:18:31 +00:00
shish
5c16e860a1 cleaning out scripts
git-svn-id: file:///home/shish/svn/shimmie2/trunk@80 7f39781d-f577-437e-ae19-be835c7a54ca
2007-05-08 21:14:53 +00:00
shish
c25427a5d1 'User Links' block is no longer hard coded
git-svn-id: file:///home/shish/svn/shimmie2/trunk@79 7f39781d-f577-437e-ae19-be835c7a54ca
2007-05-08 21:01:51 +00:00
shish
ea9da95c7b Setup items support labels nicely, as pioneered by Artanis
git-svn-id: file:///home/shish/svn/shimmie2/trunk@78 7f39781d-f577-437e-ae19-be835c7a54ca
2007-05-08 20:36:02 +00:00
shish
3d4e4f1b8e Extension header added, a minor rearrangement, and a whitespace fix
git-svn-id: file:///home/shish/svn/shimmie2/trunk@77 7f39781d-f577-437e-ae19-be835c7a54ca
2007-05-07 15:28:59 +00:00
shish
6bc6bb12ce Artanis's Link to Image extension imported
git-svn-id: file:///home/shish/svn/shimmie2/trunk@76 7f39781d-f577-437e-ae19-be835c7a54ca
2007-05-07 15:22:44 +00:00
shish
19d3062314 extensions moved to folders
git-svn-id: file:///home/shish/svn/shimmie2/trunk@75 7f39781d-f577-437e-ae19-be835c7a54ca
2007-05-07 15:04:46 +00:00
shish
b45de90705 things that don't work moved out of main extensions
git-svn-id: file:///home/shish/svn/shimmie2/trunk@74 7f39781d-f577-437e-ae19-be835c7a54ca
2007-05-07 14:56:52 +00:00
shish
d32a64cb56 this is unnecessary
git-svn-id: file:///home/shish/svn/shimmie2/trunk@73 7f39781d-f577-437e-ae19-be835c7a54ca
2007-05-07 13:56:25 +00:00
shish
0f0b7f77b5 make parse_link_template public, and specific to the image it's called on
git-svn-id: file:///home/shish/svn/shimmie2/trunk@70 7f39781d-f577-437e-ae19-be835c7a54ca
2007-05-07 00:18:52 +00:00
shish
38410565f0 DONE: this function
git-svn-id: file:///home/shish/svn/shimmie2/trunk@69 7f39781d-f577-437e-ae19-be835c7a54ca
2007-05-07 00:12:18 +00:00
shish
b3ac04ffc1 grammar >_<
git-svn-id: file:///home/shish/svn/shimmie2/trunk@68 7f39781d-f577-437e-ae19-be835c7a54ca
2007-05-06 21:39:47 +00:00
shish
eafc6d969a continuation arrows are a style thing~
git-svn-id: file:///home/shish/svn/shimmie2/trunk@67 7f39781d-f577-437e-ae19-be835c7a54ca
2007-05-06 21:19:50 +00:00
shish
1978e28565 remove rss; it's being done elsewhere
git-svn-id: file:///home/shish/svn/shimmie2/trunk@66 7f39781d-f577-437e-ae19-be835c7a54ca
2007-05-06 21:14:09 +00:00
shish
1c4f4598b2 make the default theme easier to copy & paste :P
git-svn-id: file:///home/shish/svn/shimmie2/trunk@65 7f39781d-f577-437e-ae19-be835c7a54ca
2007-05-06 21:11:58 +00:00
shish
c73f270f82 make the example for contributed extension neater
git-svn-id: file:///home/shish/svn/shimmie2/trunk@64 7f39781d-f577-437e-ae19-be835c7a54ca
2007-05-06 19:01:26 +00:00
shish
21635236f8 lack of whitespace caused problems~
git-svn-id: file:///home/shish/svn/shimmie2/trunk@63 7f39781d-f577-437e-ae19-be835c7a54ca
2007-05-05 20:55:08 +00:00
shish
f41c95b214 turn off time outs for bulk upload
git-svn-id: file:///home/shish/svn/shimmie2/trunk@62 7f39781d-f577-437e-ae19-be835c7a54ca
2007-05-04 23:31:30 +00:00
shish
8c7754040d site description extension, by Shish, but not worth including as standard IMHO
git-svn-id: file:///home/shish/svn/shimmie2/trunk@61 7f39781d-f577-437e-ae19-be835c7a54ca
2007-05-04 22:23:16 +00:00
shish
12b34bf754 for cool third party hacks
git-svn-id: file:///home/shish/svn/shimmie2/trunk@60 7f39781d-f577-437e-ae19-be835c7a54ca
2007-05-04 22:18:11 +00:00
shish
22c9cdacf7 they have functions for that sort of thing...
git-svn-id: file:///home/shish/svn/shimmie2/trunk@59 7f39781d-f577-437e-ae19-be835c7a54ca
2007-05-04 22:17:56 +00:00
shish
d5ebcb89e8 a standard way of getting stuff from the images table
git-svn-id: file:///home/shish/svn/shimmie2/trunk@58 7f39781d-f577-437e-ae19-be835c7a54ca
2007-05-04 22:15:32 +00:00
shish
b9ec7c9f5b move tag editing into it's own namespace, and have an anonymous editing option
git-svn-id: file:///home/shish/svn/shimmie2/trunk@55 7f39781d-f577-437e-ae19-be835c7a54ca
2007-05-04 21:53:58 +00:00
shish
f6ea5118d9 valid rss date
git-svn-id: file:///home/shish/svn/shimmie2/trunk@54 7f39781d-f577-437e-ae19-be835c7a54ca
2007-05-03 15:27:10 +00:00
shish
9bb567aa60 front page option, and post links in bbcode
git-svn-id: file:///home/shish/svn/shimmie2/trunk@53 7f39781d-f577-437e-ae19-be835c7a54ca
2007-05-03 15:19:02 +00:00
shish
35bae4f71d RSS post date, broken
git-svn-id: file:///home/shish/svn/shimmie2/trunk@52 7f39781d-f577-437e-ae19-be835c7a54ca
2007-05-03 15:18:22 +00:00
shish
3d2ea2a842 make front page a variable, and add support for default values in config->get
git-svn-id: file:///home/shish/svn/shimmie2/trunk@51 7f39781d-f577-437e-ae19-be835c7a54ca
2007-05-01 13:40:48 +00:00
shish
f6fdc13101 tag count for refine search is misleading
git-svn-id: file:///home/shish/svn/shimmie2/trunk@50 7f39781d-f577-437e-ae19-be835c7a54ca
2007-05-01 13:33:41 +00:00
shish
ff0fcee777 refine search
git-svn-id: file:///home/shish/svn/shimmie2/trunk@49 7f39781d-f577-437e-ae19-be835c7a54ca
2007-05-01 13:30:05 +00:00
shish
ad37982680 fix assertion error on invalid page numbers
git-svn-id: file:///home/shish/svn/shimmie2/trunk@47 7f39781d-f577-437e-ae19-be835c7a54ca
2007-05-01 13:13:41 +00:00
shish
70a34bbff5 rss for images extension
git-svn-id: file:///home/shish/svn/shimmie2/trunk@45 7f39781d-f577-437e-ae19-be835c7a54ca
2007-05-01 12:42:05 +00:00
shish
32e4af6a23 support for adding headers to a page
git-svn-id: file:///home/shish/svn/shimmie2/trunk@44 7f39781d-f577-437e-ae19-be835c7a54ca
2007-05-01 12:41:44 +00:00
shish
a9abf77ba9 thumb html shouldn't be the one adding <td>s
git-svn-id: file:///home/shish/svn/shimmie2/trunk@43 7f39781d-f577-437e-ae19-be835c7a54ca
2007-05-01 12:41:09 +00:00
shish
4d127b3a17 select image by hash, for dupe detection
git-svn-id: file:///home/shish/svn/shimmie2/trunk@42 7f39781d-f577-437e-ae19-be835c7a54ca
2007-05-01 12:40:39 +00:00
shish
fcb79e40c7 remove rss bits from index code
git-svn-id: file:///home/shish/svn/shimmie2/trunk@41 7f39781d-f577-437e-ae19-be835c7a54ca
2007-05-01 12:40:01 +00:00
shish
b0369ffd22 shared code for tag lists, and work on refine search starts
git-svn-id: file:///home/shish/svn/shimmie2/trunk@40 7f39781d-f577-437e-ae19-be835c7a54ca
2007-05-01 12:39:20 +00:00
shish
c4cbc5991d fix error when generating image_too_large, and show thumb on dupe upload
git-svn-id: file:///home/shish/svn/shimmie2/trunk@39 7f39781d-f577-437e-ae19-be835c7a54ca
2007-05-01 12:38:28 +00:00
shish
0eb5a5e6bb get rid of a warning
git-svn-id: file:///home/shish/svn/shimmie2/trunk@38 7f39781d-f577-437e-ae19-be835c7a54ca
2007-05-01 08:35:48 +00:00
shish
8b4feceb63 tag listings neatened, and tag counts made optional
git-svn-id: file:///home/shish/svn/shimmie2/trunk@37 7f39781d-f577-437e-ae19-be835c7a54ca
2007-04-29 03:15:21 +00:00
shish
38a8df40ae early bbcode support for comments, and comments page uses standard thumb html generator
git-svn-id: file:///home/shish/svn/shimmie2/trunk@36 7f39781d-f577-437e-ae19-be835c7a54ca
2007-04-29 02:43:41 +00:00
shish
26997b1b59 misc fixes
git-svn-id: file:///home/shish/svn/shimmie2/trunk@35 7f39781d-f577-437e-ae19-be835c7a54ca
2007-04-29 01:37:49 +00:00
shish
48f5df95ec update build thumb api
git-svn-id: file:///home/shish/svn/shimmie2/trunk@34 7f39781d-f577-437e-ae19-be835c7a54ca
2007-04-29 01:23:13 +00:00
shish
2add3097f5 start of refine code
git-svn-id: file:///home/shish/svn/shimmie2/trunk@33 7f39781d-f577-437e-ae19-be835c7a54ca
2007-04-29 01:22:34 +00:00
shish
6a9c127719 regen thumb uses common build_thumb_html
git-svn-id: file:///home/shish/svn/shimmie2/trunk@32 7f39781d-f577-437e-ae19-be835c7a54ca
2007-04-28 19:29:59 +00:00
shish
e6e65a9459 util.inc.php tidied up
git-svn-id: file:///home/shish/svn/shimmie2/trunk@31 7f39781d-f577-437e-ae19-be835c7a54ca
2007-04-28 19:28:29 +00:00
shish
8ae4d58fd1 sql_quote is silly...
git-svn-id: file:///home/shish/svn/shimmie2/trunk@30 7f39781d-f577-437e-ae19-be835c7a54ca
2007-04-28 19:02:54 +00:00
shish
f12e0b8f60 one step towards faster searching
git-svn-id: file:///home/shish/svn/shimmie2/trunk@29 7f39781d-f577-437e-ae19-be835c7a54ca
2007-04-28 18:58:23 +00:00
shish
d0b797247f search optimisation, and remove old search code
git-svn-id: file:///home/shish/svn/shimmie2/trunk@27 7f39781d-f577-437e-ae19-be835c7a54ca
2007-04-28 18:40:08 +00:00
shish
bed0e5260b use set_x_from_post
git-svn-id: file:///home/shish/svn/shimmie2/trunk@24 7f39781d-f577-437e-ae19-be835c7a54ca
2007-04-28 15:49:25 +00:00
shish
5bd3789b74 make the regex a little neater
git-svn-id: file:///home/shish/svn/shimmie2/trunk@23 7f39781d-f577-437e-ae19-be835c7a54ca
2007-04-28 15:46:53 +00:00
shish
71392a73a5 be more strict about allowed comparisons
git-svn-id: file:///home/shish/svn/shimmie2/trunk@19 7f39781d-f577-437e-ae19-be835c7a54ca
2007-04-27 18:14:38 +00:00
shish
f0802f2f1c search to SQL redone with regex, makes things more useful and less buggy
git-svn-id: file:///home/shish/svn/shimmie2/trunk@17 7f39781d-f577-437e-ae19-be835c7a54ca
2007-04-27 18:04:13 +00:00
shish
6e90eed812 build_thumb moved to common utils
git-svn-id: file:///home/shish/svn/shimmie2/trunk@16 7f39781d-f577-437e-ae19-be835c7a54ca
2007-04-26 22:27:17 +00:00
shish
c11a6484b8 thumbnail size in the index html
git-svn-id: file:///home/shish/svn/shimmie2/trunk@15 7f39781d-f577-437e-ae19-be835c7a54ca
2007-04-25 18:34:37 +00:00
shish
5614a7f7da less duplication again
git-svn-id: file:///home/shish/svn/shimmie2/trunk@14 7f39781d-f577-437e-ae19-be835c7a54ca
2007-04-25 18:33:59 +00:00
shish
d45e3af215 hiding main blocks is confusing
git-svn-id: file:///home/shish/svn/shimmie2/trunk@13 7f39781d-f577-437e-ae19-be835c7a54ca
2007-04-25 18:04:55 +00:00
shish
94c0446f97 short tag bad
git-svn-id: file:///home/shish/svn/shimmie2/trunk@11 7f39781d-f577-437e-ae19-be835c7a54ca
2007-04-25 16:54:10 +00:00
shish
b1b2edf021 only one copy of get_memory_limit...
git-svn-id: file:///home/shish/svn/shimmie2/trunk@9 7f39781d-f577-437e-ae19-be835c7a54ca
2007-04-24 19:12:05 +00:00
shish
65be47dbb7 slightly more robustness during upgrade, and sanity if it breaks
git-svn-id: file:///home/shish/svn/shimmie2/trunk@7 7f39781d-f577-437e-ae19-be835c7a54ca
2007-04-23 22:58:44 +00:00
shish
f219e199e9 make a big 'downtime mode is on' notice
git-svn-id: file:///home/shish/svn/shimmie2/trunk@5 7f39781d-f577-437e-ae19-be835c7a54ca
2007-04-21 13:55:11 +00:00
shish
7fdd4d787e ignore local files
git-svn-id: file:///home/shish/svn/shimmie2/trunk@4 7f39781d-f577-437e-ae19-be835c7a54ca
2007-04-21 13:43:37 +00:00
shish
01c46dc3c6 minor typo
git-svn-id: file:///home/shish/svn/shimmie2/trunk@3 7f39781d-f577-437e-ae19-be835c7a54ca
2007-04-21 13:42:48 +00:00
677 changed files with 53974 additions and 13875 deletions

8
.dockerignore Normal file
View File

@ -0,0 +1,8 @@
vendor
.git
*.phar
data
images
thumbs
*.sqlite
Dockerfile

21
.editorconfig Normal file
View File

@ -0,0 +1,21 @@
# In retrospect I'm less of a fan of tabs for indentation, because
# while they're better when they work, they're worse when they don't
# work, and so many people use terrible editors when they don't work
# that everything is inconsistent... but tabs are what Shimmie went
# with back in the 90's, so that's what we use now, and we deal with
# the pain of making sure everybody configures their editor properly
# top-most EditorConfig file
root = true
# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
trim_trailing_whitespace = true
insert_final_newline = true
[*.{js,css,php}]
charset = utf-8
indent_style = space
indent_size = 4

1
.gitattributes vendored Normal file
View File

@ -0,0 +1 @@
*.php text eol=lf

28
.github/ISSUE_TEMPLATE/bug_report.md vendored Normal file
View File

@ -0,0 +1,28 @@
---
name: Bug report
about: Create a report to help us improve
---
**Server Software**
(You can get all these stats from `http://<your site>/system_info`)
- Shimmie version:
- Database: [mysql, postgres, ...]
- Web server: [apache, nginx, ...]
**Client Software (please complete the following information)**
- Device: [e.g. iphone, windows desktop]
- Browser: [e.g. chrome, safari]
**What steps trigger this bug**
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
**What did you expect to happen?**
A clear and concise description of what you expected to happen.
**What actually happened?**
If applicable, add screenshots to help explain your problem.

View File

@ -0,0 +1,17 @@
---
name: Feature request
about: Suggest an idea for this project
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.

62
.github/workflows/release.yml vendored Normal file
View File

@ -0,0 +1,62 @@
name: Create Release
on:
push:
tags:
- 'v*'
jobs:
build:
name: Create Release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@master
- name: Get version from tag
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\/v/}
- name: Test version in sys_config
run: grep ${{ steps.get_version.outputs.VERSION }} core/sys_config.php
- name: Build
run: |
composer install --no-dev
cd ..
tar cvzf shimmie2-${{ steps.get_version.outputs.VERSION }}.tgz shimmie2
zip -r shimmie2-${{ steps.get_version.outputs.VERSION }}.zip shimmie2
- name: Create Release
id: create_release
uses: actions/create-release@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Shimmie ${{ steps.get_version.outputs.VERSION }}
body: Automated release from tags
draft: false
prerelease: false
- name: Upload Zip
id: upload-release-asset-zip
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ../shimmie2-${{ steps.get_version.outputs.VERSION }}.zip
asset_name: shimmie2-${{ steps.get_version.outputs.VERSION }}.zip
asset_content_type: application/zip
- name: Upload Tar
id: upload-release-asset-tar
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ../shimmie2-${{ steps.get_version.outputs.VERSION }}.tgz
asset_name: shimmie2-${{ steps.get_version.outputs.VERSION }}.tgz
asset_content_type: application/gzip

95
.github/workflows/test_and_publish.yml vendored Normal file
View File

@ -0,0 +1,95 @@
name: Test & Publish
on:
push:
pull_request:
schedule:
- cron: '0 2 * * 0' # Weekly on Sundays at 02:00
jobs:
test:
name: PHP ${{ matrix.php }} / DB ${{ matrix.database }}
strategy:
max-parallel: 3
fail-fast: false
matrix:
php: ['7.3']
database: ['pgsql', 'mysql', 'sqlite']
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up PHP
uses: shivammathur/setup-php@master
with:
php-version: ${{ matrix.php }}
coverage: pcov
extensions: mbstring
- name: Set up database
run: |
mkdir -p data/config
if [[ "${{ matrix.database }}" == "pgsql" ]]; then
sudo systemctl start postgresql ;
psql --version ;
sudo -u postgres psql -c "SELECT set_config('log_statement', 'all', false);" -U postgres ;
sudo -u postgres psql -c "CREATE USER shimmie WITH PASSWORD 'shimmie';" -U postgres ;
sudo -u postgres psql -c "CREATE DATABASE shimmie WITH OWNER shimmie;" -U postgres ;
fi
if [[ "${{ matrix.database }}" == "mysql" ]]; then
sudo systemctl start mysql ;
mysql --version ;
mysql -e "SET GLOBAL general_log = 'ON';" -uroot -proot ;
mysql -e "CREATE DATABASE shimmie;" -uroot -proot ;
fi
if [[ "${{ matrix.database }}" == "sqlite" ]]; then
sudo apt update && sudo apt-get install -y sqlite3 ;
sqlite3 --version ;
fi
- name: Check versions
run: php -v && composer -V
- name: Validate composer.json and composer.lock
run: composer validate
- name: Install PHP dependencies
run: composer install --prefer-dist --no-progress --no-suggest
- name: Install shimmie
run: php index.php
- name: Run test suite
run: |
if [[ "${{ matrix.database }}" == "pgsql" ]]; then
export TEST_DSN="pgsql:user=shimmie;password=shimmie;host=127.0.0.1;dbname=shimmie"
fi
if [[ "${{ matrix.database }}" == "mysql" ]]; then
export TEST_DSN="mysql:user=root;password=root;host=127.0.0.1;dbname=shimmie"
fi
if [[ "${{ matrix.database }}" == "sqlite" ]]; then
export TEST_DSN="sqlite:data/shimmie.sqlite"
fi
vendor/bin/phpunit --configuration tests/phpunit.xml --coverage-clover=data/coverage.clover
- name: Upload coverage
run: |
wget https://scrutinizer-ci.com/ocular.phar
php ocular.phar code-coverage:upload --format=php-clover data/coverage.clover
publish:
name: Publish
runs-on: ubuntu-latest
needs: test
if: github.event_name == 'push'
steps:
- uses: actions/checkout@master
- name: Publish to Registry
uses: elgohr/Publish-Docker-Github-Action@master
with:
name: shish2k/shimmie2
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
cache: ${{ github.event_name != 'schedule' }}
buildoptions: "--build-arg RUN_TESTS=false"

89
.gitignore vendored Normal file
View File

@ -0,0 +1,89 @@
backup
data
images
thumbs
*.phar
*.sqlite
*.cache
.devcontainer
trace.json
#Composer
composer.phar
composer.lock
/vendor/
# Created by http://www.gitignore.io
### Windows ###
# Windows image file caches
Thumbs.db
ehthumbs.db
# Folder config file
Desktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
### OSX ###
.DS_Store
.AppleDouble
.LSOverride
# Icon must ends with two \r.
Icon
# Thumbnails
._*
# Files that might appear on external disk
.Spotlight-V100
.Trashes
### Linux ###
*~
# KDE directory preferences
.directory
### vim ###
[._]*.s[a-w][a-z]
[._]s[a-w][a-z]
*.un~
Session.vim
.netrwhist
### PhpStorm ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm
## Directory-based project format
.idea/
# if you remove the above rule, at least ignore user-specific stuff:
# .idea/workspace.xml
# .idea/tasks.xml
# and these sensitive or high-churn files:
# .idea/dataSources.ids
# .idea/dataSources.xml
# .idea/sqlDataSources.xml
# .idea/dynamic.xml
## File-based project format
*.ipr
*.iws
*.iml
## Additional for IntelliJ
out/
# generated by mpeltonen/sbt-idea plugin
.idea_modules/
# generated by JIRA plugin
atlassian-ide-plugin.xml
# generated by Crashlytics plugin (for Android Studio and Intellij)
com_crashlytics_export_strings.xml

67
.htaccess Normal file
View File

@ -0,0 +1,67 @@
<IfModule mod_dir.c>
DirectoryIndex index.php5 index.php
</IfModule>
<FilesMatch "\.(sqlite|sdb|s3db|db)$">
<IfModule mod_authz_host.c>
Require all denied
</IfModule>
<IfModule !mod_authz_host.c>
Deny from all
</IfModule>
</FilesMatch>
<IfModule mod_rewrite.c>
RewriteEngine On
# rather than link to images/ha/hash and have an ugly filename,
# we link to images/hash/tags.ext; mod_rewrite splits things so
# that shimmie sees hash and the user sees tags.ext
RewriteRule ^_(images|thumbs)/([0-9a-f]{2})([0-9a-f]{30}).*$ data/$1/$2/$2$3 [L]
# any requests for files which don't physically exist should be handled by index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?q=$1&%{QUERY_STRING} [L]
</IfModule>
<IfModule mod_expires.c>
ExpiresActive On
<FilesMatch "([0-9a-f]{32}|\.(gif|jpe?g|png|webp|css|js))$">
<IfModule mod_headers.c>
Header set Cache-Control "public, max-age=2629743"
</IfModule>
ExpiresDefault "access plus 1 month"
</FilesMatch>
#ExpiresByType text/html "now"
#ExpiresByType text/plain "now"
</IfModule>
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css
AddOutputFilterByType DEFLATE application/x-javascript application/javascript
</IfModule>
#EXT: handle_pixel
AddType image/jpeg jpg jpeg
AddType image/gif gif
AddType image/png png
AddType image/webp webp
#EXT: handle_ico
AddType image/x-icon ico ani cur
#EXT: handle_flash
AddType application/x-shockwave-flash swf
#EXT: handle_mp3
AddType audio/mpeg mp3
#EXT: handle_svg
AddType image/svg+xml svg svgz
#EXT: handle_video
AddType video/x-flv flv
AddType video/mp4 f4v f4p m4v mp4
AddType audio/mp4 f4a f4b m4a
AddType video/ogg ogv
AddType video/webm webm

19
.php_cs.dist Normal file
View File

@ -0,0 +1,19 @@
<?php
$finder = PhpCsFixer\Finder::create()
->exclude('ext/amazon_s3/lib')
->exclude('vendor')
->exclude('data')
->in(__DIR__)
;
return PhpCsFixer\Config::create()
->setRules([
'@PSR2' => true,
//'strict_param' => true,
'array_syntax' => ['syntax' => 'short'],
])
->setFinder($finder)
;
?>

19
.scrutinizer.yml Normal file
View File

@ -0,0 +1,19 @@
imports:
- javascript
- php
filter:
excluded_paths: [ext/*/lib/*,ext/tagger/script.js,tests/*]
build:
nodes:
analysis:
tests:
before:
- mkdir -p data/config
- cp tests/defines.php data/config/shimmie.conf.php
override:
- php-scrutinizer-run
tools:
external_code_coverage: true

49
Dockerfile Normal file
View File

@ -0,0 +1,49 @@
# "Build" shimmie (composer install - done in its own stage so that we don't
# need to include all the composer fluff in the final image)
FROM debian:stable-slim AS app
RUN apt update && apt install -y composer php7.3-gd php7.3-dom php7.3-sqlite3 php-xdebug imagemagick
COPY composer.json composer.lock /app/
WORKDIR /app
RUN composer install --no-dev
COPY . /app/
# Tests in their own image. Really we should inherit from app and then
# `composer install` phpunit on top of that; but for some reason
# `composer install --no-dev && composer install` doesn't install dev
FROM debian:stable-slim AS tests
RUN apt update && apt install -y composer php7.3-gd php7.3-dom php7.3-sqlite3 php-xdebug imagemagick
COPY composer.json composer.lock /app/
WORKDIR /app
RUN composer install
COPY . /app/
ARG RUN_TESTS=true
RUN [ $RUN_TESTS = false ] || (\
echo '=== Installing ===' && mkdir -p data/config && INSTALL_DSN="sqlite:data/shimmie.sqlite" php index.php && \
echo '=== Smoke Test ===' && php index.php get-page /post/list && \
echo '=== Unit Tests ===' && ./vendor/bin/phpunit --configuration tests/phpunit.xml && \
echo '=== Coverage ===' && ./vendor/bin/phpunit --configuration tests/phpunit.xml --coverage-text && \
echo '=== Cleaning ===' && rm -rf data)
# Build su-exec so that our final image can be nicer
FROM debian:stable-slim AS suexec
RUN apt-get update && apt-get install -y --no-install-recommends gcc libc-dev curl
RUN curl -k -o /usr/local/bin/su-exec.c https://raw.githubusercontent.com/ncopa/su-exec/master/su-exec.c; \
gcc -Wall /usr/local/bin/su-exec.c -o/usr/local/bin/su-exec; \
chown root:root /usr/local/bin/su-exec; \
chmod 0755 /usr/local/bin/su-exec;
# Actually run shimmie
FROM debian:stable-slim
EXPOSE 8000
HEALTHCHECK --interval=5m --timeout=3s CMD curl --fail http://127.0.0.1:8000/ || exit 1
ENV UID=1000 \
GID=1000
RUN apt update && apt install -y curl \
php7.3-cli php7.3-gd php7.3-pgsql php7.3-mysql php7.3-sqlite3 php7.3-zip php7.3-dom php7.3-mbstring \
imagemagick zip unzip && \
rm -rf /var/lib/apt/lists/*
COPY --from=app /app /app
COPY --from=suexec /usr/local/bin/su-exec /usr/local/bin/su-exec
WORKDIR /app
CMD ["/bin/sh", "/app/tests/docker-init.sh"]

339
LICENSE.txt Normal file
View File

@ -0,0 +1,339 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc., <http://fsf.org/>
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
{description}
Copyright (C) {year} {fullname}
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
{signature of Ty Coon}, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.

43
README.md Normal file
View File

@ -0,0 +1,43 @@
```
_________.__ .__ .__ ________
/ _____/| |__ |__| _____ _____ |__| ____ \_____ \
\_____ \ | | \ | | / \ / \ | |_/ __ \ / ____/
/ \| Y \| || Y Y \| Y Y \| |\ ___/ / \
/_______ /|___| /|__||__|_| /|__|_| /|__| \___ >\_______ \
\/ \/ \/ \/ \/ \/
```
# Shimmie
[![Test & Publish](https://github.com/shish/shimmie2/workflows/Test%20&%20Publish/badge.svg)](https://github.com/shish/shimmie2/actions)
[![Code Quality](https://scrutinizer-ci.com/g/shish/shimmie2/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/shish/shimmie2/?branch=master)
[![Code Coverage](https://scrutinizer-ci.com/g/shish/shimmie2/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/shish/shimmie2/?branch=master)
# Documentation
* [Install straight on disk](https://github.com/shish/shimmie2/wiki/Install)
* [Install in docker container](https://github.com/shish/shimmie2/wiki/Docker)
* [Upgrade process](https://github.com/shish/shimmie2/wiki/Upgrade)
* [Basic settings](https://github.com/shish/shimmie2/wiki/Settings)
* [Advanced config](https://github.com/shish/shimmie2/wiki/Advanced-Config)
* [Developer notes](https://github.com/shish/shimmie2/wiki/Development-Info)
* [High-performance notes](https://github.com/shish/shimmie2/wiki/Performance)
# Contact
Email: webmaster at shishnet.org
Issue/Bug tracker: https://github.com/shish/shimmie2/issues
# Licence
All code is released under the [GNU GPL Version 2](https://www.gnu.org/licenses/gpl-2.0.html) unless mentioned otherwise.
If you give shimmie to someone else, you have to give them the source (which
should be easy, as PHP is an interpreted language...). If you want to add
customisations to your own site, then those customisations belong to you,
and you can do what you want with them.

View File

@ -1,78 +0,0 @@
_________.__ .__ .__ ________
/ _____/| |__ |__| _____ _____ |__| ____ \_____ \
\_____ \ | | \| |/ \ / \| |/ __ \ / ____/
/ \| Y \ | Y Y \ Y Y \ \ ___// \
/_______ /|___| /__|__|_| /__|_| /__|\___ >_______ \
\/ \/ \/ \/ \/ \/
Shimmie2 Release Candidate
~~~~~~~~~~~~~~~~~~~~~~~~~~
Okay, so maybe my estimate of "it should be done within the week" was a bit
optimistic... I did get the first 3.5k lines of code done in a week, then
another 1k of extensions in another week, but making it all work *properly*
took 3 months...
Requirements
~~~~~~~~~~~~
MySQL 4.1+
PHP 5.0+
GD or ImageMagick
PHP 4 support has currently been dropped, because
a) It's a pain in the ass to support
b) Nobody has told me they want it
If you want PHP 4 support, mail me, and I'll see if I can get it working for
version 2.1...
Installation
~~~~~~~~~~~~
1) Create a blank database
2) Unzip shimmie into a folder on the web host
3) Visit the install folder with a web browser
4) Enter the location of the database, and choose login details for the first
admin of the board
5) Click "install". Hopefully you'll end up at the configuration screen; if
not, you should be given instructions on how to fix any errors~
Upgrade from 0.8.4
~~~~~~~~~~~~~~~~~~
BIG NOTE: 0.8.4 is the only version the upgrader supports; please upgrade to
that before going any further! Feel free to try other versions, just don't
complain when it doesn't work :P
Upgrade process:
1) Make backups of everything. The most important things are your database
data, and your images folder. config.php and the thumbs folder are also
very helpful.
2) Check that your backups actually contain the important data, they aren't
just empty files with the right names...
3) Create a new, blank database, separate from the old one
4) Unzip shimmie2 into a different folder than shimmie1
5) Visit the URL of shimmie2
6) Full in the old database location, the new database location, and the full
path to the old installation folder (the folder where the old "images" and
"thumbs" can be found)
7) Click "upgrade"
8) Wait a couple of minutes while data is copied from the old install into the
new one. You may wish to spend these minutes in prayer :P
9) Log in with an existing admin account and set things up to taste
The old installation can now be removed, but you may wish to keep it around
until you're sure everything in v2 is working properly~
Contact
~~~~~~~
http://forum.shishnet.org/viewforum.php?f=6 -- discussion forum
http://trac.shishnet.org/shimmie2/ -- bug tracker
webmaster at shishnet.org -- email
Shish on Freenode -- IRC

67
composer.json Normal file
View File

@ -0,0 +1,67 @@
{
"name": "shish/shimmie2",
"description": "A tag-based image gallery",
"type" : "project",
"license" : "GPL-2.0-or-later",
"minimum-stability" : "dev",
"repositories" : [
{
"type" : "package",
"package" : {
"name" : "ifixit/php-akismet",
"version" : "1.1",
"source" : {
"url" : "https://github.com/iFixit/php-akismet.git",
"type" : "git",
"reference" : "fd4ff50eb577457c1b7b887401663e91e77625ae"
}
}
}
],
"require" : {
"php" : "^7.3",
"ext-pdo": "*",
"ext-json": "*",
"ext-fileinfo": "*",
"flexihash/flexihash" : "^2.0.0",
"ifixit/php-akismet" : "1.*",
"google/recaptcha" : "~1.1",
"dapphp/securimage" : "3.6.*",
"shish/eventtracer-php" : "^2.0.0",
"shish/ffsphp" : "^1.0.0",
"shish/microcrud" : "^2.0.0",
"shish/microhtml" : "^2.0.0",
"enshrined/svg-sanitize" : "0.13.*",
"bower-asset/jquery" : "1.12.*",
"bower-asset/jquery-timeago" : "1.5.*",
"bower-asset/mediaelement" : "2.21.*",
"bower-asset/js-cookie" : "2.1.*"
},
"require-dev" : {
},
"suggest": {
"ext-memcache": "memcache caching",
"ext-memcached": "memcached caching",
"ext-apc": "apc caching",
"ext-redis": "redis caching",
"ext-dom": "some extensions",
"ext-curl": "some extensions",
"ext-ctype": "some extensions",
"ext-json": "some extensions",
"ext-zip": "self-updater extension, bulk import/export",
"ext-zlib": "anti-spam",
"ext-xml": "some extensions",
"ext-gd": "GD-based thumbnailing"
},"replace": {
"bower-asset/jquery": ">=1.11.0",
"bower-asset/inputmask": ">=3.2.0",
"bower-asset/punycode": ">=1.3.0",
"bower-asset/yii2-pjax": ">=2.0.0"
}
}

461
composer.lock generated Normal file
View File

@ -0,0 +1,461 @@
{
"_readme": [
"This file locks the dependencies of your project to a known state",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "ca096500833679c5fa819eb5cfbd1d80",
"packages": [
{
"name": "bower-asset/jquery-timeago",
"version": "v1.5.4",
"source": {
"type": "git",
"url": "git@github.com:rmm5t/jquery-timeago.git",
"reference": "180864a9c544a49e43719b457250af216d5e4c3a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/rmm5t/jquery-timeago/zipball/180864a9c544a49e43719b457250af216d5e4c3a",
"reference": "180864a9c544a49e43719b457250af216d5e4c3a"
},
"require": {
"bower-asset/jquery": ">=1.4"
},
"type": "bower-asset",
"license": [
"MIT"
]
},
{
"name": "bower-asset/js-cookie",
"version": "v2.1.4",
"source": {
"type": "git",
"url": "git@github.com:js-cookie/js-cookie.git",
"reference": "8b70250875f7e07445b6a457f9c2474ead4cba44"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/js-cookie/js-cookie/zipball/8b70250875f7e07445b6a457f9c2474ead4cba44",
"reference": "8b70250875f7e07445b6a457f9c2474ead4cba44"
},
"type": "bower-asset",
"license": [
"MIT"
]
},
{
"name": "bower-asset/mediaelement",
"version": "2.21.2",
"source": {
"type": "git",
"url": "git@github.com:johndyer/mediaelement.git",
"reference": "394db3b4a2e3f5f7988cacdefe62ed973bf4a3ce"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/johndyer/mediaelement/zipball/394db3b4a2e3f5f7988cacdefe62ed973bf4a3ce",
"reference": "394db3b4a2e3f5f7988cacdefe62ed973bf4a3ce"
},
"type": "bower-asset",
"license": [
"MIT"
]
},
{
"name": "dapphp/securimage",
"version": "3.6.8",
"source": {
"type": "git",
"url": "https://github.com/dapphp/securimage.git",
"reference": "5fc5953c4ffba1eb214cc83100672f238c184ca4"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/dapphp/securimage/zipball/5fc5953c4ffba1eb214cc83100672f238c184ca4",
"reference": "5fc5953c4ffba1eb214cc83100672f238c184ca4",
"shasum": ""
},
"require": {
"ext-gd": "*",
"php": ">=5.4"
},
"suggest": {
"ext-pdo": "For database storage support",
"ext-pdo_mysql": "For MySQL database support",
"ext-pdo_sqlite": "For SQLite3 database support"
},
"type": "library",
"autoload": {
"classmap": [
"securimage.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Drew Phillips",
"email": "drew@drew-phillips.com"
}
],
"description": "PHP CAPTCHA Library",
"homepage": "https://www.phpcaptcha.org",
"keywords": [
"Forms",
"anti-spam",
"captcha",
"security"
],
"time": "2020-05-30T09:43:22+00:00"
},
{
"name": "enshrined/svg-sanitize",
"version": "0.13.3",
"source": {
"type": "git",
"url": "https://github.com/darylldoyle/svg-sanitizer.git",
"reference": "bc66593f255b7d2613d8f22041180036979b6403"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/darylldoyle/svg-sanitizer/zipball/bc66593f255b7d2613d8f22041180036979b6403",
"reference": "bc66593f255b7d2613d8f22041180036979b6403",
"shasum": ""
},
"require": {
"ext-dom": "*",
"ext-libxml": "*"
},
"require-dev": {
"codeclimate/php-test-reporter": "^0.1.2",
"phpunit/phpunit": "^6"
},
"type": "library",
"autoload": {
"psr-4": {
"enshrined\\svgSanitize\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"GPL-2.0-or-later"
],
"authors": [
{
"name": "Daryll Doyle",
"email": "daryll@enshrined.co.uk"
}
],
"description": "An SVG sanitizer for PHP",
"time": "2020-01-20T01:34:17+00:00"
},
{
"name": "flexihash/flexihash",
"version": "v2.0.2",
"source": {
"type": "git",
"url": "https://github.com/pda/flexihash.git",
"reference": "497ba5782606d998f8ab0b4e5942e3a799bec018"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/pda/flexihash/zipball/497ba5782606d998f8ab0b4e5942e3a799bec018",
"reference": "497ba5782606d998f8ab0b4e5942e3a799bec018",
"shasum": ""
},
"require": {
"php": ">=5.4.0"
},
"require-dev": {
"phpunit/phpunit": "^4.8",
"satooshi/php-coveralls": "~1.0",
"squizlabs/php_codesniffer": "^2.3",
"symfony/config": "^2.0.0",
"symfony/console": "^2.0.0",
"symfony/filesystem": "^2.0.0",
"symfony/stopwatch": "^2.0.0",
"symfony/yaml": "^2.0.0"
},
"type": "library",
"autoload": {
"psr-4": {
"Flexihash\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Paul Annesley",
"email": "paul@annesley.cc",
"homepage": "http://paul.annesley.cc"
},
{
"name": "Dom Morgan",
"email": "dom@d3r.com",
"homepage": "https://d3r.com"
}
],
"description": "Flexihash is a small PHP library which implements consistent hashing",
"homepage": "https://github.com/pda/flexihash",
"time": "2016-04-22T21:03:23+00:00"
},
{
"name": "google/recaptcha",
"version": "dev-master",
"source": {
"type": "git",
"url": "https://github.com/google/recaptcha.git",
"reference": "79ccf652575e138d51742d04e78a5adbb9892f9d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/google/recaptcha/zipball/79ccf652575e138d51742d04e78a5adbb9892f9d",
"reference": "79ccf652575e138d51742d04e78a5adbb9892f9d",
"shasum": ""
},
"require": {
"php": ">=5.5"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^2.2.20|^2.15",
"php-coveralls/php-coveralls": "^2.1",
"phpunit/phpunit": "^4.8.36|^5.7.27|^6.59|^7.5.11"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.2.x-dev"
}
},
"autoload": {
"psr-4": {
"ReCaptcha\\": "src/ReCaptcha"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"description": "Client library for reCAPTCHA, a free service that protects websites from spam and abuse.",
"homepage": "https://www.google.com/recaptcha/",
"keywords": [
"Abuse",
"captcha",
"recaptcha",
"spam"
],
"time": "2020-05-21T08:56:25+00:00"
},
{
"name": "ifixit/php-akismet",
"version": "1.1",
"source": {
"type": "git",
"url": "https://github.com/iFixit/php-akismet.git",
"reference": "fd4ff50eb577457c1b7b887401663e91e77625ae"
},
"type": "library"
},
{
"name": "shish/eventtracer-php",
"version": "v2.0.0",
"source": {
"type": "git",
"url": "https://github.com/shish/eventtracer-php.git",
"reference": "0328454c58d240667f004f3efd863b8ef521ba2a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/shish/eventtracer-php/zipball/0328454c58d240667f004f3efd863b8ef521ba2a",
"reference": "0328454c58d240667f004f3efd863b8ef521ba2a",
"shasum": ""
},
"require": {
"ext-json": "*",
"php": "^7.3"
},
"require-dev": {
"phpunit/phpunit": "^9.0"
},
"type": "library",
"autoload": {
"classmap": [
"src/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Shish",
"email": "webmaster@shishnet.org",
"homepage": "http://shishnet.org",
"role": "Developer"
}
],
"description": "An API to write JSON traces as used by the Chrome Trace Viewer",
"homepage": "https://github.com/shish/eventtracer-php",
"time": "2020-09-20T11:46:44+00:00"
},
{
"name": "shish/ffsphp",
"version": "v1.0.2",
"source": {
"type": "git",
"url": "https://github.com/shish/ffsphp.git",
"reference": "82d45b2691da11c82a28f85b07752334a06b8a8e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/shish/ffsphp/zipball/82d45b2691da11c82a28f85b07752334a06b8a8e",
"reference": "82d45b2691da11c82a28f85b07752334a06b8a8e",
"shasum": ""
},
"require": {
"php": "^7.3"
},
"require-dev": {
"phpunit/phpunit": "^9.0"
},
"type": "library",
"autoload": {
"psr-4": {
"FFSPHP\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Shish",
"email": "webmaster@shishnet.org",
"homepage": "http://shishnet.org",
"role": "Developer"
}
],
"description": "A collection of workarounds for stupid PHP things",
"homepage": "https://github.com/shish/ffsphp",
"time": "2020-09-20T13:15:53+00:00"
},
{
"name": "shish/microcrud",
"version": "v2.0.0",
"source": {
"type": "git",
"url": "https://github.com/shish/microcrud.git",
"reference": "1d55c02c405fc75ad6a0e952e9333552bef492f0"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/shish/microcrud/zipball/1d55c02c405fc75ad6a0e952e9333552bef492f0",
"reference": "1d55c02c405fc75ad6a0e952e9333552bef492f0",
"shasum": ""
},
"require": {
"ext-pdo": "*",
"php": "^7.3",
"shish/ffsphp": "^1.0",
"shish/microhtml": "^2.0.2"
},
"require-dev": {
"phpunit/phpunit": "^9.0"
},
"type": "library",
"autoload": {
"psr-4": {
"MicroCRUD\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Shish",
"email": "webmaster@shishnet.org",
"homepage": "http://shishnet.org",
"role": "Developer"
}
],
"description": "A minimal CRUD generating library",
"homepage": "https://github.com/shish/microcrud",
"keywords": [
"crud",
"generator"
],
"time": "2020-09-20T13:10:42+00:00"
},
{
"name": "shish/microhtml",
"version": "v2.0.2",
"source": {
"type": "git",
"url": "https://github.com/shish/microhtml.git",
"reference": "d5c393d5a47bb3b3febdfde9ebf6e91cb9b41947"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/shish/microhtml/zipball/d5c393d5a47bb3b3febdfde9ebf6e91cb9b41947",
"reference": "d5c393d5a47bb3b3febdfde9ebf6e91cb9b41947",
"shasum": ""
},
"require": {
"php": "^7.3"
},
"require-dev": {
"phpunit/phpunit": "^9.0"
},
"type": "library",
"autoload": {
"files": [
"src/microhtml.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Shish",
"email": "webmaster@shishnet.org",
"homepage": "http://shishnet.org",
"role": "Developer"
}
],
"description": "A minimal HTML generating library",
"homepage": "https://github.com/shish/microhtml",
"keywords": [
"generator",
"html"
],
"time": "2020-09-20T13:05:01+00:00"
}
],
"packages-dev": [],
"aliases": [],
"minimum-stability": "dev",
"stability-flags": [],
"prefer-stable": false,
"prefer-lowest": false,
"platform": {
"php": "^7.3",
"ext-pdo": "*",
"ext-json": "*",
"ext-fileinfo": "*"
},
"platform-dev": [],
"plugin-api-version": "1.1.0"
}

667
core/basepage.php Normal file
View File

@ -0,0 +1,667 @@
<?php declare(strict_types=1);
require_once "core/event.php";
abstract class PageMode
{
const REDIRECT = 'redirect';
const DATA = 'data';
const PAGE = 'page';
const FILE = 'file';
const MANUAL = 'manual';
}
/**
* Class Page
*
* A data structure for holding all the bits of data that make up a page.
*
* The various extensions all add whatever they want to this structure,
* then Layout turns it into HTML.
*/
class BasePage
{
/** @var string */
public $mode = PageMode::PAGE;
/** @var string */
private $type = "text/html; charset=utf-8";
/**
* Set what this page should do; "page", "data", or "redirect".
*/
public function set_mode(string $mode): void
{
$this->mode = $mode;
}
/**
* Set the page's MIME type.
*/
public function set_type(string $type): void
{
$this->type = $type;
}
public function __construct()
{
if (@$_GET["flash"]) {
$this->flash[] = $_GET['flash'];
unset($_GET["flash"]);
}
}
// ==============================================
/** @var string; public only for unit test */
public $data = "";
/** @var string */
private $file = null;
/** @var bool */
private $file_delete = false;
/** @var string */
private $filename = null;
private $disposition = null;
/**
* Set the raw data to be sent.
*/
public function set_data(string $data): void
{
$this->data = $data;
}
public function set_file(string $file, bool $delete = false): void
{
$this->file = $file;
$this->file_delete = $delete;
}
/**
* Set the recommended download filename.
*/
public function set_filename(string $filename, string $disposition = "attachment"): void
{
$this->filename = $filename;
$this->disposition = $disposition;
}
// ==============================================
/** @var string */
public $redirect = "";
/**
* Set the URL to redirect to (remember to use make_link() if linking
* to a page in the same site).
*/
public function set_redirect(string $redirect): void
{
$this->redirect = $redirect;
}
// ==============================================
/** @var int */
public $code = 200;
/** @var string */
public $title = "";
/** @var string */
public $heading = "";
/** @var string */
public $subheading = "";
/** @var string[] */
public $html_headers = [];
/** @var string[] */
public $http_headers = [];
/** @var string[][] */
public $cookies = [];
/** @var Block[] */
public $blocks = [];
/** @var string[] */
public $flash = [];
/**
* Set the HTTP status code
*/
public function set_code(int $code): void
{
$this->code = $code;
}
public function set_title(string $title): void
{
$this->title = $title;
}
public function set_heading(string $heading): void
{
$this->heading = $heading;
}
public function set_subheading(string $subheading): void
{
$this->subheading = $subheading;
}
public function flash(string $message): void
{
$this->flash[] = $message;
}
/**
* Add a line to the HTML head section.
*/
public function add_html_header(string $line, int $position = 50): void
{
while (isset($this->html_headers[$position])) {
$position++;
}
$this->html_headers[$position] = $line;
}
/**
* Add a http header to be sent to the client.
*/
public function add_http_header(string $line, int $position = 50): void
{
while (isset($this->http_headers[$position])) {
$position++;
}
$this->http_headers[$position] = $line;
}
/**
* The counterpart for get_cookie, this works like php's
* setcookie method, but prepends the site-wide cookie prefix to
* the $name argument before doing anything.
*/
public function add_cookie(string $name, string $value, int $time, string $path): void
{
$full_name = COOKIE_PREFIX . "_" . $name;
$this->cookies[] = [$full_name, $value, $time, $path];
}
public function get_cookie(string $name): ?string
{
$full_name = COOKIE_PREFIX . "_" . $name;
if (isset($_COOKIE[$full_name])) {
return $_COOKIE[$full_name];
} else {
return null;
}
}
/**
* Get all the HTML headers that are currently set and return as a string.
*/
public function get_all_html_headers(): string
{
$data = '';
ksort($this->html_headers);
foreach ($this->html_headers as $line) {
$data .= "\t\t" . $line . "\n";
}
return $data;
}
/**
* Add a Block of data to the page.
*/
public function add_block(Block $block): void
{
$this->blocks[] = $block;
}
/**
* Find a block which contains the given text
* (Useful for unit tests)
*/
public function find_block(string $text): ?Block
{
foreach ($this->blocks as $block) {
if ($block->header == $text) {
return $block;
}
}
return null;
}
// ==============================================
public function send_headers(): void
{
if (!headers_sent()) {
header("HTTP/1.0 {$this->code} Shimmie");
header("Content-type: " . $this->type);
header("X-Powered-By: Shimmie-" . VERSION);
foreach ($this->http_headers as $head) {
header($head);
}
foreach ($this->cookies as $c) {
setcookie($c[0], $c[1], $c[2], $c[3]);
}
} else {
print "Error: Headers have already been sent to the client.";
}
}
/**
* Display the page according to the mode and data given.
*/
public function display(): void
{
if ($this->mode!=PageMode::MANUAL) {
$this->send_headers();
}
switch ($this->mode) {
case PageMode::MANUAL:
break;
case PageMode::PAGE:
usort($this->blocks, "blockcmp");
$this->add_auto_html_headers();
$this->render();
break;
case PageMode::DATA:
header("Content-Length: " . strlen($this->data));
if (!is_null($this->filename)) {
header('Content-Disposition: ' . $this->disposition . '; filename=' . $this->filename);
}
print $this->data;
break;
case PageMode::FILE:
if (!is_null($this->filename)) {
header('Content-Disposition: ' . $this->disposition . '; filename=' . $this->filename);
}
// https://gist.github.com/codler/3906826
$size = filesize($this->file); // File size
$length = $size; // Content length
$start = 0; // Start byte
$end = $size - 1; // End byte
header("Content-Length: " . $size);
header('Accept-Ranges: bytes');
if (isset($_SERVER['HTTP_RANGE'])) {
list(, $range) = explode('=', $_SERVER['HTTP_RANGE'], 2);
if (strpos($range, ',') !== false) {
header('HTTP/1.1 416 Requested Range Not Satisfiable');
header("Content-Range: bytes $start-$end/$size");
break;
}
if ($range == '-') {
$c_start = $size - (int)substr($range, 1);
$c_end = $end;
} else {
$range = explode('-', $range);
$c_start = (int)$range[0];
$c_end = (isset($range[1]) && is_numeric($range[1])) ? (int)$range[1] : $size;
}
$c_end = ($c_end > $end) ? $end : $c_end;
if ($c_start > $c_end || $c_start > $size - 1 || $c_end >= $size) {
header('HTTP/1.1 416 Requested Range Not Satisfiable');
header("Content-Range: bytes $start-$end/$size");
break;
}
$start = $c_start;
$end = $c_end;
$length = $end - $start + 1;
header('HTTP/1.1 206 Partial Content');
}
header("Content-Range: bytes $start-$end/$size");
header("Content-Length: " . $length);
try {
stream_file($this->file, $start, $end);
} finally {
if ($this->file_delete === true) {
unlink($this->file);
}
}
break;
case PageMode::REDIRECT:
if ($this->flash) {
$this->redirect .= (strpos($this->redirect, "?") === false) ? "?" : "&";
$this->redirect .= "flash=" . url_escape(implode("\n", $this->flash));
}
header('Location: ' . $this->redirect);
print 'You should be redirected to <a href="' . $this->redirect . '">' . $this->redirect . '</a>';
break;
default:
print "Invalid page mode";
break;
}
}
/**
* This function grabs all the CSS and JavaScript files sprinkled throughout Shimmie's folders,
* concatenates them together into two large files (one for CSS and one for JS) and then stores
* them in the /cache/ directory for serving to the user.
*
* Why do this? Two reasons:
* 1. Reduces the number of files the user's browser needs to download.
* 2. Allows these cached files to be compressed/minified by the admin.
*
* TODO: This should really be configurable somehow...
*/
public function add_auto_html_headers(): void
{
global $config;
$data_href = get_base_href();
$theme_name = $config->get_string(SetupConfig::THEME, 'default');
$this->add_html_header("<script type='text/javascript'>base_href = '$data_href';</script>", 40);
# static handler will map these to themes/foo/static/bar.ico or ext/static_files/static/bar.ico
$this->add_html_header("<link rel='icon' type='image/x-icon' href='$data_href/favicon.ico'>", 41);
$this->add_html_header("<link rel='apple-touch-icon' href='$data_href/apple-touch-icon.png'>", 42);
//We use $config_latest to make sure cache is reset if config is ever updated.
$config_latest = 0;
foreach (zglob("data/config/*") as $conf) {
$config_latest = max($config_latest, filemtime($conf));
}
/*** Generate CSS cache files ***/
$css_latest = $config_latest;
$css_files = array_merge(
zglob("ext/{" . Extension::get_enabled_extensions_as_string() . "}/style.css"),
zglob("themes/$theme_name/style.css")
);
foreach ($css_files as $css) {
$css_latest = max($css_latest, filemtime($css));
}
$css_md5 = md5(serialize($css_files));
$css_cache_file = data_path("cache/style/{$theme_name}.{$css_latest}.{$css_md5}.css");
if (!file_exists($css_cache_file)) {
$css_data = "";
foreach ($css_files as $file) {
$file_data = file_get_contents($file);
$pattern = '/url[\s]*\([\s]*["\']?([^"\'\)]+)["\']?[\s]*\)/';
$replace = 'url("../../../' . dirname($file) . '/$1")';
$file_data = preg_replace($pattern, $replace, $file_data);
$css_data .= $file_data . "\n";
}
file_put_contents($css_cache_file, $css_data);
}
$this->add_html_header("<link rel='stylesheet' href='$data_href/$css_cache_file' type='text/css'>", 43);
/*** Generate JS cache files ***/
$js_latest = $config_latest;
$js_files = array_merge(
[
"vendor/bower-asset/jquery-timeago/jquery.timeago.js",
"vendor/bower-asset/js-cookie/src/js.cookie.js",
"ext/static_files/modernizr-3.3.1.custom.js",
],
zglob("ext/{" . Extension::get_enabled_extensions_as_string() . "}/script.js"),
zglob("themes/$theme_name/script.js")
);
foreach ($js_files as $js) {
$js_latest = max($js_latest, filemtime($js));
}
$js_md5 = md5(serialize($js_files));
$js_cache_file = data_path("cache/script/{$theme_name}.{$js_latest}.{$js_md5}.js");
if (!file_exists($js_cache_file)) {
$js_data = "";
foreach ($js_files as $file) {
$js_data .= file_get_contents($file) . "\n";
}
file_put_contents($js_cache_file, $js_data);
}
$this->add_html_header("<script defer src='$data_href/$js_cache_file' type='text/javascript'></script>", 44);
}
protected function get_nav_links()
{
$pnbe = send_event(new PageNavBuildingEvent());
$nav_links = $pnbe->links;
$active_link = null;
// To save on event calls, we check if one of the top-level links has already been marked as active
foreach ($nav_links as $link) {
if ($link->active===true) {
$active_link = $link;
break;
}
}
$sub_links = null;
// If one is, we just query for sub-menu options under that one tab
if ($active_link!==null) {
$psnbe = send_event(new PageSubNavBuildingEvent($active_link->name));
$sub_links = $psnbe->links;
} else {
// Otherwise we query for the sub-items under each of the tabs
foreach ($nav_links as $link) {
$psnbe = send_event(new PageSubNavBuildingEvent($link->name));
// Now we check for a current link so we can identify the sub-links to show
foreach ($psnbe->links as $sub_link) {
if ($sub_link->active===true) {
$sub_links = $psnbe->links;
break;
}
}
// If the active link has been detected, we break out
if ($sub_links!==null) {
$link->active = true;
break;
}
}
}
$sub_links = $sub_links??[];
usort($nav_links, "sort_nav_links");
usort($sub_links, "sort_nav_links");
return [$nav_links, $sub_links];
}
/**
* turns the Page into HTML
*/
public function render()
{
$head_html = $this->head_html();
$body_html = $this->body_html();
print <<<EOD
<!doctype html>
<html class="no-js" lang="en">
$head_html
$body_html
</html>
EOD;
}
protected function head_html(): string
{
$html_header_html = $this->get_all_html_headers();
return "
<head>
<title>{$this->title}</title>
$html_header_html
</head>
";
}
protected function body_html(): string
{
$left_block_html = "";
$main_block_html = "";
$sub_block_html = "";
foreach ($this->blocks as $block) {
switch ($block->section) {
case "left":
$left_block_html .= $block->get_html(true);
break;
case "main":
$main_block_html .= $block->get_html(false);
break;
case "subheading":
$sub_block_html .= $block->get_html(false);
break;
default:
print "<p>error: {$block->header} using an unknown section ({$block->section})";
break;
}
}
$wrapper = "";
if (strlen($this->heading) > 100) {
$wrapper = ' style="height: 3em; overflow: auto;"';
}
$footer_html = $this->footer_html();
$flash_html = $this->flash ? "<b id='flash'>".nl2br(html_escape(implode("\n", $this->flash)))."</b>" : "";
return "
<body>
<header>
<h1$wrapper>{$this->heading}</h1>
$sub_block_html
</header>
<nav>
$left_block_html
</nav>
<article>
$flash_html
$main_block_html
</article>
<footer>
$footer_html
</footer>
</body>
";
}
protected function footer_html(): string
{
$debug = get_debug_info();
$contact_link = contact_link();
$contact = empty($contact_link) ? "" : "<br><a href='$contact_link'>Contact</a>";
return "
Images &copy; their respective owners,
<a href=\"https://code.shishnet.org/shimmie2/\">Shimmie</a> &copy;
<a href=\"https://www.shishnet.org/\">Shish</a> &amp;
<a href=\"https://github.com/shish/shimmie2/graphs/contributors\">The Team</a>
2007-2020,
based on the Danbooru concept.
$debug
$contact
";
}
}
class PageNavBuildingEvent extends Event
{
public $links = [];
public function add_nav_link(string $name, Link $link, string $desc, ?bool $active = null, int $order = 50)
{
$this->links[] = new NavLink($name, $link, $desc, $active, $order);
}
}
class PageSubNavBuildingEvent extends Event
{
public $parent;
public $links = [];
public function __construct(string $parent)
{
parent::__construct();
$this->parent= $parent;
}
public function add_nav_link(string $name, Link $link, string $desc, ?bool $active = null, int $order = 50)
{
$this->links[] = new NavLink($name, $link, $desc, $active, $order);
}
}
class NavLink
{
public $name;
public $link;
public $description;
public $order;
public $active = false;
public function __construct(String $name, Link $link, String $description, ?bool $active = null, int $order = 50)
{
global $config;
$this->name = $name;
$this->link = $link;
$this->description = $description;
$this->order = $order;
if ($active==null) {
$query = ltrim(_get_query(), "/");
if ($query === "") {
// This indicates the front page, so we check what's set as the front page
$front_page = trim($config->get_string(SetupConfig::FRONT_PAGE), "/");
if ($front_page === $link->page) {
$this->active = true;
} else {
$this->active = self::is_active([$link->page], $front_page);
}
} elseif ($query===$link->page) {
$this->active = true;
} else {
$this->active = self::is_active([$link->page]);
}
} else {
$this->active = $active;
}
}
public static function is_active(array $pages_matched, string $url = null): bool
{
/**
* Woo! We can actually SEE THE CURRENT PAGE!! (well... see it highlighted in the menu.)
*/
$url = $url??ltrim(_get_query(), "/");
$re1='.*?';
$re2='((?:[a-z][a-z_]+))';
if (preg_match_all("/".$re1.$re2."/is", $url, $matches)) {
$url=$matches[1][0];
}
$count_pages_matched = count($pages_matched);
for ($i=0; $i < $count_pages_matched; $i++) {
if ($url == $pages_matched[$i]) {
return true;
}
}
return false;
}
}
function sort_nav_links(NavLink $a, NavLink $b)
{
return $a->order - $b->order;
}

149
core/basethemelet.php Normal file
View File

@ -0,0 +1,149 @@
<?php declare(strict_types=1);
/**
* Class BaseThemelet
*
* A collection of common functions for theme parts
*/
class BaseThemelet
{
/**
* Generic error message display
*/
public function display_error(int $code, string $title, string $message): void
{
global $page;
$page->set_code($code);
$page->set_title($title);
$page->set_heading($title);
$has_nav = false;
foreach ($page->blocks as $block) {
if ($block->header == "Navigation") {
$has_nav = true;
break;
}
}
if (!$has_nav) {
$page->add_block(new NavBlock());
}
$page->add_block(new Block("Error", $message));
}
/**
* A specific, common error message
*/
public function display_permission_denied(): void
{
$this->display_error(403, "Permission Denied", "You do not have permission to access this page");
}
/**
* Generic thumbnail code; returns HTML rather than adding
* a block since thumbs tend to go inside blocks...
*/
public function build_thumb_html(Image $image): string
{
global $config;
$i_id = (int) $image->id;
$h_view_link = make_link('post/view/'.$i_id);
$h_thumb_link = $image->get_thumb_link();
$h_tip = html_escape($image->get_tooltip());
$h_tags = html_escape(strtolower($image->get_tag_list()));
$extArr = array_flip([EXTENSION_FLASH, EXTENSION_SVG, EXTENSION_MP3]); //List of thumbless filetypes
if (!isset($extArr[$image->ext])) {
$tsize = get_thumbnail_size($image->width, $image->height);
} else {
//Use max thumbnail size if using thumbless filetype
$tsize = get_thumbnail_size($config->get_int(ImageConfig::THUMB_WIDTH), $config->get_int(ImageConfig::THUMB_WIDTH));
}
$custom_classes = "";
if (class_exists("Relationships")) {
if (property_exists($image, 'parent_id') && $image->parent_id !== null) {
$custom_classes .= "shm-thumb-has_parent ";
}
if (property_exists($image, 'has_children') && bool_escape($image->has_children)) {
$custom_classes .= "shm-thumb-has_child ";
}
}
return "<a href='$h_view_link' class='thumb shm-thumb shm-thumb-link {$custom_classes}' data-tags='$h_tags' data-post-id='$i_id'>".
"<img id='thumb_$i_id' title='$h_tip' alt='$h_tip' height='{$tsize[1]}' width='{$tsize[0]}' src='$h_thumb_link'>".
"</a>\n";
}
public function display_paginator(Page $page, string $base, ?string $query, int $page_number, int $total_pages, bool $show_random = false)
{
if ($total_pages == 0) {
$total_pages = 1;
}
$body = $this->build_paginator($page_number, $total_pages, $base, $query, $show_random);
$page->add_block(new Block(null, $body, "main", 90, "paginator"));
$page->add_html_header("<link rel='first' href='".make_http(make_link($base.'/1', $query))."'>");
if ($page_number < $total_pages) {
$page->add_html_header("<link rel='prefetch' href='".make_http(make_link($base.'/'.($page_number+1), $query))."'>");
$page->add_html_header("<link rel='next' href='".make_http(make_link($base.'/'.($page_number+1), $query))."'>");
}
if ($page_number > 1) {
$page->add_html_header("<link rel='previous' href='".make_http(make_link($base.'/'.($page_number-1), $query))."'>");
}
$page->add_html_header("<link rel='last' href='".make_http(make_link($base.'/'.$total_pages, $query))."'>");
}
private function gen_page_link(string $base_url, ?string $query, int $page, string $name): string
{
$link = make_link($base_url.'/'.$page, $query);
return '<a href="'.$link.'">'.$name.'</a>';
}
private function gen_page_link_block(string $base_url, ?string $query, int $page, int $current_page, string $name): string
{
$paginator = "";
if ($page == $current_page) {
$paginator .= "<b>";
}
$paginator .= $this->gen_page_link($base_url, $query, $page, $name);
if ($page == $current_page) {
$paginator .= "</b>";
}
return $paginator;
}
private function build_paginator(int $current_page, int $total_pages, string $base_url, ?string $query, bool $show_random): string
{
$next = $current_page + 1;
$prev = $current_page - 1;
$at_start = ($current_page <= 1 || $total_pages <= 1);
$at_end = ($current_page >= $total_pages);
$first_html = $at_start ? "First" : $this->gen_page_link($base_url, $query, 1, "First");
$prev_html = $at_start ? "Prev" : $this->gen_page_link($base_url, $query, $prev, "Prev");
$random_html = "-";
if ($show_random) {
$rand = mt_rand(1, $total_pages);
$random_html = $this->gen_page_link($base_url, $query, $rand, "Random");
}
$next_html = $at_end ? "Next" : $this->gen_page_link($base_url, $query, $next, "Next");
$last_html = $at_end ? "Last" : $this->gen_page_link($base_url, $query, $total_pages, "Last");
$start = $current_page-5 > 1 ? $current_page-5 : 1;
$end = $start+10 < $total_pages ? $start+10 : $total_pages;
$pages = [];
foreach (range($start, $end) as $i) {
$pages[] = $this->gen_page_link_block($base_url, $query, $i, $current_page, (string)$i);
}
$pages_html = implode(" | ", $pages);
return $first_html.' | '.$prev_html.' | '.$random_html.' | '.$next_html.' | '.$last_html
.'<br>&lt;&lt; '.$pages_html.' &gt;&gt;';
}
}

View File

@ -1,11 +0,0 @@
<?php
class Block {
var $header;
var $body;
public function Block($header, $body) {
$this->header = $header;
$this->body = $body;
}
}
?>

105
core/block.php Normal file
View File

@ -0,0 +1,105 @@
<?php declare(strict_types=1);
/**
* Class Block
*
* A basic chunk of a page.
*/
class Block
{
/**
* The block's title.
*
* @var string
*/
public $header;
/**
* The content of the block.
*
* @var string
*/
public $body;
/**
* Where the block should be placed. The default theme supports
* "main" and "left", other themes can add their own areas.
*
* @var string
*/
public $section;
/**
* How far down the section the block should appear, higher
* numbers appear lower. The scale is 0-100 by convention,
* though any number will work.
*
* @var int
*/
public $position;
/**
* A unique ID for the block.
*
* @var string
*/
public $id;
/**
* Should this block count as content for the sake of
* the 404 handler
*
* @var boolean
*/
public $is_content = true;
public function __construct(string $header=null, string $body=null, string $section="main", int $position=50, string $id=null)
{
$this->header = $header;
$this->body = $body;
$this->section = $section;
$this->position = $position;
if (is_null($id)) {
$id = (empty($header) ? md5($body ?? '') : $header) . $section;
}
$this->id = preg_replace('/[^\w-]/', '', str_replace(' ', '_', $id));
}
/**
* Get the HTML for this block.
*/
public function get_html(bool $hidable=false): string
{
$h = $this->header;
$b = $this->body;
$i = $this->id;
$html = "<section id='$i'>";
$h_toggler = $hidable ? " shm-toggler" : "";
if (!empty($h)) {
$html .= "<h3 data-toggle-sel='#$i' class='$h_toggler'>$h</h3>";
}
if (!empty($b)) {
$html .= "<div class='blockbody'>$b</div>";
}
$html .= "</section>\n";
return $html;
}
}
/**
* Class NavBlock
*
* A generic navigation block with a link to the main page.
*
* Used because "new NavBlock()" is easier than "new Block('Navigation', ..."
*
*/
class NavBlock extends Block
{
public function __construct()
{
parent::__construct("Navigation", "<a href='".make_link()."'>Index</a>", "left", 0);
}
}

199
core/cacheengine.php Normal file
View File

@ -0,0 +1,199 @@
<?php declare(strict_types=1);
interface CacheEngine
{
public function get(string $key);
public function set(string $key, $val, int $time=0);
public function delete(string $key);
}
class NoCache implements CacheEngine
{
public function get(string $key)
{
return false;
}
public function set(string $key, $val, int $time=0)
{
}
public function delete(string $key)
{
}
}
class MemcachedCache implements CacheEngine
{
/** @var ?Memcached */
public $memcache=null;
public function __construct(string $args)
{
$hp = explode(":", $args);
$this->memcache = new Memcached;
#$this->memcache->setOption(Memcached::OPT_COMPRESSION, False);
#$this->memcache->setOption(Memcached::OPT_SERIALIZER, Memcached::SERIALIZER_PHP);
#$this->memcache->setOption(Memcached::OPT_PREFIX_KEY, phpversion());
$this->memcache->addServer($hp[0], (int)$hp[1]);
}
public function get(string $key)
{
$key = urlencode($key);
$val = $this->memcache->get($key);
$res = $this->memcache->getResultCode();
if ($res == Memcached::RES_SUCCESS) {
return $val;
} elseif ($res == Memcached::RES_NOTFOUND) {
return false;
} else {
error_log("Memcached error during get($key): $res");
return false;
}
}
public function set(string $key, $val, int $time=0)
{
$key = urlencode($key);
$this->memcache->set($key, $val, $time);
$res = $this->memcache->getResultCode();
if ($res != Memcached::RES_SUCCESS) {
error_log("Memcached error during set($key): $res");
}
}
public function delete(string $key)
{
$key = urlencode($key);
$this->memcache->delete($key);
$res = $this->memcache->getResultCode();
if ($res != Memcached::RES_SUCCESS && $res != Memcached::RES_NOTFOUND) {
error_log("Memcached error during delete($key): $res");
}
}
}
class APCCache implements CacheEngine
{
public function __construct(string $args)
{
// $args is not used, but is passed in when APC cache is created.
}
public function get(string $key)
{
return apc_fetch($key);
}
public function set(string $key, $val, int $time=0)
{
apc_store($key, $val, $time);
}
public function delete(string $key)
{
apc_delete($key);
}
}
class RedisCache implements CacheEngine
{
private $redis=null;
public function __construct(string $args)
{
$this->redis = new Redis();
$hp = explode(":", $args);
$this->redis->pconnect($hp[0], (int)$hp[1]);
$this->redis->setOption(Redis::OPT_SERIALIZER, Redis::SERIALIZER_PHP);
$this->redis->setOption(Redis::OPT_PREFIX, 'shm:');
}
public function get(string $key)
{
return $this->redis->get($key);
}
public function set(string $key, $val, int $time=0)
{
if ($time > 0) {
$this->redis->setEx($key, $time, $val);
} else {
$this->redis->set($key, $val);
}
}
public function delete(string $key)
{
$this->redis->del($key);
}
}
class Cache
{
public $engine;
public $hits=0;
public $misses=0;
public $time=0;
public function __construct(?string $dsn)
{
$matches = [];
$c = null;
if ($dsn && preg_match("#(.*)://(.*)#", $dsn, $matches) && !isset($_GET['DISABLE_CACHE'])) {
if ($matches[1] == "memcached") {
$c = new MemcachedCache($matches[2]);
} elseif ($matches[1] == "apc") {
$c = new APCCache($matches[2]);
} elseif ($matches[1] == "redis") {
$c = new RedisCache($matches[2]);
}
} else {
$c = new NoCache();
}
$this->engine = $c;
}
public function get(string $key)
{
global $_tracer;
$_tracer->begin("Cache Query", ["key"=>$key]);
$val = $this->engine->get($key);
if ($val !== false) {
$res = "hit";
$this->hits++;
} else {
$res = "miss";
$this->misses++;
}
$_tracer->end(null, ["result"=>$res]);
return $val;
}
public function set(string $key, $val, int $time=0)
{
global $_tracer;
$_tracer->begin("Cache Set", ["key"=>$key, "time"=>$time]);
$this->engine->set($key, $val, $time);
$_tracer->end();
}
public function delete(string $key)
{
global $_tracer;
$_tracer->begin("Cache Delete", ["key"=>$key]);
$this->engine->delete($key);
$_tracer->end();
}
public function get_hits(): int
{
return $this->hits;
}
public function get_misses(): int
{
return $this->misses;
}
}

60
core/captcha.php Normal file
View File

@ -0,0 +1,60 @@
<?php declare(strict_types=1);
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
* CAPTCHA abstraction *
\* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
use ReCaptcha\ReCaptcha;
function captcha_get_html(): string
{
global $config, $user;
if (DEBUG && ip_in_range($_SERVER['REMOTE_ADDR'], "127.0.0.0/8")) {
return "";
}
$captcha = "";
if ($user->is_anonymous() && $config->get_bool("comment_captcha")) {
$r_publickey = $config->get_string("api_recaptcha_pubkey");
if (!empty($r_publickey)) {
$captcha = "
<div class=\"g-recaptcha\" data-sitekey=\"{$r_publickey}\"></div>
<script type=\"text/javascript\" src=\"https://www.google.com/recaptcha/api.js\"></script>";
} else {
session_start();
$captcha = Securimage::getCaptchaHtml(['securimage_path' => './vendor/dapphp/securimage/']);
}
}
return $captcha;
}
function captcha_check(): bool
{
global $config, $user;
if (DEBUG && ip_in_range($_SERVER['REMOTE_ADDR'], "127.0.0.0/8")) {
return true;
}
if ($user->is_anonymous() && $config->get_bool("comment_captcha")) {
$r_privatekey = $config->get_string('api_recaptcha_privkey');
if (!empty($r_privatekey)) {
$recaptcha = new ReCaptcha($r_privatekey);
$resp = $recaptcha->verify($_POST['g-recaptcha-response'], $_SERVER['REMOTE_ADDR']);
if (!$resp->isSuccess()) {
log_info("core", "Captcha failed (ReCaptcha): " . implode("", $resp->getErrorCodes()));
return false;
}
} else {
session_start();
$securimg = new Securimage();
if ($securimg->check($_POST['captcha_code']) === false) {
log_info("core", "Captcha failed (Securimage)");
return false;
}
}
}
return true;
}

View File

@ -1,128 +0,0 @@
<?php
class Config {
var $values = array(
'image_tlink' => '/thumbs/$id.jpg',
'image_ilink' => '/images/$id.$ext',
);
var $defaults = array(
'title' => 'Shimmie', # setup
'version' => 'Shimmie2-0.0.9', // internal
'db_version' => '2.0.0.9', // this should be managed by upgrade.php
'base_href' => './index.php?q=', # setup
'data_href' => './', # setup
'theme' => 'default', # setup
'debug_enabled' => true, # hidden
'anon_id' => 0, # general
'dir_images' => 'images', # general
'dir_thumbs' => 'thumbs', # general
'index_width' => 3, # index
'index_height' => 4, # index
'index_tips' => true,
'thumb_width' => 192, # index
'thumb_height' => 192, # index
'thumb_quality' => 75, # index
'thumb_gd_mem_limit' => '8MB', # upload
'view_scale' => false, # view
'tags_default' => 'map', # (ignored)
'tags_min' => '2', # tags
'upload_count' => 3, # upload
'upload_size' => '256KB', # upload
'upload_anon' => true, # upload
'comment_anon' => true, # comment
'comment_window' => 5, # comment
'comment_limit' => 3, # comment
'comment_count' => 5, # comment
'popular_count' => 15, # popular
'info_link' => 'http://tags.shishnet.org/wiki/$tag', # popular
'login_signup_enabled' => true, # user
'login_memory' => 7, # user
'image_ilink' => '$base/image/$id.$ext', # view
'image_slink' => '', # view
'image_tlink' => '$base/thumb/$id.jpg', # view
'image_tip' => '$tags // $size // $filesize' # view
);
public function Config() {
global $database;
$this->values = $database->db->GetAssoc("SELECT name, value FROM config");
}
public function save($name=null) {
global $database;
if(is_null($name)) {
foreach($this->values as $name => $value) {
// does "or update" work with sqlite / postgres?
$database->db->StartTrans();
$database->db->Execute("DELETE FROM config WHERE name = ?", array($name));
$database->db->Execute("INSERT INTO config VALUES (?, ?)", array($name, $value));
$database->db->CommitTrans();
}
}
else {
$database->db->StartTrans();
$database->db->Execute("DELETE FROM config WHERE name = ?", array($name));
$database->db->Execute("INSERT INTO config VALUES (?, ?)", array($name, $this->values[$name]));
$database->db->CommitTrans();
}
}
public function set_int($name, $value) {
$this->values[$name] = parse_shorthand_int($value);
$this->save($name);
}
public function set_string($name, $value) {
$this->values[$name] = $value;
$this->save($name);
}
public function set_bool($name, $value) {
$this->values[$name] = (($value == 'on' || $value === true) ? 'Y' : 'N');
$this->save($name);
}
public function set_int_from_post($name) {
if(isset($_POST[$name])) {
$this->values[$name] = $_POST[$name];
$this->save($name);
}
}
public function set_string_from_post($name) {
if(isset($_POST[$name])) {
$this->values[$name] = $_POST[$name];
$this->save($name);
}
}
public function set_bool_from_post($name) {
if(isset($_POST[$name]) && ($_POST[$name] == 'on')) {
$this->values[$name] = 'Y';
}
else {
$this->values[$name] = 'N';
}
$this->save($name);
}
public function get_int($name) {
// deprecated -- ints should be stored as ints now
return parse_shorthand_int($this->get($name));
}
public function get_string($name) {
return $this->get($name);
}
public function get_bool($name) {
// deprecated -- bools should be stored as Y/N now
return ($this->get($name) == 'Y' || $this->get($name) == '1');
}
public function get($name) {
if(isset($this->values[$name])) {
return $this->values[$name];
}
else if(isset($this->defaults[$name])) {
return $this->defaults[$name];
}
else {
return null;
}
}
}
?>

338
core/config.php Normal file
View File

@ -0,0 +1,338 @@
<?php declare(strict_types=1);
/**
* Interface Config
*
* An abstract interface for altering a name:value pair list.
*/
interface Config
{
/**
* Save the list of name:value pairs to wherever they came from,
* so that the next time a page is loaded it will use the new
* configuration.
*/
public function save(string $name=null): void;
//@{ /*--------------------------------- SET ------------------------------------------------------*/
/**
* Set a configuration option to a new value, regardless of what the value is at the moment.
*/
public function set_int(string $name, ?int $value): void;
/**
* Set a configuration option to a new value, regardless of what the value is at the moment.
*/
public function set_float(string $name, ?float $value): void;
/**
* Set a configuration option to a new value, regardless of what the value is at the moment.
*/
public function set_string(string $name, ?string $value): void;
/**
* Set a configuration option to a new value, regardless of what the value is at the moment.
*/
public function set_bool(string $name, ?bool $value): void;
/**
* Set a configuration option to a new value, regardless of what the value is at the moment.
*/
public function set_array(string $name, array $value): void;
//@} /*--------------------------------------------------------------------------------------------*/
//@{ /*-------------------------------- SET DEFAULT -----------------------------------------------*/
/**
* Set a configuration option to a new value, if there is no value currently.
*
* Extensions should generally call these from their InitExtEvent handlers.
* This has the advantage that the values will show up in the "advanced" setup
* page where they can be modified, while calling get_* with a "default"
* parameter won't show up.
*/
public function set_default_int(string $name, int $value): void;
/**
* Set a configuration option to a new value, if there is no value currently.
*
* Extensions should generally call these from their InitExtEvent handlers.
* This has the advantage that the values will show up in the "advanced" setup
* page where they can be modified, while calling get_* with a "default"
* parameter won't show up.
*/
public function set_default_float(string $name, float $value): void;
/**
* Set a configuration option to a new value, if there is no value currently.
*
* Extensions should generally call these from their InitExtEvent handlers.
* This has the advantage that the values will show up in the "advanced" setup
* page where they can be modified, while calling get_* with a "default"
* parameter won't show up.
*/
public function set_default_string(string $name, string $value): void;
/**
* Set a configuration option to a new value, if there is no value currently.
*
* Extensions should generally call these from their InitExtEvent handlers.
* This has the advantage that the values will show up in the "advanced" setup
* page where they can be modified, while calling get_* with a "default"
* parameter won't show up.
*/
public function set_default_bool(string $name, bool $value): void;
/**
* Set a configuration option to a new value, if there is no value currently.
*
* Extensions should generally call these from their InitExtEvent handlers.
* This has the advantage that the values will show up in the "advanced" setup
* page where they can be modified, while calling get_* with a "default"
* parameter won't show up.
*/
public function set_default_array(string $name, array $value): void;
//@} /*--------------------------------------------------------------------------------------------*/
//@{ /*--------------------------------- GET ------------------------------------------------------*/
/**
* Pick a value out of the table by name, cast to the appropriate data type.
*/
public function get_int(string $name, ?int $default=null): ?int;
/**
* Pick a value out of the table by name, cast to the appropriate data type.
*/
public function get_float(string $name, ?float $default=null): ?float;
/**
* Pick a value out of the table by name, cast to the appropriate data type.
*/
public function get_string(string $name, ?string $default=null): ?string;
/**
* Pick a value out of the table by name, cast to the appropriate data type.
*/
public function get_bool(string $name, ?bool $default=null): ?bool;
/**
* Pick a value out of the table by name, cast to the appropriate data type.
*/
public function get_array(string $name, ?array $default=[]): ?array;
//@} /*--------------------------------------------------------------------------------------------*/
}
/**
* Class BaseConfig
*
* Common methods for manipulating the list, loading and saving is
* left to the concrete implementation
*/
abstract class BaseConfig implements Config
{
public $values = [];
public function set_int(string $name, ?int $value): void
{
$this->values[$name] = is_null($value) ? null : $value;
$this->save($name);
}
public function set_float(string $name, ?float $value): void
{
$this->values[$name] = $value;
$this->save($name);
}
public function set_string(string $name, ?string $value): void
{
$this->values[$name] = $value;
$this->save($name);
}
public function set_bool(string $name, ?bool $value): void
{
$this->values[$name] = $value ? 'Y' : 'N';
$this->save($name);
}
public function set_array(string $name, ?array $value): void
{
if ($value!=null) {
$this->values[$name] = implode(",", $value);
} else {
$this->values[$name] = null;
}
$this->save($name);
}
public function set_default_int(string $name, int $value): void
{
if (is_null($this->get($name))) {
$this->values[$name] = $value;
}
}
public function set_default_float(string $name, float $value): void
{
if (is_null($this->get($name))) {
$this->values[$name] = $value;
}
}
public function set_default_string(string $name, string $value): void
{
if (is_null($this->get($name))) {
$this->values[$name] = $value;
}
}
public function set_default_bool(string $name, bool $value): void
{
if (is_null($this->get($name))) {
$this->values[$name] = $value ? 'Y' : 'N';
}
}
public function set_default_array(string $name, array $value): void
{
if (is_null($this->get($name))) {
$this->values[$name] = implode(",", $value);
}
}
public function get_int(string $name, ?int $default=null): ?int
{
return (int)($this->get($name, $default));
}
public function get_float(string $name, ?float $default=null): ?float
{
return (float)($this->get($name, $default));
}
public function get_string(string $name, ?string $default=null): ?string
{
$val = $this->get($name, $default);
if (!is_string($val) && !is_null($val)) {
throw new SCoreException("$name is not a string: $val");
}
return $val;
}
public function get_bool(string $name, ?bool $default=null): ?bool
{
return bool_escape($this->get($name, $default));
}
public function get_array(string $name, ?array $default=[]): ?array
{
return explode(",", $this->get($name, ""));
}
private function get(string $name, $default=null)
{
if (isset($this->values[$name])) {
return $this->values[$name];
} else {
return $default;
}
}
}
/**
* Class DatabaseConfig
*
* Loads the config list from a table in a given database, the table should
* be called config and have the schema:
*
* \code
* CREATE TABLE config(
* name VARCHAR(255) NOT NULL,
* value TEXT
* );
* \endcode
*/
class DatabaseConfig extends BaseConfig
{
/** @var Database */
private $database = null;
private $table_name;
private $sub_column;
private $sub_value;
public function __construct(
Database $database,
string $table_name = "config",
string $sub_column = null,
string $sub_value = null
) {
global $cache;
$this->database = $database;
$this->table_name = $table_name;
$this->sub_value = $sub_value;
$this->sub_column = $sub_column;
$cache_name = "config";
if (!empty($sub_value)) {
$cache_name .= "_".$sub_value;
}
$cached = $cache->get($cache_name);
if ($cached) {
$this->values = $cached;
} else {
$this->values = [];
$query = "SELECT name, value FROM {$this->table_name}";
$args = [];
if (!empty($sub_column)&&!empty($sub_value)) {
$query .= " WHERE $sub_column = :sub_value";
$args["sub_value"] = $sub_value;
}
foreach ($this->database->get_all($query, $args) as $row) {
$this->values[$row["name"]] = $row["value"];
}
$cache->set($cache_name, $this->values);
}
}
public function save(string $name=null): void
{
global $cache;
if (is_null($name)) {
reset($this->values); // rewind the array to the first element
foreach ($this->values as $name => $value) {
$this->save($name);
}
} else {
$query = "DELETE FROM {$this->table_name} WHERE name = :name";
$args = ["name"=>$name];
$cols = ["name","value"];
$params = [":name",":value"];
if (!empty($this->sub_column)&&!empty($this->sub_value)) {
$query .= " AND $this->sub_column = :sub_value";
$args["sub_value"] = $this->sub_value;
$cols[] = $this->sub_column;
$params[] = ":sub_value";
}
$this->database->Execute($query, $args);
$args["value"] =$this->values[$name];
$this->database->Execute(
"INSERT INTO {$this->table_name} (".join(",", $cols).") VALUES (".join(",", $params).")",
$args
);
}
// rather than deleting and having some other request(s) do a thundering
// herd of race-conditioned updates, just save the updated version once here
$cache->set("config", $this->values);
}
}

View File

@ -1,342 +0,0 @@
<?php
require_once "lib/adodb/adodb.inc.php";
class Querylet { // {{{
var $sql;
var $variables;
public function querylet($sql, $variables=array()) {
$this->sql = $sql;
$this->variables = $variables;
}
public function append($querylet) {
$this->sql .= $querylet->sql;
$this->variables = array_merge($this->variables, $querylet->variables);
}
public function append_sql($sql) {
$this->sql .= $sql;
}
public function add_variable($var) {
$this->variables[] = $var;
}
} // }}}
class Database {
var $db;
var $extensions;
public function Database() {
if(is_readable("config.php")) {
require_once "config.php";
$this->db = NewADOConnection($database_dsn);
$this->db->SetFetchMode(ADODB_FETCH_ASSOC);
$this->extensions = $this->db->GetAssoc("SELECT name, version FROM extensions");
}
else {
header("Location: install.php");
exit;
}
}
// misc {{{
public function count_pages($tags=array()) {
global $config;
$images_per_page = $config->get_int('index_width') * $config->get_int('index_height');
if(count($tags) == 0) {
return ceil($this->db->GetOne("SELECT COUNT(*) FROM images") / $images_per_page);
}
else {
$querylet = $this->build_search_querylet($tags);
$result = $this->db->Execute($querylet->sql, $querylet->variables);
return ceil($result->RecordCount() / $images_per_page);
}
}
// }}}
// extensions {{{
public function set_extension_version($name, $version) {
$this->extensions[$name] = $version;
$this->db->GetRow("INSERT INTO extensions(name, version) VALUES (?, ?)", array($name, $version));
}
public function get_extension_version($name) {
return (isset($this->extensions[$name]) ? $this->extensions[$name] : -1);
}
// }}}
// tags {{{
public function resolve_alias($tag) {
$newtag = $this->db->GetOne("SELECT newtag FROM aliases WHERE oldtag=?", array($tag));
if(!empty($newtag)) {
return $newtag;
} else {
return $tag;
}
}
public function sanitise($tag) {
return preg_replace("/[\s?*]/", "", $tag);
}
private function build_search_querylet($terms) {
$tag_search = new Querylet("0");
$positive_tag_count = 0;
$img_search = new Querylet("");
foreach($terms as $term) {
$negative = false;
if((strlen($term) > 0) && ($term[0] == '-')) {
$negative = true;
$term = substr($term, 1);
}
$term = $this->resolve_alias($term);
if(substr($term, 0, 5) == "size=") {
$dim = substr($term, 5);
$parts = explode('x', $dim);
$args = array(int_escape($parts[0]), int_escape($parts[1]));
$img_search->append(new Querylet("AND (width = ? AND height = ?)", $args));
}
else if(substr($term, 0, 5) == "size>") {
$dim = substr($term, 5);
$parts = explode('x', $dim);
$args = array(int_escape($parts[0]), int_escape($parts[1]));
$img_search->append(new Querylet("AND (width > ? AND height > ?)", $args));
}
else if(substr($term, 0, 5) == "size<") {
$dim = substr($term, 5);
$parts = explode('x', $dim);
$args = array(int_escape($parts[0]), int_escape($parts[1]));
$img_search->append(new Querylet("AND (width < ? AND height < ?)", $args));
}
else if(substr($term, 0, 6) == "ratio=") {
$dim = substr($term, 6);
$parts = explode(':', $dim);
$args = array(int_escape($parts[0]), int_escape($parts[1]));
$img_search->append(new Querylet("AND (width / height = ? / ?)", $args));
}
else if(substr($term, 0, 3) == "id<") {
$img_search->append(new Querylet("AND (id < ?)", array(int_escape(substr($term, 3)))));
}
else if(substr($term, 0, 3) == "id>") {
$img_search->append(new Querylet("AND (id > ?)", array(int_escape(substr($term, 3)))));
}
else if(substr($term, 0, 9) == "filesize<") {
$img_search->append(new Querylet("AND (filesize < ?)", array(parse_shorthand_int(substr($term, 9)))));
}
else if(substr($term, 0, 9) == "filesize>") {
$img_search->append(new Querylet("AND (filesize > ?)", array(parse_shorthand_int(substr($term, 9)))));
}
else {
$term = str_replace("*", "%", $term);
$term = str_replace("?", "_", $term);
$sign = $negative ? "-" : "+";
if($sign == "+") $positive_tag_count++;
$tag_search->append(new Querylet(" $sign (tag LIKE ?)", array($term)));
}
}
$database_fails = false; // MySQL 4.0 fails at subqueries
if(count($tag_search->variables) == 0 || $database_fails) {
$query = new Querylet("SELECT * FROM images ");
}
else {
$subquery = new Querylet("
SELECT *, SUM({$tag_search->sql}) AS score
FROM images
LEFT JOIN tags ON tags.image_id = images.id
GROUP BY images.id
HAVING score = ?",
array_merge(
$tag_search->variables,
array($positive_tag_count)
)
);
$query = new Querylet("SELECT * FROM ({$subquery->sql}) AS images ", $subquery->variables);
}
if(count($img_search->variables) > 0) {
$query->append_sql("WHERE 1=1 ");
$query->append($img_search);
}
return $query;
}
private function build_search_querylet_old($tags) { // {{{
$querylet = new Querylet("SELECT images.*, SUM(");
$tnum = 0;
foreach($tags as $tag) {
if(($tag != "") && ($tag[0] == '-')) continue;
$querylet->append_sql($tnum == 0 ? "(" : " OR ");
$querylet->append($this->term_to_querylet($tag));
$tnum++;
}
$min_score = $tnum;
if($tnum > 0) $querylet->append_sql(")");
$tnum = 0;
foreach($tags as $tag) {
if(($tag == "") || ($tag[0] != '-')) continue;
$querylet->append_sql($tnum == 0 ? "-(" : " OR ");
$querylet->append($this->term_to_querylet(substr($tag, 1)));
$tnum++;
}
if($tnum > 0) $querylet->append_sql(")");
$querylet->append_sql(") AS score
FROM tags
LEFT JOIN images ON image_id=images.id
GROUP BY images.id
HAVING score >= ?
");
$querylet->add_variable($min_score);
return $querylet;
}
private function term_to_querylet($term) {
$term = $this->resolve_alias($term);
if(substr($term, 0, 5) == "size:") {
$dim = substr($term, 5);
$parts = explode('x', $dim);
return new Querylet("(width = ? AND height = ?)", array(int_escape($parts[0]), int_escape($parts[1])));
}
else if(substr($term, 0, 9) == "size-min:") {
$dim = substr($term, 9);
$parts = explode('x', $dim);
return new Querylet("(width >= ? AND height >= ?)", array(int_escape($parts[0]), int_escape($parts[1])));
}
else if(substr($term, 0, 9) == "size-max:") {
$dim = substr($term, 9);
$parts = explode('x', $dim);
return new Querylet("(width <= ? AND height <= ?)", array(int_escape($parts[0]), int_escape($parts[1])));
}
else {
$term = str_replace("*", "%", $term);
$term = str_replace("?", "_", $term);
return new Querylet("(tag LIKE ?)", array($term));
}
} // }}}
public function delete_tags_from_image($image_id) {
$this->db->Execute("DELETE FROM tags WHERE image_id=?", array($image_id));
}
public function set_tags($image_id, $tags) {
$tags = tag_explode($tags);
$tags = array_map(array($this, 'resolve_alias'), $tags);
$tags = array_map(array($this, 'sanitise'), $tags);
$tags = array_unique($tags); // remove any duplicate tags
// delete old
$this->delete_tags_from_image($image_id);
// insert each new tag
foreach($tags as $tag) {
$this->db->Execute("INSERT INTO tags(image_id, tag) VALUES(?, ?)", array($image_id, $tag));
}
}
// }}}
// images {{{
public function get_images($start, $limit, $tags=array()) {
$images = array();
assert($start >= 0);
assert($limit > 0);
if($start < 0) $start = 0;
if($limit < 1) $limit = 1;
if(count($tags) == 0) {
$result = $this->db->Execute("SELECT * FROM images ORDER BY id DESC LIMIT ?,?", array($start, $limit));
}
else {
$querylet = $this->build_search_querylet($tags);
$querylet->append(new Querylet("ORDER BY images.id DESC LIMIT ?,?", array($start, $limit)));
$result = $this->db->Execute($querylet->sql, $querylet->variables);
}
while(!$result->EOF) {
$images[] = new Image($result->fields);
$result->MoveNext();
}
return $images;
}
public function get_next_image($id, $tags=array(), $next=true) {
if($next) {
$gtlt = "<";
$dir = "DESC";
}
else {
$gtlt = ">";
$dir = "ASC";
}
if(count($tags) == 0) {
$row = $this->db->GetRow("SELECT * FROM images WHERE id $gtlt ? ORDER BY id $dir", array((int)$id));
}
else {
$tags[] = ($next ? "id<$id" : "id>$id");
$dir = ($next ? "DESC" : "ASC");
$querylet = $this->build_search_querylet($tags);
$querylet->append_sql("ORDER BY id $dir");
$row = $this->db->GetRow($querylet->sql, $querylet->variables);
}
return ($row ? new Image($row) : null);
}
public function get_prev_image($id, $tags=array()) {
return $this->get_next_image($id, $tags, false);
}
public function get_image($id) {
$image = null;
$row = $this->db->GetRow("SELECT * FROM images WHERE id=?", array($id));
return ($row ? new Image($row) : null);
}
public function remove_image($id) {
$this->db->Execute("DELETE FROM images WHERE id=?", array($id));
}
// }}}
// users {{{
var $SELECT_USER = "SELECT *,time_to_sec(timediff(now(), joindate))/(60*60*24) AS days_old FROM users ";
public function get_user($a=false, $b=false) {
if($b == false) {
return $this->get_user_by_id($a);
}
else {
return $this->get_user_by_name_and_hash($a, $b);
}
}
public function get_user_session($name, $session) {
$row = $this->db->GetRow("{$this->SELECT_USER} WHERE name LIKE ? AND md5(concat(pass, ?)) = ?",
array($name, $_SERVER['REMOTE_ADDR'], $session));
return $row ? new User($row) : null;
}
public function get_user_by_id($id) {
$row = $this->db->GetRow("{$this->SELECT_USER} WHERE id=?", array($id));
return $row ? new User($row) : null;
}
public function get_user_by_name($name) {
$row = $this->db->GetRow("{$this->SELECT_USER} WHERE name=?", array($name));
return $row ? new User($row) : null;
}
public function get_user_by_name_and_hash($name, $hash) {
$row = $this->db->GetRow("{$this->SELECT_USER} WHERE name LIKE ? AND pass = ?", array($name, $hash));
return $row ? new User($row) : null;
}
// }}}
}
?>

339
core/database.php Normal file
View File

@ -0,0 +1,339 @@
<?php declare(strict_types=1);
use FFSPHP\PDO;
abstract class DatabaseDriver
{
public const MYSQL = "mysql";
public const PGSQL = "pgsql";
public const SQLITE = "sqlite";
}
/**
* A class for controlled database access
*/
class Database
{
/** @var string */
private $dsn;
/**
* The PDO database connection object, for anyone who wants direct access.
* @var null|PDO
*/
private $db = null;
/**
* @var float
*/
public $dbtime = 0.0;
/**
* Meta info about the database engine.
* @var DBEngine|null
*/
private $engine = null;
/**
* A boolean flag to track if we already have an active transaction.
* (ie: True if beginTransaction() already called)
*
* @var bool
*/
public $transaction = false;
/**
* How many queries this DB object has run
*/
public $query_count = 0;
public function __construct(string $dsn)
{
$this->dsn = $dsn;
}
private function connect_db(): void
{
$this->db = new PDO($this->dsn, [
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
]);
$this->connect_engine();
$this->engine->init($this->db);
$this->begin_transaction();
}
private function connect_engine(): void
{
if (preg_match("/^([^:]*)/", $this->dsn, $matches)) {
$db_proto=$matches[1];
} else {
throw new SCoreException("Can't figure out database engine");
}
if ($db_proto === DatabaseDriver::MYSQL) {
$this->engine = new MySQL();
} elseif ($db_proto === DatabaseDriver::PGSQL) {
$this->engine = new PostgreSQL();
} elseif ($db_proto === DatabaseDriver::SQLITE) {
$this->engine = new SQLite();
} else {
die_nicely(
'Unknown PDO driver: '.$db_proto,
"Please check that this is a valid driver, installing the PHP modules if needed"
);
}
}
public function begin_transaction(): void
{
if ($this->transaction === false) {
$this->db->beginTransaction();
$this->transaction = true;
}
}
public function is_transaction_open(): bool
{
return !is_null($this->db) && $this->transaction === true;
}
public function commit(): bool
{
if ($this->is_transaction_open()) {
$this->transaction = false;
return $this->db->commit();
} else {
throw new SCoreException("Unable to call commit() as there is no transaction currently open.");
}
}
public function rollback(): bool
{
if ($this->is_transaction_open()) {
$this->transaction = false;
return $this->db->rollback();
} else {
throw new SCoreException("Unable to call rollback() as there is no transaction currently open.");
}
}
public function scoreql_to_sql(string $input): string
{
if (is_null($this->engine)) {
$this->connect_engine();
}
return $this->engine->scoreql_to_sql($input);
}
public function scoresql_value_prepare($input)
{
if (is_null($this->engine)) {
$this->connect_engine();
}
if ($input===true) {
return $this->engine->BOOL_Y;
} elseif ($input===false) {
return $this->engine->BOOL_N;
}
return $input;
}
public function get_driver_name(): string
{
if (is_null($this->engine)) {
$this->connect_engine();
}
return $this->engine->name;
}
public function get_version(): string
{
return $this->engine->get_version($this->db);
}
private function count_time(string $method, float $start, string $query, ?array $args): void
{
global $_tracer, $tracer_enabled;
$dur = microtime(true) - $start;
if ($tracer_enabled) {
$query = trim(preg_replace('/^[\t ]+/m', '', $query)); // trim leading whitespace
$_tracer->complete($start * 1000000, $dur * 1000000, "DB Query", ["query"=>$query, "args"=>$args, "method"=>$method]);
}
$this->query_count++;
$this->dbtime += $dur;
}
public function set_timeout(int $time): void
{
$this->engine->set_timeout($this->db, $time);
}
public function execute(string $query, array $args = []): PDOStatement
{
try {
if (is_null($this->db)) {
$this->connect_db();
}
return $this->db->execute(
"-- " . str_replace("%2F", "/", urlencode($_GET['q'] ?? '')). "\n" .
$query,
$args
);
} catch (PDOException $pdoe) {
throw new SCoreException($pdoe->getMessage(), $query);
}
}
/**
* Execute an SQL query and return a 2D array.
*/
public function get_all(string $query, array $args = []): array
{
$_start = microtime(true);
$data = $this->execute($query, $args)->fetchAll();
$this->count_time("get_all", $_start, $query, $args);
return $data;
}
/**
* Execute an SQL query and return a iterable object for use with generators.
*/
public function get_all_iterable(string $query, array $args = []): PDOStatement
{
$_start = microtime(true);
$data = $this->execute($query, $args);
$this->count_time("get_all_iterable", $_start, $query, $args);
return $data;
}
/**
* Execute an SQL query and return a single row.
*/
public function get_row(string $query, array $args = []): ?array
{
$_start = microtime(true);
$row = $this->execute($query, $args)->fetch();
$this->count_time("get_row", $_start, $query, $args);
return $row ? $row : null;
}
/**
* Execute an SQL query and return the first column of each row.
*/
public function get_col(string $query, array $args = []): array
{
$_start = microtime(true);
$res = $this->execute($query, $args)->fetchAll(PDO::FETCH_COLUMN);
$this->count_time("get_col", $_start, $query, $args);
return $res;
}
/**
* Execute an SQL query and return the first column of each row as a single iterable object.
*/
public function get_col_iterable(string $query, array $args = []): Generator
{
$_start = microtime(true);
$stmt = $this->execute($query, $args);
$this->count_time("get_col_iterable", $_start, $query, $args);
foreach ($stmt as $row) {
yield $row[0];
}
}
/**
* Execute an SQL query and return the the first column => the second column.
*/
public function get_pairs(string $query, array $args = []): array
{
$_start = microtime(true);
$res = $this->execute($query, $args)->fetchAll(PDO::FETCH_KEY_PAIR);
$this->count_time("get_pairs", $_start, $query, $args);
return $res;
}
/**
* Execute an SQL query and return a single value, or null.
*/
public function get_one(string $query, array $args = [])
{
$_start = microtime(true);
$row = $this->execute($query, $args)->fetch();
$this->count_time("get_one", $_start, $query, $args);
return $row ? $row[0] : null;
}
/**
* Execute an SQL query and returns a bool indicating if any data was returned
*/
public function exists(string $query, array $args = []): bool
{
$_start = microtime(true);
$row = $this->execute($query, $args)->fetch();
$this->count_time("exists", $_start, $query, $args);
if ($row==null) {
return false;
}
return true;
}
/**
* Get the ID of the last inserted row.
*/
public function get_last_insert_id(string $seq): int
{
if ($this->engine->name == DatabaseDriver::PGSQL) {
$id = $this->db->lastInsertId($seq);
} else {
$id = $this->db->lastInsertId();
}
assert(is_numeric($id));
return (int)$id;
}
/**
* Create a table from pseudo-SQL.
*/
public function create_table(string $name, string $data): void
{
if (is_null($this->engine)) {
$this->connect_engine();
}
$data = trim($data, ", \t\n\r\0\x0B"); // mysql doesn't like trailing commas
$this->execute($this->engine->create_table_sql($name, $data));
}
/**
* Returns the number of tables present in the current database.
*
* @throws SCoreException
*/
public function count_tables(): int
{
if (is_null($this->db) || is_null($this->engine)) {
$this->connect_db();
}
if ($this->engine->name === DatabaseDriver::MYSQL) {
return count(
$this->get_all("SHOW TABLES")
);
} elseif ($this->engine->name === DatabaseDriver::PGSQL) {
return count(
$this->get_all("SELECT table_name FROM information_schema.tables WHERE table_schema = 'public'")
);
} elseif ($this->engine->name === DatabaseDriver::SQLITE) {
return count(
$this->get_all("SELECT name FROM sqlite_master WHERE type = 'table'")
);
} else {
throw new SCoreException("Can't count tables for database type {$this->engine->name}");
}
}
public function raw_db(): PDO
{
return $this->db;
}
}

236
core/dbengine.php Normal file
View File

@ -0,0 +1,236 @@
<?php declare(strict_types=1);
abstract class SCORE
{
const AIPK = "SCORE_AIPK";
const INET = "SCORE_INET";
const BOOL_Y = "SCORE_BOOL_Y";
const BOOL_N = "SCORE_BOOL_N";
const BOOL = "SCORE_BOOL";
}
abstract class DBEngine
{
/** @var null|string */
public $name = null;
public $BOOL_Y = null;
public $BOOL_N = null;
public function init(PDO $db)
{
}
public function scoreql_to_sql(string $scoreql): string
{
return $scoreql;
}
public function create_table_sql(string $name, string $data): string
{
return 'CREATE TABLE '.$name.' ('.$data.')';
}
abstract public function set_timeout(PDO $db, int $time);
abstract public function get_version(PDO $db): string;
}
class MySQL extends DBEngine
{
/** @var string */
public $name = DatabaseDriver::MYSQL;
public $BOOL_Y = 'Y';
public $BOOL_N = 'N';
public function init(PDO $db)
{
$db->exec("SET NAMES utf8;");
}
public function scoreql_to_sql(string $data): string
{
$data = str_replace(SCORE::AIPK, "INTEGER PRIMARY KEY auto_increment", $data);
$data = str_replace(SCORE::INET, "VARCHAR(45)", $data);
$data = str_replace(SCORE::BOOL_Y, "'$this->BOOL_Y'", $data);
$data = str_replace(SCORE::BOOL_N, "'$this->BOOL_N'", $data);
$data = str_replace(SCORE::BOOL, "ENUM('Y', 'N')", $data);
return $data;
}
public function create_table_sql(string $name, string $data): string
{
$data = $this->scoreql_to_sql($data);
$ctes = "ENGINE=InnoDB DEFAULT CHARSET='utf8'";
return 'CREATE TABLE '.$name.' ('.$data.') '.$ctes;
}
public function set_timeout(PDO $db, int $time): void
{
// These only apply to read-only queries, which appears to be the best we can to mysql-wise
// $db->exec("SET SESSION MAX_EXECUTION_TIME=".$time.";");
}
public function get_version(PDO $db): string
{
return $db->query('select version()')->fetch()[0];
}
}
class PostgreSQL extends DBEngine
{
/** @var string */
public $name = DatabaseDriver::PGSQL;
public $BOOL_Y = "true";
public $BOOL_N = "false";
public function init(PDO $db)
{
if (array_key_exists('REMOTE_ADDR', $_SERVER)) {
$db->exec("SET application_name TO 'shimmie [{$_SERVER['REMOTE_ADDR']}]';");
} else {
$db->exec("SET application_name TO 'shimmie [local]';");
}
if (defined("DATABASE_TIMEOUT")) {
$this->set_timeout($db, DATABASE_TIMEOUT);
}
}
public function scoreql_to_sql(string $data): string
{
$data = str_replace(SCORE::AIPK, "INTEGER NOT NULL PRIMARY KEY GENERATED ALWAYS AS IDENTITY", $data);
$data = str_replace(SCORE::INET, "INET", $data);
$data = str_replace(SCORE::BOOL_Y, "true", $data);
$data = str_replace(SCORE::BOOL_N, "false", $data);
$data = str_replace(SCORE::BOOL, "BOOL", $data);
return $data;
}
public function create_table_sql(string $name, string $data): string
{
$data = $this->scoreql_to_sql($data);
return "CREATE TABLE $name ($data)";
}
public function set_timeout(PDO $db, int $time): void
{
$db->exec("SET statement_timeout TO ".$time.";");
}
public function get_version(PDO $db): string
{
return $db->query('select version()')->fetch()[0];
}
}
// shimmie functions for export to sqlite
function _unix_timestamp($date)
{
return strtotime($date);
}
function _now()
{
return date("Y-m-d H:i:s");
}
function _floor($a)
{
return floor($a);
}
function _log($a, $b=null)
{
if (is_null($b)) {
return log($a);
} else {
return log($a, $b);
}
}
function _isnull($a)
{
return is_null($a);
}
function _md5($a)
{
return md5($a);
}
function _concat($a, $b)
{
return $a . $b;
}
function _lower($a)
{
return strtolower($a);
}
function _rand()
{
return rand();
}
function _ln($n)
{
return log($n);
}
class SQLite extends DBEngine
{
/** @var string */
public $name = DatabaseDriver::SQLITE;
public $BOOL_Y = 'Y';
public $BOOL_N = 'N';
public function init(PDO $db)
{
ini_set('sqlite.assoc_case', '0');
$db->exec("PRAGMA foreign_keys = ON;");
$db->sqliteCreateFunction('UNIX_TIMESTAMP', '_unix_timestamp', 1);
$db->sqliteCreateFunction('now', '_now', 0);
$db->sqliteCreateFunction('floor', '_floor', 1);
$db->sqliteCreateFunction('log', '_log');
$db->sqliteCreateFunction('isnull', '_isnull', 1);
$db->sqliteCreateFunction('md5', '_md5', 1);
$db->sqliteCreateFunction('concat', '_concat', 2);
$db->sqliteCreateFunction('lower', '_lower', 1);
$db->sqliteCreateFunction('rand', '_rand', 0);
$db->sqliteCreateFunction('ln', '_ln', 1);
}
public function scoreql_to_sql(string $data): string
{
$data = str_replace(SCORE::AIPK, "INTEGER PRIMARY KEY", $data);
$data = str_replace(SCORE::INET, "VARCHAR(45)", $data);
$data = str_replace(SCORE::BOOL_Y, "'$this->BOOL_Y'", $data);
$data = str_replace(SCORE::BOOL_N, "'$this->BOOL_N'", $data);
$data = str_replace(SCORE::BOOL, "CHAR(1)", $data);
return $data;
}
public function create_table_sql(string $name, string $data): string
{
$data = $this->scoreql_to_sql($data);
$cols = [];
$extras = "";
foreach (explode(",", $data) as $bit) {
$matches = [];
if (preg_match("/(UNIQUE)? ?INDEX\s*\((.*)\)/", $bit, $matches)) {
$uni = $matches[1];
$col = $matches[2];
$extras .= "CREATE $uni INDEX {$name}_{$col} ON {$name}({$col});";
} else {
$cols[] = $bit;
}
}
$cols_redone = implode(", ", $cols);
return "CREATE TABLE $name ($cols_redone); $extras";
}
public function set_timeout(PDO $db, int $time): void
{
// There doesn't seem to be such a thing for SQLite, so it does nothing
}
public function get_version(PDO $db): string
{
return $db->query('select sqlite_version()')->fetch()[0];
}
}

View File

@ -1,8 +0,0 @@
<?php
/*
* Event:
* generic parent class
*/
class Event {
}
?>

344
core/event.php Normal file
View File

@ -0,0 +1,344 @@
<?php declare(strict_types=1);
/**
* Generic parent class for all events.
*
* An event is anything that can be passed around via send_event($blah)
*/
abstract class Event
{
public $stop_processing = false;
public function __construct()
{
}
public function __toString()
{
return var_export($this, true);
}
}
/**
* A wake-up call for extensions. Upon recieving an InitExtEvent an extension
* should check that it's database tables are there and install them if not,
* and set any defaults with Config::set_default_int() and such.
*
* This event is sent before $user is set to anything
*/
class InitExtEvent extends Event
{
}
/**
* A signal that a page has been requested.
*
* User requests /view/42 -> an event is generated with $args = array("view",
* "42"); when an event handler asks $event->page_matches("view"), it returns
* true and ignores the matched part, such that $event->count_args() = 1 and
* $event->get_arg(0) = "42"
*/
class PageRequestEvent extends Event
{
/**
* @var array
*/
public $args;
/**
* @var int
*/
public $arg_count;
/**
* @var int
*/
public $part_count;
public function __construct(string $path)
{
parent::__construct();
global $config;
// trim starting slashes
$path = ltrim($path, "/");
// if path is not specified, use the default front page
if (empty($path)) { /* empty is faster than strlen */
$path = $config->get_string(SetupConfig::FRONT_PAGE);
}
// break the path into parts
$args = explode('/', $path);
$this->args = $args;
$this->arg_count = count($args);
}
/**
* Test if the requested path matches a given pattern.
*
* If it matches, store the remaining path elements in $args
*/
public function page_matches(string $name): bool
{
$parts = explode("/", $name);
$this->part_count = count($parts);
if ($this->part_count > $this->arg_count) {
return false;
}
for ($i=0; $i<$this->part_count; $i++) {
if ($parts[$i] != $this->args[$i]) {
return false;
}
}
return true;
}
/**
* Get the n th argument of the page request (if it exists.)
*/
public function get_arg(int $n): string
{
$offset = $this->part_count + $n;
if ($offset >= 0 && $offset < $this->arg_count) {
return $this->args[$offset];
} else {
$nm1 = $this->arg_count - 1;
throw new SCoreException("Requested an invalid page argument {$offset} / {$nm1}");
}
}
/**
* If page arg $n is set, then treat that as a 1-indexed page number
* and return a 0-indexed page number less than $max; else return 0
*/
public function try_page_num(int $n, ?int $max=null): int
{
if ($this->count_args() > $n) {
$i = $this->get_arg($n);
if (is_numeric($i) && int_escape($i) > 0) {
return page_number($i, $max);
} else {
return 0;
}
} else {
return 0;
}
}
/**
* Returns the number of arguments the page request has.
*/
public function count_args(): int
{
return $this->arg_count - $this->part_count;
}
/*
* Many things use these functions
*/
public function get_search_terms(): array
{
$search_terms = [];
if ($this->count_args() === 2) {
$search_terms = Tag::explode(Tag::decaret($this->get_arg(0)));
}
return $search_terms;
}
public function get_page_number(): int
{
$page_number = 1;
if ($this->count_args() === 1) {
$page_number = int_escape($this->get_arg(0));
} elseif ($this->count_args() === 2) {
$page_number = int_escape($this->get_arg(1));
}
if ($page_number === 0) {
$page_number = 1;
} // invalid -> 0
return $page_number;
}
public function get_page_size(): int
{
global $config;
return $config->get_int(IndexConfig::IMAGES);
}
}
/**
* Sent when index.php is called from the command line
*/
class CommandEvent extends Event
{
/**
* @var string
*/
public $cmd = "help";
/**
* @var array
*/
public $args = [];
/**
* #param string[] $args
*/
public function __construct(array $args)
{
parent::__construct();
global $user;
$opts = [];
$log_level = SCORE_LOG_WARNING;
$arg_count = count($args);
for ($i=1; $i<$arg_count; $i++) {
switch ($args[$i]) {
case '-u':
$user = User::by_name($args[++$i]);
if (is_null($user)) {
die("Unknown user");
} else {
send_event(new UserLoginEvent($user));
}
break;
case '-q':
$log_level += 10;
break;
case '-v':
$log_level -= 10;
break;
default:
$opts[] = $args[$i];
break;
}
}
if (!defined("CLI_LOG_LEVEL")) {
define("CLI_LOG_LEVEL", $log_level);
}
if (count($opts) > 0) {
$this->cmd = $opts[0];
$this->args = array_slice($opts, 1);
} else {
print "\n";
print "Usage: php {$args[0]} [flags] [command]\n";
print "\n";
print "Flags:\n";
print "\t-u [username]\n";
print "\t\tLog in as the specified user\n";
print "\t-q / -v\n";
print "\t\tBe quieter / more verbose\n";
print "\t\tScale is debug - info - warning - error - critical\n";
print "\t\tDefault is to show warnings and above\n";
print "\n";
print "Currently known commands:\n";
}
}
}
/**
* A signal that some text needs formatting, the event carries
* both the text and the result
*/
class TextFormattingEvent extends Event
{
/**
* For reference
*
* @var string
*/
public $original;
/**
* with formatting applied
*
* @var string
*/
public $formatted;
/**
* with formatting removed
*
* @var string
*/
public $stripped;
public function __construct(string $text)
{
parent::__construct();
// We need to escape before formatting, instead of at display time,
// because formatters will add their own HTML tags into the mix and
// we don't want to escape those.
$h_text = html_escape(trim($text));
$this->original = $h_text;
$this->formatted = $h_text;
$this->stripped = $h_text;
}
}
/**
* A signal that something needs logging
*/
class LogEvent extends Event
{
/**
* a category, normally the extension name
*
* @var string
*/
public $section;
/**
* See python...
*
* @var int
*/
public $priority = 0;
/**
* Free text to be logged
*
* @var string
*/
public $message;
/**
* The time that the event was created
*
* @var int
*/
public $time;
/**
* Extra data to be held separate
*
* @var array
*/
public $args;
public function __construct(string $section, int $priority, string $message)
{
parent::__construct();
$this->section = $section;
$this->priority = $priority;
$this->message = $message;
$this->time = time();
}
}
class DatabaseUpgradeEvent extends Event
{
}

View File

@ -1,14 +0,0 @@
<?php
/*
* ConfigSaveEvent:
* Sent when the setup screen's 'set' button has been
* activated; new config options are in $_POST
*/
class ConfigSaveEvent extends Event {
var $config;
public function ConfigSaveEvent($config) {
$this->config = $config;
}
}
?>

View File

@ -1,21 +0,0 @@
<?php
/*
* DisplayingImageEvent:
* $image
*
* Sent when an image is ready to display. Extensions who
* wish to appear on the "view" page should listen for this,
* which only appears when an image actually exists.
*/
class DisplayingImageEvent extends Event {
var $image;
public function DisplayingImageEvent($image) {
$this->image = $image;
}
public function get_image() {
return $this->image;
}
}
?>

View File

@ -1,17 +0,0 @@
<?php
/*
* ImageDeletionEvent:
* $image_id
*
* An image is being deleted. Used by things like tags
* and comments handlers to clean out related rows in
* their tables
*/
class ImageDeletionEvent extends Event {
var $image;
public function ImageDeletionEvent($image) {
$this->image = $image;
}
}
?>

View File

@ -1,10 +0,0 @@
<?php
/*
* InitExtEvent:
* Get extensions to load themselves
*/
class InitExtEvent extends Event {
public function InitExtEvent() {
}
}
?>

View File

@ -1,31 +0,0 @@
<?php
/*
* PageRequestEvent:
* $page
* $args
* get_arg(int)
* count_args()
*
* User requests /view/42 -> an event is generated with
* $page="view" and $args=array("42");
*
* Used for initial page generation triggers
*/
class PageRequestEvent extends Event {
var $page;
var $args;
public function PageRequestEvent($page, $args) {
$this->page = $page;
$this->args = $args;
}
public function get_arg($n) {
return isset($this->args[$n]) ? $this->args[$n] : null;
}
public function count_args() {
return isset($this->args) ? count($this->args) : 0;
}
}
?>

View File

@ -1,17 +0,0 @@
<?php
/*
* TagSetEvent:
* $image_id
* $tags
*
*/
class TagSetEvent extends Event {
var $image_id;
var $tags;
public function TagSetEvent($image_id, $tags) {
$this->image_id = $image_id;
$this->tags = $tags;
}
}
?>

View File

@ -1,15 +0,0 @@
<?php
/*
* UploadingImageEvent:
* $image_id
*
* An image is being uploaded.
*/
class UploadingImageEvent extends Event {
var $image;
public function UploadingImageEvent($image) {
$this->image = $image;
}
}
?>

83
core/exceptions.php Normal file
View File

@ -0,0 +1,83 @@
<?php declare(strict_types=1);
/**
* Class SCoreException
*
* A base exception to be caught by the upper levels.
*/
class SCoreException extends RuntimeException
{
/** @var string|null */
public $query;
/** @var string */
public $error;
public function __construct(string $msg, ?string $query=null)
{
parent::__construct($msg);
$this->error = $msg;
$this->query = $query;
}
}
class InstallerException extends RuntimeException
{
/** @var string */
public $title;
/** @var string */
public $body;
/** @var int */
public $code;
public function __construct(string $title, string $body, int $code)
{
parent::__construct($body);
$this->title = $title;
$this->body = $body;
$this->code = $code;
}
}
/**
* Class PermissionDeniedException
*
* A fairly common, generic exception.
*/
class PermissionDeniedException extends SCoreException
{
}
/**
* Class ImageDoesNotExist
*
* This exception is used when an Image cannot be found by ID.
*
* Example: Image::by_id(-1) returns null
*/
class ImageDoesNotExist extends SCoreException
{
}
/*
* For validate_input()
*/
class InvalidInput extends SCoreException
{
}
/*
* This is used by the image resizing code when there is not enough memory to perform a resize.
*/
class InsufficientMemoryException extends SCoreException
{
}
/*
* This is used by the image resizing code when there is an error while resizing
*/
class ImageResizeException extends SCoreException
{
}

View File

@ -1,77 +0,0 @@
<?php
/* AdminBuildingEvent {{{
*
* Sent when the admin page is ready to be added to
*/
class AdminBuildingEvent extends Event {
public function AdminBuildingEvent() {
}
}
// }}}
class AdminPage extends Extension {
// event handler {{{
public function receive_event($event) {
if(is_a($event, 'PageRequestEvent') && ($event->page == "admin")) {
global $user;
if(!$user->is_admin()) {
global $page;
$page->set_title("Error");
$page->set_heading("Error");
$page->add_side_block(new NavBlock(), 0);
$page->add_main_block(new Block("Permission Denied", "This page is for admins only"), 0);
}
else {
if($event->get_arg(0) == "delete_image") {
// FIXME: missing lots of else {complain}
if(isset($_POST['image_id'])) {
global $database;
$image = $database->get_image($_POST['image_id']);
if($image) {
send_event(new ImageDeletionEvent($image));
global $page;
$page->set_mode("redirect");
$page->set_redirect(make_link("index"));
}
}
}
else {
send_event(new AdminBuildingEvent());
}
}
}
if(is_a($event, 'DisplayingImageEvent')) {
global $user;
if($user->is_admin()) {
global $page;
$page->add_side_block(new Block("Admin", $this->build_del_block($event->image->id)));
}
}
if(is_a($event, 'AdminBuildingEvent')) {
$this->build_page();
}
}
// }}}
// block HTML {{{
private function build_del_block($image_id) {
$i_image_id = int_escape($image_id);
return "
<form action='".make_link("admin/delete_image")."' method='POST'>
<input type='hidden' name='image_id' value='$i_image_id'>
<input type='submit' value='Delete'>
</form>
";
}
// }}}
// admin page HTML {{{
private function build_page() {
global $page;
$page->set_title("Admin Tools");
$page->set_heading("Admin Tools");
$page->add_side_block(new NavBlock(), 0);
}
// }}}
}
add_event_listener(new AdminPage());
?>

View File

@ -1,285 +0,0 @@
<?php
/*
* A class to handle adding / getting / removing image
* files from the disk
*/
class ImageIO extends Extension {
// event handling {{{
public function receive_event($event) {
if(is_a($event, 'PageRequestEvent') && ($event->page == "image")) {
$this->send_file($event->get_arg(0), "image");
}
if(is_a($event, 'PageRequestEvent') && ($event->page == "thumb")) {
$this->send_file($event->get_arg(0), "thumb");
}
if(is_a($event, 'UploadingImageEvent')) {
$this->add_image($event->image);
}
if(is_a($event, 'ImageDeletionEvent')) {
$this->remove_image($event->image);
}
if(is_a($event, 'SetupBuildingEvent')) {
$thumbers = array();
$thumbers['Built-in GD'] = "gd";
$thumbers['ImageMagick'] = "convert";
$sb = new SetupBlock("Thumbnailing");
$sb->add_label("Engine: ");
$sb->add_choice_option("thumb_engine", $thumbers);
$sb->add_label("<br>Size ");
$sb->add_int_option("thumb_width");
$sb->add_label(" x ");
$sb->add_int_option("thumb_height");
$sb->add_label(" px at ");
$sb->add_int_option("thumb_quality");
$sb->add_label(" % quality ");
$sb->add_label("<br>Max GD memory use: ");
$sb->add_shorthand_int_option("thumb_gd_mem_limit");
$event->panel->add_main_block($sb);
}
if(is_a($event, 'ConfigSaveEvent')) {
$event->config->set_string("thumb_engine", $_POST['thumb_engine']);
$event->config->set_int("thumb_width", $_POST['thumb_width']);
$event->config->set_int("thumb_height", $_POST['thumb_height']);
$event->config->set_int("thumb_quality", $_POST['thumb_quality']);
$event->config->set_int("thumb_gd_mem_limit", $_POST['thumb_gd_mem_limit']);
}
}
// }}}
// add image {{{
private function is_dupe($hash) {
global $database;
return $database->db->GetRow("SELECT * FROM images WHERE hash=?", array($hash));
}
private function read_file($fname) {
$fp = fopen($fname, "r");
if(!$fp) return false;
$data = fread($fp, filesize($fname));
fclose($fp);
return $data;
}
private function make_thumb($inname, $outname) {
global $config;
$ok = false;
switch($config->get_string("thumb_engine")) {
default:
case 'gd':
$ok = $this->make_thumb_gd($inname, $outname);
break;
case 'convert':
$ok = $this->make_thumb_convert($inname, $outname);
break;
}
return $ok;
}
// IM thumber {{{
private function make_thumb_convert($inname, $outname) {
global $config;
$w = $config->get_int("thumb_width");
$h = $config->get_int("thumb_height");
$q = $config->get_int("thumb_quality");
exec("convert $inname -geometry {$w}x{$h} -quality {$q} $outname");
return true;
}
// }}}
// GD thumber {{{
private function make_thumb_gd($inname, $outname) {
global $config;
$thumb = $this->get_thumb($inname);
return imagejpeg($thumb, $outname, $config->get_int('thumb_quality'));
}
private function get_memory_limit() {
global $config;
// thumbnail generation requires lots of memory
$default_limit = 8*1024*1024;
$shimmie_limit = parse_shorthand_int($config->get_int("thumb_gd_mem_limit"));
if($shimmie_limit < 3*1024*1024) {
// we aren't going to fit, override
$shimmie_limit = $default_limit;
}
ini_set("memory_limit", $shimmie_limit);
$memory = parse_shorthand_int(ini_get("memory_limit"));
// changing of memory limit is disabled / failed
if($memory == -1) {
$memory = $default_limit;
}
return $memory;
}
private function get_thumb($tmpname) {
global $config;
$info = getimagesize($tmpname);
$width = $info[0];
$height = $info[1];
$max_width = $config->get_int('thumb_width');
$max_height = $config->get_int('thumb_height');
$memory_use = (filesize($tmpname)*2) + ($width*$height*4) + (4*1024*1024);
$memory_limit = $this->get_memory_limit();
if($memory_use > $memory_limit) {
$thumb = imagecreatetruecolor($max_width, min($max_height, 64));
$white = imagecolorallocate($thumb, 255, 255, 255);
$black = imagecolorallocate($thumb, 0, 0, 0);
imagefill($thumb, 0, 0, $white);
imagestring($thumb, 5, 10, 24, "Image Too Large :(", $black);
return $thumb;
}
else {
$image = imagecreatefromstring($this->read_file($tmpname));
$xscale = ($max_height / $height);
$yscale = ($max_width / $width);
$scale = ($xscale < $yscale) ? $xscale : $yscale;
if($scale >= 1) {
$thumb = $image;
}
else {
$thumb = imagecreatetruecolor($width*$scale, $height*$scale);
imagecopyresampled(
$thumb, $image, 0, 0, 0, 0,
$width*$scale, $height*$scale, $width, $height
);
}
return $thumb;
}
}
// }}}
private function add_image($image) {
global $page;
global $user;
global $database;
global $config;
/*
* Check for an existing image
*/
if($row = $this->is_dupe($image->hash)) {
$iid = $row['id'];
$page->add_main_block(new Block(
"Error uploading {$image->filename}",
"Image <a href='".make_link("post/view/$iid")."'>$iid</a> ".
"already has hash {$image->hash}"));
return false;
}
// actually insert the info
$database->db->Execute(
"INSERT INTO images(owner_id, owner_ip, filename, filesize, hash, ext, width, height, posted) ".
"VALUES (?, ?, ?, ?, ?, ?, ?, ?, now())",
array($user->id, $_SERVER['REMOTE_ADDR'], $image->filename, $image->filesize,
$image->hash, $image->ext, $image->width, $image->height));
$image->id = $database->db->Insert_ID();
/*
* If no errors: move the file from the temporary upload
* area to the main file store, create a thumbnail, and
* insert the image info into the database
*/
if(!copy($image->temp_filename, $image->get_image_filename())) {
$page->add_main_block(new Block("Error uploading {$image->filename}",
"The image couldn't be moved from the temporary area to the
main data store -- is the web server allowed to write to '".
($image->get_image_filename())."'?"));
send_event(new ImageDeletionEvent($image->id));
return false;
}
chmod($image->get_image_filename(), 0644);
if(!$this->make_thumb($image->get_image_filename(), $image->get_thumb_filename())) {
$page->add_main_block(new Block("Error uploading {$image->filename}",
"The image thumbnail couldn't be generated -- is the web
server allowed to write to '".($image->get_thumb_filename())."'?"));
send_event(new ImageDeletionEvent($image->id));
return false;
}
chmod($image->get_thumb_filename(), 0644);
send_event(new TagSetEvent($image->id, $image->get_tag_array()));
return true;
}
// }}}
// fetch image {{{
private function send_file($image_id, $type) {
global $database;
$image = $database->get_image($image_id);
global $page;
if(!is_null($image)) {
$page->set_mode("data");
if($type == "thumb") {
$page->set_type("image/jpeg");
$file = $image->get_thumb_filename();
}
else {
$page->set_type($image->get_mime_type());
$file = $image->get_image_filename();
}
$page->set_data(file_get_contents($file));
if(isset($_SERVER["HTTP_IF_MODIFIED_SINCE"])) {
$if_modified_since = preg_replace('/;.*$/', '', $_SERVER["HTTP_IF_MODIFIED_SINCE"]);
}
else {
$if_modified_since = "";
}
$gmdate_mod = gmdate('D, d M Y H:i:s', filemtime($file)) . ' GMT';
// FIXME: should be $page->blah
if($if_modified_since == $gmdate_mod) {
header("HTTP/1.0 304 Not Modified");
}
else {
header("Last-Modified: $gmdate_mod");
header("Expires: Fri, 2 Sep 2101 12:42:42 GMT"); // War was beginning
}
}
else {
$page->set_title("Not Found");
$page->set_heading("Not Found");
$page->add_side_block(new Block("Navigation", "<a href='".index."'>Index</a>"), 0);
$page->add_main_block(new Block("Image not in database",
"The requested image was not found in the database"));
}
}
// }}}
// delete image {{{
private function remove_image($image) {
global $database;
$database->remove_image($image->id);
unlink($image->get_image_filename());
unlink($image->get_thumb_filename());
}
// }}}
}
add_event_listener(new ImageIO());
?>

View File

@ -1,147 +0,0 @@
<?php
class Index extends Extension {
// event handling {{{
public function receive_event($event) {
if(is_a($event, 'PageRequestEvent') && ($event->page == "index")) {
if($event->get_arg(0) == 'rss') {
$this->do_rss();
}
else {
$search_terms = array();
$page_number = 1;
if($event->count_args() > 0) {
$page_number = int_escape($event->get_arg(0));
}
if(isset($_GET['search'])) {
$search_terms = explode(' ', $_GET['search']);
$query = "search=".html_escape($_GET['search']);
}
else {
$query = null;
}
global $page;
global $config;
global $database;
$total_pages = $database->count_pages($search_terms);
$count = $config->get_int('index_width') * $config->get_int('index_height');
$images = $database->get_images(($page_number-1)*$count, $count, $search_terms);
if(count($search_terms) == 0) {
$page_title = $config->get_string('title');
}
else {
$page_title = html_escape($_GET['search']);
/*
$page_title = "";
foreach($search_terms as $term) {
$h_term = html_escape($term);
$page_title .= "<a href='".make_link("post/list", "search=$h_term")."'>$h_term</a>";
}
*/
$page->set_subheading("Page $page_number / $total_pages");
}
if($page_number > 1 || count($search_terms) > 0) {
// $page_title .= " / $page_number";
}
$page->set_title($page_title);
$page->set_heading($page_title);
$page->add_side_block(new Block("Navigation", $this->build_navigation($page_number, $total_pages, $search_terms)), 0);
$page->add_main_block(new Block("Images", $this->build_table($images, $query)), 10);
$page->add_main_block(new Paginator("index", $query, $page_number, $total_pages), 90);
}
}
if(is_a($event, 'SetupBuildingEvent')) {
$sb = new SetupBlock("Index Options");
$sb->add_label("Index table size ");
$sb->add_int_option("index_width");
$sb->add_label(" x ");
$sb->add_int_option("index_height");
$sb->add_label(" images");
$sb->add_label("<br>Image tooltip ");
$sb->add_text_option("image_tip");
$event->panel->add_main_block($sb, 20);
}
if(is_a($event, 'ConfigSaveEvent')) {
$event->config->set_int("index_width", $_POST['index_width']);
$event->config->set_int("index_height", $_POST['index_height']);
$event->config->set_string("image_tip", $_POST['image_tip']);
}
}
// }}}
// HTML generation {{{
private function build_navigation($page_number, $total_pages, $search_terms) {
$prev = $page_number - 1;
$next = $page_number + 1;
$h_tags = html_escape(implode("%20", $search_terms));
$query = empty($h_tags) ? null : "search=$h_tags";
$h_prev = ($page_number <= 1) ? "Prev" : "<a href='".make_link("index/$prev", $query)."'>Prev</a>";
$h_index = "<a href='".make_link("index")."'>Index</a>";
$h_next = ($page_number >= $total_pages) ? "Next" : "<a href='".make_link("index/$next", $query)."'>Next</a>";
$h_search_string = count($search_terms) == 0 ? "Search" : html_escape(implode(" ", $search_terms));
$h_search_link = make_link("index");
$h_search = "
<p><form action='$h_search_link' method='GET'>
<input id='search_input' name='search' type='text'
value='$h_search_string' autocomplete='off' />
<input type='submit' value='Find' style='display: none;' />
</form>
<div id='search_completions'></div>";
return "$h_prev | $h_index | $h_next<br>$h_search";
}
private function build_table($images, $query) {
global $config;
$width = $config->get_int('index_width');
$height = $config->get_int('index_height');
$table = "<table>\n";
for($i=0; $i<$height; $i++) {
$table .= "<tr>\n";
for($j=0; $j<$width; $j++) {
$image = isset($images[$i*$width+$j]) ? $images[$i*$width+$j] : null;
if(!is_null($image)) {
$table .= $this->build_thumb($image, $query);
}
else {
$table .= "\t<td>&nbsp;</td>\n";
}
}
$table .= "</tr>\n";
}
$table .= "</table>\n";
return $table;
}
private function build_thumb($image, $query=null) {
global $config;
$h_view_link = make_link("post/view/{$image->id}", $query);
$h_tip = html_escape($image->get_tooltip());
$h_thumb_link = $image->get_thumb_link();
return "<td><a href='$h_view_link'><img title='$h_tip' alt='$h_tip' src='$h_thumb_link'></a></td>\n";
}
// }}}
// rss {{{
private function do_rss() {
// TODO: this function
}
// }}}
}
add_event_listener(new Index());
?>

View File

@ -1,216 +0,0 @@
<?php
/* SetupBuildingEvent {{{
*
* Sent when the setup page is ready to be added to
*/
class SetupBuildingEvent extends Event {
var $panel;
public function SetupBuildingEvent($panel) {
$this->panel = $panel;
}
public function get_panel() {
return $this->panel;
}
}
// }}}
/* SetupPanel {{{
*
*/
class SetupPanel extends Page {
}
// }}}
/* SetupBlock {{{
*
*/
class SetupBlock extends Block {
var $header;
var $body;
public function SetupBlock($title) {
$this->header = $title;
}
public function add_label($text) {
$this->body .= $text;
}
public function add_text_option($name) {
global $config;
$val = $config->get_string($name);
$this->body .= "<input type='text' name='$name' value='$val'>\n";
}
public function add_longtext_option($name) {
global $config;
$val = $config->get_string($name);
$this->body .= "<textarea rows='5' cols='40' name='$name'>$val</textarea>\n";
$this->body .= "<!--<br><br><br><br>-->\n"; // setup page auto-layout counts <br> tags
}
public function add_bool_option($name) {
global $config;
$checked = $config->get_bool($name) ? " checked" : "";
$this->body .= "<input type='checkbox' name='$name'$checked>\n";
}
public function add_hidden_option($name) {
global $config;
$val = $config->get_string($name);
$this->body .= "<input type='hidden' name='$name' value='$val'>";
}
public function add_int_option($name) {
global $config;
$val = $config->get_string($name);
$this->body .= "<input type='text' name='$name' value='$val' size='4' style='text-align: center;'>\n";
}
public function add_shorthand_int_option($name) {
global $config;
$val = to_shorthand_int($config->get_string($name));
$this->body .= "<input type='text' name='$name' value='$val' size='6' style='text-align: center;'>\n";
}
public function add_choice_option($name, $options) {
global $config;
$current = $config->get_string($name);
$html = "<select name='$name'>";
foreach($options as $optname => $optval) {
if($optval == $current) $selected=" selected";
else $selected="";
$html .= "<option value='$optval'$selected>$optname</option>\n";
}
$html .= "</select>";
$this->body .= $html;
}
}
// }}}
class Setup extends Extension {
// event handling {{{
public function receive_event($event) {
if(is_a($event, 'PageRequestEvent') && ($event->page == "setup")) {
global $user;
if(!$user->is_admin()) {
global $page;
$page->set_title("Error");
$page->set_heading("Error");
$page->add_side_block(new NavBlock(), 0);
$page->add_main_block(new Block("Permission Denied", "This page is for admins only"), 0);
}
else {
if($event->get_arg(0) == "save") {
global $config;
send_event(new ConfigSaveEvent($config));
$config->save();
global $page;
$page->set_mode("redirect");
$page->set_redirect(make_link("setup"));
}
else {
$panel = new SetupPanel();
send_event(new SetupBuildingEvent($panel));
$this->build_page($panel);
}
}
}
if(is_a($event, 'SetupBuildingEvent')) {
$themes = array();
foreach(glob("themes/*") as $theme_dirname) {
$name = str_replace("themes/", "", $theme_dirname);
$themes[ucfirst($name)] = $name;
}
$sb = new SetupBlock("General");
$sb->add_label("Site title: ");
$sb->add_text_option("title");
$sb->add_label("<br>Base URL: ");
$sb->add_text_option("base_href");
$sb->add_label("<br>Data URL: ");
$sb->add_text_option("data_href");
$sb->add_label("<br>Contact URL: ");
$sb->add_text_option("contact_link");
$sb->add_label("<br>Theme: ");
$sb->add_choice_option("theme", $themes);
// $sb->add_label("<br>Anonymous ID: ");
// $sb->add_int_option("anon_id", 0, 100000);
$sb->add_hidden_option("anon_id");
$event->panel->add_main_block($sb, 0);
}
if(is_a($event, 'ConfigSaveEvent')) {
$event->config->set_string("title", $_POST['title']);
$event->config->set_string("base_href", $_POST['base_href']);
$event->config->set_string("data_href", $_POST['data_href']);
$event->config->set_string("contact_link", $_POST['contact_link']);
$event->config->set_string("theme", $_POST['theme']);
$event->config->set_int("anon_id", $_POST['anon_id']);
}
}
// }}}
// HTML building {{{
private function build_page($panel) {
$setupblock_html1 = "";
$setupblock_html2 = "";
ksort($panel->mainblocks);
/*
$flip = true;
foreach($panel->mainblocks as $block) {
if(is_a($block, 'SetupBlock')) {
if($flip) $setupblock_html1 .= $this->sb_to_html($block);
else $setupblock_html2 .= $this->sb_to_html($block);
$flip = !$flip;
}
}
*/
/*
* Try and keep the two columns even; count the line breaks in
* each an calculate where a block would work best
*/
$len1 = 0;
$len2 = 0;
foreach($panel->mainblocks as $block) {
if(is_a($block, 'SetupBlock')) {
$html = $this->sb_to_html($block);
$len = count(explode("<br>", $html));
if($len1 <= $len2) {
$setupblock_html1 .= $this->sb_to_html($block);
$len1 += $len;
}
else {
$setupblock_html2 .= $this->sb_to_html($block);
$len2 += $len;
}
}
}
$table = "
<form action='".make_link("setup/save")."' method='POST'><table>
<tr><td>$setupblock_html1</td><td>$setupblock_html2</td></tr>
<tr><td colspan='2'><input type='submit' value='Save Settings'></td></tr>
</table></form>
";
global $page;
$page->set_title("Shimmie Setup");
$page->set_heading("Shimmie Setup");
$page->add_side_block(new Block("Navigation", $this->build_navigation()), 0);
$page->add_main_block(new Block("Setup", $table));
}
private function build_navigation() {
return "
<a href='".make_link("index")."'>Index</a>
<br><a href='http://trac.shishnet.org/shimmie/wiki/Settings'>Help</a>
";
}
private function sb_to_html($block) {
return "<div class='setupblock'><b>{$block->header}</b><br>{$block->body}</div>\n";
}
// }}}
}
add_event_listener(new Setup());
?>

View File

@ -1,97 +0,0 @@
<?php
class TagEdit extends Extension {
// event handling {{{
public function receive_event($event) {
if(is_a($event, 'PageRequestEvent') && ($event->page == "tags")) {
global $page;
if($event->get_arg(0) == "set") {
global $database;
$i_image_id = int_escape($_POST['image_id']);
$query = $_POST['query'];
$database->set_tags($i_image_id, $_POST['tags']);
$page->set_mode("redirect");
$page->set_redirect(make_link("post/view/$i_image_id", $query));
}
else if($event->get_arg(0) == "replace") {
global $user;
if($user->is_admin() && isset($_POST['search']) && isset($_POST['replace'])) {
global $page;
$this->mass_tag_edit($_POST['search'], $_POST['replace']);
$page->set_mode("redirect");
$page->set_redirect(make_link("admin"));
}
}
}
if(is_a($event, 'DisplayingImageEvent')) {
global $page;
$page->add_main_block(new Block(null, $this->build_tag_editor($event->image)), 5);
}
if(is_a($event, 'TagSetEvent')) {
global $database;
$database->set_tags($event->image_id, $event->tags);
}
if(is_a($event, 'ImageDeletionEvent')) {
global $database;
$database->delete_tags_from_image($event->image->id);
}
if(is_a($event, 'AdminBuildingEvent')) {
global $page;
$page->add_main_block(new Block("Mass Tag Edit", $this->build_mass_tag_edit()));
}
// When an alias is added, oldtag becomes inaccessable
if(is_a($event, 'AddAliasEvent')) {
$this->mass_tag_edit($event->oldtag, $event->newtag);
}
}
// }}}
// edit {{{
private function mass_tag_edit($search, $replace) {
// FIXME: deal with collisions
global $database;
$database->db->Execute("UPDATE tags SET tag=? WHERE tag=?", Array($replace, $search));
}
// }}}
// HTML {{{
private function build_tag_editor($image) {
global $database;
if(isset($_GET['search'])) {
$h_query = "search=".html_escape($_GET['search']);
}
else {
$h_query = "";
}
$h_tags = html_escape($image->get_tag_list());
$i_image_id = int_escape($image->id);
return "
<p><form action='".make_link("tags/set")."' method='POST'>
<input type='hidden' name='image_id' value='$i_image_id'>
<input type='hidden' name='query' value='$h_query'>
<input type='text' size='50' name='tags' value='$h_tags'>
<input type='submit' value='Set'>
</form>
";
}
private function build_mass_tag_edit() {
return "
<form action='".make_link("tags/replace")."' method='POST'>
<table border='1' style='width: 200px;'>
<tr><td>Search</td><td><input type='text' name='search'></tr>
<tr><td>Replace</td><td><input type='text' name='replace'></td></tr>
<tr><td colspan='2'><input type='submit' value='Replace'></td></tr>
</table>
</form>
";
}
// }}}
}
add_event_listener(new TagEdit());
?>

View File

@ -1,131 +0,0 @@
<?php
class Upload extends Extension {
// event handling {{{
public function receive_event($event) {
global $page;
if(is_a($event, 'PageRequestEvent') && ($event->page == "index")) {
if($this->can_upload()) {
$page->add_side_block(new Block("Upload", $this->build_upload_block()), 20);
}
}
if(is_a($event, 'PageRequestEvent') && ($event->page == "upload")) {
if($this->can_upload()) {
global $config;
global $page;
$ok = true;
foreach($_FILES as $file) {
$ok = $ok & $this->try_upload($file);
}
$this->show_result($ok);
}
else {
$page->set_title("Upload Denied");
$page->set_heading("Upload Denied");
$page->add_side_block(new NavBlock());
$page->add_main_block(new Block("Error", "Anonymous posting is disabled"));
}
}
if(is_a($event, 'SetupBuildingEvent')) {
$sb = new SetupBlock("Upload");
$sb->add_label("Max Uploads: ");
$sb->add_int_option("upload_count");
$sb->add_label("<br>Max size per file: ");
$sb->add_shorthand_int_option("upload_size");
$sb->add_label("<br>Allow anonymous upoads: ");
$sb->add_bool_option("upload_anon");
$event->panel->add_main_block($sb, 10);
}
if(is_a($event, 'ConfigSaveEvent')) {
$event->config->set_int("upload_count", $_POST['upload_count']);
$event->config->set_int("upload_size", $_POST['upload_size']);
$event->config->set_bool("upload_anon", $_POST['upload_anon']);
}
}
// }}}
// do things {{{
private function can_upload() {
global $config, $user;
return $config->get_bool("upload_anon") || ($user->id != $config->get_int("anon_id"));
}
private function try_upload($file) {
global $page;
global $config;
$ok = false;
if(!file_exists($file['tmp_name'])) {
// this happens normally with blank file boxes
}
else if(filesize($file['tmp_name']) > $config->get_int('upload_size')) {
$page->add_main_block(new Block("Error with ".html_escape($file['name']),
"File too large (".filesize($file['tmp_name'])." &gt; ".
($config->get_int('upload_size')).")"));
}
else if(!($info = getimagesize($file['tmp_name']))) {
$page->add_main_block(new Block("Error with ".html_escape($file['name']),
"PHP doesn't recognise this as an image file"));
}
else {
$image = new Image($file['tmp_name'], $file['name'], $_POST['tags']);
if($image->is_ok()) {
send_event(new UploadingImageEvent($image));
$ok = true;
}
else {
$page->add_main_block(new Block("Error with ".html_escape($file['name']),
"Something is not right!"));
}
}
return $ok;
}
private function show_result($ok) {
global $page;
if($ok) {
$page->set_mode("redirect");
$page->set_redirect(make_link("index"));
}
else {
$page->set_title("Upload Status");
$page->set_heading("Upload Status");
$page->add_side_block(new NavBlock());
$page->add_main_block(new Block("OK?",
"If there are no errors here, things should be OK \\o/"));
}
}
// }}}
// HTML {{{
private function build_upload_block() {
global $config;
$upload_list = "";
for($i=0; $i<$config->get_int('upload_count'); $i++) {
if($i == 0) $style = ""; // "style='display:visible'";
else $style = "style='display:none'";
$upload_list .= "<input accept='image/jpeg,image/png,image/gif' size='10' ".
"id='data$i' name='data$i' $style onchange=\"showUp('data".($i+1)."')\" type='file'>\n";
}
$max_size = $config->get_int('upload_size');
$max_kb = (int)($max_size / 1024);
// <input type='hidden' name='max_file_size' value='$max_size' />
return "
<form enctype='multipart/form-data' action='".make_link("upload")."' method='POST'>
$upload_list
<input id='tagBox' name='tags' type='text' value='tagme' autocomplete='off'>
<input type='submit' value='Post'>
</form>
<div id='upload_completions' style='clear: both;'><small>(Max file size is {$max_kb}KB)</small></div>
";
}
// }}}
}
add_event_listener(new Upload());
?>

View File

@ -1,401 +0,0 @@
<?php
class UserPage extends Extension {
// event handling {{{
public function receive_event($event) {
if(is_a($event, 'PageRequestEvent') && ($event->page == "user")) {
global $page;
global $user;
global $database;
global $config;
if($event->get_arg(0) == "login") {
if(isset($_POST['user']) && isset($_POST['pass'])) {
$this->login();
}
else {
$page->set_title("Login");
$page->set_heading("Login");
$page->add_side_block(new NavBlock());
$page->add_main_block(new Block("Login There",
"There should be a login box to the left"));
}
}
else if($event->get_arg(0) == "logout") {
setcookie("shm_session", "", time()+60*60*24*$config->get_int('login_memory'), "/");
$page->set_mode("redirect");
$page->set_redirect(make_link("index"));
}
else if($event->get_arg(0) == "changepass") {
$this->change_password_wrapper();
}
else if($event->get_arg(0) == "create") {
$this->create_user_wrapper();
}
else if($event->get_arg(0) == "set_more") {
$this->set_more_wrapper();
}
else { // view
$duser = ($event->count_args() == 0) ? $user : $database->get_user_by_name($event->get_arg(0));
$this->build_user_page($duser);
}
}
// user info is shown on all pages
if(is_a($event, 'PageRequestEvent')) {
global $user;
global $page;
if($user->is_anonymous()) {
$page->add_side_block(new Block("Login", $this->build_login_block()), 90);
}
else {
$page->add_side_block(new Block("User Links", $this->build_links_block()), 90);
}
}
if(is_a($event, 'SetupBuildingEvent')) {
$sb = new SetupBlock("User Options");
$sb->add_label("Login memory: ");
$sb->add_int_option("login_memory");
$sb->add_label(" days");
$sb->add_label("<br>Allow new signups: ");
$sb->add_bool_option("login_signup_enabled");
$sb->add_label("<br>Terms &amp; Conditions:<br>");
$sb->add_longtext_option("login_tac");
$event->panel->add_main_block($sb);
}
if(is_a($event, 'ConfigSaveEvent')) {
$event->config->set_int("login_memory", $_POST['login_memory']);
$event->config->set_bool("login_signup_enabled", $_POST['login_signup_enabled']);
$event->config->set_string("login_tac", $_POST['login_tac']);
}
}
// }}}
// Things done *with* the user {{{
private function login() {
global $page;
global $database;
global $config;
global $user;
$name = $_POST['user'];
$pass = $_POST['pass'];
$addr = $_SERVER['REMOTE_ADDR'];
$hash = md5( strtolower($name) . $pass );
$duser = $database->get_user($name, $hash);
if(!is_null($duser)) {
$user = $duser;
setcookie(
"shm_user", $name,
time()+60*60*24*365, "/"
);
setcookie(
"shm_session", md5($hash.$addr),
time()+60*60*24*$config->get_int('login_memory'), "/"
);
$page->set_mode("redirect");
$page->set_redirect(make_link("user"));
}
else {
$page->set_title("Permission Denied");
$page->set_heading("Permission Denied");
$page->add_side_block(new NavBlock(), 0);
$page->add_main_block(new Block("Error", "No user with those details was found"));
}
}
private function create_user_wrapper() {
global $page;
global $database;
global $config;
if(!$config->get_bool("login_signup_enabled")) {
$page->set_title("Signups Disabled");
$page->set_heading("Signups Disabled");
$page->add_side_block(new NavBlock());
$page->add_main_block(new Block("Signups Disabled",
"The board admin has disabled the ability to create new accounts~"));
}
else if(isset($_POST['name']) && isset($_POST['pass1']) && isset($_POST['pass2'])) {
$name = trim($_POST['name']);
$pass1 = $_POST['pass1'];
$pass2 = $_POST['pass2'];
$page->set_title("Error");
$page->set_heading("Error");
$page->add_side_block(new NavBlock());
if(strlen($name) < 1) {
$page->add_main_block(new Block("Error", "Username must be at least 1 character"));
}
else if($pass1 != $pass2) {
$page->add_main_block(new Block("Error", "Passwords don't match"));
}
else if($database->db->GetRow("SELECT * FROM users WHERE name = ?", array($name))) {
$page->add_main_block(new Block("Error", "That username is already taken"));
}
else {
$addr = $_SERVER['REMOTE_ADDR'];
$hash = md5( strtolower($name) . $pass1 );
$email = isset($_POST['email']) ? $_POST['email'] : null;
// FIXME: send_event()
$database->db->Execute(
"INSERT INTO users (name, pass, joindate, email) VALUES (?, ?, now(), ?)",
array($name, $hash, $email));
setcookie("shm_user", $name,
time()+60*60*24*365, '/');
setcookie("shm_session", md5($hash.$addr),
time()+60*60*24*$config->get_int('login_memory'), '/');
$page->set_mode("redirect");
$page->set_redirect(make_link("user"));
}
}
else {
$page->set_title("Create Account");
$page->set_heading("Create Account");
$page->add_side_block(new NavBlock());
$page->add_main_block(new Block("Signup", $this->build_signup_form()));
}
}
//}}}
// Things do ne *to* the user {{{
private function change_password_wrapper() {
global $user;
global $page;
global $database;
$page->set_title("Error");
$page->set_heading("Error");
$page->add_side_block(new NavBlock());
if($user->is_anonymous()) {
$page->add_main_block(new Block("Error", "You aren't logged in"));
}
else if(isset($_POST['id']) && isset($_POST['name']) &&
isset($_POST['pass1']) && isset($_POST['pass2'])) {
$name = $_POST['name'];
$id = $_POST['id'];
$pass1 = $_POST['pass1'];
$pass2 = $_POST['pass2'];
if((!$user->is_admin()) && ($name != $user->name)) {
$page->add_main_block(new Block("Error",
"You need to be an admin to change other people's passwords"));
}
else if($pass1 != $pass2) {
$page->add_main_block(new Block("Error", "Passwords don't match"));
}
else {
global $config;
$addr = $_SERVER['REMOTE_ADDR'];
$hash = md5( strtolower($name) . $pass1 );
// FIXME: send_event()
// FIXME: $duser->set_pass();
$database->db->Execute(
"UPDATE users SET pass = ? WHERE id = ?",
array($hash, $id));
if($id == $user->id) {
setcookie("shm_user", $name,
time()+60*60*24*365, '/');
setcookie("shm_session", md5($hash.$addr),
time()+60*60*24*$config->get_int('login_memory'), '/');
$page->set_mode("redirect");
$page->set_redirect(make_link("user"));
}
else {
$page->set_mode("redirect");
$page->set_redirect(make_link("user/{$user->name}"));
}
}
}
}
private function set_more_wrapper() {
global $page;
global $user;
global $database;
$page->set_title("Error");
$page->set_heading("Error");
$page->add_side_block(new NavBlock());
if(!$user->is_admin()) {
$page->add_main_block(new Block("Not Admin", "Only admins can edit accounts"));
}
else if(!isset($_POST['id']) || !is_numeric($_POST['id'])) {
$page->add_main_block(new Block("No ID Specified",
"You need to specify the account number to edit"));
}
else {
$admin = (isset($_POST['admin']) && ($_POST['admin'] == "on"));
$enabled = (isset($_POST['enabled']) && ($_POST['enabled'] == "on"));
$duser = $database->get_user_by_id($_POST['id']);
$duser->set_admin($admin);
$duser->set_enabled($enabled);
$page->set_mode("redirect");
if($duser->id == $user->id) {
$page->set_redirect(make_link("user"));
}
else {
$page->set_redirect(make_link("user/{$duser->name}"));
}
}
}
// }}}
// HTML building {{{
private function build_signup_form() {
global $config;
$tac = $config->get_string("login_tac");
if(empty($tac)) {
$html = "";
}
else {
$html = "<p>$tac</p>";
}
$html .= "
<form action='".make_link("user/create")."' method='POST'>
<table style='width: 300px;' border='1'>
<tr><td>Name</td><td><input type='text' name='name'></td></tr>
<tr><td>Password</td><td><input type='password' name='pass1'></td></tr>
<tr><td>Repeat Password</td><td><input type='password' name='pass2'></td></tr>
<tr><td>Email (Optional)</td><td><input type='text' name='email'></td></tr>
<tr><td colspan='2'><input type='Submit' value='Create Account'></td></tr>
</table>
</form>
";
return $html;
}
private function build_user_page($duser) {
global $page;
global $user;
if(!is_null($duser)) {
$page->set_title("{$duser->name}'s Page");
$page->set_heading("{$duser->name}'s Page");
$page->add_side_block(new NavBlock(), 0);
$page->add_main_block(new Block("Stats", $this->build_stats($duser)));
if(!$user->is_anonymous()) {
if($user->id == $duser->id || $user->is_admin()) {
$page->add_main_block(new Block("Options", $this->build_options($duser)));
}
if($user->is_admin()) {
$page->add_main_block(new Block("More Options", $this->build_more_options($duser)));
}
}
}
else {
$page->set_title("No Such User");
$page->set_heading("No Such User");
$page->add_side_block(new NavBlock(), 0);
$page->add_main_block(new Block("No User By That ID",
"If you typed the ID by hand, try again; if you came from a link on this ".
"site, it might be bug report time..."));
}
}
private function build_stats($duser) {
global $database;
global $config;
$i_days_old = int_escape($duser->get_days_old());
$h_join_date = html_escape($duser->join_date);
$i_image_count = int_escape($duser->get_image_count());
$i_comment_count = int_escape($duser->get_comment_count());
$i_days_old2 = ($i_days_old == 0) ? 1 : $i_days_old;
$h_image_rate = sprintf("%3.1f", ($i_image_count / $i_days_old2));
$h_comment_rate = sprintf("%3.1f", ($i_comment_count / $i_days_old2));
return "
Join date: $h_join_date ($i_days_old days old)
<br>Images uploaded: $i_image_count ($h_image_rate / day)
<br>Comments made: $i_comment_count ($h_comment_rate / day)
";
}
private function build_options($duser) {
global $database;
global $config;
$html = "";
$html .= "
<form action='".make_link("user/changepass")."' method='POST'>
<input type='hidden' name='name' value='{$duser->name}'>
<input type='hidden' name='id' value='{$duser->id}'>
<table style='width: 300px;' border='1'>
<tr><td colspan='2'>Change Password</td></tr>
<tr><td>Password</td><td><input type='password' name='pass1'></td></tr>
<tr><td>Repeat Password</td><td><input type='password' name='pass2'></td></tr>
<tr><td colspan='2'><input type='Submit' value='Change Password'></td></tr>
</table>
</form>
";
return $html;
}
private function build_more_options($duser) {
global $database;
global $config;
$i_user_id = int_escape($duser->id);
$h_is_admin = $duser->is_admin() ? " checked" : "";
$h_is_enabled = $duser->is_enabled() ? " checked" : "";
$html = "
<form action='".make_link("user/set_more")."' method='POST'>
<input type='hidden' name='id' value='$i_user_id'>
Admin: <input name='admin' type='checkbox'$h_is_admin>
<br>Enabled: <input name='enabled' type='checkbox'$h_is_enabled>
<p><input type='submit' value='Set'>
</form>
";
return $html;
}
private function build_links_block() {
global $user;
$h_name = html_escape($user->name);
$html = "Logged in as $h_name";
if($user->is_admin()) {
$html .= "<br/><a href='".make_link("setup")."'>Board Config</a>";
$html .= "<br/><a href='".make_link("admin")."'>Admin</a>";
}
$html .= "<br/><a href='".make_link("user")."'>User Config</a>";
$html .= "<br/><a href='".make_link("user/logout")."'>Log Out</a>";
return $html;
}
private function build_login_block() {
global $config;
$html = "
<form action='".make_link("user/login")."' method='POST'>
<table border='1' summary='Login Form'>
<tr><td width='70'>Name</td><td width='70'><input type='text' name='user'></td></tr>
<tr><td>Password</td><td><input type='password' name='pass'></td></tr>
<tr><td colspan='2'><input type='submit' name='gobu' value='Log In'></td></tr>
</table>
</form>
";
if($config->get_bool("login_signup_enabled")) {
$html .= "<small><a href='".make_link("user/create")."'>Create Account</a></small>";
}
else {
$html .= "<small>Account creation disabled</small>";
}
return $html;
}
// }}}
}
add_event_listener(new UserPage());
?>

View File

@ -1,124 +0,0 @@
<?php
class ViewImage extends Extension {
// event handling {{{
public function receive_event($event) {
if(is_a($event, 'PageRequestEvent') && ($event->page == "post") && ($event->get_arg(0) == "view")) {
$image_id = int_escape($event->get_arg(1));
global $database;
$image = $database->get_image($image_id);
if(!is_null($image)) {
send_event(new DisplayingImageEvent($image));
}
else {
global $page;
$page->set_title("Image not found");
$page->set_heading("Image not found");
$page->add_side_block(new NavBlock(), 0);
$page->add_main_block(new Block("Image not found",
"No image in the database has the ID #$image_id"), 0);
}
}
if(is_a($event, 'DisplayingImageEvent')) {
$image = $event->get_image();
global $page;
$page->set_title("Image {$image->id}: ".$image->get_tag_list());
$page->set_heading($image->get_tag_list());
$page->add_side_block(new Block("Navigation", $this->build_navigation($image->id)), 0);
$page->add_main_block(new Block("Image", $this->build_image_view($image)), 0);
$page->add_main_block(new Block(null, $this->build_info($image)), 10);
}
if(is_a($event, 'SetupBuildingEvent')) {
$sb = new SetupBlock("View Options");
$sb->add_label("Long link ");
$sb->add_text_option("image_ilink");
$sb->add_label("<br>Short link ");
$sb->add_text_option("image_slink");
$sb->add_label("<br>Thumbnail link ");
$sb->add_text_option("image_tlink");
//$sb->add_label("<br>Zoom by default");
//$sb->add_bool_option("view_scale");
$event->panel->add_main_block($sb, 30);
}
if(is_a($event, 'ConfigSaveEvent')) {
$event->config->set_string("image_ilink", $_POST['image_ilink']);
$event->config->set_string("image_slink", $_POST['image_slink']);
$event->config->set_string("image_tlink", $_POST['image_tlink']);
//$event->config->set_bool("view_scale", $_POST['view_scale']);
}
}
// }}}
// HTML {{{
var $pin = null;
private function build_pin($image_id) {
if(!is_null($this->pin)) {
return $this->pin;
}
global $database;
// $next_img = $database->db->GetOne("SELECT id FROM images WHERE id < ? ORDER BY id DESC", array($image_id));
// $prev_img = $database->db->GetOne("SELECT id FROM images WHERE id > ? ORDER BY id ASC ", array($image_id));
if(isset($_GET['search'])) {
$search_terms = explode(' ', $_GET['search']);
$query = "search=".html_escape($_GET['search']);
}
else {
$search_terms = array();
$query = null;
}
$next = $database->get_next_image($image_id, $search_terms);
$prev = $database->get_prev_image($image_id, $search_terms);
$h_prev = (!is_null($prev) ? "<a href='".make_link("post/view/{$prev->id}", $query)."'>Prev</a>" : "Prev");
$h_index = "<a href='".make_link("index")."'>Index</a>";
$h_next = (!is_null($next) ? "<a href='".make_link("post/view/{$next->id}", $query)."'>Next</a>" : "Next");
$this->pin = "$h_prev | $h_index | $h_next";
return $this->pin;
}
private function build_navigation($image_id) {
$h_pin = $this->build_pin($image_id);
$h_search = "
<p><form action='".make_link("index")."' method='GET'>
<input id='search_input' name='search' type='text'
value='Search' autocomplete='off'>
<input type='submit' value='Find' style='display: none;'>
</form>
<div id='search_completions'></div>";
return "$h_pin<br>$h_search";
}
private function build_image_view($image) {
$ilink = $image->get_image_link();
return "<img id='main_image' src='$ilink'>";
}
private function build_info($image) {
$owner = $image->get_owner();
$h_owner = html_escape($owner->name);
$i_owner_id = int_escape($owner->id);
$html = "";
if(strlen($image->get_short_link()) > 0) {
$slink = $image->get_short_link();
$html .= "<p>Link: <input size='50' type='text' value='$slink'>";
}
$html .= "<p>Uploaded by <a href='".make_link("user/$h_owner")."'>$h_owner</a>";
$html .= "<p>".$this->build_pin($image->id);
return $html;
}
// }}}
}
add_event_listener(new ViewImage());
?>

View File

@ -1,5 +0,0 @@
<?php
class Extension {
public function receive_event($event) {}
}
?>

446
core/extension.php Normal file
View File

@ -0,0 +1,446 @@
<?php declare(strict_types=1);
/**
* Class Extension
*
* send_event(BlahEvent()) -> onBlah($event)
*
* Also loads the theme object into $this->theme if available
*
* The original concept came from Artanis's Extension extension
* --> https://github.com/Artanis/simple-extension/tree/master
* Then re-implemented by Shish after he broke the forum and couldn't
* find the thread where the original was posted >_<
*/
abstract class Extension
{
/** @var string */
public $key;
/** @var Themelet */
protected $theme;
/** @var ExtensionInfo */
public $info;
private static $enabled_extensions = [];
public function __construct($class = null)
{
$class = $class ?? get_called_class();
$this->theme = $this->get_theme_object($class);
$this->info = ExtensionInfo::get_for_extension_class($class);
if ($this->info===null) {
throw new ScoreException("Info class not found for extension $class");
}
$this->key = $this->info->key;
}
/**
* Find the theme object for a given extension.
*/
private function get_theme_object(string $base): ?Themelet
{
$custom = 'Custom'.$base.'Theme';
$normal = $base.'Theme';
if (class_exists($custom)) {
return new $custom();
} elseif (class_exists($normal)) {
return new $normal();
} else {
return null;
}
}
/**
* Override this to change the priority of the extension,
* lower numbered ones will receive events first.
*/
public function get_priority(): int
{
return 50;
}
public static function determine_enabled_extensions()
{
self::$enabled_extensions = [];
foreach (array_merge(
ExtensionInfo::get_core_extensions(),
explode(",", EXTRA_EXTS)
) as $key) {
$ext = ExtensionInfo::get_by_key($key);
if ($ext===null || !$ext->is_supported()) {
continue;
}
// FIXME: error if one of our dependencies isn't supported
self::$enabled_extensions[] = $ext->key;
if (!empty($ext->dependencies)) {
foreach ($ext->dependencies as $dep) {
self::$enabled_extensions[] = $dep;
}
}
}
}
public static function is_enabled(string $key): ?bool
{
return in_array($key, self::$enabled_extensions);
}
public static function get_enabled_extensions(): array
{
return self::$enabled_extensions;
}
public static function get_enabled_extensions_as_string(): string
{
return implode(",", self::$enabled_extensions);
}
protected function get_version(string $name): int
{
global $config;
return $config->get_int($name, 0);
}
protected function set_version(string $name, int $ver)
{
global $config;
$config->set_int($name, $ver);
log_info("upgrade", "Set version for $name to $ver");
}
}
abstract class ExtensionInfo
{
// Every credit you get costs us RAM. It stops now.
public const SHISH_NAME = "Shish";
public const SHISH_EMAIL = "webmaster@shishnet.org";
public const SHIMMIE_URL = "https://code.shishnet.org/shimmie2/";
public const SHISH_AUTHOR = [self::SHISH_NAME=>self::SHISH_EMAIL];
public const LICENSE_GPLV2 = "GPLv2";
public const LICENSE_MIT = "MIT";
public const LICENSE_WTFPL = "WTFPL";
public const VISIBLE_ADMIN = "admin";
public const VISIBLE_HIDDEN = "hidden";
private const VALID_VISIBILITY = [self::VISIBLE_ADMIN, self::VISIBLE_HIDDEN];
public $key;
public $core = false;
public $beta = false;
public $name;
public $authors = [];
public $link;
public $license;
public $version;
public $dependencies = [];
public $visibility;
public $description;
public $documentation;
/** @var array which DBs this ext supports (blank for 'all') */
public $db_support = [];
/** @var bool */
private $supported = null;
/** @var string */
private $support_info = null;
public function is_supported(): bool
{
if ($this->supported===null) {
$this->check_support();
}
return $this->supported;
}
public function get_support_info(): string
{
if ($this->supported===null) {
$this->check_support();
}
return $this->support_info;
}
private static $all_info_by_key = [];
private static $all_info_by_class = [];
private static $core_extensions = [];
protected function __construct()
{
assert(!empty($this->key), "key field is required");
assert(!empty($this->name), "name field is required for extension $this->key");
assert(empty($this->visibility) || in_array($this->visibility, self::VALID_VISIBILITY), "Invalid visibility for extension $this->key");
assert(is_array($this->db_support), "db_support has to be an array for extension $this->key");
assert(is_array($this->authors), "authors has to be an array for extension $this->key");
assert(is_array($this->dependencies), "dependencies has to be an array for extension $this->key");
}
public function is_enabled(): bool
{
return Extension::is_enabled($this->key);
}
private function check_support()
{
global $database;
$this->support_info = "";
if (!empty($this->db_support) && !in_array($database->get_driver_name(), $this->db_support)) {
$this->support_info .= "Database not supported. ";
}
// Additional checks here as needed
$this->supported = empty($this->support_info);
}
public static function get_all(): array
{
return array_values(self::$all_info_by_key);
}
public static function get_all_keys(): array
{
return array_keys(self::$all_info_by_key);
}
public static function get_core_extensions(): array
{
return self::$core_extensions;
}
public static function get_by_key(string $key): ?ExtensionInfo
{
if (array_key_exists($key, self::$all_info_by_key)) {
return self::$all_info_by_key[$key];
} else {
return null;
}
}
public static function get_for_extension_class(string $base): ?ExtensionInfo
{
$normal = $base.'Info';
if (array_key_exists($normal, self::$all_info_by_class)) {
return self::$all_info_by_class[$normal];
} else {
return null;
}
}
public static function load_all_extension_info()
{
foreach (getSubclassesOf("ExtensionInfo") as $class) {
$extension_info = new $class();
if (array_key_exists($extension_info->key, self::$all_info_by_key)) {
throw new ScoreException("Extension Info $class with key $extension_info->key has already been loaded");
}
self::$all_info_by_key[$extension_info->key] = $extension_info;
self::$all_info_by_class[$class] = $extension_info;
if ($extension_info->core===true) {
self::$core_extensions[] = $extension_info->key;
}
}
}
}
/**
* Class FormatterExtension
*
* Several extensions have this in common, make a common API.
*/
abstract class FormatterExtension extends Extension
{
public function onTextFormatting(TextFormattingEvent $event)
{
$event->formatted = $this->format($event->formatted);
$event->stripped = $this->strip($event->stripped);
}
abstract public function format(string $text): string;
abstract public function strip(string $text): string;
}
/**
* Class DataHandlerExtension
*
* This too is a common class of extension with many methods in common,
* so we have a base class to extend from.
*/
abstract class DataHandlerExtension extends Extension
{
protected $SUPPORTED_MIME = [];
protected function move_upload_to_archive(DataUploadEvent $event)
{
$target = warehouse_path(Image::IMAGE_DIR, $event->hash);
if (!@copy($event->tmpname, $target)) {
$errors = error_get_last();
throw new UploadException(
"Failed to copy file from uploads ({$event->tmpname}) to archive ($target): ".
"{$errors['type']} / {$errors['message']}"
);
}
}
public function onDataUpload(DataUploadEvent $event)
{
$supported_ext = $this->supported_ext($event->type);
$check_contents = $this->check_contents($event->tmpname);
if ($supported_ext && $check_contents) {
$this->move_upload_to_archive($event);
send_event(new ThumbnailGenerationEvent($event->hash, $event->type));
/* Check if we are replacing an image */
if (!is_null($event->replace_id)) {
/* hax: This seems like such a dirty way to do this.. */
/* Check to make sure the image exists. */
$existing = Image::by_id($event->replace_id);
if (is_null($existing)) {
throw new UploadException("Image to replace does not exist!");
}
if ($existing->hash === $event->metadata['hash']) {
throw new UploadException("The uploaded image is the same as the one to replace.");
}
// even more hax..
$event->metadata['tags'] = $existing->get_tag_list();
$image = $this->create_image_from_data(warehouse_path(Image::IMAGE_DIR, $event->metadata['hash']), $event->metadata);
if (is_null($image)) {
throw new UploadException("Data handler failed to create image object from data");
}
if (empty($image->ext)) {
throw new UploadException("Unable to determine extension for ". $event->tmpname);
}
try {
send_event(new MediaCheckPropertiesEvent($image));
} catch (MediaException $e) {
throw new UploadException("Unable to scan media properties: ".$e->getMessage());
}
send_event(new ImageReplaceEvent($event->replace_id, $image));
$event->image_id = $event->replace_id;
} else {
$image = $this->create_image_from_data(warehouse_path(Image::IMAGE_DIR, $event->hash), $event->metadata);
if (is_null($image)) {
throw new UploadException("Data handler failed to create image object from data");
}
if (empty($image->ext)) {
throw new UploadException("Unable to determine extension for ". $event->tmpname);
}
try {
send_event(new MediaCheckPropertiesEvent($image));
} catch (MediaException $e) {
throw new UploadException("Unable to scan media properties: ".$e->getMessage());
}
$iae = send_event(new ImageAdditionEvent($image));
$event->image_id = $iae->image->id;
$event->merged = $iae->merged;
// Rating Stuff.
if (!empty($event->metadata['rating'])) {
$rating = $event->metadata['rating'];
send_event(new RatingSetEvent($image, $rating));
}
// Locked Stuff.
if (!empty($event->metadata['locked'])) {
$locked = $event->metadata['locked'];
send_event(new LockSetEvent($image, !empty($locked)));
}
}
} elseif ($supported_ext && !$check_contents) {
// We DO support this extension - but the file looks corrupt
throw new UploadException("Invalid or corrupted file");
}
}
public function onThumbnailGeneration(ThumbnailGenerationEvent $event)
{
$result = false;
if ($this->supported_ext($event->type)) {
if ($event->force) {
$result = $this->create_thumb($event->hash, $event->type);
} else {
$outname = warehouse_path(Image::THUMBNAIL_DIR, $event->hash);
if (file_exists($outname)) {
return;
}
$result = $this->create_thumb($event->hash, $event->type);
}
}
if ($result) {
$event->generated = true;
}
}
public function onDisplayingImage(DisplayingImageEvent $event)
{
global $page;
if ($this->supported_ext($event->image->ext)) {
/** @noinspection PhpPossiblePolymorphicInvocationInspection */
$this->theme->display_image($page, $event->image);
}
}
public function onMediaCheckProperties(MediaCheckPropertiesEvent $event)
{
if ($this->supported_ext($event->ext)) {
$this->media_check_properties($event);
}
}
protected function create_image_from_data(string $filename, array $metadata): Image
{
global $config;
$image = new Image();
$image->filesize = $metadata['size'];
$image->hash = $metadata['hash'];
$image->filename = (($pos = strpos($metadata['filename'], '?')) !== false) ? substr($metadata['filename'], 0, $pos) : $metadata['filename'];
if ($config->get_bool("upload_use_mime")) {
$image->ext = get_extension_for_file($filename);
}
if (empty($image->ext)) {
$image->ext = (($pos = strpos($metadata['extension'], '?')) !== false) ? substr($metadata['extension'], 0, $pos) : $metadata['extension'];
}
$image->tag_array = is_array($metadata['tags']) ? $metadata['tags'] : Tag::explode($metadata['tags']);
$image->source = $metadata['source'];
return $image;
}
abstract protected function media_check_properties(MediaCheckPropertiesEvent $event): void;
abstract protected function check_contents(string $tmpname): bool;
abstract protected function create_thumb(string $hash, string $type): bool;
protected function supported_ext(string $ext): bool
{
return in_array(get_mime_for_extension($ext), $this->SUPPORTED_MIME);
}
public static function get_all_supported_exts(): array
{
$arr = [];
foreach (getSubclassesOf("DataHandlerExtension") as $handler) {
$handler = (new $handler());
foreach ($handler->SUPPORTED_MIME as $mime) {
$arr = array_merge($arr, get_all_extension_for_mime($mime));
}
}
$arr = array_unique($arr);
return $arr;
}
}

448
core/filetypes.php Normal file
View File

@ -0,0 +1,448 @@
<?php
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
* MIME types and extension information and resolvers *
\* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
const EXTENSION_ANI = 'ani';
const EXTENSION_ASC = 'asc';
const EXTENSION_ASF = 'asf';
const EXTENSION_AVI = 'avi';
const EXTENSION_BMP = 'bmp';
const EXTENSION_BZIP = 'bz';
const EXTENSION_BZIP2 = 'bz2';
const EXTENSION_CBR = 'cbr';
const EXTENSION_CBZ = 'cbz';
const EXTENSION_CBT = 'cbt';
const EXTENSION_CBA = 'cbA';
const EXTENSION_CB7 = 'cb7';
const EXTENSION_CSS = 'css';
const EXTENSION_CSV = 'csv';
const EXTENSION_CUR = 'cur';
const EXTENSION_FLASH = 'swf';
const EXTENSION_FLASH_VIDEO = 'flv';
const EXTENSION_GIF = 'gif';
const EXTENSION_GZIP = 'gz';
const EXTENSION_HTML = 'html';
const EXTENSION_HTM = 'htm';
const EXTENSION_ICO = 'ico';
const EXTENSION_JFIF = 'jfif';
const EXTENSION_JFI = 'jfi';
const EXTENSION_JPEG = 'jpeg';
const EXTENSION_JPG = 'jpg';
const EXTENSION_JS = 'js';
const EXTENSION_JSON = 'json';
const EXTENSION_MKV = 'mkv';
const EXTENSION_MP3 = 'mp3';
const EXTENSION_MP4 = 'mp4';
const EXTENSION_M4V = 'm4v';
const EXTENSION_M4A = 'm4a';
const EXTENSION_MPEG = 'mpeg';
const EXTENSION_MPG = 'mpg';
const EXTENSION_OGG = 'ogg';
const EXTENSION_OGG_VIDEO = 'ogv';
const EXTENSION_OGG_AUDIO = 'oga';
const EXTENSION_PDF = 'pdf';
const EXTENSION_PHP = 'php';
const EXTENSION_PHP5 = 'php5';
const EXTENSION_PNG = 'png';
const EXTENSION_PSD = 'psd';
const EXTENSION_MOV = 'mov';
const EXTENSION_RSS = 'rss';
const EXTENSION_SVG = 'svg';
const EXTENSION_TAR = 'tar';
const EXTENSION_TEXT = 'txt';
const EXTENSION_TIFF = 'tiff';
const EXTENSION_TIF = 'tif';
const EXTENSION_WAV = 'wav';
const EXTENSION_WEBM = 'webm';
const EXTENSION_WEBP = 'webp';
const EXTENSION_WMA = 'wma';
const EXTENSION_WMV = 'wmv';
const EXTENSION_XML = 'xml';
const EXTENSION_XSL = 'xsl';
const EXTENSION_ZIP = 'zip';
// Couldn't find a mimetype for ani, so made one up based on it being a riff container
const MIME_TYPE_ANI = 'application/riff+ani';
const MIME_TYPE_ASF = 'video/x-ms-asf';
const MIME_TYPE_AVI = 'video/x-msvideo';
// Went with mime types from http://fileformats.archiveteam.org/wiki/Comic_Book_Archive
const MIME_TYPE_COMIC_ZIP = 'application/vnd.comicbook+zip';
const MIME_TYPE_COMIC_RAR = 'application/vnd.comicbook-rar';
const MIME_TYPE_BMP = 'image/x-ms-bmp';
const MIME_TYPE_BZIP = 'application/x-bzip';
const MIME_TYPE_BZIP2 = 'application/x-bzip2';
const MIME_TYPE_CSS = 'text/css';
const MIME_TYPE_CSV = 'text/csv';
const MIME_TYPE_FLASH = 'application/x-shockwave-flash';
const MIME_TYPE_FLASH_VIDEO = 'video/x-flv';
const MIME_TYPE_GIF = 'image/gif';
const MIME_TYPE_GZIP = 'application/x-gzip';
const MIME_TYPE_HTML = 'text/html';
const MIME_TYPE_ICO = 'image/x-icon';
const MIME_TYPE_JPEG = 'image/jpeg';
const MIME_TYPE_JS = 'text/javascript';
const MIME_TYPE_JSON = 'application/json';
const MIME_TYPE_MKV = 'video/x-matroska';
const MIME_TYPE_MP3 = 'audio/mpeg';
const MIME_TYPE_MP4_AUDIO = 'audio/mp4';
const MIME_TYPE_MP4_VIDEO = 'video/mp4';
const MIME_TYPE_MPEG = 'video/mpeg';
const MIME_TYPE_OCTET_STREAM = 'application/octet-stream';
const MIME_TYPE_OGG = 'application/ogg';
const MIME_TYPE_OGG_VIDEO = 'video/ogg';
const MIME_TYPE_OGG_AUDIO = 'audio/ogg';
const MIME_TYPE_PDF = 'application/pdf';
const MIME_TYPE_PHP = 'text/x-php';
const MIME_TYPE_PNG = 'image/png';
const MIME_TYPE_PSD = 'image/vnd.adobe.photoshop';
const MIME_TYPE_QUICKTIME = 'video/quicktime';
const MIME_TYPE_RSS = 'application/rss+xml';
const MIME_TYPE_SVG = 'image/svg+xml';
const MIME_TYPE_TAR = 'application/x-tar';
const MIME_TYPE_TEXT = 'text/plain';
const MIME_TYPE_TIFF = 'image/tiff';
const MIME_TYPE_WAV = 'audio/x-wav';
const MIME_TYPE_WEBM = 'video/webm';
const MIME_TYPE_WEBP = 'image/webp';
const MIME_TYPE_WIN_BITMAP = 'image/x-win-bitmap';
const MIME_TYPE_XML = 'text/xml';
const MIME_TYPE_XML_APPLICATION = 'application/xml';
const MIME_TYPE_XSL = 'application/xsl+xml';
const MIME_TYPE_ZIP = 'application/zip';
const MIME_TYPE_MAP_NAME = 'name';
const MIME_TYPE_MAP_EXT = 'ext';
const MIME_TYPE_MAP_MIME = 'mime';
// Mime type map. Each entry in the MIME_TYPE_ARRAY represents a kind of file, identified by the "correct" mimetype as the key.
// The value for each entry is a map of twokeys, ext and mime.
// ext's value is an array of all of the extensions that the file type can use, with the "correct" one being first.
// mime's value is an array of all mime types that the file type is known to use, with the current "correct" one being first.
const MIME_TYPE_MAP = [
MIME_TYPE_ANI => [
MIME_TYPE_MAP_NAME => "ANI Cursor",
MIME_TYPE_MAP_EXT => [EXTENSION_ANI],
MIME_TYPE_MAP_MIME => [MIME_TYPE_ANI],
],
MIME_TYPE_AVI => [
MIME_TYPE_MAP_NAME => "AVI",
MIME_TYPE_MAP_EXT => [EXTENSION_AVI],
MIME_TYPE_MAP_MIME => [MIME_TYPE_AVI,'video/avi','video/msvideo'],
],
MIME_TYPE_ASF => [
MIME_TYPE_MAP_NAME => "ASF/WMV",
MIME_TYPE_MAP_EXT => [EXTENSION_ASF,EXTENSION_WMA,EXTENSION_WMV],
MIME_TYPE_MAP_MIME => [MIME_TYPE_ASF,'audio/x-ms-wma','video/x-ms-wmv'],
],
MIME_TYPE_BMP => [
MIME_TYPE_MAP_NAME => "BMP",
MIME_TYPE_MAP_EXT => [EXTENSION_BMP],
MIME_TYPE_MAP_MIME => [MIME_TYPE_BMP],
],
MIME_TYPE_BZIP => [
MIME_TYPE_MAP_NAME => "BZIP",
MIME_TYPE_MAP_EXT => [EXTENSION_BZIP],
MIME_TYPE_MAP_MIME => [MIME_TYPE_BZIP],
],
MIME_TYPE_BZIP2 => [
MIME_TYPE_MAP_NAME => "BZIP2",
MIME_TYPE_MAP_EXT => [EXTENSION_BZIP2],
MIME_TYPE_MAP_MIME => [MIME_TYPE_BZIP2],
],
MIME_TYPE_COMIC_ZIP => [
MIME_TYPE_MAP_NAME => "CBZ",
MIME_TYPE_MAP_EXT => [EXTENSION_CBZ],
MIME_TYPE_MAP_MIME => [MIME_TYPE_COMIC_ZIP],
],
MIME_TYPE_CSS => [
MIME_TYPE_MAP_NAME => "Cascading Style Sheet",
MIME_TYPE_MAP_EXT => [EXTENSION_CSS],
MIME_TYPE_MAP_MIME => [MIME_TYPE_CSS],
],
MIME_TYPE_CSV => [
MIME_TYPE_MAP_NAME => "CSV",
MIME_TYPE_MAP_EXT => [EXTENSION_CSV],
MIME_TYPE_MAP_MIME => [MIME_TYPE_CSV],
],
MIME_TYPE_FLASH => [
MIME_TYPE_MAP_NAME => "Flash",
MIME_TYPE_MAP_EXT => [EXTENSION_FLASH],
MIME_TYPE_MAP_MIME => [MIME_TYPE_FLASH],
],
MIME_TYPE_FLASH_VIDEO => [
MIME_TYPE_MAP_NAME => "Flash Video",
MIME_TYPE_MAP_EXT => [EXTENSION_FLASH_VIDEO],
MIME_TYPE_MAP_MIME => [MIME_TYPE_FLASH_VIDEO,'video/flv'],
],
MIME_TYPE_GIF => [
MIME_TYPE_MAP_NAME => "GIF",
MIME_TYPE_MAP_EXT => [EXTENSION_GIF],
MIME_TYPE_MAP_MIME => [MIME_TYPE_GIF],
],
MIME_TYPE_GZIP => [
MIME_TYPE_MAP_NAME => "GZIP",
MIME_TYPE_MAP_EXT => [EXTENSION_GZIP],
MIME_TYPE_MAP_MIME => [MIME_TYPE_TAR],
],
MIME_TYPE_HTML => [
MIME_TYPE_MAP_NAME => "HTML",
MIME_TYPE_MAP_EXT => [EXTENSION_HTM, EXTENSION_HTML],
MIME_TYPE_MAP_MIME => [MIME_TYPE_HTML],
],
MIME_TYPE_ICO => [
MIME_TYPE_MAP_NAME => "Icon",
MIME_TYPE_MAP_EXT => [EXTENSION_ICO, EXTENSION_CUR],
MIME_TYPE_MAP_MIME => [MIME_TYPE_ICO, MIME_TYPE_WIN_BITMAP],
],
MIME_TYPE_JPEG => [
MIME_TYPE_MAP_NAME => "JPEG",
MIME_TYPE_MAP_EXT => [EXTENSION_JPG, EXTENSION_JPEG, EXTENSION_JFIF, EXTENSION_JFI],
MIME_TYPE_MAP_MIME => [MIME_TYPE_JPEG],
],
MIME_TYPE_JS => [
MIME_TYPE_MAP_NAME => "JavaScript",
MIME_TYPE_MAP_EXT => [EXTENSION_JS],
MIME_TYPE_MAP_MIME => [MIME_TYPE_JS],
],
MIME_TYPE_JSON => [
MIME_TYPE_MAP_NAME => "JSON",
MIME_TYPE_MAP_EXT => [EXTENSION_JSON],
MIME_TYPE_MAP_MIME => [MIME_TYPE_JSON],
],
MIME_TYPE_MKV => [
MIME_TYPE_MAP_NAME => "Matroska",
MIME_TYPE_MAP_EXT => [EXTENSION_MKV],
MIME_TYPE_MAP_MIME => [MIME_TYPE_MKV],
],
MIME_TYPE_MP3 => [
MIME_TYPE_MAP_NAME => "MP3",
MIME_TYPE_MAP_EXT => [EXTENSION_MP3],
MIME_TYPE_MAP_MIME => [MIME_TYPE_MP3],
],
MIME_TYPE_MP4_AUDIO => [
MIME_TYPE_MAP_NAME => "MP4 Audio",
MIME_TYPE_MAP_EXT => [EXTENSION_M4A],
MIME_TYPE_MAP_MIME => [MIME_TYPE_MP4_AUDIO,"audio/m4a"],
],
MIME_TYPE_MP4_VIDEO => [
MIME_TYPE_MAP_NAME => "MP4 Video",
MIME_TYPE_MAP_EXT => [EXTENSION_MP4,EXTENSION_M4V],
MIME_TYPE_MAP_MIME => [MIME_TYPE_MP4_VIDEO,'video/x-m4v'],
],
MIME_TYPE_MPEG => [
MIME_TYPE_MAP_NAME => "MPEG",
MIME_TYPE_MAP_EXT => [EXTENSION_MPG,EXTENSION_MPEG],
MIME_TYPE_MAP_MIME => [MIME_TYPE_MPEG],
],
MIME_TYPE_PDF => [
MIME_TYPE_MAP_NAME => "PDF",
MIME_TYPE_MAP_EXT => [EXTENSION_PDF],
MIME_TYPE_MAP_MIME => [MIME_TYPE_PDF],
],
MIME_TYPE_PHP => [
MIME_TYPE_MAP_NAME => "PHP",
MIME_TYPE_MAP_EXT => [EXTENSION_PHP,EXTENSION_PHP5],
MIME_TYPE_MAP_MIME => [MIME_TYPE_PHP],
],
MIME_TYPE_PNG => [
MIME_TYPE_MAP_NAME => "PNG",
MIME_TYPE_MAP_EXT => [EXTENSION_PNG],
MIME_TYPE_MAP_MIME => [MIME_TYPE_PNG],
],
MIME_TYPE_PSD => [
MIME_TYPE_MAP_NAME => "PSD",
MIME_TYPE_MAP_EXT => [EXTENSION_PSD],
MIME_TYPE_MAP_MIME => [MIME_TYPE_PSD],
],
MIME_TYPE_OGG_AUDIO => [
MIME_TYPE_MAP_NAME => "Ogg Vorbis",
MIME_TYPE_MAP_EXT => [EXTENSION_OGG_AUDIO,EXTENSION_OGG],
MIME_TYPE_MAP_MIME => [MIME_TYPE_OGG_AUDIO,MIME_TYPE_OGG],
],
MIME_TYPE_OGG_VIDEO => [
MIME_TYPE_MAP_NAME => "Ogg Theora",
MIME_TYPE_MAP_EXT => [EXTENSION_OGG_VIDEO],
MIME_TYPE_MAP_MIME => [MIME_TYPE_OGG_VIDEO],
],
MIME_TYPE_QUICKTIME => [
MIME_TYPE_MAP_NAME => "Quicktime",
MIME_TYPE_MAP_EXT => [EXTENSION_MOV],
MIME_TYPE_MAP_MIME => [MIME_TYPE_QUICKTIME],
],
MIME_TYPE_RSS => [
MIME_TYPE_MAP_NAME => "RSS",
MIME_TYPE_MAP_EXT => [EXTENSION_RSS],
MIME_TYPE_MAP_MIME => [MIME_TYPE_RSS],
],
MIME_TYPE_SVG => [
MIME_TYPE_MAP_NAME => "SVG",
MIME_TYPE_MAP_EXT => [EXTENSION_SVG],
MIME_TYPE_MAP_MIME => [MIME_TYPE_SVG],
],
MIME_TYPE_TAR => [
MIME_TYPE_MAP_NAME => "TAR",
MIME_TYPE_MAP_EXT => [EXTENSION_TAR],
MIME_TYPE_MAP_MIME => [MIME_TYPE_TAR],
],
MIME_TYPE_TEXT => [
MIME_TYPE_MAP_NAME => "Text",
MIME_TYPE_MAP_EXT => [EXTENSION_TEXT, EXTENSION_ASC],
MIME_TYPE_MAP_MIME => [MIME_TYPE_TEXT],
],
MIME_TYPE_TIFF => [
MIME_TYPE_MAP_NAME => "TIFF",
MIME_TYPE_MAP_EXT => [EXTENSION_TIF,EXTENSION_TIFF],
MIME_TYPE_MAP_MIME => [MIME_TYPE_TIFF],
],
MIME_TYPE_WAV => [
MIME_TYPE_MAP_NAME => "Wave",
MIME_TYPE_MAP_EXT => [EXTENSION_WAV],
MIME_TYPE_MAP_MIME => [MIME_TYPE_WAV],
],
MIME_TYPE_WEBM => [
MIME_TYPE_MAP_NAME => "WebM",
MIME_TYPE_MAP_EXT => [EXTENSION_WEBM],
MIME_TYPE_MAP_MIME => [MIME_TYPE_WEBM],
],
MIME_TYPE_WEBP => [
MIME_TYPE_MAP_NAME => "WebP",
MIME_TYPE_MAP_EXT => [EXTENSION_WEBP],
MIME_TYPE_MAP_MIME => [MIME_TYPE_WEBP],
],
MIME_TYPE_XML => [
MIME_TYPE_MAP_NAME => "XML",
MIME_TYPE_MAP_EXT => [EXTENSION_XML],
MIME_TYPE_MAP_MIME => [MIME_TYPE_XML,MIME_TYPE_XML_APPLICATION],
],
MIME_TYPE_XSL => [
MIME_TYPE_MAP_NAME => "XSL",
MIME_TYPE_MAP_EXT => [EXTENSION_XSL],
MIME_TYPE_MAP_MIME => [MIME_TYPE_XSL],
],
MIME_TYPE_ZIP => [
MIME_TYPE_MAP_NAME => "ZIP",
MIME_TYPE_MAP_EXT => [EXTENSION_ZIP],
MIME_TYPE_MAP_MIME => [MIME_TYPE_ZIP],
],
];
/**
* Returns the mimetype that matches the provided extension.
*/
function get_mime_for_extension(string $ext): ?string
{
$ext = strtolower($ext);
foreach (MIME_TYPE_MAP as $key=>$value) {
if (in_array($ext, $value[MIME_TYPE_MAP_EXT])) {
return $key;
}
}
return null;
}
/**
* Returns the mimetype for the specified file, trying file inspection methods before falling back on extension-based detection.
* @param String $file
* @param String $ext The files extension, for if the current filename somehow lacks the extension
* @return String The extension that was found.
*/
function get_mime(string $file, string $ext=""): string
{
if (!file_exists($file)) {
throw new SCoreException("File not found: ".$file);
}
$type = false;
if (extension_loaded('fileinfo')) {
$finfo = finfo_open(FILEINFO_MIME_TYPE);
try {
$type = finfo_file($finfo, $file);
} finally {
finfo_close($finfo);
}
} elseif (function_exists('mime_content_type')) {
// If anyone is still using mime_content_type()
$type = trim(mime_content_type($file));
}
if ($type===false || empty($type)) {
// Checking by extension is our last resort
if ($ext==null||strlen($ext) == 0) {
$ext = pathinfo($file, PATHINFO_EXTENSION);
}
$type = get_mime_for_extension($ext);
}
if ($type !== false && strlen($type) > 0) {
return $type;
}
return MIME_TYPE_OCTET_STREAM;
}
/**
* Returns the file extension associated with the specified mimetype.
*/
function get_extension(?string $mime_type): ?string
{
if (empty($mime_type)) {
return null;
}
if ($mime_type==MIME_TYPE_OCTET_STREAM) {
return null;
}
foreach (MIME_TYPE_MAP as $key=>$value) {
if (in_array($mime_type, $value[MIME_TYPE_MAP_MIME])) {
return $value[MIME_TYPE_MAP_EXT][0];
}
}
return null;
}
/**
* Returns all of the file extensions associated with the specified mimetype.
*/
function get_all_extension_for_mime(?string $mime_type): array
{
$output = [];
if (empty($mime_type)) {
return $output;
}
foreach (MIME_TYPE_MAP as $key=>$value) {
if (in_array($mime_type, $value[MIME_TYPE_MAP_MIME])) {
$output = array_merge($output, $value[MIME_TYPE_MAP_EXT]);
}
}
return $output;
}
/**
* Gets an the extension defined in MIME_TYPE_MAP for a file.
*
* @param String $file_path
* @return String The extension that was found, or null if one can not be found.
*/
function get_extension_for_file(String $file_path): ?String
{
$mime = get_mime($file_path);
if (!empty($mime)) {
if ($mime==MIME_TYPE_OCTET_STREAM) {
return null;
} else {
$ext = get_extension($mime);
}
if (!empty($ext)) {
return $ext;
}
}
return null;
}

View File

@ -1,162 +0,0 @@
<?php
class Image {
var $id = null;
var $height, $width;
var $hash, $filesize;
var $filename, $ext;
public function Image($a=false, $b=false, $c=false) {
if($b == false && $c == false) {
$this->create_from_row($a);
}
else {
$this->create_from_data($a, $b, $c);
}
}
private function create_from_row($row) {
$this->id = $row['id'];
$this->owner_id = $row['owner_id'];
$this->filename = $row['filename'];
$this->filesize = $row['filesize'];
$this->hash = $row['hash'];
$this->ext = $row['ext'];
$this->width = $row['width'];
$this->height = $row['height'];
}
private function mime_to_ext($mime) {
switch($mime) {
default:
case 'image/jpeg': return "jpg"; break;
case 'image/png': return "png"; break;
case 'image/gif': return "gif"; break;
}
}
private function create_from_data($tmp, $filename, $tags) {
global $config;
$this->ok = false;
$info = "";
if(!file_exists($tmp)) return;
if(filesize($tmp) > $config->get_int('upload_size')) return;
if(!($info = getimagesize($tmp))) return;
$this->width = $info[0];
$this->height = $info[1];
$this->mime_type = $info['mime'];
$this->filename = str_replace("/", "_", $filename); // is this even possible?
$this->filesize = filesize($tmp);
$this->ext = $this->mime_to_ext($info['mime']);
$this->hash = md5_file($tmp);
$this->temp_filename = $tmp;
$this->tag_array = tag_explode($tags);
$this->ok = true;
}
public function is_ok() {
return $this->ok;
}
public function get_owner() {
global $database;
return $database->get_user($this->owner_id);
}
public function get_tag_array() {
if(!isset($this->tag_array)) {
global $database;
$this->tag_array = Array();
$row = $database->db->Execute("SELECT * FROM tags WHERE image_id=?", array($this->id));
while(!$row->EOF) {
$this->tag_array[] = $row->fields['tag'];
$row->MoveNext();
}
}
return $this->tag_array;
}
public function get_tag_list() {
return implode(' ', $this->get_tag_array());
}
public function get_image_link() {
global $config;
return $this->parse_link_template($config->get_string('image_ilink'), $this);
}
public function get_short_link() {
global $config;
return $this->parse_link_template($config->get_string('image_slink'), $this);
}
public function get_thumb_link() {
global $config;
return $this->parse_link_template($config->get_string('image_tlink'), $this);
}
public function get_tooltip() {
global $config;
return $this->parse_link_template($config->get_string('image_tip'), $this);
}
public function get_image_filename() {
global $config;
$hash = $this->hash;
$ab = substr($hash, 0, 2);
$ext = $this->ext;
return "images/$ab/$hash";
}
public function get_thumb_filename() {
global $config;
$hash = $this->hash;
$ab = substr($hash, 0, 2);
return "thumbs/$ab/$hash";
}
public function get_filename() {
return $this->filename;
}
public function get_mime_type() {
return "image/".($this->ext);
}
public function get_ext() {
return $this->ext;
}
private function parse_link_template($tmpl, $img) {
global $config;
// don't bother hitting the database if it won't be used...
$safe_tags = "";
if(strpos($tmpl, '$tags') !== false) { // * stabs dynamically typed languages with a rusty spoon *
$safe_tags = preg_replace(
"/[^a-zA-Z0-9_\- ]/",
"", $img->get_tag_list());
}
$base_href = $config->get_string('base_href');
$fname = $img->get_filename();
$base_fname = strpos($fname, '.') ? substr($fname, 0, strrpos($fname, '.')) : $fname;
$tmpl = str_replace('$id', $img->id, $tmpl);
$tmpl = str_replace('$hash', $img->hash, $tmpl);
$tmpl = str_replace('$tags', $safe_tags, $tmpl);
$tmpl = str_replace('$base', $base_href, $tmpl);
$tmpl = str_replace('$ext', $img->ext, $tmpl);
$tmpl = str_replace('$size', "{$img->width}x{$img->height}", $tmpl);
$tmpl = str_replace('$filesize', to_shorthand_int($img->filesize), $tmpl);
$tmpl = str_replace('$filename', $base_fname, $tmpl);
return $tmpl;
}
}
?>

149
core/imageboard/event.php Normal file
View File

@ -0,0 +1,149 @@
<?php declare(strict_types=1);
/**
* An image is being added to the database.
*/
class ImageAdditionEvent extends Event
{
/** @var User */
public $user;
/** @var Image */
public $image;
public $merged = false;
/**
* Inserts a new image into the database with its associated
* information. Also calls TagSetEvent to set the tags for
* this new image.
*/
public function __construct(Image $image)
{
parent::__construct();
$this->image = $image;
}
}
class ImageAdditionException extends SCoreException
{
}
/**
* An image is being deleted.
*/
class ImageDeletionEvent extends Event
{
/** @var Image */
public $image;
/** @var bool */
public $force = false;
/**
* Deletes an image.
*
* Used by things like tags and comments handlers to
* clean out related rows in their tables.
*/
public function __construct(Image $image, bool $force = false)
{
parent::__construct();
$this->image = $image;
$this->force = $force;
}
}
/**
* An image is being replaced.
*/
class ImageReplaceEvent extends Event
{
/** @var int */
public $id;
/** @var Image */
public $image;
/**
* Replaces an image.
*
* Updates an existing ID in the database to use a new image
* file, leaving the tags and such unchanged. Also removes
* the old image file and thumbnail from the disk.
*/
public function __construct(int $id, Image $image)
{
parent::__construct();
$this->id = $id;
$this->image = $image;
}
}
class ImageReplaceException extends SCoreException
{
}
/**
* Request a thumbnail be made for an image object.
*/
class ThumbnailGenerationEvent extends Event
{
/** @var string */
public $hash;
/** @var string */
public $type;
/** @var bool */
public $force;
/** @var bool */
public $generated;
/**
* Request a thumbnail be made for an image object
*/
public function __construct(string $hash, string $type, bool $force=false)
{
parent::__construct();
$this->hash = $hash;
$this->type = $type;
$this->force = $force;
$this->generated = false;
}
}
/*
* ParseLinkTemplateEvent:
* $link -- the formatted text (with each element URL Escape'd)
* $text -- the formatted text (not escaped)
* $original -- the formatting string, for reference
* $image -- the image who's link is being parsed
*/
class ParseLinkTemplateEvent extends Event
{
/** @var string */
public $link;
/** @var string */
public $text;
/** @var string */
public $original;
/** @var Image */
public $image;
public function __construct(string $link, Image $image)
{
parent::__construct();
$this->link = $link;
$this->text = $link;
$this->original = $link;
$this->image = $image;
}
public function replace(string $needle, ?string $replace): void
{
if (!is_null($replace)) {
$this->link = str_replace($needle, url_escape($replace), $this->link);
$this->text = str_replace($needle, $replace, $this->text);
}
}
}

1004
core/imageboard/image.php Normal file

File diff suppressed because it is too large Load Diff

186
core/imageboard/misc.php Normal file
View File

@ -0,0 +1,186 @@
<?php declare(strict_types=1);
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
* Misc functions *
\* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/**
* Add a directory full of images
*
* @param string $base
* @return array
*/
function add_dir(string $base): array
{
$results = [];
foreach (list_files($base) as $full_path) {
$short_path = str_replace($base, "", $full_path);
$filename = basename($full_path);
$tags = path_to_tags($short_path);
$result = "$short_path (".str_replace(" ", ", ", $tags).")... ";
try {
add_image($full_path, $filename, $tags);
$result .= "ok";
} catch (UploadException $ex) {
$result .= "failed: ".$ex->getMessage();
}
$results[] = $result;
}
return $results;
}
/**
* Sends a DataUploadEvent for a file.
*
* @param string $tmpname
* @param string $filename
* @param string $tags
* @throws UploadException
*/
function add_image(string $tmpname, string $filename, string $tags): int
{
assert(file_exists($tmpname));
$pathinfo = pathinfo($filename);
$metadata = [];
$metadata['filename'] = $pathinfo['basename'];
if (array_key_exists('extension', $pathinfo)) {
$metadata['extension'] = $pathinfo['extension'];
}
$metadata['tags'] = Tag::explode($tags);
$metadata['source'] = null;
$due = new DataUploadEvent($tmpname, $metadata);
send_event($due);
return $due->image_id;
}
/**
* Given a full size pair of dimensions, return a pair scaled down to fit
* into the configured thumbnail square, with ratio intact.
* Optionally uses the High-DPI scaling setting to adjust the final resolution.
*
* @param int $orig_width
* @param int $orig_height
* @param bool $use_dpi_scaling Enables the High-DPI scaling.
* @return array
*/
function get_thumbnail_size(int $orig_width, int $orig_height, bool $use_dpi_scaling = false): array
{
global $config;
$fit = $config->get_string(ImageConfig::THUMB_FIT);
if (in_array($fit, [Media::RESIZE_TYPE_FILL, Media::RESIZE_TYPE_STRETCH, Media::RESIZE_TYPE_FIT_BLUR])) {
return [$config->get_int(ImageConfig::THUMB_WIDTH), $config->get_int(ImageConfig::THUMB_HEIGHT)];
}
if ($orig_width === 0) {
$orig_width = 192;
}
if ($orig_height === 0) {
$orig_height = 192;
}
if ($orig_width > $orig_height * 5) {
$orig_width = $orig_height * 5;
}
if ($orig_height > $orig_width * 5) {
$orig_height = $orig_width * 5;
}
if ($use_dpi_scaling) {
list($max_width, $max_height) = get_thumbnail_max_size_scaled();
} else {
$max_width = $config->get_int(ImageConfig::THUMB_WIDTH);
$max_height = $config->get_int(ImageConfig::THUMB_HEIGHT);
}
$output = get_scaled_by_aspect_ratio($orig_width, $orig_height, $max_width, $max_height);
if ($output[2] > 1 && $config->get_bool('thumb_upscale')) {
return [(int)$orig_width, (int)$orig_height];
} else {
return $output;
}
}
function get_scaled_by_aspect_ratio(int $original_width, int $original_height, int $max_width, int $max_height) : array
{
$xscale = ($max_width/ $original_width);
$yscale = ($max_height/ $original_height);
$scale = ($yscale < $xscale) ? $yscale : $xscale ;
return [(int)($original_width*$scale), (int)($original_height*$scale), $scale];
}
/**
* Fetches the thumbnails height and width settings and applies the High-DPI scaling setting before returning the dimensions.
*
* @return array [width, height]
*/
function get_thumbnail_max_size_scaled(): array
{
global $config;
$scaling = $config->get_int(ImageConfig::THUMB_SCALING);
$max_width = $config->get_int(ImageConfig::THUMB_WIDTH) * ($scaling/100);
$max_height = $config->get_int(ImageConfig::THUMB_HEIGHT) * ($scaling/100);
return [$max_width, $max_height];
}
function create_image_thumb(string $hash, string $type, string $engine = null)
{
global $config;
$inname = warehouse_path(Image::IMAGE_DIR, $hash);
$outname = warehouse_path(Image::THUMBNAIL_DIR, $hash);
$tsize = get_thumbnail_max_size_scaled();
create_scaled_image(
$inname,
$outname,
$tsize,
$type,
$engine,
$config->get_string(ImageConfig::THUMB_FIT)
);
}
function create_scaled_image(string $inname, string $outname, array $tsize, string $type, ?string $engine = null, ?string $resize_type = null)
{
global $config;
if (empty($engine)) {
$engine = $config->get_string(ImageConfig::THUMB_ENGINE);
}
if (empty($resize_type)) {
$resize_type = $config->get_string(ImageConfig::THUMB_FIT);
}
$output_format = $config->get_string(ImageConfig::THUMB_TYPE);
if ($output_format==EXTENSION_WEBP) {
$output_format = Media::WEBP_LOSSY;
}
send_event(new MediaResizeEvent(
$engine,
$inname,
$type,
$outname,
$tsize[0],
$tsize[1],
$resize_type,
$output_format,
$config->get_int(ImageConfig::THUMB_QUALITY),
true,
true
));
}

View File

@ -0,0 +1,58 @@
<?php declare(strict_types=1);
class Querylet
{
/** @var string */
public $sql;
/** @var array */
public $variables;
public function __construct(string $sql, array $variables=[])
{
$this->sql = $sql;
$this->variables = $variables;
}
public function append(Querylet $querylet): void
{
$this->sql .= $querylet->sql;
$this->variables = array_merge($this->variables, $querylet->variables);
}
public function append_sql(string $sql): void
{
$this->sql .= $sql;
}
public function add_variable($var): void
{
$this->variables[] = $var;
}
}
class TagCondition
{
/** @var string */
public $tag;
/** @var bool */
public $positive;
public function __construct(string $tag, bool $positive)
{
$this->tag = $tag;
$this->positive = $positive;
}
}
class ImgCondition
{
/** @var Querylet */
public $qlet;
/** @var bool */
public $positive;
public function __construct(Querylet $qlet, bool $positive)
{
$this->qlet = $qlet;
$this->positive = $positive;
}
}

218
core/imageboard/tag.php Normal file
View File

@ -0,0 +1,218 @@
<?php declare(strict_types=1);
/**
* Class Tag
*
* A class for organising the tag related functions.
*
* All the methods are static, one should never actually use a tag object.
*
*/
class Tag
{
public static function implode(array $tags): string
{
sort($tags);
$tags = implode(' ', $tags);
return $tags;
}
/**
* Turn a human-supplied string into a valid tag array.
*
* #return string[]
*/
public static function explode(string $tags, bool $tagme=true): array
{
global $database;
$tags = explode(' ', trim($tags));
/* sanitise by removing invisible / dodgy characters */
$tag_array = self::sanitize_array($tags);
/* if user supplied a blank string, add "tagme" */
if (count($tag_array) === 0 && $tagme) {
$tag_array = ["tagme"];
}
/* resolve aliases */
$new = [];
$i = 0;
$tag_count = count($tag_array);
while ($i<$tag_count) {
$tag = $tag_array[$i];
$negative = '';
if (!empty($tag) && ($tag[0] == '-')) {
$negative = '-';
$tag = substr($tag, 1);
}
$newtags = $database->get_one(
"
SELECT newtag
FROM aliases
WHERE LOWER(oldtag)=LOWER(:tag)
",
["tag"=>$tag]
);
if (empty($newtags)) {
//tag has no alias, use old tag
$aliases = [$tag];
} else {
$aliases = explode(" ", $newtags); // Tag::explode($newtags); - recursion can be infinite
}
foreach ($aliases as $alias) {
if (!in_array($alias, $new)) {
if ($tag == $alias) {
$new[] = $negative.$alias;
} elseif (!in_array($alias, $tag_array)) {
$tag_array[] = $negative.$alias;
$tag_count++;
}
}
}
$i++;
}
/* remove any duplicate tags */
$tag_array = array_iunique($new);
/* tidy up */
sort($tag_array);
return $tag_array;
}
public static function sanitize(string $tag): string
{
$tag = preg_replace("/\s/", "", $tag); # whitespace
$tag = preg_replace('/\x20[\x0e\x0f]/', '', $tag); # unicode RTL
$tag = preg_replace("/\.+/", ".", $tag); # strings of dots?
$tag = preg_replace("/^(\.+[\/\\\\])+/", "", $tag); # trailing slashes?
$tag = trim($tag, ", \t\n\r\0\x0B");
if ($tag == ".") {
$tag = "";
} // hard-code one bad case...
if (mb_strlen($tag, 'UTF-8') > 255) {
throw new ScoreException("The tag below is longer than 255 characters, please use a shorter tag.\n$tag\n");
}
return $tag;
}
public static function compare(array $tags1, array $tags2): bool
{
if (count($tags1)!==count($tags2)) {
return false;
}
$tags1 = array_map("strtolower", $tags1);
$tags2 = array_map("strtolower", $tags2);
natcasesort($tags1);
natcasesort($tags2);
for ($i = 0; $i < count($tags1); $i++) {
if ($tags1[$i]!==$tags2[$i]) {
return false;
}
}
return true;
}
public static function get_diff_tags(array $source, array $remove): array
{
$before = array_map('strtolower', $source);
$remove = array_map('strtolower', $remove);
$after = [];
foreach ($before as $tag) {
if (!in_array($tag, $remove)) {
$after[] = $tag;
}
}
return $after;
}
public static function sanitize_array(array $tags): array
{
global $page;
$tag_array = [];
foreach ($tags as $tag) {
try {
$tag = Tag::sanitize($tag);
} catch (Exception $e) {
$page->flash($e->getMessage());
continue;
}
if (!empty($tag)) {
$tag_array[] = $tag;
}
}
return $tag_array;
}
public static function sqlify(string $term): string
{
global $database;
if ($database->get_driver_name() === DatabaseDriver::SQLITE) {
$term = str_replace('\\', '\\\\', $term);
}
$term = str_replace('_', '\_', $term);
$term = str_replace('%', '\%', $term);
$term = str_replace('*', '%', $term);
// $term = str_replace("?", "_", $term);
return $term;
}
/**
* Kind of like urlencode, but using a custom scheme so that
* tags always fit neatly between slashes in a URL. Use this
* when you want to put an arbitrary tag into a URL.
*/
public static function caret(string $input): string
{
$to_caret = [
"^" => "^",
"/" => "s",
"\\" => "b",
"?" => "q",
"&" => "a",
"." => "d",
];
foreach ($to_caret as $from => $to) {
$input = str_replace($from, '^' . $to, $input);
}
return $input;
}
/**
* Use this when you want to get a tag out of a URL
*/
public static function decaret(string $str): string
{
$from_caret = [
"^" => "^",
"s" => "/",
"b" => "\\",
"q" => "?",
"a" => "&",
"d" => ".",
];
$out = "";
$length = strlen($str);
for ($i=0; $i<$length; $i++) {
if ($str[$i] == "^") {
$i++;
$out .= $from_caret[$str[$i]] ?? '';
} else {
$out .= $str[$i];
}
}
return $out;
}
}

326
core/install.php Normal file
View File

@ -0,0 +1,326 @@
<?php
/**
* Shimmie Installer
*
* @package Shimmie
* @copyright Copyright (c) 2007-2015, Shish et al.
* @author Shish [webmaster at shishnet.org], jgen [jeffgenovy at gmail.com]
* @link https://code.shishnet.org/shimmie2/
* @license https://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
* Initialise the database, check that folder
* permissions are set properly.
*
* This file should be independent of the database
* and other such things that aren't ready yet
*/
function install()
{
date_default_timezone_set('UTC');
if (is_readable("data/config/shimmie.conf.php")) {
die_nicely(
"Shimmie is already installed.",
"data/config/shimmie.conf.php exists, how did you get here?"
);
}
// Pull in necessary files
require_once "vendor/autoload.php";
global $_tracer;
$_tracer = new EventTracer();
require_once "core/exceptions.php";
require_once "core/cacheengine.php";
require_once "core/dbengine.php";
require_once "core/database.php";
require_once "core/util.php";
$dsn = get_dsn();
if ($dsn) {
do_install($dsn);
} else {
ask_questions();
}
}
function get_dsn()
{
if (getenv("INSTALL_DSN")) {
$dsn = getenv("INSTALL_DSN");
;
} elseif (@$_POST["database_type"] == DatabaseDriver::SQLITE) {
/** @noinspection PhpUnhandledExceptionInspection */
$id = bin2hex(random_bytes(5));
$dsn = "sqlite:data/shimmie.{$id}.sqlite";
} elseif (isset($_POST['database_type']) && isset($_POST['database_host']) && isset($_POST['database_user']) && isset($_POST['database_name'])) {
$dsn = "{$_POST['database_type']}:user={$_POST['database_user']};password={$_POST['database_password']};host={$_POST['database_host']};dbname={$_POST['database_name']}";
} else {
$dsn = null;
}
return $dsn;
}
function do_install($dsn)
{
try {
create_dirs();
create_tables(new Database($dsn));
write_config($dsn);
} catch (InstallerException $e) {
die_nicely($e->title, $e->body, $e->code);
}
}
function ask_questions()
{
$warnings = [];
$errors = [];
if (check_gd_version() == 0 && check_im_version() == 0) {
$errors[] = "
No thumbnailers could be found - install the imagemagick
tools (or the PHP-GD library, if imagemagick is unavailable).
";
} elseif (check_im_version() == 0) {
$warnings[] = "
The 'convert' command (from the imagemagick package)
could not be found - PHP-GD can be used instead, but
the size of thumbnails will be limited.
";
}
if (!function_exists('mb_strlen')) {
$errors[] = "
The mbstring PHP extension is missing - multibyte languages
(eg non-english languages) may not work right.
";
}
$drivers = PDO::getAvailableDrivers();
if (
!in_array(DatabaseDriver::MYSQL, $drivers) &&
!in_array(DatabaseDriver::PGSQL, $drivers) &&
!in_array(DatabaseDriver::SQLITE, $drivers)
) {
$errors[] = "
No database connection library could be found; shimmie needs
PDO with either Postgres, MySQL, or SQLite drivers
";
}
$db_m = in_array(DatabaseDriver::MYSQL, $drivers) ? '<option value="'. DatabaseDriver::MYSQL .'">MySQL</option>' : "";
$db_p = in_array(DatabaseDriver::PGSQL, $drivers) ? '<option value="'. DatabaseDriver::PGSQL .'">PostgreSQL</option>' : "";
$db_s = in_array(DatabaseDriver::SQLITE, $drivers) ? '<option value="'. DatabaseDriver::SQLITE .'">SQLite</option>' : "";
$warn_msg = $warnings ? "<h3>Warnings</h3>".implode("\n<p>", $warnings) : "";
$err_msg = $errors ? "<h3>Errors</h3>".implode("\n<p>", $errors) : "";
die_nicely(
"Install Options",
<<<EOD
$warn_msg
$err_msg
<form action="index.php" method="POST">
<table class='form' style="margin: 1em auto;">
<tr>
<th>Type:</th>
<td><select name="database_type" id="database_type" onchange="update_qs();">
$db_m
$db_p
$db_s
</select></td>
</tr>
<tr class="dbconf mysql pgsql">
<th>Host:</th>
<td><input type="text" name="database_host" size="40" value="localhost"></td>
</tr>
<tr class="dbconf mysql pgsql">
<th>Username:</th>
<td><input type="text" name="database_user" size="40"></td>
</tr>
<tr class="dbconf mysql pgsql">
<th>Password:</th>
<td><input type="password" name="database_password" size="40"></td>
</tr>
<tr class="dbconf mysql pgsql">
<th>DB&nbsp;Name:</th>
<td><input type="text" name="database_name" size="40" value="shimmie"></td>
</tr>
<tr><td colspan="2"><input type="submit" value="Go!"></td></tr>
</table>
<script>
document.addEventListener('DOMContentLoaded', update_qs);
function q(n) {
return document.querySelectorAll(n);
}
function update_qs() {
Array.prototype.forEach.call(q('.dbconf'), function(el, i){
el.style.display = 'none';
});
let seldb = q("#database_type")[0].value || "none";
Array.prototype.forEach.call(q('.'+seldb), function(el, i){
el.style.display = null;
});
}
</script>
</form>
<h3>Help</h3>
<p class="dbconf mysql pgsql">
Please make sure the database you have chosen exists and is empty.<br>
The username provided must have access to create tables within the database.
</p>
<p class="dbconf sqlite">
For SQLite the database name will be a filename on disk, relative to
where shimmie was installed.
</p>
<p class="dbconf none">
Drivers can generally be downloaded with your OS package manager;
for Debian / Ubuntu you want php-pgsql, php-mysql, or php-sqlite.
</p>
EOD
);
}
function create_dirs()
{
$data_exists = file_exists("data") || mkdir("data");
$data_writable = $data_exists && (is_writable("data") || chmod("data", 0755));
if (!$data_exists || !$data_writable) {
throw new InstallerException(
"Directory Permissions Error:",
"<p>Shimmie needs to have a 'data' folder in its directory, writable by the PHP user.</p>
<p>If you see this error, if probably means the folder is owned by you, and it needs to be writable by the web server.</p>
<p>PHP reports that it is currently running as user: ".get_current_user()." (". getmyuid() .")</p>
<p>Once you have created this folder and / or changed the ownership of the shimmie folder, hit 'refresh' to continue.</p>",
7
);
}
}
function create_tables(Database $db)
{
try {
if ($db->count_tables() > 0) {
throw new InstallerException(
"Warning: The Database schema is not empty!",
"<p>Please ensure that the database you are installing Shimmie with is empty before continuing.</p>
<p>Once you have emptied the database of any tables, please hit 'refresh' to continue.</p>",
2
);
}
$db->create_table("aliases", "
oldtag VARCHAR(128) NOT NULL,
newtag VARCHAR(128) NOT NULL,
PRIMARY KEY (oldtag)
");
$db->execute("CREATE INDEX aliases_newtag_idx ON aliases(newtag)", []);
$db->create_table("config", "
name VARCHAR(128) NOT NULL,
value TEXT,
PRIMARY KEY (name)
");
$db->create_table("users", "
id SCORE_AIPK,
name VARCHAR(32) UNIQUE NOT NULL,
pass VARCHAR(250),
joindate TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
class VARCHAR(32) NOT NULL DEFAULT 'user',
email VARCHAR(128)
");
$db->execute("CREATE INDEX users_name_idx ON users(name)", []);
$db->execute("INSERT INTO users(name, pass, joindate, class) VALUES(:name, :pass, now(), :class)", ["name" => 'Anonymous', "pass" => null, "class" => 'anonymous']);
$db->execute("INSERT INTO config(name, value) VALUES(:name, :value)", ["name" => 'anon_id', "value" => $db->get_last_insert_id('users_id_seq')]);
if (check_im_version() > 0) {
$db->execute("INSERT INTO config(name, value) VALUES(:name, :value)", ["name" => 'thumb_engine', "value" => 'convert']);
}
$db->create_table("images", "
id SCORE_AIPK,
owner_id INTEGER NOT NULL,
owner_ip SCORE_INET NOT NULL,
filename VARCHAR(64) NOT NULL,
filesize INTEGER NOT NULL,
hash CHAR(32) UNIQUE NOT NULL,
ext CHAR(4) NOT NULL,
source VARCHAR(255),
width INTEGER NOT NULL,
height INTEGER NOT NULL,
posted TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
locked SCORE_BOOL NOT NULL DEFAULT SCORE_BOOL_N,
FOREIGN KEY (owner_id) REFERENCES users(id) ON DELETE RESTRICT
");
$db->execute("CREATE INDEX images_owner_id_idx ON images(owner_id)", []);
$db->execute("CREATE INDEX images_width_idx ON images(width)", []);
$db->execute("CREATE INDEX images_height_idx ON images(height)", []);
$db->execute("CREATE INDEX images_hash_idx ON images(hash)", []);
$db->create_table("tags", "
id SCORE_AIPK,
tag VARCHAR(64) UNIQUE NOT NULL,
count INTEGER NOT NULL DEFAULT 0
");
$db->execute("CREATE INDEX tags_tag_idx ON tags(tag)", []);
$db->create_table("image_tags", "
image_id INTEGER NOT NULL,
tag_id INTEGER NOT NULL,
UNIQUE(image_id, tag_id),
FOREIGN KEY (image_id) REFERENCES images(id) ON DELETE CASCADE,
FOREIGN KEY (tag_id) REFERENCES tags(id) ON DELETE CASCADE
");
$db->execute("CREATE INDEX images_tags_image_id_idx ON image_tags(image_id)", []);
$db->execute("CREATE INDEX images_tags_tag_id_idx ON image_tags(tag_id)", []);
$db->execute("INSERT INTO config(name, value) VALUES('db_version', 11)");
$db->commit();
} catch (PDOException $e) {
throw new InstallerException(
"PDO Error:",
"<p>An error occurred while trying to create the database tables necessary for Shimmie.</p>
<p>Please check and ensure that the database configuration options are all correct.</p>
<p>{$e->getMessage()}</p>",
3
);
}
}
function write_config($dsn)
{
$file_content = "<" . "?php\ndefine('DATABASE_DSN', '$dsn');\n";
if (!file_exists("data/config")) {
mkdir("data/config", 0755, true);
}
if (file_put_contents("data/config/shimmie.conf.php", $file_content, LOCK_EX)) {
header("Location: index.php?flash=Installation%20complete");
die_nicely(
"Installation Successful",
"<p>If you aren't redirected, <a href=\"index.php\">click here to Continue</a>."
);
} else {
$h_file_content = htmlentities($file_content);
throw new InstallerException(
"File Permissions Error:",
"The web server isn't allowed to write to the config file; please copy
the text below, save it as 'data/config/shimmie.conf.php', and upload it into the shimmie
folder manually. Make sure that when you save it, there is no whitespace
before the \"&lt;?php\".
<p><textarea cols='80' rows='2'>$h_file_content</textarea>
<p>Once done, <a href='index.php'>click here to Continue</a>.",
0
);
}
}

82
core/logging.php Normal file
View File

@ -0,0 +1,82 @@
<?php declare(strict_types=1);
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
* Logging convenience *
\* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
define("SCORE_LOG_CRITICAL", 50);
define("SCORE_LOG_ERROR", 40);
define("SCORE_LOG_WARNING", 30);
define("SCORE_LOG_INFO", 20);
define("SCORE_LOG_DEBUG", 10);
define("SCORE_LOG_NOTSET", 0);
const LOGGING_LEVEL_NAMES = [
SCORE_LOG_NOTSET=>"Not Set",
SCORE_LOG_DEBUG=>"Debug",
SCORE_LOG_INFO=>"Info",
SCORE_LOG_WARNING=>"Warning",
SCORE_LOG_ERROR=>"Error",
SCORE_LOG_CRITICAL=>"Critical",
];
/**
* A shorthand way to send a LogEvent
*
* When parsing a user request, a flash message should give info to the user
* When taking action, a log event should be stored by the server
* Quite often, both of these happen at once, hence log_*() having $flash
*/
function log_msg(string $section, int $priority, string $message, ?string $flash=null)
{
global $page;
send_event(new LogEvent($section, $priority, $message));
$threshold = defined("CLI_LOG_LEVEL") ? CLI_LOG_LEVEL : 0;
if ((PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') && ($priority >= $threshold)) {
print date("c")." $section: $message\n";
ob_flush();
}
if (!is_null($flash)) {
$page->flash($flash);
}
}
// More shorthand ways of logging
function log_debug(string $section, string $message, ?string $flash=null)
{
log_msg($section, SCORE_LOG_DEBUG, $message, $flash);
}
function log_info(string $section, string $message, ?string $flash=null)
{
log_msg($section, SCORE_LOG_INFO, $message, $flash);
}
function log_warning(string $section, string $message, ?string $flash=null)
{
log_msg($section, SCORE_LOG_WARNING, $message, $flash);
}
function log_error(string $section, string $message, ?string $flash=null)
{
log_msg($section, SCORE_LOG_ERROR, $message, $flash);
}
function log_critical(string $section, string $message, ?string $flash=null)
{
log_msg($section, SCORE_LOG_CRITICAL, $message, $flash);
}
/**
* Get a unique ID for this request, useful for grouping log messages.
*/
function get_request_id(): string
{
static $request_id = null;
if (!$request_id) {
// not completely trustworthy, as a user can spoof this
if (@$_SERVER['HTTP_X_VARNISH']) {
$request_id = $_SERVER['HTTP_X_VARNISH'];
} else {
$request_id = "P" . uniqid();
}
}
return $request_id;
}

View File

@ -1,11 +0,0 @@
<?php
class NavBlock {
var $header;
var $body;
public function NavBlock() {
$this->header = "Navigation";
$this->body = "<a href='".make_link("index")."'>Index</a>";
}
}
?>

View File

@ -1,95 +0,0 @@
<?php
class Page {
var $mode = "page";
var $type = "text/html";
public function set_mode($mode) {
$this->mode = $mode;
}
public function set_type($type) {
$this->type = $type;
}
// ==============================================
// data
var $data = "";
public function set_data($data) {
$this->data = $data;
}
// ==============================================
// redirect
var $redirect = "";
public function set_redirect($redirect) {
$this->redirect = $redirect;
}
// ==============================================
// page
var $title = "";
var $heading = "";
var $subheading = "";
var $quicknav = "";
var $sideblocks = array();
var $mainblocks = array();
public function set_title($title) {
$this->title = $title;
}
public function set_heading($heading) {
$this->heading = $heading;
}
public function set_subheading($subheading) {
$this->subheading = $subheading;
}
public function add_side_block($block, $position=50) {
while(isset($this->sideblocks[$position])) $position++;
$this->sideblocks[$position] = $block;
}
public function add_main_block($block, $position=50) {
while(isset($this->mainblocks[$position])) $position++;
$this->mainblocks[$position] = $block;
}
// ==============================================
public function display() {
global $config;
header("Content-type: {$this->type}");
switch($this->mode) {
case "page":
header("Cache-control: no-cache");
ksort($this->sideblocks);
ksort($this->mainblocks);
$theme = $config->get_string("theme");
require_once "themes/$theme/default.php";
break;
case "data":
print $this->data;
break;
case "redirect":
header("Location: {$this->redirect}");
print "You should be redirected to <a href='{$this->redirect}'>{$this->redirect}</a>";
break;
default:
print "Invalid page mode";
break;
}
}
}
?>

View File

@ -1,50 +0,0 @@
<?php
class Paginator extends Block {
var $header = null;
var $body = "";
public function Paginator($page, $query, $page_number, $total_pages) {
$this->body = $this->build_paginator($page_number, $total_pages, $page, $query);
}
private function gen_page_link($base_url, $query, $page, $name) {
$link = make_link("$base_url/$page", $query);
return "<a href='$link'>$name</a>";
}
private function gen_page_link_block($base_url, $query, $page, $current_page, $name) {
$paginator = "";
if($page == $current_page) $paginator .= "<b>";
$paginator .= $this->gen_page_link($base_url, $query, $page, $name);
if($page == $current_page) $paginator .= "</b>";
return $paginator;
}
private function build_paginator($current_page, $total_pages, $base_url, $query) {
$next = $current_page + 1;
$prev = $current_page - 1;
$rand = rand(1, $total_pages);
$at_start = ($current_page <= 1 || $total_pages <= 1);
$at_end = ($current_page >= $total_pages);
$first_html = $at_start ? "First" : $this->gen_page_link($base_url, $query, 1, "First");
$prev_html = $at_start ? "Prev" : $this->gen_page_link($base_url, $query, $prev, "Prev");
$random_html = $this->gen_page_link($base_url, $query, $rand, "Random");
$next_html = $at_end ? "Next" : $this->gen_page_link($base_url, $query, $next, "Next");
$last_html = $at_end ? "Last" : $this->gen_page_link($base_url, $query, $total_pages, "Last");
$start = $current_page-5 > 1 ? $current_page-5 : 1;
$end = $start+10 < $total_pages ? $start+10 : $total_pages;
$pages = array();
foreach(range($start, $end) as $i) {
$pages[] = $this->gen_page_link_block($base_url, $query, $i, $current_page, $i);
}
$pages_html = implode(" | ", $pages);
return "<p>$first_html | $prev_html | $random_html | $next_html | $last_html".
"<br>&lt;&lt; $pages_html &gt;&gt;</p>";
}
}

106
core/permissions.php Normal file
View File

@ -0,0 +1,106 @@
<?php declare(strict_types=1);
// action_object_attribute
// action = create / view / edit / delete
// object = image / user / tag / setting
abstract class Permissions
{
public const CHANGE_SETTING = "change_setting"; # modify web-level settings, eg the config table
public const OVERRIDE_CONFIG = "override_config"; # modify sys-level settings, eg shimmie.conf.php
public const BIG_SEARCH = "big_search"; # search for more than 3 tags at once (speed mode only)
public const MANAGE_EXTENSION_LIST = "manage_extension_list";
public const MANAGE_ALIAS_LIST = "manage_alias_list";
public const MANAGE_AUTO_TAG = "manage_auto_tag";
public const MASS_TAG_EDIT = "mass_tag_edit";
public const VIEW_IP = "view_ip"; # view IP addresses associated with things
public const BAN_IP = "ban_ip";
public const CREATE_USER = "create_user";
public const CREATE_OTHER_USER = "create_other_user";
public const EDIT_USER_NAME = "edit_user_name";
public const EDIT_USER_PASSWORD = "edit_user_password";
public const EDIT_USER_INFO = "edit_user_info"; # email address, etc
public const EDIT_USER_CLASS = "edit_user_class";
public const DELETE_USER = "delete_user";
public const CREATE_COMMENT = "create_comment";
public const DELETE_COMMENT = "delete_comment";
public const BYPASS_COMMENT_CHECKS = "bypass_comment_checks"; # spam etc
public const REPLACE_IMAGE = "replace_image";
public const CREATE_IMAGE = "create_image";
public const EDIT_IMAGE_TAG = "edit_image_tag";
public const EDIT_IMAGE_SOURCE = "edit_image_source";
public const EDIT_IMAGE_OWNER = "edit_image_owner";
public const EDIT_IMAGE_LOCK = "edit_image_lock";
public const EDIT_IMAGE_TITLE = "edit_image_title";
public const EDIT_IMAGE_RELATIONSHIPS = "edit_image_relationships";
public const EDIT_IMAGE_ARTIST = "edit_image_artist";
public const BULK_EDIT_IMAGE_TAG = "bulk_edit_image_tag";
public const BULK_EDIT_IMAGE_SOURCE = "bulk_edit_image_source";
public const DELETE_IMAGE = "delete_image";
public const BAN_IMAGE = "ban_image";
public const VIEW_EVENTLOG = "view_eventlog";
public const IGNORE_DOWNTIME = "ignore_downtime";
public const VIEW_REGISTRATIONS = "view_registrations";
public const CREATE_IMAGE_REPORT = "create_image_report";
public const VIEW_IMAGE_REPORT = "view_image_report"; # deal with reported images
public const WIKI_ADMIN = "wiki_admin";
public const EDIT_WIKI_PAGE = "edit_wiki_page";
public const DELETE_WIKI_PAGE = "delete_wiki_page";
public const MANAGE_BLOCKS = "manage_blocks";
public const MANAGE_ADMINTOOLS = "manage_admintools";
public const SEND_PM = "send_pm";
public const READ_PM = "read_pm";
public const VIEW_OTHER_PMS = "view_other_pms";
public const EDIT_FEATURE = "edit_feature";
public const BULK_EDIT_VOTE = "bulk_edit_vote";
public const EDIT_OTHER_VOTE = "edit_other_vote";
public const VIEW_SYSINTO = "view_sysinfo";
public const HELLBANNED = "hellbanned";
public const VIEW_HELLBANNED = "view_hellbanned";
public const PROTECTED = "protected"; # only admins can modify protected users (stops a moderator changing an admin's password)
public const EDIT_IMAGE_RATING = "edit_image_rating";
public const BULK_EDIT_IMAGE_RATING = "bulk_edit_image_rating";
public const VIEW_TRASH = "view_trash";
public const PERFORM_BULK_ACTIONS = "perform_bulk_actions";
public const BULK_ADD = "bulk_add";
public const EDIT_FILES = "edit_files";
public const EDIT_TAG_CATEGORIES = "edit_tag_categories";
public const RESCAN_MEDIA = "rescan_media";
public const SEE_IMAGE_VIEW_COUNTS = "see_image_view_counts";
public const EDIT_FAVOURITES = "edit_favourites";
public const ARTISTS_ADMIN = "artists_admin";
public const BLOTTER_ADMIN = "blotter_admin";
public const FORUM_ADMIN = "forum_admin";
public const NOTES_ADMIN = "notes_admin";
public const POOLS_ADMIN = "pools_admin";
public const TIPS_ADMIN = "tips_admin";
public const CRON_ADMIN = "cron_admin";
public const APPROVE_IMAGE = "approve_image";
public const APPROVE_COMMENT = "approve_comment";
public const SET_PRIVATE_IMAGE = "set_private_image";
public const SET_OTHERS_PRIVATE_IMAGES = "set_others_private_images";
public const BULK_IMPORT = "bulk_import";
public const BULK_EXPORT = "bulk_export";
public const BULK_DOWNLOAD = "bulk_download";
}

777
core/polyfills.php Normal file
View File

@ -0,0 +1,777 @@
<?php declare(strict_types=1);
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
* Things which should be in the core API *
\* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
require_once "filetypes.php";
/**
* Return the unique elements of an array, case insensitively
*/
function array_iunique(array $array): array
{
$ok = [];
foreach ($array as $element) {
$found = false;
foreach ($ok as $existing) {
if (strtolower($element) == strtolower($existing)) {
$found = true;
break;
}
}
if (!$found) {
$ok[] = $element;
}
}
return $ok;
}
/**
* Figure out if an IP is in a specified range
*
* from https://uk.php.net/network
*/
function ip_in_range(string $IP, string $CIDR): bool
{
list($net, $mask) = explode("/", $CIDR);
$ip_net = ip2long($net);
$ip_mask = ~((1 << (32 - $mask)) - 1);
$ip_ip = ip2long($IP);
$ip_ip_net = $ip_ip & $ip_mask;
return ($ip_ip_net == $ip_net);
}
/**
* Delete an entire file heirachy
*
* from a patch by Christian Walde; only intended for use in the
* "extension manager" extension, but it seems to fit better here
*/
function deltree(string $f): void
{
//Because Windows (I know, bad excuse)
if (PHP_OS === 'WINNT') {
$real = realpath($f);
$path = realpath('./').'\\'.str_replace('/', '\\', $f);
if ($path != $real) {
rmdir($path);
} else {
foreach (glob($f.'/*') as $sf) {
if (is_dir($sf) && !is_link($sf)) {
deltree($sf);
} else {
unlink($sf);
}
}
rmdir($f);
}
} else {
if (is_link($f)) {
unlink($f);
} elseif (is_dir($f)) {
foreach (glob($f.'/*') as $sf) {
if (is_dir($sf) && !is_link($sf)) {
deltree($sf);
} else {
unlink($sf);
}
}
rmdir($f);
}
}
}
/**
* Copy an entire file hierarchy
*
* from a comment on https://uk.php.net/copy
*/
function full_copy(string $source, string $target): void
{
if (is_dir($source)) {
@mkdir($target);
$d = dir($source);
while (false !== ($entry = $d->read())) {
if ($entry == '.' || $entry == '..') {
continue;
}
$Entry = $source . '/' . $entry;
if (is_dir($Entry)) {
full_copy($Entry, $target . '/' . $entry);
continue;
}
copy($Entry, $target . '/' . $entry);
}
$d->close();
} else {
copy($source, $target);
}
}
/**
* Return a list of all the regular files in a directory and subdirectories
*/
function list_files(string $base, string $_sub_dir=""): array
{
assert(is_dir($base));
$file_list = [];
$files = [];
$dir = opendir("$base/$_sub_dir");
while ($f = readdir($dir)) {
$files[] = $f;
}
closedir($dir);
sort($files);
foreach ($files as $filename) {
$full_path = "$base/$_sub_dir/$filename";
if (!is_link($full_path) && is_dir($full_path)) {
if (!($filename == "." || $filename == "..")) {
//subdirectory found
$file_list = array_merge(
$file_list,
list_files($base, "$_sub_dir/$filename")
);
}
} else {
$full_path = str_replace("//", "/", $full_path);
$file_list[] = $full_path;
}
}
return $file_list;
}
function flush_output(): void
{
if (!defined("UNITTEST")) {
@ob_flush();
}
flush();
}
function stream_file(string $file, int $start, int $end): void
{
$fp = fopen($file, 'r');
try {
set_time_limit(0);
fseek($fp, $start);
$buffer = 1024 * 1024;
while (!feof($fp) && ($p = ftell($fp)) <= $end) {
if ($p + $buffer > $end) {
$buffer = $end - $p + 1;
}
echo fread($fp, $buffer);
flush_output();
// After flush, we can tell if the client browser has disconnected.
// This means we can start sending a large file, and if we detect they disappeared
// then we can just stop and not waste any more resources or bandwidth.
if (connection_status() != 0) {
break;
}
}
} finally {
fclose($fp);
}
}
if (!function_exists('http_parse_headers')) { #http://www.php.net/manual/en/function.http-parse-headers.php#112917
/**
* #return string[]
*/
function http_parse_headers(string $raw_headers): array
{
$headers = []; // $headers = [];
foreach (explode("\n", $raw_headers) as $i => $h) {
$h = explode(':', $h, 2);
if (isset($h[1])) {
if (!isset($headers[$h[0]])) {
$headers[$h[0]] = trim($h[1]);
} elseif (is_array($headers[$h[0]])) {
$tmp = array_merge($headers[$h[0]], [trim($h[1])]);
$headers[$h[0]] = $tmp;
} else {
$tmp = array_merge([$headers[$h[0]]], [trim($h[1])]);
$headers[$h[0]] = $tmp;
}
}
}
return $headers;
}
}
/**
* HTTP Headers can sometimes be lowercase which will cause issues.
* In cases like these, we need to make sure to check for them if the camelcase version does not exist.
*/
function findHeader(array $headers, string $name): ?string
{
if (!is_array($headers)) {
return null;
}
$header = null;
if (array_key_exists($name, $headers)) {
$header = $headers[$name];
} else {
$headers = array_change_key_case($headers); // convert all to lower case.
$lc_name = strtolower($name);
if (array_key_exists($lc_name, $headers)) {
$header = $headers[$lc_name];
}
}
return $header;
}
if (!function_exists('mb_strlen')) {
// TODO: we should warn the admin that they are missing multibyte support
function mb_strlen($str, $encoding)
{
return strlen($str);
}
function mb_internal_encoding($encoding)
{
}
function mb_strtolower($str)
{
return strtolower($str);
}
}
/** @noinspection PhpUnhandledExceptionInspection */
function getSubclassesOf(string $parent)
{
$result = [];
foreach (get_declared_classes() as $class) {
$rclass = new ReflectionClass($class);
if (!$rclass->isAbstract() && is_subclass_of($class, $parent)) {
$result[] = $class;
}
}
return $result;
}
/**
* Like glob, with support for matching very long patterns with braces.
*/
function zglob(string $pattern): array
{
$results = [];
if (preg_match('/(.*)\{(.*)\}(.*)/', $pattern, $matches)) {
$braced = explode(",", $matches[2]);
foreach ($braced as $b) {
$sub_pattern = $matches[1].$b.$matches[3];
$results = array_merge($results, zglob($sub_pattern));
}
return $results;
} else {
$r = glob($pattern);
if ($r) {
return $r;
} else {
return [];
}
}
}
/**
* Figure out the path to the shimmie install directory.
*
* eg if shimmie is visible at https://foo.com/gallery, this
* function should return /gallery
*
* PHP really, really sucks.
*/
function get_base_href(): string
{
if (defined("BASE_HREF") && !empty(BASE_HREF)) {
return BASE_HREF;
}
$possible_vars = ['SCRIPT_NAME', 'PHP_SELF', 'PATH_INFO', 'ORIG_PATH_INFO'];
$ok_var = null;
foreach ($possible_vars as $var) {
if (isset($_SERVER[$var]) && substr($_SERVER[$var], -4) === '.php') {
$ok_var = $_SERVER[$var];
break;
}
}
assert(!empty($ok_var));
$dir = dirname($ok_var);
$dir = str_replace("\\", "/", $dir);
$dir = str_replace("//", "/", $dir);
$dir = rtrim($dir, "/");
return $dir;
}
/**
* The opposite of the standard library's parse_url
*/
function unparse_url($parsed_url)
{
$scheme = isset($parsed_url['scheme']) ? $parsed_url['scheme'] . '://' : '';
$host = isset($parsed_url['host']) ? $parsed_url['host'] : '';
$port = isset($parsed_url['port']) ? ':' . $parsed_url['port'] : '';
$user = isset($parsed_url['user']) ? $parsed_url['user'] : '';
$pass = isset($parsed_url['pass']) ? ':' . $parsed_url['pass'] : '';
$pass = ($user || $pass) ? "$pass@" : '';
$path = isset($parsed_url['path']) ? $parsed_url['path'] : '';
$query = !empty($parsed_url['query']) ? '?' . $parsed_url['query'] : '';
$fragment = !empty($parsed_url['fragment']) ? '#' . $parsed_url['fragment'] : '';
return "$scheme$user$pass$host$port$path$query$fragment";
}
function startsWith(string $haystack, string $needle): bool
{
$length = strlen($needle);
return (substr($haystack, 0, $length) === $needle);
}
function endsWith(string $haystack, string $needle): bool
{
$length = strlen($needle);
$start = $length * -1; //negative
return (substr($haystack, $start) === $needle);
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
* Input / Output Sanitising *
\* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/**
* Make some data safe for printing into HTML
*/
function html_escape(?string $input): string
{
if (is_null($input)) {
return "";
}
return htmlentities($input, ENT_QUOTES, "UTF-8");
}
/**
* Unescape data that was made safe for printing into HTML
*/
function html_unescape(string $input): string
{
return html_entity_decode($input, ENT_QUOTES, "UTF-8");
}
/**
* Make sure some data is safe to be used in integer context
*/
function int_escape(?string $input): int
{
/*
Side note, Casting to an integer is FASTER than using intval.
http://hakre.wordpress.com/2010/05/13/php-casting-vs-intval/
*/
if (is_null($input)) {
return 0;
}
return (int)$input;
}
/**
* Make sure some data is safe to be used in URL context
*/
function url_escape(?string $input): string
{
if (is_null($input)) {
return "";
}
$input = rawurlencode($input);
return $input;
}
/**
* Turn all manner of HTML / INI / JS / DB booleans into a PHP one
*/
function bool_escape($input): bool
{
/*
Sometimes, I don't like PHP -- this, is one of those times...
"a boolean FALSE is not considered a valid boolean value by this function."
Yay for Got'chas!
https://php.net/manual/en/filter.filters.validate.php
*/
if (is_bool($input)) {
return $input;
} elseif (is_int($input)) {
return ($input === 1);
} else {
$value = filter_var($input, FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE);
if (!is_null($value)) {
return $value;
} else {
$input = strtolower(trim($input));
return (
$input === "y" ||
$input === "yes" ||
$input === "t" ||
$input === "true" ||
$input === "on" ||
$input === "1"
);
}
}
}
/**
* Some functions require a callback function for escaping,
* but we might not want to alter the data
*/
function no_escape(string $input): string
{
return $input;
}
/**
* Given a 1-indexed numeric-ish thing, return a zero-indexed
* number between 0 and $max
*/
function page_number(string $input, ?int $max=null): int
{
if (!is_numeric($input)) {
$pageNumber = 0;
} elseif ($input <= 0) {
$pageNumber = 0;
} elseif (!is_null($max) && $input >= $max) {
$pageNumber = $max - 1;
} else {
$pageNumber = $input - 1;
}
return $pageNumber;
}
function clamp(?int $val, ?int $min=null, ?int $max=null): int
{
if (!is_numeric($val) || (!is_null($min) && $val < $min)) {
$val = $min;
}
if (!is_null($max) && $val > $max) {
$val = $max;
}
if (!is_null($min) && !is_null($max)) {
assert($val >= $min && $val <= $max, "$min <= $val <= $max");
}
return $val;
}
function xml_tag(string $name, array $attrs=[], array $children=[]): string
{
$xml = "<$name ";
foreach ($attrs as $k => $v) {
$xv = str_replace('&#039;', '&apos;', htmlspecialchars((string)$v, ENT_QUOTES));
$xml .= "$k=\"$xv\" ";
}
if (count($children) > 0) {
$xml .= ">\n";
foreach ($children as $child) {
$xml .= xml_tag($child);
}
$xml .= "</$name>\n";
} else {
$xml .= "/>\n";
}
return $xml;
}
/**
* Original PHP code by Chirp Internet: www.chirp.com.au
* Please acknowledge use of this code by including this header.
*/
function truncate(string $string, int $limit, string $break=" ", string $pad="..."): string
{
// return with no change if string is shorter than $limit
if (strlen($string) <= $limit) {
return $string;
}
// is $break present between $limit and the end of the string?
if (false !== ($breakpoint = strpos($string, $break, $limit))) {
if ($breakpoint < strlen($string) - 1) {
$string = substr($string, 0, $breakpoint) . $pad;
}
}
return $string;
}
/**
* Turn a human readable filesize into an integer, eg 1KB -> 1024
*/
function parse_shorthand_int(string $limit): int
{
if (preg_match('/^([\d\.]+)([tgmk])?b?$/i', (string)$limit, $m)) {
$value = $m[1];
if (isset($m[2])) {
switch (strtolower($m[2])) {
/** @noinspection PhpMissingBreakStatementInspection */
case 't': $value *= 1024; // fall through
/** @noinspection PhpMissingBreakStatementInspection */
// no break
case 'g': $value *= 1024; // fall through
/** @noinspection PhpMissingBreakStatementInspection */
// no break
case 'm': $value *= 1024; // fall through
/** @noinspection PhpMissingBreakStatementInspection */
// no break
case 'k': $value *= 1024; break;
default: $value = -1;
}
}
return (int)$value;
} else {
return -1;
}
}
/**
* Turn an integer into a human readable filesize, eg 1024 -> 1KB
*/
function to_shorthand_int(int $int): string
{
assert($int >= 0);
if ($int >= pow(1024, 4)) {
return sprintf("%.1fTB", $int / pow(1024, 4));
} elseif ($int >= pow(1024, 3)) {
return sprintf("%.1fGB", $int / pow(1024, 3));
} elseif ($int >= pow(1024, 2)) {
return sprintf("%.1fMB", $int / pow(1024, 2));
} elseif ($int >= 1024) {
return sprintf("%.1fKB", $int / 1024);
} else {
return (string)$int;
}
}
const TIME_UNITS = ["s"=>60,"m"=>60,"h"=>24,"d"=>365,"y"=>PHP_INT_MAX];
function format_milliseconds(int $input): string
{
$output = "";
$remainder = floor($input / 1000);
foreach (TIME_UNITS as $unit=>$conversion) {
$count = $remainder % $conversion;
$remainder = floor($remainder / $conversion);
if ($count==0&&$remainder<1) {
break;
}
$output = "$count".$unit." ".$output;
}
return trim($output);
}
/**
* Turn a date into a time, a date, an "X minutes ago...", etc
*/
function autodate(string $date, bool $html=true): string
{
$cpu = date('c', strtotime($date));
$hum = date('F j, Y; H:i', strtotime($date));
return ($html ? "<time datetime='$cpu'>$hum</time>" : $hum);
}
/**
* Check if a given string is a valid date-time. ( Format: yyyy-mm-dd hh:mm:ss )
*/
function isValidDateTime(string $dateTime): bool
{
if (preg_match("/^(\d{4})-(\d{2})-(\d{2}) ([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])$/", $dateTime, $matches)) {
if (checkdate((int)$matches[2], (int)$matches[3], (int)$matches[1])) {
return true;
}
}
return false;
}
/**
* Check if a given string is a valid date. ( Format: yyyy-mm-dd )
*/
function isValidDate(string $date): bool
{
if (preg_match("/^(\d{4})-(\d{2})-(\d{2})$/", $date, $matches)) {
// checkdate wants (month, day, year)
if (checkdate((int)$matches[2], (int)$matches[3], (int)$matches[1])) {
return true;
}
}
return false;
}
function validate_input(array $inputs): array
{
$outputs = [];
foreach ($inputs as $key => $validations) {
$flags = explode(',', $validations);
if (in_array('bool', $flags) && !isset($_POST[$key])) {
$_POST[$key] = 'off';
}
if (in_array('optional', $flags)) {
if (!isset($_POST[$key]) || trim($_POST[$key]) == "") {
$outputs[$key] = null;
continue;
}
}
if (!isset($_POST[$key]) || trim($_POST[$key]) == "") {
throw new InvalidInput("Input '$key' not set");
}
$value = trim($_POST[$key]);
if (in_array('user_id', $flags)) {
$id = int_escape($value);
if (in_array('exists', $flags)) {
if (is_null(User::by_id($id))) {
throw new InvalidInput("User #$id does not exist");
}
}
$outputs[$key] = $id;
} elseif (in_array('user_name', $flags)) {
if (strlen($value) < 1) {
throw new InvalidInput("Username must be at least 1 character");
} elseif (!preg_match('/^[a-zA-Z0-9-_]+$/', $value)) {
throw new InvalidInput(
"Username contains invalid characters. Allowed characters are ".
"letters, numbers, dash, and underscore"
);
}
$outputs[$key] = $value;
} elseif (in_array('user_class', $flags)) {
global $_shm_user_classes;
if (!array_key_exists($value, $_shm_user_classes)) {
throw new InvalidInput("Invalid user class: ".html_escape($value));
}
$outputs[$key] = $value;
} elseif (in_array('email', $flags)) {
$outputs[$key] = trim($value);
} elseif (in_array('password', $flags)) {
$outputs[$key] = $value;
} elseif (in_array('int', $flags)) {
$value = trim($value);
if (empty($value) || !is_numeric($value)) {
throw new InvalidInput("Invalid int: ".html_escape($value));
}
$outputs[$key] = (int)$value;
} elseif (in_array('bool', $flags)) {
$outputs[$key] = bool_escape($value);
} elseif (in_array('date', $flags)) {
$outputs[$key] = date("Y-m-d H:i:s", strtotime(trim($value)));
} elseif (in_array('string', $flags)) {
if (in_array('trim', $flags)) {
$value = trim($value);
}
if (in_array('lower', $flags)) {
$value = strtolower($value);
}
if (in_array('not-empty', $flags)) {
throw new InvalidInput("$key must not be blank");
}
if (in_array('nullify', $flags)) {
if (empty($value)) {
$value = null;
}
}
$outputs[$key] = $value;
} else {
throw new InvalidInput("Unknown validation '$validations'");
}
}
return $outputs;
}
/**
* Translates all possible directory separators to the appropriate one for the current system,
* and removes any duplicate separators.
*/
function sanitize_path(string $path): string
{
return preg_replace('|[\\\\/]+|S', DIRECTORY_SEPARATOR, $path);
}
/**
* Combines all path segments specified, ensuring no duplicate separators occur,
* as well as converting all possible separators to the one appropriate for the current system.
*/
function join_path(string ...$paths): string
{
$output = "";
foreach ($paths as $path) {
if (empty($path)) {
continue;
}
$path = sanitize_path($path);
if (empty($output)) {
$output = $path;
} else {
$output = rtrim($output, DIRECTORY_SEPARATOR);
$path = ltrim($path, DIRECTORY_SEPARATOR);
$output .= DIRECTORY_SEPARATOR . $path;
}
}
return $output;
}
/**
* Perform callback on each item returned by an iterator.
*/
function iterator_map(callable $callback, iterator $iter): Generator
{
foreach ($iter as $i) {
yield call_user_func($callback, $i);
}
}
/**
* Perform callback on each item returned by an iterator and combine the result into an array.
*/
function iterator_map_to_array(callable $callback, iterator $iter): array
{
return iterator_to_array(iterator_map($callback, $iter));
}
function stringer($s)
{
if (is_array($s)) {
if (isset($s[0])) {
return "[" . implode(", ", array_map("stringer", $s)) . "]";
} else {
$pairs = [];
foreach ($s as $k=>$v) {
$pairs[] = "\"$k\"=>" . stringer($v);
}
return "[" . implode(", ", $pairs) . "]";
}
}
if (is_string($s)) {
return "\"$s\""; // FIXME: handle escaping quotes
}
return (string)$s;
}

63
core/sanitize_php.php Normal file
View File

@ -0,0 +1,63 @@
<?php declare(strict_types=1);
/*
* A small number of PHP-sanity things (eg don't silently ignore errors) to
* be included right at the very start of index.php and tests/bootstrap.php
*/
$min_php = "7.3";
if (version_compare(phpversion(), $min_php, ">=") === false) {
print "
Shimmie does not support versions of PHP lower than $min_php
(PHP reports that it is version ".phpversion().").
If your web host is running an older version, they are dangerously out of
date and you should plan on moving elsewhere.
";
exit;
}
# ini_set('zend.assertions', '1'); // generate assertions
ini_set('assert.exception', '1'); // throw exceptions when failed
set_error_handler(function ($errNo, $errStr) {
// Should we turn ALL notices into errors? PHP allows a lot of
// terrible things to happen by default...
if (strpos($errStr, 'Use of undefined constant ') === 0) {
throw new Exception("PHP Error#$errNo: $errStr");
} else {
return false;
}
});
ob_start();
if (PHP_SAPI === 'cli' || PHP_SAPI == 'phpdbg') {
if (isset($_SERVER['REMOTE_ADDR'])) {
die("CLI with remote addr? Confused, not taking the risk.");
}
$_SERVER['REMOTE_ADDR'] = "0.0.0.0";
$_SERVER['HTTP_HOST'] = "<cli command>";
}
function die_nicely($title, $body, $code=0)
{
print("<!DOCTYPE html>
<html lang='en'>
<head>
<title>Shimmie</title>
<link rel=\"shortcut icon\" href=\"ext/static_files/static/favicon.ico\">
<link rel=\"stylesheet\" href=\"ext/static_files/style.css\" type=\"text/css\">
</head>
<body>
<div id=\"installer\">
<h1>Shimmie</h1>
<h3>$title</h3>
<div class=\"container\">
$body
</div>
</div>
</body>
</html>");
if ($code != 0) {
http_response_code(500);
}
exit($code);
}

128
core/send_event.php Normal file
View File

@ -0,0 +1,128 @@
<?php declare(strict_types=1);
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
* Event API *
\* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/** @private */
global $_shm_event_listeners;
$_shm_event_listeners = [];
function _load_event_listeners(): void
{
global $_shm_event_listeners;
$cache_path = data_path("cache/shm_event_listeners.php");
if (SPEED_HAX && file_exists($cache_path)) {
require_once($cache_path);
} else {
_set_event_listeners();
if (SPEED_HAX) {
_dump_event_listeners($_shm_event_listeners, $cache_path);
}
}
}
function _clear_cached_event_listeners(): void
{
if (file_exists(data_path("cache/shm_event_listeners.php"))) {
unlink(data_path("cache/shm_event_listeners.php"));
}
}
function _set_event_listeners(): void
{
global $_shm_event_listeners;
$_shm_event_listeners = [];
foreach (getSubclassesOf("Extension") as $class) {
/** @var Extension $extension */
$extension = new $class();
// skip extensions which don't support our current database
if (!$extension->info->is_supported()) {
continue;
}
foreach (get_class_methods($extension) as $method) {
if (substr($method, 0, 2) == "on") {
$event = substr($method, 2) . "Event";
$pos = $extension->get_priority() * 100;
while (isset($_shm_event_listeners[$event][$pos])) {
$pos += 1;
}
$_shm_event_listeners[$event][$pos] = $extension;
}
}
}
}
function _dump_event_listeners(array $event_listeners, string $path): void
{
$p = "<"."?php\n";
foreach (getSubclassesOf("Extension") as $class) {
$p .= "\$$class = new $class(); ";
}
$p .= "\$_shm_event_listeners = array(\n";
foreach ($event_listeners as $event => $listeners) {
$p .= "\t'$event' => array(\n";
foreach ($listeners as $id => $listener) {
$p .= "\t\t$id => \$".get_class($listener).",\n";
}
$p .= "\t),\n";
}
$p .= ");\n";
file_put_contents($path, $p);
}
/** @private */
global $_shm_event_count;
$_shm_event_count = 0;
/**
* Send an event to all registered Extensions.
*/
function send_event(Event $event): Event
{
global $tracer_enabled;
global $_shm_event_listeners, $_shm_event_count, $_tracer;
if (!isset($_shm_event_listeners[get_class($event)])) {
return $event;
}
$method_name = "on".str_replace("Event", "", get_class($event));
// send_event() is performance sensitive, and with the number
// of times tracer gets called the time starts to add up
if ($tracer_enabled) {
$_tracer->begin(get_class($event));
}
// SHIT: https://bugs.php.net/bug.php?id=35106
$my_event_listeners = $_shm_event_listeners[get_class($event)];
ksort($my_event_listeners);
foreach ($my_event_listeners as $listener) {
if ($tracer_enabled) {
$_tracer->begin(get_class($listener));
}
if (method_exists($listener, $method_name)) {
$listener->$method_name($event);
}
if ($tracer_enabled) {
$_tracer->end();
}
if ($event->stop_processing===true) {
break;
}
}
$_shm_event_count++;
if ($tracer_enabled) {
$_tracer->end();
}
return $event;
}

34
core/sys_config.php Normal file
View File

@ -0,0 +1,34 @@
<?php declare(strict_types=1);
/**
* For any values that aren't defined in data/config/*.php,
* Shimmie will set the values to their defaults
*
* All of these can be over-ridden by placing a 'define' in
* data/config/shimmie.conf.php
*
* Do NOT change them in this file. These are the defaults only!
*
* Example:
* define("SPEED_HAX", true);
*/
function _d(string $name, $value): void
{
if (!defined($name)) {
define($name, $value);
}
}
$_g = file_exists(".git") ? '+' : '';
_d("DATABASE_DSN", null); // string PDO database connection details
_d("DATABASE_TIMEOUT", 10000);// int Time to wait for each statement to complete
_d("CACHE_DSN", null); // string cache connection details
_d("DEBUG", false); // boolean print various debugging details
_d("COOKIE_PREFIX", 'shm'); // string if you run multiple galleries with non-shared logins, give them different prefixes
_d("SPEED_HAX", false); // boolean do some questionable things in the name of performance
_d("WH_SPLITS", 1); // int how many levels of subfolders to put in the warehouse
_d("VERSION", "2.8.4$_g"); // string shimmie version
_d("TIMEZONE", null); // string timezone
_d("EXTRA_EXTS", ""); // string optional extra extensions
_d("BASE_HREF", null); // string force a specific base URL (default is auto-detect)
_d("TRACE_FILE", null); // string file to log performance data into
_d("TRACE_THRESHOLD", 0.0); // float log pages which take more time than this many seconds

View File

@ -0,0 +1,51 @@
<?php declare(strict_types=1);
use PHPUnit\Framework\TestCase;
require_once "core/basepage.php";
class BasePageTest extends TestCase
{
public function test_page()
{
$page = new BasePage();
$page->set_mode(PageMode::PAGE);
ob_start();
$page->display();
ob_end_clean();
$this->assertTrue(true); // doesn't crash
}
public function test_file()
{
$page = new BasePage();
$page->set_mode(PageMode::FILE);
$page->set_file("tests/pbx_screenshot.jpg");
ob_start();
$page->display();
ob_end_clean();
$this->assertTrue(true); // doesn't crash
}
public function test_data()
{
$page = new BasePage();
$page->set_mode(PageMode::DATA);
$page->set_data("hello world");
ob_start();
$page->display();
ob_end_clean();
$this->assertTrue(true); // doesn't crash
}
public function test_redirect()
{
$page = new BasePage();
$page->set_mode(PageMode::REDIRECT);
$page->set_redirect("/new/page");
ob_start();
$page->display();
ob_end_clean();
$this->assertTrue(true); // doesn't crash
}
}

17
core/tests/block.test.php Normal file
View File

@ -0,0 +1,17 @@
<?php declare(strict_types=1);
use PHPUnit\Framework\TestCase;
require_once "core/block.php";
class BlockTest extends TestCase
{
public function test_basic()
{
$b = new Block("head", "body");
$this->assertEquals(
"<section id='headmain'><h3 data-toggle-sel='#headmain' class=''>head</h3><div class='blockbody'>body</div></section>\n",
$b->get_html()
);
}
}

18
core/tests/init.test.php Normal file
View File

@ -0,0 +1,18 @@
<?php declare(strict_types=1);
use PHPUnit\Framework\TestCase;
class TestInit extends TestCase
{
public function testInitExt()
{
send_event(new InitExtEvent());
$this->assertTrue(true);
}
public function testDatabaseUpgrade()
{
send_event(new DatabaseUpgradeEvent());
$this->assertTrue(true);
}
}

View File

@ -0,0 +1,223 @@
<?php declare(strict_types=1);
use PHPUnit\Framework\TestCase;
require_once "core/polyfills.php";
class PolyfillsTest extends TestCase
{
public function test_html_escape()
{
$this->assertEquals(
html_escape("Foo & <waffles>"),
"Foo &amp; &lt;waffles&gt;"
);
$this->assertEquals(
html_unescape("Foo &amp; &lt;waffles&gt;"),
"Foo & <waffles>"
);
$x = "Foo &amp; &lt;waffles&gt;";
$this->assertEquals(html_escape(html_unescape($x)), $x);
}
public function test_int_escape()
{
$this->assertEquals(int_escape(""), 0);
$this->assertEquals(int_escape("1"), 1);
$this->assertEquals(int_escape("-1"), -1);
$this->assertEquals(int_escape("-1.5"), -1);
$this->assertEquals(int_escape(null), 0);
}
public function test_url_escape()
{
$this->assertEquals(url_escape("^\o/^"), "%5E%5Co%2F%5E");
$this->assertEquals(url_escape(null), "");
}
public function test_bool_escape()
{
$this->assertTrue(bool_escape(true));
$this->assertFalse(bool_escape(false));
$this->assertTrue(bool_escape("true"));
$this->assertFalse(bool_escape("false"));
$this->assertTrue(bool_escape("t"));
$this->assertFalse(bool_escape("f"));
$this->assertTrue(bool_escape("T"));
$this->assertFalse(bool_escape("F"));
$this->assertTrue(bool_escape("yes"));
$this->assertFalse(bool_escape("no"));
$this->assertTrue(bool_escape("Yes"));
$this->assertFalse(bool_escape("No"));
$this->assertTrue(bool_escape("on"));
$this->assertFalse(bool_escape("off"));
$this->assertTrue(bool_escape(1));
$this->assertFalse(bool_escape(0));
$this->assertTrue(bool_escape("1"));
$this->assertFalse(bool_escape("0"));
}
public function test_clamp()
{
$this->assertEquals(clamp(0, 5, 10), 5);
$this->assertEquals(clamp(5, 5, 10), 5);
$this->assertEquals(clamp(7, 5, 10), 7);
$this->assertEquals(clamp(10, 5, 10), 10);
$this->assertEquals(clamp(15, 5, 10), 10);
}
public function test_xml_tag()
{
$this->assertEquals(
"<test foo=\"bar\" >\n<cake />\n</test>\n",
xml_tag("test", ["foo"=>"bar"], ["cake"])
);
}
public function test_truncate()
{
$this->assertEquals(truncate("test words", 10), "test words");
$this->assertEquals(truncate("test...", 9), "test...");
$this->assertEquals(truncate("test...", 6), "test...");
$this->assertEquals(truncate("te...", 2), "te...");
}
public function test_to_shorthand_int()
{
$this->assertEquals(to_shorthand_int(1231231231), "1.1GB");
$this->assertEquals(to_shorthand_int(2), "2");
}
public function test_parse_shorthand_int()
{
$this->assertEquals(parse_shorthand_int("foo"), -1);
$this->assertEquals(parse_shorthand_int("32M"), 33554432);
$this->assertEquals(parse_shorthand_int("43.4KB"), 44441);
$this->assertEquals(parse_shorthand_int("1231231231"), 1231231231);
}
public function test_format_milliseconds()
{
$this->assertEquals("", format_milliseconds(5));
$this->assertEquals("5s", format_milliseconds(5000));
$this->assertEquals("1y 213d 16h 53m 20s", format_milliseconds(50000000000));
}
public function test_autodate()
{
$this->assertEquals(
"<time datetime='2012-06-23T16:14:22+00:00'>June 23, 2012; 16:14</time>",
autodate("2012-06-23 16:14:22")
);
}
public function test_validate_input()
{
$_POST = [
"foo" => " bar ",
"to_null" => " ",
"num" => "42",
];
$this->assertEquals(
["foo"=>"bar"],
validate_input(["foo"=>"string,trim,lower"])
);
//$this->assertEquals(
// ["to_null"=>null],
// validate_input(["to_null"=>"string,trim,nullify"])
//);
$this->assertEquals(
["num"=>42],
validate_input(["num"=>"int"])
);
}
public function test_sanitize_path()
{
$this->assertEquals(
"one",
sanitize_path("one")
);
$this->assertEquals(
"one".DIRECTORY_SEPARATOR."two",
sanitize_path("one\\two")
);
$this->assertEquals(
"one".DIRECTORY_SEPARATOR."two",
sanitize_path("one/two")
);
$this->assertEquals(
"one".DIRECTORY_SEPARATOR."two",
sanitize_path("one\\\\two")
);
$this->assertEquals(
"one".DIRECTORY_SEPARATOR."two",
sanitize_path("one//two")
);
$this->assertEquals(
"one".DIRECTORY_SEPARATOR."two",
sanitize_path("one\\\\\\two")
);
$this->assertEquals(
"one".DIRECTORY_SEPARATOR."two",
sanitize_path("one///two")
);
$this->assertEquals(
DIRECTORY_SEPARATOR."one".DIRECTORY_SEPARATOR."two".DIRECTORY_SEPARATOR,
sanitize_path("\\/one/\\/\\/two\\/")
);
}
public function test_join_path()
{
$this->assertEquals(
"one",
join_path("one")
);
$this->assertEquals(
"one".DIRECTORY_SEPARATOR."two",
join_path("one", "two")
);
$this->assertEquals(
"one".DIRECTORY_SEPARATOR."two".DIRECTORY_SEPARATOR."three",
join_path("one", "two", "three")
);
$this->assertEquals(
"one".DIRECTORY_SEPARATOR."two".DIRECTORY_SEPARATOR."three",
join_path("one/two", "three")
);
$this->assertEquals(
DIRECTORY_SEPARATOR."one".DIRECTORY_SEPARATOR."two".DIRECTORY_SEPARATOR."three".DIRECTORY_SEPARATOR,
join_path("\\/////\\\\one/\///"."\\//two\/\\//\\//", "//\/\\\/three/\\/\/")
);
}
public function test_stringer()
{
$this->assertEquals(
'["foo"=>"bar", "baz"=>[1, 2, 3], "qux"=>["a"=>"b"]]',
stringer(["foo"=>"bar", "baz"=>[1,2,3], "qux"=>["a"=>"b"]])
);
}
}

22
core/tests/tag.test.php Normal file
View File

@ -0,0 +1,22 @@
<?php declare(strict_types=1);
use PHPUnit\Framework\TestCase;
require_once "core/imageboard/tag.php";
class TagTest extends TestCase
{
public function test_caret()
{
$this->assertEquals("foo", Tag::decaret("foo"));
$this->assertEquals("foo?", Tag::decaret("foo^q"));
$this->assertEquals("a^b/c\\d?e&f", Tag::decaret("a^^b^sc^bd^qe^af"));
}
public function test_decaret()
{
$this->assertEquals("foo", Tag::caret("foo"));
$this->assertEquals("foo^q", Tag::caret("foo?"));
$this->assertEquals("a^^b^sc^bd^qe^af", Tag::caret("a^b/c\\d?e&f"));
}
}

101
core/tests/urls.test.php Normal file
View File

@ -0,0 +1,101 @@
<?php declare(strict_types=1);
use PHPUnit\Framework\TestCase;
require_once "core/urls.php";
class UrlsTest extends TestCase
{
public function test_make_link()
{
// basic
$this->assertEquals(
"/test/foo",
make_link("foo")
);
// remove leading slash from path
$this->assertEquals(
"/test/foo",
make_link("/foo")
);
// query
$this->assertEquals(
"/test/foo?a=1&b=2",
make_link("foo", "a=1&b=2")
);
// hash
$this->assertEquals(
"/test/foo#cake",
make_link("foo", null, "cake")
);
// query + hash
$this->assertEquals(
"/test/foo?a=1&b=2#cake",
make_link("foo", "a=1&b=2", "cake")
);
}
public function test_make_http()
{
// relative to shimmie install
$this->assertEquals(
"http://<cli command>/test/foo",
make_http("foo")
);
// relative to web server
$this->assertEquals(
"http://<cli command>/foo",
make_http("/foo")
);
// absolute
$this->assertEquals(
"https://foo.com",
make_http("https://foo.com")
);
}
public function test_modify_url()
{
$this->assertEquals(
"/foo/bar?a=3&b=2",
modify_url("/foo/bar?a=1&b=2", ["a"=>"3"])
);
$this->assertEquals(
"https://blah.com/foo/bar?b=2",
modify_url("https://blah.com/foo/bar?a=1&b=2", ["a"=>null])
);
$this->assertEquals(
"/foo/bar",
modify_url("/foo/bar?a=1&b=2", ["a"=>null, "b"=>null])
);
}
public function test_referer_or()
{
unset($_SERVER['HTTP_REFERER']);
$this->assertEquals(
"foo",
referer_or("foo")
);
$_SERVER['HTTP_REFERER'] = "cake";
$this->assertEquals(
"cake",
referer_or("foo")
);
$_SERVER['HTTP_REFERER'] = "cake";
$this->assertEquals(
"foo",
referer_or("foo", ["cake"])
);
}
}

86
core/tests/util.test.php Normal file
View File

@ -0,0 +1,86 @@
<?php declare(strict_types=1);
use PHPUnit\Framework\TestCase;
require_once "core/util.php";
class UtilTest extends TestCase
{
public function test_warehouse_path()
{
$hash = "7ac19c10d6859415";
$this->assertEquals(
join_path(DATA_DIR, "base", $hash),
warehouse_path("base", $hash, false, 0)
);
$this->assertEquals(
join_path(DATA_DIR, "base", "7a", $hash),
warehouse_path("base", $hash, false, 1)
);
$this->assertEquals(
join_path(DATA_DIR, "base", "7a", "c1", $hash),
warehouse_path("base", $hash, false, 2)
);
$this->assertEquals(
join_path(DATA_DIR, "base", "7a", "c1", "9c", $hash),
warehouse_path("base", $hash, false, 3)
);
$this->assertEquals(
join_path(DATA_DIR, "base", "7a", "c1", "9c", "10", $hash),
warehouse_path("base", $hash, false, 4)
);
$this->assertEquals(
join_path(DATA_DIR, "base", "7a", "c1", "9c", "10", "d6", $hash),
warehouse_path("base", $hash, false, 5)
);
$this->assertEquals(
join_path(DATA_DIR, "base", "7a", "c1", "9c", "10", "d6", "85", $hash),
warehouse_path("base", $hash, false, 6)
);
$this->assertEquals(
join_path(DATA_DIR, "base", "7a", "c1", "9c", "10", "d6", "85", "94", $hash),
warehouse_path("base", $hash, false, 7)
);
$this->assertEquals(
join_path(DATA_DIR, "base", "7a", "c1", "9c", "10", "d6", "85", "94", "15", $hash),
warehouse_path("base", $hash, false, 8)
);
$this->assertEquals(
join_path(DATA_DIR, "base", "7a", "c1", "9c", "10", "d6", "85", "94", "15", $hash),
warehouse_path("base", $hash, false, 9)
);
$this->assertEquals(
join_path(DATA_DIR, "base", "7a", "c1", "9c", "10", "d6", "85", "94", "15", $hash),
warehouse_path("base", $hash, false, 10)
);
}
public function test_load_balance_url()
{
$hash = "7ac19c10d6859415";
$ext = "jpg";
// pseudo-randomly select one of the image servers, balanced in given ratio
$this->assertEquals(
"https://baz.mycdn.com/7ac19c10d6859415.jpg",
load_balance_url("https://{foo=10,bar=5,baz=5}.mycdn.com/$hash.$ext", $hash)
);
// N'th and N+1'th results should be different
$this->assertNotEquals(
load_balance_url("https://{foo=10,bar=5,baz=5}.mycdn.com/$hash.$ext", $hash, 0),
load_balance_url("https://{foo=10,bar=5,baz=5}.mycdn.com/$hash.$ext", $hash, 1)
);
}
}

114
core/urls.php Normal file
View File

@ -0,0 +1,114 @@
<?php declare(strict_types=1);
class Link
{
public $page;
public $query;
public function __construct(?string $page=null, ?string $query=null)
{
$this->page = $page;
$this->query = $query;
}
public function make_link(): string
{
return make_link($this->page, $this->query);
}
}
/**
* Figure out the correct way to link to a page, taking into account
* things like the nice URLs setting.
*
* eg make_link("post/list") becomes "/v2/index.php?q=post/list"
*/
function make_link(?string $page=null, ?string $query=null, ?string $fragment=null): string
{
global $config;
if (is_null($page)) {
$page = $config->get_string(SetupConfig::MAIN_PAGE);
}
$page = trim($page, "/");
$parts = [];
$install_dir = get_base_href();
if (SPEED_HAX || $config->get_bool('nice_urls', false)) {
$parts['path'] = "$install_dir/$page";
} else {
$parts['path'] = "$install_dir/index.php";
$query = empty($query) ? "q=$page" : "q=$page&$query";
}
$parts['query'] = $query; // http_build_query($query);
$parts['fragment'] = $fragment; // http_build_query($hash);
return unparse_url($parts);
}
/**
* Take the current URL and modify some parameters
*/
function modify_current_url(array $changes): string
{
return modify_url($_SERVER['REQUEST_URI'], $changes);
}
function modify_url(string $url, array $changes): string
{
$parts = parse_url($url);
$params = [];
if (isset($parts['query'])) {
parse_str($parts['query'], $params);
}
foreach ($changes as $k => $v) {
if (is_null($v) and isset($params[$k])) {
unset($params[$k]);
}
$params[$k] = $v;
}
$parts['query'] = http_build_query($params);
return unparse_url($parts);
}
/**
* Turn a relative link into an absolute one, including hostname
*/
function make_http(string $link): string
{
if (strpos($link, "://") > 0) {
return $link;
}
if (strlen($link) > 0 && $link[0] != '/') {
$link = get_base_href() . '/' . $link;
}
$protocol = is_https_enabled() ? "https://" : "http://";
$link = $protocol . $_SERVER["HTTP_HOST"] . $link;
$link = str_replace("/./", "/", $link);
return $link;
}
/**
* If HTTP_REFERER is set, and not blacklisted, then return it
* Else return a default $dest
*/
function referer_or(string $dest, ?array $blacklist=null): string
{
if (empty($_SERVER['HTTP_REFERER'])) {
return $dest;
}
if ($blacklist) {
foreach ($blacklist as $b) {
if (strstr($_SERVER['HTTP_REFERER'], $b)) {
return $dest;
}
}
}
return $_SERVER['HTTP_REFERER'];
}

View File

@ -1,64 +0,0 @@
<?php
class User {
var $id;
var $name;
var $email;
var $join_date;
var $days_old;
var $enabled;
var $admin;
public function User($row) {
$this->id = int_escape($row['id']);
$this->name = $row['name'];
$this->email = $row['email'];
$this->join_date = $row['joindate'];
$this->days_old = $row['days_old'];
$this->enabled = ($row['enabled'] == 'Y');
$this->admin = ($row['admin'] == 'Y');
}
public function is_anonymous() {
global $config;
return ($this->id == $config->get_int('anon_id'));
}
public function is_enabled() {
return $this->enabled;
}
public function set_enabled($enabled) {
global $database;
$yn = $enabled ? 'Y' : 'N';
$database->db->Execute("UPDATE users SET enabled=? WHERE id=?",
array($yn, $this->id));
}
public function is_admin() {
return $this->admin;
}
public function set_admin($admin) {
global $database;
$yn = $admin ? 'Y' : 'N';
$database->db->Execute("UPDATE users SET admin=? WHERE id=?",
array($yn, $this->id));
}
public function get_days_old() {
return $this->days_old;
}
public function get_image_count() {
global $database;
return $database->db->GetOne("SELECT COUNT(*) AS count FROM images WHERE owner_id=?", $this->id);
}
public function get_comment_count() {
global $database;
return $database->db->GetOne("SELECT COUNT(*) AS count FROM comments WHERE owner_id=?", $this->id);
}
}
?>

262
core/user.php Normal file
View File

@ -0,0 +1,262 @@
<?php declare(strict_types=1);
function _new_user(array $row): User
{
return new User($row);
}
/**
* Class User
*
* An object representing a row in the "users" table.
*
* The currently logged in user will always be accessible via the global variable $user.
*/
class User
{
/** @var int */
public $id;
/** @var string */
public $name;
/** @var string */
public $email;
public $join_date;
/** @var string */
public $passhash;
/** @var UserClass */
public $class;
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Initialisation *
* *
* User objects shouldn't be created directly, they should be *
* fetched from the database like so: *
* *
* $user = User::by_name("bob"); *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/**
* One will very rarely construct a user directly, more common
* would be to use User::by_id, User::by_session, etc.
*
* @throws SCoreException
*/
public function __construct(array $row)
{
global $_shm_user_classes;
$this->id = int_escape((string)$row['id']);
$this->name = $row['name'];
$this->email = $row['email'];
$this->join_date = $row['joindate'];
$this->passhash = $row['pass'];
if (array_key_exists($row["class"], $_shm_user_classes)) {
$this->class = $_shm_user_classes[$row["class"]];
} else {
throw new SCoreException("User '{$this->name}' has invalid class '{$row["class"]}'");
}
}
public static function by_session(string $name, string $session): ?User
{
global $cache, $config, $database;
$row = $cache->get("user-session:$name-$session");
if (!$row) {
if ($database->get_driver_name() === DatabaseDriver::MYSQL) {
$query = "SELECT * FROM users WHERE name = :name AND md5(concat(pass, :ip)) = :sess";
} else {
$query = "SELECT * FROM users WHERE name = :name AND md5(pass || :ip) = :sess";
}
$row = $database->get_row($query, ["name"=>$name, "ip"=>get_session_ip($config), "sess"=>$session]);
$cache->set("user-session:$name-$session", $row, 600);
}
return is_null($row) ? null : new User($row);
}
public static function by_id(int $id): ?User
{
global $cache, $database;
if ($id === 1) {
$cached = $cache->get('user-id:'.$id);
if ($cached) {
return new User($cached);
}
}
$row = $database->get_row("SELECT * FROM users WHERE id = :id", ["id"=>$id]);
if ($id === 1) {
$cache->set('user-id:'.$id, $row, 600);
}
return is_null($row) ? null : new User($row);
}
public static function by_name(string $name): ?User
{
global $database;
$row = $database->get_row("SELECT * FROM users WHERE LOWER(name) = LOWER(:name)", ["name"=>$name]);
return is_null($row) ? null : new User($row);
}
public static function name_to_id(string $name): int
{
$u = User::by_name($name);
if (is_null($u)) {
throw new ScoreException("Can't find any user named $name");
} else {
return $u->id;
}
}
public static function by_name_and_pass(string $name, string $pass): ?User
{
$my_user = User::by_name($name);
// If user tried to log in as "foo bar" and failed, try "foo_bar"
if (!$my_user && strpos($name, " ") !== false) {
$my_user = User::by_name(str_replace(" ", "_", $name));
}
if ($my_user) {
if ($my_user->passhash == md5(strtolower($name) . $pass)) {
log_info("core-user", "Migrating from md5 to bcrypt for $name");
$my_user->set_password($pass);
}
if (password_verify($pass, $my_user->passhash)) {
log_info("core-user", "Logged in as $name ({$my_user->class->name})");
return $my_user;
} else {
log_warning("core-user", "Failed to log in as $name (Invalid password)");
}
} else {
log_warning("core-user", "Failed to log in as $name (Invalid username)");
}
return null;
}
/* useful user object functions start here */
public function can(string $ability): bool
{
return $this->class->can($ability);
}
public function is_anonymous(): bool
{
global $config;
return ($this->id === $config->get_int('anon_id'));
}
public function is_logged_in(): bool
{
global $config;
return ($this->id !== $config->get_int('anon_id'));
}
public function set_class(string $class): void
{
global $database;
$database->Execute("UPDATE users SET class=:class WHERE id=:id", ["class"=>$class, "id"=>$this->id]);
log_info("core-user", 'Set class for '.$this->name.' to '.$class);
}
public function set_name(string $name): void
{
global $database;
if (User::by_name($name)) {
throw new ScoreException("Desired username is already in use");
}
$old_name = $this->name;
$this->name = $name;
$database->Execute("UPDATE users SET name=:name WHERE id=:id", ["name"=>$this->name, "id"=>$this->id]);
log_info("core-user", "Changed username for {$old_name} to {$this->name}");
}
public function set_password(string $password): void
{
global $database;
$hash = password_hash($password, PASSWORD_BCRYPT);
if (is_string($hash)) {
$this->passhash = $hash;
$database->Execute("UPDATE users SET pass=:hash WHERE id=:id", ["hash"=>$this->passhash, "id"=>$this->id]);
log_info("core-user", 'Set password for '.$this->name);
} else {
throw new SCoreException("Failed to hash password");
}
}
public function set_email(string $address): void
{
global $database;
$database->Execute("UPDATE users SET email=:email WHERE id=:id", ["email"=>$address, "id"=>$this->id]);
log_info("core-user", 'Set email for '.$this->name);
}
/**
* Get a snippet of HTML which will render the user's avatar, be that
* a local file, a remote file, a gravatar, a something else, etc.
*/
public function get_avatar_html(): string
{
// FIXME: configurable
global $config;
if ($config->get_string("avatar_host") === "gravatar") {
if (!empty($this->email)) {
$hash = md5(strtolower($this->email));
$s = $config->get_string("avatar_gravatar_size");
$d = urlencode($config->get_string("avatar_gravatar_default"));
$r = $config->get_string("avatar_gravatar_rating");
$cb = date("Y-m-d");
return "<img alt='avatar' class=\"avatar gravatar\" src=\"https://www.gravatar.com/avatar/$hash.jpg?s=$s&d=$d&r=$r&cacheBreak=$cb\">";
}
}
return "";
}
/**
* Get an auth token to be used in POST forms
*
* password = secret, avoid storing directly
* passhash = bcrypt(password), so someone who gets to the database can't get passwords
* sesskey = md5(passhash . IP), so if it gets sniffed it can't be used from another IP,
* and it can't be used to get the passhash to generate new sesskeys
* authtok = md5(sesskey, salt), presented to the user in web forms, to make sure that
* the form was generated within the session. Salted and re-hashed so that
* reading a web page from the user's cache doesn't give access to the session key
*/
public function get_auth_token(): string
{
global $config;
$salt = DATABASE_DSN;
$addr = get_session_ip($config);
return md5(md5($this->passhash . $addr) . "salty-csrf-" . $salt);
}
public function get_auth_html(): string
{
$at = $this->get_auth_token();
return '<input type="hidden" name="auth_token" value="'.$at.'">';
}
public function check_auth_token(): bool
{
if (defined("UNITTEST")) {
return true;
}
return (isset($_POST["auth_token"]) && $_POST["auth_token"] == $this->get_auth_token());
}
public function ensure_authed(): void
{
if (!$this->check_auth_token()) {
die("Invalid auth token");
}
}
}

211
core/userclass.php Normal file
View File

@ -0,0 +1,211 @@
<?php declare(strict_types=1);
/**
* @global UserClass[] $_shm_user_classes
*/
global $_shm_user_classes;
$_shm_user_classes = [];
/**
* Class UserClass
*/
class UserClass
{
/**
* @var ?string
*/
public $name = null;
/**
* @var ?UserClass
*/
public $parent = null;
/**
* @var array
*/
public $abilities = [];
public function __construct(string $name, string $parent = null, array $abilities = [])
{
global $_shm_user_classes;
$this->name = $name;
$this->abilities = $abilities;
if (!is_null($parent)) {
$this->parent = $_shm_user_classes[$parent];
}
$_shm_user_classes[$name] = $this;
}
/**
* Determine if this class of user can perform an action or has ability.
*
* @throws SCoreException
*/
public function can(string $ability): bool
{
if (array_key_exists($ability, $this->abilities)) {
return $this->abilities[$ability];
} elseif (!is_null($this->parent)) {
return $this->parent->can($ability);
} else {
global $_shm_user_classes;
$min_dist = 9999;
$min_ability = null;
foreach ($_shm_user_classes['base']->abilities as $a => $cando) {
$v = levenshtein($ability, $a);
if ($v < $min_dist) {
$min_dist = $v;
$min_ability = $a;
}
}
throw new SCoreException("Unknown ability '$ability'. Did the developer mean '$min_ability'?");
}
}
}
$_all_false = [];
foreach ((new ReflectionClass('Permissions'))->getConstants() as $k => $v) {
$_all_false[$v] = false;
}
new UserClass("base", null, $_all_false);
unset($_all_false);
// Ghost users can't do anything
new UserClass("ghost", "base", [
]);
// Anonymous users can't do anything by default, but
// the admin might grant them some permissions
new UserClass("anonymous", "base", [
Permissions::CREATE_USER => true,
]);
new UserClass("user", "base", [
Permissions::BIG_SEARCH => true,
Permissions::CREATE_IMAGE => true,
Permissions::CREATE_COMMENT => true,
Permissions::EDIT_IMAGE_TAG => true,
Permissions::EDIT_IMAGE_SOURCE => true,
Permissions::EDIT_IMAGE_TITLE => true,
Permissions::EDIT_IMAGE_RELATIONSHIPS => true,
Permissions::EDIT_IMAGE_ARTIST => true,
Permissions::CREATE_IMAGE_REPORT => true,
Permissions::EDIT_IMAGE_RATING => true,
Permissions::EDIT_FAVOURITES => true,
Permissions::SEND_PM => true,
Permissions::READ_PM => true,
Permissions::SET_PRIVATE_IMAGE => true,
Permissions::BULK_DOWNLOAD => true,
]);
new UserClass("hellbanned", "user", [
Permissions::HELLBANNED => true,
]);
new UserClass("admin", "base", [
Permissions::CHANGE_SETTING => true,
Permissions::OVERRIDE_CONFIG => true,
Permissions::BIG_SEARCH => true,
Permissions::MANAGE_EXTENSION_LIST => true,
Permissions::MANAGE_ALIAS_LIST => true,
Permissions::MANAGE_AUTO_TAG => true,
Permissions::MASS_TAG_EDIT => true,
Permissions::VIEW_IP => true,
Permissions::BAN_IP => true,
Permissions::CREATE_USER => true,
Permissions::CREATE_OTHER_USER => true,
Permissions::EDIT_USER_NAME => true,
Permissions::EDIT_USER_PASSWORD => true,
Permissions::EDIT_USER_INFO => true,
Permissions::EDIT_USER_CLASS => true,
Permissions::DELETE_USER => true,
Permissions::CREATE_COMMENT => true,
Permissions::DELETE_COMMENT => true,
Permissions::BYPASS_COMMENT_CHECKS => true,
Permissions::REPLACE_IMAGE => true,
Permissions::CREATE_IMAGE => true,
Permissions::EDIT_IMAGE_TAG => true,
Permissions::EDIT_IMAGE_SOURCE => true,
Permissions::EDIT_IMAGE_OWNER => true,
Permissions::EDIT_IMAGE_LOCK => true,
Permissions::EDIT_IMAGE_TITLE => true,
Permissions::EDIT_IMAGE_RELATIONSHIPS => true,
Permissions::EDIT_IMAGE_ARTIST => true,
Permissions::BULK_EDIT_IMAGE_TAG => true,
Permissions::BULK_EDIT_IMAGE_SOURCE => true,
Permissions::DELETE_IMAGE => true,
Permissions::BAN_IMAGE => true,
Permissions::VIEW_EVENTLOG => true,
Permissions::IGNORE_DOWNTIME => true,
Permissions::VIEW_REGISTRATIONS => true,
Permissions::CREATE_IMAGE_REPORT => true,
Permissions::VIEW_IMAGE_REPORT => true,
Permissions::WIKI_ADMIN => true,
Permissions::EDIT_WIKI_PAGE => true,
Permissions::DELETE_WIKI_PAGE => true,
Permissions::MANAGE_BLOCKS => true,
Permissions::MANAGE_ADMINTOOLS => true,
Permissions::SEND_PM => true,
Permissions::READ_PM => true,
Permissions::VIEW_OTHER_PMS => true, # hm
Permissions::EDIT_FEATURE => true,
Permissions::BULK_EDIT_VOTE => true,
Permissions::EDIT_OTHER_VOTE => true,
Permissions::VIEW_SYSINTO => true,
Permissions::HELLBANNED => false,
Permissions::VIEW_HELLBANNED => true,
Permissions::PROTECTED => true,
Permissions::EDIT_IMAGE_RATING => true,
Permissions::BULK_EDIT_IMAGE_RATING => true,
Permissions::VIEW_TRASH => true,
Permissions::PERFORM_BULK_ACTIONS => true,
Permissions::BULK_ADD => true,
Permissions::EDIT_FILES => true,
Permissions::EDIT_TAG_CATEGORIES => true,
Permissions::RESCAN_MEDIA => true,
Permissions::SEE_IMAGE_VIEW_COUNTS => true,
Permissions::EDIT_FAVOURITES => true,
Permissions::ARTISTS_ADMIN => true,
Permissions::BLOTTER_ADMIN => true,
Permissions::FORUM_ADMIN => true,
Permissions::NOTES_ADMIN => true,
Permissions::POOLS_ADMIN => true,
Permissions::TIPS_ADMIN => true,
Permissions::CRON_ADMIN => true,
Permissions::APPROVE_IMAGE => true,
Permissions::APPROVE_COMMENT => true,
Permissions::BULK_IMPORT =>true,
Permissions::BULK_EXPORT =>true,
Permissions::BULK_DOWNLOAD => true,
Permissions::SET_PRIVATE_IMAGE => true,
Permissions::SET_OTHERS_PRIVATE_IMAGES => true,
]);
@include_once "data/config/user-classes.conf.php";

View File

@ -1,197 +0,0 @@
<?php
function html_escape($input) {
return htmlentities($input);
}
function int_escape($input) {
return (int)$input;
}
function sql_escape($input) {
global $database;
return $database->db->Quote($input);
}
function make_link($page, $query=null) {
global $config;
$base = $config->get_string('base_href');
if(is_null($query)) {
return "$base/$page";
}
else {
if(strpos($base, "?")) {
return "$base/$page&$query";
}
else {
return "$base/$page?$query";
}
}
}
function parse_shorthand_int($limit) {
if(is_numeric($limit)) {
return (int)$limit;
}
if(preg_match('/^([\d\.]+)([gmk])?b?$/i', "$limit", $m)) {
$value = $m[1];
if (isset($m[2])) {
switch(strtolower($m[2])) {
case 'g': $value *= 1024; # fallthrough
case 'm': $value *= 1024; # fallthrough
case 'k': $value *= 1024; break;
default: $value = -1;
}
}
return (int)$value;
} else {
return -1;
}
}
function to_shorthand_int($int) {
if($int >= pow(1024, 3)) {
return sprintf("%.1fGB", $int / pow(1024, 3));
}
else if($int >= pow(1024, 2)) {
return sprintf("%.1fMB", $int / pow(1024, 2));
}
else if($int >= 1024) {
return sprintf("%.1fKB", $int / 1024);
}
else {
return "$int";
}
}
function bbcode2html($text) {
$text = trim($text);
$text = html_escape($text);
# $text = preg_replace("/\[b\](.*?)\[\/b\]/s", "<b>\\1</b>", $text);
# $text = preg_replace("/\[i\](.*?)\[\/i\]/s", "<i>\\1</i>", $text);
# $text = preg_replace("/\[u\](.*?)\[\/u\]/s", "<u>\\1</u>", $text);
$text = str_replace("\n", "\n<br>", $text);
return $text;
}
function tag_explode($tags) {
if(is_string($tags)) {
$tags = explode(' ', $tags);
}
else if(is_array($tags)) {
// do nothing
}
else {
die("tag_explode only takes strings or arrays");
}
$tags = array_map("trim", $tags);
foreach($tags as $tag) {
if(is_string($tag) && strlen($tag) > 0) {
$tag_array[] = $tag;
}
}
if(count($tag_array) == 0) {
$tag_array = array("tagme");
}
return $tag_array;
}
# $db is the connection object
function CountExecs($db, $sql, $inputarray) {
global $_execs;
# $fp = fopen("sql.log", "a");
# fwrite($fp, preg_replace('/\s+/msi', ' ', $sql)."\n");
# fclose($fp);
if (!is_array($inputarray)) $_execs++;
# handle 2-dimensional input arrays
else if (is_array(reset($inputarray))) $_execs += sizeof($inputarray);
else $_execs++;
# in PHP4.4 and PHP5, we need to return a value by reference
$null = null; return $null;
}
// internal things
$_event_listeners = array();
function add_event_listener($block, $pos=50) {
global $_event_listeners;
while(isset($_event_listeners[$pos])) {
$pos++;
}
$_event_listeners[$pos] = $block;
}
function send_event($event) {
global $_event_listeners;
foreach($_event_listeners as $listener) {
$listener->receive_event($event);
}
}
function _get_query_parts() {
if(isset($_GET["q"])) {
$path = $_GET["q"];
}
else if(isset($_SERVER["PATH_INFO"])) {
$path = $_SERVER["PATH_INFO"];
}
else {
$path = "index/1";
}
while(strlen($path) > 0 && $path[0] == '/') {
$path = substr($path, 1);
}
return split('/', $path);
}
function get_page_request() {
$args = _get_query_parts();
if(count($args) == 0) {
$page = "index";
$args = array();
}
else if(count($args) == 1) {
$page = (strlen($args[0]) > 0 ? $args[0] : "index");
$args = array();
}
else {
$page = $args[0];
$args = array_slice($args, 1);
}
return new PageRequestEvent($page, $args);
}
function get_user() {
global $database;
global $config;
$user = null;
if(isset($_COOKIE["shm_user"]) && isset($_COOKIE["shm_session"])) {
$tmp_user = $database->get_user_session($_COOKIE["shm_user"], $_COOKIE["shm_session"]);
if(!is_null($tmp_user) && $tmp_user->is_enabled()) {
$user = $tmp_user;
}
}
if(is_null($user)) {
$user = $database->get_user($config->get_int("anon_id"));
}
return $user;
}
?>

799
core/util.php Normal file
View File

@ -0,0 +1,799 @@
<?php declare(strict_types=1);
use function MicroHTML\emptyHTML;
use function MicroHTML\rawHTML;
use function MicroHTML\FORM;
use function MicroHTML\INPUT;
use function MicroHTML\DIV;
use function MicroHTML\PRE;
use function MicroHTML\P;
use function MicroHTML\TABLE;
use function MicroHTML\THEAD;
use function MicroHTML\TFOOT;
use function MicroHTML\TR;
use function MicroHTML\TH;
use function MicroHTML\TD;
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
* Misc *
\* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
const DATA_DIR = "data";
function mtimefile(string $file): string
{
$data_href = get_base_href();
$mtime = filemtime($file);
return "$data_href/$file?$mtime";
}
function get_theme(): string
{
global $config;
$theme = $config->get_string(SetupConfig::THEME, "default");
if (!file_exists("themes/$theme")) {
$theme = "default";
}
return $theme;
}
function contact_link(): ?string
{
global $config;
$text = $config->get_string('contact_link');
if (is_null($text)) {
return null;
}
if (
startsWith($text, "http:") ||
startsWith($text, "https:") ||
startsWith($text, "mailto:")
) {
return $text;
}
if (strpos($text, "@")) {
return "mailto:$text";
}
if (strpos($text, "/")) {
return "http://$text";
}
return $text;
}
/**
* Check if HTTPS is enabled for the server.
*/
function is_https_enabled(): bool
{
return (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off');
}
/**
* Compare two Block objects, used to sort them before being displayed
*/
function blockcmp(Block $a, Block $b): int
{
if ($a->position == $b->position) {
return 0;
} else {
return ($a->position > $b->position) ? 1 : -1;
}
}
/**
* Figure out PHP's internal memory limit
*/
function get_memory_limit(): int
{
global $config;
// thumbnail generation requires lots of memory
$default_limit = 8*1024*1024; // 8 MB of memory is PHP's default.
$shimmie_limit = $config->get_int(MediaConfig::MEM_LIMIT);
if ($shimmie_limit < 3*1024*1024) {
// we aren't going to fit, override
$shimmie_limit = $default_limit;
}
/*
Get PHP's configured memory limit.
Note that this is set to -1 for NO memory limit.
https://ca2.php.net/manual/en/ini.core.php#ini.memory-limit
*/
$memory = parse_shorthand_int(ini_get("memory_limit"));
if ($memory == -1) {
// No memory limit.
// Return the larger of the set limits.
return max($shimmie_limit, $default_limit);
} else {
// PHP has a memory limit set.
if ($shimmie_limit > $memory) {
// Shimmie wants more memory than what PHP is currently set for.
// Attempt to set PHP's memory limit.
if (ini_set("memory_limit", "$shimmie_limit") === false) {
/* We can't change PHP's limit, oh well, return whatever its currently set to */
return $memory;
}
$memory = parse_shorthand_int(ini_get("memory_limit"));
}
// PHP's memory limit is more than Shimmie needs.
return $memory; // return the current setting
}
}
/**
* Check if PHP has the GD library installed
*/
function check_gd_version(): int
{
$gdversion = 0;
if (function_exists('gd_info')) {
$gd_info = gd_info();
if (substr_count($gd_info['GD Version'], '2.')) {
$gdversion = 2;
} elseif (substr_count($gd_info['GD Version'], '1.')) {
$gdversion = 1;
}
}
return $gdversion;
}
/**
* Check whether ImageMagick's `convert` command
* is installed and working
*/
function check_im_version(): int
{
$convert_check = exec("convert");
return (empty($convert_check) ? 0 : 1);
}
/**
* Get the currently active IP, masked to make it not change when the last
* octet or two change, for use in session cookies and such
*/
function get_session_ip(Config $config): string
{
$mask = $config->get_string("session_hash_mask", "255.255.0.0");
$addr = $_SERVER['REMOTE_ADDR'];
$addr = inet_ntop(inet_pton($addr) & inet_pton($mask));
return $addr;
}
/**
* A shorthand way to send a TextFormattingEvent and get the results.
*/
function format_text(string $string): string
{
$tfe = send_event(new TextFormattingEvent($string));
return $tfe->formatted;
}
/**
* Generates the path to a file under the data folder based on the file's hash.
* This process creates subfolders based on octet pairs from the file's hash.
* The calculated folder follows this pattern data/$base/octet_pairs/$hash
* @param string $base
* @param string $hash
* @param bool $create
* @param int $splits The number of octet pairs to split the hash into. Caps out at strlen($hash)/2.
* @return string
*/
function warehouse_path(string $base, string $hash, bool $create=true, int $splits = WH_SPLITS): string
{
$dirs =[DATA_DIR, $base];
$splits = min($splits, strlen($hash) / 2);
for ($i = 0; $i < $splits; $i++) {
$dirs[] = substr($hash, $i * 2, 2);
}
$dirs[] = $hash;
$pa = join_path(...$dirs);
if ($create && !file_exists(dirname($pa))) {
mkdir(dirname($pa), 0755, true);
}
return $pa;
}
/**
* Determines the path to the specified file in the data folder.
*/
function data_path(string $filename, bool $create = true): string
{
$filename = join_path("data", $filename);
if ($create&&!file_exists(dirname($filename))) {
mkdir(dirname($filename), 0755, true);
}
return $filename;
}
function load_balance_url(string $tmpl, string $hash, int $n=0): string
{
static $flexihashes = [];
$matches = [];
if (preg_match("/(.*){(.*)}(.*)/", $tmpl, $matches)) {
$pre = $matches[1];
$opts = $matches[2];
$post = $matches[3];
if (isset($flexihashes[$opts])) {
$flexihash = $flexihashes[$opts];
} else {
$flexihash = new Flexihash\Flexihash();
foreach (explode(",", $opts) as $opt) {
$parts = explode("=", $opt);
$parts_count = count($parts);
$opt_val = "";
$opt_weight = 0;
if ($parts_count === 2) {
$opt_val = $parts[0];
$opt_weight = $parts[1];
} elseif ($parts_count === 1) {
$opt_val = $parts[0];
$opt_weight = 1;
}
$flexihash->addTarget($opt_val, $opt_weight);
}
$flexihashes[$opts] = $flexihash;
}
// $choice = $flexihash->lookup($pre.$post);
$choices = $flexihash->lookupList($hash, $n + 1); // hash doesn't change
$choice = $choices[$n];
$tmpl = $pre . $choice . $post;
}
return $tmpl;
}
function transload(string $url, string $mfile): ?array
{
global $config;
if ($config->get_string("transload_engine") === "curl" && function_exists("curl_init")) {
$ch = curl_init($url);
$fp = fopen($mfile, "w");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_REFERER, $url);
curl_setopt($ch, CURLOPT_USERAGENT, "Shimmie-".VERSION);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$response = curl_exec($ch);
if ($response === false) {
log_warning("core-util", "Failed to transload $url");
throw new SCoreException("Failed to fetch $url");
}
$header_size = curl_getinfo($ch, CURLINFO_HEADER_SIZE);
$headers = http_parse_headers(implode("\n", preg_split('/\R/', rtrim(substr($response, 0, $header_size)))));
$body = substr($response, $header_size);
curl_close($ch);
fwrite($fp, $body);
fclose($fp);
return $headers;
}
if ($config->get_string("transload_engine") === "wget") {
$s_url = escapeshellarg($url);
$s_mfile = escapeshellarg($mfile);
system("wget --no-check-certificate $s_url --output-document=$s_mfile");
return file_exists($mfile) ? ["ok"=>"true"] : null;
}
if ($config->get_string("transload_engine") === "fopen") {
$fp_in = @fopen($url, "r");
$fp_out = fopen($mfile, "w");
if (!$fp_in || !$fp_out) {
return null;
}
$length = 0;
while (!feof($fp_in) && $length <= $config->get_int('upload_size')) {
$data = fread($fp_in, 8192);
$length += strlen($data);
fwrite($fp_out, $data);
}
fclose($fp_in);
fclose($fp_out);
$headers = http_parse_headers(implode("\n", $http_response_header));
return $headers;
}
return null;
}
function path_to_tags(string $path): string
{
$matches = [];
$tags = [];
if (preg_match("/\d+ - (.+)\.([a-zA-Z0-9]+)/", basename($path), $matches)) {
$tags = explode(" ", $matches[1]);
}
$path = dirname($path);
$path = str_replace(";", ":", $path);
$path = str_replace("__", " ", $path);
$category = "";
foreach (explode("/", $path) as $dir) {
$category_to_inherit = "";
foreach (explode(" ", $dir) as $tag) {
$tag = trim($tag);
if ($tag=="") {
continue;
}
if (substr_compare($tag, ":", -1) === 0) {
// This indicates a tag that ends in a colon,
// which is for inheriting to tags on the subfolder
$category_to_inherit = $tag;
} else {
if ($category!=""&&strpos($tag, ":") === false) {
// This indicates that category inheritance is active,
// and we've encountered a tag that does not specify a category.
// So we attach the inherited category to the tag.
$tag = $category.$tag;
}
$tags[] = $tag;
}
}
// Category inheritance only works on the immediate subfolder,
// so we hold a category until the next iteration, and then set
// it back to an empty string after that iteration
$category = $category_to_inherit;
}
return implode(" ", $tags);
}
function join_url(string $base, string ...$paths)
{
$output = $base;
foreach ($paths as $path) {
$output = rtrim($output, "/");
$path = ltrim($path, "/");
$output .= "/".$path;
}
return $output;
}
function get_dir_contents(string $dir): array
{
assert(!empty($dir));
if (!is_dir($dir)) {
return [];
}
return array_diff(
scandir(
$dir
),
['..', '.']
);
}
function remove_empty_dirs(string $dir): bool
{
assert(!empty($dir));
$result = true;
if (!is_dir($dir)) {
return false;
}
$items = array_diff(
scandir(
$dir
),
['..', '.']
);
foreach ($items as $item) {
$path = join_path($dir, $item);
if (is_dir($path)) {
$result = $result && remove_empty_dirs($path);
} else {
$result = false;
}
}
if ($result===true) {
$result = $result && rmdir($dir);
}
return $result;
}
function get_files_recursively(string $dir): array
{
assert(!empty($dir));
if (!is_dir($dir)) {
return [];
}
$things = array_diff(
scandir(
$dir
),
['..', '.']
);
$output = [];
foreach ($things as $thing) {
$path = join_path($dir, $thing);
if (is_file($path)) {
$output[] = $path;
} else {
$output = array_merge($output, get_files_recursively($path));
}
}
return $output;
}
/**
* Returns amount of files & total size of dir.
*/
function scan_dir(string $path): array
{
$bytestotal = 0;
$nbfiles = 0;
$ite = new RecursiveDirectoryIterator(
$path,
FilesystemIterator::KEY_AS_PATHNAME |
FilesystemIterator::CURRENT_AS_FILEINFO |
FilesystemIterator::SKIP_DOTS
);
foreach (new RecursiveIteratorIterator($ite) as $filename => $cur) {
try {
$filesize = $cur->getSize();
$bytestotal += $filesize;
$nbfiles++;
} catch (RuntimeException $e) {
// This usually just means that the file got eaten by the import
continue;
}
}
$size_mb = $bytestotal / 1048576; // to mb
$size_mb = number_format($size_mb, 2, '.', '');
return ['path' => $path, 'total_files' => $nbfiles, 'total_mb' => $size_mb];
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
* Debugging functions *
\* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
// SHIT by default this returns the time as a string. And it's not even a
// string representation of a number, it's two numbers separated by a space.
// What the fuck were the PHP developers smoking.
$_shm_load_start = microtime(true);
/**
* Collects some debug information (execution time, memory usage, queries, etc)
* and formats it to stick in the footer of the page.
*/
function get_debug_info(): string
{
global $cache, $config, $_shm_event_count, $database, $_shm_load_start;
$i_mem = sprintf("%5.2f", ((memory_get_peak_usage(true)+512)/1024)/1024);
if ($config->get_string("commit_hash", "unknown") == "unknown") {
$commit = "";
} else {
$commit = " (".$config->get_string("commit_hash").")";
}
$time = sprintf("%.2f", microtime(true) - $_shm_load_start);
$dbtime = sprintf("%.2f", $database->dbtime);
$i_files = count(get_included_files());
$hits = $cache->get_hits();
$miss = $cache->get_misses();
$debug = "<br>Took $time seconds (db:$dbtime) and {$i_mem}MB of RAM";
$debug .= "; Used $i_files files and {$database->query_count} queries";
$debug .= "; Sent $_shm_event_count events";
$debug .= "; $hits cache hits and $miss misses";
$debug .= "; Shimmie version ". VERSION . $commit;
return $debug;
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
* Request initialisation stuff *
\* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/** @privatesection
* @noinspection PhpIncludeInspection
*/
function require_all(array $files): void
{
foreach ($files as $filename) {
require_once $filename;
}
}
function _load_core_files()
{
require_all(array_merge(
zglob("core/*.php"),
zglob("core/imageboard/*.php"),
zglob("ext/*/info.php")
));
}
function _load_theme_files()
{
require_all(_get_themelet_files(get_theme()));
}
function _set_up_shimmie_environment(): void
{
global $tracer_enabled;
if (file_exists("images") && !file_exists("data/images")) {
die_nicely("Upgrade error", "As of Shimmie 2.7 images and thumbs should be moved to data/images and data/thumbs");
}
if (TIMEZONE) {
date_default_timezone_set(TIMEZONE);
}
if (DEBUG) {
error_reporting(E_ALL);
}
// The trace system has a certain amount of memory consumption every time it is used,
// so to prevent running out of memory during complex operations code that uses it should
// check if tracer output is enabled before making use of it.
$tracer_enabled = constant('TRACE_FILE')!==null;
}
function _get_themelet_files(string $_theme): array
{
$base_themelets = [];
$base_themelets[] = 'themes/'.$_theme.'/page.class.php';
$base_themelets[] = 'themes/'.$_theme.'/themelet.class.php';
$ext_themelets = zglob("ext/{".Extension::get_enabled_extensions_as_string()."}/theme.php");
$custom_themelets = zglob('themes/'.$_theme.'/{'.Extension::get_enabled_extensions_as_string().'}.theme.php');
return array_merge($base_themelets, $ext_themelets, $custom_themelets);
}
/**
* Used to display fatal errors to the web user.
* @noinspection PhpPossiblePolymorphicInvocationInspection
*/
function _fatal_error(Exception $e): void
{
$version = VERSION;
$message = $e->getMessage();
$phpver = phpversion();
$query = is_subclass_of($e, "SCoreException") ? $e->query : null;
//$hash = exec("git rev-parse HEAD");
//$h_hash = $hash ? "<p><b>Hash:</b> $hash" : "";
//'.$h_hash.'
if (PHP_SAPI === 'cli' || PHP_SAPI == 'phpdbg') {
print("Trace: ");
$t = array_reverse($e->getTrace());
foreach ($t as $n => $f) {
$c = $f['class'] ?? '';
$t = $f['type'] ?? '';
$a = implode(", ", array_map("stringer", $f['args']));
print("$n: {$f['file']}({$f['line']}): {$c}{$t}{$f['function']}({$a})\n");
}
print("Message: $message\n");
if ($query) {
print("Query: {$query}\n");
}
print("Version: $version (on $phpver)\n");
} else {
$q = $query ? "" : "<p><b>Query:</b> " . html_escape($query);
header("HTTP/1.0 500 Internal Error");
echo '
<!doctype html>
<html lang="en">
<head>
<title>Internal error - SCore-'.$version.'</title>
</head>
<body>
<h1>Internal Error</h1>
<p><b>Message:</b> '.html_escape($message).'
'.$q.'
<p><b>Version:</b> '.$version.' (on '.$phpver.')
<p><b>Stack Trace:</b></p><pre>'.$e->getTraceAsString().'</pre>
</body>
</html>
';
}
}
function _get_user(): User
{
global $config, $page;
$my_user = null;
if ($page->get_cookie("user") && $page->get_cookie("session")) {
$tmp_user = User::by_session($page->get_cookie("user"), $page->get_cookie("session"));
if (!is_null($tmp_user)) {
$my_user = $tmp_user;
}
}
if (is_null($my_user)) {
$my_user = User::by_id($config->get_int("anon_id", 0));
}
assert(!is_null($my_user));
return $my_user;
}
function _get_query(): string
{
return (@$_POST["q"]?:@$_GET["q"])?:"/";
}
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
* HTML Generation *
\* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/**
* Give a HTML string which shows an IP (if the user is allowed to see IPs),
* and a link to ban that IP (if the user is allowed to ban IPs)
*
* FIXME: also check that IP ban ext is installed
*/
function show_ip(string $ip, string $ban_reason): string
{
global $user;
$u_reason = url_escape($ban_reason);
$u_end = url_escape("+1 week");
$ban = $user->can(Permissions::BAN_IP) ? ", <a href='".make_link("ip_ban/list", "c_ip=$ip&c_reason=$u_reason&c_expires=$u_end", "create")."'>Ban</a>" : "";
$ip = $user->can(Permissions::VIEW_IP) ? $ip.$ban : "";
return $ip;
}
/**
* Make a form tag with relevant auth token and stuff
*/
function make_form(string $target, string $method="POST", bool $multipart=false, string $form_id="", string $onsubmit=""): string
{
global $user;
if ($method == "GET") {
$link = html_escape($target);
$target = make_link($target);
$extra_inputs = "<input type='hidden' name='q' value='$link'>";
} else {
$extra_inputs = $user->get_auth_html();
}
$extra = empty($form_id) ? '' : 'id="'. $form_id .'"';
if ($multipart) {
$extra .= " enctype='multipart/form-data'";
}
if ($onsubmit) {
$extra .= ' onsubmit="'.$onsubmit.'"';
}
return '<form action="'.$target.'" method="'.$method.'" '.$extra.'>'.$extra_inputs;
}
function SHM_FORM(string $target, string $method="POST", bool $multipart=false, string $form_id="", string $onsubmit="")
{
global $user;
$attrs = [
"action"=>make_link($target),
"method"=>$method
];
if ($form_id) {
$attrs["id"] = $form_id;
}
if ($multipart) {
$attrs["enctype"] = 'multipart/form-data';
}
if ($onsubmit) {
$attrs["onsubmit"] = $onsubmit;
}
return FORM(
$attrs,
INPUT(["type"=>"hidden", "name"=>"q", "value"=>$target]),
$method == "GET" ? "" : rawHTML($user->get_auth_html())
);
}
function SHM_SIMPLE_FORM($target, ...$children)
{
$form = SHM_FORM($target);
$form->appendChild(emptyHTML(...$children));
return $form;
}
function SHM_SUBMIT(string $text)
{
return INPUT(["type"=>"submit", "value"=>$text]);
}
function SHM_COMMAND_EXAMPLE(string $ex, string $desc)
{
return DIV(
["class"=>"command_example"],
PRE($ex),
P($desc)
);
}
function SHM_USER_FORM(User $duser, string $target, string $title, $body, $foot)
{
if (is_string($foot)) {
$foot = TFOOT(TR(TD(["colspan"=>"2"], INPUT(["type"=>"submit", "value"=>$foot]))));
}
return SHM_SIMPLE_FORM(
$target,
P(
INPUT(["type"=>'hidden', "name"=>'id', "value"=>$duser->id]),
TABLE(
["class"=>"form"],
THEAD(TR(TH(["colspan"=>"2"], $title))),
$body,
$foot
)
)
);
}
const BYTE_DENOMINATIONS = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
function human_filesize(int $bytes, $decimals = 2)
{
$factor = floor((strlen(strval($bytes)) - 1) / 3);
return sprintf("%.{$decimals}f", $bytes / pow(1024, $factor)) . @BYTE_DENOMINATIONS[$factor];
}
/*
* Generates a unique key for the website to prevent unauthorized access.
*/
function generate_key(int $length = 20)
{
$characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
$randomString = '';
for ($i = 0; $i < $length; $i++) {
$randomString .= $characters [rand(0, strlen($characters) - 1)];
}
return $randomString;
}

23
ext/admin/info.php Normal file
View File

@ -0,0 +1,23 @@
<?php declare(strict_types=1);
class AdminPageInfo extends ExtensionInfo
{
public const KEY = "admin";
public $key = self::KEY;
public $name = "Admin Controls";
public $url = self::SHIMMIE_URL;
public $authors = self::SHISH_AUTHOR;
public $license = self::LICENSE_GPLV2;
public $description = "Various things to make admins' lives easier";
public $documentation =
"Various moderate-level tools for admins; for advanced, obscure, and possibly dangerous tools see the shimmie2-utils script set
<p>Lowercase all tags:
<br>Set all tags to lowercase for consistency
<p>Recount tag use:
<br>If the counts of images per tag get messed up somehow, this will reset them, and remove any unused tags
<p>Database dump:
<br>Download the contents of the database in plain text format, useful for backups.
<p>Image dump:
<br>Download all the images as a .zip file (Requires ZipArchive)";
}

194
ext/admin/main.php Normal file
View File

@ -0,0 +1,194 @@
<?php /** @noinspection PhpUnusedPrivateMethodInspection */
declare(strict_types=1);
/**
* Sent when the admin page is ready to be added to
*/
class AdminBuildingEvent extends Event
{
/** @var Page */
public $page;
public function __construct(Page $page)
{
parent::__construct();
$this->page = $page;
}
}
class AdminActionEvent extends Event
{
/** @var string */
public $action;
/** @var bool */
public $redirect = true;
public function __construct(string $action)
{
parent::__construct();
$this->action = $action;
}
}
class AdminPage extends Extension
{
/** @var AdminPageTheme */
protected $theme;
public function onPageRequest(PageRequestEvent $event)
{
global $page, $user;
if ($event->page_matches("admin")) {
if (!$user->can(Permissions::MANAGE_ADMINTOOLS)) {
$this->theme->display_permission_denied();
} else {
if ($event->count_args() == 0) {
send_event(new AdminBuildingEvent($page));
} else {
$action = $event->get_arg(0);
$aae = new AdminActionEvent($action);
if ($user->check_auth_token()) {
log_info("admin", "Util: $action");
set_time_limit(0);
send_event($aae);
}
if ($aae->redirect) {
$page->set_mode(PageMode::REDIRECT);
$page->set_redirect(make_link("admin"));
}
}
}
}
}
public function onCommand(CommandEvent $event)
{
if ($event->cmd == "help") {
print "\tget-page <query string>\n";
print "\t\teg 'get-page post/list'\n\n";
print "\tpost-page <query string> <urlencoded params>\n";
print "\t\teg 'post-page ip_ban/delete id=1'\n\n";
print "\tget-token\n";
print "\t\tget a CSRF auth token\n\n";
print "\tregen-thumb <id / hash>\n";
print "\t\tregenerate a thumbnail\n\n";
print "\tcache [get|set|del] [key] <value>\n";
print "\t\teg 'cache get config'\n\n";
}
if ($event->cmd == "get-page") {
global $page;
if (isset($event->args[1])) {
parse_str($event->args[1], $_GET);
}
send_event(new PageRequestEvent($event->args[0]));
$page->display();
}
if ($event->cmd == "post-page") {
global $page;
$_SERVER['REQUEST_METHOD'] = "POST";
if (isset($event->args[1])) {
parse_str($event->args[1], $_POST);
}
send_event(new PageRequestEvent($event->args[0]));
$page->display();
}
if ($event->cmd == "get-token") {
global $user;
print($user->get_auth_token());
}
if ($event->cmd == "regen-thumb") {
$uid = $event->args[0];
$image = Image::by_id_or_hash($uid);
if ($image) {
send_event(new ThumbnailGenerationEvent($image->hash, $image->ext, true));
} else {
print("No post with ID '$uid'\n");
}
}
if ($event->cmd == "cache") {
global $cache;
$cmd = $event->args[0];
$key = $event->args[1];
switch ($cmd) {
case "get":
var_dump($cache->get($key));
break;
case "set":
$cache->set($key, $event->args[2], 60);
break;
case "del":
$cache->delete($key);
break;
}
}
}
public function onAdminBuilding(AdminBuildingEvent $event)
{
$this->theme->display_page();
$this->theme->display_form();
}
public function onPageSubNavBuilding(PageSubNavBuildingEvent $event)
{
global $user;
if ($event->parent==="system") {
if ($user->can(Permissions::MANAGE_ADMINTOOLS)) {
$event->add_nav_link("admin", new Link('admin'), "Board Admin");
}
}
}
public function onUserBlockBuilding(UserBlockBuildingEvent $event)
{
global $user;
if ($user->can(Permissions::MANAGE_ADMINTOOLS)) {
$event->add_link("Board Admin", make_link("admin"));
}
}
public function onAdminAction(AdminActionEvent $event)
{
$action = $event->action;
if (method_exists($this, $action)) {
$event->redirect = $this->$action();
}
}
private function set_tag_case()
{
global $database;
$database->execute(
"UPDATE tags SET tag=:tag1 WHERE LOWER(tag) = LOWER(:tag2)",
["tag1" => $_POST['tag'], "tag2" => $_POST['tag']]
);
log_info("admin", "Fixed the case of {$_POST['tag']}", "Fixed case");
return true;
}
private function lowercase_all_tags()
{
global $database;
$database->execute("UPDATE tags SET tag=lower(tag)");
log_warning("admin", "Set all tags to lowercase", "Set all tags to lowercase");
return true;
}
private function recount_tag_use()
{
global $database;
$database->Execute("
UPDATE tags
SET count = COALESCE(
(SELECT COUNT(image_id) FROM image_tags WHERE tag_id=tags.id GROUP BY tag_id),
0
)
");
$database->Execute("DELETE FROM tags WHERE count=0");
log_warning("admin", "Re-counted tags", "Re-counted tags");
return true;
}
}

18
ext/admin/style.css Normal file
View File

@ -0,0 +1,18 @@
.admin {
padding: 4px;
border-radius: 4px;
background: green;
margin: 6px;
width: 200px;
display: inline-block;
}
.admin.protected {
background: red;
}
.admin INPUT[type="submit"] {
width: 100%;
}
.admin.protected INPUT[type="submit"] {
width: 90%;
}

89
ext/admin/test.php Normal file
View File

@ -0,0 +1,89 @@
<?php declare(strict_types=1);
class AdminPageTest extends ShimmiePHPUnitTestCase
{
public function testAuth()
{
send_event(new UserLoginEvent(User::by_name(self::$anon_name)));
$page = $this->get_page('admin');
$this->assertEquals(403, $page->code);
$this->assertEquals("Permission Denied", $page->title);
send_event(new UserLoginEvent(User::by_name(self::$user_name)));
$page = $this->get_page('admin');
$this->assertEquals(403, $page->code);
$this->assertEquals("Permission Denied", $page->title);
send_event(new UserLoginEvent(User::by_name(self::$admin_name)));
$page = $this->get_page('admin');
$this->assertEquals(200, $page->code);
$this->assertEquals("Admin Tools", $page->title);
}
public function testLowercaseAndSetCase()
{
// Create a problem
$ts = time(); // we need a tag that hasn't been used before
send_event(new UserLoginEvent(User::by_name(self::$admin_name)));
$image_id_1 = $this->post_image("tests/pbx_screenshot.jpg", "TeStCase$ts");
// Validate problem
$page = $this->get_page("post/view/$image_id_1");
$this->assertEquals("Image $image_id_1: TeStCase$ts", $page->title);
// Fix
send_event(new AdminActionEvent('lowercase_all_tags'));
// Validate fix
$this->get_page("post/view/$image_id_1");
$this->assert_title("Image $image_id_1: testcase$ts");
// Change
$_POST["tag"] = "TestCase$ts";
send_event(new AdminActionEvent('set_tag_case'));
// Validate change
$this->get_page("post/view/$image_id_1");
$this->assert_title("Image $image_id_1: TestCase$ts");
}
# FIXME: make sure the admin tools actually work
public function testRecount()
{
global $database;
// Create a problem
$ts = time(); // we need a tag that hasn't been used before
send_event(new UserLoginEvent(User::by_name(self::$admin_name)));
$database->execute(
"INSERT INTO tags(tag, count) VALUES(:tag, :count)",
["tag"=>"tes$ts", "count"=>42]
);
// Fix
send_event(new AdminActionEvent('recount_tag_use'));
// Validate fix
$this->assertEquals(
0,
$database->get_one(
"SELECT count FROM tags WHERE tag = :tag",
["tag"=>"tes$ts"]
)
);
}
public function testCommands()
{
send_event(new UserLoginEvent(User::by_name(self::$admin_name)));
ob_start();
send_event(new CommandEvent(["index.php", "help"]));
send_event(new CommandEvent(["index.php", "get-page", "post/list"]));
send_event(new CommandEvent(["index.php", "post-page", "post/list", "foo=bar"]));
send_event(new CommandEvent(["index.php", "get-token"]));
send_event(new CommandEvent(["index.php", "regen-thumb", "42"]));
ob_end_clean();
// don't crash
$this->assertTrue(true);
}
}

54
ext/admin/theme.php Normal file
View File

@ -0,0 +1,54 @@
<?php declare(strict_types=1);
use function MicroHTML\INPUT;
class AdminPageTheme extends Themelet
{
/*
* Show the basics of a page, for other extensions to add to
*/
public function display_page()
{
global $page;
$page->set_title("Admin Tools");
$page->set_heading("Admin Tools");
$page->add_block(new NavBlock());
}
protected function button(string $name, string $action, bool $protected=false): string
{
$c_protected = $protected ? " protected" : "";
$html = make_form(make_link("admin/$action"), "POST", false, "admin$c_protected");
if ($protected) {
$html .= "<input type='submit' id='$action' value='$name' disabled='disabled'>";
$html .= "<input type='checkbox' onclick='$(\"#$action\").attr(\"disabled\", !$(this).is(\":checked\"))'>";
} else {
$html .= "<input type='submit' id='$action' value='$name'>";
}
$html .= "</form>\n";
return $html;
}
/*
* Show a form which links to admin_utils with POST[action] set to one of:
* 'lowercase all tags'
* 'recount tag use'
* etc
*/
public function display_form()
{
global $page;
$html = "";
$html .= $this->button("All tags to lowercase", "lowercase_all_tags", true);
$html .= $this->button("Recount tag use", "recount_tag_use", false);
$page->add_block(new Block("Misc Admin Tools", $html));
$html = (string)SHM_SIMPLE_FORM(
"admin/set_tag_case",
INPUT(["type"=>'text', "name"=>'tag', "placeholder"=>'Enter tag with correct case', "class"=>'autocomplete_tags', "autocomplete"=>'off']),
SHM_SUBMIT('Set Tag Case'),
);
$page->add_block(new Block("Set Tag Case", $html));
}
}

View File

@ -1,91 +0,0 @@
<?php
class AddAliasEvent extends Event {
var $oldtag;
var $newtag;
public function AddAliasEvent($oldtag, $newtag) {
$this->oldtag = $oldtag;
$this->newtag = $newtag;
}
}
class AliasEditor extends Extension {
// event handler {{{
public function receive_event($event) {
if(is_a($event, 'PageRequestEvent') && ($event->page == "alias")) {
global $user;
if($user->is_admin()) {
if($event->get_arg(0) == "add") {
if(isset($_POST['oldtag']) && isset($_POST['newtag'])) {
send_event(new AddAliasEvent($_POST['oldtag'], $_POST['newtag']));
}
}
else if($event->get_arg(0) == "remove") {
if(isset($_POST['oldtag'])) {
global $database;
$database->db->Execute("DELETE FROM aliases WHERE oldtag=?", array($_POST['oldtag']));
global $page;
$page->set_mode("redirect");
$page->set_redirect(make_link("admin"));
}
}
}
}
if(is_a($event, 'AdminBuildingEvent')) {
global $page;
$page->add_main_block(new Block("Edit Aliases", $this->build_aliases()));
}
if(is_a($event, 'AddAliasEvent')) {
global $database;
$database->db->Execute("INSERT INTO aliases(oldtag, newtag) VALUES(?, ?)", array($event->oldtag, $event->newtag));
global $page;
$page->set_mode("redirect");
$page->set_redirect(make_link("admin"));
}
}
// }}}
// admin page HTML {{{
private function build_aliases() {
global $database;
$h_aliases = "";
$aliases = $database->db->GetAssoc("SELECT oldtag, newtag FROM aliases");
foreach($aliases as $old => $new) {
$h_old = html_escape($old);
$h_new = html_escape($new);
$h_aliases .= "
<tr>
<td>$h_old</td>
<td>$h_new</td>
<td>
<form action='".make_link("alias/remove")."' method='POST'>
<input type='hidden' name='oldtag' value='$h_old'>
<input type='submit' value='Remove'>
</form>
</td>
</tr>
";
}
$html = "
<table border='1'>
<thead><td>From</td><td>To</td><td>Action</td></thead>
$h_aliases
<tr>
<form action='".make_link("alias/add")."' method='POST'>
<td><input type='text' name='oldtag'></td>
<td><input type='text' name='newtag'></td>
<td><input type='submit' value='Add'></td>
</form>
</tr>
</table>
";
return $html;
}
// }}}
}
add_event_listener(new AliasEditor());
?>

15
ext/alias_editor/info.php Normal file
View File

@ -0,0 +1,15 @@
<?php declare(strict_types=1);
class AliasEditorInfo extends ExtensionInfo
{
public const KEY = "alias_editor";
public $key = self::KEY;
public $name = "Alias Editor";
public $url = self::SHIMMIE_URL;
public $authors = self::SHISH_AUTHOR;
public $license = self::LICENSE_GPLV2;
public $description = "Edit the alias list";
public $documentation = 'The list is visible at <a href="$site/alias/list">/alias/list</a>; only site admins can edit it, other people can view and download it';
public $core = true;
}

209
ext/alias_editor/main.php Normal file
View File

@ -0,0 +1,209 @@
<?php declare(strict_types=1);
use MicroCRUD\ActionColumn;
use MicroCRUD\TextColumn;
use MicroCRUD\Table;
class AliasTable extends Table
{
public function __construct(\FFSPHP\PDO $db)
{
parent::__construct($db);
$this->table = "aliases";
$this->base_query = "SELECT * FROM aliases";
$this->primary_key = "oldtag";
$this->size = 100;
$this->limit = 1000000;
$this->set_columns([
new TextColumn("oldtag", "Old Tag"),
new TextColumn("newtag", "New Tag"),
new ActionColumn("oldtag"),
]);
$this->order_by = ["oldtag"];
$this->table_attrs = ["class" => "zebra"];
}
}
class AddAliasEvent extends Event
{
/** @var string */
public $oldtag;
/** @var string */
public $newtag;
public function __construct(string $oldtag, string $newtag)
{
parent::__construct();
$this->oldtag = trim($oldtag);
$this->newtag = trim($newtag);
}
}
class DeleteAliasEvent extends Event
{
public $oldtag;
public function __construct(string $oldtag)
{
parent::__construct();
$this->oldtag = $oldtag;
}
}
class AddAliasException extends SCoreException
{
}
class AliasEditor extends Extension
{
/** @var AliasEditorTheme */
protected $theme;
public function onPageRequest(PageRequestEvent $event)
{
global $config, $database, $page, $user;
if ($event->page_matches("alias")) {
if ($event->get_arg(0) == "add") {
if ($user->can(Permissions::MANAGE_ALIAS_LIST)) {
$user->ensure_authed();
$input = validate_input(["c_oldtag"=>"string", "c_newtag"=>"string"]);
try {
send_event(new AddAliasEvent($input['c_oldtag'], $input['c_newtag']));
$page->set_mode(PageMode::REDIRECT);
$page->set_redirect(make_link("alias/list"));
} catch (AddAliasException $ex) {
$this->theme->display_error(500, "Error adding alias", $ex->getMessage());
}
}
} elseif ($event->get_arg(0) == "remove") {
if ($user->can(Permissions::MANAGE_ALIAS_LIST)) {
$user->ensure_authed();
$input = validate_input(["d_oldtag"=>"string"]);
send_event(new DeleteAliasEvent($input['d_oldtag']));
$page->set_mode(PageMode::REDIRECT);
$page->set_redirect(make_link("alias/list"));
}
} elseif ($event->get_arg(0) == "list") {
$t = new AliasTable($database->raw_db());
$t->token = $user->get_auth_token();
$t->inputs = $_GET;
$t->size = $config->get_int('alias_items_per_page', 30);
if ($user->can(Permissions::MANAGE_ALIAS_LIST)) {
$t->create_url = make_link("alias/add");
$t->delete_url = make_link("alias/remove");
}
$this->theme->display_aliases($t->table($t->query()), $t->paginator());
} elseif ($event->get_arg(0) == "export") {
$page->set_mode(PageMode::DATA);
$page->set_type(MIME_TYPE_CSV);
$page->set_filename("aliases.csv");
$page->set_data($this->get_alias_csv($database));
} elseif ($event->get_arg(0) == "import") {
if ($user->can(Permissions::MANAGE_ALIAS_LIST)) {
if (count($_FILES) > 0) {
$tmp = $_FILES['alias_file']['tmp_name'];
$contents = file_get_contents($tmp);
$this->add_alias_csv($database, $contents);
log_info("alias_editor", "Imported aliases from file", "Imported aliases"); # FIXME: how many?
$page->set_mode(PageMode::REDIRECT);
$page->set_redirect(make_link("alias/list"));
} else {
$this->theme->display_error(400, "No File Specified", "You have to upload a file");
}
} else {
$this->theme->display_error(401, "Admins Only", "Only admins can edit the alias list");
}
}
}
}
public function onAddAlias(AddAliasEvent $event)
{
global $database;
$row = $database->get_row(
"SELECT * FROM aliases WHERE lower(oldtag)=lower(:oldtag)",
["oldtag"=>$event->oldtag]
);
if ($row) {
throw new AddAliasException("{$row['oldtag']} is already an alias for {$row['newtag']}");
}
$row = $database->get_row(
"SELECT * FROM aliases WHERE lower(oldtag)=lower(:newtag)",
["newtag" => $event->newtag]
);
if ($row) {
throw new AddAliasException("{$row['oldtag']} is itself an alias for {$row['newtag']}");
}
$database->execute(
"INSERT INTO aliases(oldtag, newtag) VALUES(:oldtag, :newtag)",
["oldtag" => $event->oldtag, "newtag" => $event->newtag]
);
log_info("alias_editor", "Added alias for {$event->oldtag} -> {$event->newtag}", "Added alias");
}
public function onDeleteAlias(DeleteAliasEvent $event)
{
global $database;
$database->execute("DELETE FROM aliases WHERE oldtag=:oldtag", ["oldtag" => $event->oldtag]);
log_info("alias_editor", "Deleted alias for {$event->oldtag}", "Deleted alias");
}
public function onPageSubNavBuilding(PageSubNavBuildingEvent $event)
{
if ($event->parent=="tags") {
$event->add_nav_link("aliases", new Link('alias/list'), "Aliases", NavLink::is_active(["alias"]));
}
}
public function onUserBlockBuilding(UserBlockBuildingEvent $event)
{
global $user;
if ($user->can(Permissions::MANAGE_ALIAS_LIST)) {
$event->add_link("Alias Editor", make_link("alias/list"));
}
}
private function get_alias_csv(Database $database): string
{
$csv = "";
$aliases = $database->get_pairs("SELECT oldtag, newtag FROM aliases ORDER BY newtag");
foreach ($aliases as $old => $new) {
$csv .= "\"$old\",\"$new\"\n";
}
return $csv;
}
private function add_alias_csv(Database $database, string $csv): int
{
$csv = str_replace("\r", "\n", $csv);
$i = 0;
foreach (explode("\n", $csv) as $line) {
$parts = str_getcsv($line);
if (count($parts) == 2) {
try {
send_event(new AddAliasEvent($parts[0], $parts[1]));
$i++;
} catch (AddAliasException $ex) {
$this->theme->display_error(500, "Error adding alias", $ex->getMessage());
}
}
}
return $i;
}
/**
* Get the priority for this extension.
*
* Add alias *after* mass tag editing, else the MTE will
* search for the images and be redirected to the alias,
* missing out the images tagged with the old tag.
*/
public function get_priority(): int
{
return 60;
}
}

85
ext/alias_editor/test.php Normal file
View File

@ -0,0 +1,85 @@
<?php declare(strict_types=1);
class AliasEditorTest extends ShimmiePHPUnitTestCase
{
public function testAliasList()
{
$this->get_page('alias/list');
$this->assert_response(200);
$this->assert_title("Alias List");
}
public function testAliasListReadOnly()
{
$this->log_in_as_user();
$this->get_page('alias/list');
$this->assert_title("Alias List");
$this->assert_no_text("Add");
$this->log_out();
$this->get_page('alias/list');
$this->assert_title("Alias List");
$this->assert_no_text("Add");
}
public function testAliasOneToOne()
{
$this->log_in_as_admin();
$this->get_page("alias/export/aliases.csv");
$this->assert_no_text("test1");
send_event(new AddAliasEvent("test1", "test2"));
$this->get_page('alias/list');
$this->assert_text("test1");
$this->get_page("alias/export/aliases.csv");
$this->assert_text('"test1","test2"');
$image_id = $this->post_image("tests/pbx_screenshot.jpg", "test1");
$this->get_page("post/view/$image_id"); # check that the tag has been replaced
$this->assert_title("Image $image_id: test2");
$this->get_page("post/list/test1/1"); # searching for an alias should find the master tag
$this->assert_response(302);
$this->get_page("post/list/test2/1"); # check that searching for the main tag still works
$this->assert_response(302);
$this->delete_image($image_id);
send_event(new DeleteAliasEvent("test1"));
$this->get_page('alias/list');
$this->assert_title("Alias List");
$this->assert_no_text("test1");
}
public function testAliasOneToMany()
{
$this->log_in_as_admin();
$this->get_page("alias/export/aliases.csv");
$this->assert_no_text("multi");
send_event(new AddAliasEvent("onetag", "multi tag"));
$this->get_page('alias/list');
$this->assert_text("multi");
$this->assert_text("tag");
$this->get_page("alias/export/aliases.csv");
$this->assert_text('"onetag","multi tag"');
$image_id_1 = $this->post_image("tests/pbx_screenshot.jpg", "onetag");
$image_id_2 = $this->post_image("tests/bedroom_workshop.jpg", "onetag");
$this->get_page("post/list/onetag/1"); # searching for an aliased tag should find its aliases
$this->assert_title("multi tag");
$this->assert_no_text("No Images Found");
$this->get_page("post/list/multi/1");
$this->assert_title("multi");
$this->assert_no_text("No Images Found");
$this->get_page("post/list/multi tag/1");
$this->assert_title("multi tag");
$this->assert_no_text("No Images Found");
$this->delete_image($image_id_1);
$this->delete_image($image_id_2);
send_event(new DeleteAliasEvent("onetag"));
$this->get_page('alias/list');
$this->assert_title("Alias List");
$this->assert_no_text("test1");
}
}

View File

@ -0,0 +1,36 @@
<?php declare(strict_types=1);
class AliasEditorTheme extends Themelet
{
/**
* Show a page of aliases.
*
* Note: $can_manage = whether things like "add new alias" should be shown
*/
public function display_aliases($table, $paginator): void
{
global $page, $user;
$can_manage = $user->can(Permissions::MANAGE_ALIAS_LIST);
$html = "
$table
$paginator
<p><a href='".make_link("alias/export/aliases.csv")."' download='aliases.csv'>Download as CSV</a></p>
";
$bulk_html = "
".make_form(make_link("alias/import"), 'post', true)."
<input type='file' name='alias_file'>
<input type='submit' value='Upload List'>
</form>
";
$page->set_title("Alias List");
$page->set_heading("Alias List");
$page->add_block(new NavBlock());
$page->add_block(new Block("Aliases", $html));
if ($can_manage) {
$page->add_block(new Block("Bulk Upload", $bulk_html, "main", 51));
}
}
}

12
ext/approval/info.php Normal file
View File

@ -0,0 +1,12 @@
<?php declare(strict_types=1);
class ApprovalInfo extends ExtensionInfo
{
public const KEY = "approval";
public $key = self::KEY;
public $name = "Approval";
public $authors = ["Matthew Barbour"=>"matthew@darkholme.net"];
public $license = self::LICENSE_WTFPL;
public $description = "Adds an approval step to the upload/import process.";
}

255
ext/approval/main.php Normal file
View File

@ -0,0 +1,255 @@
<?php declare(strict_types=1);
abstract class ApprovalConfig
{
const VERSION = "ext_approval_version";
const IMAGES = "approve_images";
const COMMENTS = "approve_comments";
}
class Approval extends Extension
{
/** @var ApprovalTheme */
protected $theme;
public function onInitExt(InitExtEvent $event)
{
global $config;
$config->set_default_bool(ApprovalConfig::IMAGES, false);
$config->set_default_bool(ApprovalConfig::COMMENTS, false);
Image::$bool_props[] = "approved";
}
public function onPageRequest(PageRequestEvent $event)
{
global $page, $user;
if ($event->page_matches("approve_image") && $user->can(Permissions::APPROVE_IMAGE)) {
// Try to get the image ID
$image_id = int_escape($event->get_arg(0));
if (empty($image_id)) {
$image_id = isset($_POST['image_id']) ? $_POST['image_id'] : null;
}
if (empty($image_id)) {
throw new SCoreException("Can not approve image: No valid Image ID given.");
}
self::approve_image($image_id);
$page->set_mode(PageMode::REDIRECT);
$page->set_redirect(make_link("post/view/" . $image_id));
}
if ($event->page_matches("disapprove_image") && $user->can(Permissions::APPROVE_IMAGE)) {
// Try to get the image ID
$image_id = int_escape($event->get_arg(0));
if (empty($image_id)) {
$image_id = isset($_POST['image_id']) ? $_POST['image_id'] : null;
}
if (empty($image_id)) {
throw new SCoreException("Can not disapprove image: No valid Image ID given.");
}
self::disapprove_image($image_id);
$page->set_mode(PageMode::REDIRECT);
$page->set_redirect(make_link("post/view/".$image_id));
}
}
public function onSetupBuilding(SetupBuildingEvent $event)
{
$this->theme->display_admin_block($event);
}
public function onAdminBuilding(AdminBuildingEvent $event)
{
$this->theme->display_admin_form();
}
public function onAdminAction(AdminActionEvent $event)
{
global $database, $user;
$action = $event->action;
$event->redirect = true;
if ($action==="approval") {
$approval_action = $_POST["approval_action"];
switch ($approval_action) {
case "approve_all":
$database->set_timeout(300000); // These updates can take a little bit
$database->execute(
"UPDATE images SET approved = :true, approved_by_id = :approved_by_id WHERE approved = :false",
["approved_by_id"=>$user->id, "true"=>true, "false"=>false]
);
break;
case "disapprove_all":
$database->set_timeout(300000); // These updates can take a little bit
$database->execute(
"UPDATE images SET approved = :false, approved_by_id = NULL WHERE approved = :true",
["true"=>true, "false"=>false]
);
break;
default:
break;
}
}
}
public function onDisplayingImage(DisplayingImageEvent $event)
{
global $user, $page, $config;
if ($config->get_bool(ApprovalConfig::IMAGES) && $event->image->approved===false && !$user->can(Permissions::APPROVE_IMAGE)) {
$page->set_mode(PageMode::REDIRECT);
$page->set_redirect(make_link("post/list"));
}
}
public function onPageSubNavBuilding(PageSubNavBuildingEvent $event)
{
global $user;
if ($event->parent=="posts") {
if ($user->can(Permissions::APPROVE_IMAGE)) {
$event->add_nav_link("posts_unapproved", new Link('/post/list/approved%3Ano/1'), "Pending Approval", null, 60);
}
}
}
const SEARCH_REGEXP = "/^approved:(yes|no)/";
public function onSearchTermParse(SearchTermParseEvent $event)
{
global $user, $database, $config;
if ($config->get_bool(ApprovalConfig::IMAGES)) {
$matches = [];
if (is_null($event->term) && $this->no_approval_query($event->context)) {
$event->add_querylet(new Querylet($database->scoreql_to_sql("approved = SCORE_BOOL_Y ")));
}
if (is_null($event->term)) {
return;
}
if (preg_match(self::SEARCH_REGEXP, strtolower($event->term), $matches)) {
if ($user->can(Permissions::APPROVE_IMAGE) && $matches[1] == "no") {
$event->add_querylet(new Querylet($database->scoreql_to_sql("approved = SCORE_BOOL_N ")));
} else {
$event->add_querylet(new Querylet($database->scoreql_to_sql("approved = SCORE_BOOL_Y ")));
}
}
}
}
public function onHelpPageBuilding(HelpPageBuildingEvent $event)
{
global $user, $config;
if ($event->key===HelpPages::SEARCH) {
if ($user->can(Permissions::APPROVE_IMAGE) && $config->get_bool(ApprovalConfig::IMAGES)) {
$block = new Block();
$block->header = "Approval";
$block->body = $this->theme->get_help_html();
$event->add_block($block);
}
}
}
private function no_approval_query(array $context): bool
{
foreach ($context as $term) {
if (preg_match(self::SEARCH_REGEXP, $term)) {
return false;
}
}
return true;
}
public static function approve_image($image_id)
{
global $database, $user;
$database->execute(
"UPDATE images SET approved = :true, approved_by_id = :approved_by_id WHERE id = :id AND approved = :false",
["approved_by_id"=>$user->id, "id"=>$image_id, "true"=>true, "false"=>false]
);
}
public static function disapprove_image($image_id)
{
global $database;
$database->execute(
"UPDATE images SET approved = :false, approved_by_id = NULL WHERE id = :id AND approved = :true",
["id"=>$image_id, "true"=>true, "false"=>false]
);
}
public function onImageAdminBlockBuilding(ImageAdminBlockBuildingEvent $event)
{
global $user, $config;
if ($user->can(Permissions::APPROVE_IMAGE) && $config->get_bool(ApprovalConfig::IMAGES)) {
$event->add_part($this->theme->get_image_admin_html($event->image));
}
}
public function onBulkActionBlockBuilding(BulkActionBlockBuildingEvent $event)
{
global $user, $config;
if ($user->can(Permissions::APPROVE_IMAGE)&& $config->get_bool(ApprovalConfig::IMAGES)) {
if (in_array("approved:no", $event->search_terms)) {
$event->add_action("bulk_approve_image", "Approve", "a");
} else {
$event->add_action("bulk_disapprove_image", "Disapprove");
}
}
}
public function onBulkAction(BulkActionEvent $event)
{
global $page, $user;
switch ($event->action) {
case "bulk_approve_image":
if ($user->can(Permissions::APPROVE_IMAGE)) {
$total = 0;
foreach ($event->items as $image) {
self::approve_image($image->id);
$total++;
}
$page->flash("Approved $total items");
}
break;
case "bulk_disapprove_image":
if ($user->can(Permissions::APPROVE_IMAGE)) {
$total = 0;
foreach ($event->items as $image) {
self::disapprove_image($image->id);
$total++;
}
$page->flash("Disapproved $total items");
}
break;
}
}
public function onDatabaseUpgrade(DatabaseUpgradeEvent $event)
{
global $database;
if ($this->get_version(ApprovalConfig::VERSION) < 1) {
$database->execute($database->scoreql_to_sql(
"ALTER TABLE images ADD COLUMN approved SCORE_BOOL NOT NULL DEFAULT SCORE_BOOL_N"
));
$database->execute(
"ALTER TABLE images ADD COLUMN approved_by_id INTEGER NULL"
);
$database->execute("CREATE INDEX images_approved_idx ON images(approved)");
$this->set_version(ApprovalConfig::VERSION, 1);
}
}
}

61
ext/approval/theme.php Normal file
View File

@ -0,0 +1,61 @@
<?php declare(strict_types=1);
use function MicroHTML\BR;
use function MicroHTML\BUTTON;
use function MicroHTML\INPUT;
class ApprovalTheme extends Themelet
{
public function get_image_admin_html(Image $image)
{
if ($image->approved===true) {
$html = SHM_SIMPLE_FORM(
'disapprove_image/'.$image->id,
INPUT(["type"=>'hidden', "name"=>'image_id', "value"=>$image->id]),
SHM_SUBMIT("Disapprove")
);
} else {
$html = SHM_SIMPLE_FORM(
'approve_image/'.$image->id,
INPUT(["type"=>'hidden', "name"=>'image_id', "value"=>$image->id]),
SHM_SUBMIT("Approve")
);
}
return (string)$html;
}
public function get_help_html()
{
return '<p>Search for images that are approved/not approved.</p>
<div class="command_example">
<pre>approved:yes</pre>
<p>Returns images that have been approved.</p>
</div>
<div class="command_example">
<pre>approved:no</pre>
<p>Returns images that have not been approved.</p>
</div>
';
}
public function display_admin_block(SetupBuildingEvent $event)
{
$sb = new SetupBlock("Approval");
$sb->add_bool_option(ApprovalConfig::IMAGES, "Images: ");
$event->panel->add_block($sb);
}
public function display_admin_form()
{
global $page;
$html = (string)SHM_SIMPLE_FORM(
"admin/approval",
BUTTON(["name"=>'approval_action', "value"=>'approve_all'], "Approve All Images"),
BR(),
BUTTON(["name"=>'approval_action', "value"=>'disapprove_all'], "Disapprove All Images"),
);
$page->add_block(new Block("Approval", $html));
}
}

14
ext/artists/info.php Normal file
View File

@ -0,0 +1,14 @@
<?php declare(strict_types=1);
class ArtistsInfo extends ExtensionInfo
{
public const KEY = "artists";
public $key = self::KEY;
public $name = "Artists System";
public $url = self::SHIMMIE_URL;
public $authors = ["Sein Kraft"=>"mail@seinkraft.info","Alpha"=>"alpha@furries.com.ar"];
public $license = self::LICENSE_GPLV2;
public $description = "Simple artists extension";
public $beta = true;
}

1057
ext/artists/main.php Normal file

File diff suppressed because it is too large Load Diff

15
ext/artists/test.php Normal file
View File

@ -0,0 +1,15 @@
<?php declare(strict_types=1);
class ArtistsTest extends ShimmiePHPUnitTestCase
{
public function testSearch()
{
global $user;
$this->log_in_as_user();
$image_id = $this->post_image("tests/pbx_screenshot.jpg", "pbx computer screenshot");
$image = Image::by_id($image_id);
send_event(new AuthorSetEvent($image, $user, "bob"));
$this->assert_search_results(["author=bob"], [$image_id]);
}
}

558
ext/artists/theme.php Normal file
View File

@ -0,0 +1,558 @@
<?php declare(strict_types=1);
class ArtistsTheme extends Themelet
{
public function get_author_editor_html(string $author): string
{
$h_author = html_escape($author);
return "
<tr>
<th>Author</th>
<td>
<span class='view'>$h_author</span>
<input class='edit' type='text' name='tag_edit__author' value='$h_author'>
</td>
</tr>
";
}
public function sidebar_options(string $mode, ?int $artistID=null, $is_admin=false): void
{
global $page, $user;
$html = "";
if ($mode == "neutral") {
$html = "<form method='post' action='".make_link("artist/new_artist")."'>
".$user->get_auth_html()."
<input type='submit' name='edit' id='edit' value='New Artist'/>
</form>";
}
if ($mode == "editor") {
$html = "<form method='post' action='".make_link("artist/new_artist")."'>
".$user->get_auth_html()."
<input type='submit' name='edit' value='New Artist'/>
</form>
<form method='post' action='".make_link("artist/edit_artist")."'>
".$user->get_auth_html()."
<input type='submit' name='edit' value='Edit Artist'/>
<input type='hidden' name='artist_id' value='".$artistID."'>
</form>";
if ($is_admin) {
$html .= "<form method='post' action='".make_link("artist/nuke_artist")."'>
".$user->get_auth_html()."
<input type='submit' name='edit' value='Delete Artist'/>
<input type='hidden' name='artist_id' value='".$artistID."'>
</form>";
}
$html .= "<form method='post' action='".make_link("artist/add_alias")."'>
".$user->get_auth_html()."
<input type='submit' name='edit' value='Add Alias'/>
<input type='hidden' name='artist_id' value='".$artistID."'>
</form>
<form method='post' action='".make_link("artist/add_member")."'>
".$user->get_auth_html()."
<input type='submit' name='edit' value='Add Member'/>
<input type='hidden' name='artist_id' value='".$artistID."'>
</form>
<form method='post' action='".make_link("artist/add_url")."'>
".$user->get_auth_html()."
<input type='submit' name='edit' value='Add Url'/>
<input type='hidden' name='artist_id' value='".$artistID."'>
</form>";
}
if ($html) {
$page->add_block(new Block("Manage Artists", $html, "left", 10));
}
}
public function show_artist_editor($artist, $aliases, $members, $urls)
{
global $user;
$artistName = $artist['name'];
$artistNotes = $artist['notes'];
$artistID = $artist['id'];
// aliases
$aliasesString = "";
$aliasesIDsString = "";
foreach ($aliases as $alias) {
$aliasesString .= $alias["alias_name"]." ";
$aliasesIDsString .= $alias["alias_id"]." ";
}
$aliasesString = rtrim($aliasesString);
$aliasesIDsString = rtrim($aliasesIDsString);
// members
$membersString = "";
$membersIDsString = "";
foreach ($members as $member) {
$membersString .= $member["name"]." ";
$membersIDsString .= $member["id"]." ";
}
$membersString = rtrim($membersString);
$membersIDsString = rtrim($membersIDsString);
// urls
$urlsString = "";
$urlsIDsString = "";
foreach ($urls as $url) {
$urlsString .= $url["url"]."\n";
$urlsIDsString .= $url["id"]." ";
}
$urlsString = substr($urlsString, 0, strlen($urlsString) -1);
$urlsIDsString = rtrim($urlsIDsString);
$html = '
<form method="POST" action="'.make_link("artist/edited/".$artist['id']).'">
'.$user->get_auth_html().'
<table>
<tr><td>Name:</td><td><input type="text" name="name" value="'.$artistName.'" />
<input type="hidden" name="id" value="'.$artistID.'" /></td></tr>
<tr><td>Alias:</td><td><input type="text" name="aliases" value="'.$aliasesString.'" />
<input type="hidden" name="aliasesIDs" value="'.$aliasesIDsString.'" /></td></tr>
<tr><td>Members:</td><td><input type="text" name="members" value="'.$membersString.'" />
<input type="hidden" name="membersIDs" value="'.$membersIDsString.'" /></td></tr>
<tr><td>URLs:</td><td><textarea name="urls">'.$urlsString.'</textarea>
<input type="hidden" name="urlsIDs" value="'.$urlsIDsString.'" /></td></tr>
<tr><td>Notes:</td><td><textarea name="notes">'.$artistNotes.'</textarea></td></tr>
<tr><td colspan="2"><input type="submit" value="Submit" /></td></tr>
</table>
</form>
';
global $page;
$page->add_block(new Block("Edit artist", $html, "main", 10));
}
public function new_artist_composer()
{
global $page, $user;
$html = "<form action=".make_link("artist/create")." method='POST'>
".$user->get_auth_html()."
<table>
<tr><td>Name:</td><td><input type='text' name='name' /></td></tr>
<tr><td>Aliases:</td><td><input type='text' name='aliases' /></td></tr>
<tr><td>Members:</td><td><input type='text' name='members' /></td></tr>
<tr><td>URLs:</td><td><textarea name='urls'></textarea></td></tr>
<tr><td>Notes:</td><td><textarea name='notes'></textarea></td></tr>
<tr><td colspan='2'><input type='submit' value='Submit' /></td></tr>
</table>
";
$page->set_title("Artists");
$page->set_heading("Artists");
$page->add_block(new Block("Artists", $html, "main", 10));
}
public function list_artists($artists, $pageNumber, $totalPages)
{
global $user, $page;
$html = "<table id='poolsList' class='zebra'>".
"<thead><tr>".
"<th>Name</th>".
"<th>Type</th>".
"<th>Last updater</th>".
"<th>Posts</th>";
if (!$user->is_anonymous()) {
$html .= "<th colspan='2'>Action</th>";
} // space for edit link
$html .= "</tr></thead>";
$deletionLinkActionArray = [
'artist' => 'artist/nuke/',
'alias' => 'artist/alias/delete/',
'member' => 'artist/member/delete/',
];
$editionLinkActionArray = [
'artist' => 'artist/edit/',
'alias' => 'artist/alias/edit/',
'member' => 'artist/member/edit/',
];
$typeTextArray = [
'artist' => 'Artist',
'alias' => 'Alias',
'member' => 'Member',
];
foreach ($artists as $artist) {
if ($artist['type'] != 'artist') {
$artist['name'] = str_replace("_", " ", $artist['name']);
}
$elementLink = "<a href='".make_link("artist/view/".$artist['artist_id'])."'>".str_replace("_", " ", $artist['name'])."</a>";
//$artist_link = "<a href='".make_link("artist/view/".$artist['artist_id'])."'>".str_replace("_", " ", $artist['artist_name'])."</a>";
$user_link = "<a href='".make_link("user/".$artist['user_name'])."'>".$artist['user_name']."</a>";
$edit_link = "<a href='".make_link($editionLinkActionArray[$artist['type']].$artist['id'])."'>Edit</a>";
$del_link = "<a href='".make_link($deletionLinkActionArray[$artist['type']].$artist['id'])."'>Delete</a>";
$html .= "<tr>".
"<td class='left'>".$elementLink;
//if ($artist['type'] == 'member')
// $html .= " (member of ".$artist_link.")";
//if ($artist['type'] == 'alias')
// $html .= " (alias for ".$artist_link.")";
$html .= "</td>".
"<td>".$typeTextArray[$artist['type']]."</td>".
"<td>".$user_link."</td>".
"<td>".$artist['posts']."</td>";
if (!$user->is_anonymous()) {
$html .= "<td>".$edit_link."</td>";
}
if ($user->can(Permissions::ARTISTS_ADMIN)) {
$html .= "<td>".$del_link."</td>";
}
$html .= "</tr>";
}
$html .= "</tbody></table>";
$page->set_title("Artists");
$page->set_heading("Artists");
$page->add_block(new Block("Artists", $html, "main", 10));
$this->display_paginator($page, "artist/list", null, $pageNumber, $totalPages);
}
public function show_new_alias_composer($artistID)
{
global $user;
$html = '
<form method="POST" action='.make_link("artist/alias/add").'>
'.$user->get_auth_html().'
<table>
<tr><td>Alias:</td><td><input type="text" name="aliases" />
<input type="hidden" name="artistID" value='.$artistID.' /></td></tr>
<tr><td colspan="2"><input type="submit" value="Submit" /></td></tr>
</table>
</form>
';
global $page;
$page->add_block(new Block("Artist Aliases", $html, "main", 20));
}
public function show_new_member_composer($artistID)
{
global $user;
$html = '
<form method="POST" action='.make_link("artist/member/add").'>
'.$user->get_auth_html().'
<table>
<tr><td>Members:</td><td><input type="text" name="members" />
<input type="hidden" name="artistID" value='.$artistID.' /></td></tr>
<tr><td colspan="2"><input type="submit" value="Submit" /></td></tr>
</table>
</form>
';
global $page;
$page->add_block(new Block("Artist members", $html, "main", 30));
}
public function show_new_url_composer($artistID)
{
global $user;
$html = '
<form method="POST" action='.make_link("artist/url/add").'>
'.$user->get_auth_html().'
<table>
<tr><td>URL:</td><td><textarea name="urls"></textarea>
<input type="hidden" name="artistID" value='.$artistID.' /></td></tr>
<tr><td colspan="2"><input type="submit" value="Submit" /></td></tr>
</table>
</form>
';
global $page;
$page->add_block(new Block("Artist URLs", $html, "main", 40));
}
public function show_alias_editor($alias)
{
global $user;
$html = '
<form method="POST" action="'.make_link("artist/alias/edited/".$alias['id']).'">
'.$user->get_auth_html().'
<label for="alias">Alias:</label>
<input type="text" name="alias" id="alias" value="'.$alias['alias'].'" />
<input type="hidden" name="aliasID" value="'.$alias['id'].'" />
<input type="submit" value="Submit" />
</form>
';
global $page;
$page->add_block(new Block("Edit Alias", $html, "main", 10));
}
public function show_url_editor($url)
{
global $user;
$html = '
<form method="POST" action="'.make_link("artist/url/edited/".$url['id']).'">
'.$user->get_auth_html().'
<label for="url">URL:</label>
<input type="text" name="url" id="url" value="'.$url['url'].'" />
<input type="hidden" name="urlID" value="'.$url['id'].'" />
<input type="submit" value="Submit" />
</form>
';
global $page;
$page->add_block(new Block("Edit URL", $html, "main", 10));
}
public function show_member_editor($member)
{
global $user;
$html = '
<form method="POST" action="'.make_link("artist/member/edited/".$member['id']).'">
'.$user->get_auth_html().'
<label for="name">Member name:</label>
<input type="text" name="name" id="name" value="'.$member['name'].'" />
<input type="hidden" name="memberID" value="'.$member['id'].'" />
<input type="submit" value="Submit" />
</form>
';
global $page;
$page->add_block(new Block("Edit Member", $html, "main", 10));
}
public function show_artist($artist, $aliases, $members, $urls, $images, $userIsLogged, $userIsAdmin)
{
global $page;
$artist_link = "<a href='".make_link("post/list/".$artist['name']."/1")."'>".str_replace("_", " ", $artist['name'])."</a>";
$html = "<table id='poolsList' class='zebra'>
<thead>
<tr>
<th></th>
<th></th>";
if ($userIsLogged) {
$html .= "<th></th>";
}
if ($userIsAdmin) {
$html .= "<th></th>";
}
$html .= " <tr>
</thead>
<tr>
<td class='left'>Name:</td>
<td class='left'>".$artist_link."</td>";
if ($userIsLogged) {
$html .= "<td></td>";
}
if ($userIsAdmin) {
$html .= "<td></td>";
}
$html .= "</tr>";
$html .= $this->render_aliases($aliases, $userIsLogged, $userIsAdmin);
$html .= $this->render_members($members, $userIsLogged, $userIsAdmin);
$html .= $this->render_urls($urls, $userIsLogged, $userIsAdmin);
$html .= "<tr>
<td class='left'>Notes:</td>
<td class='left'>".$artist["notes"]."</td>";
if ($userIsLogged) {
$html .= "<td></td>";
}
if ($userIsAdmin) {
$html .= "<td></td>";
}
//TODO how will notes be edited? On edit artist? (should there be an editartist?) or on a editnotes?
//same question for deletion
$html .= "</tr>
</table>";
$page->set_title("Artist");
$page->set_heading("Artist");
$page->add_block(new Block("Artist", $html, "main", 10));
//we show the images for the artist
$artist_images = "";
foreach ($images as $image) {
$thumb_html = $this->build_thumb_html($image);
$artist_images .= '<span class="thumb">'.
'<a href="$image_link">'.$thumb_html.'</a>'.
'</span>';
}
$page->add_block(new Block("Artist Images", $artist_images, "main", 20));
}
private function render_aliases(array $aliases, bool $userIsLogged, bool $userIsAdmin): string
{
$html = "";
if (count($aliases) > 0) {
$aliasViewLink = str_replace("_", " ", $aliases[0]['alias_name']); // no link anymore
$aliasEditLink = "<a href='" . make_link("artist/alias/edit/" . $aliases[0]['alias_id']) . "'>Edit</a>";
$aliasDeleteLink = "<a href='" . make_link("artist/alias/delete/" . $aliases[0]['alias_id']) . "'>Delete</a>";
$html .= "<tr>
<td class='left'>Aliases:</td>
<td class='left'>" . $aliasViewLink . "</td>";
if ($userIsLogged) {
$html .= "<td class='left'>" . $aliasEditLink . "</td>";
}
if ($userIsAdmin) {
$html .= "<td class='left'>" . $aliasDeleteLink . "</td>";
}
$html .= "</tr>";
if (count($aliases) > 1) {
for ($i = 1; $i < count($aliases); $i++) {
$aliasViewLink = str_replace("_", " ", $aliases[$i]['alias_name']); // no link anymore
$aliasEditLink = "<a href='" . make_link("artist/alias/edit/" . $aliases[$i]['alias_id']) . "'>Edit</a>";
$aliasDeleteLink = "<a href='" . make_link("artist/alias/delete/" . $aliases[$i]['alias_id']) . "'>Delete</a>";
$html .= "<tr>
<td class='left'>&nbsp;</td>
<td class='left'>" . $aliasViewLink . "</td>";
if ($userIsLogged) {
$html .= "<td class='left'>" . $aliasEditLink . "</td>";
}
if ($userIsAdmin) {
$html .= "<td class='left'>" . $aliasDeleteLink . "</td>";
}
$html .= "</tr>";
}
}
}
return $html;
}
private function render_members(array $members, bool $userIsLogged, bool $userIsAdmin): string
{
$html = "";
if (count($members) > 0) {
$memberViewLink = str_replace("_", " ", $members[0]['name']); // no link anymore
$memberEditLink = "<a href='" . make_link("artist/member/edit/" . $members[0]['id']) . "'>Edit</a>";
$memberDeleteLink = "<a href='" . make_link("artist/member/delete/" . $members[0]['id']) . "'>Delete</a>";
$html .= "<tr>
<td class='left'>Members:</td>
<td class='left'>" . $memberViewLink . "</td>";
if ($userIsLogged) {
$html .= "<td class='left'>" . $memberEditLink . "</td>";
}
if ($userIsAdmin) {
$html .= "<td class='left'>" . $memberDeleteLink . "</td>";
}
$html .= "</tr>";
if (count($members) > 1) {
for ($i = 1; $i < count($members); $i++) {
$memberViewLink = str_replace("_", " ", $members[$i]['name']); // no link anymore
$memberEditLink = "<a href='" . make_link("artist/member/edit/" . $members[$i]['id']) . "'>Edit</a>";
$memberDeleteLink = "<a href='" . make_link("artist/member/delete/" . $members[$i]['id']) . "'>Delete</a>";
$html .= "<tr>
<td class='left'>&nbsp;</td>
<td class='left'>" . $memberViewLink . "</td>";
if ($userIsLogged) {
$html .= "<td class='left'>" . $memberEditLink . "</td>";
}
if ($userIsAdmin) {
$html .= "<td class='left'>" . $memberDeleteLink . "</td>";
}
$html .= "</tr>";
}
}
}
return $html;
}
private function render_urls(array $urls, bool $userIsLogged, bool $userIsAdmin): string
{
$html = "";
if (count($urls) > 0) {
$urlViewLink = "<a href='" . str_replace("_", " ", $urls[0]['url']) . "' target='_blank'>" . str_replace("_", " ", $urls[0]['url']) . "</a>";
$urlEditLink = "<a href='" . make_link("artist/url/edit/" . $urls[0]['id']) . "'>Edit</a>";
$urlDeleteLink = "<a href='" . make_link("artist/url/delete/" . $urls[0]['id']) . "'>Delete</a>";
$html .= "<tr>
<td class='left'>URLs:</td>
<td class='left'>" . $urlViewLink . "</td>";
if ($userIsLogged) {
$html .= "<td class='left'>" . $urlEditLink . "</td>";
}
if ($userIsAdmin) {
$html .= "<td class='left'>" . $urlDeleteLink . "</td>";
}
$html .= "</tr>";
if (count($urls) > 1) {
for ($i = 1; $i < count($urls); $i++) {
$urlViewLink = "<a href='" . str_replace("_", " ", $urls[$i]['url']) . "' target='_blank'>" . str_replace("_", " ", $urls[$i]['url']) . "</a>";
$urlEditLink = "<a href='" . make_link("artist/url/edit/" . $urls[$i]['id']) . "'>Edit</a>";
$urlDeleteLink = "<a href='" . make_link("artist/url/delete/" . $urls[$i]['id']) . "'>Delete</a>";
$html .= "<tr>
<td class='left'>&nbsp;</td>
<td class='left'>" . $urlViewLink . "</td>";
if ($userIsLogged) {
$html .= "<td class='left'>" . $urlEditLink . "</td>";
}
if ($userIsAdmin) {
$html .= "<td class='left'>" . $urlDeleteLink . "</td>";
}
$html .= "</tr>";
}
return $html;
}
}
return $html;
}
public function get_help_html()
{
return '<p>Search for images with a particular artist.</p>
<div class="command_example">
<pre>artist=leonardo</pre>
<p>Returns images with the artist "leonardo".</p>
</div>
';
}
}

View File

@ -0,0 +1,7 @@
<?php declare(strict_types=1);
abstract class AutoTaggerConfig
{
public const VERSION = "ext_auto_tagger_ver";
public const ITEMS_PER_PAGE = "auto_tagger_items_per_page";
}

12
ext/auto_tagger/info.php Normal file
View File

@ -0,0 +1,12 @@
<?php declare(strict_types=1);
class AutoTaggerInfo extends ExtensionInfo
{
public const KEY = "auto_tagger";
public $key = self::KEY;
public $name = "Auto-Tagger";
public $authors = ["Matthew Barbour"=>"matthew@darkholme.net"];
public $license = self::LICENSE_WTFPL;
public $description = "Provides several automatic tagging functions";
}

335
ext/auto_tagger/main.php Normal file
View File

@ -0,0 +1,335 @@
<?php declare(strict_types=1);
require_once 'config.php';
use MicroCRUD\ActionColumn;
use MicroCRUD\TextColumn;
use MicroCRUD\Table;
class AutoTaggerTable extends Table
{
public function __construct(\FFSPHP\PDO $db)
{
parent::__construct($db);
$this->table = "auto_tagger";
$this->base_query = "SELECT * FROM auto_tag";
$this->primary_key = "tag";
$this->size = 100;
$this->limit = 1000000;
$this->set_columns([
new TextColumn("tag", "Tag"),
new TextColumn("additional_tags", "Additional Tags"),
new ActionColumn("tag"),
]);
$this->order_by = ["tag"];
$this->table_attrs = ["class" => "zebra"];
}
}
class AddAutoTagEvent extends Event
{
/** @var string */
public $tag;
/** @var string */
public $additional_tags;
public function __construct(string $tag, string $additional_tags)
{
parent::__construct();
$this->tag = trim($tag);
$this->additional_tags = trim($additional_tags);
}
}
class DeleteAutoTagEvent extends Event
{
public $tag;
public function __construct(string $tag)
{
parent::__construct();
$this->tag = $tag;
}
}
class AutoTaggerException extends SCoreException
{
}
class AddAutoTagException extends SCoreException
{
}
class AutoTagger extends Extension
{
/** @var AutoTaggerTheme */
protected $theme;
public function onPageRequest(PageRequestEvent $event)
{
global $config, $database, $page, $user;
if ($event->page_matches("auto_tag")) {
if ($event->get_arg(0) == "add") {
if ($user->can(Permissions::MANAGE_AUTO_TAG)) {
$user->ensure_authed();
$input = validate_input(["c_tag"=>"string", "c_additional_tags"=>"string"]);
try {
send_event(new AddAutoTagEvent($input['c_tag'], $input['c_additional_tags']));
$page->set_mode(PageMode::REDIRECT);
$page->set_redirect(make_link("auto_tag/list"));
} catch (AddAutoTagException $ex) {
$this->theme->display_error(500, "Error adding auto-tag", $ex->getMessage());
}
}
} elseif ($event->get_arg(0) == "remove") {
if ($user->can(Permissions::MANAGE_AUTO_TAG)) {
$user->ensure_authed();
$input = validate_input(["d_tag"=>"string"]);
send_event(new DeleteAutoTagEvent($input['d_tag']));
$page->set_mode(PageMode::REDIRECT);
$page->set_redirect(make_link("auto_tag/list"));
}
} elseif ($event->get_arg(0) == "list") {
$t = new AutoTaggerTable($database->raw_db());
$t->token = $user->get_auth_token();
$t->inputs = $_GET;
$t->size = $config->get_int(AutoTaggerConfig::ITEMS_PER_PAGE, 30);
if ($user->can(Permissions::MANAGE_AUTO_TAG)) {
$t->create_url = make_link("auto_tag/add");
$t->delete_url = make_link("auto_tag/remove");
}
$this->theme->display_auto_tagtable($t->table($t->query()), $t->paginator());
} elseif ($event->get_arg(0) == "export") {
$page->set_mode(PageMode::DATA);
$page->set_type(MIME_TYPE_CSV);
$page->set_filename("auto_tag.csv");
$page->set_data($this->get_auto_tag_csv($database));
} elseif ($event->get_arg(0) == "import") {
if ($user->can(Permissions::MANAGE_AUTO_TAG)) {
if (count($_FILES) > 0) {
$tmp = $_FILES['auto_tag_file']['tmp_name'];
$contents = file_get_contents($tmp);
$count = $this->add_auto_tag_csv($database, $contents);
log_info(AutoTaggerInfo::KEY, "Imported $count auto-tag definitions from file from file", "Imported $count auto-tag definitions");
$page->set_mode(PageMode::REDIRECT);
$page->set_redirect(make_link("auto_tag/list"));
} else {
$this->theme->display_error(400, "No File Specified", "You have to upload a file");
}
} else {
$this->theme->display_error(401, "Admins Only", "Only admins can edit the auto-tag list");
}
}
}
}
public function onPageSubNavBuilding(PageSubNavBuildingEvent $event)
{
if ($event->parent=="tags") {
$event->add_nav_link("auto_tag", new Link('auto_tag/list'), "Auto-Tag", NavLink::is_active(["auto_tag"]));
}
}
public function onDatabaseUpgrade(DatabaseUpgradeEvent $event)
{
global $database;
// Create the database tables
if ($this->get_version(AutoTaggerConfig::VERSION) < 1) {
$database->create_table("auto_tag", "
tag VARCHAR(128) NOT NULL PRIMARY KEY,
additional_tags VARCHAR(2000) NOT NULL
");
if ($database->get_driver_name() == DatabaseDriver::PGSQL) {
$database->execute('CREATE INDEX auto_tag_lower_tag_idx ON auto_tag ((lower(tag)))');
}
$this->set_version(AutoTaggerConfig::VERSION, 1);
log_info(AutoTaggerInfo::KEY, "extension installed");
}
}
public function onTagSet(TagSetEvent $event)
{
$results = $this->apply_auto_tags($event->tags);
if (!empty($results)) {
$event->tags = $results;
}
}
public function onAddAutoTag(AddAutoTagEvent $event)
{
global $page;
$this->add_auto_tag($event->tag, $event->additional_tags);
$page->flash("Added Auto-Tag");
}
public function onDeleteAutoTag(DeleteAutoTagEvent $event)
{
$this->remove_auto_tag($event->tag);
}
public function onUserBlockBuilding(UserBlockBuildingEvent $event)
{
global $user;
if ($user->can(Permissions::MANAGE_AUTO_TAG)) {
$event->add_link("Auto-Tag Editor", make_link("auto_tag/list"));
}
}
private function get_auto_tag_csv(Database $database): string
{
$csv = "";
$pairs = $database->get_pairs("SELECT tag, additional_tags FROM auto_tag ORDER BY tag");
foreach ($pairs as $old => $new) {
$csv .= "\"$old\",\"$new\"\n";
}
return $csv;
}
private function add_auto_tag_csv(Database $database, string $csv): int
{
$csv = str_replace("\r", "\n", $csv);
$i = 0;
foreach (explode("\n", $csv) as $line) {
$parts = str_getcsv($line);
if (count($parts) == 2) {
try {
send_event(new AddAutoTagEvent($parts[0], $parts[1]));
$i++;
} catch (AddAutoTagException $ex) {
$this->theme->display_error(500, "Error adding auto-tags", $ex->getMessage());
}
}
}
return $i;
}
private function add_auto_tag(string $tag, string $additional_tags)
{
global $database;
if ($database->exists("SELECT * FROM auto_tag WHERE LOWER(tag)=LOWER(:tag)", ["tag"=>$tag])) {
throw new AutoTaggerException("Auto-Tag is already set for that tag");
} else {
$tag = Tag::sanitize($tag);
$additional_tags = Tag::explode($additional_tags);
$database->execute(
"INSERT INTO auto_tag(tag, additional_tags) VALUES(:tag, :additional_tags)",
["tag"=>$tag, "additional_tags"=>Tag::implode($additional_tags)]
);
log_info(
AutoTaggerInfo::KEY,
"Added auto-tag for {$tag} -> {".implode(" ", $additional_tags)."}"
);
// Now we apply it to existing items
$this->apply_new_auto_tag($tag);
}
}
private function update_auto_tag(string $tag, string $additional_tags): bool
{
global $database;
$result = $database->get_row("SELECT * FROM auto_tag WHERE LOWER(tag)=LOWER(:tag)", ["tag"=>$tag]);
if ($result===null) {
throw new AutoTaggerException("Auto-tag not set for $tag, can't update");
} else {
$additional_tags = Tag::explode($additional_tags);
$current_additional_tags = Tag::explode($result["additional_tags"]);
if (!Tag::compare($additional_tags, $current_additional_tags)) {
$database->execute(
"UPDATE auto_tag SET additional_tags = :additional_tags WHERE LOWER(tag)=LOWER(:tag)",
["tag"=>$tag, "additional_tags"=>Tag::implode($additional_tags)]
);
log_info(
AutoTaggerInfo::KEY,
"Updated auto-tag for {$tag} -> {".implode(" ", $additional_tags)."}",
"Updated Auto-Tag"
);
// Now we apply it to existing items
$this->apply_new_auto_tag($tag);
return true;
}
}
return false;
}
private function apply_new_auto_tag(string $tag)
{
global $database;
$tag_id = $database->get_one("SELECT id FROM tags WHERE LOWER(tag) = LOWER(:tag)", ["tag"=>$tag]);
if (!empty($tag_id)) {
$image_ids = $database->get_col_iterable("SELECT image_id FROM image_tags WHERE tag_id = :tag_id", ["tag_id"=>$tag_id]);
foreach ($image_ids as $image_id) {
$image = Image::by_id($image_id);
$event = new TagSetEvent($image, $image->get_tag_array());
send_event($event);
}
}
}
private function remove_auto_tag(String $tag)
{
global $database;
$database->execute("DELETE FROM auto_tag WHERE LOWER(tag)=LOWER(:tag)", ["tag" => $tag]);
}
/**
* #param string[] $tags_mixed
*/
private function apply_auto_tags(array $tags_mixed): ?array
{
global $database;
while (true) {
$new_tags = [];
foreach ($tags_mixed as $tag) {
$additional_tags = $database->get_one(
"SELECT additional_tags FROM auto_tag WHERE LOWER(tag) = LOWER(:input)",
["input" => $tag]
);
if (!empty($additional_tags)) {
$additional_tags = explode(" ", $additional_tags);
$new_tags = array_merge(
$new_tags,
array_udiff($additional_tags, $tags_mixed, 'strcasecmp')
);
}
}
if (empty($new_tags)) {
break;
}
$tags_mixed = array_merge($tags_mixed, $new_tags);
}
$results = array_intersect_key(
$tags_mixed,
array_unique(array_map('strtolower', $tags_mixed))
);
return $results;
}
/**
* Get the priority for this extension.
*
*/
public function get_priority(): int
{
return 30;
}
}

58
ext/auto_tagger/test.php Normal file
View File

@ -0,0 +1,58 @@
<?php declare(strict_types=1);
class AutoTaggerTest extends ShimmiePHPUnitTestCase
{
public function testAutoTaggerList()
{
$this->get_page('auto_tag/list');
$this->assert_response(200);
$this->assert_title("Auto-Tag");
}
public function testAutoTaggerListReadOnly()
{
$this->log_in_as_user();
$this->get_page('auto_tag/list');
$this->assert_title("Auto-Tag");
$this->assert_no_text("value=\"Add\"");
$this->log_out();
$this->get_page('auto_tag/list');
$this->assert_title("Auto-Tag");
$this->assert_no_text("value=\"Add\"");
}
public function testAutoTagger()
{
$this->log_in_as_admin();
$this->get_page("auto_tag/export/auto_tag.csv");
$this->assert_no_text("test1");
send_event(new AddAutoTagEvent("test1", "test2"));
$this->get_page('auto_tag/list');
$this->assert_text("test1");
$this->assert_text("test2");
$this->get_page("auto_tag/export/auto_tag.csv");
$this->assert_text('"test1","test2"');
$image_id = $this->post_image("tests/pbx_screenshot.jpg", "test1");
$this->get_page("post/view/$image_id"); # check that the tag has been replaced
$this->assert_title("Image $image_id: test1 test2");
$this->delete_image($image_id);
send_event(new AddAutoTagEvent("test2", "test3"));
$image_id = $this->post_image("tests/pbx_screenshot.jpg", "test1");
$this->get_page("post/view/$image_id"); # check that the tag has been replaced
$this->assert_title("Image $image_id: test1 test2 test3");
$this->delete_image($image_id);
send_event(new DeleteAutoTagEvent("test1"));
send_event(new DeleteAutoTagEvent("test2"));
$this->get_page('auto_tag/list');
$this->assert_title("Auto-Tag");
$this->assert_no_text("test1");
$this->assert_no_text("test2");
$this->assert_no_text("test3");
}
}

36
ext/auto_tagger/theme.php Normal file
View File

@ -0,0 +1,36 @@
<?php declare(strict_types=1);
class AutoTaggerTheme extends Themelet
{
/**
* Show a page of auto-tag definitions.
*
* Note: $can_manage = whether things like "add new alias" should be shown
*/
public function display_auto_tagtable($table, $paginator): void
{
global $page, $user;
$can_manage = $user->can(Permissions::MANAGE_AUTO_TAG);
$html = "
$table
$paginator
<p><a href='".make_link("auto_tag/export/auto_tag.csv")."' download='auto_tag.csv'>Download as CSV</a></p>
";
$bulk_html = "
".make_form(make_link("auto_tag/import"), 'post', true)."
<input type='file' name='auto_tag_file'>
<input type='submit' value='Upload List'>
</form>
";
$page->set_title("Auto-Tag List");
$page->set_heading("Auto-Tag List");
$page->add_block(new NavBlock());
$page->add_block(new Block("Auto-Tag", $html));
if ($can_manage) {
$page->add_block(new Block("Bulk Upload", $bulk_html, "main", 51));
}
}
}

Some files were not shown because too many files have changed in this diff Show More