Commit graph

63 commits

Author SHA1 Message Date
Stefan Parviainen
647311db3e Directory sorting as a dropdown, forum filter as checkbox, option to sort oldest first 2014-12-07 12:31:12 +01:00
friendica
5bb794cc28 allow directory searches to be filtered by (public forums) and/or (! public forums) 2014-11-23 18:22:19 -08:00
Stefan Parviainen
c8c061d0cf Fix dirsearch with quoted single-word term 2014-11-18 13:48:22 +01:00
Stefan Parviainen
ece9819b4d Fix dirsearch parser to not get confused by logic terms in names and to handle quoted single word names 2014-11-17 18:51:37 +01:00
Habeas Codice
ac27db22c1 Merge remote-tracking branch 'upstream/master'
Conflicts:
	boot.php
	include/dba/dba_driver.php
	include/diaspora.php
	include/follow.php
	include/session.php
	include/zot.php
	mod/photos.php
	mod/ping.php
2014-11-13 13:06: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
5619902776 indicate public forums in directory results (there will be some [possibly considerable] lag time before existing forums are correctly tagged). 2014-11-10 17:44:02 -08:00
friendica
75fc3a8ceb for webpages, hide the mimetype selector unless in advanced mode. For pages that endless scroll and show blocky-block things, set the default items-per-page to 60. Why? It fits column-widths of 2,3,4,5,6,10,12,15, and 20 without leaving remaindered items dangling at the end. No other setting less than 100 has this much versatility. 2014-09-07 19:16:48 -07:00
friendica
95def2a247 retro-actively set standalone directory fix, also a fix for directory endless scroll when you hit the end. 2014-08-28 19:05:13 -07:00
friendica
b8a5b7a610 restrict returned directory contents to xchans in the zot network. We could probably add other networks to this and create a distributed directory for the free web. It's highly unlikely we would do this but we *could*. 2014-08-20 19:36:01 -07:00
friendica
4a76925787 some more work on realms 2014-08-17 19:06:56 -07:00
friendica
33034bc9b6 limit updates from new dir servers to avoid exhausting memory. 2014-06-29 18:18:29 -07:00
friendica
cc22c1da50 keep dirsync from exhausting memory 2014-06-29 18:11:10 -07:00
friendica
ed14c1f224 more work on firehose 2014-03-26 18:45:01 -07:00
friendica
09dde2810c failed experiment - revert the directory to 80 results per page until somebody implements endless scroll on the thing. 300 takes far too long to load all the images. 2014-03-10 23:47:45 -07:00
friendica
a79072ce47 update cacert.pem , don't hide url link for rmagic 2014-03-09 13:53:55 -07:00
friendica
bef416a2d1 advanced search front-end 2014-03-08 17:39:20 -08:00
friendica
20ef3aee72 back-end for advanced directory search 2014-03-08 15:53:55 -08:00
friendica
4da73d7d84 stopgap solution until somebody implements endless scroll on the directory 2014-03-04 19:34:04 -08:00
friendica
3d49bf0320 directory sync issues 2014-03-03 21:00:42 -08:00
Thomas Willingham
a49704fdb6 Probably shouldn't list REGISTER_CLOSED sites on a list of open hubs. 2014-01-14 03:50:32 +00:00
friendica
c1875bcc37 cut/paste error 2013-12-25 02:04:52 -08:00
friendica
fe00e9b261 extend the directory profiles a bit more 2013-12-25 01:57:04 -08:00
friendica
8194ade886 improve the directory popup a bit 2013-12-23 19:44:23 -08:00
friendica
b08d4cc1fe first cut at a directory popup. It's a bit annoying at the moment, so we'll have to make it less so. Also had second thoughts about the project homepage changes made yesterday. Just because a bunch of Reddit trolls can't get social networking out of their brain long enough to explore other technologies or even read the project page doesn't mean we should pander to them and explain how or why we either are or aren't a social network. 2013-12-23 17:24:25 -08:00
friendica
bf709d49ba dirsearch and pubsites - force non-SSL sites to float to the bottom of the list 2013-11-14 18:36:09 -08:00
friendica
b26989bb65 removeme sort of works for a single channel - lots of loose ends to deal with but it's a start 2013-11-12 18:27:36 -08:00
Thomas Willingham
c030330abc Fix safe search, and also make it an xconfig 2013-11-09 15:36:14 +00:00
friendica
8b9633e46b DB - allow private messages to expire 2013-11-06 17:27:51 -08:00
friendica
a966e53ee4 hmmph. That's why the sort order didn't change... 2013-11-03 15:22:22 -08:00
friendica
cea11c9498 make date order the default for the directory 2013-11-03 15:20:40 -08:00
friendica
2035a5dd76 allow zot public providers to list their location, as a non US-based server could be a strong selling point. 2013-10-30 01:58:45 -07:00
friendica
3da20b3797 directory leaking hidden channels - logic issue 2013-10-24 18:34:55 -07:00
friendica
55c43f12b5 directory date order (sort=date) 2013-10-12 15:12:45 -07:00
friendica
2353e6d23f small fixes 2013-09-30 19:28:59 -07:00
friendica
e992cfeca9 directory sync - this will either work, or it won't work, or it will possibly recurse and blow up the matrix. Hard to say. Do you feel lucky? Well do ya' ... punk? Rule #1 - don't mess with anything unless it's blowing up the matrix. If it doesn't blow up the matrix, but doesn't work, just let it go and let's figure out what it is doing and what it isn't doing.
The flow is as follows:
Once a day go out to all the directory servers besides yourself and grab a list of updates. This happens in the poller. If we've never seen them before add them to the updates table. The poller also looks to see if we're a directory server and have updates that haven't yet been processed. It calls onedirsync.php to process each one. If we contact the channel to update and don't find anything (we're just doing a basic zot_finger), set a ud_last timestamp. If this is set we will only try once a day for seven days. Then we stop trying to update.

This will probably cause a spike the first time through because you haven't seen any updates before, but we spread out the load over your delivery interval.
2013-09-30 18:33:27 -07:00
friendica
49882c13a4 there's our directory sync packet (aka transaction log). Now we just have to pass them around and act on them. 2013-09-29 22:24:37 -07:00
friendica
cdfb5f9dc7 adult channel setting 2013-09-22 20:38:24 -07:00
friendica
6cb81f6e47 use &safe=-1 for unsafe only 2013-09-19 21:36:22 -07:00
friendica
54abed8457 provide a "safe search" backend and allow for self-censorship using nsfw or adult profile keywords. Eventually the directories will be forced to mark adult profiles and sync this knowledge between them. At the moment there's no way to do an unsafe search, but we really just need a checkbox and pass the value through directory to dirsearch on the back end, and some will want this as a pconfig. 2013-09-19 19:50:13 -07:00
friendica
e4d2e2200e add "tiered" access policy, add tagcloud to directory pages 2013-09-18 17:47:26 -07:00
friendica
f7acc94bfe provide the back-end for a directory tag cloud 2013-09-17 22:52:46 -07:00
friendica
d3aa31be4d site sellpage links 2013-09-17 22:27:51 -07:00
friendica
129a119c84 implement what I hope will now be the server side of directory sync, add viewsrc to item_photo_menu, and log what changed in import_xchan update objects so we can find out why there are so many updates when nothing _obvious_ has changed that should trigger it. 2013-09-15 03:48:43 -07:00
friendica
75dfcf9c4f quick fix to directory 2013-09-09 13:45:51 -07:00
friendica
2c53017fb5 function name 2013-09-05 22:23:57 -07:00
friendica
c65ea0b97b public site list (will take a few days to populate, assuming folks have updated their site access policy which old sites do not have) 2013-09-05 22:00:06 -07:00
friendica
99bd0712b6 Add a site access policy (to determine if this is really a public site or just an open site) and add an orphan flag to xchans in case all their hublocs go away. Get rid of a couple of DO NOT EDIT template messages which were still lurking in the tree. 2013-08-06 17:15:41 -07:00
friendica
e6a8bb211c connect link in directory 2013-08-03 16:35:55 -07:00
friendica
d571ac02b2 provide a way to search the directory by modification date 2013-07-14 22:53:28 -07:00