I've been looking for an easy way to track my current session variables on my desktop in order to have an eye on them.
My website uses Joomla and session variables are stored in MySQL by PHP.
What I'd like to achieve is a 'widget' or 'snippet' which could show on my Windows 7 desktop current session variables, and how they change during a visit on the website.
In fact the session state is stored in a table like:
session_id varchar(32)
data varchar(20480)
userid int(11)
So let say one solution could be retrieving first two columns by my userid with a SQL query and parsing 'data' column, which is in JSON format, into an 'snippet' object.
I don't know how to write widget/snippets and I don't expect anybody to write me one, I just wonder if such thing exist to make my developing easier.
Well, if you want to hack together something, I've got a couple of crude suggestions.
Write a simple SQL query ordered by date, throw in some HTML and add javascript to auto refresh the page, say every 30 seconds. Now you just need a tab open to monitor your sessions.
The same thing as above but instead of HTML, output XML in the feed format. Then use any feed reader software which usually has desktop widgets and alerts etc.
Good luck!
Well, it's been long time since I asked this question. So far, the best option I've found was PHP Quick Profiler tunned a bit up for Joomla Framework. Soon, I gonna post a tutorial how to implement this for Joomla. Should anybody want to hurry me up do not hesitate :)
Related
This is my second attempt to try an figure this out. I looked at other answers and tested the answer I got from my previous post.
Found here:
How do I link an Account table with an Order table in MS Access 2013?
There is a catch to this that doesn't work for me. The main reason is that the orders are highly customized and not predefined.
I sell shirts and they can customize the picture and the monograms (among other things) versus selling a specific shirt that can be stored and picked from the database.
I normalized my tables as much as I can down to two possibly three. An Account.tbl (account number, shipping info and payment method, etc.) and an Order.tbl (shirt color, picture attachments, monograms, etc.) A possible third table (account.ID and order.ID).
I asked a collegue of mine and from what I understand this may be something for PHP to handle. I don't know the first thing about PHP or really Access either. I just make shirts. :)
I am assuming I would need a button that when pressed:
1.) Saves the data
2.) Pushes/Exports the account.ID from the Account.tbl to the account.ID on the Order.tbl
3.) Changes from the Account.frm to the Order.frm
I have #1 and #3 accomplished. But I have not found a way to do #2 from Access alone.
I have tried building relationships with the Primary key and Foreign key but it doens't keep track of who is ordering what. My tables just fill up with unrelated data. :/
Is there a solution in Access? Would PHP solve this? Is there a simple PHP code for this? If not, where should I start looking in PHP language?
Any help or suggestion would be appreciated.
If you don't have any prior knowledge of PHP then don't waste your time learning about it just for this project.
If you are building a database application to run on your own computer and you already have Access 2013 then that's all you need.
If you intend to build a web application that your customers can access over the Internet then you might benefit from knowing a bit about PHP, depending on the tools or framework you use to build your site. However, in that case you should not be using an Access database as a data repository for a web application.
I have a site (php) with a text editor that I want to be saved automatically every few minutes (on mysql) and I wanted to consult with you about this.
(You may know this behavior from the Google Docs platform.)
Won't it kill my DB if I'll call it again and again?
Is their a known approach for this type of feature?
Does it matter if I save every minute or every type that the user is doing?
Any tips that can help me start with this feature?
It depends on your server and the amount of data saved to mysql, tell us more why do you want to save text editor data to database, im pretty sure theres a better way to do this.
If you want to save data for users, you should use local storage, you can do it using JQuery plugins:
Ex:
http://www.jstorage.info/
I am building a weather station that will update the weather in "real-time" to a MySQL Database. To give the feel of "real-time" without taking up a ton of space on my MySQL server, I have my weather station updating a single cell in the MySQL database every few seconds. I would like to set up a way for a website to view this change in realtime without refreshing the page. I have tried researching a lot, but I can't quite find what I am looking for (at least with more of an explanation into the JQuery and how it works). Most answers have partial as people have a lot more experience.
I have a little experience with PHP and MySQL (I have just started learning a couple of months ago). This project is more of a way to learn JQuery and AJAX (along with PHP and MySQL). Frankly, I don't know a ton as I am just starting into programming.
If I could get a bit more of an explanation into how the JQuery works and what files I need to be placing the information in, that would be great (a lot of other similar answers had a separate "server" file and a "client" file in PHP. Do I really need that?).
I just don't know where to begin or what to put in what files. Maybe I need a tutorial? Thanks.
I think what you are looking for is "Push Technology". But, as a beginner like me, I would introduce you to try out "long pulling". Although is not the best method, you can learn how real-time update works.
I suggest you create a normal working AJAX, then use the code below to repeatedly call for updates from the server.
jQuery(document).ready(function () {
interval = setInterval("checkNewUpdate()",4000); //Set interval for accident checking ajax
}
This function basically retrieves information from the database every 4seconds. This method is not so efficient, but I hope would help you to kick start in push technology.
Visit How do I implement basic "Long Polling"? for more information.
I suggest you to create a function to check database status, something like count row in the database or something else like that... the return must be simple a data like number , true or false (not a long data) with interval .. and when it change the fetch function will run
I want to add functionality to a website I am building for a client that allows him to log on to a secure page and add new job listings. He will be the only one modifying this so I don't need to worry about concurrent access or anything like that. At this point I don't even have a database set up for him but I understand that might need to be implemented soon, for other features if not this one.
He doesn't have any knowledge of HTML so I can't just create a template job posting and have him manually fill in the information (although that is also unprofessional, I suppose.) I was planning on just making a simple php/html page where he could put the title of the job along with all details through submission of a form. Once I have that, though, I don't know how to deal with adding that job title to a list of current job postings and also have that link to a new page with all the details of the job.
My memory from early undergraduate classes are hinting that the adding jobs to a list would be object-oriented. However, I can also see something where I would just add the title to an array which the list then dynamically filled from.
Another recommendation I have received is to look into implementing a django/python solution. The problem is I have about a week to work on this and I ahve no python experience. If that is something that would be possible to learn and implement in that time, I will go for it. I just don't want to waste time on something that takes a week or two to learn and then still have nothing implemented.
Basically, I would appreciate a point in the right direction and some reassurance that I am considering all possibilities. If it would be easier to implement some kind of simple wiki, that is another option as well.
Do any of these ideas sound like the right choice? Is there anything I am missing?
I apologize if this is a trivial question but I have stumped myself and would appreciate any help you can offer.
A possible and easy solution would be using an appropriate CMS module, like Job Manager or Resume Submissions and Job Posting for WordPress. I haven't tested them personally, but they should handle everything for you through a Web interface, no coding needed (you should just adapt the WordPress CSS to match the existing client's Website style).
For reference, here's what I would have done in case no such CMS module existed.
Create a database with a table that will hold all job postings. The table should have the following columns: id, title, description, validityDate (names are self-explanatory). Add more if appropriate.
Write a script that queries the database for all current job postings using the following query: SELECT id, title FROM postings WHERE validityDate >= NOW(). To manage database connections, use the PHP PDO extension (look at its page on the PHP manual website for examples). This will return a list of all current job postings. For each result, let the script output HTML code like this: echo "$title<br />$description";, where $id, $title and $description are the variables holding the ID, title and description of the current record.
Write the post.php script that will fetch the details of the job posting with the ID specified in the id parameter.
Write another script where the client will input the details for a new posting into a form. After submission, the script should just insert the data into the table.
The cms I'm currently working with only supports live editing of data (news, events, blogs, files, etc), and I've been asked to build a system that supports drafting (with moderation) + revision history system. The cms i'm using was developed in house so I'll probably have to code it from scratch.
At every save of a item it would create a snapshot of the data into a "timeline". The same would go for drafts. Automated functionality would pull the timeline draft into the originating record when required.
The timeline table would store the data type & primary key, seralised version of the data + created/modified dates + a drafting date (if in the future)
I've had a quick look around at other systems, but I've yet to improve from my current idea.
I'm sure someone has already built a system like this and I would like to improve on my design before I start building. Any good articles/resources would help as well.
Thanks
I think using serialize() to encode each row into a single string, then saving that to a central database may be a solution.
You'd have your 'live' database with relevant tables etc., but when you edit or create something (without clicking publish) it would instead of being saved in your main table go into a table like:
id - PRI INT
date - DATETIME
table - VARCHAR
table_id - INT
type - ENUM('UNPUBLISHED','ARCHIVED','DELETED');
data - TEXT/BLOB
...with the type set to 'unpublished' and the table and table_id stored so it knows where it is from. Clicking publish would then serialize the current tables contents, store it in the above table set to 'archive', then read out the latest change (marked as unpublished) and place this in the database. The same could also apply to deleting rows - place them in and mark as 'deleted' for potential undelete/rollback functionality.
It'll require quite a lot of legwork to get it all working, but should provide full publish/unpublish and rollback facilities. Integrated correctly into custom database functions it may also be possible to do all this transparently (from a SQL point of view).
I have been planning on implementing this as a solution to the same problem you appear to be have, but it's still theoretical from my point of view but I reckon the idea is sound.
This sounds very wiki-like to me. You may want to look at MediaWiki, the system used by Wikipedia, which also uses PHP and MySQL.
DotNetNuke is a good open source CMS, you could read the soure for that system to get ideas. Or you could simply use DotNetNuke.
http://www.dotnetnuke.com/
I think that there are many systems out there that would support this functionality out of the box. Although I don't know al your considerations for doing a custom build, consider looking at some of these. It is very likely that they will be able to support what you need, and then some.
Consider having a look at Drupal, I think still the leading CMS for publishing. Drupal in combination with the workflow module contains all that you need:
http://drupal.org
http://drupal.org/project/workflow
And add save draft for usability:
http://drupal.org/project/save_draft