# ================================================================== # Plugins::Ace_PPC_Banner - Auto Generated Install Module # # Plugins::Ace_PPC_Banner # Author : A.J.Newby # Version : 1.0.1 # Updated : Fri Apr 12 05:24:49 2002 # # ================================================================== # package Plugins::Ace_PPC_Banner; # ================================================================== 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.0.1; $DEBUG = 0; $NAME = 'Ace_PPC_Banner'; # Inhert from base class for debug and error methods @Plugins::Ace_PPC_Banner::ISA = qw(GT::Base); $META = { 'prog_ver' => '2.0.5', 'url' => 'http://www.ace-installer.com', 'license' => 'Commercial', 'description' => 'This script will allow you to use a <%ppc_banner%> tag, SSI or a PHP include to show banners on your site. Every time someone clicks on a banner, money is debited from their account. They can top up with PayPal (ClickBank comming soon) instantly. Comes with full admin control, statistics, advertiser login page and more...', 'author' => 'A.J.Newby', 'version' => '1.0.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 = 'First of all, thanks for deciding to use our script. We hope you find it useful, and it makes you loads of money ;)'; 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 = 'I\'m sorry you don\'t appear to want to use our script any more. I hope it wasn\'t anything in the script that detered you. Thanks for trying it though :) Feedback is also welcome at webmaster@ace-installer.com.'; 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::Ace_PPC_Banner::error # my ($mgr, $tar) = @_; $mgr->install_menu ( 'Ace_PPC_Banner', [ ['Admin Panel', 'admin.php'] ] ); # Silence warnings $GT::Tar::error ||= ''; # The following section will unarchive attached files into the # proper location. my $file; # Copying click.php to $CFG->{admin_root_path}/.. directory. $file = $tar->get_file ('click.php'); $file->name("$CFG->{admin_root_path}/../click.php"); $file->write or return Ace_PPC_Banner->error("Unable to extract file: '$CFG->{admin_root_path}/../click.php' ($GT::Tar::error)", 'WARN'); # Copying banner.php to $CFG->{admin_root_path}/.. directory. $file = $tar->get_file ('banner.php'); $file->name("$CFG->{admin_root_path}/../banner.php"); $file->write or return Ace_PPC_Banner->error("Unable to extract file: '$CFG->{admin_root_path}/../banner.php' ($GT::Tar::error)", 'WARN'); # Copying admin/settings.inc.php to $CFG->{admin_root_path}/.. directory. $file = $tar->get_file ('admin/settings.inc.php'); $file->name("$CFG->{admin_root_path}/../admin/settings.inc.php"); $file->write or return Ace_PPC_Banner->error("Unable to extract file: '$CFG->{admin_root_path}/../admin/settings.inc.php' ($GT::Tar::error)", 'WARN'); # Copying admin/paypal.php to $CFG->{admin_root_path}/.. directory. $file = $tar->get_file ('admin/paypal.php'); $file->name("$CFG->{admin_root_path}/../admin/paypal.php"); $file->write or return Ace_PPC_Banner->error("Unable to extract file: '$CFG->{admin_root_path}/../admin/paypal.php' ($GT::Tar::error)", 'WARN'); # Copying admin/install.php to $CFG->{admin_root_path}/.. directory. $file = $tar->get_file ('admin/install.php'); $file->name("$CFG->{admin_root_path}/../admin/install.php"); $file->write or return Ace_PPC_Banner->error("Unable to extract file: '$CFG->{admin_root_path}/../admin/install.php' ($GT::Tar::error)", 'WARN'); # Copying admin/advertiser.php to $CFG->{admin_root_path}/.. directory. $file = $tar->get_file ('admin/advertiser.php'); $file->name("$CFG->{admin_root_path}/../admin/advertiser.php"); $file->write or return Ace_PPC_Banner->error("Unable to extract file: '$CFG->{admin_root_path}/../admin/advertiser.php' ($GT::Tar::error)", 'WARN'); # Copying admin/admin.php to $CFG->{admin_root_path}/.. directory. $file = $tar->get_file ('admin/admin.php'); $file->name("$CFG->{admin_root_path}/../admin/admin.php"); $file->write or return Ace_PPC_Banner->error("Unable to extract file: '$CFG->{admin_root_path}/../admin/admin.php' ($GT::Tar::error)", 'WARN'); 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::Ace_PPC_Banner::error # my $mgr = shift; $mgr->uninstall_menu ( 'Ace_PPC_Banner', [ ['Admin Panel', 'admin.php'] ] ); return "The plugin has been successfully removed!"; } 1;