Jump to content

Preview Website Before Committing To Changes


son

Recommended Posts

If I wanted to have a preview facility, so changes from admin area could be checked on copy of website before displayed on website: How do you normally achieve this? A copy of entire database? There could be many changes as category and product changes, introductory text changes etc...Son

Link to comment
Share on other sites

It depends what you want to preview. If you want to change everything, and then preview that before it goes live, then yeah, you need another copy of everything, whether that's in the database or session or whatever.

Link to comment
Share on other sites

It depends what you want to preview. If you want to change everything, and then preview that before it goes live, then yeah, you need another copy of everything, whether that's in the database or session or whatever.
I want to have facility to see homepage, product overview and detail page before committing to changes...Son
Link to comment
Share on other sites

I want to have facility to see homepage, product overview and detail page before committing to changes...Son
Copy those, and have a separate "dumb" copy of the database, containing only a few samples of products. Keep your DB connection infromation in a separate file that you DO NOT copy along. That way, when you make changes, and upload all the rest, the DB will be switched automatically.
Link to comment
Share on other sites

Copy those, and have a separate "dumb" copy of the database, containing only a few samples of products. Keep your DB connection infromation in a separate file that you DO NOT copy along. That way, when you make changes, and upload all the rest, the DB will be switched automatically.
But can the switch be done by mouse-click in my admin area?Son
Link to comment
Share on other sites

But can the switch be done by mouse-click in my admin area?Son
You could make PHP (therefore the admin area) to zip the site up, and serve a download for the user using the admin panel. This assumes that you can take the zip file, and extract it at an appropriate place, where it could run.You could use PHP to send a copy of the entire site to another running server via FTP. This of course assumes that you actually have an FTP server running in your development machine.In the case of FTP, you could also make it download a copy of the site from that same location (or use the same upload utility from the development copy to update the live site), and replace all of your live files (except the DB configuration file, which will have to be "blacklisted", so that it doesn't get overwritten), while deleting the old ones.It's a very error prone solution, as you may loose or damage one of your copies if something goes wrong during the connection. Still, it's probably the best possible thing with a single click on an admin panel. If you're willing to do "two clicks" instead, you could separate the download process from the update process. Simply place the new versions in an "update" folder, and once successfully downloaded and verified, execute an "update" script.
Link to comment
Share on other sites

You could make PHP (therefore the admin area) to zip the site up, and serve a download for the user using the admin panel. This assumes that you can take the zip file, and extract it at an appropriate place, where it could run.You could use PHP to send a copy of the entire site to another running server via FTP. This of course assumes that you actually have an FTP server running in your development machine.In the case of FTP, you could also make it download a copy of the site from that same location (or use the same upload utility from the development copy to update the live site), and replace all of your live files (except the DB configuration file, which will have to be "blacklisted", so that it doesn't get overwritten), while deleting the old ones.It's a very error prone solution, as you may loose or damage one of your copies if something goes wrong during the connection. Still, it's probably the best possible thing with a single click on an admin panel. If you're willing to do "two clicks" instead, you could separate the download process from the update process. Simply place the new versions in an "update" folder, and once successfully downloaded and verified, execute an "update" script.
That all sounds very complicated and maybe above my head... I was hoping for two fields in db tables, one for live data, one for preview data. When you upload any changes it would be stored in preview field and checked on exact copy of website (that always displays the preview fields). Then there is any option to press "Make changes live" or similar that moves all data from preview fields in live fields while overriding previous live data and leaving the preview fields with data till the next change occurs... Is this a crazy idea?Son
Link to comment
Share on other sites

It could work, but gathering the data, encoding it to fit into a single text/blob field, and decoding it back is just as (if not more) complicated.Or do you mean one set of DB fields for live data, and another set of fields for preview data? That's extremely unflexible, as if you decide to change the types or number of fields in your DB, you can't do it without potentially damaging the original. And don't get me started on relations (foreign keys, etc.)... it's basically impossible to do those reliably. And what if the update is on a PHP file, and not the DB? Are you going to store PHP file copies into the live DB as well?If you don't have separate copies, you are always is a position to damange your original. And if don't feel pressure to preserve the original, why have a preview to begin with?

Link to comment
Share on other sites

It could work, but gathering the data, encoding it to fit into a single text/blob field, and decoding it back is just as (if not more) complicated.Or do you mean one set of DB fields for live data, and another set of fields for preview data? That's extremely unflexible, as if you decide to change the types or number of fields in your DB, you can't do it without potentially damaging the original. And don't get me started on relations (foreign keys, etc.)... it's basically impossible to do those reliably. And what if the update is on a PHP file, and not the DB? Are you going to store PHP file copies into the live DB as well?If you don't have separate copies, you are always is a position to damange your original. And if don't feel pressure to preserve the original, why have a preview to begin with?
It is not for me. I built this site to be used by me and someone else who is not very technical. So I set up a nice admin area. Now, I put an option to change data on homepage, but my friend would like to see what it looks like on homepage before it can actually be seen by anyone else...Son
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...