Something I would like to see is a block that would display the last time the database was updated. I'd like to have a "Last Modified" date displayed on my page, but since the real activity happens in the database and not the site files, the usual functions that display the last time a file was changed don't really provide much detail. Even a chunk of code that I could place in the footer would be useful.
This is one of the requirements of the CMS that will be chosen for my group to move forward with.
Has anyone seen anything like this or have any ideas on how to go about making something new?
Watch
GitHub Core
Show your support for Zikula! Sign up at Github account and watch the Core project!
GitHub Modules
- mesteele101 created topic »ERR (3): E_USER_ERROR: Smarty error: [in pagesvar:pagesitem2en line XXX]…« 01:39 AM
- mesteele101 responded to »Zikula 1.3.3 - Selecting a category in Pages not working« 01:29 AM
- mdee created topic »How to implement returnpage ?« 01:00 AM
- nestormateo responded to »Fillters in Clip« 24. May
- damon responded to »Can the Updated Version Check be Turned Off (Z 1.3)« 24. May
- frw responded to »Bug in the SMTP mail transfer protocol - Port 25 - Zikula 1.2.9« 22. May
- mdee responded to »Short URL questions« 22. May
Zikula Blog
- Anatomy of Open Source Projects on Mar 07
- Continuous Review on Mar 01
- Not Invented Here on Feb 24
- How to Contribute Your Code at Github on Jan 13
- 10 Steps to Coding-Nirvana: Tips for Successful Module Writing on Nov 12
- Submitting Bug Report Tickets That Get Results on Aug 17
- Cozi Tricks #1: Syntax Highlighting on Aug 07
Login
Block that shows when database was last updated...
-
- Rank: Team Member
- Registered: Mar 18, 2002
- Last visit: Oct 21, 2009
- Posts: 6606
Spire,
This is something that sounds trivial until you actually sit and think about it for a bit. At which point this becomes something that I don't believe there's a simple solution for regardless of which CMS you talk about especially when mysql is used as the backend.
I've had a quick look through the docs for adodb, mysql and PHP's mysql functions and there appears to be no way get the last database update. Even if there was you've got the sessions table which is updated on every page load with your last access time.
If mysql wasn't the backend then you'd have the option of stored procedures that could be used to track insert's to tables other than the sessions table. It would probably be possible to subclass adodb to keep track of the same but would require coding. A further solution could be a PostNuke hook module (providing create and update hook methods) but this would be a little hit and miss with 3rd party modules since they don't all call hooks.
In short there's no simple solution to this. There's nothing like a GetLastDBUpdate function for mysql. I think you'll struggle to find a generic CMS that cleanly implements this feature. Some may but I guess they'll be tied to a specific database engine (say one with stored procedures) or won't be as modular as PN.
-Mark
--
Visit My homepage and Zikula themes. -
**unknown user**
- Rank: Helper
- Registered: Mar 16, 2002
- Last visit: Oct 21, 2009
- Posts: 842
I expected something like this, Mark. I thought about the sessions table, and know that would be a problem, but I guessed (with nothing to back it up) that you could omit tables in the function.
What about the SHOW TABLE STATUS statement? I know it produces a lot more info, but surely it would be possible to parse the results somehow, get the dates for each table and determine which was the most recent and output that one? Again, my PHP is more theoretical in knowledge rather than practical at this point, so maybe I'm off base here.
If not, then my answer to the higher ups is a simple one. -
- Rank: Team Member
- Registered: Mar 18, 2002
- Last visit: Oct 21, 2009
- Posts: 6606
That's something i'd missed but the problem here is that it's a table operation. While you could take the relevant data from this query the problem would be which table are you going to operate on? If your site was heavily news orientated then you might run this on the stories table. If your content comes from a mix of modules you've more work to do. Don't forget that every query performed adds the load on the database and thus increases the time required to create the page.
Picking up on one other point in your original post I wouldn't necessarily create the solution as a block. Personally i'd write the code as a Xanthia theme plugin and add it to the bottom of the theme. This way your not wasting an entire blocks worth of page real estate.
-Mark
--
Visit My homepage and Zikula themes. -
- Rank: Team Member
- Registered: Mar 18, 2002
- Last visit: Oct 21, 2009
- Posts: 6606
Kind of... this was my initial thought as well. ADODB isn't a object orientated as it looks on the surface. I've looked at exactly this type of setup as i'd like to push all $dbconn->Execute functions through CacheExecute to allow for central caching of queries based on a module var for the module. Unfortunately there seems to be just enough function based code in there to make this harder than it should be.
-Mark
--
Visit My homepage and Zikula themes. -
- Rank: Team Member
- Registered: Mar 18, 2002
- Last visit: Oct 21, 2009
- Posts: 6606
Of course there are but the difficulty is one that's maintainable over a period of time. Most people can hack code to achieve a specific end goal at a given time. Doing that such that you create a more generic solution that can handle upgrades and other changes isn't quite as easy. As I say i'm looking for a specific solution in this area myself so may have something shortly that's consistent with both adodb and PN and allows for each upgrades and maintainence of the codebase.
-Mark
--
Visit My homepage and Zikula themes.
- Moderated by:
- Support
