Commit graph

111 commits

Author SHA1 Message Date
friendica
9c445e9817 incorrect check for sys ownership 2014-12-19 00:28:36 -08:00
friendica
f28103d595 wall tags 2014-12-15 14:37:31 -08:00
Habeas Codice
1a5a5c7edb PostgreSQL support initial commit
There were 11 main types of changes:
- UPDATE's and DELETE's sometimes had LIMIT 1 at the end of them. This is not only non-compliant but
it would certainly not do what whoever wrote it thought it would. It is likely this mistake was just
copied from Friendica. All of these instances, the LIMIT 1 was simply removed.
- Bitwise operations (and even some non-zero int checks) erroneously rely on MySQL implicit
integer-boolean conversion in the WHERE clauses. This is non-compliant (and bad programming practice
to boot). Proper explicit boolean conversions were added. New queries should use proper conventions.
- MySQL has a different operator for bitwise XOR than postgres. Rather than add yet another dba_
func, I converted them to "& ~" ("AND NOT") when turning off, and "|" ("OR") when turning on. There
were no true toggles (XOR). New queries should refrain from using XOR when not necessary.
- There are several fields which the schema has marked as NOT NULL, but the inserts don't specify
them. The reason this works is because mysql totally ignores the constraint and adds an empty text
default automatically. Again, non-compliant, obviously. In these cases a default of empty text was
added.
- Several statements rely on a non-standard MySQL feature
(http://dev.mysql.com/doc/refman/5.5/en/group-by-handling.html). These queries can all be rewritten
to be standards compliant. Interestingly enough, the newly rewritten standards compliant queries run
a zillion times faster, even on MySQL.
- A couple of function/operator name translations were needed (RAND/RANDOM, GROUP_CONCAT/STRING_AGG,
UTC_NOW, REGEXP/~, ^/#) -- assist functions added in the dba_
- INTERVALs: postgres requires quotes around the value, mysql requires that there are not quotes
around the value -- assist functions added in the dba_
- NULL_DATE's -- Postgres does not allow the invalid date '0000-00-00 00:00:00' (there is no such
thing as year 0 or month 0 or day 0). We use '0001-01-01 00:00:00' for postgres. Conversions are
handled in Zot/item packets automagically by quoting all dates with dbescdate().
- char(##) specifications in the schema creates fields with blank spaces that aren't trimmed in the
code. MySQL apparently treats char(##) as varchar(##), again, non-compliant. Since postgres works
better with text fields anyway, this ball of bugs was simply side-stepped by using 'text' datatype
for all text fields in the postgres schema. varchar was used in a couple of places where it actually
seemed appropriate (size constraint), but without rigorously vetting that all of the PHP code
actually validates data, new bugs might come out from under the rug.
- postgres doesn't store nul bytes and a few other non-printables in text fields, even when quoted.
bytea fields were used when storing binary data (photo.data, attach.data). A new dbescbin() function
was added to handle this transparently.
- postgres does not support LIMIT #,# syntax. All databases support LIMIT # OFFSET # syntax.
Statements were updated to be standard.

These changes require corresponding changes in the coding standards. Please review those before
adding any code going forward.

Still on my TODO list:
- remove quotes from non-reserved identifiers and make reserved identifiers use dba func for quoting
- Rewrite search queries for better results (both MySQL and Postgres)
2014-11-13 12:21:58 -08:00
friendica
d4759a5883 repeated content collapse on update from display page under rare conditions (when the conversation hasn't changed) 2014-09-18 16:32:05 -07:00
friendica
3d7d6ec21f honour sys channel permissions for who can view the sys owned content 2014-07-26 18:48:25 -07:00
friendica
00904d4994 cleanup 2014-06-19 16:09:02 -07:00
friendica
0f6c321e3f only show jotnets when posting conversation items 2014-06-14 20:16:40 -07:00
friendica
3dfcfbf85c issue #433 2014-06-10 22:35:15 -07:00
friendica
04cd60a0e3 add sys channel (discover) posts to "anonymous" search. They will by default be public. 2014-06-03 17:17:26 -07:00
friendica
6f570a7df3 mod_display: match "message_id begins with xxxx" as well as "message_id = xxxx" 2014-05-22 16:35:43 -07:00
marijus
9f621dac85 change the way jot tools are displayed/hidden 2014-04-08 22:07:06 +02:00
friendica
7b24b78af9 add fh to other page templates 2014-03-27 00:35:46 -07:00
friendica
7910221832 preparatory work for supporting a "list view" mode for conversations. This would be useful for forum-like channels and/or block-oriented themes. 2014-01-08 15:20:12 -08:00
zottel
b3e3073b99 JS-less display 2013-12-17 12:23:39 +01:00
friendica
1c5f98440d quite a bit of work on default acl permissions and various acl quirks 2013-11-29 14:09:21 -08:00
friendica
4415ed7820 mod_display - if we are given the mid of a webpage, redirect to that webpage. This lets us include webpages in searches and 'view in context' will do the right thing. 2013-10-28 18:20:04 -07:00
friendica
4ce948731a doc - complete hook list, still need detailed functional descriptions with parameters and examples for each 2013-10-18 15:48:59 -07:00
friendica
3772682204 Put a status editor on the display page if you're logged in. This fixes issue #113 and also provides the ability to reshare from that page. 2013-10-18 14:25:55 -07:00
friendica
454aa6bff3 turn off endless scroll if we have no more content to load - currently for mod_display, need to add to other content modules 2013-10-13 20:09:11 -07:00
friendica
a2b20bd58f one more edge case in the public perms - don't match perms = 0 which is private, this and prior checkin are for issue #114 2013-09-22 23:00:55 -07:00
friendica
956d275693 fixes for display and search privacy enforcement 2013-09-22 22:52:48 -07:00
friendica
de777d2f9c remove old debugging cruft 2013-09-10 21:17:33 -07:00
friendica
d194ee091a encode and decode channel names containing HTML special characters and quotes so they will survive a reshare without mangling 2013-09-06 05:25:10 -07:00
friendica
c0cc494bf3 fix mod-display when not logged in. 2013-06-18 02:06:16 -07:00
friendica
d3b5e67890 odds and ends in prepearation for photo abstraction, plus red-to-friendica addon 2013-04-25 01:55:35 -07:00
Thomas Willingham
fb8a0e06c4 Updated build_query for mid 2013-03-25 19:20:12 +00:00
friendica
23cd14329d fix mod_display breakage. 2013-03-24 19:51:23 -07:00
friendica
ddf5bf8968 rename 'uri' (and parent_uri) to 'mid' (and parent_mid) since these no longer remotely resemble uri's and are actually message_id's. This change is potentially destabilising because it touches a lot of code and structure. But it has to get done and there's no better time than the present. 2013-03-21 18:25:41 -07:00
friendica
1aa7561a2c improve mod/display for local users - use their own copy if possible 2013-03-02 14:46:09 -08:00
friendica
ba3cff6d9a progress on tag delivery 2013-02-11 00:20:14 -08:00
friendica
90c1ecca24 taming the wild mod_display 2013-02-10 17:03:33 -08:00
friendica
2cfd73c57d progress on mod/display - slow but any progress is good 2013-02-10 16:04:03 -08:00
friendica
99c5f88963 mod_display - no fun. Not working at all. But a bit of progress. 2013-02-10 04:55:29 -08:00
friendica
13ff4b9f01 bring back selective "mark unseen" on network page now that we can mark all unseen 2013-02-03 20:39:43 -08:00
Zach Prezkuta
a0d19ffb72 implement Smarty3 2013-01-06 15:57:11 -07:00
friendica
1c09e055c6 mod_display - now barely functional but that's a lot better than being totally buggered. 2012-12-20 22:17:10 -08:00
friendica
8d8ad7656e there are now 2 permalinks - one is the remote original post (plink) and the other is a pointer to a local copy (llink). mod_display is not longer tied to a particular id or channel so if a message is publicly viewable it will appear without any ownership info. 2012-12-16 02:18:26 -08:00
friendica
152641bf24 that was certainly some fun debugging (not) 2012-11-04 20:53:59 -08:00
friendica
79d7562526 this one is going to be hard 2012-10-23 22:01:18 -07:00
friendica
794c92a8fb wall posts now display - address book structure revamp started 2012-10-10 17:58:56 -07:00
friendica
3ebb4a3dc7 updates 2012-09-09 21:17:06 -07:00
friendica
dcbc0c0c95 major theme re-org, only duepuntozero and slackr working atm 2012-08-01 05:02:43 -07:00
friendica
02cc436ec7 Added urlify to try and create webbie auto-suggestions out of whatever unicode stuff gets thrown in as a name. Currently this will only work for latin/european/cyrillic/russian, but possible to extend to ideographic forms. 2012-07-30 18:51:44 -07:00
friendica
aeaccb03ba make network tag and personal searches work again 2012-07-16 21:07:59 -07:00
Alexander Kampmann
355c42cb30 Merge branch 'master' of https://github.com/friendica/friendica
Conflicts:
	include/config.php
	update.php
2012-04-05 13:39:15 +02:00
Simon L'nu
49540fb958 make auto-complete work in more places
Signed-off-by: Simon L'nu <simon.lnu@gmail.com>
2012-03-16 21:20:23 -04:00
friendica
7ad2dd6565 fix photos after permissions_sql change 2012-03-06 17:52:00 -08:00
friendica
88cd5800cf [privacy] rework latest fix 2012-03-06 17:21:14 -08:00
friendica
39a49d51e3 remove stray debugging 2012-03-06 16:28:52 -08:00
friendica
21887a36fd [PRIVACY] privacy issue bug #314 2012-03-06 14:53:14 -08:00