function pay_settings()
 {
     $this->output->admin();
     $f = $this->input->f;
     // Set the default to be PayPal
     if (!$this->default[adrevenue][payment_module]) {
         $this->default[adrevenue][payment_module] = "paypal";
     }
     $mod = "pay." . $this->default[adrevenue][payment_module] . ".php";
     include_once $mod;
     $opt = payment::mod_vars();
     $info = payment::mod_info();
     if (count($f) > 0) {
         reset($f);
         while (list($key, $val) = each($f)) {
             $this->save($key, $val);
         }
         $this->output->redirect("The payment settings were updated", "index.php?section=settings&action=pay_settings", 1);
         exit;
     }
     // Show the form
     $form = new formgen();
     $form->comment("<b>" . lib_lang("Enter the settings for your {$info['name']} payment module") . "</b><br>&nbsp;");
     if ($info[extern] == TRUE) {
         $form->comment(lib_lang($info[extern_description]) . ": <font color=red>" . $this->default[adrevenue][hostname] . "ipn.php<p>" . "</font>");
     }
     foreach ($opt as $rec) {
         $name = $rec[name];
         $v = $this->db->getsql("SELECT value FROM adrev_settings WHERE name=?", array($name));
         $form->input(lib_lang($rec[label]), "f[{$name}]", stripslashes($v[0][value]), $rec[length]);
     }
     $form->hidden("submit", "1");
     $this->title = lib_lang("Edit {$info['name']} Payment Settings");
     $this->content = $form->generate("post", lib_lang("Save Payment Settings"));
     $this->display();
     $this->printpage();
     exit;
 }