[Meta] FreeGameDev changes NEW: https://freegamedev.net

Re: [Meta] FreeGameDev changes NEW: https://freegamedev.net

Postby Julius » 10 Jun 2021, 15:58

Still another issue it seems. I added the extra ")" though.
“Reality is that which, when you stop believing in it, doesn’t go away.” - Philip K. Dick
User avatar
Julius
Community Moderator
 
Posts: 3116
Joined: 06 Dec 2009, 14:02

Re: [Meta] FreeGameDev changes NEW: https://freegamedev.net

Postby bzt » 10 Jun 2021, 23:37

Huh? What version of Flarum are you running?
{l Code}: {l Select All Code}
Unable to query the database: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'b.hidden_at' in 'where clause'
According to the official site's sql dump, both the discussions table (line 74) and the posts table (line 228) should have a "hidden_at" field. If there isn't then I really honestly don't now what you meant by "private tag" if not the "is_private" fields.

Anyway, here's a fix, hidden_at removed, use this sql:
{l Code}: {l Select All Code}
   $sql = "SELECT a.id, a.title, a.slug, a.last_posted_at, a.comment_count, b.username, ".
      " TIMESTAMPDIFF(SECOND, a.last_posted_at, NOW()) as t, ".
      " DATE_FORMAT(a.last_posted_at, '%a, %d %b %Y %T') as d FROM ".
      $config["database"]["prefix"]."discussions as a LEFT JOIN ".
      $config["database"]["prefix"]."users as b ON a.last_posted_user_id = b.id ".
      "WHERE b.id IS NOT NULL AND a.is_private != 1 AND b.is_private != 1 ".
      "ORDER BY a.last_posted_at DESC LIMIT ".$limit.";";
Hope this will finally work.

Cheers,
bzt
User avatar
bzt
 
Posts: 32
Joined: 23 May 2021, 21:46

Re: [Meta] FreeGameDev changes NEW: https://freegamedev.net

Postby Julius » 11 Jun 2021, 12:32

I use the latest stable Flarum release 1.0.2.

The columns "is_private" (and "is_approved", something we probably want to use in the future), exists in the DB, so I am not sure why your new code is still failing.

But you are right, the "is_private" seems to refer to another mechanism than the private tags that are used to hid certain posts from non-authorized users. I'll look a bit closer to where that is stored in the database, but it seems odd that this isn't done at the "post" level.
Edit: hmm, this looks like it is designed to not store that at "post" level but rather indirectly through the tag association and the "is_restricted" column in the "tags" section. I guess that is due to the modular nature of Flarum with tags not being a core feature :-/
“Reality is that which, when you stop believing in it, doesn’t go away.” - Philip K. Dick
User avatar
Julius
Community Moderator
 
Posts: 3116
Joined: 06 Dec 2009, 14:02

Re: [Meta] FreeGameDev changes NEW: https://freegamedev.net

Postby bzt » 11 Jun 2021, 13:19

Julius {l Wrote}:I use the latest stable Flarum release 1.0.2.

The columns "is_private" (and "is_approved", something we probably want to use in the future), exists in the DB, so I am not sure why your new code is still failing.
Because I've used the official DB scheme, but it looks like you're having a different one? There's no "is_approved" field at all for example...

Julius {l Wrote}:But you are right, the "is_private" seems to refer to another mechanism than the private tags that are used to hid certain posts from non-authorized users. I'll look a bit closer to where that is stored in the database, but it seems odd that this isn't done at the "post" level.
Actually it is. The problem we're having is that in your DB there's no "is_private" field in the posts table, but it should be. At least in the official sql dump it exists.
Julius {l Wrote}:Edit: hmm, this looks like it is designed to not store that at "post" level but rather indirectly through the tag association and the "is_restricted" column in the "tags" section. I guess that is due to the modular nature of Flarum with tags not being a core feature :-/
Ok, absolutely no "tags" table...

To get this solved in short time, may I ask for an sql dump of your current DB? You can remove all sensitive information if there's any, I'm only interested in the schema. With that I can create a sql query which filters everything out that you want filtered out in no time. It is very strange that your schema differs to the official one, not just you have more tables for the modules, but some fields in core tables are missing too.

Cheers,
bzt
User avatar
bzt
 
Posts: 32
Joined: 23 May 2021, 21:46

Re: [Meta] FreeGameDev changes NEW: https://freegamedev.net

Postby Julius » 11 Jun 2021, 13:38

The "is_private" column definitely exist my my database under "posts".

I thin the problem is that the "core" Flarum is intentionally stripped down to the bare minimum and most stuff is managed through extensions that are often bundled with the core, like the "tags" one.

As for debugging this further, let me try the newly updated syndication extension first, maybe that solves the issue anyways and is probably nicer as you can subscribe to specific categories etc.
“Reality is that which, when you stop believing in it, doesn’t go away.” - Philip K. Dick
User avatar
Julius
Community Moderator
 
Posts: 3116
Joined: 06 Dec 2009, 14:02

Re: [Meta] FreeGameDev changes NEW: https://freegamedev.net

Postby bzt » 11 Jun 2021, 14:08

Julius {l Wrote}:The "is_private" column definitely exist my my database under "posts".
Then that sql error makes no sense.

Julius {l Wrote}:I thin the problem is that the "core" Flarum is intentionally stripped down to the bare minimum and most stuff is managed through extensions that are often bundled with the core, like the "tags" one.

As for debugging this further, let me try the newly updated syndication extension first, maybe that solves the issue anyways and is probably nicer as you can subscribe to specific categories etc.
Yikes, but does it support non-login, suckless, simple list of new posts? I'd only want to quickly check if there's a new post, without logging in or enabling js, exactly the same that phpBB does out-of-the-box with active topics. I like simple.

Cheers,
bzt
User avatar
bzt
 
Posts: 32
Joined: 23 May 2021, 21:46

Re: [Meta] FreeGameDev changes NEW: https://freegamedev.net

Postby Julius » 11 Jun 2021, 18:54

Please test the syndication feeds (it is limited to the last 20 entries as well):
https://freegamedev.net/d/1-welcome-to- ... -forums/22
“Reality is that which, when you stop believing in it, doesn’t go away.” - Philip K. Dick
User avatar
Julius
Community Moderator
 
Posts: 3116
Joined: 06 Dec 2009, 14:02

Re: [Meta] FreeGameDev changes NEW: https://freegamedev.net

Postby bzt » 11 Jun 2021, 21:16

Julius {l Wrote}:Please test the syndication feeds (it is limited to the last 20 entries as well):
https://freegamedev.net/d/1-welcome-to- ... -forums/22
It is terribly slow, but probably this hurts you (and your server) much more than me. I can wait after all...
{l Code}: {l Select All Code}
$ time curl https://freegamedev.net/atom -s -o /dev/null
real   0m1.008s
user   0m0.033s
sys   0m0.015s
$
I've repeated the download several times, the best was 0.47 sec.

It is not refreshing (the same nginx expire configuration issue as with rss.php):
{l Code}: {l Select All Code}
$ curl -I https://freegamedev.net/atom
HTTP/2 200
server: nginx
date: Fri, 11 Jun 2021 20:05:51 GMT
content-type: application/atom+xml; charset=utf8
x-content-type-options: nosniff
referrer-policy: same-origin
x-powered-by: Flarum
x-csrf-token: sKXkdTBUfrpOAXxGrEsUrKk9OphKud3DLo5RB0Ea
set-cookie: flarum_session=owDg6MblteFheXQYfw0YvnGisIKVwG2cwE32stpn; Path=/; Expires=Fri, 11 Jun 2021 22:05:51 GMT; Max-Age=7200; Secure; HttpOnly; SameSite=Lax
last-modified: Fri, 11 Jun 2021 18:49:53 GMT
cache-control: max-age=3600
expires: Fri, 11 Jun 2021 21:05:51 GMT
(See that "max-age=3600"?)

About the atom feed:
- there are no dates. Neither absolute nor relative, so I cannot see when the posts were made.
- incorrect charset is specified ("utf-8" vs. "utf8")
- there's a validation error because it does not remove all tags?
- does not pass the validation: https://validator.w3.org/feed/check.cgi?url=https%3A%2F%2Ffreegamedev.net%2Fatom

About the rss feed:
- for some reason there are no links, so I can't go to the discussion
- I can't see who made the post (username is missing)
- same charset issue as with the atom
- does not pass the validation: https://validator.w3.org/feed/check.cgi?url=https%3A%2F%2Ffreegamedev.net%2Frss

I hope this helps.

Cheers,
bzt
Attachments
fgdrss.png
fgdatom.png
User avatar
bzt
 
Posts: 32
Joined: 23 May 2021, 21:46

Re: [Meta] FreeGameDev changes NEW: https://freegamedev.net

Postby Julius » 11 Jun 2021, 22:07

Thanks, will report the issues upstream. About the dates/time... my feed reader does show them. Seems maybe an issue of the Firefox plugin you are using?

Indeed this looks like a more heavy weight solution, I'll have to see what the impact on the server is.
“Reality is that which, when you stop believing in it, doesn’t go away.” - Philip K. Dick
User avatar
Julius
Community Moderator
 
Posts: 3116
Joined: 06 Dec 2009, 14:02

Re: [Meta] FreeGameDev changes NEW: https://freegamedev.net

Postby bzt » Yesterday, 17:16

Julius {l Wrote}:Thanks, will report the issues upstream. About the dates/time... my feed reader does show them. Seems maybe an issue of the Firefox plugin you are using?
Yeah, could be. But if the rss feed would include the poster's name and working links, I wouldn't care. Actually I would be happy with the poster's name, I can copy'n'paste the url to the address bar if I want to.

Julius {l Wrote}:Indeed this looks light a more heavy weight solution, I'll have to see what the impact on the server is.
This is something you have to decide yourself. I don't mind if I have to wait a few secs. Otherwise this looks promising, provides the list of latest posts without logging in or enabling js, so looks good for me :-)

Cheers,
bzt
User avatar
bzt
 
Posts: 32
Joined: 23 May 2021, 21:46

Who is online

Users browsing this forum: No registered users and 1 guest

cron