Xenforo does not show updated values after manually changing in database - xenforo

I have a Xenforo forum with Waindigo Custom Fields addon. I created a custom group with 3 fields: Address, Latitude and Longitude.
A thread is created with initial values as example below:
- Address A
- Lat A
- Long A
Later on I want to change these values. Because Xenforo & Custom Fields addon don't provide the function to change them. I decided to make change directly on database. The table is MySql is xf_thread_field_value. I changed values of 3 rows coresponse to that thread.
But after refreshing the browser (CTRL+F5), the values are still the same. I tried to cron the cache in admin panel but no luck.

You should try to rebuild posts cache. XF keeps the posts from last days cached for performance (the exact number of days is configurable in the Options)
To rebuild the caches, go to Tools -> Rebuild Caches

Related

MySQL/PHP - change status depending on date

I have a MySQL Table, let's say for blog posts. They have a column status which cam be active or inactive and two columns which are optional: publish date and expire date for scheduling posts.
Which solution do you recommend for changing the status depending on the publish date and expire date? Can I do this with a PHP script or cronjob ?
EDIT 30.11.16 / 16:50
Perhaps I have to be more precise about my specific problem: I have a magento store and I would like to add the possibility to schedule teasers. I want to change the existing code as little as possible.
I would say, it depends, but as #ADyson sad you should't only work with a cronjob, because it show some posts that should have been expired.
But you think about to write a single class/function that handle the status and expiration / publish date logic. It will be a mess later, if you have the code copy in the cronjob and on different output pages.
I also would think about the status field, maybe it is not necessary, if you make some MySQL Selects like
...
WHERE publish_date>now() AND expire_date<now()

Can't search records added by other user in MS ACCESS

Hello helpful internet strangers. I have created a fairly simple database for a client that has one main entry form and a search form that uses unbound text boxes for searching around 15 fields.
Details are below, but here is my problem: When I add new records and use the search form all the fields work as expected and return the correct results in the datasheet. When I sent the database to the client and they add new records, they are not returned in the search. I had them save the database with their records and send it back to me, and I confirmed that when I search for the records they added (I can see the records in the table) they are not returned in the search. If I add new records to the copy they sent me back, my records do appear in the search.
I created the database in Access 2013 on a Windows 8 machine. The client is using Access 2010 on Windows Vista.
The field types are text, dropdown and date. The dropdowns are all based on lookup queries so they store the id number in the main info table and pull the name value from the query. All of the fields in the search query are written to allow nulls, including the date range searches. And again, all fields test out correctly on my machine when I enter the records.
I went on site and compared settings and nothing jumped out at me except the different versions. I also watched the client enter new records and she didn't do anything 'wrong' or unusual. When I try to do a save as 2007-2010 it says I am using features that won't allow for that, but for the life of me I can't think of anything like that since this is really a very straightforward design.
I'm going to do a package as executable, but am highly doubtful that will help. Any insights?
Thanks in advance.
A few things. Most important - always, always develop in the earliest version of Access that the system will be used with. So, you need to rebuild, using Access 2010, period. Try creating a new blank database (in 2010) and importing the objects one (or a few) at a time. Make sure the system is split. One file for the FE (forms, queries, reports, code, etc.) and one for the BE (tables only). Make sure that the Filter On Load property of all forms is set to No. If the recordsource for the form contains a where clause, make sure that the newly entered records meet the criteria for the where clause.

Access Web Application Data Macro to Sum values in Query and return as variable

I am working on a small application in Access Services on SharePoint to log colleagues leave requests, and I need to work out a data macro to calculate how many days of leave they have remaining from their allowance.
I have a table [Colleagues] with all of the user data, for simplicity I'll reduce it to [Email] and [Allowance] in days. I have another table which stores the requests [Requests] including the number of days to deduct in each approved leave request [Days Requested].
I have set up a query that returns all approved requests for the colleague and I would like to use a data macro that is triggered to run when the colleague logs in. As you cannot use aggregate functions in Web Applications, I am currently using ForEachRecord in the query to total the number of deductible days, however I cannot work out how to return that to a field in the [Colleague] record.
According to the Access help, I should be able to set the value to a LocalVar and use it in expressions as simply as referencing [Deductible Days], however this is not working.
Any help?
I finally worked this out after much tinkering.
In my query I included the [Colleague Email] field as well as the [Days Requested] field, and then when my Application loads it navigates to a form created from the [Colleagues] table. I have modified the Data Source of the form to link the [Email] field in the query results to the [Email] field in the [Colleagues] form.
Following this I was able to create an unbound textbox with the data source =Sum([Days Requested]) referring to the relevant field in the query. Voila! I now have the value to play around with in my application.
Hope that helps, took a lot of fiddling around. No data macros needed after all, but its a method I shall remember in future, opens up a lot of possibilities.
If I understand your situation correctly, I was faced with a very similar problem.
I believe the solution used here will work for you. It involves using a query to Sum up the values (we would use Sum where he used Count), use a Data Macro to run the query and then have have an On Insert/On Update trigger the Data Macro:
http://devspoint.wordpress.com/2014/03/26/validating-data-with-data-macros-in-access-services-2013/
Let me know if this works for you. It worked for me!

Weird SQL Behaviour

A view that hase been running for years selects specific columns from several tables and joins them.
Recently, I added a column to one of the tables, and the vew no longer worked properly.
One of the columns in the query result contained data that was from another column in the table.
I rebuilt the view from a script - no changes to the script - and the problem went away.
The view does not look at the new column.
What is going on?
Your query is using SELECT *. You simply need to recomple it.
When the view is compiled, it compiles the offset of the fields in the record, rather than the names of the field. If the underlying table changes . . . well, the offsets no longer go to the correct positions.
I, unfortunately, learned this once upon a time after about 5 hours of trying to figure out why a number was getting a numeric error -- starting at 6:00 a.m. So, this problem can even effect different types of data.
I do the recompile by scripting out the view as an alter, using SQL Server Management Studio, and then running the code (without any changes). However, you could change the code by putting in the explicit list of columns, and not having this problem in the future.
You can also set up a script that recompiles all your views every evening, to prevent this problem in the future. We now have such a script as well.

Rails 3 - increment_counter increments twice

When I run this line of code
Movie.increment_counter :views, #moive.id
So the column views will be incremented twice (+2, not +1). In terminal I see this ran query to database:
UPDATE `movies` SET `views` = COALESCE(`views`, 0) + 1 WHERE `movies`.`id` = 8
If I attempt to run this query direct to MySQL, co the value of views is incremented correctly once (+1).
Any tips, what am I missing or I haven't set up?
Are you tracking page views by any chance? I ran into this as well- for every page load I would see the page view counter increment by three rather than 1, but only in production.
It turned out to be Google's Adsense code loading the page remotely. I noticed that they hit the page twice for every time one of my users would hit the page, effectively resulting in 3 page views. I suspect they do this to verify that content on the page meets their guidelines and to help match ads appropriately to page content. Check your httpd logs for Mediapartners-Google. I bet that's what's going on.
General advice: use Google Analytics (or similar service) for tracking page views. In my case I still needed to track this in a DB because I implement autocomplete based on "popularity" of certain page actions, but you might not need this.