Jump to content

Edward Cufaude

  • Posts

  • Joined

  • Last visited

Everything posted by Edward Cufaude

  1. Thanks for reply, I will go investigate extending selector parsings and possibilities that open up if using raw mysql queries.
  2. I'm already building custom selectors for this page. This is what I have at moment, it sorts by -numberwatchers (this is my votes field) and then by -published in case number watchers is same. $results = $pages->find("template=contest, contest_closing_date>$currenttime, limit=6, sort=-numberwatchers, sort=-published"); Is it possible to do it in a selector? or do you have to do something along the lines of load every page, do the calculation on every page and then select from an array of pages to do it at runtime?
  3. That's an interesting idea on a way to achieve it, the first thing that comes to mind is whether that is fast. I'm looking at thousands of page visits a day and thinking that's a lot of extra writes to the database.
  4. I'd just like to ask how you guys would you go about this, as I'm not sure whether my proposed solution is the easiest method of achieving this. I have a basic voting system setup and an integer field on each page which increments every time someone votes on something, I also store the pages voted on in each user, I can then sort pages by number of votes, and also display to the user a list of pages voted on. So far it is working good. Now I'm looking at creating a list of sorted pages that is more dynamic. So something like the number of votes divided by number of days since the page was published, so a newer page with 10 votes on in 1 day (10 votes per day) will come above the page that has 12 votes over 2 days (6 per day) because although 10 votes is less than 12, the number of votes over time is greater so therefore it comes out higher. Basically something similar to how sites like reddit do their sorting as it is more dynamic based on users, but items can drop off if popularity doesn't keep up. My thoughts are that you could have a separate field on each page, which is number of votes divided by time since published for each page which is updated when a vote is placed and say every hour using a script in a cron job, so pages without new votes also get updated. But I'm not sure whether that is the right thing to do as I'm not sure whether updating multiple pages at regular intervals is a good idea if the number of pages gets large and wanted thoughts on whether this could be done a simpler way.
  5. The new line causes the value for replies and all to both be filled in with 4 instead of 2 for Replies and 4 for All with the line commented out.
  6. I'm just reporting this here in case anyone else has same problem, as I've spent the last few hours trying to get comment reply notifications to work. Finally discovered that this line in the comments.js file causes a problem. It was nullifying the values in the reply form from a cookie of previous values. So instead of setting Off, Replies and All radios to 0 2 and 4 values. It was setting them to all to value = "" causing the replies notification to not work, so anyone with a set cookie couldn't use notifications. I think it happens when you had comment replies turned off in the field settings and make a comment, causing the browser to have a cookie, but then turning notifications on. Then and the radios get nullified values from the previously set cookie. Commenting out this line caused reply notifications to start working for me. $form.find(".CommentFormNotify :input").val(values[3]);
  • Create New...