Has anyone found a way to preview posts before they are submitted?
Apr 1, 2003, 1:28 PM
User (202 posts)
Apr 1, 2003, 1:28 PM
Post #2 of 17
Views: 7083
I also wanted users to be able to preview and make changes as they were submitting new links, and before I had a chance to validate them. The way I did it isn't very elegant, but it works for me.
I added a new field to my Links database called 'Active' and set the default value as 'Yes'. Then in modify.pm, in the section: sub _list_owned_links {
I changed:
to
This just allows users to modify their links, even if they aren't validated yet.
Then on the modify_success.html and add_success.html templates I include the tags similar to the link.html template, so that it would preview for them how the link would actually look on the directory, and I also include a link to the modify.cgi in case they want to make immediate changes.
That way, after a user submits a new link, they will see how it looks on the add_success.html page. Then if they want to make a change (eventhough it hasn't been validated yet), they can click on the link to modify, and they can then make the changes, and see how it looks on the modify_success.html page.
I'm sure there must be a way to change modify.pm without having to add the field 'Active', but whenever I tried, it would no longer work for me. There's probably a much better or easier way to do this, but I'm just including this in case it's helpful.
--Frank
I added a new field to my Links database called 'Active' and set the default value as 'Yes'. Then in modify.pm, in the section: sub _list_owned_links {
I changed:
Code:
my $sth = $link_db->select ( { LinkOwner => $USER->{Username}, isValidated => 'Yes' });to
Code:
my $sth = $link_db->select ( { LinkOwner => $USER->{Username}, Active => 'Yes' });This just allows users to modify their links, even if they aren't validated yet.
Then on the modify_success.html and add_success.html templates I include the tags similar to the link.html template, so that it would preview for them how the link would actually look on the directory, and I also include a link to the modify.cgi in case they want to make immediate changes.
That way, after a user submits a new link, they will see how it looks on the add_success.html page. Then if they want to make a change (eventhough it hasn't been validated yet), they can click on the link to modify, and they can then make the changes, and see how it looks on the modify_success.html page.
I'm sure there must be a way to change modify.pm without having to add the field 'Active', but whenever I tried, it would no longer work for me. There's probably a much better or easier way to do this, but I'm just including this in case it's helpful.
--Frank
Apr 1, 2003, 11:52 PM
Veteran / Moderator (2199 posts)
Apr 1, 2003, 11:52 PM
Post #6 of 17
Views: 7040
I have a plugin for this, but it's not quite ready yet.
The main problem is that there are two things to be previewed: how a link looks on the category page, and how a detailed page.
If you have detailed pages, you might want to open the preview in a different window, which complicates things...
Ivan
-----
Iyengar Yoga Resources / GT Plugins
The main problem is that there are two things to be previewed: how a link looks on the category page, and how a detailed page.
If you have detailed pages, you might want to open the preview in a different window, which complicates things...
Ivan
-----
Iyengar Yoga Resources / GT Plugins
Apr 2, 2003, 8:09 AM
Veteran (2312 posts)
Apr 2, 2003, 8:09 AM
Post #7 of 17
Views: 7018
My Xtended Add.Modify.Delete plugin (XAMD) has the preview feature implemented already.
The only problem is, that the plugin will be not released for a while... Read more about release plans in the mentioned thread.
Best regards,
Webmaster33
Paid Support from Webmaster33. Expert in Perl programming & Gossamer Threads applications. (click here for prices)
Webmaster33's products (upd.2004.09.26) | Private message | Contact me | Was my post helpful? Donate my help...
The only problem is, that the plugin will be not released for a while... Read more about release plans in the mentioned thread.
Best regards,
Webmaster33
Paid Support from Webmaster33. Expert in Perl programming & Gossamer Threads applications. (click here for prices)
Webmaster33's products (upd.2004.09.26) | Private message | Contact me | Was my post helpful? Donate my help...
Aug 23, 2003, 9:03 AM
User (422 posts)
Aug 23, 2003, 9:03 AM
Post #9 of 17
Views: 6931
Hi Yogi,
Why not simply print on the same preview page how the link looks on the category page (on the top of the preview page) and how it look on detailed page (on the bottom of the preview page)? It would be simple and do the job.
When do you plan to release your plugin? I really need this one...
Thank you.
François
Why not simply print on the same preview page how the link looks on the category page (on the top of the preview page) and how it look on detailed page (on the bottom of the preview page)? It would be simple and do the job.
When do you plan to release your plugin? I really need this one...
Thank you.
François
Aug 23, 2003, 10:16 AM
Veteran / Moderator (6956 posts)
Aug 23, 2003, 10:16 AM
Post #11 of 17
Views: 6923
This is a bit dusty, but if you want a preview plugin, I think I have one.
All you need to do is offer preview/submit options, and if preview, you simply take the information, and return it to the page, and give the author a chance to preview or submit.
I actually simply changed the code in add.pm to allow this, and changed the template to allow a preview mode and edit or a submit. The only complexity was really getting the <%IF%> tags in the templates to work right.
It's *NOT* hard, and many people have had something like this implemented since Links SQL 1.1
Do you still need this?
I did not allow preview of the detailed page, but I can probably set up a link that will allow detail_page.cgi to display a dummy detail_page in a pop up window.
PUGDOG� Enterprises, Inc.
The best way to contact me is to NOT use Email.
Please leave a PM here.
All you need to do is offer preview/submit options, and if preview, you simply take the information, and return it to the page, and give the author a chance to preview or submit.
I actually simply changed the code in add.pm to allow this, and changed the template to allow a preview mode and edit or a submit. The only complexity was really getting the <%IF%> tags in the templates to work right.
It's *NOT* hard, and many people have had something like this implemented since Links SQL 1.1
Do you still need this?
I did not allow preview of the detailed page, but I can probably set up a link that will allow detail_page.cgi to display a dummy detail_page in a pop up window.
PUGDOG� Enterprises, Inc.
The best way to contact me is to NOT use Email.
Please leave a PM here.
Aug 23, 2003, 10:20 AM
Veteran / Moderator (6956 posts)
Aug 23, 2003, 10:20 AM
Post #12 of 17
Views: 6927
Hi,
To preview link.html and detailed.html inside another page, you need to make some code changes, and not only get some variables yourself, but you need to us a different template to get rid of the extra <html> and <head> tags, and such, which can really destroy some browsers.
If you use a modular format, and include your blocks of code into main templates, this shouldn't be too hard or error prone, but you still need to edit add.cgi/pm to get some variables that are only availabel on the detailed or link page.
Simply previewing the data a user types in, with a chance to re-edit it, is [almost] trivial as posted in the previous note.
PUGDOG� Enterprises, Inc.
The best way to contact me is to NOT use Email.
Please leave a PM here.
To preview link.html and detailed.html inside another page, you need to make some code changes, and not only get some variables yourself, but you need to us a different template to get rid of the extra <html> and <head> tags, and such, which can really destroy some browsers.
If you use a modular format, and include your blocks of code into main templates, this shouldn't be too hard or error prone, but you still need to edit add.cgi/pm to get some variables that are only availabel on the detailed or link page.
Simply previewing the data a user types in, with a chance to re-edit it, is [almost] trivial as posted in the previous note.
PUGDOG� Enterprises, Inc.
The best way to contact me is to NOT use Email.
Please leave a PM here.
Oct 11, 2003, 3:53 PM
User (376 posts)
Oct 11, 2003, 3:53 PM
Post #13 of 17
Views: 6881
Well it only took be how long to finally get around to adding this... six months or so .
Thank you FrankM. This little hack isn't pretty, but it works very well and it was relatively easy to setup.
The preview post function should be written into the LSQL core program. IMOP.
Thank you FrankM. This little hack isn't pretty, but it works very well and it was relatively easy to setup.
The preview post function should be written into the LSQL core program. IMOP.
Oct 15, 2003, 7:25 AM
Veteran / Moderator (6956 posts)
Oct 15, 2003, 7:25 AM
Post #14 of 17
Views: 6806
Code:
I'm sure there must be a way to change modify.pm without having to add the field 'Active', but whenever I tried, it would no longer work for me. There's probably a much better or easier way to do this, but I'm just including this in case it's helpful.my $sth = $link_db->select ( { LinkOwner => $USER->{Username} } );
Should work.
But, using the field "Active" gives you a way of "blocking" links if you want to at some point, if you want to.
PUGDOG� Enterprises, Inc.
The best way to contact me is to NOT use Email.
Please leave a PM here.
Jul 8, 2005, 1:03 PM
User (376 posts)
Jul 8, 2005, 1:03 PM
Post #17 of 17
Views: 6667
If I change:
to
Auto-update will overwrite the changed file anyone have a solution for this?
Code:
my $sth = $link_db->select ( { LinkOwner => $USER->{Username}, isValidated => 'Yes' });Code:
my $sth = $link_db->select ( { LinkOwner => $USER->{Username}, Active => 'Yes' });Auto-update will overwrite the changed file anyone have a solution for this?