** Warning huge post ahead^^ **The main problem on the Message.php Page is, that there are no tags to get from HTML-Code.
Example Search-Item look like this:
You can get the Tag here within the title attribute- Code: Select all
<li class="gallery-item" id="365456" title="Angel, Non-Vore, Criss Rose">(...Element with username img etc...)</li>
But on the Message site the Elements look like this: There are no tags to search trough
- Code: Select all
<li class="gallery-item ui-selectee">
<div class="context-icons" style="display: none;">
<span alt="D" src="img/t14.gif" class="triicon14 icon-delete"></span>
</div>
<div>
<a class="thumb" href="/g4/view/365602"><img src="//static.aryion.com/g4/thumb/365602-62224-thumb.auto.jpg" alt=""></a> <p><input value="119419966" name="msg[]" type="checkbox"></p>
<p class="item-title">Flutterbat Spelunking</p>
<p class="g-small">By: <a class="user-link" href="/g4/user/PegaSUS">PegaSUS</a></p>
<p class="g-small"><span class="pretty-date" title="Oct 23rd, 2016 11:28 PM">16 hours ago</span></p>
</div>
</li>
There is
no possible solution to get Tags without requesting them (and may save them to memory for every element - for only 1 time request) but I guess its to hard to realize it. If there can be tags within the element it can be possible.
To avoid much load on Ekas side there are these solutions:
- Sending a Hashed URL or ID to an External Server with a Database
Technical:
- The Image-Link-URL or ID it can be hashed and send to a Server where the Tags are saved. IF there is not a record for this Hash, it will request the target Element 1 time and save the Tags on the Server assigned to the hashed URL/Id.
- Of course we can add Search, Tagged and Lastest updates to this process for filling the Database bec it DOESN'T need an extra request and holding the Database up to date is easier.
- To hold the Database (Tag changes) up to date, we can check all tags from Search, Tagged and Lastest updates sites and hashing a alphabetic sorted array to check if the tag hashes matches - if not update them - but only on Search, Tagged and Lastest updates bec it DOESN'T need an Page-Request. On Messages you may get old data from the server
- To avoid much Server traffic and respecting User-Privacy the client has its own database and only request new Data from Server if:
- A button is clicked (Sync Database)
- A Hashed ID/Image URL is not in the local Database
- Local tags has changed
- Then also syncing if the server is up to date
- May save the Date of the post and delete old ones bec. the database is more for messages and old messages never appear again in the inbox (maybe older that 6months will not saved to db or with an empty entry and return value that its old) it can help to upkeep the performance
- Save them with Date and Hash and and extra value that show that its to old tags should be empty to save memory
- Cleanup the database every week once
- Last cleanup has to be saved^^ to do the next cleanup after 1 week on user request automaticly
- Advantages:
- Better results for ALL users (because every user get the results of every other user)
- May better performance
- Every time avialable to get the whole Database (if you changes browser and so on)
- Disadvantages:
- Complex to code
- Needs an extra Server/place for a DB
- User may worry about privacy (IP-Address from requests)
- Tags can saved only Local
Technical:
Basicly like the Server but without syncing and this stuff
- Advantages:
- Easy to code
- User don't have to worry about their privacy because its local
- Don't need an extra Server or such stuff
- Disadvantages:
- The results can be bad not so wide (because the user has to get all the stuff by himself browsing on lastest updates etc)
- If the User switches the browser the local Database is gone
- Maybe performance issues
- Eka build in the missing info (Tags) on the message.php site and we only need to filter stuff out without a database - but i guess that will not happen
Its to hard to build it - it canbe done but a huge amount of work and just for some user I guess its to much work in comparision of the use =/ It would be funny to build such a system (Server or non-server one)
------
I absolutely want to avoid additional page requests. We shouldn't do anything that would give Eka a reason to shutdown this project, or ban discussion of it here.
Yeah I agree with that
We can cache that data any time it's incidentally available, on the "Latest Updates" page, the individual image pages, or even the iframe box that pops up when you hover over something on the main page, and then apply it as a filter anywhere that we can see the image's id number (which is part of the URL for it, so pretty much anywhere).
Sure that can be made, but it work only for seen images if storaged local it has less effectivity, but you're right you can avoid some of the blacklisted tags with this method in you messages
That can made like the method with the server just without the Server. We can store them as objects like this: (Maybe save them within an SQLLite DB as json Data if possible or as array in local storage)
- Code: Select all
PostObject {
// Member
private id:int;
private tags:array;
private hasBlacklistTags:bool; // Has to recheck if user add/remove tags from his list - has also to be checked if tag changes on this object - is a value for faster checking all object (presaved)
// Methods:
public bool:hasTag(tag:string);
private void:addTag(tag:string);
private void:removeTag(tag:string);
public bool:hasTagsChanged(array);
private void:setTags(tags:array);
public array:getTags();
public string:getId();
public void:setId();
static public int:extractId(imageURL:string);
static private string:tagsToTagHash(tags:array|null);
}
I'm not realy a JavaScript Geek, so what do you think? Can the local Database get performance issues if it gets to big? If yes how can we solve it?
Edit: Id can saved insteed of hashed url you're right^^
-------------------------------------------------
I've done many optimations on the code and
I've add a reshow button if you want for whatever reason to reshow the blocked content without unblocking everyone. By default blocked content will not be shown until you hit that button. And after a page refresh blocked content is gone again its only for checking it for whatever reason^^ See example:
You can get the script
here until/if WHTB merges the
changesEdit:
Found a bug on the message page, will try to fix it at weekend - until then I don't have time for that - have work to do