Home : Products : DBMan SQL : Discussion :

Products: DBMan SQL: Discussion: Re: [jaspercram] add my own pages: Edit Log

Here is the list of edits for this post
Re: [jaspercram] add my own pages
Hi,

I'm not sure if this is what you are looking for or if it's the correct way to achieve the result but I recently did the following (and it works for me) -

I created a plugin named CustomPage that redirects to a custom html page when do=search_results&custom_page=1 is included in the url. The plugin code is as follows -

sub search_results {

my $self = shift;

# Ignores the plugin if this is not a call for custom_page

if ($self->{cgi}->{custom_page}) {

GT::Plugins->action ( STOP );

return ('/path to required directory/custom_page.html');

}

else {

#Continue with the main script search_result sub

return @_;

}

}

# Always end with a 1.

1;



For this to work you need to add a hook -

Name: search_results

Type: PRE

Code: Plugins::Dbsql::CustomPage::search_results

Position: First



Upload your custom html page to your nominated directory and try calling it up using something like -

http://www.yoursite/yourcgi/db.cgi?<%ifnot use_cookie%>sid=<%session_id%>&<%endif%>do=search_results&custom_page=1&db=tablename

Note, the plugin is very basic and may need additional coding to give you the desired result. Also, I chose the search_results sub as the place to hook in to the main script but you can use any of the valid hook in locations (MAYBE SOMEONE FROM GT WILL GIVE US A LIST AS REQUESTED IN THE PLUGIN FORUM).

I hope this helps and I also hope that someone from GT will comment on this method.

Simon.

Last edited by:

jai: Oct 17, 2002, 4:42 PM

Edit Log: