Gossamer Forum
Quote Reply
Preview Link Submission
Is there a way for users to preview their link before submitting it?
The old way of doing this modified a core file (modify.pm) which will get overridden with auto update.
See thread
http://www.gossamer-threads.com/perl/gforum/gforum.cgi?post=238324

Has anyone found a way do do this?
Quote Reply
Re: [jgkiefer] Preview Link Submission In reply to
Hi,

This is a pretty hard one to do, due to the way the add system works.

Normally, I tend to add a "preview" button, which uses an onclick="" call to access page.cgi?=preview_link .. and shows a page based on the form details they submitted.

Personally, I'd try and keep as far away from editing the .pm files as possible, as that can cause some major headaches with upgrades/in the future :(

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Preview Link Submission In reply to
In Reply To:
Personally, I'd try and keep as far away from editing the .pm files as possible, as that can cause some major headaches with upgrades/in the future :(

I agree with you. Could you please tell me how you-

"Normally, I tend to add a "preview" button, which uses an onclick="" call to access page.cgi?=preview_link .. and shows a page based on the form details they submitted."
Quote Reply
Re: [jgkiefer] Preview Link Submission In reply to
Phhheeww.. giving away trade secrets? Tongue

Try adding a new button, called "preview", with the following code;

Code:
<script>
function doopenwindow {
var urlpage = 'http://www.site.com/cgi-bin/page.cgi?page=preview';
var args = parseQueryString ();
var showit;
for (var arg in args) {
showit = showit + '&' + arg + '=' + args[arg] + ';'
}
open(urlpage + showit, '_blank', '')
}

function parseQueryString (str) {
str = str ? str : location.search;
var query = str.charAt(0) == '?' ? str.substring(1) : str;
var args = new Object();
if (query) {
var fields = query.split('&');
for (var f = 0; f < fields.length; f++) {
var field = fields[f].split('=');
args[unescape(field[0].replace(/\+/g, ' '))] =
unescape(field[1].replace(/\+/g, ' '));
}
}
return args;
}
</script>

<input type="button" name="Preview" value="Preview" onclick="doopenwindow()" />

That should open a new window, and then open page.cgi?page=preview, with all the variables passed through.

Hope that helps.

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Preview Link Submission In reply to
Thanks! My lips are sealed. I will not tell anyone. Wink
Quote Reply
Re: [Andy] Preview Link Submission In reply to
I thought that I could just include this code on the add.cgi page but that doesn't seem to work. I am confused, where does this code get placed?
Quote Reply
Re: [jgkiefer] Preview Link Submission In reply to
Hi,

You could probably get away with putting it in add.html template. However, it hasn't been tested... so that may be part of the problem. Was more aimed at getting you on the right tracks <G>

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Preview Link Submission In reply to
As GLinks morphs into more than just a links directory this seems to be a needed feature. Maybe you could develop a plugin for this? I know I'd be interested.
Quote Reply
Re: [jgkiefer] Preview Link Submission In reply to
Me too Smile

Vishal
-------------------------------------------------------
Quote Reply
Re: [SWDevil.Com] Preview Link Submission In reply to
Ok,

What is happening, from the little I've played with, is that to get around the problem of not having a Link ID to deal with the payment issue, or using "holding" tables, the link is being added as an unvalidated, unapproved, and unpaid link to the main links table. Then, you move on to the payment process which updates the correct flags (if needed).

You can do your "preview" by entering the "modify" system. I've had a bit of a discussion about this with brewt, and you might have to override some of the checks on "modify" and use a "select" "update" format. GT is concerned that a user can modify a link at that exact same instant an Admin is approving a link. But, if that's so, then there is some problem with how a link can be modified. I haven't had time to delve deeply into this.

This is on my to-do list, but that list is so long, it times out when I try to view it ;)

The javascript pop up has some advantages, and also some draw backs. (I don't know much javascript <G>). I'd rather not ask the browser to do what the application should be doing. Just my feelings.


PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [pugdog] Preview Link Submission In reply to
Thank you for taking time with this. Believe me I understand long to-do-lists. When you have time do you think you may be able to help us use the nifty snippet of javascript you put together to use as a temporary solution? Or maybe someone else here is a javascript guru and could walk us through it?

I really do appreciate the time being shown on this subject. Smile