From: x2000habouzit Date: Sun, 23 Jul 2006 12:19:05 +0000 (+0000) Subject: move banana things into the banana module. X-Git-Tag: xorg/0.9.11~321 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;ds=sidebyside;h=57e834acf593ac435793ce7e50b472535e724148;p=platal.git move banana things into the banana module. git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@584 839d8a87-29fc-0310-9880-83ba4fa771e5 --- diff --git a/bin/banana.spoolgen.php b/bin/banana.spoolgen.php index 16f2004..6cf1ce0 100755 --- a/bin/banana.spoolgen.php +++ b/bin/banana.spoolgen.php @@ -8,8 +8,8 @@ * Copyright: See COPYING files that comes with this distribution ********************************************************************************/ -require_once('connect.db.inc.php'); -require_once('banana/banana.inc.php'); +require_once 'connect.db.inc.php'; +require_once dirname(__FILE__).'/ ../modules/banana/banana.inc.php'; class MyBanana extends Banana { diff --git a/modules/banana.php b/modules/banana.php index eecfc2c..63234c2 100644 --- a/modules/banana.php +++ b/modules/banana.php @@ -116,7 +116,7 @@ class BananaModule extends PLModule $page->addCssLink('css/banana.css'); $page->assign('xorg_title','Polytechnique.org - Forums & PA'); - require_once('banana.inc.php'); + require_once dirname(__FILE__).'/banana/banana.inc.php'; $res = PlatalBanana::run($params); $page->assign_by_ref('banana', $banana); diff --git a/include/banana.inc.php b/modules/banana/banana.inc.php similarity index 99% rename from include/banana.inc.php rename to modules/banana/banana.inc.php index 6fc4052..f897c40 100644 --- a/include/banana.inc.php +++ b/modules/banana/banana.inc.php @@ -19,7 +19,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ***************************************************************************/ -require_once('banana/banana.inc.php'); +require_once 'banana/banana.inc.php'; function hook_formatDisplayHeader($_header, $_text) { global $banana; @@ -68,7 +68,7 @@ function hook_makeLink($params) { } return $base . '/' . $params['artid']; } - + if ($params['action'] == 'new') { return $base . '/new'; } @@ -85,7 +85,7 @@ function hook_makeImg($img, $alt, $height, $width) if (!is_null($height)) { $height = ' height="' . $height . '"'; } - + return '' . $alt . ''; } @@ -131,7 +131,7 @@ class PlatalBanana extends Banana $this->profile['display'] = $disp; $this->profile['autoup'] = $maj; $this->profile['lastnews'] = S::v('banana_last'); - + if ($maj) { XDB::execute("UPDATE auth_user_quick SET banana_last={?} WHERE user_id={?}", gmdate("YmdHis"), $uid); } @@ -174,7 +174,7 @@ class PlatalBanana extends Banana if (!count($_POST['subscribe'])) { return true; } - + $req = XDB::iterRow("SELECT fid,nom FROM {$globals->banana->table_prefix}list"); $fids = array(); while (list($fid,$fnom) = $req->next()) {