Wizard.pm 000644 023421 023421 3622 7540672447 13261 0 ustar 00ace-host psacln 0 0 # ================================================================== # Auto Generated Plugin Configuration - Needed for Web Based Creator. # # Plugins::SearchFeed_Results # Author : Andy Newby # Version : 1 # Updated : Sat Sep 14 13:49:47 2002 # # ================================================================== # package Plugins::SearchFeed_Results; # ================================================================== use strict; use vars qw/$WIZARD/; $WIZARD = { 'install' => 'Hi. Please consider sending me a donation for this plugin, here, and also, when signing up for SearchFeed.com, please use us as your affiliate referer....we get some gredit then :) CLICK HERE TO SIGNUP', 'menu' => [ [ 'Readme', 'admin.cgi?do=plugin&plugin=SearchFeed_Results&func=Readme' ] ], 'files' => [], 'install_code' => '', 'uninstall' => 'Sorry to see you are uninstalling :(', 'user' => [ [ 'SearchFeed_Affiliate_ID', '5491', 'This is your ID number with SearchFeed. Make sure you change it, otherwise you won\'t get credit!', 'TEXT', [], [] ] ], 'uninstall_code' => '', 'name' => 'SearchFeed_Results', 'meta' => { 'prog_ver' => '2.1.0', 'description' => 'This will grab the results from SearchFeed.com, and add them to the end (or beginning) of your results...', 'license' => 'Freeware', 'url' => 'http://www.ace-installer.com', 'author' => 'Andy Newby', 'version' => '1' }, 'hooks' => [ [ 'search_results', 'PRE', 'Plugins::SearchFeed_Results::do_checks', 'FIRST' ] ] }; 1; Install.pm 000644 023421 023421 12074 7540673273 13446 0 ustar 00ace-host psacln 0 0 # ================================================================== # Plugins::SearchFeed_Results - Auto Generated Install Module # # Plugins::SearchFeed_Results # Author : Andy Newby # Version : 1 # Updated : Sat Sep 14 13:49:47 2002 # # ================================================================== # package Plugins::SearchFeed_Results; # ================================================================== use strict; use vars qw/$VERSION $DEBUG $NAME $META/; use GT::Base; use GT::Plugins qw/STOP CONTINUE/; use Links qw/$CFG $IN $DB/; $VERSION = '1'; $DEBUG = 0; $NAME = 'SearchFeed_Results'; # Inhert from base class for debug and error methods @Plugins::SearchFeed_Results::ISA = qw(GT::Base); $META = { 'prog_ver' => '2.1.0', 'description' => 'This will grab the results from SearchFeed.com, and add them to the end (or beginning) of your results...', 'license' => 'Freeware', 'url' => 'http://www.ace-installer.com', 'author' => 'Andy Newby', 'version' => '1' }; sub pre_install { # ------------------------------------------------------------------- # This function displays an HTML formatted message that will display # to the user any instructions/information before they install # the plugin. # my $inst_msg = 'Hi. Please consider sending me a donation for this plugin, here, and also, when signing up for SearchFeed.com, please use us as your affiliate referer....we get some gredit then :) CLICK HERE TO SIGNUP'; return $inst_msg; } sub pre_uninstall { # ------------------------------------------------------------------- # This function displays an HTML formatted message that will display # to the user any instructions/information before they remove the # plugin. # my $uninst_msg = 'Sorry to see you are uninstalling :('; return $uninst_msg; } sub install { # ------------------------------------------------------------------- # This function does the actual installation. It's first argument is # a plugin manager which you can use to register hooks, install files, # add menu options, etc. The second argument is a GT::Tar object which # you can use to access any files in your plugin module. # # You should return an HTML formatted string that will be displayed # to the user. # # If there is an error, return undef, and set the error message in # $Plugins::SearchFeed_Results::error # my ($mgr, $tar) = @_; # if template already exist...dont get rid of em! if (-e "$CFG->{admin_root_path}/templates/$CFG->{build_default_tpl}/search_link.html") { next; } $file = $tar->get_file ("search_link.html"); $file->name("$CFG->{admin_root_path}/templates/$CFG->{build_default_tpl}/search_link.html") or return Plugins::SearchFeed_Results->error("Error: $GT::Tar::error"); unless ($file->write) { last; return Plugins::SearchFeed_Results->error("Unable to extract file: '$CFG->{admin_root_path}/templates/$CFG->{build_default_tpl}/search_link.html' ($GT::Tar::error)", 'WARN'); } $mgr->install_hooks ( 'SearchFeed_Results', [ ['search_results', 'PRE', 'Plugins::SearchFeed_Results::do_checks', 'FIRST'] ]); $mgr->install_menu ( 'SearchFeed_Results', [ ['Readme', 'admin.cgi?do=plugin&plugin=SearchFeed_Results&func=Readme'] ] ); $mgr->install_options ( 'SearchFeed_Results', [ ['SearchFeed_Affiliate_ID', '5491', 'This is your ID number with SearchFeed. Make sure you change it, otherwise you won\'t get credit!', 'TEXT', [], [], '' ] ] ); $mgr->install_options ( 'SearchFeed_Results', [ ['Active', '1', 'Set to 0 if you don\'t want this plugin to be active, or 1 if you want the results to be grabbed...', 'TEXT', [], [], '' ] ] ); return "The plugin has been successfully installed!"; } sub uninstall { # ------------------------------------------------------------------- # This function removes the plugin. It's first argument is # also a plugin manager which you can use to register hooks, install files, # add menu options, etc. You should return an HTML formatted string # that will be displayed to the user. # # If there is an error, return undef, and set the error message in # $Plugins::SearchFeed_Results::error # my $mgr = shift; $mgr->uninstall_hooks ( 'SearchFeed_Results', [ ['search_results', 'PRE', 'Plugins::SearchFeed_Results::do_checks', 'FIRST'] ]); $mgr->uninstall_menu ( 'SearchFeed_Results', [ ['Readme', 'admin.cgi?do=plugin&plugin=SearchFeed_Results&func=Readme'] ] ); $mgr->uninstall_options ( 'SearchFeed_Results', [ ['SearchFeed_Affiliate_ID', '5491', 'This is your ID number with SearchFeed. Make sure you change it, otherwise you won\'t get credit!', 'TEXT', [], [], '' ] ] ); $mgr->uninstall_options ( 'SearchFeed_Results', [ ['Active', '1', 'Set to 0 if you don\'t want this plugin to be active, or 1 if you want the results to be grabbed...', 'TEXT', [], [], '' ] ] ); return "The plugin has been successfully removed!"; } 1; SearchFeed_Results.pm 000644 023421 023421 7156 7540673273 15537 0 ustar 00ace-host psacln 0 0 # ================================================================== # Plugins::SearchFeed_Results - Auto Generated Program Module # # Plugins::SearchFeed_Results # Author : Andy Newby # Version : 1.3 # Updated : Sat Sep 14 13:49:47 2002 # # ================================================================== # package Plugins::SearchFeed_Results; # ================================================================== use strict; use GT::Base; use vars qw/$VERSION $DEBUG $NAME $FONT $SEARCHED/; use GT::Plugins qw/STOP/; use Links qw/$IN $DB $CFG/; use Links::Plugins; use Links::SiteHTML; use LWP::Simple; use XML::Simple; # Inherit from base class for debug and error methods @Plugins::SearchFeed_Results::ISA = qw(GT::Base); # Your code begins here! Good Luck! # PLUGIN HOOKS # =================================================================== sub do_checks { # ------------------------------------------------------------------- # This subroutine will get called whenever the hook 'search_results' # is run. You should call GT::Plugins->action ( STOP ) if you don't # want the regular code to run, otherwise the code will continue as # normal. # my (@args) = @_; # Do something useful here my $results = shift; if ($SEARCHED) { return $results; } my $opts = Links::Plugins->get_plugin_user_cfg ('SearchFeed_Results'); my $inc = $opts->{Active}; if ($inc == 0) { return $results; } if ($inc == 1 and $results->{link_hits} > 0) { return $results; } print $IN->header(); my $self_ip = $ENV{REMOTR_ADDR}; my $affil_id = $opts->{SearchFeed_Affiliate_ID}; my $query = $IN->param('query'); my $page = get("http://www.searchfeed.com/rd/feed/XMLFeed.jsp?cat=$query&pID=$affil_id&nl=25&ip=$self_ip"); if (!$page) { print "Could not get SearchFeed content. Site may be down...please try again later!"; exit; } my $ref = XMLin($page); my $link_count = $ref->{Count}; # if we didnt get any results from here either, lets let em know! if (!$link_count) { print Links::SiteHTML::display('search', { error => "No links were found!" }); exit; } my ($count, $html_links); for ($count = 0; $count <= 25; $count++) { # catch if there are no more results... if (!$ref->{Listing}->[$count]->{Title}) { last; } # get the variables all setup... my $Description = $ref->{Listing}->[$count]->{Description}; my $Title = $ref->{Listing}->[$count]->{Title}; my $URI = $ref->{Listing}->[$count]->{URI}; my $Bid = $ref->{Listing}->[$count]->{Bid}; # some people think its clever to bid # like 0.024343, so lets narrow it tro a round, 2 digit number... $Bid = sprintf("%.2f", $Bid); # put the links into HTML format... $html_links .= Links::SiteHTML::display('search_link', { Description => $Description, Title => $Title, URL => $URI, Bid => $Bid }); } # now show the results page! print Links::SiteHTML::display('search_results', { link_results => $html_links, cat_hits => 0, link_hits => $link_count }); # stop the script from running other stuff! exit; } # ADMIN MENU OPTIONS # =================================================================== sub Readme { # ------------------------------------------------------------------- # This subroutine will get called whenever the user clicks # on 'Readme' in the admin menu. Remember, you need to print # your own content-type headers; you should use # # print $IN->header(); # } # Always end with a 1. 1; search_link.html 000644 023421 023421 1431 7541400415 14610 0 ustar 00ace-host psacln 0 0 <%-- File : search_link.html Description : This file displays a single link. It is used on category listings, search results, what's new, what's cool, pretty much anywhere you see a link. Tags : You have all the following options on this page: URL => The URL to the site...not jump.cgi! Description => The site description... Title => The sites title Bid => Bid, in cents for that listing... NO OTHER OPTIONS ARE AVAILABLE! --%>