Backlinks tracking / Отслеживание обратных ссылок
EN: We need internal tracking of backlinks - so that on each photo it would be indicated where else it was mentioned. Like in Github, for example.
RU: Нужен внутренний трекинг обратных ссылок (backlinks) — чтобы на каждой фотографии было бы указаны где еще она упоминалась. Как в Гитхабе, к примеру.
Stale issue message
This would be better to do together with https://github.com/PastVu/pastvu/issues/239#issuecomment-1218488456 . When link to another photo is added the the comment (news or photo), event for each destination photo mentioned in the comment is triggered. This event can be used:
- For notifying interested parties e.g. photo author and any subscribers, see #239
- For storing relation between photo and comment IDs (through some event listener and processing function).
The data from relation map can be used to output information on the photo page (mockups will be required at the later stages of implementation).
Suggested logic:
- when comment is created:
- check if comment contains links to photos, trigger event for each link.
- when comment is edited:
- check if comment contains links to photos, check existing relations that belong to the same comment -> for missing relations trigger event for each new link, for existing relations do nothing, delete relations that no longer in the list of comment links.
- when comment is deleted:
- check if comment contains links to photos, delete existing relations that belong to the same comment.
- when destination photo (the one mentioned in comment) is deactivated/reactivated:
- toggle
destActiveflag at relation record, this can be used to render photo link in comment formatted in some way (strikethrough for instance) when photo is not available (this is optional feature)
- toggle
(news or photo),
... or user profile
when comment is deleted:
- check if comment contains links to photos, delete existing relations that belong to the same comment.
Our comments is not deleted really, but marked as "deleted". This is important.
Therefore, relations for deleted comments also should not be deleted, but marked as "deprecated/inactive". If comment was restored, these relations also may be activated.
This logic also should be applicable not for comments only, but also for image descriptions.
OK, so the relation record (and event) in this case will also contain entity type (comment, user or photo). Similar logic will apply on them too (e.g. when photo is deactivated, active flag in relevant relations records will be updated).