simpler database and session.
[platal.git] / classes / Platal.php
index 43cf776..c34d34d 100644 (file)
@@ -34,14 +34,14 @@ class Platal
     function Platal()
     {
         $modules    = func_get_args();
-        $this->path = trim(Get::_get('p', null), '/');
+        $this->path = trim(Get::_get('n', null), '/');
 
         $this->__mods  = array();
         $this->__hooks = array();
 
         array_unshift($modules, 'core');
         foreach ($modules as $module) {
-            $this->__mods[$module] = $m = PLModule::factory($this, $module);
+            $this->__mods[$module] = $m = PLModule::factory($module);
             $this->__hooks += $m->handlers();
         }
     }
@@ -112,10 +112,10 @@ class Platal
     {
         if (S::logged() and !$new_name) {
             $page->changeTpl('password_prompt_logged.tpl');
-            $page->addJsLink('javascript/do_challenge_response_logged.js');
+            $page->addJsLink('do_challenge_response_logged.js');
         } else {
             $page->changeTpl('password_prompt.tpl');
-            $page->addJsLink('javascript/do_challenge_response.js');
+            $page->addJsLink('do_challenge_response.js');
        }
         $page->run();
     }
@@ -142,6 +142,16 @@ class Platal
         $page->assign_by_ref('platal', $this);
         $page->run();
     }
+
+    function on_subscribe($forlife, $uid, $promo, $pass)
+    {
+        $args = func_get_args();
+        foreach ($this->__mods as $mod) {
+            if (!is_callable($mod, 'on_subscribe'))
+                continue;
+            call_user_func_array(array($mod, 'on_subscribe'), $args);
+        }
+    }
 }
 
 ?>